From e11193097847280992b107af5e8b7dbeffcf8d4b Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Tue, 2 May 2000 12:10:27 +0000 Subject: [PATCH] added register functions --- src/registry/Makefile | 4 +++- src/registry/registryDeviceSupport.c | 2 +- src/registry/registryDriverSupport.c | 2 +- src/registry/registryFunction.c | 32 ++++++++++++++++++++++++++++ src/registry/registryFunction.h | 23 ++++++++++++++++++++ src/registry/registryRecordType.c | 2 +- 6 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 src/registry/registryFunction.c create mode 100644 src/registry/registryFunction.h diff --git a/src/registry/Makefile b/src/registry/Makefile index d820395ff..7c8171d35 100644 --- a/src/registry/Makefile +++ b/src/registry/Makefile @@ -5,9 +5,10 @@ include $(TOP)/configure/CONFIG # INC += registry.h +INC += registryRecordType.h INC += registryDeviceSupport.h INC += registryDriverSupport.h -INC += registryRecordType.h +INC += registryFunction.h # general contents of library on all platforms @@ -23,6 +24,7 @@ LIBSRCS += registry.c LIBSRCS += registryRecordType.c LIBSRCS += registryDeviceSupport.c LIBSRCS += registryDriverSupport.c +LIBSRCS += registryFunction.c LIBRARY_IOC = registryIoc registryIoc_DLL_LIBS = Com diff --git a/src/registry/registryDeviceSupport.c b/src/registry/registryDeviceSupport.c index 9f1ff6018..a98e8302f 100644 --- a/src/registry/registryDeviceSupport.c +++ b/src/registry/registryDeviceSupport.c @@ -13,9 +13,9 @@ of this distribution. #include "dbBase.h" #include "devSup.h" +#include "registry.h" #define epicsExportSharedSymbols #include "registryDeviceSupport.h" -#include "registry.h" const char *deviceSupport = "device support"; static void *registryID = (void *)&deviceSupport; diff --git a/src/registry/registryDriverSupport.c b/src/registry/registryDriverSupport.c index 140e53f43..8bd4916ef 100644 --- a/src/registry/registryDriverSupport.c +++ b/src/registry/registryDriverSupport.c @@ -13,9 +13,9 @@ of this distribution. #include "dbBase.h" #include "drvSup.h" +#include "registry.h" #define epicsExportSharedSymbols #include "registryDriverSupport.h" -#include "registry.h" const char *driverSupport = "driver support"; static void *registryID = (void *)&driverSupport; diff --git a/src/registry/registryFunction.c b/src/registry/registryFunction.c new file mode 100644 index 000000000..83d15267f --- /dev/null +++ b/src/registry/registryFunction.c @@ -0,0 +1,32 @@ +/* registryFunction.c */ + +/* Author: Marty Kraimer Date: 01MAY2000 */ + +/********************COPYRIGHT NOTIFICATION********************************** +This software was developed under a United States Government license +described on the COPYRIGHT_UniversityOfChicago file included as part +of this distribution. +****************************************************************************/ +#include +#include +#include +#include "registry.h" + +#define epicsExportSharedSymbols +#include "registryFunction.h" + +const char *function = "function"; +static void *registryID = (void *)&function; + + +epicsShareFunc int epicsShareAPI registryFunctionAdd( + const char *name,REGISTRYFUNCTION func) +{ + return(registryAdd(registryID,name,(void *)func)); +} + +epicsShareFunc REGISTRYFUNCTION epicsShareAPI registryFunctionFind( + const char *name) +{ + return((REGISTRYFUNCTION)registryFind(registryID,name)); +} diff --git a/src/registry/registryFunction.h b/src/registry/registryFunction.h new file mode 100644 index 000000000..1b599fd46 --- /dev/null +++ b/src/registry/registryFunction.h @@ -0,0 +1,23 @@ +#ifndef INCregistryFunctionh +#define INCregistryFunctionh + +#include "shareLib.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void (*REGISTRYFUNCTION)(void); + +/* c interface definitions */ +epicsShareFunc int epicsShareAPI registryFunctionAdd( + const char *name,REGISTRYFUNCTION func); +epicsShareFunc REGISTRYFUNCTION epicsShareAPI registryFunctionFind( + const char *name); + +#ifdef __cplusplus +} +#endif + + +#endif /* INCregistryFunctionh */ diff --git a/src/registry/registryRecordType.c b/src/registry/registryRecordType.c index 657a65222..b3214d577 100644 --- a/src/registry/registryRecordType.c +++ b/src/registry/registryRecordType.c @@ -12,9 +12,9 @@ of this distribution. #include #include "dbBase.h" +#include "registry.h" #define epicsExportSharedSymbols #include "registryRecordType.h" -#include "registry.h" const char *recordType = "record type"; static void *registryID = (void *)&recordType;