summaryrefslogtreecommitdiffstats
path: root/pcilib/view.h
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-10-18 07:36:47 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-10-18 07:36:47 +0200
commitfa54d4c2ca8ffcece7a9c6e9c784e2150cbed78b (patch)
tree80f82fdbeaf8d2f94c5a1a48ea28a5e452b561f5 /pcilib/view.h
parent6a4a556b15bda7e0c737f247c8282c1b3a9d1e0d (diff)
downloadpcitool-fa54d4c2ca8ffcece7a9c6e9c784e2150cbed78b.tar.gz
pcitool-fa54d4c2ca8ffcece7a9c6e9c784e2150cbed78b.tar.bz2
pcitool-fa54d4c2ca8ffcece7a9c6e9c784e2150cbed78b.tar.xz
pcitool-fa54d4c2ca8ffcece7a9c6e9c784e2150cbed78b.zip
Support reading/writting register views by id
Diffstat (limited to 'pcilib/view.h')
-rw-r--r--pcilib/view.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/pcilib/view.h b/pcilib/view.h
index 606a688..ec775b7 100644
--- a/pcilib/view.h
+++ b/pcilib/view.h
@@ -38,6 +38,7 @@ struct pcilib_view_description_s {
struct pcilib_view_context_s {
const char *name;
pcilib_view_t view;
+ pcilib_xml_node_t *xml;
UT_hash_handle hh;
};
@@ -58,6 +59,19 @@ extern "C" {
int pcilib_add_views(pcilib_t *ctx, size_t n, const pcilib_view_description_t *desc);
/**
+ * Use this function to add new view definitions into the model. It is error to re-register
+ * already registered view. The function will copy the context of unit description, but name,
+ * transform, and other strings in the structure are considered to have static duration
+ * and will not be copied. On error no new views are initalized.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] n - number of views to initialize. It is OK to pass 0 if protocols variable is NULL terminated (last member of protocols array have all members set to 0)
+ * @param[in] desc - view descriptions
+ * @param[out] refs - fills allocated view contexts. On error context is undefined.
+ * @return - error or 0 on success
+ */
+int pcilib_add_views_custom(pcilib_t *ctx, size_t n, const pcilib_view_description_t *desc, pcilib_view_context_t **refs);
+
+/**
* Destroys data associated with views. This is an internal function and will
* be called during clean-up.
* @param[in,out] ctx - pcilib context