summaryrefslogtreecommitdiffstats
path: root/pcilib.h
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-04-14 17:06:12 +0200
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-04-14 17:06:12 +0200
commita178ae6180e4844e89f6e040cbf040fed5f4df6a (patch)
tree016ec939606350b55f283a334e93c437ceb54aaa /pcilib.h
parentd7143e0f1ff45449f5e69adc1a42c72eddf642d8 (diff)
downloadpcitool-a178ae6180e4844e89f6e040cbf040fed5f4df6a.tar.gz
pcitool-a178ae6180e4844e89f6e040cbf040fed5f4df6a.tar.bz2
pcitool-a178ae6180e4844e89f6e040cbf040fed5f4df6a.tar.xz
pcitool-a178ae6180e4844e89f6e040cbf040fed5f4df6a.zip
Introduce pcilib_context_t type instead pointer to void
Diffstat (limited to 'pcilib.h')
-rw-r--r--pcilib.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/pcilib.h b/pcilib.h
index 9729aa1..f427b59 100644
--- a/pcilib.h
+++ b/pcilib.h
@@ -17,6 +17,7 @@ struct timespec {
#define pcilib_datacpy pcilib_datacpy32
typedef struct pcilib_s pcilib_t;
+typedef void pcilib_context_t;
typedef uint8_t pcilib_bar_t; /**< Type holding the PCI Bar number */
typedef uint8_t pcilib_register_t; /**< Type holding the register ID within the Bank */
@@ -125,18 +126,18 @@ typedef struct {
typedef int (*pcilib_callback_t)(pcilib_event_t event, pcilib_event_id_t event_id, void *user);
typedef struct {
- void *(*init)(pcilib_t *ctx);
- void (*free)(void *ctx);
+ pcilib_context_t *(*init)(pcilib_t *ctx);
+ void (*free)(pcilib_context_t *ctx);
- int (*reset)(void *ctx);
+ int (*reset)(pcilib_context_t *ctx);
- int (*start)(void *ctx, pcilib_event_t event_mask, pcilib_callback_t callback, void *user);
- int (*stop)(void *ctx);
- int (*trigger)(void *ctx, pcilib_event_t event, size_t trigger_size, void *trigger_data);
+ int (*start)(pcilib_context_t *ctx, pcilib_event_t event_mask, pcilib_callback_t callback, void *user);
+ int (*stop)(pcilib_context_t *ctx);
+ int (*trigger)(pcilib_context_t *ctx, pcilib_event_t event, size_t trigger_size, void *trigger_data);
- pcilib_event_id_t (*next_event)(void *ctx, pcilib_event_t event_mask, const struct timespec *timeout);
- void* (*get_data)(void *ctx, pcilib_event_id_t event_id, pcilib_event_data_type_t data_type, size_t arg_size, void *arg, size_t *size);
- int (*return_data)(void *ctx, pcilib_event_id_t event_id);
+ pcilib_event_id_t (*next_event)(pcilib_context_t *ctx, pcilib_event_t event_mask, const struct timespec *timeout);
+ void* (*get_data)(pcilib_context_t *ctx, pcilib_event_id_t event_id, pcilib_event_data_type_t data_type, size_t arg_size, void *arg, size_t *size);
+ int (*return_data)(pcilib_context_t *ctx, pcilib_event_id_t event_id);
} pcilib_event_api_description_t;
typedef struct {
@@ -158,7 +159,7 @@ extern pcilib_model_description_t pcilib_model[];
int pcilib_set_error_handler(void (*err)(const char *msg, ...), void (*warn)(const char *msg, ...));
pcilib_model_t pcilib_get_model(pcilib_t *ctx);
-void *pcilib_get_implementation_context(pcilib_t *ctx);
+pcilib_context_t *pcilib_get_implementation_context(pcilib_t *ctx);
pcilib_t *pcilib_open(const char *device, pcilib_model_t model);
void pcilib_close(pcilib_t *ctx);