summaryrefslogtreecommitdiffstats
path: root/pcilib/views.h
diff options
context:
space:
mode:
authornicolas.zilio@hotmail.fr <>2015-09-15 12:07:04 +0200
committernicolas.zilio@hotmail.fr <>2015-09-15 12:07:04 +0200
commit33db9c07bd08fae74c145c547f1b0e9f55ab25ae (patch)
tree7121279d8ebe972374cae6238096f0f8008be1d5 /pcilib/views.h
parent6c47064466d8484813741f347e41af1d4ac90f85 (diff)
downloadpcitool-33db9c07bd08fae74c145c547f1b0e9f55ab25ae.tar.gz
pcitool-33db9c07bd08fae74c145c547f1b0e9f55ab25ae.tar.bz2
pcitool-33db9c07bd08fae74c145c547f1b0e9f55ab25ae.tar.xz
pcitool-33db9c07bd08fae74c145c547f1b0e9f55ab25ae.zip
merge views and units, some name homogeneisation
Diffstat (limited to 'pcilib/views.h')
-rw-r--r--pcilib/views.h35
1 files changed, 32 insertions, 3 deletions
diff --git a/pcilib/views.h b/pcilib/views.h
index ae92d0d..c44393d 100644
--- a/pcilib/views.h
+++ b/pcilib/views.h
@@ -2,9 +2,14 @@
#define _PCILIB_VIEWS_H
#include "pcilib.h"
-#include "unit.h"
-typedef struct pcilib_view_enum_s pcilib_view_enum_t;
+#define PCILIB_MAX_TRANSFORMS_PER_UNIT 16
+
+typedef struct pcilib_transform_unit_s pcilib_transform_unit_t;
+
+typedef struct pcilib_unit_s pcilib_unit_t;
+
+typedef struct pcilib_enum_s pcilib_enum_t;
typedef struct pcilib_view_s pcilib_view_t;
@@ -13,9 +18,25 @@ typedef struct pcilib_formula_s pcilib_formula_t;
typedef int (*pcilib_view_operation_t)(pcilib_t *ctx, void *params, char* string, int read_or_write, pcilib_register_value_t *regval, size_t viewval_size, void* viewval);
/**
+ * type to save a transformation unit in the pcitool program
+ */
+struct pcilib_transform_unit_s{
+ char *name;
+ char *transform_formula;
+};
+
+/**
+ * type to save a unit in the pcitool programm
+ */
+struct pcilib_unit_s{
+ char* name;
+ pcilib_transform_unit_t transforms[PCILIB_MAX_TRANSFORMS_PER_UNIT];
+};
+
+/**
* new type to define an enum view
*/
-struct pcilib_view_enum_s {
+struct pcilib_enum_s {
const char *name; /**<corresponding string to value*/
pcilib_register_value_t value, min, max;
};
@@ -49,4 +70,12 @@ int operation_formula(pcilib_t *ctx, void *params, char* unit, int view2reg, pci
int pcilib_add_views(pcilib_t *ctx, size_t n, const pcilib_view_t* views);
+
+/**
+ * function to populate the ctx with units
+ */
+int pcilib_add_units(pcilib_t* ctx, size_t n, const pcilib_unit_t* units);
+
+
+
#endif