From 800b45a28bd80ae0caecfcee58618a56a1b97066 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Wed, 22 Mar 2000 16:49:58 +0000 Subject: [PATCH] separate pvAdapter definitions from cadef --- src/ca/Makefile | 1 + src/ca/cadef.h | 34 +-------------------------- src/ca/pvAdapter.h | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 33 deletions(-) create mode 100644 src/ca/pvAdapter.h diff --git a/src/ca/Makefile b/src/ca/Makefile index 22c370a1e..6298d84b8 100644 --- a/src/ca/Makefile +++ b/src/ca/Makefile @@ -13,6 +13,7 @@ INC += caerr.h INC += caeventmask.h INC += caProto.h INC += db_access.h +INC += pvAdapter.h #LIBSRCS += caOsDependent.c LIBSRCS += access.cpp diff --git a/src/ca/cadef.h b/src/ca/cadef.h index ec2e47bc7..296719677 100644 --- a/src/ca/cadef.h +++ b/src/ca/cadef.h @@ -43,6 +43,7 @@ #include "caerr.h" #include "db_access.h" #include "caeventmask.h" +#include "pvAdapter.h" #ifdef __cplusplus extern "C" { @@ -924,39 +925,6 @@ epicsShareFunc int epicsShareAPI ca_replace_printf_handler ( epicsShareFunc unsigned epicsShareAPI ca_get_ioc_connection_count (void); epicsShareFunc unsigned epicsShareAPI ca_search_attempts (chid chan); -/* - * Warning - this is an temporary CA client API - * which will probably vanish in the future. - */ -typedef void * pvId; -typedef void * putNotifyId; -struct db_field_log; -struct putNotify; -typedef struct pvAdapter { - pvId (*p_pvNameToId) (const char *pname); - int (*p_pvPutField) (pvId, int src_type, - const void *psrc, int no_elements); - int (*p_pvGetField) (pvId, int dest_type, - void *pdest, int no_elements, void *pfl); - long (*p_pvPutNotifyInitiate) (pvId, unsigned type, unsigned long count, - const void *pValue, void (*callback)(void *), void *usrPvt, putNotifyId * pID); - void (*p_pvPutNotifyDestroy) (putNotifyId); - const char * (*p_pvName) (pvId); - unsigned long (*p_pvNoElements) (pvId); - short (*p_pvType) (pvId); - void * (*p_pvEventQueueInit) (void); - int (*p_pvEventQueueStart) (void *, const char *taskname, - void (*init_func)(void *), void *init_func_arg, int priority_offset); - void (*p_pvEventQueueClose) (void *); - int (*p_pvEventQueuePostSingleEvent) (void *es); - void * (*p_pvEventQueueAddEvent) (void *ctx, pvId id, - void (*user_sub)(void *usrArg, pvId id, int eventsRemaining, struct db_field_log *), - void *user_arg, unsigned select); - void (*p_pvEventQueueCancelEvent) (void *es); - int (*p_pvEventQueueAddExtraLaborEvent) (void *, void (*func)(void *), void *arg); - int (*p_pvEventQueuePostExtraLabor) (void *ctx); -} pvAdapter; -epicsShareFunc void * epicsShareAPI ca_create_context (pvAdapter *pAdapter); /* * used when an auxillary thread needs to join a CA client context started diff --git a/src/ca/pvAdapter.h b/src/ca/pvAdapter.h new file mode 100644 index 000000000..fbdb94335 --- /dev/null +++ b/src/ca/pvAdapter.h @@ -0,0 +1,57 @@ +/* pvAdapter.h */ +/* broken out of cadef.h so that new database access can include it*/ +#ifndef INCLpvAdapterh +#define INCLpvAdapterh + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Warning - this is an temporary CA client API + * which will probably vanish in the future. + */ +typedef void * pvId; +typedef void * putNotifyId; +struct db_field_log; +struct putNotify; +typedef void (*putNotifyCallback)(void *); +typedef void (*eventQueueInit)(void *); +typedef void (*eventQueueEventUser) + (void *usrArg, pvId id, int eventsRemaining, struct db_field_log *); +typedef void (*eventQueueExtraLaborUser)(void *); +typedef struct pvAdapter { + pvId (*p_pvNameToId) (const char *pname); + int (*p_pvPutField) (pvId, int src_type, + const void *psrc, int no_elements); + int (*p_pvGetField) (pvId, int dest_type, + void *pdest, int no_elements, void *pfl); + long (*p_pvPutNotifyInitiate) (pvId, unsigned type, unsigned long count, + const void *pValue, putNotifyCallback, void *usrPvt, putNotifyId * pID); + void (*p_pvPutNotifyDestroy) (putNotifyId); + const char * (*p_pvName) (pvId); + unsigned long (*p_pvNoElements) (pvId); + short (*p_pvType) (pvId); + void * (*p_pvEventQueueInit) (void); + int (*p_pvEventQueueStart) (void *, const char *taskname, + eventQueueInit, void *init_func_arg, int priority_offset); + void (*p_pvEventQueueClose) (void *); + int (*p_pvEventQueuePostSingleEvent) (void *es); + void * (*p_pvEventQueueAddEvent) (void *ctx, pvId id, + eventQueueEventUser, void *user_arg, unsigned select); + void (*p_pvEventQueueCancelEvent) (void *es); + int (*p_pvEventQueueAddExtraLaborEvent) (void *, + eventQueueExtraLaborUser, void *arg); + int (*p_pvEventQueuePostExtraLabor) (void *ctx); +} pvAdapter; + +epicsShareFunc void * epicsShareAPI ca_create_context (pvAdapter *pAdapter); + +#ifdef __cplusplus +} +#endif + +/* + * no additions below this endif + */ +#endif /* INCLpvAdapterh */