changed name

This commit is contained in:
Marty Kraimer
2000-05-25 19:18:00 +00:00
parent 900f32c792
commit ecb63cc5c4
5 changed files with 94 additions and 3 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ INC += dbBkptRegister.h
INC += dbCaTestRegister.h
INC += caTestRegister.h
INC += dbAccessRegister.h
INC += ioccrfRegister.h
INC += ioccrfRegisterCommon.h
INC += asTestRegister.h
INC += envRegister.h
INC += registerRecordDeviceDriverRegister.h
@@ -34,7 +34,7 @@ LIBSRCS += dbBkptRegister.c
LIBSRCS += dbCaTestRegister.c
LIBSRCS += caTestRegister.c
LIBSRCS += dbAccessRegister.c
LIBSRCS += ioccrfRegister.c
LIBSRCS += ioccrfRegisterCommon.c
LIBSRCS += asTestRegister.c
LIBSRCS += envRegister.c
LIBSRCS += iocUtil.c
+22 -1
View File
@@ -32,8 +32,11 @@ typedef struct argvalue {
typedef struct ioccrfFunc {
ioccrfFuncDef *pioccrfFuncDef;
ioccrfCallFunc func;
struct ioccrfFunc *pprev;
} ioccrfFunc;
static ioccrfFunc *pioccrfFuncHead = 0;
static char ioccrfID[] = "ioccrf";
#ifdef IOCSH_USE_READLINE
@@ -60,12 +63,28 @@ void epicsShareAPI ioccrfRegister (ioccrfFuncDef *pioccrfFuncDef, ioccrfCallFunc
ioccrfFunc *pioccrfFunc;
pioccrfFunc = callocMustSucceed (1, sizeof(ioccrfFunc), "ioccrfRegister");
pioccrfFunc->pprev = pioccrfFuncHead;
/* keep list of allocated ioccrfFunc so they can be freed*/
pioccrfFuncHead = pioccrfFunc;
pioccrfFunc->pioccrfFuncDef = pioccrfFuncDef;
pioccrfFunc->func = func;
if (!registryAdd(ioccrfID, pioccrfFuncDef->name, (void *)pioccrfFunc))
errlogPrintf ("ioccrfRegister failed to add %s\n", pioccrfFuncDef->name);
}
/* free storage created by ioccrfRegister */
void epicsShareAPI ioccrfFree(void)
{
ioccrfFunc *pioccrfFunc = pioccrfFuncHead;
pioccrfFuncHead = 0;
while(pioccrfFunc) {
ioccrfFunc *pprev = pioccrfFunc->pprev;
free(pioccrfFunc);
pioccrfFunc = pprev;
}
}
/*
* Read a line of input
*/
@@ -352,7 +371,9 @@ ioccrf (const char *pathname)
/*
* Look up command
*/
pioccrfFunc = (ioccrfFunc *)registryFind (ioccrfID, argv[0]);
pioccrfFunc = 0;
if(pioccrfFuncHead)
pioccrfFunc = (ioccrfFunc *)registryFind (ioccrfID, argv[0]);
if (!pioccrfFunc) {
showError (filename, lineno, "Command %s not found.", argv[0]);
continue;
+3
View File
@@ -41,6 +41,9 @@ typedef void (*ioccrfCallFunc)(ioccrfArg **argList);
epicsShareFunc void epicsShareAPI ioccrfRegister(
ioccrfFuncDef *pioccrfFuncDef,ioccrfCallFunc func);
/* ioccrfFree frees storage used by ioccrfRegister*/
/* This should only be called when ioccrf is no longer needed*/
epicsShareFunc void epicsShareAPI ioccrfFree(void);
epicsShareFunc int epicsShareAPI ioccrf(const char *pathname);
+41
View File
@@ -0,0 +1,41 @@
/* ioccrfRegisterCommon.c */
/* Author: Marty Kraimer Date: 26APR2000 */
/********************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 <stddef.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#define epicsExportSharedSymbols
#include "dbStaticRegister.h"
#include "iocUtilRegister.h"
#include "dbTestRegister.h"
#include "dbBkptRegister.h"
#include "dbCaTestRegister.h"
#include "caTestRegister.h"
#include "dbAccessRegister.h"
#include "asTestRegister.h"
#include "envRegister.h"
#include "ioccrfRegisterCommon.h"
#include "osiRegister.h"
#include "ioccrf.h"
void epicsShareAPI ioccrfRegisterCommon(void)
{
osiRegister();
iocUtilRegister();
dbStaticRegister();
dbTestRegister();
dbBkptRegister();
dbCaTestRegister();
caTestRegister();
dbAccessRegister();
asTestRegister();
envRegister();
}
+26
View File
@@ -0,0 +1,26 @@
/* ioccrfRegisterCommon.h */
/* Author: Marty Kraimer Date: 27APR2000 */
/********************COPYRIGHT NOTIFICATION**********************************
This software was developed under a United States Government license
described on the COPYRIGHT_UniversityOfChicago file included as part
of this distribution.
****************************************************************************/
#ifndef INCioccrfRegisterCommonH
#define INCioccrfRegisterCommonH
#include "shareLib.h"
#ifdef __cplusplus
extern "C" {
#endif
/* register many useful commands */
epicsShareFunc void epicsShareAPI ioccrfRegisterCommon(void);
#ifdef __cplusplus
}
#endif
#endif /*INCioccrfRegisterCommonH*/