summaryrefslogtreecommitdiffstats
path: root/pcilib/view.h
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-10-09 04:42:53 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-10-09 04:42:53 +0200
commitf13867f64fcba24ef2cb9d726b5ee1082ac1a8b9 (patch)
treed7186eb2a2c2d2e36c05cc702eb0ab0b3c877443 /pcilib/view.h
parent3b8e32c9bbe0d909c34303da0ad36ef0ef5be852 (diff)
downloadpcitool-f13867f64fcba24ef2cb9d726b5ee1082ac1a8b9.tar.gz
pcitool-f13867f64fcba24ef2cb9d726b5ee1082ac1a8b9.tar.bz2
pcitool-f13867f64fcba24ef2cb9d726b5ee1082ac1a8b9.tar.xz
pcitool-f13867f64fcba24ef2cb9d726b5ee1082ac1a8b9.zip
Implement enum view
Diffstat (limited to 'pcilib/view.h')
-rw-r--r--pcilib/view.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/pcilib/view.h b/pcilib/view.h
index 4af4c00..9d3d32d 100644
--- a/pcilib/view.h
+++ b/pcilib/view.h
@@ -1,6 +1,8 @@
#ifndef _PCILIB_VIEW_H
#define _PCILIB_VIEW_H
+#include <uthash.h>
+
#include <pcilib.h>
#include <pcilib/unit.h>
@@ -19,7 +21,7 @@ typedef struct {
pcilib_view_context_t *(*init)(pcilib_t *ctx);
void (*free)(pcilib_t *ctx, pcilib_view_context_t *view);
void (*free_description)(pcilib_t *ctx, pcilib_view_description_t *view);
- int (*read_from_reg)(pcilib_t *ctx, pcilib_view_context_t *view, const pcilib_register_value_t *regval, pcilib_value_t *val);
+ int (*read_from_reg)(pcilib_t *ctx, pcilib_view_context_t *view, pcilib_register_value_t regval, pcilib_value_t *val);
int (*write_to_reg)(pcilib_t *ctx, pcilib_view_context_t *view, pcilib_register_value_t *regval, const pcilib_value_t *val);
} pcilib_view_api_description_t;
@@ -32,6 +34,12 @@ struct pcilib_view_description_s {
const char *description; /**< Short description */
};
+struct pcilib_view_context_s {
+ const char *name;
+ pcilib_view_t view;
+ UT_hash_handle hh;
+};
+
#ifdef __cplusplus
extern "C" {
#endif