Merge branch '7.0' release 7.4.0.1 into PSI-7.0

Conflicts:
	.gitmodules
	modules/database/src/ioc/db/Makefile
	modules/libcom/test/epicsAtomicTest.cpp
	modules/pvAccess
	modules/pvData
	modules/pvDatabase
	modules/pva2pva
This commit is contained in:
2020-06-02 14:55:30 +02:00
868 changed files with 33281 additions and 27367 deletions

View File

@@ -15,4 +15,4 @@ DIRS += src
DIRS += test
test_DEPEND_DIRS = src
include $(TOP)/configure/RULES_TOP
include $(TOP)/configure/RULES_DIRS

View File

@@ -11,19 +11,28 @@ TOP = ../../../..
include $(TOP)/configure/CONFIG
USR_CPPFLAGS += -DUSE_TYPED_RSET
USR_CPPFLAGS += -DUSE_TYPED_RSET -DUSE_TYPED_DSET
SHRLIB_VERSION = 3.17.0
# Shared library ABI version.
SHRLIB_VERSION = $(EPICS_DATABASE_MAJOR_VERSION).$(EPICS_DATABASE_MINOR_VERSION).$(EPICS_DATABASE_MAINTENANCE_VERSION)
API_HEADER = dbCoreAPI.h
dbCore_API = dbCore
LIBRARY_IOC += dbCore
dbCore_LIBS += ca Com
dbCore_SYS_LIBS_WIN32 += ws2_32
dbCore_RCS += dbCore.rc
dbStaticHost_RCS = dbStaticHost.rc
EXPAND_COMMON += databaseVersion.h@
EXPAND_ME += EPICS_DATABASE_MAJOR_VERSION
EXPAND_ME += EPICS_DATABASE_MINOR_VERSION
EXPAND_ME += EPICS_DATABASE_MAINTENANCE_VERSION
EXPAND_ME += EPICS_DATABASE_DEVELOPMENT_FLAG
INC += databaseVersion.h
INC += databaseVersionNum.h
PROD_LIBS = Com
@@ -39,13 +48,6 @@ include $(IOCDIR)/rsrv/Makefile
GENVERSION = epicsVCS.h
GENVERSIONMACRO = EPICS_VCS_VERSION
EXPANDVARS += EPICS_DATABASE_MAJOR_VERSION
EXPANDVARS += EPICS_DATABASE_MINOR_VERSION
EXPANDVARS += EPICS_DATABASE_MAINTENANCE_VERSION
EXPANDVARS += EPICS_DATABASE_DEVELOPMENT_FLAG
EXPANDFLAGS += $(foreach var,$(EXPANDVARS),-D$(var)="$(strip $($(var)))")
include $(TOP)/configure/RULES
include $(IOCDIR)/dbStatic/RULES
@@ -53,10 +55,4 @@ include $(IOCDIR)/bpt/RULES
include $(IOCDIR)/db/RULES
include $(IOCDIR)/dbtemplate/RULES
# Can't use EXPAND as generated headers must appear
# in O.Common, but EXPAND emits rules for O.$(T_A)
../O.Common/databaseVersionNum.h: ../databaseVersionNum.h@
$(MKDIR) $(COMMON_DIR)
$(EXPAND_TOOL) $(EXPANDFLAGS) $($@_EXPANDFLAGS) $< $@
epicsRelease$(DEP): $(COMMON_DIR)/$(GENVERSION)

View File

@@ -5,7 +5,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* Author: Marty Kraimer Date: 10-15-93 */
@@ -43,16 +43,16 @@ epicsExportAddress(int,asCaDebug);
static int firstTime = TRUE;
static epicsThreadId threadid=0;
static int caInitializing=FALSE;
static epicsMutexId asCaTaskLock; /*lock access to task */
static epicsEventId asCaTaskWait; /*Wait for task to respond*/
static epicsEventId asCaTaskAddChannels; /*Tell asCaTask to add channels*/
static epicsEventId asCaTaskClearChannels;/*Tell asCaTask to clear channels*/
static epicsMutexId asCaTaskLock; /*lock access to task */
static epicsEventId asCaTaskWait; /*Wait for task to respond*/
static epicsEventId asCaTaskAddChannels; /*Tell asCaTask to add channels*/
static epicsEventId asCaTaskClearChannels; /*Tell asCaTask to clear channels*/
typedef struct {
struct dbr_sts_double rtndata;
chid chid;
chid chid;
} CAPVT;
static void exceptionCallback(struct exception_handler_args args)
{
chid chid = args.chid;
@@ -77,164 +77,158 @@ static void exceptionCallback(struct exception_handler_args args)
writeAccess = (chid ? ca_write_access(chid) : 0);
errlogPrintf("dbCa:exceptionCallback stat \"%s\" channel \"%s\""
" context \"%s\"\n"
" nativeType %s requestType %s"
" nativeCount %ld requestCount %ld %s %s\n",
ca_message(stat),channel,context,
nativeType,requestType,
nativeCount,requestCount,
(readAccess ? "readAccess" : "noReadAccess"),
(writeAccess ? "writeAccess" : "noWriteAccess"));
" context \"%s\"\n"
" nativeType %s requestType %s"
" nativeCount %ld requestCount %ld %s %s\n",
ca_message(stat),channel,context,
nativeType,requestType,
nativeCount,requestCount,
(readAccess ? "readAccess" : "noReadAccess"),
(writeAccess ? "writeAccess" : "noWriteAccess"));
}
/*connectCallback only handles disconnects*/
static void connectCallback(struct connection_handler_args arg)
{
chid chid = arg.chid;
ASGINP *pasginp = (ASGINP *)ca_puser(chid);
ASG *pasg = pasginp->pasg;
chid chid = arg.chid;
ASGINP *pasginp = (ASGINP *)ca_puser(chid);
ASG *pasg = pasginp->pasg;
if(ca_state(chid)!=cs_conn) {
if(!(pasg->inpBad & (1<<pasginp->inpIndex))) {
/*was good so lets make it bad*/
pasg->inpBad |= (1<<pasginp->inpIndex);
if(!caInitializing) asComputeAsg(pasg);
if(asCaDebug) printf("as connectCallback disconnect %s\n",
ca_name(chid));
}
if(!(pasg->inpBad & (1<<pasginp->inpIndex))) {
/*was good so lets make it bad*/
pasg->inpBad |= (1<<pasginp->inpIndex);
if(!caInitializing) asComputeAsg(pasg);
if(asCaDebug) printf("as connectCallback disconnect %s\n",
ca_name(chid));
}
}
}
static void eventCallback(struct event_handler_args arg)
{
int caStatus = arg.status;
chid chid = arg.chid;
ASGINP *pasginp = (ASGINP *)arg.usr;
ASG *pasg;
CAPVT *pcapvt;
int caStatus = arg.status;
chid chid = arg.chid;
ASGINP *pasginp = (ASGINP *)arg.usr;
ASG *pasg;
CAPVT *pcapvt;
const struct dbr_sts_double *pdata;
if(caStatus!=ECA_NORMAL) {
if(chid) {
epicsPrintf("asCa: eventCallback error %s channel %s\n",
ca_message(caStatus),ca_name(chid));
} else {
epicsPrintf("asCa: eventCallback error %s chid is null\n",
ca_message(caStatus));
}
return;
if(chid) {
epicsPrintf("asCa: eventCallback error %s channel %s\n",
ca_message(caStatus),ca_name(chid));
} else {
epicsPrintf("asCa: eventCallback error %s chid is null\n",
ca_message(caStatus));
}
return;
}
pasg = pasginp->pasg;
pcapvt = (CAPVT *)pasginp->capvt;
if(chid!=pcapvt->chid) {
epicsPrintf("asCa: eventCallback error pcapvt->chid != arg.chid\n");
return;
epicsPrintf("asCa: eventCallback error pcapvt->chid != arg.chid\n");
return;
}
if(ca_state(chid)!=cs_conn || !ca_read_access(chid)) {
if(!(pasg->inpBad & (1<<pasginp->inpIndex))) {
/*was good so lets make it bad*/
pasg->inpBad |= (1<<pasginp->inpIndex);
if(!caInitializing) asComputeAsg(pasg);
if(asCaDebug) {
printf("as eventCallback %s inpBad ca_state %d"
" ca_read_access %d\n",
ca_name(chid),ca_state(chid),ca_read_access(chid));
}
}
return;
if(!(pasg->inpBad & (1<<pasginp->inpIndex))) {
/*was good so lets make it bad*/
pasg->inpBad |= (1<<pasginp->inpIndex);
if(!caInitializing) asComputeAsg(pasg);
if(asCaDebug) {
printf("as eventCallback %s inpBad ca_state %d"
" ca_read_access %d\n",
ca_name(chid),ca_state(chid),ca_read_access(chid));
}
}
return;
}
pdata = arg.dbr;
pcapvt->rtndata = *pdata; /*structure copy*/
if(pdata->severity==INVALID_ALARM) {
pasg->inpBad |= (1<<pasginp->inpIndex);
if(asCaDebug)
printf("as eventCallback %s inpBad because INVALID_ALARM\n",
ca_name(chid));
if(asCaDebug)
printf("as eventCallback %s inpBad because INVALID_ALARM\n",
ca_name(chid));
} else {
pasg->inpBad &= ~((1<<pasginp->inpIndex));
pasg->pavalue[pasginp->inpIndex] = pdata->value;
if(asCaDebug)
printf("as eventCallback %s inpGood data %f\n",
ca_name(chid),pdata->value);
if(asCaDebug)
printf("as eventCallback %s inpGood data %f\n",
ca_name(chid),pdata->value);
}
pasg->inpChanged |= (1<<pasginp->inpIndex);
if(!caInitializing) asComputeAsg(pasg);
}
static void asCaTask(void)
{
ASG *pasg;
ASGINP *pasginp;
CAPVT *pcapvt;
int status;
ASG *pasg;
ASGINP *pasginp;
CAPVT *pcapvt;
int status;
taskwdInsert(epicsThreadGetIdSelf(),NULL,NULL);
SEVCHK(ca_context_create(ca_enable_preemptive_callback),
"asCaTask calling ca_context_create");
"asCaTask calling ca_context_create");
SEVCHK(ca_add_exception_event(exceptionCallback,NULL),
"ca_add_exception_event");
while(TRUE) {
"ca_add_exception_event");
while(TRUE) {
epicsEventMustWait(asCaTaskAddChannels);
caInitializing = TRUE;
pasg = (ASG *)ellFirst(&pasbase->asgList);
while(pasg) {
pasginp = (ASGINP *)ellFirst(&pasg->inpList);
while(pasginp) {
pasg->inpBad |= (1<<pasginp->inpIndex);
pcapvt = pasginp->capvt = asCalloc(1,sizeof(CAPVT));
/*Note calls connectCallback immediately for local Pvs*/
status = ca_search_and_connect(pasginp->inp,&pcapvt->chid,
connectCallback,pasginp);
if(status!=ECA_NORMAL) {
epicsPrintf("asCa ca_search_and_connect error %s\n",
ca_message(status));
}
/*Note calls eventCallback immediately for local Pvs*/
status = ca_add_event(DBR_STS_DOUBLE,pcapvt->chid,
eventCallback,pasginp,0);
if(status!=ECA_NORMAL) {
epicsPrintf("asCa ca_add_event error %s\n",
ca_message(status));
}
pasginp = (ASGINP *)ellNext((ELLNODE *)pasginp);
}
pasg = (ASG *)ellNext((ELLNODE *)pasg);
}
caInitializing = TRUE;
pasg = (ASG *)ellFirst(&pasbase->asgList);
while(pasg) {
pasginp = (ASGINP *)ellFirst(&pasg->inpList);
while(pasginp) {
pasg->inpBad |= (1<<pasginp->inpIndex);
pcapvt = pasginp->capvt = asCalloc(1,sizeof(CAPVT));
/*Note calls connectCallback immediately for local Pvs*/
status = ca_search_and_connect(pasginp->inp,&pcapvt->chid,
connectCallback,pasginp);
if(status!=ECA_NORMAL) {
epicsPrintf("asCa ca_search_and_connect error %s\n",
ca_message(status));
}
/*Note calls eventCallback immediately for local Pvs*/
status = ca_add_event(DBR_STS_DOUBLE,pcapvt->chid,
eventCallback,pasginp,0);
if(status!=ECA_NORMAL) {
epicsPrintf("asCa ca_add_event error %s\n",
ca_message(status));
}
pasginp = (ASGINP *)ellNext((ELLNODE *)pasginp);
}
pasg = (ASG *)ellNext((ELLNODE *)pasg);
}
SEVCHK(ca_flush_io(),"asCaTask");
caInitializing = FALSE;
asComputeAllAsg();
if(asCaDebug) printf("asCaTask initialized\n");
epicsEventSignal(asCaTaskWait);
caInitializing = FALSE;
asComputeAllAsg();
if(asCaDebug) printf("asCaTask initialized\n");
epicsEventSignal(asCaTaskWait);
epicsEventMustWait(asCaTaskClearChannels);
pasg = (ASG *)ellFirst(&pasbase->asgList);
while(pasg) {
pasginp = (ASGINP *)ellFirst(&pasg->inpList);
while(pasginp) {
pcapvt = (CAPVT *)pasginp->capvt;
status = ca_clear_channel(pcapvt->chid);
if(status!=ECA_NORMAL) {
epicsPrintf("asCa ca_clear_channel error %s\n",
ca_message(status));
}
free(pasginp->capvt);
pasginp->capvt = 0;
pasginp = (ASGINP *)ellNext((ELLNODE *)pasginp);
}
pasg = (ASG *)ellNext((ELLNODE *)pasg);
}
if(asCaDebug) printf("asCaTask has cleared all channels\n");
epicsEventSignal(asCaTaskWait);
pasg = (ASG *)ellFirst(&pasbase->asgList);
while(pasg) {
pasginp = (ASGINP *)ellFirst(&pasg->inpList);
while(pasginp) {
pcapvt = (CAPVT *)pasginp->capvt;
status = ca_clear_channel(pcapvt->chid);
if(status!=ECA_NORMAL) {
epicsPrintf("asCa ca_clear_channel error %s\n",
ca_message(status));
}
free(pasginp->capvt);
pasginp->capvt = 0;
pasginp = (ASGINP *)ellNext((ELLNODE *)pasginp);
}
pasg = (ASG *)ellNext((ELLNODE *)pasg);
}
if(asCaDebug) printf("asCaTask has cleared all channels\n");
epicsEventSignal(asCaTaskWait);
}
}
void asCaStart(void)
{
epicsThreadOpts opts = EPICS_THREAD_OPTS_INIT;
opts.stackSize = epicsThreadGetStackSize(epicsThreadStackBig);
opts.priority = epicsThreadPriorityScanLow - 3;
opts.joinable = 1;
if(asCaDebug) printf("asCaStart called\n");
if(firstTime) {
firstTime = FALSE;
@@ -242,7 +236,10 @@ void asCaStart(void)
asCaTaskWait=epicsEventMustCreate(epicsEventEmpty);
asCaTaskAddChannels=epicsEventMustCreate(epicsEventEmpty);
asCaTaskClearChannels=epicsEventMustCreate(epicsEventEmpty);
threadid = epicsThreadCreateOpt("asCaTask", (EPICSTHREADFUNC)asCaTask, 0, &opts);
threadid = epicsThreadCreate("asCaTask",
(epicsThreadPriorityScanLow - 3),
epicsThreadGetStackSize(epicsThreadStackBig),
(EPICSTHREADFUNC)asCaTask,0);
if(threadid==0) {
errMessage(0,"asCaStart: taskSpawn Failure\n");
}
@@ -263,8 +260,6 @@ void asCaStop(void)
epicsEventMustWait(asCaTaskWait);
if(asCaDebug) printf("asCaStop done\n");
epicsMutexUnlock(asCaTaskLock);
epicsThreadMustJoin(threadid);
threadid = 0;
}
int ascar(int level) { return ascarFP(stdout,level);}
@@ -298,8 +293,8 @@ int ascarFP(FILE *fp,int level)
else if(state==cs_closed) fprintf(fp,"closed");
else fprintf(fp,"unknown");
fprintf(fp," read:%s write:%s",
(ca_read_access(chid) ? "yes" : "no "),
(ca_write_access(chid) ? "yes" : "no "));
(ca_read_access(chid) ? "yes" : "no "),
(ca_write_access(chid) ? "yes" : "no "));
fprintf(fp," %s %s\n", ca_name(chid),ca_host_name(chid));
}
pasginp = (ASGINP *)ellNext((ELLNODE *)pasginp);

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* asCa.h */

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* Author: Marty Kraimer Date: 02-11-94*/
@@ -36,32 +36,32 @@
#include "dbStaticLib.h"
#include "recSup.h"
static char *pacf=NULL;
static char *psubstitutions=NULL;
static epicsThreadId asInitTheadId=0;
static int firstTime = TRUE;
static char *pacf=NULL;
static char *psubstitutions=NULL;
static epicsThreadId asInitTheadId=0;
static int firstTime = TRUE;
static long asDbAddRecords(void)
{
DBENTRY dbentry;
DBENTRY *pdbentry=&dbentry;
long status;
dbCommon *precord;
DBENTRY dbentry;
DBENTRY *pdbentry=&dbentry;
long status;
dbCommon *precord;
dbInitEntry(pdbbase,pdbentry);
status = dbFirstRecordType(pdbentry);
while(!status) {
status = dbFirstRecord(pdbentry);
while(!status) {
precord = pdbentry->precnode->precord;
if(!precord->asp) {
status = asAddMember(&precord->asp, precord->asg);
if(status) errMessage(status,"asDbAddRecords:asAddMember");
asPutMemberPvt(precord->asp,precord);
}
status = dbNextRecord(pdbentry);
}
status = dbNextRecordType(pdbentry);
status = dbFirstRecord(pdbentry);
while(!status) {
precord = pdbentry->precnode->precord;
if(!precord->asp) {
status = asAddMember(&precord->asp, precord->asg);
if(status) errMessage(status,"asDbAddRecords:asAddMember");
asPutMemberPvt(precord->asp,precord);
}
status = dbNextRecord(pdbentry);
}
status = dbNextRecordType(pdbentry);
}
dbFinishEntry(pdbentry);
return(0);
@@ -92,14 +92,14 @@ int asSetSubstitutions(const char *substitutions)
{
if(psubstitutions) free ((void *)psubstitutions);
if(substitutions) {
psubstitutions = calloc(1,strlen(substitutions)+1);
if(!psubstitutions) {
errMessage(0,"asSetSubstitutions calloc failure");
} else {
strcpy(psubstitutions,substitutions);
}
psubstitutions = calloc(1,strlen(substitutions)+1);
if(!psubstitutions) {
errMessage(0,"asSetSubstitutions calloc failure");
} else {
strcpy(psubstitutions,substitutions);
}
} else {
psubstitutions = NULL;
psubstitutions = NULL;
}
return(0);
}
@@ -117,9 +117,9 @@ static void asInitCommonOnce(void *arg)
static long asInitCommon(void)
{
long status;
int asWasActive = asActive;
int wasFirstTime = firstTime;
long status;
int asWasActive = asActive;
int wasFirstTime = firstTime;
static epicsThreadOnceId asInitCommonOnceFlag = EPICS_THREAD_ONCE_INIT;
@@ -140,11 +140,11 @@ static long asInitCommon(void)
}
status = asInitFile(pacf,psubstitutions);
if(asActive) {
if(!asWasActive) {
if(!asWasActive) {
dbSpcAsRegisterCallback(asSpcAsCallback);
asDbAddRecords();
}
asCaStart();
asCaStart();
}
return(status);
}
@@ -179,8 +179,8 @@ static void asInitTask(ASDBCALLBACK *pcallback)
taskwdRemove(epicsThreadGetIdSelf());
asInitTheadId = 0;
if(pcallback) {
pcallback->status = status;
callbackRequest(&pcallback->callback);
pcallback->status = status;
callbackRequest(&pcallback->callback);
}
}
@@ -188,24 +188,24 @@ int asInitAsyn(ASDBCALLBACK *pcallback)
{
if(!pacf) return(0);
if(asInitTheadId) {
errMessage(-1,"asInit: asInitTask already active");
if(pcallback) {
pcallback->status = S_asLib_InitFailed;
callbackRequest(&pcallback->callback);
}
return(-1);
errMessage(-1,"asInit: asInitTask already active");
if(pcallback) {
pcallback->status = S_asLib_InitFailed;
callbackRequest(&pcallback->callback);
}
return(-1);
}
asInitTheadId = epicsThreadCreate("asInitTask",
(epicsThreadPriorityCAServerHigh + 1),
epicsThreadGetStackSize(epicsThreadStackBig),
(EPICSTHREADFUNC)asInitTask,(void *)pcallback);
if(asInitTheadId==0) {
errMessage(0,"asInit: epicsThreadCreate Error");
if(pcallback) {
pcallback->status = S_asLib_InitFailed;
callbackRequest(&pcallback->callback);
}
asInitTheadId = 0;
errMessage(0,"asInit: epicsThreadCreate Error");
if(pcallback) {
pcallback->status = S_asLib_InitFailed;
callbackRequest(&pcallback->callback);
}
asInitTheadId = 0;
}
return(0);
}
@@ -227,18 +227,18 @@ static void astacCallback(ASCLIENTPVT clientPvt,asClientStatus status)
recordname = (char *)asGetClientPvt(clientPvt);
printf("astac callback %s: status=%d",recordname,status);
printf(" get %s put %s\n",(asCheckGet(clientPvt) ? "Yes" : "No"),
(asCheckPut(clientPvt) ? "Yes" : "No"));
(asCheckPut(clientPvt) ? "Yes" : "No"));
}
int astac(const char *pname,const char *user,const char *location)
{
DBADDR *paddr;
long status;
ASCLIENTPVT *pasclientpvt=NULL;
dbCommon *precord;
dbFldDes *pflddes;
char *puser;
char *plocation;
DBADDR *paddr;
long status;
ASCLIENTPVT *pasclientpvt=NULL;
dbCommon *precord;
dbFldDes *pflddes;
char *puser;
char *plocation;
if (!pname || !user || !location){
printf("Usage: astac \"record name\", \"user\", \"host\"\n");
@@ -248,8 +248,8 @@ int astac(const char *pname,const char *user,const char *location)
pasclientpvt = (ASCLIENTPVT *)(paddr + 1);
status=dbNameToAddr(pname,paddr);
if(status) {
errMessage(status,"dbNameToAddr error");
return(1);
errMessage(status,"dbNameToAddr error");
return(1);
}
precord = paddr->precord;
pflddes = paddr->pfldDes;
@@ -259,20 +259,20 @@ int astac(const char *pname,const char *user,const char *location)
strcpy(plocation,location);
status = asAddClient(pasclientpvt,precord->asp,
(int)pflddes->as_level,puser,plocation);
(int)pflddes->as_level,puser,plocation);
if(status) {
errMessage(status,"asAddClient error");
return(1);
errMessage(status,"asAddClient error");
return(1);
} else {
asPutClientPvt(*pasclientpvt,(void *)precord->name);
asRegisterClientCallback(*pasclientpvt,astacCallback);
asPutClientPvt(*pasclientpvt,(void *)precord->name);
asRegisterClientCallback(*pasclientpvt,astacCallback);
}
return(0);
}
static void myMemberCallback(ASMEMBERPVT memPvt,FILE *fp)
{
dbCommon *precord;
dbCommon *precord;
precord = asGetMemberPvt(memPvt);
if(precord) fprintf(fp," Record:%s",precord->name);

View File

@@ -18,8 +18,8 @@
#include "shareLib.h"
typedef struct {
epicsCallback callback;
long status;
epicsCallback callback;
long status;
} ASDBCALLBACK;
struct dbChannel;

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include "asLib.h"
@@ -19,7 +19,9 @@
static const iocshArg asSetFilenameArg0 = { "ascf",iocshArgString};
static const iocshArg * const asSetFilenameArgs[] = {&asSetFilenameArg0};
static const iocshFuncDef asSetFilenameFuncDef =
{"asSetFilename",1,asSetFilenameArgs};
{"asSetFilename",1,asSetFilenameArgs,
"Set path+file name of ACF file.\n"
"No immediate effect. Run as asInit() to (re)load.\n"};
static void asSetFilenameCallFunc(const iocshArgBuf *args)
{
asSetFilename(args[0].sval);
@@ -29,21 +31,25 @@ static void asSetFilenameCallFunc(const iocshArgBuf *args)
static const iocshArg asSetSubstitutionsArg0 = { "substitutions",iocshArgString};
static const iocshArg * const asSetSubstitutionsArgs[] = {&asSetSubstitutionsArg0};
static const iocshFuncDef asSetSubstitutionsFuncDef =
{"asSetSubstitutions",1,asSetSubstitutionsArgs};
{"asSetSubstitutions",1,asSetSubstitutionsArgs,
"Set subtitutions used when reading ACF file.\n"
"No immediate effect. Run as asInit() to (re)load.\n"};
static void asSetSubstitutionsCallFunc(const iocshArgBuf *args)
{
asSetSubstitutions(args[0].sval);
}
/* asInit */
static const iocshFuncDef asInitFuncDef = {"asInit",0};
static const iocshFuncDef asInitFuncDef = {"asInit",0,0,
"(Re)load ACF file.\n"};
static void asInitCallFunc(const iocshArgBuf *args)
{
iocshSetError(asInit());
}
/* asdbdump */
static const iocshFuncDef asdbdumpFuncDef = {"asdbdump",0};
static const iocshFuncDef asdbdumpFuncDef = {"asdbdump",0,0,
"Dump processed ACF file (as read).\n"};
static void asdbdumpCallFunc(const iocshArgBuf *args)
{
asdbdump();
@@ -52,7 +58,8 @@ static void asdbdumpCallFunc(const iocshArgBuf *args)
/* aspuag */
static const iocshArg aspuagArg0 = { "uagname",iocshArgString};
static const iocshArg * const aspuagArgs[] = {&aspuagArg0};
static const iocshFuncDef aspuagFuncDef = {"aspuag",1,aspuagArgs};
static const iocshFuncDef aspuagFuncDef = {"aspuag",1,aspuagArgs,
"Show members of User Access Group.\n"};
static void aspuagCallFunc(const iocshArgBuf *args)
{
aspuag(args[0].sval);
@@ -61,7 +68,8 @@ static void aspuagCallFunc(const iocshArgBuf *args)
/* asphag */
static const iocshArg asphagArg0 = { "hagname",iocshArgString};
static const iocshArg * const asphagArgs[] = {&asphagArg0};
static const iocshFuncDef asphagFuncDef = {"asphag",1,asphagArgs};
static const iocshFuncDef asphagFuncDef = {"asphag",1,asphagArgs,
"Show members of Host Access Group.\n"};
static void asphagCallFunc(const iocshArgBuf *args)
{
asphag(args[0].sval);
@@ -70,7 +78,8 @@ static void asphagCallFunc(const iocshArgBuf *args)
/* asprules */
static const iocshArg asprulesArg0 = { "asgname",iocshArgString};
static const iocshArg * const asprulesArgs[] = {&asprulesArg0};
static const iocshFuncDef asprulesFuncDef = {"asprules",1,asprulesArgs};
static const iocshFuncDef asprulesFuncDef = {"asprules",1,asprulesArgs,
"List rules of an Access Security Group.\n"};
static void asprulesCallFunc(const iocshArgBuf *args)
{
asprules(args[0].sval);
@@ -80,7 +89,8 @@ static void asprulesCallFunc(const iocshArgBuf *args)
static const iocshArg aspmemArg0 = { "asgname",iocshArgString};
static const iocshArg aspmemArg1 = { "clients",iocshArgInt};
static const iocshArg * const aspmemArgs[] = {&aspmemArg0,&aspmemArg1};
static const iocshFuncDef aspmemFuncDef = {"aspmem",2,aspmemArgs};
static const iocshFuncDef aspmemFuncDef = {"aspmem",2,aspmemArgs,
"List members of Access Security Group.\n"};
static void aspmemCallFunc(const iocshArgBuf *args)
{
aspmem(args[0].sval,args[1].ival);
@@ -89,9 +99,10 @@ static void aspmemCallFunc(const iocshArgBuf *args)
/* astac */
static const iocshArg astacArg0 = { "recordname",iocshArgString};
static const iocshArg astacArg1 = { "user",iocshArgString};
static const iocshArg astacArg2 = { "location",iocshArgString};
static const iocshArg astacArg2 = { "host",iocshArgString};
static const iocshArg * const astacArgs[] = {&astacArg0,&astacArg1,&astacArg2};
static const iocshFuncDef astacFuncDef = {"astac",3,astacArgs};
static const iocshFuncDef astacFuncDef = {"astac",3,astacArgs,
"Test Access Security privlages granted to user+host.\n"};
static void astacCallFunc(const iocshArgBuf *args)
{
astac(args[0].sval,args[1].sval,args[2].sval);
@@ -100,7 +111,8 @@ static void astacCallFunc(const iocshArgBuf *args)
/* ascar */
static const iocshArg ascarArg0 = { "level",iocshArgInt};
static const iocshArg * const ascarArgs[] = {&ascarArg0};
static const iocshFuncDef ascarFuncDef = {"ascar",1,ascarArgs};
static const iocshFuncDef ascarFuncDef = {"ascar",1,ascarArgs,
"Report status of PVs used in INP*() Access Security rules.\n"};
static void ascarCallFunc(const iocshArgBuf *args)
{
ascar(args[0].ival);

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef INC_asIocRegister_H

View File

@@ -7,7 +7,7 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* Author: Marty Kraimer Date: 03-24-94 */
/* Author: Marty Kraimer Date: 03-24-94 */
#include <stdlib.h>
#include <stddef.h>
@@ -21,35 +21,35 @@
int main(int argc,char **argv)
{
int argn = 1;
char *sub = NULL;
int subLength = 0;
char **pstr;
char *psep;
int *len;
long status = 0;
char *sub = NULL;
int subLength = 0;
char **pstr;
char *psep;
int *len;
long status = 0;
static char *subSep = ",";
/* Look for -Smacro=value options */
while (argc>argn && (strncmp(argv[argn], "-S", 2)==0)) {
pstr = &sub;
psep = subSep;
len = &subLength;
if (strlen(argv[argn])==2) {
dbCatString(pstr, len, argv[++argn], psep);
} else {
dbCatString(pstr, len, argv[argn]+2, psep);
}
argn++;
pstr = &sub;
psep = subSep;
len = &subLength;
if (strlen(argv[argn])==2) {
dbCatString(pstr, len, argv[++argn], psep);
} else {
dbCatString(pstr, len, argv[argn]+2, psep);
}
argn++;
}
if (argc == argn) {
status = asInitFP(stdin, sub);
if(status) errlogPrintf("ascheck: Access Security File failed.\n");
status = asInitFP(stdin, sub);
if(status) errlogPrintf("ascheck: Access Security File failed.\n");
} else if (argc == argn+1) {
status = asInitFile(argv[argn], sub);
if(status) errlogPrintf("ascheck: Access Security File failed.\n");
status = asInitFile(argv[argn], sub);
if(status) errlogPrintf("ascheck: Access Security File failed.\n");
} else {
printf("usage: ascheck [-Smac=sub ...] [<] file\n");
status = -1;
printf("usage: ascheck [-Smac=sub ...] [<] file\n");
status = -1;
}
errlogFlush();
return status;

View File

@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Breakpoint Tables
@@ -15,7 +15,7 @@
*/
#ifndef INCcvtTableh
#define INCcvtTableh 1
#define INCcvtTableh 1
#include "shareLib.h"

View File

@@ -5,12 +5,12 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author: Marty Kraimer
* Date: 9/28/95
* Replacement for old bldCvtTable
* Author: Marty Kraimer
* Date: 9/28/95
* Replacement for old bldCvtTable
*/
#include <stdlib.h>
@@ -27,40 +27,40 @@
#define MAX_LINE_SIZE 160
#define MAX_BREAKS 100
struct brkCreateInfo {
double engLow; /* Lowest value desired: engineering units */
double engHigh; /* Highest value desired: engineering units */
double rawLow; /* Raw value for EngLow */
double rawHigh; /* Raw value for EngHigh */
double accuracy; /* accuracy desired in engineering units */
double tblEngFirst;/* First table value: engineering units */
double tblEngLast; /* Last table value: engineering units */
double tblEngDelta;/* Change per table entry: eng units */
long nTable; /* number of table entries */
/* (last-first)/delta + 1 */
double *pTable; /* addr of data table */
double engLow; /* Lowest value desired: engineering units */
double engHigh; /* Highest value desired: engineering units */
double rawLow; /* Raw value for EngLow */
double rawHigh; /* Raw value for EngHigh */
double accuracy; /* accuracy desired in engineering units */
double tblEngFirst; /* First table value: engineering units */
double tblEngLast; /* Last table value: engineering units */
double tblEngDelta; /* Change per table entry: eng units */
long nTable; /* number of table entries */
/* (last-first)/delta + 1 */
double *pTable; /* addr of data table */
} brkCreateInfo;
typedef struct brkInt { /* breakpoint interval */
double raw; /* raw value for beginning of interval */
double slope; /* slope for interval */
double eng; /* converted value for beginning of interval */
typedef struct brkInt { /* breakpoint interval */
double raw; /* raw value for beginning of interval */
double slope; /* slope for interval */
double eng; /* converted value for beginning of interval */
} brkInt;
brkInt brkint[MAX_BREAKS];
static int create_break(struct brkCreateInfo *pbci, brkInt *pabrkInt,
int max_breaks, int *n_breaks);
int max_breaks, int *n_breaks);
static char inbuf[MAX_LINE_SIZE];
static int linenum=0;
typedef struct dataList{
struct dataList *next;
double value;
struct dataList *next;
double value;
}dataList;
static int getNumber(char **pbeg, double *value)
{
int nchars=0;
int nchars=0;
while(isspace((int)**pbeg) && **pbeg!= '\0') (*pbeg)++;
if(**pbeg == '!' || **pbeg == '\0') return(-1);
@@ -68,7 +68,7 @@ static int getNumber(char **pbeg, double *value)
*pbeg += nchars;
return(0);
}
static void errExit(char *pmessage)
{
fprintf(stderr, "%s\n", pmessage);
@@ -78,98 +78,98 @@ static void errExit(char *pmessage)
int main(int argc, char **argv)
{
char *pbeg;
char *pend;
double value;
char *pname = NULL;
dataList *phead;
dataList *pdataList;
dataList *pnext;
double *pdata;
long ndata;
int nBreak,n;
size_t len;
char *outFilename;
char *pext;
FILE *outFile;
FILE *inFile;
char *plastSlash;
char *pbeg;
char *pend;
double value;
char *pname = NULL;
dataList *phead;
dataList *pdataList;
dataList *pnext;
double *pdata;
long ndata;
int nBreak,n;
size_t len;
char *outFilename;
char *pext;
FILE *outFile;
FILE *inFile;
char *plastSlash;
if(argc<2) {
fprintf(stderr,"usage: makeBpt file.data [outfile]\n");
exit(-1);
fprintf(stderr,"usage: makeBpt file.data [outfile]\n");
exit(-1);
}
if (argc==2) {
plastSlash = strrchr(argv[1],'/');
plastSlash = (plastSlash ? plastSlash+1 : argv[1]);
outFilename = calloc(1,strlen(plastSlash)+2);
if(!outFilename) {
fprintf(stderr,"calloc failed\n");
exit(-1);
}
strcpy(outFilename,plastSlash);
pext = strstr(outFilename,".data");
if(!pext) {
fprintf(stderr,"Input file MUST have .data extension\n");
exit(-1);
}
strcpy(pext,".dbd");
plastSlash = strrchr(argv[1],'/');
plastSlash = (plastSlash ? plastSlash+1 : argv[1]);
outFilename = calloc(1,strlen(plastSlash)+2);
if(!outFilename) {
fprintf(stderr,"calloc failed\n");
exit(-1);
}
strcpy(outFilename,plastSlash);
pext = strstr(outFilename,".data");
if(!pext) {
fprintf(stderr,"Input file MUST have .data extension\n");
exit(-1);
}
strcpy(pext,".dbd");
} else {
outFilename = calloc(1,strlen(argv[2])+1);
if(!outFilename) {
fprintf(stderr,"calloc failed\n");
exit(-1);
}
strcpy(outFilename,argv[2]);
outFilename = calloc(1,strlen(argv[2])+1);
if(!outFilename) {
fprintf(stderr,"calloc failed\n");
exit(-1);
}
strcpy(outFilename,argv[2]);
}
inFile = fopen(argv[1],"r");
if(!inFile) {
fprintf(stderr,"Error opening %s\n",argv[1]);
exit(-1);
fprintf(stderr,"Error opening %s\n",argv[1]);
exit(-1);
}
outFile = fopen(outFilename,"w");
if(!outFile) {
fprintf(stderr,"Error opening %s\n",outFilename);
exit(-1);
fprintf(stderr,"Error opening %s\n",outFilename);
exit(-1);
}
while(fgets(inbuf,MAX_LINE_SIZE,inFile)) {
linenum++;
pbeg = inbuf;
while(isspace((int)*pbeg) && *pbeg!= '\0') pbeg++;
if(*pbeg == '!' || *pbeg == '\0') continue;
while(*pbeg!='"' && *pbeg!= '\0') pbeg++;
if(*pbeg!='"' ) errExit("Illegal Header");
pbeg++; pend = pbeg;
while(*pend!='"' && *pend!= '\0') pend++;
if(*pend!='"') errExit("Illegal Header");
len = pend - pbeg;
if(len<=1) errExit("Illegal Header");
pname = calloc(len+1,sizeof(char));
if(!pname) {
fprintf(stderr,"calloc failed while processing line %d\n",linenum);
exit(-1);
}
strncpy(pname,pbeg,len);
pname[len]='\0';
pbeg = pend + 1;
if(getNumber(&pbeg,&value)) errExit("Illegal Header");
brkCreateInfo.engLow = value;
if(getNumber(&pbeg,&value)) errExit("Illegal Header");
brkCreateInfo.rawLow = value;
if(getNumber(&pbeg,&value)) errExit("Illegal Header");
brkCreateInfo.engHigh = value;
if(getNumber(&pbeg,&value)) errExit("Illegal Header");
brkCreateInfo.rawHigh = value;
if(getNumber(&pbeg,&value)) errExit("Illegal Header");
brkCreateInfo.accuracy = value;
if(getNumber(&pbeg,&value)) errExit("Illegal Header");
brkCreateInfo.tblEngFirst = value;
if(getNumber(&pbeg,&value)) errExit("Illegal Header");
brkCreateInfo.tblEngLast = value;
if(getNumber(&pbeg,&value)) errExit("Illegal Header");
brkCreateInfo.tblEngDelta = value;
goto got_header;
linenum++;
pbeg = inbuf;
while(isspace((int)*pbeg) && *pbeg!= '\0') pbeg++;
if(*pbeg == '!' || *pbeg == '\0') continue;
while(*pbeg!='"' && *pbeg!= '\0') pbeg++;
if(*pbeg!='"' ) errExit("Illegal Header");
pbeg++; pend = pbeg;
while(*pend!='"' && *pend!= '\0') pend++;
if(*pend!='"') errExit("Illegal Header");
len = pend - pbeg;
if(len<=1) errExit("Illegal Header");
pname = calloc(len+1,sizeof(char));
if(!pname) {
fprintf(stderr,"calloc failed while processing line %d\n",linenum);
exit(-1);
}
strncpy(pname,pbeg,len);
pname[len]='\0';
pbeg = pend + 1;
if(getNumber(&pbeg,&value)) errExit("Illegal Header");
brkCreateInfo.engLow = value;
if(getNumber(&pbeg,&value)) errExit("Illegal Header");
brkCreateInfo.rawLow = value;
if(getNumber(&pbeg,&value)) errExit("Illegal Header");
brkCreateInfo.engHigh = value;
if(getNumber(&pbeg,&value)) errExit("Illegal Header");
brkCreateInfo.rawHigh = value;
if(getNumber(&pbeg,&value)) errExit("Illegal Header");
brkCreateInfo.accuracy = value;
if(getNumber(&pbeg,&value)) errExit("Illegal Header");
brkCreateInfo.tblEngFirst = value;
if(getNumber(&pbeg,&value)) errExit("Illegal Header");
brkCreateInfo.tblEngLast = value;
if(getNumber(&pbeg,&value)) errExit("Illegal Header");
brkCreateInfo.tblEngDelta = value;
goto got_header;
}
errExit("Illegal Header");
got_header:
@@ -177,48 +177,48 @@ got_header:
ndata = 0;
errno = 0;
while(fgets(inbuf,MAX_LINE_SIZE,inFile)) {
double value;
double value;
linenum++;
pbeg = inbuf;
while(!getNumber(&pbeg,&value)) {
ndata++;
pdataList = (dataList *)calloc(1,sizeof(dataList));
if(!pdataList) {
fprintf(stderr,"calloc failed (after header)"
" while processing line %d\n",linenum);
exit(-1);
}
if(!phead)
phead = pdataList;
else
pnext->next = pdataList;
pdataList->value = value;
pnext = pdataList;
}
linenum++;
pbeg = inbuf;
while(!getNumber(&pbeg,&value)) {
ndata++;
pdataList = (dataList *)calloc(1,sizeof(dataList));
if(!pdataList) {
fprintf(stderr,"calloc failed (after header)"
" while processing line %d\n",linenum);
exit(-1);
}
if(!phead)
phead = pdataList;
else
pnext->next = pdataList;
pdataList->value = value;
pnext = pdataList;
}
}
if(!pname) {
errExit("create_break failed: no name specified\n");
errExit("create_break failed: no name specified\n");
}
brkCreateInfo.nTable = ndata;
pdata = (double *)calloc(brkCreateInfo.nTable,sizeof(double));
if(!pdata) {
fprintf(stderr,"calloc failed for table length %ld\n",brkCreateInfo.nTable);
exit(-1);
fprintf(stderr,"calloc failed for table length %ld\n",brkCreateInfo.nTable);
exit(-1);
}
pnext = phead;
for(n=0; n<brkCreateInfo.nTable; n++) {
pdata[n] = pnext->value;
pdataList = pnext;
pnext = pnext->next;
free((void *)pdataList);
pdata[n] = pnext->value;
pdataList = pnext;
pnext = pnext->next;
free((void *)pdataList);
}
brkCreateInfo.pTable = pdata;
if(create_break(&brkCreateInfo,&brkint[0],MAX_BREAKS,&nBreak))
errExit("create_break failed\n");
if(create_break(&brkCreateInfo,&brkint[0],MAX_BREAKS,&nBreak))
errExit("create_break failed\n");
fprintf(outFile,"breaktable(%s) {\n",pname);
for(n=0; n<nBreak; n++) {
fprintf(outFile,"\t%f %f\n",brkint[n].raw,brkint[n].eng);
fprintf(outFile,"\t%f %f\n",brkint[n].raw,brkint[n].eng);
}
fprintf(outFile,"}\n");
fclose(inFile);
@@ -256,24 +256,24 @@ static int create_break( struct brkCreateInfo *pbci, brkInt *pabrkInt,
expanding;
/* make checks to ensure that brkCreateInfo makes sense */
if (pbci->engLow >= pbci->engHigh) {
errExit("create_break: engLow >= engHigh");
return (-1);
errExit("create_break: engLow >= engHigh");
return (-1);
}
if ((pbci->engLow < pbci->tblEngFirst)
|| (pbci->engHigh > pbci->tblEngLast)) {
errExit("create_break: engLow > engHigh");
return (-1);
|| (pbci->engHigh > pbci->tblEngLast)) {
errExit("create_break: engLow > engHigh");
return (-1);
}
if (pbci->tblEngDelta <= 0.0) {
errExit("create_break: tblEngDelta <= 0.0");
return (-1);
errExit("create_break: tblEngDelta <= 0.0");
return (-1);
}
if (ntable < 3) {
errExit("raw data must have at least 3 elements");
return (-1);
errExit("raw data must have at least 3 elements");
return (-1);
}
/***************************************************************************
Convert Table to raw values
Convert Table to raw values
*
* raw and table values are assumed to be related by an equation of the form:
*
@@ -296,23 +296,23 @@ static int create_break( struct brkCreateInfo *pbci, brkInt *pabrkInt,
ilow = (pbci->engLow - pbci->tblEngFirst) / (pbci->tblEngDelta);
i = (int) ilow;
if (i >= ntable - 1)
i = ntable - 2;
i = ntable - 2;
tbllow = table[i] + (table[i + 1] - table[i]) * (ilow - (double) i);
/* Find engHigh in Table and then compute tblHigh */
ihigh = (pbci->engHigh - pbci->tblEngFirst) / (pbci->tblEngDelta);
i = (int) ihigh;
if (i >= ntable - 1)
i = ntable - 2;
i = ntable - 2;
tblhigh = table[i] + (table[i + 1] - table[i]) * (ihigh - (double) i);
/* compute slope and offset */
slope = (pbci->rawHigh - pbci->rawLow) / (tblhigh - tbllow);
offset = pbci->rawHigh - slope * tblhigh;
/* convert table to raw units */
for (i = 0; i < ntable; i++)
table[i] = table[i] * slope + offset;
table[i] = table[i] * slope + offset;
/*****************************************************************************
* Now create break point table
* Now create break point table
*
* The algorithm does the following:
*
@@ -320,11 +320,11 @@ static int create_break( struct brkCreateInfo *pbci, brkInt *pabrkInt,
*
* 1) Use a relatively large portion of the remaining table as an interval
* 2) It attempts to use the entire interval as a breakpoint interval
* Success is determined by the following algorithm:
* a) compute the slope using the entire interval
* Success is determined by the following algorithm:
* a) compute the slope using the entire interval
* b) for each table entry in the interval determine the eng value
* using the slope just determined.
* c) compare the computed value with eng value associated with table
* using the slope just determined.
* c) compare the computed value with eng value associated with table
* d) if all table entries are within the accuracy desired then success.
* 3) If successful then attempt to expand the interval and try again.
* Note that it is expanded by up to 1/10 of the table size.
@@ -337,7 +337,7 @@ static int create_break( struct brkCreateInfo *pbci, brkInt *pabrkInt,
/* Must start with table entry corresponding to engLow; */
i = (int) ilow;
if (i >= ntable - 1)
i = ntable - 2;
i = ntable - 2;
rawBeg = table[i] + (table[i + 1] - table[i]) * (ilow - (double) i);
engBeg = pbci->engLow;
ibeg = (int) (ilow); /* Make sure that ibeg > ilow */
@@ -349,77 +349,77 @@ static int create_break( struct brkCreateInfo *pbci, brkInt *pabrkInt,
pbrkInt->eng = engBeg;
/* determine next breakpoint interval */
while ((engBeg <= pbci->engHigh) && (ibeg < ntable - 1)) {
/* determine next interval to try. Up to 1/10 full range */
rawEnd = rawBeg;
engEnd = engBeg;
iend = ibeg;
inc = (int) ((ihigh - ilow) / 10.0);
if (inc < 1)
inc = 1;
valid = TRUE;
/* keep trying intervals until cant do better */
expanding = TRUE; /* originally we are trying larger and larger
* intervals */
while (valid) {
imax = iend + inc;
if (imax >= ntable) {
/* don't go past end of table */
imax = ntable - 1;
inc = ntable - iend - 1;
expanding = FALSE;
}
if (imax > (int) (ihigh + 1.0)) { /* Don't go to far past
* engHigh */
imax = (int) (ihigh + 1.0);
inc = (int) (ihigh + 1.0) - iend;
expanding = FALSE;
}
if (imax <= ibeg)
break; /* failure */
rawEnd = table[imax];
engEnd = pbci->tblEngFirst + (double) imax *(pbci->tblEngDelta);
slope = (engEnd - engBeg) / (rawEnd - rawBeg);
all_ok = TRUE;
for (i = ibeg + 1; i <= imax; i++) {
engCalc = engBeg + slope * (table[i] - rawBeg);
engActual = pbci->tblEngFirst + ((double) i) * (pbci->tblEngDelta);
error = engCalc - engActual;
if (error < 0.0)
error = -error;
if (error >= pbci->accuracy) {
/* we will be trying smaller intervals */
expanding = FALSE;
/* just decrease inc and let while(valid) try again */
inc--;
all_ok = FALSE;
break;
}
} /* end for */
if (all_ok) {
iend = imax;
/* if not expanding we found interval */
if (!expanding)
break;
/* will automatically try larger interval */
}
} /* end while(valid) */
/* either we failed or optimal interval has been found */
if ((iend <= ibeg) && (iend < (int) ihigh)) {
errExit("Could not meet accuracy criteria");
return (-1);
}
pbrkInt->slope = slope;
/* get ready for next breakpoint interval */
if (n++ >= max_breaks) {
errExit("Break point table too large");
return (-1);
}
ibeg = iend;
pbrkInt++;
rawBeg = rawEnd;
engBeg = engEnd;
pbrkInt->raw = rawBeg;
pbrkInt->eng = engBeg + (pbrkInt->raw - rawBeg) * slope;
/* determine next interval to try. Up to 1/10 full range */
rawEnd = rawBeg;
engEnd = engBeg;
iend = ibeg;
inc = (int) ((ihigh - ilow) / 10.0);
if (inc < 1)
inc = 1;
valid = TRUE;
/* keep trying intervals until cant do better */
expanding = TRUE; /* originally we are trying larger and larger
* intervals */
while (valid) {
imax = iend + inc;
if (imax >= ntable) {
/* don't go past end of table */
imax = ntable - 1;
inc = ntable - iend - 1;
expanding = FALSE;
}
if (imax > (int) (ihigh + 1.0)) { /* Don't go to far past
* engHigh */
imax = (int) (ihigh + 1.0);
inc = (int) (ihigh + 1.0) - iend;
expanding = FALSE;
}
if (imax <= ibeg)
break; /* failure */
rawEnd = table[imax];
engEnd = pbci->tblEngFirst + (double) imax *(pbci->tblEngDelta);
slope = (engEnd - engBeg) / (rawEnd - rawBeg);
all_ok = TRUE;
for (i = ibeg + 1; i <= imax; i++) {
engCalc = engBeg + slope * (table[i] - rawBeg);
engActual = pbci->tblEngFirst + ((double) i) * (pbci->tblEngDelta);
error = engCalc - engActual;
if (error < 0.0)
error = -error;
if (error >= pbci->accuracy) {
/* we will be trying smaller intervals */
expanding = FALSE;
/* just decrease inc and let while(valid) try again */
inc--;
all_ok = FALSE;
break;
}
} /* end for */
if (all_ok) {
iend = imax;
/* if not expanding we found interval */
if (!expanding)
break;
/* will automatically try larger interval */
}
} /* end while(valid) */
/* either we failed or optimal interval has been found */
if ((iend <= ibeg) && (iend < (int) ihigh)) {
errExit("Could not meet accuracy criteria");
return (-1);
}
pbrkInt->slope = slope;
/* get ready for next breakpoint interval */
if (n++ >= max_breaks) {
errExit("Break point table too large");
return (-1);
}
ibeg = iend;
pbrkInt++;
rawBeg = rawEnd;
engBeg = engEnd;
pbrkInt->raw = rawBeg;
pbrkInt->eng = engBeg + (pbrkInt->raw - rawBeg) * slope;
}
pbrkInt->slope = 0.0;
*n_breaks = n;

View File

@@ -5,23 +5,17 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef DATABASEVERSION_H
#define DATABASEVERSION_H
#ifndef INC_databaseVersion_H
#define INC_databaseVersion_H
#define EPICS_DATABASE_MAJOR_VERSION @EPICS_DATABASE_MAJOR_VERSION@
#define EPICS_DATABASE_MINOR_VERSION @EPICS_DATABASE_MINOR_VERSION@
#define EPICS_DATABASE_MAINTENANCE_VERSION @EPICS_DATABASE_MAINTENANCE_VERSION@
#define EPICS_DATABASE_DEVELOPMENT_FLAG @EPICS_DATABASE_DEVELOPMENT_FLAG@
#include <epicsVersion.h>
#ifndef VERSION_INT
# define VERSION_INT(V,R,M,P) ( ((V)<<24) | ((R)<<16) | ((M)<<8) | (P))
#endif
#define DATABASE_VERSION_INT VERSION_INT(EPICS_DATABASE_MAJOR_VERSION, \
EPICS_DATABASE_MINOR_VERSION, EPICS_DATABASE_MAINTENANCE_VERSION, 0)
/* include generated headers with:
* EPICS_DATABASE_MAJOR_VERSION
* EPICS_DATABASE_MINOR_VERSION
* EPICS_DATABASE_MAINTENANCE_VERSION
* EPICS_DATABASE_DEVELOPMENT_FLAG
*/
#include "databaseVersionNum.h"
#define DATABASE_VERSION_INT VERSION_INT(EPICS_DATABASE_MAJOR_VERSION, EPICS_DATABASE_MINOR_VERSION, EPICS_DATABASE_MAINTENANCE_VERSION, 0)
#endif // DATABASEVERSION_H
#endif /* INC_databaseVersion_H */

View File

@@ -1,7 +0,0 @@
#ifndef DATABASEVERSION_H
# error include databaseVersion.h, not this header
#endif
#define EPICS_DATABASE_MAJOR_VERSION @EPICS_DATABASE_MAJOR_VERSION@
#define EPICS_DATABASE_MINOR_VERSION @EPICS_DATABASE_MINOR_VERSION@
#define EPICS_DATABASE_MAINTENANCE_VERSION @EPICS_DATABASE_MAINTENANCE_VERSION@
#define EPICS_DATABASE_DEVELOPMENT_FLAG @EPICS_DATABASE_DEVELOPMENT_FLAG@

View File

@@ -4,7 +4,7 @@
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
# in file LICENSE that is included with this distribution.
#*************************************************************************
# This is a Makefile fragment, see src/ioc/Makefile.
@@ -63,6 +63,9 @@ DBDINC += dbCommon
dbMenusPod = $(notdir $(wildcard ../db/menu*.dbd.pod))
HTMLS += $(patsubst %.dbd.pod,%.html,$(dbMenusPod))
HTMLS += dbCommonRecord.html
HTMLS += dbCommonInput.html
HTMLS += dbCommonOutput.html
dbCore_SRCS += dbLock.c
dbCore_SRCS += dbAccess.c
@@ -98,4 +101,3 @@ dbCore_SRCS += dbState.c
dbCore_SRCS += dbUnitTest.c
dbCore_SRCS += dbServer.c
dbCore_SRCS_vxWorks += templateInstances.cpp

View File

@@ -6,21 +6,25 @@
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
# in file LICENSE that is included with this distribution.
#*************************************************************************
# This is a Makefile fragment, see src/ioc/Makefile.
dbCommon.h$(DEP): $(IOCDIR)/db/dbCommonRecord.dbd $(IOCDIR)/db/RULES
@$(RM) $@
@$(DBTORECORDTYPEH) -D -I ../db -o $(COMMONDEP_TARGET) $< > $@
THESE_RULES := $(IOCDIR)/db/RULES
$(COMMON_DIR)/dbCommon.h: $(IOCDIR)/db/dbCommonRecord.dbd $(IOCDIR)/db/RULES
dbCommon.h$(DEP): $(COMMON_DIR)/dbCommonRecord.dbd $(THESE_RULES)
@$(RM) $@
@$(DBTORECORDTYPEH) -D -I ../db -I $(COMMON_DIR) -o $(COMMONDEP_TARGET) $< > $@
$(COMMON_DIR)/dbCommonRecord.html: ../db/dbCommon.dbd.pod
$(COMMON_DIR)/dbCommon.h: $(COMMON_DIR)/dbCommonRecord.dbd $(THESE_RULES)
@$(RM) $(notdir $@)
$(DBTORECORDTYPEH) -I ../db -o $(notdir $@) $<
$(DBTORECORDTYPEH) -I ../db -I $(COMMON_DIR) -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
$(COMMON_DIR)/menuGlobal.dbd: $(IOCDIR)/db/Makefile $(IOCDIR)/db/RULES
$(COMMON_DIR)/menuGlobal.dbd: $(IOCDIR)/db/Makefile $(THESE_RULES)
# This is a target-specific variable
$(COMMON_DIR)/menuGlobal.dbd: DBDCAT_COMMAND = \

View File

@@ -9,10 +9,10 @@
\*************************************************************************/
/* callback.c */
/* general purpose callback tasks */
/* general purpose callback tasks */
/*
* Original Author: Marty Kraimer
* Date: 07-18-91
* Date: 07-18-91
*/
#include <stddef.h>
@@ -65,7 +65,7 @@ static cbQueueSet callbackQueue[NUM_CALLBACK_PRIORITIES];
int callbackThreadsDefault = 1;
/* Don't know what a reasonable default is (yet).
* For the time being: parallel means 2 if not explicitly specified */
epicsShareDef int callbackParallelThreadsDefault = 2;
int callbackParallelThreadsDefault = 2;
epicsExportAddress(int,callbackParallelThreadsDefault);
/* Timer for Delayed Requests */

View File

@@ -5,13 +5,13 @@
* Operator of Los Alamos National Laboratory.
* Copyright (c) 2013 ITER Organization.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* includes for general purpose callback tasks */
/* includes for general purpose callback tasks */
/*
* Original Author: Marty Kraimer
* Date: 07-18-91
* Date: 07-18-91
*/
#ifndef INCcallbackh
@@ -27,9 +27,9 @@ extern "C" {
* WINDOWS also has a "CALLBACK" type def
*/
#if defined(_WIN32) && !defined(EPICS_NO_CALLBACK)
# ifdef CALLBACK
# undef CALLBACK
# endif /*CALLBACK*/
# ifdef CALLBACK
# undef CALLBACK
# endif /*CALLBACK*/
#endif /*_WIN32*/
#define NUM_CALLBACK_PRIORITIES 3
@@ -38,9 +38,9 @@ extern "C" {
#define priorityHigh 2
typedef struct callbackPvt {
void (*callback)(struct callbackPvt*);
int priority;
void *user; /*for use by callback user*/
void (*callback)(struct callbackPvt*);
int priority;
void *user; /*for use by callback user*/
void *timer; /*for use by callback itself*/
}epicsCallback;

View File

@@ -5,14 +5,14 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* cvtBpt.c - Convert using breakpoint table
*
* Author: Marty Kraimer
* Date: 04OCT95
* This is adaptation of old bldCvtTable
* This is adaptation of old bldCvtTable
*/
#include "epicsPrint.h"
@@ -24,179 +24,179 @@
#include "dbStaticLib.h"
static brkTable *findBrkTable(short linr)
{
dbMenu *pdbMenu;
{
dbMenu *pdbMenu;
pdbMenu = dbFindMenu(pdbbase,"menuConvert");
if (!pdbMenu) {
epicsPrintf("findBrkTable: menuConvert not loaded!\n");
return NULL;
epicsPrintf("findBrkTable: menuConvert not loaded!\n");
return NULL;
}
if (linr < 0 || linr >= pdbMenu->nChoice) {
epicsPrintf("findBrkTable: linr=%d but menuConvert only has %d choices\n",
linr,pdbMenu->nChoice);
return NULL;
epicsPrintf("findBrkTable: linr=%d but menuConvert only has %d choices\n",
linr,pdbMenu->nChoice);
return NULL;
}
return dbFindBrkTable(pdbbase,pdbMenu->papChoiceValue[linr]);
}
/* Used by both ao and ai record types */
long cvtRawToEngBpt(double *pval, short linr, short init,
void **ppbrk, short *plbrk)
void **ppbrk, short *plbrk)
{
double val = *pval;
long status = 0;
brkTable *pbrkTable;
brkInt *pInt, *nInt;
short lbrk;
int number;
double val = *pval;
long status = 0;
brkTable *pbrkTable;
brkInt *pInt, *nInt;
short lbrk;
int number;
if (linr < 2)
return -1;
return -1;
if (init || *ppbrk == NULL) {
pbrkTable = findBrkTable(linr);
if (!pbrkTable)
return S_dbLib_badField;
*ppbrk = (void *)pbrkTable;
*plbrk = 0;
pbrkTable = findBrkTable(linr);
if (!pbrkTable)
return S_dbLib_badField;
*ppbrk = (void *)pbrkTable;
*plbrk = 0;
} else
pbrkTable = (brkTable *)*ppbrk;
pbrkTable = (brkTable *)*ppbrk;
number = pbrkTable->number;
lbrk = *plbrk;
/* Limit index to the size of the table */
if (lbrk < 0)
lbrk = 0;
lbrk = 0;
else if (lbrk > number-2)
lbrk = number-2;
lbrk = number-2;
pInt = & pbrkTable->paBrkInt[lbrk];
nInt = pInt + 1;
if (nInt->raw > pInt->raw) {
/* raw values increase down the table */
while (val > nInt->raw) {
lbrk++;
pInt = nInt++;
if (lbrk > number-2) {
status = 1;
break;
}
}
while (val < pInt->raw) {
if (lbrk <= 0) {
status = 1;
break;
}
lbrk--;
nInt = pInt--;
}
/* raw values increase down the table */
while (val > nInt->raw) {
lbrk++;
pInt = nInt++;
if (lbrk > number-2) {
status = 1;
break;
}
}
while (val < pInt->raw) {
if (lbrk <= 0) {
status = 1;
break;
}
lbrk--;
nInt = pInt--;
}
} else {
/* raw values decrease down the table */
while (val <= nInt->raw) {
lbrk++;
pInt = nInt++;
if (lbrk > number-2) {
status = 1;
break;
}
}
while(val > pInt->raw) {
if (lbrk <= 0) {
status = 1;
break;
}
lbrk--;
nInt = pInt--;
}
/* raw values decrease down the table */
while (val <= nInt->raw) {
lbrk++;
pInt = nInt++;
if (lbrk > number-2) {
status = 1;
break;
}
}
while(val > pInt->raw) {
if (lbrk <= 0) {
status = 1;
break;
}
lbrk--;
nInt = pInt--;
}
}
*plbrk = lbrk;
*pval = pInt->eng + (val - pInt->raw) * pInt->slope;
return status;
}
/* Used by the ao record type */
long cvtEngToRawBpt(double *pval, short linr, short init,
void **ppbrk, short *plbrk)
void **ppbrk, short *plbrk)
{
double val = *pval;
long status = 0;
brkTable *pbrkTable;
brkInt *pInt, *nInt;
short lbrk;
int number;
double val = *pval;
long status = 0;
brkTable *pbrkTable;
brkInt *pInt, *nInt;
short lbrk;
int number;
if (linr < 2)
return -1;
return -1;
if (init || *ppbrk == NULL) { /*must find breakpoint table*/
pbrkTable = findBrkTable(linr);
if (!pbrkTable)
return S_dbLib_badField;
*ppbrk = (void *)pbrkTable;
/* start at the beginning */
*plbrk = 0;
pbrkTable = findBrkTable(linr);
if (!pbrkTable)
return S_dbLib_badField;
*ppbrk = (void *)pbrkTable;
/* start at the beginning */
*plbrk = 0;
} else
pbrkTable = (brkTable *)*ppbrk;
pbrkTable = (brkTable *)*ppbrk;
number = pbrkTable->number;
lbrk = *plbrk;
/* Limit index to the size of the table */
if (lbrk < 0)
lbrk = 0;
lbrk = 0;
else if (lbrk > number-2)
lbrk = number-2;
lbrk = number-2;
pInt = & pbrkTable->paBrkInt[lbrk];
nInt = pInt + 1;
if (nInt->eng > pInt->eng) {
/* eng values increase down the table */
while (val > nInt->eng) {
lbrk++;
pInt = nInt++;
if (lbrk > number-2) {
status = 1;
break;
}
}
while (val < pInt->eng) {
if (lbrk <= 0) {
status = 1;
break;
}
lbrk--;
nInt = pInt--;
}
/* eng values increase down the table */
while (val > nInt->eng) {
lbrk++;
pInt = nInt++;
if (lbrk > number-2) {
status = 1;
break;
}
}
while (val < pInt->eng) {
if (lbrk <= 0) {
status = 1;
break;
}
lbrk--;
nInt = pInt--;
}
} else {
/* eng values decrease down the table */
while (val <= nInt->eng) {
lbrk++;
pInt = nInt++;
if (lbrk > number-2) {
status = 1;
break;
}
}
while (val > pInt->eng) {
if (lbrk <= 0) {
status = 1;
break;
}
lbrk--;
nInt = pInt--;
}
/* eng values decrease down the table */
while (val <= nInt->eng) {
lbrk++;
pInt = nInt++;
if (lbrk > number-2) {
status = 1;
break;
}
}
while (val > pInt->eng) {
if (lbrk <= 0) {
status = 1;
break;
}
lbrk--;
nInt = pInt--;
}
}
*plbrk = lbrk;
*pval = pInt->raw + (val - pInt->eng) / pInt->slope;
return status;
}

View File

@@ -62,15 +62,15 @@
#include "recSup.h"
#include "special.h"
epicsShareDef struct dbBase *pdbbase = 0;
epicsShareDef volatile int interruptAccept=FALSE;
struct dbBase *pdbbase = 0;
volatile int interruptAccept=FALSE;
epicsShareDef int dbAccessDebugPUTF = 0;
int dbAccessDebugPUTF = 0;
epicsExportAddress(int, dbAccessDebugPUTF);
/* Hook Routines */
epicsShareDef DB_LOAD_RECORDS_HOOK_ROUTINE dbLoadRecordsHook = NULL;
DB_LOAD_RECORDS_HOOK_ROUTINE dbLoadRecordsHook = NULL;
static short mapDBFToDBR[DBF_NTYPES] = {
/* DBF_STRING => */ DBR_STRING,
@@ -111,176 +111,176 @@ void dbSpcAsRegisterCallback(SPC_ASCALLBACK func)
long dbPutSpecial(DBADDR *paddr,int pass)
{
long int (*pspecial)()=NULL;
long int (*pspecial)()=NULL;
rset *prset;
dbCommon *precord = paddr->precord;
long status=0;
long special=paddr->special;
dbCommon *precord = paddr->precord;
long status=0;
long special=paddr->special;
prset = dbGetRset(paddr);
if(special<100) { /*global processing*/
if((special==SPC_NOMOD) && (pass==0)) {
status = S_db_noMod;
recGblDbaddrError(status,paddr,"dbPut");
return(status);
}else if(special==SPC_SCAN){
if(pass==0)
scanDelete(precord);
else
scanAdd(precord);
}else if((special==SPC_AS) && (pass==1)) {
if((special==SPC_NOMOD) && (pass==0)) {
status = S_db_noMod;
recGblDbaddrError(status,paddr,"dbPut");
return(status);
}else if(special==SPC_SCAN){
if(pass==0)
scanDelete(precord);
else
scanAdd(precord);
}else if((special==SPC_AS) && (pass==1)) {
if(spcAsCallback) (*spcAsCallback)(precord);
}
}
}else {
if( prset && (pspecial = (prset->special))) {
status=(*pspecial)(paddr,pass);
if(status) return(status);
} else if(pass==0){
recGblRecSupError(S_db_noSupport,paddr,"dbPut", "special");
return(S_db_noSupport);
}
if( prset && (pspecial = (prset->special))) {
status=(*pspecial)(paddr,pass);
if(status) return(status);
} else if(pass==0){
recGblRecSupError(S_db_noSupport,paddr,"dbPut", "special");
return(S_db_noSupport);
}
}
return(0);
}
static void get_enum_strs(DBADDR *paddr, char **ppbuffer,
rset *prset,long *options)
rset *prset,long *options)
{
short field_type=paddr->field_type;
dbFldDes *pdbFldDes = paddr->pfldDes;
dbMenu *pdbMenu;
dbDeviceMenu *pdbDeviceMenu;
char **papChoice;
unsigned long no_str;
char *ptemp;
struct dbr_enumStrs *pdbr_enumStrs=(struct dbr_enumStrs*)(*ppbuffer);
short field_type=paddr->field_type;
dbFldDes *pdbFldDes = paddr->pfldDes;
dbMenu *pdbMenu;
dbDeviceMenu *pdbDeviceMenu;
char **papChoice;
unsigned long no_str;
char *ptemp;
struct dbr_enumStrs *pdbr_enumStrs=(struct dbr_enumStrs*)(*ppbuffer);
unsigned int i;
memset(pdbr_enumStrs,'\0',dbr_enumStrs_size);
switch(field_type) {
case DBF_ENUM:
if( prset && prset->get_enum_strs ) {
(*prset->get_enum_strs)(paddr,pdbr_enumStrs);
} else {
*options = (*options)^DBR_ENUM_STRS;/*Turn off option*/
}
break;
case DBF_MENU:
pdbMenu = (dbMenu *)pdbFldDes->ftPvt;
no_str = pdbMenu->nChoice;
papChoice= pdbMenu->papChoiceValue;
goto choice_common;
case DBF_DEVICE:
pdbDeviceMenu = (dbDeviceMenu *)pdbFldDes->ftPvt;
memset(pdbr_enumStrs,'\0',dbr_enumStrs_size);
switch(field_type) {
case DBF_ENUM:
if( prset && prset->get_enum_strs ) {
(*prset->get_enum_strs)(paddr,pdbr_enumStrs);
} else {
*options = (*options)^DBR_ENUM_STRS;/*Turn off option*/
}
break;
case DBF_MENU:
pdbMenu = (dbMenu *)pdbFldDes->ftPvt;
no_str = pdbMenu->nChoice;
papChoice= pdbMenu->papChoiceValue;
goto choice_common;
case DBF_DEVICE:
pdbDeviceMenu = (dbDeviceMenu *)pdbFldDes->ftPvt;
if(!pdbDeviceMenu) {
*options = (*options)^DBR_ENUM_STRS;/*Turn off option*/
break;
}
no_str = pdbDeviceMenu->nChoice;
papChoice = pdbDeviceMenu->papChoice;
goto choice_common;
no_str = pdbDeviceMenu->nChoice;
papChoice = pdbDeviceMenu->papChoice;
goto choice_common;
choice_common:
i = sizeof(pdbr_enumStrs->strs)/
sizeof(pdbr_enumStrs->strs[0]);
if(i<no_str) no_str = i;
pdbr_enumStrs->no_str = no_str;
ptemp = &(pdbr_enumStrs->strs[0][0]);
for (i=0; i<no_str; i++) {
if(papChoice[i]==NULL) *ptemp=0;
else {
strncpy(ptemp,papChoice[i],
sizeof(pdbr_enumStrs->strs[0]));
*(ptemp+sizeof(pdbr_enumStrs->strs[0])-1) = 0;
}
ptemp += sizeof(pdbr_enumStrs->strs[0]);
}
break;
default:
*options = (*options)^DBR_ENUM_STRS;/*Turn off option*/
break;
}
*ppbuffer = ((char *)*ppbuffer) + dbr_enumStrs_size;
return;
i = sizeof(pdbr_enumStrs->strs)/
sizeof(pdbr_enumStrs->strs[0]);
if(i<no_str) no_str = i;
pdbr_enumStrs->no_str = no_str;
ptemp = &(pdbr_enumStrs->strs[0][0]);
for (i=0; i<no_str; i++) {
if(papChoice[i]==NULL) *ptemp=0;
else {
strncpy(ptemp,papChoice[i],
sizeof(pdbr_enumStrs->strs[0]));
*(ptemp+sizeof(pdbr_enumStrs->strs[0])-1) = 0;
}
ptemp += sizeof(pdbr_enumStrs->strs[0]);
}
break;
default:
*options = (*options)^DBR_ENUM_STRS;/*Turn off option*/
break;
}
*ppbuffer = ((char *)*ppbuffer) + dbr_enumStrs_size;
return;
}
static void get_graphics(DBADDR *paddr, char **ppbuffer,
rset *prset,long *options)
rset *prset,long *options)
{
struct dbr_grDouble grd;
int got_data=FALSE;
struct dbr_grDouble grd;
int got_data=FALSE;
grd.upper_disp_limit = grd.lower_disp_limit = 0.0;
if( prset && prset->get_graphic_double ) {
(*prset->get_graphic_double)(paddr,&grd);
got_data=TRUE;
}
if( (*options) & (DBR_GR_LONG) ) {
char *pbuffer=*ppbuffer;
if( prset && prset->get_graphic_double ) {
(*prset->get_graphic_double)(paddr,&grd);
got_data=TRUE;
}
if( (*options) & (DBR_GR_LONG) ) {
char *pbuffer=*ppbuffer;
if(got_data) {
struct dbr_grLong *pgr=(struct dbr_grLong*)pbuffer;
pgr->upper_disp_limit = (epicsInt32)grd.upper_disp_limit;
pgr->lower_disp_limit = (epicsInt32)grd.lower_disp_limit;
} else {
memset(pbuffer,'\0',dbr_grLong_size);
*options = (*options) ^ DBR_GR_LONG; /*Turn off option*/
}
*ppbuffer = ((char *)*ppbuffer) + dbr_grLong_size;
}
if( (*options) & (DBR_GR_DOUBLE) ) {
char *pbuffer=*ppbuffer;
if(got_data) {
struct dbr_grLong *pgr=(struct dbr_grLong*)pbuffer;
pgr->upper_disp_limit = (epicsInt32)grd.upper_disp_limit;
pgr->lower_disp_limit = (epicsInt32)grd.lower_disp_limit;
} else {
memset(pbuffer,'\0',dbr_grLong_size);
*options = (*options) ^ DBR_GR_LONG; /*Turn off option*/
}
*ppbuffer = ((char *)*ppbuffer) + dbr_grLong_size;
}
if( (*options) & (DBR_GR_DOUBLE) ) {
char *pbuffer=*ppbuffer;
if(got_data) {
struct dbr_grDouble *pgr=(struct dbr_grDouble*)pbuffer;
pgr->upper_disp_limit = grd.upper_disp_limit;
pgr->lower_disp_limit = grd.lower_disp_limit;
} else {
memset(pbuffer,'\0',dbr_grDouble_size);
*options = (*options) ^ DBR_GR_DOUBLE; /*Turn off option*/
}
*ppbuffer = ((char *)*ppbuffer) + dbr_grDouble_size;
}
return;
if(got_data) {
struct dbr_grDouble *pgr=(struct dbr_grDouble*)pbuffer;
pgr->upper_disp_limit = grd.upper_disp_limit;
pgr->lower_disp_limit = grd.lower_disp_limit;
} else {
memset(pbuffer,'\0',dbr_grDouble_size);
*options = (*options) ^ DBR_GR_DOUBLE; /*Turn off option*/
}
*ppbuffer = ((char *)*ppbuffer) + dbr_grDouble_size;
}
return;
}
static void get_control(DBADDR *paddr, char **ppbuffer,
rset *prset,long *options)
rset *prset,long *options)
{
struct dbr_ctrlDouble ctrld;
int got_data=FALSE;
struct dbr_ctrlDouble ctrld;
int got_data=FALSE;
ctrld.upper_ctrl_limit = ctrld.lower_ctrl_limit = 0.0;
if( prset && prset->get_control_double ) {
(*prset->get_control_double)(paddr,&ctrld);
got_data=TRUE;
}
if( (*options) & (DBR_CTRL_LONG) ) {
char *pbuffer=*ppbuffer;
if( prset && prset->get_control_double ) {
(*prset->get_control_double)(paddr,&ctrld);
got_data=TRUE;
}
if( (*options) & (DBR_CTRL_LONG) ) {
char *pbuffer=*ppbuffer;
if(got_data) {
struct dbr_ctrlLong *pctrl=(struct dbr_ctrlLong*)pbuffer;
pctrl->upper_ctrl_limit = (epicsInt32)ctrld.upper_ctrl_limit;
pctrl->lower_ctrl_limit = (epicsInt32)ctrld.lower_ctrl_limit;
} else {
memset(pbuffer,'\0',dbr_ctrlLong_size);
*options = (*options) ^ DBR_CTRL_LONG; /*Turn off option*/
}
*ppbuffer = ((char *)*ppbuffer) + dbr_ctrlLong_size;
}
if( (*options) & (DBR_CTRL_DOUBLE) ) {
char *pbuffer=*ppbuffer;
if(got_data) {
struct dbr_ctrlLong *pctrl=(struct dbr_ctrlLong*)pbuffer;
pctrl->upper_ctrl_limit = (epicsInt32)ctrld.upper_ctrl_limit;
pctrl->lower_ctrl_limit = (epicsInt32)ctrld.lower_ctrl_limit;
} else {
memset(pbuffer,'\0',dbr_ctrlLong_size);
*options = (*options) ^ DBR_CTRL_LONG; /*Turn off option*/
}
*ppbuffer = ((char *)*ppbuffer) + dbr_ctrlLong_size;
}
if( (*options) & (DBR_CTRL_DOUBLE) ) {
char *pbuffer=*ppbuffer;
if(got_data) {
struct dbr_ctrlDouble *pctrl=(struct dbr_ctrlDouble*)pbuffer;
pctrl->upper_ctrl_limit = ctrld.upper_ctrl_limit;
pctrl->lower_ctrl_limit = ctrld.lower_ctrl_limit;
} else {
memset(pbuffer,'\0',dbr_ctrlDouble_size);
*options = (*options) ^ DBR_CTRL_DOUBLE; /*Turn off option*/
}
*ppbuffer = ((char *)*ppbuffer) + dbr_ctrlDouble_size;
}
return;
if(got_data) {
struct dbr_ctrlDouble *pctrl=(struct dbr_ctrlDouble*)pbuffer;
pctrl->upper_ctrl_limit = ctrld.upper_ctrl_limit;
pctrl->lower_ctrl_limit = ctrld.lower_ctrl_limit;
} else {
memset(pbuffer,'\0',dbr_ctrlDouble_size);
*options = (*options) ^ DBR_CTRL_DOUBLE; /*Turn off option*/
}
*ppbuffer = ((char *)*ppbuffer) + dbr_ctrlDouble_size;
}
return;
}
static void get_alarm(DBADDR *paddr, char **ppbuffer,
@@ -332,21 +332,21 @@ static void get_alarm(DBADDR *paddr, char **ppbuffer,
static void getOptions(DBADDR *paddr, char **poriginal, long *options,
void *pflin)
{
db_field_log *pfl= (db_field_log *)pflin;
rset *prset;
short field_type;
dbCommon *pcommon;
char *pbuffer = *poriginal;
db_field_log *pfl= (db_field_log *)pflin;
rset *prset;
short field_type;
dbCommon *pcommon;
char *pbuffer = *poriginal;
if (!pfl || pfl->type == dbfl_type_rec)
field_type = paddr->field_type;
else
field_type = pfl->field_type;
prset=dbGetRset(paddr);
/* Process options */
pcommon = paddr->precord;
if( (*options) & DBR_STATUS ) {
unsigned short *pushort = (unsigned short *)pbuffer;
prset=dbGetRset(paddr);
/* Process options */
pcommon = paddr->precord;
if( (*options) & DBR_STATUS ) {
unsigned short *pushort = (unsigned short *)pbuffer;
if (!pfl || pfl->type == dbfl_type_rec) {
*pushort++ = pcommon->stat;
@@ -355,32 +355,32 @@ static void getOptions(DBADDR *paddr, char **poriginal, long *options,
*pushort++ = pfl->stat;
*pushort++ = pfl->sevr;
}
*pushort++ = pcommon->acks;
*pushort++ = pcommon->ackt;
pbuffer = (char *)pushort;
}
if( (*options) & DBR_UNITS ) {
memset(pbuffer,'\0',dbr_units_size);
if( prset && prset->get_units ){
(*prset->get_units)(paddr, pbuffer);
pbuffer[DB_UNITS_SIZE-1] = '\0';
} else {
*options ^= DBR_UNITS; /*Turn off DBR_UNITS*/
}
pbuffer += dbr_units_size;
}
if( (*options) & DBR_PRECISION ) {
memset(pbuffer, '\0', dbr_precision_size);
if((field_type==DBF_FLOAT || field_type==DBF_DOUBLE)
&& prset && prset->get_precision ){
*pushort++ = pcommon->acks;
*pushort++ = pcommon->ackt;
pbuffer = (char *)pushort;
}
if( (*options) & DBR_UNITS ) {
memset(pbuffer,'\0',dbr_units_size);
if( prset && prset->get_units ){
(*prset->get_units)(paddr, pbuffer);
pbuffer[DB_UNITS_SIZE-1] = '\0';
} else {
*options ^= DBR_UNITS; /*Turn off DBR_UNITS*/
}
pbuffer += dbr_units_size;
}
if( (*options) & DBR_PRECISION ) {
memset(pbuffer, '\0', dbr_precision_size);
if((field_type==DBF_FLOAT || field_type==DBF_DOUBLE)
&& prset && prset->get_precision ){
(*prset->get_precision)(paddr,(long *)pbuffer);
} else {
*options ^= DBR_PRECISION; /*Turn off DBR_PRECISION*/
}
pbuffer += dbr_precision_size;
}
if( (*options) & DBR_TIME ) {
epicsUInt32 *ptime = (epicsUInt32 *)pbuffer;
} else {
*options ^= DBR_PRECISION; /*Turn off DBR_PRECISION*/
}
pbuffer += dbr_precision_size;
}
if( (*options) & DBR_TIME ) {
epicsUInt32 *ptime = (epicsUInt32 *)pbuffer;
if (!pfl || pfl->type == dbfl_type_rec) {
*ptime++ = pcommon->time.secPastEpoch;
@@ -388,26 +388,26 @@ static void getOptions(DBADDR *paddr, char **poriginal, long *options,
} else {
*ptime++ = pfl->time.secPastEpoch;
*ptime++ = pfl->time.nsec;
}
pbuffer = (char *)ptime;
}
if( (*options) & DBR_ENUM_STRS )
get_enum_strs(paddr, &pbuffer, prset, options);
if( (*options) & (DBR_GR_LONG|DBR_GR_DOUBLE ))
get_graphics(paddr, &pbuffer, prset, options);
if((*options) & (DBR_CTRL_LONG | DBR_CTRL_DOUBLE ))
get_control(paddr, &pbuffer, prset, options);
if((*options) & (DBR_AL_LONG | DBR_AL_DOUBLE ))
get_alarm(paddr, &pbuffer, prset, options);
*poriginal = pbuffer;
}
pbuffer = (char *)ptime;
}
if( (*options) & DBR_ENUM_STRS )
get_enum_strs(paddr, &pbuffer, prset, options);
if( (*options) & (DBR_GR_LONG|DBR_GR_DOUBLE ))
get_graphics(paddr, &pbuffer, prset, options);
if((*options) & (DBR_CTRL_LONG | DBR_CTRL_DOUBLE ))
get_control(paddr, &pbuffer, prset, options);
if((*options) & (DBR_AL_LONG | DBR_AL_DOUBLE ))
get_alarm(paddr, &pbuffer, prset, options);
*poriginal = pbuffer;
}
rset * dbGetRset(const struct dbAddr *paddr)
{
struct dbFldDes *pfldDes = paddr->pfldDes;
struct dbFldDes *pfldDes = paddr->pfldDes;
if(!pfldDes) return(0);
return(pfldDes->pdbRecordType->prset);
if(!pfldDes) return(0);
return(pfldDes->pdbRecordType->prset);
}
long dbPutAttribute(
@@ -466,7 +466,7 @@ long dbProcess(dbCommon *precord)
char context[40] = "";
long status = 0;
int *ptrace;
int set_trace = FALSE;
int set_trace = FALSE;
dbFldDes *pdbFldDes;
int callNotifyCompletion = FALSE;
@@ -776,8 +776,19 @@ int dbLoadRecords(const char* file, const char* subs)
return -1;
}
status = dbReadDatabase(&pdbbase, file, 0, subs);
if (!status && dbLoadRecordsHook)
dbLoadRecordsHook(file, subs);
switch(status)
{
case 0:
if(dbLoadRecordsHook)
dbLoadRecordsHook(file, subs);
break;
case -2:
errlogPrintf("dbLoadRecords: failed to load '%s'\n"
" Records cannot be loaded after iocInit!\n", file);
break;
default:
errlogPrintf("dbLoadRecords: failed to load '%s'\n", file);
}
return status;
}
@@ -943,6 +954,11 @@ long dbGet(DBADDR *paddr, short dbrType,
} else {
DBADDR localAddr = *paddr; /* Structure copy */
if (pfl->no_elements < 1) {
status = S_db_badField;
goto done;
}
localAddr.field_type = pfl->field_type;
localAddr.field_size = pfl->field_size;
localAddr.no_elements = pfl->no_elements;
@@ -1204,11 +1220,11 @@ cleanup:
long dbPutField(DBADDR *paddr, short dbrType,
const void *pbuffer, long nRequest)
{
long status = 0;
long special = paddr->special;
dbFldDes *pfldDes = paddr->pfldDes;
dbCommon *precord = paddr->precord;
short dbfType = paddr->field_type;
long status = 0;
long special = paddr->special;
dbFldDes *pfldDes = paddr->pfldDes;
dbCommon *precord = paddr->precord;
short dbfType = paddr->field_type;
if (special == SPC_ATTRIBUTE)
return S_db_noMod;

View File

@@ -4,9 +4,9 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbAccess.h */
/* dbAccess.h */
#ifndef INCdbAccessh
#define INCdbAccessh

View File

@@ -6,7 +6,7 @@
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbAccessDefs.h */
/* dbAccessDefs.h */
#ifndef INCdbAccessDefsh
#define INCdbAccessDefsh
@@ -38,7 +38,7 @@ epicsShareExtern volatile int interruptAccept;
epicsShareExtern int dbAccessDebugPUTF;
/* The database field and request types are defined in dbFldTypes.h*/
/* Data Base Request Options */
/* Data Base Request Options */
#define DBR_STATUS 0x00000001
#define DBR_UNITS 0x00000002
#define DBR_PRECISION 0x00000004
@@ -57,9 +57,9 @@ epicsShareExtern int dbAccessDebugPUTF;
* of 10 float values + DBR_STATUS and DBR_TIME options
*
* struct {
* DBRstatus
* DBRtime
* epicsFloat32 value[10]
* DBRstatus
* DBRtime
* epicsFloat32 value[10]
* } buffer;
*
* IMPORTANT!! The DBRoptions must be given in the order that they
@@ -74,9 +74,9 @@ epicsShareExtern int dbAccessDebugPUTF;
* rtnval=dbGetField(paddr,DBR_FLOAT,&buffer,&options,&number_elements);
*
* When dbGetField returns:
* rtnval is error status (0 means success)
* options has a bit set for each option that was accepted
* number_elements is actual number of elements obtained
* rtnval is error status (0 means success)
* options has a bit set for each option that was accepted
* number_elements is actual number of elements obtained
*
* The individual items can be refered to by the expressions::
*
@@ -90,9 +90,9 @@ epicsShareExtern int dbAccessDebugPUTF;
* The following is also a valid declaration:
*
* typedef struct {
* DBRstatus
* DBRtime
* epicsFloat32 value[10]
* DBRstatus
* DBRtime
* epicsFloat32 value[10]
* } MYBUFFER;
*
* With this definition you can give definitions such as the following:
@@ -103,13 +103,13 @@ epicsShareExtern int dbAccessDebugPUTF;
/* Macros for defining each option */
#define DBRstatus \
epicsUInt16 status; /* alarm status */\
epicsUInt16 severity; /* alarm severity*/\
epicsUInt16 acks; /* alarm ack severity*/\
epicsUInt16 ackt; /* Acknowledge transient alarms?*/
epicsUInt16 status; /* alarm status */\
epicsUInt16 severity; /* alarm severity*/\
epicsUInt16 acks; /* alarm ack severity*/\
epicsUInt16 ackt; /* Acknowledge transient alarms?*/
#define DB_UNITS_SIZE 16
#define DBRunits \
char units[DB_UNITS_SIZE]; /* units */
char units[DB_UNITS_SIZE]; /* units */
#define DBRprecision union { \
long dp; /* number of decimal places*/\
double unused; /* for alignment */\
@@ -119,11 +119,11 @@ epicsShareExtern int dbAccessDebugPUTF;
* too late to change now. DBRprecision must be padded to
* maintain 8-byte alignment. */
#define DBRtime \
epicsTimeStamp time; /* time stamp*/
epicsTimeStamp time; /* time stamp*/
#define DBRenumStrs \
epicsUInt32 no_str; /* number of strings*/\
epicsInt32 padenumStrs; /*padding to force 8 byte align*/\
char strs[DB_MAX_CHOICES][MAX_STRING_SIZE]; /* string values */
epicsUInt32 no_str; /* number of strings*/\
epicsInt32 padenumStrs; /*padding to force 8 byte align*/\
char strs[DB_MAX_CHOICES][MAX_STRING_SIZE]; /* string values */
#define DBRgrLong \
epicsInt32 upper_disp_limit; /*upper limit of graph*/\
epicsInt32 lower_disp_limit; /*lower limit of graph*/
@@ -175,23 +175,23 @@ struct dbr_alDouble {DBRalDouble};
#ifndef INCerrMdefh
#include "errMdef.h"
#endif
#define S_db_notFound (M_dbAccess| 1) /*Process Variable Not Found*/
#define S_db_badDbrtype (M_dbAccess| 3) /*Illegal Database Request Type*/
#define S_db_noMod (M_dbAccess| 5) /*Attempt to modify noMod field*/
#define S_db_badLset (M_dbAccess| 7) /*Illegal Lock Set*/
#define S_db_precision (M_dbAccess| 9) /*get precision failed */
#define S_db_onlyOne (M_dbAccess|11) /*Only one element allowed*/
#define S_db_badChoice (M_dbAccess|13) /*Illegal choice*/
#define S_db_badField (M_dbAccess|15) /*Illegal field value*/
#define S_db_lsetLogic (M_dbAccess|17) /*Logic error generating lock sets*/
#define S_db_notFound (M_dbAccess| 1) /*Process Variable Not Found*/
#define S_db_badDbrtype (M_dbAccess| 3) /*Illegal Database Request Type*/
#define S_db_noMod (M_dbAccess| 5) /*Attempt to modify noMod field*/
#define S_db_badLset (M_dbAccess| 7) /*Illegal Lock Set*/
#define S_db_precision (M_dbAccess| 9) /*get precision failed */
#define S_db_onlyOne (M_dbAccess|11) /*Only one element allowed*/
#define S_db_badChoice (M_dbAccess|13) /*Illegal choice*/
#define S_db_badField (M_dbAccess|15) /*Illegal field value*/
#define S_db_lsetLogic (M_dbAccess|17) /*Logic error generating lock sets*/
#define S_db_noLSET (M_dbAccess|21) /*No link support table or entry*/
#define S_db_noRSET (M_dbAccess|31) /*missing record support entry table*/
#define S_db_noSupport (M_dbAccess|33) /*RSET or DSXT routine not defined*/
#define S_db_BadSub (M_dbAccess|35) /*Subroutine not found*/
#define S_db_noRSET (M_dbAccess|31) /*missing record support entry table*/
#define S_db_noSupport (M_dbAccess|33) /*RSET or DSXT routine not defined*/
#define S_db_BadSub (M_dbAccess|35) /*Subroutine not found*/
/*!!!! Do not change next line without changing src/rsrv/server.h!!!!!!!!*/
#define S_db_Pending (M_dbAccess|37) /*Request is pending*/
#define S_db_Pending (M_dbAccess|37) /*Request is pending*/
#define S_db_Blocked (M_dbAccess|39) /*Request is Blocked*/
#define S_db_Blocked (M_dbAccess|39) /*Request is Blocked*/
#define S_db_putDisabled (M_dbAccess|41) /*putFields are disabled*/
#define S_db_badHWaddr (M_dbAccess|43) /*Hardware link type not on INP/OUT*/
#define S_db_bkptSet (M_dbAccess|53) /*Breakpoint already set*/

View File

@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbBkpt.c */
/*
@@ -89,7 +89,7 @@ static long FIND_CONT_NODE(
* dbb() and dbd() add a breakpoint to a record or delete one
* from a record. dbstat() prints out comprehensive breakpoint
* status information.
*
*
* Breakpoints may be set on a per lockset basis. When a
* breakpoint is set in a lockset, a new task is created. A
* separate task gets created for _every_ lockset containing
@@ -201,7 +201,7 @@ static long FIND_CONT_NODE(
struct LS_LIST **ppnode,
struct dbCommon **pprecord)
{
struct dbAddr addr;
struct dbAddr addr;
struct LS_LIST *pnode;
struct dbCommon *precord = NULL;
long status = 0;
@@ -211,7 +211,7 @@ static long FIND_CONT_NODE(
* Search through stack, taking the first entry that
* is currently stopped at a breakpoint.
*/
pnode = (struct LS_LIST *) ellFirst(&lset_stack);
pnode = (struct LS_LIST *) ellFirst(&lset_stack);
while (pnode != NULL) {
if (pnode->precord != NULL) {
precord = pnode->precord;
@@ -219,7 +219,7 @@ static long FIND_CONT_NODE(
}
pnode = (struct LS_LIST *) ellNext((ELLNODE *)pnode);
}
if (pnode == NULL) {
printf(" BKPT> No records are currently stopped\n");
return(S_db_notStopped);
@@ -295,7 +295,7 @@ long dbb(const char *record_name)
precord = addr.precord;
if (precord->bkpt & BKPT_ON_MASK) {
printf(" BKPT> Breakpoint already set in this record\n");
printf(" BKPT> Breakpoint already set in this record\n");
return(S_db_bkptSet);
}
@@ -354,13 +354,13 @@ long dbb(const char *record_name)
epicsMutexUnlock(bkpt_stack_sem);
return(1);
}
pbl->precord = precord;
pbl->precord = precord;
ellAdd(&pnode->bp_list, (ELLNODE *)pbl);
/*
* Turn on breakpoint field in record
*/
precord->bkpt |= BKPT_ON_MASK;
precord->bkpt |= BKPT_ON_MASK;
if (! pnode->taskid) {
@@ -455,7 +455,7 @@ long dbd(const char *record_name)
}
if (pbl == NULL) {
printf(" BKPT> Logic Error in dbd()\n");
printf(" BKPT> Logic Error in dbd()\n");
precord->bkpt &= BKPT_OFF_MASK;
epicsMutexUnlock(bkpt_stack_sem);
dbScanUnlock(precord);
@@ -663,9 +663,9 @@ int dbBkpt(dbCommon *precord)
/*
* Take and give a semaphore to check for breakpoints
* every time a record is processed. Slow. Thank
* goodness breakpoint checking is turned off during
* normal operation.
* every time a record is processed. Slow. Thank
* goodness breakpoint checking is turned off during
* normal operation.
*/
epicsMutexMustLock(bkpt_stack_sem);
FIND_LOCKSET(precord, pnode);
@@ -696,7 +696,7 @@ int dbBkpt(dbCommon *precord)
* is used to determine if the source of processing is the
* continuation task or an external source. If it is an external
* source, queue its execution, but dump out of dbProcess without
* calling record support.
* calling record support.
*/
if (pnode->taskid && (epicsThreadGetIdSelf() != pnode->taskid)) {
/* CONTINUE TASK CANNOT ENTER HERE */
@@ -706,7 +706,7 @@ int dbBkpt(dbCommon *precord)
* not already exist.
*/
FIND_QUEUE_ENTRY(&pnode->ep_queue, pqe, precord);
if (pqe == NULL) {
pqe = (struct EP_LIST *) malloc(sizeof(struct EP_LIST));
@@ -746,7 +746,7 @@ int dbBkpt(dbCommon *precord)
/*
* Release the semaphore, letting the continuation
* task begin execution of the new entrypoint.
*/
*/
epicsEventSignal(pnode->ex_sem);
}
return(1);
@@ -903,7 +903,7 @@ long dbstat(void)
pnode->l_num, pnode->precord->name, ellCount(&pnode->bp_list), pnode->taskid);
/* for each entrypoint detected, print out entrypoint statistics */
pqe = (struct EP_LIST *) ellFirst(&pnode->ep_queue);
pqe = (struct EP_LIST *) ellFirst(&pnode->ep_queue);
while (pqe != NULL) {
double diff = epicsTimeDiffInSeconds(&time,&pqe->time);
if (diff) {

View File

@@ -5,9 +5,9 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbBkpt.h */
/* dbBkpt.h */
/*
* Author: Matthew Needes
* Date: 8-30-93
@@ -32,7 +32,7 @@ extern "C" {
struct BP_LIST {
ELLNODE *next_list;
ELLNODE *prev_list;
ELLNODE *prev_list;
struct dbCommon *precord;
};
@@ -41,7 +41,7 @@ struct BP_LIST {
* detected for a lockset.
*/
struct EP_LIST {
ELLNODE *next_list;
ELLNODE *next_list;
ELLNODE *prev_list;
struct dbCommon *entrypoint; /* pointer to entry point in lockset */
unsigned long count; /* number of times record processed */

View File

@@ -8,9 +8,9 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
*
* NOTES:
* 1) This interface is preliminary and will change in the future

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -641,7 +641,7 @@ static long getControlLimits(const struct link *plink,
*low = pca->controlLimits[0];
*high = pca->controlLimits[1];
}
epicsMutexUnlock(pca->lock);
epicsMutexUnlock(pca->lock);
return gotAttributes ? 0 : -1;
}
@@ -657,7 +657,7 @@ static long getGraphicLimits(const struct link *plink,
*low = pca->displayLimits[0];
*high = pca->displayLimits[1];
}
epicsMutexUnlock(pca->lock);
epicsMutexUnlock(pca->lock);
return gotAttributes ? 0 : -1;
}
@@ -687,7 +687,7 @@ static long getPrecision(const struct link *plink, short *precision)
pcaGetCheck
gotAttributes = pca->gotAttributes;
if (gotAttributes) *precision = pca->precision;
epicsMutexUnlock(pca->lock);
epicsMutexUnlock(pca->lock);
return gotAttributes ? 0 : -1;
}
@@ -890,8 +890,8 @@ static void eventCallback(struct event_handler_args arg)
/* Disable the record scan if we also have a string monitor */
doScan = !(plink->value.pv_link.pvlMask & pvlOptInpString);
/* fall through */
case DBR_TIME_STRING:
case DBR_TIME_SHORT:
case DBR_TIME_STRING:
case DBR_TIME_SHORT:
case DBR_TIME_FLOAT:
case DBR_TIME_CHAR:
case DBR_TIME_LONG:
@@ -970,7 +970,7 @@ done:
static void accessRightsCallback(struct access_rights_handler_args arg)
{
caLink *pca = (caLink *)ca_puser(arg.chid);
struct link *plink;
struct link *plink;
struct pv_link *ppv_link;
dbCommon *precord;

View File

@@ -22,41 +22,41 @@
#include "link.h"
/* link_action mask */
#define CA_CLEAR_CHANNEL 0x1
#define CA_CONNECT 0x2
#define CA_WRITE_NATIVE 0x4
#define CA_WRITE_STRING 0x8
#define CA_MONITOR_NATIVE 0x10
#define CA_MONITOR_STRING 0x20
#define CA_GET_ATTRIBUTES 0x40
#define CA_SYNC 0x1000
#define CA_CLEAR_CHANNEL 0x1
#define CA_CONNECT 0x2
#define CA_WRITE_NATIVE 0x4
#define CA_WRITE_STRING 0x8
#define CA_MONITOR_NATIVE 0x10
#define CA_MONITOR_STRING 0x20
#define CA_GET_ATTRIBUTES 0x40
#define CA_SYNC 0x1000
/* write type */
#define CA_PUT 0x1
#define CA_PUT_CALLBACK 0x2
typedef struct caLink
{
ELLNODE node;
int refcount;
epicsMutexId lock;
struct link *plink;
char *pvname;
chid chid;
short link_action;
ELLNODE node;
int refcount;
epicsMutexId lock;
struct link *plink;
char *pvname;
chid chid;
short link_action;
/* The following have new values after each data event*/
epicsEnum16 sevr;
epicsEnum16 stat;
epicsTimeStamp timeStamp;
epicsEnum16 sevr;
epicsEnum16 stat;
epicsTimeStamp timeStamp;
/* The following have values after connection*/
short dbrType;
short dbrType;
size_t elementSize; /* size of one element in pgetNative */
unsigned long nelements; /* PVs max array size */
unsigned long usedelements; /* currently used in pgetNative */
unsigned long putnelements; /* currently used in pputNative */
char hasReadAccess;
char hasWriteAccess;
char hasReadAccess;
char hasWriteAccess;
char isConnected;
char gotFirstConnection;
char gotFirstConnection;
/* The following are for dbCaAddLinkCallback */
dbCaCallback connect;
dbCaCallback monitor;
@@ -67,7 +67,7 @@ typedef struct caLink
void *putUserPvt;
/* The following are for access to additional attributes*/
char gotAttributes;
dbCaCallback getAttributes;
dbCaCallback getAttributes;
void *getAttributesPvt;
/* The following have values after getAttribEventCallback*/
double controlLimits[2];
@@ -76,22 +76,22 @@ typedef struct caLink
short precision;
char units[MAX_UNITS_SIZE]; /* units of value */
/* The following are for handling data*/
void *pgetNative;
char *pgetString;
void *pputNative;
char *pputString;
evid evidNative;
evid evidString;
char gotInNative;
char gotInString;
char gotOutNative;
char gotOutString;
char newOutNative;
char newOutString;
void *pgetNative;
char *pgetString;
void *pputNative;
char *pputString;
evid evidNative;
evid evidString;
char gotInNative;
char gotInString;
char gotOutNative;
char gotOutString;
char newOutNative;
char newOutString;
unsigned char scanningOnce;
/* The following are for dbcar*/
unsigned long nDisconnect;
unsigned long nNoWrite; /*only modified by dbCaPutLink*/
unsigned long nDisconnect;
unsigned long nNoWrite; /*only modified by dbCaPutLink*/
unsigned long nUpdate;
}caLink;

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbCaTest.c */
@@ -155,7 +155,7 @@ done:
printf(" (%lu disconnects, %lu writes prohibited)\n\n",
nDisconnect, nNoWrite);
dbFinishEntry(pdbentry);
if ( level > 2 && dbCaClientContext != 0 ) {
ca_context_status ( dbCaClientContext, level - 2 );
}

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef INC_dbCaTest_H

View File

@@ -37,6 +37,7 @@
#include "link.h"
#include "recSup.h"
#include "special.h"
#include "alarm.h"
typedef struct parseContext {
dbChannel *chan;
@@ -601,6 +602,7 @@ long dbChannelOpen(dbChannel *chan)
probe.field_type = dbChannelExportType(chan);
probe.no_elements = dbChannelElements(chan);
probe.field_size = dbChannelFieldSize(chan);
probe.sevr = NO_ALARM;
p = probe;
/*

View File

@@ -21,9 +21,9 @@
#include "ellLib.h"
#include "epicsTypes.h"
#include "errMdef.h"
#include "shareLib.h"
#include "db_field_log.h"
#include "dbEvent.h"
#include "dbCoreAPI.h"
#ifdef __cplusplus
extern "C" {
@@ -148,14 +148,14 @@ struct chFilter {
struct dbCommon;
struct dbFldDes;
epicsShareFunc void dbChannelInit (void);
epicsShareFunc void dbChannelExit(void);
epicsShareFunc long dbChannelTest(const char *name);
epicsShareFunc dbChannel * dbChannelCreate(const char *name);
epicsShareFunc long dbChannelOpen(dbChannel *chan);
DBCORE_API void dbChannelInit (void);
DBCORE_API void dbChannelExit(void);
DBCORE_API long dbChannelTest(const char *name);
DBCORE_API dbChannel * dbChannelCreate(const char *name);
DBCORE_API long dbChannelOpen(dbChannel *chan);
/*Following is also defined in db_convert.h*/
epicsShareExtern unsigned short dbDBRnewToDBRold[];
DBCORE_API extern unsigned short dbDBRnewToDBRold[];
/* In the following macros pChan is dbChannel* */
@@ -206,25 +206,25 @@ epicsShareExtern unsigned short dbDBRnewToDBRold[];
#define dbChannelField(pChan) ((pChan)->addr.pfield)
epicsShareFunc long dbChannelGet(dbChannel *chan, short type,
DBCORE_API long dbChannelGet(dbChannel *chan, short type,
void *pbuffer, long *options, long *nRequest, void *pfl);
epicsShareFunc long dbChannelGetField(dbChannel *chan, short type,
DBCORE_API long dbChannelGetField(dbChannel *chan, short type,
void *pbuffer, long *options, long *nRequest, void *pfl);
epicsShareFunc long dbChannelPut(dbChannel *chan, short type,
DBCORE_API long dbChannelPut(dbChannel *chan, short type,
const void *pbuffer, long nRequest);
epicsShareFunc long dbChannelPutField(dbChannel *chan, short type,
DBCORE_API long dbChannelPutField(dbChannel *chan, short type,
const void *pbuffer, long nRequest);
epicsShareFunc void dbChannelShow(dbChannel *chan, int level,
DBCORE_API void dbChannelShow(dbChannel *chan, int level,
const unsigned short indent);
epicsShareFunc void dbChannelFilterShow(dbChannel *chan, int level,
DBCORE_API void dbChannelFilterShow(dbChannel *chan, int level,
const unsigned short indent);
epicsShareFunc void dbChannelDelete(dbChannel *chan);
DBCORE_API void dbChannelDelete(dbChannel *chan);
epicsShareFunc void dbRegisterFilter(const char *key, const chFilterIf *fif, void *puser);
epicsShareFunc db_field_log* dbChannelRunPreChain(dbChannel *chan, db_field_log *pLogIn);
epicsShareFunc db_field_log* dbChannelRunPostChain(dbChannel *chan, db_field_log *pLogIn);
epicsShareFunc const chFilterPlugin * dbFindFilter(const char *key, size_t len);
epicsShareFunc void dbChannelMakeArrayCopy(void *pvt, db_field_log *pfl, dbChannel *chan);
DBCORE_API void dbRegisterFilter(const char *key, const chFilterIf *fif, void *puser);
DBCORE_API db_field_log* dbChannelRunPreChain(dbChannel *chan, db_field_log *pLogIn);
DBCORE_API db_field_log* dbChannelRunPostChain(dbChannel *chan, db_field_log *pLogIn);
DBCORE_API const chFilterPlugin * dbFindFilter(const char *key, size_t len);
DBCORE_API void dbChannelMakeArrayCopy(void *pvt, db_field_log *pfl, dbChannel *chan);
#ifdef __cplusplus
}

View File

@@ -7,10 +7,10 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
/*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
*/
#include <string>
@@ -48,7 +48,7 @@ dbChannelIO::~dbChannelIO ()
{
}
void dbChannelIO::destructor ( CallbackGuard & cbGuard,
void dbChannelIO::destructor ( CallbackGuard & cbGuard,
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );

View File

@@ -9,9 +9,9 @@
\*************************************************************************/
/*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
*
* NOTES:
* 1) This interface is preliminary and will change in the future

View File

@@ -1,268 +0,0 @@
#*************************************************************************
# Copyright (c) 2007 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************
%#include "epicsTypes.h"
%#include "link.h"
field(NAME,DBF_STRING) {
prompt("Record Name")
special(SPC_NOMOD)
size(61)
}
field(DESC,DBF_STRING) {
prompt("Descriptor")
promptgroup("10 - Common")
size(41)
}
field(ASG,DBF_STRING) {
prompt("Access Security Group")
promptgroup("10 - Common")
special(SPC_AS)
size(29)
}
field(SCAN,DBF_MENU) {
prompt("Scan Mechanism")
promptgroup("20 - Scan")
special(SPC_SCAN)
interest(1)
menu(menuScan)
}
field(PINI,DBF_MENU) {
prompt("Process at iocInit")
promptgroup("20 - Scan")
interest(1)
menu(menuPini)
}
field(PHAS,DBF_SHORT) {
prompt("Scan Phase")
promptgroup("20 - Scan")
special(SPC_SCAN)
interest(1)
}
field(EVNT,DBF_STRING) {
prompt("Event Name")
promptgroup("20 - Scan")
special(SPC_SCAN)
size(40)
interest(1)
}
field(TSE,DBF_SHORT) {
prompt("Time Stamp Event")
promptgroup("20 - Scan")
interest(1)
}
field(TSEL,DBF_INLINK) {
prompt("Time Stamp Link")
promptgroup("20 - Scan")
interest(1)
}
field(DTYP,DBF_DEVICE) {
prompt("Device Type")
promptgroup("10 - Common")
interest(1)
}
field(DISV,DBF_SHORT) {
prompt("Disable Value")
promptgroup("20 - Scan")
initial("1")
}
field(DISA,DBF_SHORT) {
prompt("Disable")
}
field(SDIS,DBF_INLINK) {
prompt("Scanning Disable")
promptgroup("20 - Scan")
interest(1)
}
%#include "epicsMutex.h"
field(MLOK,DBF_NOACCESS) {
prompt("Monitor lock")
special(SPC_NOMOD)
interest(4)
extra("epicsMutexId mlok")
}
%#include "ellLib.h"
field(MLIS,DBF_NOACCESS) {
prompt("Monitor List")
special(SPC_NOMOD)
interest(4)
extra("ELLLIST mlis")
}
field(BKLNK,DBF_NOACCESS) {
prompt("Backwards link tracking")
special(SPC_NOMOD)
interest(4)
extra("ELLLIST bklnk")
}
field(DISP,DBF_UCHAR) {
prompt("Disable putField")
}
field(PROC,DBF_UCHAR) {
prompt("Force Processing")
pp(TRUE)
interest(3)
}
field(STAT,DBF_MENU) {
prompt("Alarm Status")
special(SPC_NOMOD)
menu(menuAlarmStat)
initial("UDF")
}
field(SEVR,DBF_MENU) {
prompt("Alarm Severity")
special(SPC_NOMOD)
menu(menuAlarmSevr)
}
field(NSTA,DBF_MENU) {
prompt("New Alarm Status")
special(SPC_NOMOD)
interest(2)
menu(menuAlarmStat)
}
field(NSEV,DBF_MENU) {
prompt("New Alarm Severity")
special(SPC_NOMOD)
interest(2)
menu(menuAlarmSevr)
}
field(ACKS,DBF_MENU) {
prompt("Alarm Ack Severity")
special(SPC_NOMOD)
interest(2)
menu(menuAlarmSevr)
}
field(ACKT,DBF_MENU) {
prompt("Alarm Ack Transient")
promptgroup("70 - Alarm")
special(SPC_NOMOD)
interest(2)
menu(menuYesNo)
initial("YES")
}
field(DISS,DBF_MENU) {
prompt("Disable Alarm Sevrty")
promptgroup("70 - Alarm")
interest(1)
menu(menuAlarmSevr)
}
field(LCNT,DBF_UCHAR) {
prompt("Lock Count")
special(SPC_NOMOD)
interest(2)
}
field(PACT,DBF_UCHAR) {
prompt("Record active")
special(SPC_NOMOD)
interest(1)
}
field(PUTF,DBF_UCHAR) {
prompt("dbPutField process")
special(SPC_NOMOD)
interest(1)
}
field(RPRO,DBF_UCHAR) {
prompt("Reprocess ")
special(SPC_NOMOD)
interest(1)
}
field(ASP,DBF_NOACCESS) {
prompt("Access Security Pvt")
special(SPC_NOMOD)
interest(4)
extra("struct asgMember *asp")
}
field(PPN,DBF_NOACCESS) {
prompt("pprocessNotify")
special(SPC_NOMOD)
interest(4)
extra("struct processNotify *ppn")
}
field(PPNR,DBF_NOACCESS) {
prompt("pprocessNotifyRecord")
special(SPC_NOMOD)
interest(4)
extra("struct processNotifyRecord *ppnr")
}
field(SPVT,DBF_NOACCESS) {
prompt("Scan Private")
special(SPC_NOMOD)
interest(4)
extra("struct scan_element *spvt")
}
field(RSET,DBF_NOACCESS) {
prompt("Address of RSET")
special(SPC_NOMOD)
interest(4)
extra("struct typed_rset *rset")
}
%#include "devSup.h"
field(DSET,DBF_NOACCESS) {
prompt("DSET address")
special(SPC_NOMOD)
interest(4)
extra("unambiguous_dset *dset")
}
field(DPVT,DBF_NOACCESS) {
prompt("Device Private")
special(SPC_NOMOD)
interest(4)
extra("void *dpvt")
}
field(RDES,DBF_NOACCESS) {
prompt("Address of dbRecordType")
special(SPC_NOMOD)
interest(4)
extra("struct dbRecordType *rdes")
}
field(LSET,DBF_NOACCESS) {
prompt("Lock Set")
special(SPC_NOMOD)
interest(4)
extra("struct lockRecord *lset")
}
field(PRIO,DBF_MENU) {
prompt("Scheduling Priority")
promptgroup("20 - Scan")
special(SPC_SCAN)
interest(1)
menu(menuPriority)
}
field(TPRO,DBF_UCHAR) {
prompt("Trace Processing")
}
field(BKPT,DBF_NOACCESS) {
prompt("Break Point")
special(SPC_NOMOD)
interest(1)
extra("char bkpt")
}
field(UDF,DBF_UCHAR) {
prompt("Undefined")
promptgroup("10 - Common")
pp(TRUE)
interest(1)
initial("1")
}
field(UDFS,DBF_MENU) {
prompt("Undefined Alarm Sevrty")
promptgroup("70 - Alarm")
interest(1)
menu(menuAlarmSevr)
initial("INVALID")
}
%#include "epicsTime.h"
field(TIME,DBF_NOACCESS) {
prompt("Time")
special(SPC_NOMOD)
interest(2)
extra("epicsTimeStamp time")
}
field(FLNK,DBF_FWDLINK) {
prompt("Forward Process Link")
promptgroup("20 - Scan")
interest(1)
}

View File

@@ -0,0 +1,521 @@
#*************************************************************************
# Copyright (c) 2007 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************
=head3 Operator Display Parameters
The B<NAME> field contains the record name which must be unique within an
EPICS Channel Access name space. The name is supplied by the application
developer and is the means of identifying a specific record. The name has a
maximum length of 60 characters and should use only this limited set of
characters:
a-z A-Z 0-9 _ - : [ ] < > ;
The B<DESC> field may be set to provide a meaningful description of the
record's purpose. Maximum length is 40 characters.
=fields NAME, DESC
=cut
%#include "epicsTypes.h"
%#include "link.h"
field(NAME,DBF_STRING) {
prompt("Record Name")
special(SPC_NOMOD)
size(61)
}
field(DESC,DBF_STRING) {
prompt("Descriptor")
promptgroup("10 - Common")
size(41)
}
field(ASG,DBF_STRING) {
prompt("Access Security Group")
promptgroup("10 - Common")
special(SPC_AS)
size(29)
}
=head3 Scan Fields
These fields contain information related to how and when a record processes. A
few records have unique fields that also affect how they process. These
fields, if any, will be listed and explained in the section for each record.
The B<SCAN> field specifies the scanning period for periodic record scans or the
scan type for non-periodic record scans. The default set of values for SCAN can
be found in L<menuScan.dbd|menuScan>.
The choices provided by this menu are:
=over
=item *
C<Passive> for the record scan to be triggered by other records or Channel
Access
=item *
C<Event> for event-driven scan
=item *
C<I/O Intr> for interrupt-driven scan
=item *
A set of periodic scan intervals
=back
Additional periodic scan rates may be defined for individual IOCs by making a
local copy of menuScan.dbd and adding more choices as required. Scan rates
should normally be defined in order, with the fastest rates appearing first.
Scan periods may now be specified in seconds, minutes, hours or Hertz/Hz, and
plural time units will also be accepted (seconds are used if no unit is
mentioned in the choice string). For example the rates given below are all
valid:
1 hour
0.5 hours
15 minutes
3 seconds
1 second
2 Hertz
The B<PINI> field specifies record processing at initialization. If it is set
to YES during database configuration, the record is processed once at IOC
initialization (before the normal scan tasks are started).
The B<PHAS> field orders the records within a specific SCAN group. This is not
meaningful for passive records. All records of a specified phase are processed
before those with higher phase number. Whenever possible it is better to use
linked passive records to enforce the order of processing rather than a phase
number.
The B<EVNT> field specifies an event number. This event number is used if the
SCAN field is set to C<Event>. All records with scan type C<Event> and the
same EVNT value will be processed when a call to post_event for EVNT is made.
The call to post_event is: post_event(short event_number).
The B<PRIO> field specifies the scheduling priority for processing records
with SCAN=C<I/O Event> and asynchronous record completion tasks.
The B<DISV> field specifies a "disable value". Record processing is
immediately terminated if the value of this field is equal to the value of the
DISA field, i.e. the record is disabled. Note that field values of a record
can be changed by database put or Channel Access, even if a record is
disabled.
The B<DISA> field contains the value that is compared with DISV to determine
if the record is disabled. The value of the DISA field is obtained via SDIS if
SDIS is a database or channel access link. If SDIS is not a database or
channel access link, then DISA can be set via dbPutField or dbPutLink.
If the B<PROC> field of a record is written to, the record is processed.
The B<DISS> field defines the record's "disable severity". If this field is
not NO_ALARM and the record is disabled, the record will be put into alarm
with this severity and a status of DISABLE_ALARM.
The B<LSET> field contains the lock set to which this record belongs. All
records linked in any way via input, output, or forward database links belong
to the same lock set. Lock sets are determined at IOC initialization time, and
are updated whenever a database link is added, removed or altered.
The B<LCNT> field counts the number of times dbProcess finds the record active
during successive scans, i.e. PACT is TRUE. If dbProcess finds the record
active MAX_LOCK times (currently set to 10) it raises a SCAN_ALARM.
The B<PACT> field is TRUE while the record is being processed. For
asynchronous records PACT can be TRUE from the time record processing is
started until the asynchronous completion occurs. As long as PACT is TRUE,
dbProcess will not call the record processing routine. See Application
Developers Guide for details on usage of PACT.
The B<FLNK> field is a database link to another record (the "target" record).
Processing a record with a specified FLNK field will force processing of the
target record, provided the target record's SCAN field is set to C<Passive>.
The B<SPVT> field is for internal use by the scanning system.
=fields SCAN, PINI, PHAS, EVNT, PRIO, DISV, DISA, SDIS, PROC, DISS, LCNT, PACT, FLNK, SPVT
=cut
field(SCAN,DBF_MENU) {
prompt("Scan Mechanism")
promptgroup("20 - Scan")
special(SPC_SCAN)
interest(1)
menu(menuScan)
}
field(PINI,DBF_MENU) {
prompt("Process at iocInit")
promptgroup("20 - Scan")
interest(1)
menu(menuPini)
}
field(PHAS,DBF_SHORT) {
prompt("Scan Phase")
promptgroup("20 - Scan")
special(SPC_SCAN)
interest(1)
}
field(EVNT,DBF_STRING) {
prompt("Event Name")
promptgroup("20 - Scan")
special(SPC_SCAN)
size(40)
interest(1)
}
field(TSE,DBF_SHORT) {
prompt("Time Stamp Event")
promptgroup("20 - Scan")
interest(1)
}
field(TSEL,DBF_INLINK) {
prompt("Time Stamp Link")
promptgroup("20 - Scan")
interest(1)
}
field(DTYP,DBF_DEVICE) {
prompt("Device Type")
promptgroup("10 - Common")
interest(1)
}
field(DISV,DBF_SHORT) {
prompt("Disable Value")
promptgroup("20 - Scan")
initial("1")
}
field(DISA,DBF_SHORT) {
prompt("Disable")
}
field(SDIS,DBF_INLINK) {
prompt("Scanning Disable")
promptgroup("20 - Scan")
interest(1)
}
%#include "epicsMutex.h"
field(MLOK,DBF_NOACCESS) {
prompt("Monitor lock")
special(SPC_NOMOD)
interest(4)
extra("epicsMutexId mlok")
}
%#include "ellLib.h"
field(MLIS,DBF_NOACCESS) {
prompt("Monitor List")
special(SPC_NOMOD)
interest(4)
extra("ELLLIST mlis")
}
field(BKLNK,DBF_NOACCESS) {
prompt("Backwards link tracking")
special(SPC_NOMOD)
interest(4)
extra("ELLLIST bklnk")
}
field(DISP,DBF_UCHAR) {
prompt("Disable putField")
}
field(PROC,DBF_UCHAR) {
prompt("Force Processing")
pp(TRUE)
interest(3)
}
=head3 Alarm Fields
These fields indicate the status and severity of alarms, or else determine the
how and when alarms are triggered. Of course, many records have alarm-related
fields not common to all records. These fields are listed and explained in the
appropriate section on each record.
The B<STAT> field contains the current alarm status.
The B<SEVR> field contains the current alarm severity.
These two fields are seen outside database access. The B<NSTA> and B<NSEV>
fields are used by the database access, record support, and device support
routines to set new alarm status and severity values. Whenever any software
component discovers an alarm condition, it uses the following macro function:
recGblSetSevr(precord,new_status,new_severity) This ensures that the current
alarm severity is set equal to the highest outstanding alarm. The file alarm.h
defines all allowed alarm status and severity values.
The B<ACKS> field contains the highest unacknowledged alarm severity.
The B<ACKT> field specifies if it is necessary to acknowledge transient
alarms.
The B<UDF> indicates if the record's value is B<U>nB<D>eB<F>ined. Typically
this is caused by a failure in device support, the fact that the record has
never been processed, or that the VAL field currently contains a NaN (not a
number). UDF is initialized to TRUE at IOC initialization. Record and device
support routines which write to the VAL field are responsible for setting UDF.
=fields STAT, SEVR, NSTA, NSEV, ACKS, ACKT, UDF
=cut
field(STAT,DBF_MENU) {
prompt("Alarm Status")
special(SPC_NOMOD)
menu(menuAlarmStat)
initial("UDF")
}
field(SEVR,DBF_MENU) {
prompt("Alarm Severity")
special(SPC_NOMOD)
menu(menuAlarmSevr)
}
field(NSTA,DBF_MENU) {
prompt("New Alarm Status")
special(SPC_NOMOD)
interest(2)
menu(menuAlarmStat)
}
field(NSEV,DBF_MENU) {
prompt("New Alarm Severity")
special(SPC_NOMOD)
interest(2)
menu(menuAlarmSevr)
}
field(ACKS,DBF_MENU) {
prompt("Alarm Ack Severity")
special(SPC_NOMOD)
interest(2)
menu(menuAlarmSevr)
}
field(ACKT,DBF_MENU) {
prompt("Alarm Ack Transient")
promptgroup("70 - Alarm")
special(SPC_NOMOD)
interest(2)
menu(menuYesNo)
initial("YES")
}
field(DISS,DBF_MENU) {
prompt("Disable Alarm Sevrty")
promptgroup("70 - Alarm")
interest(1)
menu(menuAlarmSevr)
}
field(LCNT,DBF_UCHAR) {
prompt("Lock Count")
special(SPC_NOMOD)
interest(2)
}
field(PACT,DBF_UCHAR) {
prompt("Record active")
special(SPC_NOMOD)
interest(1)
}
field(PUTF,DBF_UCHAR) {
prompt("dbPutField process")
special(SPC_NOMOD)
interest(1)
}
field(RPRO,DBF_UCHAR) {
prompt("Reprocess ")
special(SPC_NOMOD)
interest(1)
}
field(ASP,DBF_NOACCESS) {
prompt("Access Security Pvt")
special(SPC_NOMOD)
interest(4)
extra("struct asgMember *asp")
}
field(PPN,DBF_NOACCESS) {
prompt("pprocessNotify")
special(SPC_NOMOD)
interest(4)
extra("struct processNotify *ppn")
}
field(PPNR,DBF_NOACCESS) {
prompt("pprocessNotifyRecord")
special(SPC_NOMOD)
interest(4)
extra("struct processNotifyRecord *ppnr")
}
field(SPVT,DBF_NOACCESS) {
prompt("Scan Private")
special(SPC_NOMOD)
interest(4)
extra("struct scan_element *spvt")
}
=head3 Device Fields
The B<RSET> field contains the address of the Record Support Entry Table. See
the Application Developers Guide for details on usage.
The B<DSET> field contains the address of Device Support Entry Table. The
value of this field is determined at IOC initialization time. Record support
routines use this field to locate their device support routines.
The B<DPVT> field is is for private use of the device support modules.
=fields RSET, DSET, DPVT
=cut
field(RSET,DBF_NOACCESS) {
prompt("Address of RSET")
special(SPC_NOMOD)
interest(4)
extra("struct typed_rset *rset")
}
%#include "devSup.h"
field(DSET,DBF_NOACCESS) {
prompt("DSET address")
special(SPC_NOMOD)
interest(4)
extra("unambiguous_dset *dset")
}
field(DPVT,DBF_NOACCESS) {
prompt("Device Private")
special(SPC_NOMOD)
interest(4)
extra("void *dpvt")
}
field(RDES,DBF_NOACCESS) {
prompt("Address of dbRecordType")
special(SPC_NOMOD)
interest(4)
extra("struct dbRecordType *rdes")
}
field(LSET,DBF_NOACCESS) {
prompt("Lock Set")
special(SPC_NOMOD)
interest(4)
extra("struct lockRecord *lset")
}
field(PRIO,DBF_MENU) {
prompt("Scheduling Priority")
promptgroup("20 - Scan")
special(SPC_SCAN)
interest(1)
menu(menuPriority)
}
=head3 Debugging Fields
The B<TPRO> field is used for trace processing. If this field is non-zero a
message is printed whenever this record is processed, and when any other
record in the same lock-set is processed by a database link from this record.
The B<BKPT> field indicates if there is a breakpoint set at this record. This
supports setting a debug breakpoint in the record processing. STEP through
database processing can be supported using this.
=fields TPRO, BKPT
=head3 Miscellaneous Fields
The B<ASG> field contains a character string value defining the access
security group for this record. If left empty, the record is placed in group
DEFAULT.
The B<ASP> field is a field for private use of the access security system.
The B<DISP> field controls dbPutFields to this record which are normally
issued by channel access. If the field is set to TRUE all dbPutFields
directed to this record are ignored except to the field DISP itself.
The B<DTYP> field specifies the device type for the record. Each record type
has its own set of device support routines which are specified in
devSup.ASCII. If a record type does not have any associated device support,
DTYP and DSET are meaningless.
The B<MLOK> field contains the monitor lock. The lock used by the monitor
routines when the monitor list is being used. The list is locked whenever
monitors are being scheduled, invoked, or when monitors are being added to or
removed from the list. This field is accessed only by the dbEvent routines.
The B<MLIS> field is the head of the list of monitors connected to this
record. Each record support module is responsible for triggering monitors for
any fields that change as a result of record processing. Monitors are present
if mlis count is greater than zero. The call to trigger monitors is:
db_post_event(precord,&data,mask), where "mask" is some combination of
DBE_ALARM, DBE_VALUE, and DBE_LOG.
The B<PPN> field contains the address of a putNotify callback.
The B<PPNR> field contains the next record for PutNotify.
The B<PUTF> field is set to TRUE if dbPutField caused the current record
processing.
The B<RDES> field contains the address of dbRecordType
The B<RPRO> field specifies a reprocessing of the record when current
processing completes.
The B<TIME> field contains the time when this record was last processed in
standard format.
The B<TSE> field indicates the mechanism to use to get the time stamp. '0' -
call get time as before '-1' - call the time stamp driver and use the best
source available. '-2' - the device support provides the time stamp from the
hardware. Values between 1-255 request the time of the last occurance of a
generalTime event.
The B<TSEL> field contains an input link for obtaining the time stamp. If this
link references the .TIME field of a record then the time stamp of the
referenced record becomes the time stamp for this record as well. In this
case, an internal flag is set and ".TIME" is then overwritten by ".VAL". If
any other field is referenced, the field value is read and stored in the .TSE
field which is then used to acquire a timestamp.
=fields ASG, ASP, DISP, DTYP, MLOK, MLIS, PPN, PPNR, PUTF, RDES, RPRO, TIME, TSE, TSEL
=cut
field(TPRO,DBF_UCHAR) {
prompt("Trace Processing")
}
field(BKPT,DBF_NOACCESS) {
prompt("Break Point")
special(SPC_NOMOD)
interest(1)
extra("char bkpt")
}
field(UDF,DBF_UCHAR) {
prompt("Undefined")
promptgroup("10 - Common")
pp(TRUE)
interest(1)
initial("1")
}
field(UDFS,DBF_MENU) {
prompt("Undefined Alarm Sevrty")
promptgroup("70 - Alarm")
interest(1)
menu(menuAlarmSevr)
initial("INVALID")
}
%#include "epicsTime.h"
field(TIME,DBF_NOACCESS) {
prompt("Time")
special(SPC_NOMOD)
interest(2)
extra("epicsTimeStamp time")
}
field(FLNK,DBF_FWDLINK) {
prompt("Forward Process Link")
promptgroup("20 - Scan")
interest(1)
}

View File

@@ -0,0 +1,208 @@
#*************************************************************************
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************
=head1 Fields Common to Input Record Types
This section describes fields that are found in many input record types.
These fields usually have the same meaning whenever they are used.
See also L<Fields Common to All Record Types|dbCommonRecord> and L<Fields Common
to Output Record Types|dbCommonOutput>.
=head3 Input and Value Fields
The B<INP> field specifies an input link. It is used by the device support
routines to obtain input. For soft analog records it can be a constant, a
database link, or a channel access link.
The B<DTYP> field specifies the name of the device support module that will
input values. Each record type has its own set of device support routines. If
a record type does not have any associated device support, DTYP is
meaningless.
The B<RVAL> field contains - whenever possible - the raw data value exactly as
it is obtained from the hardware or from the associated device driver and
before it undergoes any conversions. The Soft Channel device support module
reads values directly into VAL, bypassing this field.
The B<VAL> field contains the record's final value, after any needed
conversions have been performed.
=head3 Device Input
A device input routine normally returns one of the following values to its
associated record support routine:
=over
=item *
0: Success and convert. The input value is in RVAL. The record support module
will compute VAL from RVAL.
=item *
2: Success, but don't convert. The device support module can specify this
value if it does not want any conversions. It might do this for two reasons:
=over
=item *
A hardware error is detected (in this case, it should also raise an alarm
condition).
=item *
The device support routine reads values directly into the VAL field and then
sets UDF to FALSE. For some record types the device support routine may have to
do other record-specific processing as well such as applying a smoothing filter
to the engineering units value.
=back
=back
=head3 Device Support for Soft Records
In most cases, two soft output device support modules are provided: Soft Channel
and Raw Soft Channel. Both allow INP to be a constant, a database link, or a
channel access link. The Soft Channel device support module reads input directly
into the VAL field and specifies that no value conversion should be performed.
This allows the record to store values in the data type of its VAL field. Note
that for Soft Channel input, the RVAL field is not used. The Raw Soft Channel
support module reads input into RVAL and indicates that any specified unit
conversions be performed.
The device support read routine normally calls C<dbGetLink()> which
fetches a value from the link.
If a value was returned by the link the UDF field is set to FALSE. The device
support read routine normally returns the status from C<dbGetLink()>.
=head3 Input Simulation Fields
The B<SIMM> field controls simulation mode.
By setting this field to YES or RAW, the record can be switched into
simulation mode of operation.
While in simulation mode, input will be obtained from SIOL instead of INP.
The B<SIML> field specifies the simulation mode location. This field can be a
constant, a database link, or a channel access link. If SIML is a database or
channel access link, then SIMM is read from SIML. If SIML is a constant link
then SIMM is initialized with the constant value, but can be changed via
database or channel access puts.
The B<SVAL> field contains the simulation value. This is the record's input
value, in engineering units, when the record is switched into simulation mode,
i.e., SIMM is set to YES or RAW. If the record type supports conversion,
setting SIMM to RAW causes SVAL to be written to RVAL and the conversion to
be done.
The B<SIOL> field is a link that can be used to fetch the simulation value. The
link can be a constant, a database link, or a channel access link. If SIOL is a
database or channel access link, then SVAL is read from SIOL. If SIOL is a
constant link then SVAL is initialized with the constant value but can be
changed via database or channel access puts.
The B<SIMS> field specifies the simulation mode alarm severity. When this
field is set to a value other than NO_ALARM and the record is in simulation
mode, it will be put into alarm with this severity and a status of SIMM_ALARM.
The B<SDLY> field specifies a delay (in seconds) to implement asynchronous
processing in simulation mode. A positive SDLY value will be used as delay
between the first and second phase of processing in simulation mode.
A negative value (default) specifies synchronous processing.
The B<SSCN> field specifies the SCAN mechanism to be used in simulation mode.
This is specifically useful for 'I/O Intr' scanned records, which would
otherwise never be scanned in simulation mode.
=head3 Simulation Mode for Input Records
An input record can be switched into simulation mode of operation by setting
the value of SIMM to YES or RAW.
During simulation, the record will be put into alarm with a severity of SIMS
and a status of SIMM_ALARM.
-- (SIMM = NO?)
/ (if supported and directed by device support,
/ INP -> RVAL -- convert -> VAL),
(else INP -> VAL)
SIML -> SIMM
\
-- (SIMM = YES?) SIOL -> SVAL -> VAL
\
-- (SIMM = RAW?) SIOL -> SVAL -> RVAL -- convert -> VAL
If SIMM is set to YES, the input value, in engineering units, will be obtained
from SIOL instead of INP and directly written to the VAL field.
If SIMM is set to RAW, the value read through SIOL will be truncated and
written to the RVAL field, followed by the regular raw value conversion.
While the record is in simulation mode, there will be no calls to device
support when the record is processed.
If SIOL contains a link, a TSE setting of "time from device" (-2) is honored
in simulation mode by taking the time stamp from the record that SIOL points
to.
Normally input records contain a private C<readValue()> routine which performs
the following steps:
=over
=item *
If PACT is TRUE, the device support read routine is called, status is set to
its return code, and readValue returns.
=item *
Call C<dbGetLink()> to get a new value for SIMM from SIML.
=item *
Check value of SIMM.
=item *
If SIMM is NO, then call the device support read routine, set status to its
return code, and return.
=item *
If SIMM is YES or RAW, then
=over
=item *
Set alarm status to SIMM_ALARM and severity to SIMS,
if SIMS is greater than zero.
=item *
If the record simulation processing is synchronous (SDLY < 0) or the record is
in the second phase of an asynchronous processing, call C<dbGetLink()>
to read the input value from SIOL into SVAL.
Set status to the return code from C<dbGetLink()>.
If the call succeeded and SIMM is YES, write the value to VAL and set the
status to 2 (don't convert),
if SIMM is RAW and the record type supports conversion, cast the value to RVAL
and leave the status as 0 (convert).
Otherwise (record is in first phase of an asynchronous processing), set up a
callback processing with the delay specified in SDLY.
=back
=item *
If SIMM is not YES, NO or RAW, a SOFT alarm with a severity of INVALID is
raised, and return status is set to -1.
=back

View File

@@ -0,0 +1,239 @@
#*************************************************************************
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************
=head1 Fields Common to Output Record Types
This section describes fields that are found in many output record types.
These fields usually have the same meaning whenever they are used.
See also L<Fields Common to All Record Types|dbCommonRecord> and L<Fields Common to
Input Records|dbCommonInput>.
=head3 Output and Value Fields
The B<OUT> field specifies an output link. It is used by the device support
routines to decide where to send output. For soft records, it can be a
constant, a database link, or a channel access link. If the link is a
constant, the result is no output.
The B<DTYP> field specifies the name of the device support module that will
input values. Each record type has its own set of device support routines. If
a record type does not have any associated device support, DTYP is
meaningless.
The B<VAL> field contains the desired value before any conversions to raw
output have been performed.
The B<OVAL> field is used to decide when to invoke monitors. Archive and value
change monitors are invoked if OVAL is not equal to VAL. If a record type
needs to make adjustments, OVAL is used to enforce the maximum rate of change
limit before converting the desired value to a raw value.
The B<RVAL> field contains - whenever possible - the actual value sent to the
hardware itself or to the associated device driver.
The B<RBV> field contains - whenever possible - the actual read back value
obtained from the hardware itself or from the associated device driver.
=head3 Device Support for Soft Records
Normally two soft output device support modules are provided, Soft Channel and
and Raw Soft Channel. Both write a value through the output link OUT.
The Soft Channel module writes output from the value associated with OVAL or
VAL (if OVAL does not exist). The Raw Soft Channel support module writes the
value associated with the RVAL field after conversion has been performed.
The device support write routine normally calls C<dbPutLink()> which writes a
value through the OUT link, and returns the status from that call.
=head3 Input and Mode Select Fields
The B<DOL> field is a link from which the desired output value can be fetched.
DOL can be a constant, a database link, or a channel access link. If DOL is a
database or channel access link and OMSL is closed_loop, then VAL is obtained
from DOL.
The B<OMSL> field selects the output mode. This field has either the value
C<supervisory> or C<closed_loop>. DOL is used to fetch VAL only if OMSL has the
value C<closed_loop>. By setting this field a record can be switched between
supervisory and closed loop mode of operation. While in closed loop mode, the
VAL field cannot be set via dbPuts.
=head3 Output Mode Selection
The fields DOL and OMSL are used to allow the output record to be part of a
closed loop control algorithm. OMSL is meaningful only if DOL refers to a
database or channel access link. It can have the values C<supervisory> or
C<closed_loop>. If the mode is C<supervisory>, then nothing is done to VAL. If
the mode is C<closed_loop> and the record type does not contain an OIF field,
then each time the record is processed, VAL is set equal to the value obtained
from the location referenced by DOL. If the mode is C<closed_loop> in record
types with an OIF field and OIF is Full, VAL is set equal to the value obtained
from the location referenced by DOL; if OIF is Incremental VAL is incremented by
the value obtained from DOL.
=head3 Invalid Output Action Fields
The B<IVOA> field specifies the output action for the case that the record is
put into an INVALID alarm severity. IVOA can be one of the following actions:
=over
=item *
C<Continue normally>
=item *
C<Don't drive outputs>
=item *
C<Set output to IVOV>
=back
The B<IVOV> field contains the value for the IVOA action C<Set output to IVOV>
in engineering units. If a new severity has been set to INVALID and IVOA is
C<Set output to IVOV>, then VAL is set to IVOV and converted to RVAL before
device support is called.
=head3 Invalid Alarm Output Action
Whenever an output record is put into INVALID alarm severity, IVOA specifies
an action to take. The record support process routine for each output record
contains code which performs the following steps.
=over
=item *
If new severity is less than INVALID, then call C<writeValue()>:
=item *
Else do the following:
=over
=item *
If IVOA is C<Continue normally> then call C<writeValue()>.
=item *
If IVOA is C<Don't drive outputs> then do not write output.
=item *
If IVOA is C<Set output to IVOV> then set VAL to IVOV, call C<convert()> if
necessary, and then call C<writeValue()>.
=item *
If IVOA not one of the above, an error message is generated.
=back
=back
=head3 Output Simulation Fields
The B<SIMM> field controls simulation mode. It has either the value YES or NO.
By setting this field to YES, the record can be switched into simulation mode
of operation. While in simulation mode, output will be forwarded through SIOL
instead of OUT.
The B<SIML> field specifies the simulation mode location. This field can be a
constant, a database link, or a channel access link. If SIML is a database or
channel access link, then SIMM is read from SIML. If SIML is a constant link
then SIMM is initialized with the constant value, but can be changed via
database or channel access puts.
The B<SIOL> field is a link that the output value is written to when the record
is in simulation mode.
The B<SIMS> field specifies the simulation mode alarm severity. When this
field is set to a value other than NO_ALARM and the record is in simulation
mode, it will be put into alarm with this severity and a status of SIMM_ALARM.
The B<SDLY> field specifies a delay (in seconds) to implement asynchronous
processing in simulation mode. A positive SDLY value will be used as delay
between the first and second phase of processing in simulation mode.
A negative value (default) specifies synchronous processing.
The B<SSCN> field specifies the SCAN mechanism to be used in simulation mode.
This is specifically useful for 'I/O Intr' scanned records, which would
otherwise never be scanned in simulation mode.
=head3 Simulation Mode for Output Records
An output record can be switched into simulation mode of operation by setting
the value of SIMM to YES. During simulation, the record will be put into alarm
with a severity of SIMS and a status of SIMM_ALARM. While in simulation mode,
output values, in engineering units, will be written to SIOL instead of OUT.
However, the output values are never converted. Also, while the record is in
simulation mode, there will be no calls to device support during record
processing.
Normally output records contain a private C<writeValue()> routine which performs
the following steps:
=over
=item *
If PACT is TRUE, the device support write routine is called, status is set to
its return code, and readValue returns.
=item *
Call C<dbGetLink()> to get a new value for SIMM if SIML is a DB_LINK or a
CA_LINK.
=item *
Check value of SIMM.
=item *
If SIMM is NO, then call the device support write routine, set status to its
return code, and return.
=item *
If SIMM is YES, then
=over
=item *
Set alarm status to SIMM_ALARM and severity to SIMS,
if SIMS is greater than zero.
=item *
If the record simulation processing is synchronous (SDLY < 0) or the record is
in the second phase of an asynchronous processing, call C<dbPutLink()>
to write the output value from VAL or OVAL to SIOL.
Otherwise (record is in first phase of an asynchronous processing), set up a
callback processing with the delay specified in SDLY.
=item *
Set status to the return code from C<dbPutLink()> and return.
=back
=item *
If SIMM is not YES or NO, a SOFT alarm with a severity of INVALID is
raised, and return status is set to -1.
=back

View File

@@ -1,12 +0,0 @@
#*************************************************************************
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
# National Laboratory.
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# EPICS BASE Versions 3.13.7
# and higher are distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************
recordtype(dbCommon) {
include "dbCommon.dbd"
}

View File

@@ -0,0 +1,20 @@
#*************************************************************************
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************
=head1 Fields Common to All Record Types
This section contains a description of the fields that are common to all record
types. These fields are defined in dbCommon.dbd.
See also L<Fields Common to Input Record Types|dbCommonInput> and L<Fields
Common to Output Record Types|dbCommonOutput>.
=recordtype dbCommon
=cut
recordtype(dbCommon) {
include "dbCommon.dbd.pod"
}

View File

@@ -6,10 +6,10 @@
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
/*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
*/
#include <limits.h>
@@ -123,7 +123,7 @@ cacChannel & dbContext::createChannel (
void dbContext::destroyChannel (
CallbackGuard & cbGuard,
epicsGuard < epicsMutex > & guard,
epicsGuard < epicsMutex > & guard,
dbChannelIO & chan )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -281,7 +281,7 @@ void dbContext::initiatePutNotify (
void dbContext::destroyAllIO (
CallbackGuard & cbGuard,
epicsGuard < epicsMutex > & guard,
epicsGuard < epicsMutex > & guard,
dbChannelIO & chan )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -315,7 +315,7 @@ void dbContext::destroyAllIO (
}
void dbContext::ioCancel (
CallbackGuard & cbGuard, epicsGuard < epicsMutex > & guard,
CallbackGuard & cbGuard, epicsGuard < epicsMutex > & guard,
dbChannelIO & chan, const cacChannel::ioid &id )
{
guard.assertIdenticalMutex ( this->mutex );

View File

@@ -38,18 +38,18 @@ public:
dbContextReadNotifyCacheAllocator & allocator, unsigned long size ) :
_allocator ( allocator ), _p ( allocator.alloc ( size ) ) {}
~privateAutoDestroyPtr () { _allocator.free ( _p ); }
char * get () const { return _p; }
char * get () const { return _p; }
private:
dbContextReadNotifyCacheAllocator & _allocator;
char * _p;
privateAutoDestroyPtr ( const privateAutoDestroyPtr & );
privateAutoDestroyPtr & operator = ( const privateAutoDestroyPtr & );
privateAutoDestroyPtr ( const privateAutoDestroyPtr & );
privateAutoDestroyPtr & operator = ( const privateAutoDestroyPtr & );
};
// extra effort taken here to not hold the lock when calling the callback
void dbContextReadNotifyCache::callReadNotify (
epicsGuard < epicsMutex > & guard, struct dbChannel * dbch,
unsigned type, unsigned long count, cacReadNotify & notify )
unsigned type, unsigned long count, cacReadNotify & notify )
{
guard.assertIdenticalMutex ( _mutex );

View File

@@ -1704,7 +1704,7 @@ static long putEnumEnum PUT_NOCONVERT(epicsEnum16, epicsEnum16)
DBR_FLOAT, DBR_DOUBLE, DBR_ENUM
***************************************************************************/
epicsShareDef GETCONVERTFUNC dbGetConvertRoutine[DBF_DEVICE+1][DBR_ENUM+1] = {
GETCONVERTFUNC dbGetConvertRoutine[DBF_DEVICE+1][DBR_ENUM+1] = {
/* source is a DBF_STRING */
{getStringString, getStringChar, getStringUchar, getStringShort, getStringUshort,
@@ -1775,7 +1775,7 @@ epicsShareDef GETCONVERTFUNC dbGetConvertRoutine[DBF_DEVICE+1][DBR_ENUM+1] = {
DBF_MENU, DBF_DEVICE
***************************************************************************/
epicsShareDef PUTCONVERTFUNC dbPutConvertRoutine[DBR_ENUM+1][DBF_DEVICE+1] = {
PUTCONVERTFUNC dbPutConvertRoutine[DBR_ENUM+1][DBF_DEVICE+1] = {
/* source is a DBR_STRING */
{putStringString, putStringChar, putStringUchar, putStringShort, putStringUshort,
putStringLong, putStringUlong, putStringInt64, putStringUInt64,

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbConvert.h */

View File

@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbConvertFast.h */

View File

@@ -2,7 +2,7 @@
* Copyright (c) 2016 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbConvertJSON.c */
@@ -129,7 +129,7 @@ static int dbcj_end_map(void *ctx) {
static int dbcj_start_array(void *ctx) {
parseContext *parser = (parseContext *) ctx;
if (++parser->depth > 1)
if (++parser->depth > 1)
errlogPrintf("dbConvertJSON: Embedded arrays not supported\n");
return (parser->depth == 1);

View File

@@ -2,7 +2,7 @@
* Copyright (c) 2016 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbConvertJSON.h */

View File

@@ -394,7 +394,7 @@ static long processTarget(dbCommon *psrc, dbCommon *pdst)
psrc->pact = TRUE;
if (psrc && psrc->ppn)
if (psrc->ppn)
dbNotifyAdd(psrc, pdst);
if (trace && dbServerClient(context, sizeof(context))) {

View File

@@ -156,7 +156,7 @@ int dbel ( const char *pname, unsigned level )
if ( ! pname ) return DB_EVENT_OK;
status = dbNameToAddr ( pname, &addr );
if ( status != 0 ) {
errMessage ( status, " dbNameToAddr failed" );
errMessage ( status, " dbNameToAddr failed" );
return DB_EVENT_ERROR;
}
@@ -165,7 +165,7 @@ int dbel ( const char *pname, unsigned level )
pevent = (struct evSubscrip *) ellFirst ( &addr.precord->mlis );
if ( ! pevent ) {
printf ( "\"%s\": No PV event subscriptions ( monitors ).\n", pname );
printf ( "\"%s\": No PV event subscriptions ( monitors ).\n", pname );
UNLOCKREC (addr.precord);
return DB_EVENT_OK;
}
@@ -177,14 +177,14 @@ int dbel ( const char *pname, unsigned level )
pdbFldDes = dbChannelFldDes(pevent->chan);
if ( level > 0 ) {
printf ( "%4.4s", pdbFldDes->name );
printf ( "%4.4s", pdbFldDes->name );
printf ( " { " );
if ( pevent->select & DBE_VALUE ) printf( "VALUE " );
if ( pevent->select & DBE_LOG ) printf( "LOG " );
if ( pevent->select & DBE_ALARM ) printf( "ALARM " );
if ( pevent->select & DBE_PROPERTY ) printf( "PROPERTY " );
printf ( "}" );
printf ( " { " );
if ( pevent->select & DBE_VALUE ) printf( "VALUE " );
if ( pevent->select & DBE_LOG ) printf( "LOG " );
if ( pevent->select & DBE_ALARM ) printf( "ALARM " );
if ( pevent->select & DBE_PROPERTY ) printf( "PROPERTY " );
printf ( "}" );
if ( pevent->npend ) {
printf ( " undelivered=%ld", pevent->npend );
@@ -239,7 +239,7 @@ int dbel ( const char *pname, unsigned level )
( void * ) pevent->ev_que->evUser );
}
printf( "\n" );
printf( "\n" );
}
pevent = (struct evSubscrip *) ellNext ( &pevent->node );
@@ -371,7 +371,7 @@ void db_close_events (dbEventCtx ctx)
*/
static struct event_que * create_ev_que ( struct event_user * const evUser )
{
struct event_que * const ev_que = (struct event_que *)
struct event_que * const ev_que = (struct event_que *)
freeListCalloc ( dbevEventQueueFreeList );
if ( ! ev_que ) {
return NULL;
@@ -415,7 +415,7 @@ dbEventSubscription db_add_event (
while ( TRUE ) {
int success = 0;
LOCKEVQUE ( ev_que );
success = ( ev_que->quota + ev_que->nCanceled <
success = ( ev_que->quota + ev_que->nCanceled <
EVENTQUESIZE - EVENTENTRIES );
if ( success ) {
ev_que->quota += EVENTENTRIES;
@@ -1097,7 +1097,7 @@ int db_start_events (
/*
* db_event_change_priority()
*/
void db_event_change_priority ( dbEventCtx ctx,
void db_event_change_priority ( dbEventCtx ctx,
unsigned epicsPriority )
{
struct event_user * const evUser = ( struct event_user * ) ctx;

View File

@@ -68,7 +68,7 @@ epicsShareFunc void db_cleanup_events(void);
#endif
typedef void EVENTFUNC (void *user_arg, struct dbChannel *chan,
int eventsRemaining, struct db_field_log *pfl);
int eventsRemaining, struct db_field_log *pfl);
typedef void * dbEventSubscription;
epicsShareFunc dbEventSubscription db_add_event (

View File

@@ -38,7 +38,7 @@
#include "recGbl.h"
#include "recSup.h"
#include "special.h"
/*
* In the following functions:
@@ -1045,7 +1045,7 @@ static long cvt_f_st(
long precision = 6;
if(paddr) prset = dbGetRset(paddr);
if (prset && prset->get_precision)
status = (*prset->get_precision)(paddr, &precision);
cvtFloatToString(*from, to, (unsigned short)precision);
@@ -1140,7 +1140,7 @@ static long cvt_d_st(
long precision = 6;
if(paddr) prset = dbGetRset(paddr);
if (prset && prset->get_precision)
status = (*prset->get_precision)(paddr, &precision);
cvtDoubleToString(*from, to, (unsigned short)precision);
@@ -1313,7 +1313,7 @@ static long cvt_e_st_get(
long status;
if(paddr) prset = dbGetRset(paddr);
if (prset && prset->get_enum_str)
return (*prset->get_enum_str)(paddr, to);
@@ -1335,20 +1335,20 @@ static long cvt_menu_st(
epicsEnum16 *from,
char *to,
const dbAddr *paddr)
{
dbFldDes *pdbFldDes;
dbMenu *pdbMenu;
char **papChoiceValue;
char *pchoice;
{
dbFldDes *pdbFldDes;
dbMenu *pdbMenu;
char **papChoiceValue;
char *pchoice;
if(! paddr
if(! paddr
|| !(pdbFldDes = paddr->pfldDes)
|| !(pdbMenu = (dbMenu *)pdbFldDes->ftPvt)
|| *from>=pdbMenu->nChoice
|| !(papChoiceValue = pdbMenu->papChoiceValue)
|| !(pchoice=papChoiceValue[*from])) {
recGblDbaddrError(S_db_badChoice,paddr,"dbFastLinkConv(cvt_menu_st)");
return(S_db_badChoice);
recGblDbaddrError(S_db_badChoice,paddr,"dbFastLinkConv(cvt_menu_st)");
return(S_db_badChoice);
}
strncpy(to,pchoice,MAX_STRING_SIZE);
return(0);
@@ -1360,20 +1360,20 @@ static long cvt_device_st(
epicsEnum16 *from,
char *to,
const dbAddr *paddr)
{
dbFldDes *pdbFldDes;
dbDeviceMenu *pdbDeviceMenu;
char **papChoice;
char *pchoice;
{
dbFldDes *pdbFldDes;
dbDeviceMenu *pdbDeviceMenu;
char **papChoice;
char *pchoice;
if(!paddr
if(!paddr
|| !(pdbFldDes = paddr->pfldDes)
|| !(pdbDeviceMenu = (dbDeviceMenu *)pdbFldDes->ftPvt)
|| *from>=pdbDeviceMenu->nChoice
|| !(papChoice= pdbDeviceMenu->papChoice)
|| !(pchoice=papChoice[*from])) {
recGblDbaddrError(S_db_badChoice,paddr,"dbFastLinkConv(cvt_device_st)");
return(S_db_badChoice);
recGblDbaddrError(S_db_badChoice,paddr,"dbFastLinkConv(cvt_device_st)");
return(S_db_badChoice);
}
strncpy(to,pchoice,MAX_STRING_SIZE);
return(0);
@@ -1390,7 +1390,7 @@ static long cvt_device_st(
* NULL implies the conversion is not supported.
*/
epicsShareDef long (*dbFastGetConvertRoutine[DBF_DEVICE+1][DBR_ENUM+1])() = {
long (*dbFastGetConvertRoutine[DBF_DEVICE+1][DBR_ENUM+1])() = {
/* Convert DBF_STRING to ... */
{ cvt_st_st, cvt_st_c, cvt_st_uc, cvt_st_s, cvt_st_us, cvt_st_l, cvt_st_ul, cvt_st_q, cvt_st_uq, cvt_st_f, cvt_st_d, cvt_st_e },
@@ -1446,7 +1446,7 @@ epicsShareDef long (*dbFastGetConvertRoutine[DBF_DEVICE+1][DBR_ENUM+1])() = {
* NULL implies the conversion is not supported.
*/
epicsShareDef long (*dbFastPutConvertRoutine[DBR_ENUM+1][DBF_DEVICE+1])() = {
long (*dbFastPutConvertRoutine[DBR_ENUM+1][DBF_DEVICE+1])() = {
/* Convert DBR_STRING to ... */
{ cvt_st_st, cvt_st_c, cvt_st_uc, cvt_st_s, cvt_st_us, cvt_st_l, cvt_st_ul, cvt_st_q, cvt_st_uq, cvt_st_f, cvt_st_d, cvt_st_e, cvt_st_menu, cvt_st_device},

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include "iocsh.h"
@@ -55,56 +55,69 @@ static void dbLoadRecordsCallFunc(const iocshArgBuf *args)
/* dbb */
static const iocshArg dbbArg0 = { "record name",iocshArgString};
static const iocshArg * const dbbArgs[1] = {&dbbArg0};
static const iocshFuncDef dbbFuncDef = {"dbb",1,dbbArgs};
static const iocshFuncDef dbbFuncDef = {"dbb",1,dbbArgs,
"Add breakpoint to a lock set.\n"};
static void dbbCallFunc(const iocshArgBuf *args) { dbb(args[0].sval);}
/* dbd */
static const iocshArg dbdArg0 = { "record name",iocshArgString};
static const iocshArg * const dbdArgs[1] = {&dbdArg0};
static const iocshFuncDef dbdFuncDef = {"dbd",1,dbdArgs};
static const iocshFuncDef dbdFuncDef = {"dbd",1,dbdArgs,
"Remove breakpoint from a record.\n"};
static void dbdCallFunc(const iocshArgBuf *args) { dbd(args[0].sval);}
/* dbc */
static const iocshArg dbcArg0 = { "record name",iocshArgString};
static const iocshArg * const dbcArgs[1] = {&dbcArg0};
static const iocshFuncDef dbcFuncDef = {"dbc",1,dbcArgs};
static const iocshFuncDef dbcFuncDef = {"dbc",1,dbcArgs,
"Continue processing in a lock set.\n"};
static void dbcCallFunc(const iocshArgBuf *args) { dbc(args[0].sval);}
/* dbs */
static const iocshArg dbsArg0 = { "record name",iocshArgString};
static const iocshArg * const dbsArgs[1] = {&dbsArg0};
static const iocshFuncDef dbsFuncDef = {"dbs",1,dbsArgs};
static const iocshFuncDef dbsFuncDef = {"dbs",1,dbsArgs,
"Step through record processing.\n"};
static void dbsCallFunc(const iocshArgBuf *args) { dbs(args[0].sval);}
/* dbstat */
static const iocshFuncDef dbstatFuncDef = {"dbstat",0};
static const iocshFuncDef dbstatFuncDef = {"dbstat",0,0,
"print list of stopped records, and breakpoints set in locksets.\n"};
static void dbstatCallFunc(const iocshArgBuf *args) { dbstat();}
/* dbp */
static const iocshArg dbpArg0 = { "record name",iocshArgString};
static const iocshArg dbpArg1 = { "interest level",iocshArgInt};
static const iocshArg * const dbpArgs[2] = {&dbpArg0,&dbpArg1};
static const iocshFuncDef dbpFuncDef = {"dbp",2,dbpArgs};
static const iocshFuncDef dbpFuncDef = {"dbp",2,dbpArgs,
"print stopped record.\n"};
static void dbpCallFunc(const iocshArgBuf *args)
{ dbp(args[0].sval,args[1].ival);}
/* dbap */
static const iocshArg dbapArg0 = { "record name",iocshArgString};
static const iocshArg * const dbapArgs[1] = {&dbapArg0};
static const iocshFuncDef dbapFuncDef = {"dbap",1,dbapArgs};
static const iocshFuncDef dbapFuncDef = {"dbap",1,dbapArgs,
"toggle printing after processing a certain record.\n"};
static void dbapCallFunc(const iocshArgBuf *args) { dbap(args[0].sval);}
/* dbsr */
static const iocshArg dbsrArg0 = { "interest level",iocshArgInt};
static const iocshArg * const dbsrArgs[1] = {&dbsrArg0};
static const iocshFuncDef dbsrFuncDef = {"dbsr",1,dbsrArgs};
static const iocshFuncDef dbsrFuncDef = {"dbsr",1,dbsrArgs,
"Database Server Report.\n"};
static void dbsrCallFunc(const iocshArgBuf *args) { dbsr(args[0].ival);}
/* dbcar */
static const iocshArg dbcarArg0 = { "record name",iocshArgString};
static const iocshArg dbcarArg1 = { "level",iocshArgInt};
static const iocshArg * const dbcarArgs[2] = {&dbcarArg0,&dbcarArg1};
static const iocshFuncDef dbcarFuncDef = {"dbcar",2,dbcarArgs};
static const iocshFuncDef dbcarFuncDef = {"dbcar",2,dbcarArgs,
"Database Channel Access Report.\n"
"Shows status of Channel Access links (CA_LINK).\n"
"interest level 0 - Shows statistics for all links.\n"
" 1 - Shows info. of only disconnected links.\n"
" 2 - Shows info. for all links.\n"};
static void dbcarCallFunc(const iocshArgBuf *args)
{
dbcar(args[0].sval,args[1].ival);
@@ -114,7 +127,8 @@ static void dbcarCallFunc(const iocshArgBuf *args)
static const iocshArg dbjlrArg0 = { "record name",iocshArgString};
static const iocshArg dbjlrArg1 = { "level",iocshArgInt};
static const iocshArg * const dbjlrArgs[2] = {&dbjlrArg0,&dbjlrArg1};
static const iocshFuncDef dbjlrFuncDef = {"dbjlr",2,dbjlrArgs};
static const iocshFuncDef dbjlrFuncDef = {"dbjlr",2,dbjlrArgs,
"Database JSON link Report.\n"};
static void dbjlrCallFunc(const iocshArgBuf *args)
{
dbjlr(args[0].sval,args[1].ival);
@@ -124,7 +138,9 @@ static void dbjlrCallFunc(const iocshArgBuf *args)
static const iocshArg dbelArg0 = { "record name",iocshArgString};
static const iocshArg dbelArg1 = { "level",iocshArgInt};
static const iocshArg * const dbelArgs[2] = {&dbelArg0,&dbelArg1};
static const iocshFuncDef dbelFuncDef = {"dbel",2,dbelArgs};
static const iocshFuncDef dbelFuncDef = {"dbel",2,dbelArgs,
"Database event list.\n"
"Show information on dbEvent subscriptions.\n"};
static void dbelCallFunc(const iocshArgBuf *args)
{
dbel(args[0].sval, args[1].ival);
@@ -133,14 +149,18 @@ static void dbelCallFunc(const iocshArgBuf *args)
/* dba */
static const iocshArg dbaArg0 = { "record name",iocshArgString};
static const iocshArg * const dbaArgs[1] = {&dbaArg0};
static const iocshFuncDef dbaFuncDef = {"dba",1,dbaArgs};
static const iocshFuncDef dbaFuncDef = {"dba",1,dbaArgs,
"dbAddr info.\n"};
static void dbaCallFunc(const iocshArgBuf *args) { dba(args[0].sval);}
/* dbl */
static const iocshArg dblArg0 = { "record type",iocshArgString};
static const iocshArg dblArg1 = { "fields",iocshArgString};
static const iocshArg * const dblArgs[] = {&dblArg0,&dblArg1};
static const iocshFuncDef dblFuncDef = {"dbl",2,dblArgs};
static const iocshFuncDef dblFuncDef = {"dbl",2,dblArgs,
"Database list.\n"
"List record/field names.\n"
"With no arguments, lists all record names.\n"};
static void dblCallFunc(const iocshArgBuf *args)
{
dbl(args[0].sval,args[1].sval);
@@ -149,38 +169,46 @@ static void dblCallFunc(const iocshArgBuf *args)
/* dbnr */
static const iocshArg dbnrArg0 = { "verbose",iocshArgInt};
static const iocshArg * const dbnrArgs[1] = {&dbnrArg0};
static const iocshFuncDef dbnrFuncDef = {"dbnr",1,dbnrArgs};
static const iocshFuncDef dbnrFuncDef = {"dbnr",1,dbnrArgs,
"List stats on record alias()s.\n"};
static void dbnrCallFunc(const iocshArgBuf *args) { dbnr(args[0].ival);}
/* dbli */
static const iocshArg dbliArg0 = { "pattern",iocshArgString};
static const iocshArg * const dbliArgs[1] = {&dbliArg0};
static const iocshFuncDef dbliFuncDef = {"dbli",1,dbliArgs};
static const iocshFuncDef dbliFuncDef = {"dbli",1,dbliArgs,
"List info() tags with names matching pattern.\n"};
static void dbliCallFunc(const iocshArgBuf *args) { dbli(args[0].sval);}
/* dbla */
static const iocshArg dblaArg0 = { "pattern",iocshArgString};
static const iocshArg * const dblaArgs[1] = {&dblaArg0};
static const iocshFuncDef dblaFuncDef = {"dbla",1,dblaArgs};
static const iocshFuncDef dblaFuncDef = {"dbla",1,dblaArgs,
"List record alias()s by alias name pattern.\n"};
static void dblaCallFunc(const iocshArgBuf *args) { dbla(args[0].sval);}
/* dbgrep */
static const iocshArg dbgrepArg0 = { "pattern",iocshArgString};
static const iocshArg * const dbgrepArgs[1] = {&dbgrepArg0};
static const iocshFuncDef dbgrepFuncDef = {"dbgrep",1,dbgrepArgs};
static const iocshFuncDef dbgrepFuncDef = {"dbgrep",1,dbgrepArgs,
"List record names matching pattern.\n"};
static void dbgrepCallFunc(const iocshArgBuf *args) { dbgrep(args[0].sval);}
/* dbgf */
static const iocshArg dbgfArg0 = { "record name",iocshArgString};
static const iocshArg * const dbgfArgs[1] = {&dbgfArg0};
static const iocshFuncDef dbgfFuncDef = {"dbgf",1,dbgfArgs};
static const iocshFuncDef dbgfFuncDef = {"dbgf",1,dbgfArgs,
"Database Get Field.\n"
"Print current value of record field.\n"};
static void dbgfCallFunc(const iocshArgBuf *args) { dbgf(args[0].sval);}
/* dbpf */
static const iocshArg dbpfArg0 = { "record name",iocshArgString};
static const iocshArg dbpfArg1 = { "value",iocshArgString};
static const iocshArg * const dbpfArgs[2] = {&dbpfArg0,&dbpfArg1};
static const iocshFuncDef dbpfFuncDef = {"dbpf",2,dbpfArgs};
static const iocshFuncDef dbpfFuncDef = {"dbpf",2,dbpfArgs,
"Database Put Field.\n"
"Change value of record field.\n"};
static void dbpfCallFunc(const iocshArgBuf *args)
{ dbpf(args[0].sval,args[1].sval);}
@@ -188,27 +216,33 @@ static void dbpfCallFunc(const iocshArgBuf *args)
static const iocshArg dbprArg0 = { "record name",iocshArgString};
static const iocshArg dbprArg1 = { "interest level",iocshArgInt};
static const iocshArg * const dbprArgs[2] = {&dbprArg0,&dbprArg1};
static const iocshFuncDef dbprFuncDef = {"dbpr",2,dbprArgs};
static const iocshFuncDef dbprFuncDef = {"dbpr",2,dbprArgs,
"Database Print Record.\n"
"Print values of record fields.\n"};
static void dbprCallFunc(const iocshArgBuf *args)
{ dbpr(args[0].sval,args[1].ival);}
/* dbtr */
static const iocshArg dbtrArg0 = { "record name",iocshArgString};
static const iocshArg * const dbtrArgs[1] = {&dbtrArg0};
static const iocshFuncDef dbtrFuncDef = {"dbtr",1,dbtrArgs};
static const iocshFuncDef dbtrFuncDef = {"dbtr",1,dbtrArgs,
"Process record and then some fields.\n"};
static void dbtrCallFunc(const iocshArgBuf *args) { dbtr(args[0].sval);}
/* dbtgf */
static const iocshArg dbtgfArg0 = { "record name",iocshArgString};
static const iocshArg * const dbtgfArgs[1] = {&dbtgfArg0};
static const iocshFuncDef dbtgfFuncDef = {"dbtgf",1,dbtgfArgs};
static const iocshFuncDef dbtgfFuncDef = {"dbtgf",1,dbtgfArgs,
"Database Test Get Field.\n"
"Get field with different DBR_* types"};
static void dbtgfCallFunc(const iocshArgBuf *args) { dbtgf(args[0].sval);}
/* dbtpf */
static const iocshArg dbtpfArg0 = { "record name",iocshArgString};
static const iocshArg dbtpfArg1 = { "value",iocshArgString};
static const iocshArg * const dbtpfArgs[2] = {&dbtpfArg0,&dbtpfArg1};
static const iocshFuncDef dbtpfFuncDef = {"dbtpf",2,dbtpfArgs};
static const iocshFuncDef dbtpfFuncDef = {"dbtpf",2,dbtpfArgs,
"Database Test Put Field.\n"};
static void dbtpfCallFunc(const iocshArgBuf *args)
{ dbtpf(args[0].sval,args[1].sval);}
@@ -216,25 +250,29 @@ static void dbtpfCallFunc(const iocshArgBuf *args)
static const iocshArg dbiorArg0 = { "driver name",iocshArgString};
static const iocshArg dbiorArg1 = { "interest level",iocshArgInt};
static const iocshArg * const dbiorArgs[] = {&dbiorArg0,&dbiorArg1};
static const iocshFuncDef dbiorFuncDef = {"dbior",2,dbiorArgs};
static const iocshFuncDef dbiorFuncDef = {"dbior",2,dbiorArgs,
"Driver Report.\n"};
static void dbiorCallFunc(const iocshArgBuf *args)
{ dbior(args[0].sval,args[1].ival);}
/* dbhcr */
static const iocshFuncDef dbhcrFuncDef = {"dbhcr",0,0};
static const iocshFuncDef dbhcrFuncDef = {"dbhcr",0,0,
"Database Report Device Config.\n"};
static void dbhcrCallFunc(const iocshArgBuf *args) { dbhcr();}
/* gft */
static const iocshArg gftArg0 = { "record name",iocshArgString};
static const iocshArg * const gftArgs[1] = {&gftArg0};
static const iocshFuncDef gftFuncDef = {"gft",1,gftArgs};
static const iocshFuncDef gftFuncDef = {"gft",1,gftArgs,
"Report dbChannel info and value.\n"};
static void gftCallFunc(const iocshArgBuf *args) { gft(args[0].sval);}
/* pft */
static const iocshArg pftArg0 = { "record name",iocshArgString};
static const iocshArg pftArg1 = { "value",iocshArgString};
static const iocshArg * const pftArgs[2] = {&pftArg0,&pftArg1};
static const iocshFuncDef pftFuncDef = {"pft",2,pftArgs};
static const iocshFuncDef pftFuncDef = {"pft",2,pftArgs,
"dbChannel put value.\n"};
static void pftCallFunc(const iocshArgBuf *args)
{ pft(args[0].sval,args[1].sval);}
@@ -242,12 +280,16 @@ static void pftCallFunc(const iocshArgBuf *args)
static const iocshArg dbtpnArg0 = { "record name",iocshArgString};
static const iocshArg dbtpnArg1 = { "value",iocshArgString};
static const iocshArg * const dbtpnArgs[2] = {&dbtpnArg0,&dbtpnArg1};
static const iocshFuncDef dbtpnFuncDef = {"dbtpn",2,dbtpnArgs};
static const iocshFuncDef dbtpnFuncDef = {"dbtpn",2,dbtpnArgs,
"Database Put Notify\n"
"Without value, begin async. processing and get\n"
"With value, begin put, process, and get"};
static void dbtpnCallFunc(const iocshArgBuf *args)
{ dbtpn(args[0].sval,args[1].sval);}
/* dbNotifyDump */
static const iocshFuncDef dbNotifyDumpFuncDef = {"dbNotifyDump",0,0};
static const iocshFuncDef dbNotifyDumpFuncDef = {"dbNotifyDump",0,0,
"Report status of any active async processing with completion notification.\n"};
static void dbNotifyDumpCallFunc(const iocshArgBuf *args) { dbNotifyDump();}
/* dbPutAttribute */
@@ -257,7 +299,8 @@ static const iocshArg dbPutAttrArg2 = { "value",iocshArgString};
static const iocshArg * const dbPutAttrArgs[] =
{&dbPutAttrArg0, &dbPutAttrArg1, &dbPutAttrArg2};
static const iocshFuncDef dbPutAttrFuncDef =
{"dbPutAttribute",3,dbPutAttrArgs};
{"dbPutAttribute",3,dbPutAttrArgs,
"Set/Create record attribute.\n"};
static void dbPutAttrCallFunc(const iocshArgBuf *args)
{ dbPutAttribute(args[0].sval,args[1].sval,args[2].sval);}
@@ -265,7 +308,8 @@ static void dbPutAttrCallFunc(const iocshArgBuf *args)
static const iocshArg tpnArg0 = { "record name",iocshArgString};
static const iocshArg tpnArg1 = { "value",iocshArgString};
static const iocshArg * const tpnArgs[2] = {&tpnArg0,&tpnArg1};
static const iocshFuncDef tpnFuncDef = {"tpn",2,tpnArgs};
static const iocshFuncDef tpnFuncDef = {"tpn",2,tpnArgs,
"Begin async. process and get.\n"};
static void tpnCallFunc(const iocshArgBuf *args)
{ tpn(args[0].sval,args[1].sval);}
@@ -273,7 +317,8 @@ static void tpnCallFunc(const iocshArgBuf *args)
static const iocshArg dblsrArg0 = { "record name",iocshArgString};
static const iocshArg dblsrArg1 = { "interest level",iocshArgInt};
static const iocshArg * const dblsrArgs[2] = {&dblsrArg0,&dblsrArg1};
static const iocshFuncDef dblsrFuncDef = {"dblsr",2,dblsrArgs};
static const iocshFuncDef dblsrFuncDef = {"dblsr",2,dblsrArgs,
"Database Lockset report.\n"};
static void dblsrCallFunc(const iocshArgBuf *args)
{ dblsr(args[0].sval,args[1].ival);}
@@ -281,7 +326,8 @@ static void dblsrCallFunc(const iocshArgBuf *args)
static const iocshArg dbLockShowLockedArg0 = { "interest level",iocshArgInt};
static const iocshArg * const dbLockShowLockedArgs[1] = {&dbLockShowLockedArg0};
static const iocshFuncDef dbLockShowLockedFuncDef =
{"dbLockShowLocked",1,dbLockShowLockedArgs};
{"dbLockShowLocked",1,dbLockShowLockedArgs,
"Show Locksets which are currently locked.\n"};
static void dbLockShowLockedCallFunc(const iocshArgBuf *args)
{ dbLockShowLocked(args[0].ival);}
@@ -290,7 +336,9 @@ static const iocshArg scanOnceSetQueueSizeArg0 = { "size",iocshArgInt};
static const iocshArg * const scanOnceSetQueueSizeArgs[1] =
{&scanOnceSetQueueSizeArg0};
static const iocshFuncDef scanOnceSetQueueSizeFuncDef =
{"scanOnceSetQueueSize",1,scanOnceSetQueueSizeArgs};
{"scanOnceSetQueueSize",1,scanOnceSetQueueSizeArgs,
"Change size of Scan once queue.\n"
"Must be called before iocInit().\n"};
static void scanOnceSetQueueSizeCallFunc(const iocshArgBuf *args)
{
scanOnceSetQueueSize(args[0].ival);
@@ -301,7 +349,8 @@ static const iocshArg scanOnceQueueShowArg0 = { "reset",iocshArgInt};
static const iocshArg * const scanOnceQueueShowArgs[1] =
{&scanOnceQueueShowArg0};
static const iocshFuncDef scanOnceQueueShowFuncDef =
{"scanOnceQueueShow",1,scanOnceQueueShowArgs};
{"scanOnceQueueShow",1,scanOnceQueueShowArgs,
"Show details and statitics of scan once queue processing.\n"};
static void scanOnceQueueShowCallFunc(const iocshArgBuf *args)
{
scanOnceQueueShow(args[0].ival);
@@ -310,21 +359,24 @@ static void scanOnceQueueShowCallFunc(const iocshArgBuf *args)
/* scanppl */
static const iocshArg scanpplArg0 = { "rate",iocshArgDouble};
static const iocshArg * const scanpplArgs[1] = {&scanpplArg0};
static const iocshFuncDef scanpplFuncDef = {"scanppl",1,scanpplArgs};
static const iocshFuncDef scanpplFuncDef = {"scanppl",1,scanpplArgs,
"print periodic scan lists.\n"};
static void scanpplCallFunc(const iocshArgBuf *args)
{ scanppl(args[0].dval);}
/* scanpel */
static const iocshArg scanpelArg0 = { "event name",iocshArgString};
static const iocshArg * const scanpelArgs[1] = {&scanpelArg0};
static const iocshFuncDef scanpelFuncDef = {"scanpel",1,scanpelArgs};
static const iocshFuncDef scanpelFuncDef = {"scanpel",1,scanpelArgs,
"Print info for records with SCAN = \"Event\".\n"};
static void scanpelCallFunc(const iocshArgBuf *args)
{ scanpel(args[0].sval);}
/* postEvent */
static const iocshArg postEventArg0 = { "event name",iocshArgString};
static const iocshArg * const postEventArgs[1] = {&postEventArg0};
static const iocshFuncDef postEventFuncDef = {"postEvent",1,postEventArgs};
static const iocshFuncDef postEventFuncDef = {"postEvent",1,postEventArgs,
"Manually scan all records with EVNT == name.\n"};
static void postEventCallFunc(const iocshArgBuf *args)
{
EVENTPVT pel = eventNameToHandle(args[0].sval);
@@ -332,7 +384,8 @@ static void postEventCallFunc(const iocshArgBuf *args)
}
/* scanpiol */
static const iocshFuncDef scanpiolFuncDef = {"scanpiol",0};
static const iocshFuncDef scanpiolFuncDef = {"scanpiol",0,0,
"Print info for records with SCAN = \"I/O Intr\".\n"};
static void scanpiolCallFunc(const iocshArgBuf *args) { scanpiol();}
/* callbackSetQueueSize */
@@ -340,7 +393,9 @@ static const iocshArg callbackSetQueueSizeArg0 = { "bufsize",iocshArgInt};
static const iocshArg * const callbackSetQueueSizeArgs[1] =
{&callbackSetQueueSizeArg0};
static const iocshFuncDef callbackSetQueueSizeFuncDef =
{"callbackSetQueueSize",1,callbackSetQueueSizeArgs};
{"callbackSetQueueSize",1,callbackSetQueueSizeArgs,
"Change depth of queue for callback workers.\n"
"Must be called before iocInit().\n"};
static void callbackSetQueueSizeCallFunc(const iocshArgBuf *args)
{
callbackSetQueueSize(args[0].ival);
@@ -351,7 +406,8 @@ static const iocshArg callbackQueueShowArg0 = { "reset", iocshArgInt};
static const iocshArg * const callbackQueueShowArgs[1] =
{&callbackQueueShowArg0};
static const iocshFuncDef callbackQueueShowFuncDef =
{"callbackQueueShow",1,callbackQueueShowArgs};
{"callbackQueueShow",1,callbackQueueShowArgs,
"Show status of callback thread processing queue.\n"};
static void callbackQueueShowCallFunc(const iocshArgBuf *args)
{
callbackQueueShow(args[0].ival);
@@ -363,7 +419,10 @@ static const iocshArg callbackParallelThreadsArg1 = { "priority", iocshArgString
static const iocshArg * const callbackParallelThreadsArgs[2] =
{&callbackParallelThreadsArg0,&callbackParallelThreadsArg1};
static const iocshFuncDef callbackParallelThreadsFuncDef =
{"callbackParallelThreads",2,callbackParallelThreadsArgs};
{"callbackParallelThreads",2,callbackParallelThreadsArgs,
"Configure multiple workers for a given callback queue priority level.\n"
"priority may be omitted or \"*\" to act on all priorities\n"
"or one of LOW, MEDIUM, or HIGH.\n"};
static void callbackParallelThreadsCallFunc(const iocshArgBuf *args)
{
callbackParallelThreads(args[0].ival, args[1].sval);
@@ -372,7 +431,8 @@ static void callbackParallelThreadsCallFunc(const iocshArgBuf *args)
/* dbStateCreate */
static const iocshArg dbStateArgName = { "name", iocshArgString };
static const iocshArg * const dbStateCreateArgs[] = { &dbStateArgName };
static const iocshFuncDef dbStateCreateFuncDef = { "dbStateCreate", 1, dbStateCreateArgs };
static const iocshFuncDef dbStateCreateFuncDef = { "dbStateCreate", 1, dbStateCreateArgs,
"Allocate new state name for \"state\" filter.\n"};
static void dbStateCreateCallFunc (const iocshArgBuf *args)
{
dbStateCreate(args[0].sval);
@@ -380,7 +440,8 @@ static void dbStateCreateCallFunc (const iocshArgBuf *args)
/* dbStateSet */
static const iocshArg * const dbStateSetArgs[] = { &dbStateArgName };
static const iocshFuncDef dbStateSetFuncDef = { "dbStateSet", 1, dbStateSetArgs };
static const iocshFuncDef dbStateSetFuncDef = { "dbStateSet", 1, dbStateSetArgs,
"Change state to set for \"state\" filter.\n"};
static void dbStateSetCallFunc (const iocshArgBuf *args)
{
dbStateId sid = dbStateFind(args[0].sval);
@@ -391,7 +452,8 @@ static void dbStateSetCallFunc (const iocshArgBuf *args)
/* dbStateClear */
static const iocshArg * const dbStateClearArgs[] = { &dbStateArgName };
static const iocshFuncDef dbStateClearFuncDef = { "dbStateClear", 1, dbStateClearArgs };
static const iocshFuncDef dbStateClearFuncDef = { "dbStateClear", 1, dbStateClearArgs,
"Change state to clear for \"state\" filter.\n" };
static void dbStateClearCallFunc (const iocshArgBuf *args)
{
dbStateId sid = dbStateFind(args[0].sval);
@@ -403,7 +465,8 @@ static void dbStateClearCallFunc (const iocshArgBuf *args)
/* dbStateShow */
static const iocshArg dbStateShowArg1 = { "level", iocshArgInt };
static const iocshArg * const dbStateShowArgs[] = { &dbStateArgName, &dbStateShowArg1 };
static const iocshFuncDef dbStateShowFuncDef = { "dbStateShow", 2, dbStateShowArgs };
static const iocshFuncDef dbStateShowFuncDef = { "dbStateShow", 2, dbStateShowArgs,
"Show set/clear status of named state. (cf. \"state\" filter)\n" };
static void dbStateShowCallFunc (const iocshArgBuf *args)
{
dbStateId sid = dbStateFind(args[0].sval);
@@ -415,7 +478,8 @@ static void dbStateShowCallFunc (const iocshArgBuf *args)
/* dbStateShowAll */
static const iocshArg dbStateShowAllArg0 = { "level", iocshArgInt };
static const iocshArg * const dbStateShowAllArgs[] = { &dbStateShowAllArg0 };
static const iocshFuncDef dbStateShowAllFuncDef = { "dbStateShowAll", 1, dbStateShowAllArgs };
static const iocshFuncDef dbStateShowAllFuncDef = { "dbStateShowAll", 1, dbStateShowAllArgs,
"Show set/clear status of all named states. (cf. \"state\" filter)\n" };
static void dbStateShowAllCallFunc (const iocshArgBuf *args)
{
dbStateShowAll(args[0].ival);

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef INC_dbIocRegister_H

View File

@@ -27,7 +27,7 @@
#include "link.h"
#include "epicsExport.h"
epicsShareDef int dbJLinkDebug = 0;
int dbJLinkDebug = 0;
epicsExportAddress(int, dbJLinkDebug);
#define IFDEBUG(n) if (dbJLinkDebug >= (n))
@@ -39,12 +39,12 @@ typedef struct parseContext {
short jsonDepth;
} parseContext;
epicsShareDef const char *jlif_result_name[2] = {
const char *jlif_result_name[2] = {
"jlif_stop",
"jlif_continue",
};
epicsShareDef const char *jlif_key_result_name[5] = {
const char *jlif_key_result_name[5] = {
"jlif_key_stop",
"jlif_key_continue",
"jlif_key_child_inlink",

View File

@@ -10,7 +10,7 @@
#define INC_dbJLink_H
#include <stdlib.h>
#include <shareLib.h>
#include <dbCoreAPI.h>
#ifdef __cplusplus
extern "C" {
@@ -124,18 +124,18 @@ typedef struct jlif {
*/
} jlif;
epicsShareFunc long dbJLinkParse(const char *json, size_t len, short dbfType,
DBCORE_API long dbJLinkParse(const char *json, size_t len, short dbfType,
jlink **ppjlink);
epicsShareFunc long dbJLinkInit(struct link *plink);
DBCORE_API long dbJLinkInit(struct link *plink);
epicsShareFunc void dbJLinkFree(jlink *);
epicsShareFunc void dbJLinkReport(jlink *, int level, int indent);
DBCORE_API void dbJLinkFree(jlink *);
DBCORE_API void dbJLinkReport(jlink *, int level, int indent);
epicsShareFunc long dbJLinkMapChildren(struct link *,
DBCORE_API long dbJLinkMapChildren(struct link *,
jlink_map_fn rtn, void *ctx);
epicsShareFunc long dbjlr(const char *recname, int level);
epicsShareFunc long dbJLinkMapAll(char *recname, jlink_map_fn rtn, void *ctx);
DBCORE_API long dbjlr(const char *recname, int level);
DBCORE_API long dbJLinkMapAll(char *recname, jlink_map_fn rtn, void *ctx);
#ifdef __cplusplus
}

View File

@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include <stddef.h>
@@ -882,16 +882,16 @@ static char *msstring[4]={"NMS","MS","MSI","MSS"};
long dblsr(char *recordname,int level)
{
int link;
DBENTRY dbentry;
DBENTRY *pdbentry=&dbentry;
long status;
dbCommon *precord;
lockSet *plockSet;
lockRecord *plockRecord;
dbRecordType *pdbRecordType;
dbFldDes *pdbFldDes;
DBLINK *plink;
int link;
DBENTRY dbentry;
DBENTRY *pdbentry=&dbentry;
long status;
dbCommon *precord;
lockSet *plockSet;
lockRecord *plockRecord;
dbRecordType *pdbRecordType;
dbFldDes *pdbFldDes;
DBLINK *plink;
if (recordname && ((*recordname == '\0') || !strcmp(recordname,"*")))
recordname = NULL;
@@ -923,7 +923,7 @@ long dblsr(char *recordname,int level)
printf("%s\n",precord->name);
if(level<=1) continue;
for(link=0; (link<pdbRecordType->no_links) ; link++) {
DBADDR *pdbAddr;
DBADDR *pdbAddr;
pdbFldDes = pdbRecordType->papFldDes[pdbRecordType->link_ind[link]];
plink = (DBLINK *)((char *)precord + pdbFldDes->offset);
if(plink->type != DB_LINK) continue;
@@ -983,8 +983,8 @@ long dbLockShowLocked(int level)
int * dbLockSetAddrTrace(dbCommon *precord)
{
lockRecord *plockRecord = precord->lset;
lockSet *plockSet = plockRecord->plockSet;
lockRecord *plockRecord = precord->lset;
lockSet *plockSet = plockRecord->plockSet;
return(&plockSet->trace);
}

View File

@@ -5,10 +5,10 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbLock.h */
/* Author: Marty Kraimer Date: 12MAR96 */
/* Author: Marty Kraimer Date: 12MAR96 */
#ifndef INCdbLockh
#define INCdbLockh

View File

@@ -24,10 +24,10 @@
* are guarded by its lock.
*/
typedef struct dbLockSet {
ELLNODE node;
ELLLIST lockRecordList; /* holds lockRecord::node */
epicsMutexId lock;
unsigned long id;
ELLNODE node;
ELLLIST lockRecordList; /* holds lockRecord::node */
epicsMutexId lock;
unsigned long id;
int refcount;
#ifdef LOCKSET_DEBUG
@@ -48,15 +48,15 @@ struct lockRecord;
* plockSet is guarded by spin.
*/
typedef struct lockRecord {
ELLNODE node; /* in lockSet::lockRecordList */
ELLNODE node; /* in lockSet::lockRecordList */
/* The association between lockRecord and lockSet
* can only be changed while the lockSet is held,
* and the lockRecord's spinlock is held.
* It may be read which either lock is held.
*/
lockSet *plockSet;
lockSet *plockSet;
/* the association between lockRecord and dbCommon never changes */
dbCommon *precord;
dbCommon *precord;
epicsSpinId spin;
/* temp used during lockset split.
@@ -86,6 +86,10 @@ struct dbLocker {
lockRecordRef refs[DBLOCKER_NALLOC]; /* actual length is maxrefs */
};
#ifdef __cplusplus
extern "C" {
#endif
/* These are exported for testing only */
epicsShareFunc lockSet* dbLockGetRef(lockRecord *lr); /* lookup lockset and increment ref count */
epicsShareFunc void dbLockIncRef(lockSet* ls);
@@ -107,4 +111,8 @@ void dbLockSetSplit(struct dbLocker *locker,
struct dbCommon *psource,
struct dbCommon *psecond);
#ifdef __cplusplus
}
#endif
#endif /* DBLOCKPVT_H */

View File

@@ -8,7 +8,7 @@
\*************************************************************************/
/* dbNotify.c */
/*
* Author: Marty Kraimer
* Author: Marty Kraimer
* Andrew Johnson <anj@aps.anl.gov>
*
* Extracted from dbLink.c
@@ -151,7 +151,7 @@ static void restartCheck(processNotifyRecord *ppnr)
dbCommon *precord = ppnr->precord;
processNotify *pfirst;
notifyPvt *pnotifyPvt;
assert(precord->ppn);
pfirst = (processNotify *) ellFirst(&ppnr->restartList);
if (!pfirst) {
@@ -188,7 +188,7 @@ static void callDone(dbCommon *precord, processNotify *ppn)
}
if (!pnotifyPvt->cancelWait && !pnotifyPvt->userCallbackWait) {
notifyCleanup(ppn);
epicsMutexUnlock(pnotifyGlobal->lock);
epicsMutexUnlock(pnotifyGlobal->lock);
return;
}
if (pnotifyPvt->cancelWait) {
@@ -213,7 +213,7 @@ static void processNotifyCommon(processNotify *ppn, dbCommon *precord, int first
if (precord->ppn &&
pnotifyPvt->state != notifyRestartCallbackRequested) {
/* Another processNotify owns the record */
pnotifyPvt->state = notifyWaitForRestart;
pnotifyPvt->state = notifyWaitForRestart;
ellSafeAdd(&precord->ppnr->restartList, &ppn->restartNode);
epicsMutexUnlock(pnotifyGlobal->lock);
dbScanUnlock(precord);
@@ -225,7 +225,7 @@ static void processNotifyCommon(processNotify *ppn, dbCommon *precord, int first
if (precord->pact) {
precord->ppn = ppn;
ellSafeAdd(&pnotifyPvt->waitList, &precord->ppnr->waitNode);
pnotifyPvt->state = notifyRestartInProgress;
pnotifyPvt->state = notifyRestartInProgress;
epicsMutexUnlock(pnotifyGlobal->lock);
dbScanUnlock(precord);
return;
@@ -347,7 +347,7 @@ void dbProcessNotify(processNotify *ppn)
if (ppn->requestType == processGetRequest ||
ppn->requestType == putProcessGetRequest) {
ppn->getCallback(ppn, getFieldType);
}
ppn->doneCallback(ppn);
return;
@@ -413,7 +413,7 @@ void dbNotifyCancel(processNotify *ppn)
epicsMutexUnlock(pnotifyGlobal->lock);
return;
case notifyNotActive:
break;
break;
case notifyWaitForRestart:
assert(precord->ppn);
assert(precord->ppn!=ppn);
@@ -425,7 +425,7 @@ void dbNotifyCancel(processNotify *ppn)
processNotifyRecord *ppnrWait;
while ((ppnrWait = (processNotifyRecord *)
ellFirst(&pnotifyPvt->waitList))) {
ellFirst(&pnotifyPvt->waitList))) {
ellSafeDelete(&pnotifyPvt->waitList, &ppnrWait->waitNode);
restartCheck(ppnrWait);
}
@@ -569,7 +569,7 @@ static void doneCallback(processNotify *ppn)
printf("dbtpnCallback: success record=%s\n", pname);
else
printf("%s dbtpnCallback processNotify.status %d\n",
pname, (int) status);
pname, (int) status);
epicsEventSignal(ptpnInfo->callbackDone);
}
@@ -602,7 +602,7 @@ long dbtpn(char *pname, char *pvalue)
printf("dbtpn: No such channel\n");
return -1;
}
ppn = dbCalloc(1, sizeof(processNotify));
ppn->requestType = pvalue ? putProcessRequest : processGetRequest;
ppn->chan = chan;
@@ -671,7 +671,7 @@ int dbNotifyDump(void)
ppnRestart = (processNotify *)ellFirst(
&precord->ppnr->restartList);
if (ppnRestart)
printf("%s restartList\n", precord->name);
printf("%s restartList\n", precord->name);
while (ppnRestart) {
printf(" %s\n", dbChannelRecord(ppnRestart->chan)->name);
ppnRestart = (processNotify *) ellNext(

View File

@@ -6,7 +6,7 @@
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbNotify.h */
/* dbNotify.h */
#ifndef INCdbNotifyh
#define INCdbNotifyh
@@ -89,7 +89,7 @@ epicsShareFunc void dbNotifyCompletion(struct dbCommon *precord);
epicsShareFunc int db_put_process(
processNotify *processNotify,notifyPutType type,
int src_type,const void *psrc, int no_elements);
/* dbtpn is test routine for dbNotify putProcessRequest */
epicsShareFunc long dbtpn(char *recordname,char *value);
@@ -98,7 +98,7 @@ epicsShareFunc int dbNotifyDump(void);
/* This module provides code to handle process notify.
* client code semantics are:
* 1) The client code allocates storage for a processNotify structure.
* 1) The client code allocates storage for a processNotify structure.
* This structure can be used for multiple calls to dbProcessNotify.
* The client is responsible for setting the following fields :
* requestType - The type of request.
@@ -107,7 +107,7 @@ epicsShareFunc int dbNotifyDump(void);
* getCallback - If request is processGetRequest or putProcessGetRequest
* doneCallback - Must be set
* usrPvt - For exclusive use of client. dbNotify does not access this field
* 2) The client calls dbProcessNotify.
* 2) The client calls dbProcessNotify.
* 3) putCallback is called after dbNotify has claimed the record instance
* but before a potential process is requested.
* The putCallback MUST issue the correct put request
@@ -140,22 +140,22 @@ epicsShareFunc int dbNotifyDump(void);
* The other global routines (dbNotifyAdd and dbNotifyCompletion) are called by:
*
* dbAccess.c
* dbScanPassive and dbScanLink
* call dbNotifyAdd just before calling dbProcess
* dbProcess
* Calls dbNotifyCompletion if dbProcess does not call process
* dbScanPassive and dbScanLink
* call dbNotifyAdd just before calling dbProcess
* dbProcess
* Calls dbNotifyCompletion if dbProcess does not call process
* Unless pact is already true.
* recGbl
* recGblFwdLink calls dbNotifyCompletion
* recGbl
* recGblFwdLink calls dbNotifyCompletion
*
* Two fields in dbCommon are used for put notify.
* ppn pointer to processNotify
* If a record is part of a put notify group,
* This field is the address of the associated processNotify.
* As soon as a record completes processing the field is set NULL
* ppnr pointer to processNotifyRecord, which is a private structure
* ppn pointer to processNotify
* If a record is part of a put notify group,
* This field is the address of the associated processNotify.
* As soon as a record completes processing the field is set NULL
* ppnr pointer to processNotifyRecord, which is a private structure
* owned by dbNotify.
* dbNotify is reponsible for this structure.
* dbNotify is reponsible for this structure.
*
*/
#ifdef __cplusplus

View File

@@ -7,8 +7,8 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author:
/*
* Author:
* Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
@@ -48,7 +48,7 @@ dbPutNotifyBlocker::~dbPutNotifyBlocker ()
{
}
void dbPutNotifyBlocker::destructor ( CallbackGuard & cbGuard,
void dbPutNotifyBlocker::destructor ( CallbackGuard & cbGuard,
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -103,7 +103,7 @@ extern "C" int putNotifyPut ( processNotify *ppn, notifyPutType type )
extern "C" void putNotifyCompletion ( processNotify *ppn )
{
dbPutNotifyBlocker * const pBlocker =
dbPutNotifyBlocker * const pBlocker =
static_cast < dbPutNotifyBlocker * > ( ppn->usrPvt );
epicsGuard < epicsMutex > guard ( pBlocker->mutex );
cacWriteNotify * const pNtfy = pBlocker->pNotify;
@@ -111,14 +111,14 @@ extern "C" void putNotifyCompletion ( processNotify *ppn )
pBlocker->pNotify = 0;
// Its necessary to signal the initiators now before we call
// the user callback. This is less efficent, and potentially
// causes more thread context switching, but its probably
// unavoidable because its possible that the use callback
// causes more thread context switching, but its probably
// unavoidable because its possible that the use callback
// might destroy this object.
pBlocker->block.signal ();
if ( pBlocker->pn.status != notifyOK ) {
pNtfy->exception (
pNtfy->exception (
guard, ECA_PUTFAIL, "put notify unsuccessful",
static_cast < unsigned > (pBlocker->dbrType),
static_cast < unsigned > (pBlocker->dbrType),
static_cast < unsigned > (pBlocker->nRequest) );
}
else {
@@ -144,12 +144,12 @@ void dbPutNotifyBlocker::initiatePutNotify (
break;
}
if ( beginTimeInit ) {
if ( epicsTime::getMonotonic () - begin > 30.0 ) {
if ( epicsTime::getCurrent () - begin > 30.0 ) {
throw cacChannel::requestTimedOut ();
}
}
else {
begin = epicsTime::getMonotonic ();
begin = epicsTime::getCurrent ();
beginTimeInit = true;
}
{

View File

@@ -8,10 +8,10 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
/*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
*/
#ifndef dbPutNotifyBlockerh
@@ -75,8 +75,8 @@ private:
epicsGuard < epicsMutex > &, unsigned long newSize );
friend void putNotifyCompletion ( processNotify * ppn );
friend int putNotifyPut ( processNotify *ppn, notifyPutType type );
dbPutNotifyBlocker ( const dbPutNotifyBlocker & );
dbPutNotifyBlocker & operator = ( const dbPutNotifyBlocker & );
dbPutNotifyBlocker ( const dbPutNotifyBlocker & );
dbPutNotifyBlocker & operator = ( const dbPutNotifyBlocker & );
virtual ~dbPutNotifyBlocker ();
void operator delete ( void * );
};

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author: Marty Kraimer

View File

@@ -7,10 +7,10 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
/*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
*/
#include <string>
@@ -56,14 +56,14 @@ dbSubscriptionIO::~dbSubscriptionIO ()
{
}
void dbSubscriptionIO::destructor ( CallbackGuard & cbGuard,
void dbSubscriptionIO::destructor ( CallbackGuard & cbGuard,
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
this->~dbSubscriptionIO ();
}
void dbSubscriptionIO::unsubscribe ( CallbackGuard & cbGuard,
void dbSubscriptionIO::unsubscribe ( CallbackGuard & cbGuard,
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -112,7 +112,7 @@ void dbSubscriptionIO::operator delete ( void * pCadaver,
#endif
extern "C" void dbSubscriptionEventCallback ( void *pPrivate, struct dbChannel * /* dbch */,
int /* eventsRemaining */, struct db_field_log *pfl )
int /* eventsRemaining */, struct db_field_log *pfl )
{
dbSubscriptionIO * pIO = static_cast < dbSubscriptionIO * > ( pPrivate );
pIO->chan.callStateNotify ( pIO->type, pIO->count, pfl, pIO->notify );

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef INC_dbTest_H

View File

@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* db_convert.h */
@@ -40,28 +40,28 @@ epicsShareExtern long (*dbFastPutConvertRoutine[newDBR_ENUM+1][newDBF_DEVICE+1])
epicsShareExtern unsigned short dbDBRoldToDBFnew[DBR_DOUBLE+1];
epicsShareExtern unsigned short dbDBRnewToDBRold[newDBR_ENUM+1];
#ifdef DB_CONVERT_GBLSOURCE
epicsShareDef unsigned short dbDBRoldToDBFnew[DBR_DOUBLE+1] = {
0, /*DBR_STRING to DBF_STRING*/
3, /*DBR_INT to DBF_SHORT*/
9, /*DBR_FLOAT to DBF_FLOAT*/
11, /*DBR_ENUM to DBF_ENUM*/
1, /*DBR_CHAR to DBF_CHAR*/
5, /*DBR_LONG to DBF_LONG*/
10 /*DBR_DOUBLE to DBF_DOUBLE*/
unsigned short dbDBRoldToDBFnew[DBR_DOUBLE+1] = {
0, /*DBR_STRING to DBF_STRING*/
3, /*DBR_INT to DBF_SHORT*/
9, /*DBR_FLOAT to DBF_FLOAT*/
11, /*DBR_ENUM to DBF_ENUM*/
1, /*DBR_CHAR to DBF_CHAR*/
5, /*DBR_LONG to DBF_LONG*/
10 /*DBR_DOUBLE to DBF_DOUBLE*/
};
epicsShareDef unsigned short dbDBRnewToDBRold[newDBR_ENUM+1] = {
0, /*DBR_STRING to DBR_STRING*/
4, /*DBR_CHAR to DBR_CHAR*/
4, /*DBR_UCHAR to DBR_CHAR*/
1, /*DBR_SHORT to DBR_SHORT*/
5, /*DBR_USHORT to DBR_LONG*/
5, /*DBR_LONG to DBR_LONG*/
6, /*DBR_ULONG to DBR_DOUBLE*/
6, /*DBR_INT64 to DBR_DOUBLE*/
6, /*DBR_UINT64 to DBR_DOUBLE*/
2, /*DBR_FLOAT to DBR_FLOAT*/
6, /*DBR_DOUBLE to DBR_DOUBLE*/
3, /*DBR_ENUM to DBR_ENUM*/
unsigned short dbDBRnewToDBRold[newDBR_ENUM+1] = {
0, /*DBR_STRING to DBR_STRING*/
4, /*DBR_CHAR to DBR_CHAR*/
4, /*DBR_UCHAR to DBR_CHAR*/
1, /*DBR_SHORT to DBR_SHORT*/
5, /*DBR_USHORT to DBR_LONG*/
5, /*DBR_LONG to DBR_LONG*/
6, /*DBR_ULONG to DBR_DOUBLE*/
6, /*DBR_INT64 to DBR_DOUBLE*/
6, /*DBR_UINT64 to DBR_DOUBLE*/
2, /*DBR_FLOAT to DBR_FLOAT*/
6, /*DBR_DOUBLE to DBR_DOUBLE*/
3, /*DBR_ENUM to DBR_ENUM*/
};
#endif /*DB_CONVERT_GBLSOURCE*/

View File

@@ -38,20 +38,20 @@ extern "C" {
* will adjust automatically, it just compares field sizes.
*/
union native_value {
epicsInt8 dbf_char;
epicsInt16 dbf_short;
epicsEnum16 dbf_enum;
epicsInt32 dbf_long;
epicsFloat32 dbf_float;
epicsFloat64 dbf_double;
epicsInt8 dbf_char;
epicsInt16 dbf_short;
epicsEnum16 dbf_enum;
epicsInt32 dbf_long;
epicsFloat32 dbf_float;
epicsFloat64 dbf_double;
#ifdef DB_EVENT_LOG_STRINGS
char dbf_string[MAX_STRING_SIZE];
char dbf_string[MAX_STRING_SIZE];
#endif
};
/*
* structure to log the state of a data base field at the time
* an event is triggered.
* structure to log the state of a data base field at the time
* an event is triggered.
*/
struct db_field_log;
typedef void (dbfl_freeFunc)(struct db_field_log *pfl);

View File

@@ -30,7 +30,7 @@
#include "dbNotify.h"
#include "db_test.h"
#define MAX_ELEMS 10
#define MAX_ELEMS 10
int gft(const char *pname)
{

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef INCLdb_testh

View File

@@ -48,7 +48,7 @@
/* Hook Routines */
epicsShareDef RECGBL_ALARM_HOOK_ROUTINE recGblAlarmHook = NULL;
RECGBL_ALARM_HOOK_ROUTINE recGblAlarmHook = NULL;
/* local routines */
static void getMaxRangeValues(short field_type, double *pupper_limit,
@@ -59,8 +59,8 @@ static void getMaxRangeValues(short field_type, double *pupper_limit,
void recGblDbaddrError(long status, const struct dbAddr *paddr,
const char *pmessage)
{
dbCommon *precord = 0;
dbFldDes *pdbFldDes = 0;
dbCommon *precord = 0;
dbFldDes *pdbFldDes = 0;
if(paddr) {
pdbFldDes = paddr->pfldDes;
@@ -78,7 +78,7 @@ void recGblDbaddrError(long status, const struct dbAddr *paddr,
void recGblRecordError(long status, void *pdbc,
const char *pmessage)
{
dbCommon *precord = pdbc;
dbCommon *precord = pdbc;
errPrintf(status,0,0,
"PV: %s %s\n",
@@ -190,24 +190,24 @@ unsigned short recGblResetAlarms(void *precord)
pdbc->nsev = 0;
if (prev_sevr != new_sevr) {
stat_mask = DBE_ALARM;
db_post_events(pdbc, &pdbc->sevr, DBE_VALUE);
stat_mask = DBE_ALARM;
db_post_events(pdbc, &pdbc->sevr, DBE_VALUE);
}
if (prev_stat != new_stat) {
stat_mask |= DBE_VALUE;
stat_mask |= DBE_VALUE;
}
if (stat_mask) {
db_post_events(pdbc, &pdbc->stat, stat_mask);
val_mask = DBE_ALARM;
db_post_events(pdbc, &pdbc->stat, stat_mask);
val_mask = DBE_ALARM;
if (!pdbc->ackt || new_sevr >= pdbc->acks) {
pdbc->acks = new_sevr;
db_post_events(pdbc, &pdbc->acks, DBE_VALUE);
}
if (!pdbc->ackt || new_sevr >= pdbc->acks) {
pdbc->acks = new_sevr;
db_post_events(pdbc, &pdbc->acks, DBE_VALUE);
}
if (recGblAlarmHook) {
(*recGblAlarmHook)(pdbc, prev_sevr, prev_stat);
}
if (recGblAlarmHook) {
(*recGblAlarmHook)(pdbc, prev_sevr, prev_stat);
}
}
return val_mask;
}
@@ -217,8 +217,8 @@ int recGblSetSevr(void *precord, epicsEnum16 new_stat, epicsEnum16 new_sevr)
struct dbCommon *prec = precord;
if (prec->nsev < new_sevr) {
prec->nsta = new_stat;
prec->nsev = new_sevr;
return TRUE;
prec->nsev = new_sevr;
return TRUE;
}
return FALSE;
}
@@ -228,17 +228,17 @@ void recGblInheritSevr(int msMode, void *precord, epicsEnum16 stat,
{
switch (msMode) {
case pvlOptNMS:
break;
break;
case pvlOptMSI:
if (sevr < INVALID_ALARM)
break;
/* Fall through */
break;
/* Fall through */
case pvlOptMS:
recGblSetSevr(precord, LINK_ALARM, sevr);
break;
recGblSetSevr(precord, LINK_ALARM, sevr);
break;
case pvlOptMSS:
recGblSetSevr(precord, stat, sevr);
break;
break;
}
}
@@ -251,9 +251,9 @@ void recGblFwdLink(void *precord)
/*Handle dbPutFieldNotify record completions*/
if(pdbc->ppn) dbNotifyCompletion(pdbc);
if(pdbc->rpro) {
/*If anyone requested reprocessing do it*/
pdbc->rpro = FALSE;
scanOnce(pdbc);
/*If anyone requested reprocessing do it*/
pdbc->rpro = FALSE;
scanOnce(pdbc);
}
/*In case putField caused put we are all done */
pdbc->putf = FALSE;
@@ -272,7 +272,7 @@ void recGblGetTimeStampSimm(void *pvoid, const epicsEnum16 simm, struct link *si
if (!dbLinkIsConstant(plink)) {
if (plink->flags & DBLINK_FLAG_TSELisTIME) {
if (dbGetTimeStamp(plink, &prec->time))
errlogPrintf("recGblGetTimeStamp: dbGetTimeStamp failed for %s.TSEL",
errlogPrintf("recGblGetTimeStamp: dbGetTimeStamp failed for %s.TSEL\n",
prec->name);
return;
}

View File

@@ -7,7 +7,7 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* recGbl.h */
/* Record Global
/* Record Global
* Author: Marty Kraimer
* Date: 13Jun95
*/

View File

@@ -22,39 +22,39 @@
#include "devSup.h"
typedef struct dbMenu {
ELLNODE node;
char *name;
int nChoice;
char **papChoiceName;
char **papChoiceValue;
ELLNODE node;
char *name;
int nChoice;
char **papChoiceName;
char **papChoiceValue;
}dbMenu;
typedef struct drvSup {
ELLNODE node;
char *name;
struct drvet *pdrvet;
ELLNODE node;
char *name;
struct drvet *pdrvet;
}drvSup;
typedef struct devSup {
ELLNODE node;
char *name;
char *choice;
int link_type;
/*Following only available on run time system*/
dset *pdset;
struct dsxt *pdsxt; /* Extended device support */
ELLNODE node;
char *name;
char *choice;
int link_type;
/*Following only available on run time system*/
dset *pdset;
struct dsxt *pdsxt; /* Extended device support */
}devSup;
typedef struct linkSup {
ELLNODE node;
char *name;
char *jlif_name;
struct jlif *pjlif;
ELLNODE node;
char *name;
char *jlif_name;
struct jlif *pjlif;
} linkSup;
typedef struct dbDeviceMenu {
int nChoice;
char **papChoice;
int nChoice;
char **papChoice;
}dbDeviceMenu;
/* conversion types*/
@@ -64,47 +64,47 @@ typedef enum {ASL0,ASL1} asLevel;
/*Breakpoint Tables */
typedef struct brkInt{ /* breakpoint interval */
double raw; /*raw value for beginning of interval */
double slope; /*slope for interval */
double eng; /*converted value for beginning of interval*/
double raw; /*raw value for beginning of interval */
double slope; /*slope for interval */
double eng; /*converted value for beginning of interval*/
}brkInt;
typedef struct brkTable { /* breakpoint table */
ELLNODE node;
char *name; /*breakpoint table name */
long number; /*number of brkInt in this table*/
struct brkInt *paBrkInt; /* ptr to array of brkInts */
ELLNODE node;
char *name; /*breakpoint table name */
long number; /*number of brkInt in this table */
struct brkInt *paBrkInt; /* ptr to array of brkInts */
}brkTable;
typedef struct dbFldDes{ /* field description */
char *prompt; /*Prompt string for DCT*/
char *name; /*Field name*/
char *extra; /*C def for DBF_NOACCESS*/
char *prompt; /*Prompt string for DCT */
char *name; /*Field name */
char *extra; /*C def for DBF_NOACCESS */
struct dbRecordType *pdbRecordType;
short indRecordType; /*within dbRecordType.papFldDes */
short special; /*Special processing requirements */
dbfType field_type; /*Field type as defined in dbFldTypes.h */
unsigned int process_passive:1;/*should dbPutField process passive */
unsigned int prop:1;/*field is a metadata, post DBE_PROPERTY on change*/
unsigned int isDevLink:1; /* true for INP/OUT fields */
ctType base; /*base for integer to string conversions*/
short promptgroup; /*prompt, i.e. gui group */
short interest; /*interest level */
asLevel as_level; /*access security level */
char *initial; /*initial value */
/*If (DBF_MENU,DBF_DEVICE) ftPvt is (pdbMenu,pdbDeviceMenu) */
void *ftPvt;
/*On no runtime following only set for STRING */
short size; /*length in bytes of a field element */
short indRecordType; /*within dbRecordType.papFldDes */
short special; /*Special processing requirements */
dbfType field_type; /*Field type as defined in dbFldTypes.h */
unsigned int process_passive:1;/*should dbPutField process passive */
unsigned int prop:1; /*field is a metadata, post DBE_PROPERTY on change*/
unsigned int isDevLink:1; /* true for INP/OUT fields */
ctType base; /*base for integer to string conversions*/
short promptgroup; /*prompt, i.e. gui group */
short interest; /*interest level */
asLevel as_level; /*access security level */
char *initial; /*initial value */
/*If (DBF_MENU,DBF_DEVICE) ftPvt is (pdbMenu,pdbDeviceMenu) */
void *ftPvt;
/*On no runtime following only set for STRING */
short size; /*length in bytes of a field element */
/*The following are only available on run time system*/
unsigned short offset; /*Offset in bytes from beginning of record*/
unsigned short offset; /*Offset in bytes from beginning of record*/
}dbFldDes;
typedef struct dbInfoNode { /*non-field per-record information*/
ELLNODE node;
char *name;
char *string;
void *pointer;
typedef struct dbInfoNode { /*non-field per-record information*/
ELLNODE node;
char *name;
char *string;
void *pointer;
}dbInfoNode;
#define DBRN_FLAGS_VISIBLE 1
@@ -112,11 +112,11 @@ typedef struct dbInfoNode { /*non-field per-record information*/
#define DBRN_FLAGS_HASALIAS 4
typedef struct dbRecordNode {
ELLNODE node;
void *precord;
char *recordname;
ELLLIST infoList; /*LIST head of info nodes*/
int flags;
ELLNODE node;
void *precord;
char *recordname;
ELLLIST infoList; /*LIST head of info nodes*/
int flags;
struct dbRecordNode *aliasedRecnode; /* NULL unless flags|DBRN_FLAGS_ISALIAS */
}dbRecordNode;
@@ -124,64 +124,64 @@ typedef struct dbRecordNode {
/*pdbFldDes is so that other access routines work correctly*/
/*Until base supports char * value MUST be fixed length string*/
typedef struct dbRecordAttribute {
ELLNODE node;
char *name;
dbFldDes *pdbFldDes;
char value[MAX_STRING_SIZE];
ELLNODE node;
char *name;
dbFldDes *pdbFldDes;
char value[MAX_STRING_SIZE];
}dbRecordAttribute;
typedef struct dbText {
ELLNODE node;
char *text;
ELLNODE node;
char *text;
}dbText;
typedef struct dbVariableDef {
ELLNODE node;
char *name;
char *type;
ELLNODE node;
char *name;
char *type;
}dbVariableDef;
typedef struct dbRecordType {
ELLNODE node;
ELLLIST attributeList; /*LIST head of attributes*/
ELLLIST recList; /*LIST head of sorted dbRecordNodes*/
ELLLIST devList; /*List of associated device support*/
ELLLIST cdefList; /*LIST of Cdef text items*/
char *name;
short no_fields; /* number of fields defined */
short no_prompt; /* number of fields to configure*/
short no_links; /* number of links */
short no_aliases; /* number of aliases in recList */
short *link_ind; /* addr of array of ind in papFldDes*/
char **papsortFldName;/* ptr to array of ptr to fld names*/
short *sortFldInd; /* addr of array of ind in papFldDes*/
dbFldDes *pvalFldDes; /*pointer dbFldDes for VAL field*/
short indvalFlddes; /*ind in papFldDes*/
dbFldDes **papFldDes; /* ptr to array of ptr to fldDes*/
ELLNODE node;
ELLLIST attributeList; /*LIST head of attributes*/
ELLLIST recList; /*LIST head of sorted dbRecordNodes*/
ELLLIST devList; /*List of associated device support*/
ELLLIST cdefList; /*LIST of Cdef text items*/
char *name;
short no_fields; /* number of fields defined */
short no_prompt; /* number of fields to configure*/
short no_links; /* number of links */
short no_aliases; /* number of aliases in recList */
short *link_ind; /* addr of array of ind in papFldDes*/
char **papsortFldName;/* ptr to array of ptr to fld names*/
short *sortFldInd; /* addr of array of ind in papFldDes*/
dbFldDes *pvalFldDes; /*pointer dbFldDes for VAL field*/
short indvalFlddes; /*ind in papFldDes*/
dbFldDes **papFldDes; /* ptr to array of ptr to fldDes*/
/*The following are only available on run time system*/
rset *prset;
int rec_size; /*record size in bytes */
rset *prset;
int rec_size; /*record size in bytes */
}dbRecordType;
struct dbPvd; /* Contents private to dbPvdLib code */
struct gphPvt; /* Contents private to gpHashLib code */
typedef struct dbBase {
ELLLIST menuList;
ELLLIST recordTypeList;
ELLLIST drvList;
ELLLIST linkList;
ELLLIST registrarList;
ELLLIST functionList;
ELLLIST variableList;
ELLLIST bptList;
ELLLIST menuList;
ELLLIST recordTypeList;
ELLLIST drvList;
ELLLIST linkList;
ELLLIST registrarList;
ELLLIST functionList;
ELLLIST variableList;
ELLLIST bptList;
ELLLIST filterList;
ELLLIST guiGroupList;
void *pathPvt;
struct dbPvd *ppvd;
struct gphPvt *pgpHash;
short ignoreMissingMenus;
short loadCdefs;
void *pathPvt;
struct dbPvd *ppvd;
struct gphPvt *pgpHash;
short ignoreMissingMenus;
short loadCdefs;
}dbBase;
#endif

View File

@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author: Marty Kraimer
@@ -22,53 +22,53 @@ extern "C" {
/* field types */
typedef enum {
DBF_STRING,
DBF_CHAR,
DBF_UCHAR,
DBF_SHORT,
DBF_USHORT,
DBF_LONG,
DBF_ULONG,
DBF_INT64,
DBF_UINT64,
DBF_FLOAT,
DBF_DOUBLE,
DBF_ENUM,
DBF_MENU,
DBF_DEVICE,
DBF_INLINK,
DBF_OUTLINK,
DBF_FWDLINK,
DBF_NOACCESS
DBF_STRING,
DBF_CHAR,
DBF_UCHAR,
DBF_SHORT,
DBF_USHORT,
DBF_LONG,
DBF_ULONG,
DBF_INT64,
DBF_UINT64,
DBF_FLOAT,
DBF_DOUBLE,
DBF_ENUM,
DBF_MENU,
DBF_DEVICE,
DBF_INLINK,
DBF_OUTLINK,
DBF_FWDLINK,
DBF_NOACCESS
}dbfType;
#define DBF_NTYPES DBF_NOACCESS+1
typedef struct mapdbfType{
char *strvalue;
dbfType value;
char *strvalue;
dbfType value;
}mapdbfType;
epicsShareExtern mapdbfType pamapdbfType[];
#ifdef DBFLDTYPES_GBLSOURCE
epicsShareDef mapdbfType pamapdbfType[DBF_NTYPES] = {
{"DBF_STRING",DBF_STRING},
{"DBF_CHAR",DBF_CHAR},
{"DBF_UCHAR",DBF_UCHAR},
{"DBF_SHORT",DBF_SHORT},
{"DBF_USHORT",DBF_USHORT},
{"DBF_LONG",DBF_LONG},
{"DBF_ULONG",DBF_ULONG},
{"DBF_INT64",DBF_INT64},
{"DBF_UINT64",DBF_UINT64},
{"DBF_FLOAT",DBF_FLOAT},
{"DBF_DOUBLE",DBF_DOUBLE},
{"DBF_ENUM",DBF_ENUM},
{"DBF_MENU",DBF_MENU},
{"DBF_DEVICE",DBF_DEVICE},
{"DBF_INLINK",DBF_INLINK},
{"DBF_OUTLINK",DBF_OUTLINK},
{"DBF_FWDLINK",DBF_FWDLINK},
{"DBF_NOACCESS",DBF_NOACCESS}
mapdbfType pamapdbfType[DBF_NTYPES] = {
{"DBF_STRING",DBF_STRING},
{"DBF_CHAR",DBF_CHAR},
{"DBF_UCHAR",DBF_UCHAR},
{"DBF_SHORT",DBF_SHORT},
{"DBF_USHORT",DBF_USHORT},
{"DBF_LONG",DBF_LONG},
{"DBF_ULONG",DBF_ULONG},
{"DBF_INT64",DBF_INT64},
{"DBF_UINT64",DBF_UINT64},
{"DBF_FLOAT",DBF_FLOAT},
{"DBF_DOUBLE",DBF_DOUBLE},
{"DBF_ENUM",DBF_ENUM},
{"DBF_MENU",DBF_MENU},
{"DBF_DEVICE",DBF_DEVICE},
{"DBF_INLINK",DBF_INLINK},
{"DBF_OUTLINK",DBF_OUTLINK},
{"DBF_FWDLINK",DBF_FWDLINK},
{"DBF_NOACCESS",DBF_NOACCESS}
};
#endif /*DBFLDTYPES_GBLSOURCE*/
@@ -85,8 +85,8 @@ epicsShareDef mapdbfType pamapdbfType[DBF_NTYPES] = {
#define DBR_FLOAT DBF_FLOAT
#define DBR_DOUBLE DBF_DOUBLE
#define DBR_ENUM DBF_ENUM
#define DBR_PUT_ACKT DBR_ENUM+1
#define DBR_PUT_ACKS DBR_PUT_ACKT+1
#define DBR_PUT_ACKT DBR_ENUM+1
#define DBR_PUT_ACKS DBR_PUT_ACKT+1
#define DBR_NOACCESS DBF_NOACCESS
#define VALID_DB_REQ(x) ((x >= 0) && (x <= DBR_ENUM))
#define INVALID_DB_REQ(x) ((x < 0) || (x > DBR_ENUM))

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
newline "\n"
@@ -16,18 +16,18 @@ escape {backslash}.
stringchar [^"\n\\]
bareword [a-zA-Z0-9_\-+:.\[\]<>;]
punctuation [:,\[\]{}]
normalchar [^"\\\0-\x1f]
barechar [a-zA-Z0-9_\-+.]
escapedchar ({backslash}["\\/bfnrt])
hexdigit [0-9a-fA-F]
unicodechar ({backslash}"u"{hexdigit}{4})
jsonchar ({normalchar}|{escapedchar}|{unicodechar})
jsondqstr ({doublequote}{jsonchar}*{doublequote})
int ("-"?([0-9]|[1-9][0-9]+))
frac ("."[0-9]+)
exp ([eE][+-]?[0-9]+)
number ({int}{frac}?{exp}?)
punctuation [:,\[\]{}]
normalchar [^"\\\0-\x1f]
barechar [a-zA-Z0-9_\-+.]
escapedchar ({backslash}["\\/bfnrt])
hexdigit [0-9a-fA-F]
unicodechar ({backslash}"u"{hexdigit}{4})
jsonchar ({normalchar}|{escapedchar}|{unicodechar})
jsondqstr ({doublequote}{jsonchar}*{doublequote})
int ("-"?([0-9]|[1-9][0-9]+))
frac ("."[0-9]+)
exp ([eE][+-]?[0-9]+)
number ({int}{frac}?{exp}?)
%{
#undef YY_INPUT
@@ -35,8 +35,8 @@ number ({int}{frac}?{exp}?)
static int yyreset(void)
{
BEGIN INITIAL;
return(0);
BEGIN INITIAL;
return(0);
}
%}
@@ -45,90 +45,90 @@ static int yyreset(void)
%%
"include" return(tokenINCLUDE);
"path" return(tokenPATH);
"addpath" return(tokenADDPATH);
"menu" return(tokenMENU);
"choice" return(tokenCHOICE);
"recordtype" return(tokenRECORDTYPE);
"field" return(tokenFIELD);
"device" return(tokenDEVICE);
"driver" return(tokenDRIVER);
"link" return(tokenLINK);
"breaktable" return(tokenBREAKTABLE);
"record" return(tokenRECORD);
"grecord" return(tokenGRECORD);
"alias" return(tokenALIAS);
"info" return(tokenINFO);
"registrar" return(tokenREGISTRAR);
"function" return(tokenFUNCTION);
"variable" return(tokenVARIABLE);
"include" return(tokenINCLUDE);
"path" return(tokenPATH);
"addpath" return(tokenADDPATH);
"menu" return(tokenMENU);
"choice" return(tokenCHOICE);
"recordtype" return(tokenRECORDTYPE);
"field" return(tokenFIELD);
"device" return(tokenDEVICE);
"driver" return(tokenDRIVER);
"link" return(tokenLINK);
"breaktable" return(tokenBREAKTABLE);
"record" return(tokenRECORD);
"grecord" return(tokenGRECORD);
"alias" return(tokenALIAS);
"info" return(tokenINFO);
"registrar" return(tokenREGISTRAR);
"function" return(tokenFUNCTION);
"variable" return(tokenVARIABLE);
{bareword}+ { /* unquoted string or number */
yylval.Str = dbmfStrdup((char *) yytext);
return(tokenSTRING);
yylval.Str = dbmfStrdup((char *) yytext);
return(tokenSTRING);
}
{doublequote}({stringchar}|{escape})*{doublequote} { /* quoted string */
yylval.Str = dbmfStrdup((char *) yytext+1);
yylval.Str[strlen(yylval.Str)-1] = '\0';
return(tokenSTRING);
yylval.Str = dbmfStrdup((char *) yytext+1);
yylval.Str[strlen(yylval.Str)-1] = '\0';
return(tokenSTRING);
}
%.* { /*C definition in recordtype*/
yylval.Str = dbmfStrdup((char *) yytext+1);
return(tokenCDEFS);
%.* { /*C definition in recordtype*/
yylval.Str = dbmfStrdup((char *) yytext+1);
return(tokenCDEFS);
}
"{" return(yytext[0]);
"}" return(yytext[0]);
"(" return(yytext[0]);
")" return(yytext[0]);
"," return(yytext[0]);
"{" return(yytext[0]);
"}" return(yytext[0]);
"(" return(yytext[0]);
")" return(yytext[0]);
"," return(yytext[0]);
{doublequote}({stringchar}|{escape})*{newline} { /* bad string */
yyerrorAbort("Newline in string, closing quote missing");
yyerrorAbort("Newline in string, closing quote missing");
}
<JSON>"null" return jsonNULL;
<JSON>"true" return jsonTRUE;
<JSON>"false" return jsonFALSE;
<JSON>"null" return jsonNULL;
<JSON>"true" return jsonTRUE;
<JSON>"false" return jsonFALSE;
<JSON>{punctuation} return yytext[0];
<JSON>{punctuation} return yytext[0];
<JSON>{jsondqstr} {
yylval.Str = dbmfStrdup((char *) yytext);
return jsonSTRING;
yylval.Str = dbmfStrdup((char *) yytext);
return jsonSTRING;
}
<JSON>{number} {
yylval.Str = dbmfStrdup((char *) yytext);
return jsonNUMBER;
yylval.Str = dbmfStrdup((char *) yytext);
return jsonNUMBER;
}
<JSON>{barechar}+ {
yylval.Str = dbmfStrdup((char *) yytext);
return jsonBARE;
yylval.Str = dbmfStrdup((char *) yytext);
return jsonBARE;
}
<INITIAL,JSON>{comment}.* ;
<INITIAL,JSON>{comment}.* ;
<INITIAL,JSON>{whitespace} ;
<INITIAL,JSON>{whitespace} ;
<INITIAL,JSON>. {
char message[40];
YY_BUFFER_STATE *dummy=0;
<INITIAL,JSON>. {
char message[40];
YY_BUFFER_STATE *dummy=0;
if (isprint((int) yytext[0])) {
sprintf(message, "Invalid character '%c'", yytext[0]);
}
else {
sprintf(message, "Invalid character 0x%2.2x", yytext[0]);
}
yyerrorAbort(message);
/*The following suppresses compiler warning messages*/
if(FALSE) yyunput('c',(unsigned char *) message);
if(FALSE) yy_switch_to_buffer(*dummy);
if (isprint((int) yytext[0])) {
sprintf(message, "Invalid character '%c'", yytext[0]);
}
else {
sprintf(message, "Invalid character 0x%2.2x", yytext[0]);
}
yyerrorAbort(message);
/*The following suppresses compiler warning messages*/
if(FALSE) yyunput('c',(unsigned char *) message);
if(FALSE) yy_switch_to_buffer(*dummy);
}
%%

View File

@@ -35,22 +35,23 @@
#include "epicsExport.h"
#include "link.h"
#include "special.h"
#include "iocInit.h"
/*global declarations*/
epicsShareDef char *makeDbdDepends=0;
char *makeDbdDepends=0;
epicsShareDef int dbRecordsOnceOnly=0;
int dbRecordsOnceOnly=0;
epicsExportAddress(int,dbRecordsOnceOnly);
epicsShareDef int dbBptNotMonotonic=0;
int dbBptNotMonotonic=0;
epicsExportAddress(int,dbBptNotMonotonic);
epicsShareDef int dbQuietMacroWarnings=0;
int dbQuietMacroWarnings=0;
epicsExportAddress(int,dbQuietMacroWarnings);
epicsShareDef int dbRecordsAbcSorted=0;
int dbRecordsAbcSorted=0;
epicsExportAddress(int,dbRecordsAbcSorted);
/*private routines */
@@ -75,7 +76,7 @@ static void dbRecordtypeFieldItem(char *name,char *value);
static short findOrAddGuiGroup(const char *name);
static void dbDevice(char *recordtype,char *linktype,
char *dsetname,char *choicestring);
char *dsetname,char *choicestring);
static void dbDriver(char *name);
static void dbLinkType(char *name, char *jlif_name);
static void dbRegistrar(char *name);
@@ -97,11 +98,11 @@ static char *mac_input_buffer=NULL;
static char *my_buffer_ptr=NULL;
static MAC_HANDLE *macHandle = NULL;
typedef struct inputFile{
ELLNODE node;
char *path;
char *filename;
FILE *fp;
int line_num;
ELLNODE node;
char *path;
char *filename;
FILE *fp;
int line_num;
}inputFile;
static ELLLIST inputFileList = ELLLIST_INIT;
@@ -109,8 +110,8 @@ static inputFile *pinputFileNow = NULL;
static DBBASE *pdbbase = NULL;
typedef struct tempListNode {
ELLNODE node;
void *item;
ELLNODE node;
void *item;
}tempListNode;
static ELLLIST tempList = ELLLIST_INIT;
@@ -125,7 +126,7 @@ static void yyerrorAbort(char *str)
static void allocTemp(void *pvoid)
{
tempListNode *ptempListNode;
tempListNode *ptempListNode;
ptempListNode = freeListCalloc(freeListPvt);
ptempListNode->item = pvoid;
@@ -134,8 +135,8 @@ static void allocTemp(void *pvoid)
static void *popFirstTemp(void)
{
tempListNode *ptempListNode;
void *ptemp;
tempListNode *ptempListNode;
void *ptemp;
ptempListNode = (tempListNode *)ellFirst(&tempList);
ptemp = ptempListNode->item;
@@ -146,7 +147,7 @@ static void *popFirstTemp(void)
static void *getLastTemp(void)
{
tempListNode *ptempListNode;
tempListNode *ptempListNode;
ptempListNode = (tempListNode *)ellLast(&tempList);
return(ptempListNode->item);
@@ -154,9 +155,9 @@ static void *getLastTemp(void)
static char *dbOpenFile(DBBASE *pdbbase,const char *filename,FILE **fp)
{
ELLLIST *ppathList = (ELLLIST *)pdbbase->pathPvt;
dbPathNode *pdbPathNode;
char *fullfilename;
ELLLIST *ppathList = (ELLLIST *)pdbbase->pathPvt;
dbPathNode *pdbPathNode;
char *fullfilename;
*fp = 0;
if (!filename) return 0;
@@ -190,12 +191,12 @@ static void freeInputFileList(void)
inputFile *pinputFileNow;
while((pinputFileNow=(inputFile *)ellFirst(&inputFileList))) {
if(fclose(pinputFileNow->fp))
errPrintf(0,__FILE__, __LINE__,
"Closing file %s",pinputFileNow->filename);
free((void *)pinputFileNow->filename);
ellDelete(&inputFileList,(ELLNODE *)pinputFileNow);
free((void *)pinputFileNow);
if(fclose(pinputFileNow->fp))
errPrintf(0,__FILE__, __LINE__,
"Closing file %s",pinputFileNow->filename);
free((void *)pinputFileNow->filename);
ellDelete(&inputFileList,(ELLNODE *)pinputFileNow);
free((void *)pinputFileNow);
}
}
@@ -209,46 +210,49 @@ int cmp_dbRecordNode(const ELLNODE *lhs, const ELLNODE *rhs)
}
static long dbReadCOM(DBBASE **ppdbbase,const char *filename, FILE *fp,
const char *path,const char *substitutions)
const char *path,const char *substitutions)
{
long status;
inputFile *pinputFile = NULL;
char *penv;
char **macPairs;
long status;
inputFile *pinputFile = NULL;
char *penv;
char **macPairs;
if(ellCount(&tempList)) {
if (ellCount(&tempList)) {
epicsPrintf("dbReadCOM: Parser stack dirty %d\n", ellCount(&tempList));
}
if (getIocState() != iocVoid)
return -2;
if(*ppdbbase == 0) *ppdbbase = dbAllocBase();
pdbbase = *ppdbbase;
if(path && strlen(path)>0) {
dbPath(pdbbase,path);
dbPath(pdbbase,path);
} else {
penv = getenv("EPICS_DB_INCLUDE_PATH");
if(penv) {
dbPath(pdbbase,penv);
} else {
dbPath(pdbbase,".");
}
penv = getenv("EPICS_DB_INCLUDE_PATH");
if(penv) {
dbPath(pdbbase,penv);
} else {
dbPath(pdbbase,".");
}
}
my_buffer = dbCalloc(MY_BUFFER_SIZE,sizeof(char));
freeListInitPvt(&freeListPvt,sizeof(tempListNode),100);
if(substitutions) {
if(macCreateHandle(&macHandle,NULL)) {
epicsPrintf("macCreateHandle error\n");
if(macCreateHandle(&macHandle,NULL)) {
epicsPrintf("macCreateHandle error\n");
status = -1;
goto cleanup;
}
macParseDefns(macHandle,(char *)substitutions,&macPairs);
if(macPairs ==NULL) {
macDeleteHandle(macHandle);
macHandle = NULL;
} else {
macInstallMacros(macHandle,macPairs);
free((void *)macPairs);
mac_input_buffer = dbCalloc(MY_BUFFER_SIZE,sizeof(char));
}
goto cleanup;
}
macParseDefns(macHandle,(char *)substitutions,&macPairs);
if(macPairs ==NULL) {
macDeleteHandle(macHandle);
macHandle = NULL;
} else {
macInstallMacros(macHandle,macPairs);
free((void *)macPairs);
mac_input_buffer = dbCalloc(MY_BUFFER_SIZE,sizeof(char));
}
macSuppressWarning(macHandle,dbQuietMacroWarnings);
}
pinputFile = dbCalloc(1,sizeof(inputFile));
@@ -286,26 +290,26 @@ static long dbReadCOM(DBBASE **ppdbbase,const char *filename, FILE *fp,
dbFreePath(pdbbase);
if(!status) { /*add RTYP and VERS as an attribute */
DBENTRY dbEntry;
DBENTRY *pdbEntry = &dbEntry;
long localStatus;
DBENTRY dbEntry;
DBENTRY *pdbEntry = &dbEntry;
long localStatus;
dbInitEntry(pdbbase,pdbEntry);
localStatus = dbFirstRecordType(pdbEntry);
while(!localStatus) {
localStatus = dbPutRecordAttribute(pdbEntry,"RTYP",
dbGetRecordTypeName(pdbEntry));
if(!localStatus) {
localStatus = dbPutRecordAttribute(pdbEntry,"VERS",
"none specified");
}
if(localStatus) {
fprintf(stderr,"dbPutRecordAttribute status %ld\n",status);
} else {
localStatus = dbNextRecordType(pdbEntry);
}
}
dbFinishEntry(pdbEntry);
dbInitEntry(pdbbase,pdbEntry);
localStatus = dbFirstRecordType(pdbEntry);
while(!localStatus) {
localStatus = dbPutRecordAttribute(pdbEntry,"RTYP",
dbGetRecordTypeName(pdbEntry));
if(!localStatus) {
localStatus = dbPutRecordAttribute(pdbEntry,"VERS",
"none specified");
}
if(localStatus) {
fprintf(stderr,"dbPutRecordAttribute status %ld\n",status);
} else {
localStatus = dbNextRecordType(pdbEntry);
}
}
dbFinishEntry(pdbEntry);
}
cleanup:
if(dbRecordsAbcSorted) {
@@ -330,48 +334,48 @@ cleanup:
}
long dbReadDatabase(DBBASE **ppdbbase,const char *filename,
const char *path,const char *substitutions)
const char *path,const char *substitutions)
{return (dbReadCOM(ppdbbase,filename,0,path,substitutions));}
long dbReadDatabaseFP(DBBASE **ppdbbase,FILE *fp,
const char *path,const char *substitutions)
const char *path,const char *substitutions)
{return (dbReadCOM(ppdbbase,0,fp,path,substitutions));}
static int db_yyinput(char *buf, int max_size)
{
size_t l,n;
char *fgetsRtn;
char *fgetsRtn;
if(yyAbort) return(0);
if(*my_buffer_ptr==0) {
while(TRUE) { /*until we get some input*/
if(macHandle) {
fgetsRtn = fgets(mac_input_buffer,MY_BUFFER_SIZE,
pinputFileNow->fp);
if(fgetsRtn) {
int exp = macExpandString(macHandle,mac_input_buffer,
my_buffer,MY_BUFFER_SIZE);
if (exp < 0) {
fprintf(stderr, "Warning: '%s' line %d has undefined macros\n",
pinputFileNow->filename, pinputFileNow->line_num+1);
}
}
} else {
fgetsRtn = fgets(my_buffer,MY_BUFFER_SIZE,pinputFileNow->fp);
}
if(fgetsRtn) break;
if(fclose(pinputFileNow->fp))
errPrintf(0,__FILE__, __LINE__,
"Closing file %s",pinputFileNow->filename);
free((void *)pinputFileNow->filename);
ellDelete(&inputFileList,(ELLNODE *)pinputFileNow);
free((void *)pinputFileNow);
pinputFileNow = (inputFile *)ellLast(&inputFileList);
if(!pinputFileNow) return(0);
}
if(dbStaticDebug) fprintf(stderr,"%s",my_buffer);
pinputFileNow->line_num++;
my_buffer_ptr = &my_buffer[0];
while(TRUE) { /*until we get some input*/
if(macHandle) {
fgetsRtn = fgets(mac_input_buffer,MY_BUFFER_SIZE,
pinputFileNow->fp);
if(fgetsRtn) {
int exp = macExpandString(macHandle,mac_input_buffer,
my_buffer,MY_BUFFER_SIZE);
if (exp < 0) {
fprintf(stderr, "Warning: '%s' line %d has undefined macros\n",
pinputFileNow->filename, pinputFileNow->line_num+1);
}
}
} else {
fgetsRtn = fgets(my_buffer,MY_BUFFER_SIZE,pinputFileNow->fp);
}
if(fgetsRtn) break;
if(fclose(pinputFileNow->fp))
errPrintf(0,__FILE__, __LINE__,
"Closing file %s",pinputFileNow->filename);
free((void *)pinputFileNow->filename);
ellDelete(&inputFileList,(ELLNODE *)pinputFileNow);
free((void *)pinputFileNow);
pinputFileNow = (inputFile *)ellLast(&inputFileList);
if(!pinputFileNow) return(0);
}
if(dbStaticDebug) fprintf(stderr,"%s",my_buffer);
pinputFileNow->line_num++;
my_buffer_ptr = &my_buffer[0];
}
l = strlen(my_buffer_ptr);
n = (l<=max_size ? l : max_size);
@@ -385,16 +389,16 @@ static void dbIncludePrint(void)
inputFile *pinputFile = pinputFileNow;
while (pinputFile) {
epicsPrintf(" in");
if (pinputFile->path)
epicsPrintf(" path \"%s\" ",pinputFile->path);
if (pinputFile->filename) {
epicsPrintf(" file \"%s\"",pinputFile->filename);
} else {
epicsPrintf(" standard input");
}
epicsPrintf(" line %d\n",pinputFile->line_num);
pinputFile = (inputFile *)ellPrevious(&pinputFile->node);
epicsPrintf(" in");
if (pinputFile->path)
epicsPrintf(" path \"%s\" ",pinputFile->path);
if (pinputFile->filename) {
epicsPrintf(" file \"%s\"",pinputFile->filename);
} else {
epicsPrintf(" standard input");
}
epicsPrintf(" line %d\n",pinputFile->line_num);
pinputFile = (inputFile *)ellPrevious(&pinputFile->node);
}
return;
}
@@ -411,8 +415,8 @@ static void dbAddPathCmd(char *path)
static void dbIncludeNew(char *filename)
{
inputFile *pinputFile;
FILE *fp;
inputFile *pinputFile;
FILE *fp;
pinputFile = dbCalloc(1,sizeof(inputFile));
pinputFile->filename = macEnvExpand(filename);
@@ -431,8 +435,8 @@ static void dbIncludeNew(char *filename)
static void dbMenuHead(char *name)
{
dbMenu *pdbMenu;
GPHENTRY *pgphentry;
dbMenu *pdbMenu;
GPHENTRY *pgphentry;
if (!*name) {
yyerrorAbort("dbMenuHead: Menu name can't be empty");
@@ -440,8 +444,8 @@ static void dbMenuHead(char *name)
}
pgphentry = gphFind(pdbbase->pgpHash,name,&pdbbase->menuList);
if(pgphentry) {
duplicate = TRUE;
return;
duplicate = TRUE;
return;
}
if(ellCount(&tempList)) yyerrorAbort("dbMenuHead: tempList not empty");
pdbMenu = dbCalloc(1,sizeof(dbMenu));
@@ -462,45 +466,45 @@ static void dbMenuChoice(char *name,char *value)
static void dbMenuBody(void)
{
dbMenu *pnewMenu;
dbMenu *pMenu;
int nChoice;
int i;
GPHENTRY *pgphentry;
dbMenu *pnewMenu;
dbMenu *pMenu;
int nChoice;
int i;
GPHENTRY *pgphentry;
if(duplicate) {
duplicate = FALSE;
return;
duplicate = FALSE;
return;
}
pnewMenu = (dbMenu *)popFirstTemp();
pnewMenu->nChoice = nChoice = ellCount(&tempList)/2;
pnewMenu->papChoiceName = dbCalloc(pnewMenu->nChoice,sizeof(char *));
pnewMenu->papChoiceValue = dbCalloc(pnewMenu->nChoice,sizeof(char *));
for(i=0; i<nChoice; i++) {
pnewMenu->papChoiceName[i] = (char *)popFirstTemp();
pnewMenu->papChoiceValue[i] = (char *)popFirstTemp();
pnewMenu->papChoiceName[i] = (char *)popFirstTemp();
pnewMenu->papChoiceValue[i] = (char *)popFirstTemp();
}
if(ellCount(&tempList)) yyerrorAbort("dbMenuBody: tempList not empty");
/* Add menu in sorted order */
pMenu = (dbMenu *)ellFirst(&pdbbase->menuList);
while(pMenu && strcmp(pMenu->name,pnewMenu->name) >0 )
pMenu = (dbMenu *)ellNext(&pMenu->node);
pMenu = (dbMenu *)ellNext(&pMenu->node);
if(pMenu)
ellInsert(&pdbbase->menuList,ellPrevious(&pMenu->node),&pnewMenu->node);
ellInsert(&pdbbase->menuList,ellPrevious(&pMenu->node),&pnewMenu->node);
else
ellAdd(&pdbbase->menuList,&pnewMenu->node);
ellAdd(&pdbbase->menuList,&pnewMenu->node);
pgphentry = gphAdd(pdbbase->pgpHash,pnewMenu->name,&pdbbase->menuList);
if(!pgphentry) {
yyerrorAbort("gphAdd failed");
yyerrorAbort("gphAdd failed");
} else {
pgphentry->userPvt = pnewMenu;
pgphentry->userPvt = pnewMenu;
}
}
static void dbRecordtypeHead(char *name)
{
dbRecordType *pdbRecordType;
GPHENTRY *pgphentry;
dbRecordType *pdbRecordType;
GPHENTRY *pgphentry;
if (!*name) {
yyerrorAbort("dbRecordtypeHead: Recordtype name can't be empty");
@@ -508,21 +512,21 @@ static void dbRecordtypeHead(char *name)
}
pgphentry = gphFind(pdbbase->pgpHash,name,&pdbbase->recordTypeList);
if(pgphentry) {
duplicate = TRUE;
return;
duplicate = TRUE;
return;
}
pdbRecordType = dbCalloc(1,sizeof(dbRecordType));
pdbRecordType->name = epicsStrDup(name);
if (pdbbase->loadCdefs) ellInit(&pdbRecordType->cdefList);
if(ellCount(&tempList))
yyerrorAbort("dbRecordtypeHead tempList not empty");
yyerrorAbort("dbRecordtypeHead tempList not empty");
allocTemp(pdbRecordType);
}
static void dbRecordtypeFieldHead(char *name,char *type)
{
dbFldDes *pdbFldDes;
int i;
dbFldDes *pdbFldDes;
int i;
if (!*name) {
yyerrorAbort("dbRecordtypeFieldHead: Field name can't be empty");
@@ -559,7 +563,7 @@ static short findOrAddGuiGroup(const char *name)
static void dbRecordtypeFieldItem(char *name,char *value)
{
dbFldDes *pdbFldDes;
dbFldDes *pdbFldDes;
if(duplicate) return;
pdbFldDes = (dbFldDes *)getLastTemp();
@@ -586,7 +590,7 @@ static void dbRecordtypeFieldItem(char *name,char *value)
return;
}
if(strcmp(name,"special")==0) {
int i;
int i;
for(i=0; i<SPC_NTYPES; i++) {
if(strcmp(value,pamapspcType[i].strvalue)==0) {
pdbFldDes->special = pamapspcType[i].value;
@@ -649,16 +653,16 @@ static void dbRecordtypeFieldItem(char *name,char *value)
}
static void dbRecordtypeCdef(char *text) {
dbText *pdbCdef;
tempListNode *ptempListNode;
dbRecordType *pdbRecordType;
dbText *pdbCdef;
tempListNode *ptempListNode;
dbRecordType *pdbRecordType;
if (!pdbbase->loadCdefs || duplicate) return;
ptempListNode = (tempListNode *)ellFirst(&tempList);
pdbRecordType = ptempListNode->item;
pdbCdef = dbCalloc(1,sizeof(dbText));
if (text[0] == ' ') text++; /* strip leading space if present */
if (text[0] == ' ') text++; /* strip leading space if present */
pdbCdef->text = epicsStrDup(text);
ellAdd(&pdbRecordType->cdefList, &pdbCdef->node);
return;
@@ -671,7 +675,7 @@ static void dbRecordtypeEmpty(void)
if (duplicate) {
duplicate = FALSE;
return;
return;
}
ptempListNode = (tempListNode *)ellFirst(&tempList);
@@ -683,20 +687,20 @@ static void dbRecordtypeEmpty(void)
static void dbRecordtypeBody(void)
{
dbRecordType *pdbRecordType;
dbFldDes *pdbFldDes;
int i,j,ilink;
GPHENTRY *pgphentry;
int no_fields,no_prompt,no_links;
dbfType field_type;
char *psortFldNameTemp;
short psortFldIndTemp;
char **papsortFldName;
short *sortFldInd;
dbRecordType *pdbRecordType;
dbFldDes *pdbFldDes;
int i,j,ilink;
GPHENTRY *pgphentry;
int no_fields,no_prompt,no_links;
dbfType field_type;
char *psortFldNameTemp;
short psortFldIndTemp;
char **papsortFldName;
short *sortFldInd;
if(duplicate) {
duplicate = FALSE;
return;
duplicate = FALSE;
return;
}
pdbRecordType= (dbRecordType *)popFirstTemp();
pdbRecordType->no_fields = no_fields = ellCount(&tempList);
@@ -705,19 +709,19 @@ static void dbRecordtypeBody(void)
pdbRecordType->sortFldInd = dbCalloc(no_fields,sizeof(short));
no_prompt = no_links = 0;
for(i=0; i<no_fields; i++) {
pdbFldDes = (dbFldDes *)popFirstTemp();
pdbFldDes->pdbRecordType = pdbRecordType;
pdbFldDes->indRecordType = i;
pdbRecordType->papFldDes[i] = pdbFldDes;
if(pdbFldDes->promptgroup) no_prompt++;
field_type = pdbFldDes->field_type;
if((field_type>=DBF_INLINK) && (field_type<=DBF_FWDLINK))no_links++;
if((field_type==DBF_STRING) && (pdbFldDes->size==0))
fprintf(stderr,"recordtype(%s).%s size not specified\n",
pdbRecordType->name,pdbFldDes->name);
if((field_type==DBF_NOACCESS) && (pdbFldDes->extra==0))
fprintf(stderr,"recordtype(%s).%s extra not specified\n",
pdbRecordType->name,pdbFldDes->name);
pdbFldDes = (dbFldDes *)popFirstTemp();
pdbFldDes->pdbRecordType = pdbRecordType;
pdbFldDes->indRecordType = i;
pdbRecordType->papFldDes[i] = pdbFldDes;
if(pdbFldDes->promptgroup) no_prompt++;
field_type = pdbFldDes->field_type;
if((field_type>=DBF_INLINK) && (field_type<=DBF_FWDLINK))no_links++;
if((field_type==DBF_STRING) && (pdbFldDes->size==0))
fprintf(stderr,"recordtype(%s).%s size not specified\n",
pdbRecordType->name,pdbFldDes->name);
if((field_type==DBF_NOACCESS) && (pdbFldDes->extra==0))
fprintf(stderr,"recordtype(%s).%s extra not specified\n",
pdbRecordType->name,pdbFldDes->name);
}
if (ellCount(&tempList))
yyerrorAbort("dbRecordtypeBody: tempList not empty");
@@ -726,79 +730,79 @@ static void dbRecordtypeBody(void)
pdbRecordType->link_ind = dbCalloc(no_links,sizeof(short));
ilink = 0;
for(i=0; i<no_fields; i++) {
pdbFldDes = pdbRecordType->papFldDes[i];
pdbFldDes = pdbRecordType->papFldDes[i];
/* if prompt is null make it a null string */
if(!pdbFldDes->prompt) pdbFldDes->prompt = dbCalloc(1,sizeof(char));
field_type = pdbFldDes->field_type;
if((field_type>=DBF_INLINK) && (field_type<=DBF_FWDLINK))
pdbRecordType->link_ind[ilink++] = i;
if(strcmp(pdbFldDes->name,"VAL")==0) {
pdbRecordType->pvalFldDes = pdbRecordType->papFldDes[i];
pdbRecordType->indvalFlddes = i;
}
pdbRecordType->papsortFldName[i] = pdbFldDes->name;
pdbRecordType->sortFldInd[i] = i;
field_type = pdbFldDes->field_type;
if((field_type>=DBF_INLINK) && (field_type<=DBF_FWDLINK))
pdbRecordType->link_ind[ilink++] = i;
if(strcmp(pdbFldDes->name,"VAL")==0) {
pdbRecordType->pvalFldDes = pdbRecordType->papFldDes[i];
pdbRecordType->indvalFlddes = i;
}
pdbRecordType->papsortFldName[i] = pdbFldDes->name;
pdbRecordType->sortFldInd[i] = i;
}
/*Now sort fields. Sorry dumb sort algorithm */
papsortFldName = pdbRecordType->papsortFldName;
sortFldInd = pdbRecordType->sortFldInd;
for(i=0; i<no_fields; i++) {
for(j=i+1; j<no_fields; j++) {
if(strcmp(papsortFldName[j],papsortFldName[i])<0 ) {
psortFldNameTemp = papsortFldName[j];
psortFldIndTemp = sortFldInd[j];
papsortFldName[j] = papsortFldName[i];
sortFldInd[j] = sortFldInd[i];
papsortFldName[i] = psortFldNameTemp;
sortFldInd[i] = psortFldIndTemp;
}
}
for(j=i+1; j<no_fields; j++) {
if(strcmp(papsortFldName[j],papsortFldName[i])<0 ) {
psortFldNameTemp = papsortFldName[j];
psortFldIndTemp = sortFldInd[j];
papsortFldName[j] = papsortFldName[i];
sortFldInd[j] = sortFldInd[i];
papsortFldName[i] = psortFldNameTemp;
sortFldInd[i] = psortFldIndTemp;
}
}
}
/*Initialize lists*/
ellInit(&pdbRecordType->attributeList);
ellInit(&pdbRecordType->recList);
ellInit(&pdbRecordType->devList);
pgphentry = gphAdd(pdbbase->pgpHash,pdbRecordType->name,
&pdbbase->recordTypeList);
&pdbbase->recordTypeList);
if(!pgphentry) {
yyerrorAbort("gphAdd failed");
yyerrorAbort("gphAdd failed");
} else {
pgphentry->userPvt = pdbRecordType;
pgphentry->userPvt = pdbRecordType;
}
ellAdd(&pdbbase->recordTypeList,&pdbRecordType->node);
}
static void dbDevice(char *recordtype,char *linktype,
char *dsetname,char *choicestring)
char *dsetname,char *choicestring)
{
devSup *pdevSup;
dbRecordType *pdbRecordType;
GPHENTRY *pgphentry;
int i,link_type;
devSup *pdevSup;
dbRecordType *pdbRecordType;
GPHENTRY *pgphentry;
int i,link_type;
pgphentry = gphFind(pdbbase->pgpHash,recordtype,&pdbbase->recordTypeList);
if(!pgphentry) {
epicsPrintf("Record type \"%s\" not found for device \"%s\"\n",
recordtype, choicestring);
yyerror(NULL);
return;
yyerror(NULL);
return;
}
link_type=-1;
for(i=0; i<LINK_NTYPES; i++) {
if(strcmp(pamaplinkType[i].strvalue,linktype)==0) {
link_type = pamaplinkType[i].value;
break;
}
if(strcmp(pamaplinkType[i].strvalue,linktype)==0) {
link_type = pamaplinkType[i].value;
break;
}
}
if(link_type==-1) {
epicsPrintf("Bad link type \"%s\" for device \"%s\"\n",
linktype, choicestring);
yyerror(NULL);
return;
yyerror(NULL);
return;
}
pdbRecordType = (dbRecordType *)pgphentry->userPvt;
pgphentry = gphFind(pdbbase->pgpHash,choicestring,&pdbRecordType->devList);
if(pgphentry) {
return;
return;
}
pdevSup = dbCalloc(1,sizeof(devSup));
pdevSup->name = epicsStrDup(dsetname);
@@ -806,17 +810,17 @@ static void dbDevice(char *recordtype,char *linktype,
pdevSup->link_type = link_type;
pgphentry = gphAdd(pdbbase->pgpHash,pdevSup->choice,&pdbRecordType->devList);
if(!pgphentry) {
yyerrorAbort("gphAdd failed");
yyerrorAbort("gphAdd failed");
} else {
pgphentry->userPvt = pdevSup;
pgphentry->userPvt = pdevSup;
}
ellAdd(&pdbRecordType->devList,&pdevSup->node);
}
static void dbDriver(char *name)
{
drvSup *pdrvSup;
GPHENTRY *pgphentry;
drvSup *pdrvSup;
GPHENTRY *pgphentry;
if (!*name) {
yyerrorAbort("dbDriver: Driver name can't be empty");
@@ -824,13 +828,13 @@ static void dbDriver(char *name)
}
pgphentry = gphFind(pdbbase->pgpHash,name,&pdbbase->drvList);
if(pgphentry) {
return;
return;
}
pdrvSup = dbCalloc(1,sizeof(drvSup));
pdrvSup->name = epicsStrDup(name);
pgphentry = gphAdd(pdbbase->pgpHash,pdrvSup->name,&pdbbase->drvList);
if(!pgphentry) {
yyerrorAbort("gphAdd failed");
yyerrorAbort("gphAdd failed");
}
pgphentry->userPvt = pdrvSup;
ellAdd(&pdbbase->drvList,&pdrvSup->node);
@@ -843,14 +847,14 @@ static void dbLinkType(char *name, char *jlif_name)
pgphentry = gphFind(pdbbase->pgpHash, name, &pdbbase->linkList);
if (pgphentry) {
return;
return;
}
pLinkSup = dbCalloc(1,sizeof(linkSup));
pLinkSup->name = epicsStrDup(name);
pLinkSup->jlif_name = epicsStrDup(jlif_name);
pgphentry = gphAdd(pdbbase->pgpHash, pLinkSup->name, &pdbbase->linkList);
if (!pgphentry) {
yyerrorAbort("gphAdd failed");
yyerrorAbort("gphAdd failed");
}
pgphentry->userPvt = pLinkSup;
ellAdd(&pdbbase->linkList, &pLinkSup->node);
@@ -858,8 +862,8 @@ static void dbLinkType(char *name, char *jlif_name)
static void dbRegistrar(char *name)
{
dbText *ptext;
GPHENTRY *pgphentry;
dbText *ptext;
GPHENTRY *pgphentry;
if (!*name) {
yyerrorAbort("dbRegistrar: Registrar name can't be empty");
@@ -867,13 +871,13 @@ static void dbRegistrar(char *name)
}
pgphentry = gphFind(pdbbase->pgpHash,name,&pdbbase->registrarList);
if(pgphentry) {
return;
return;
}
ptext = dbCalloc(1,sizeof(dbText));
ptext->text = epicsStrDup(name);
pgphentry = gphAdd(pdbbase->pgpHash,ptext->text,&pdbbase->registrarList);
if(!pgphentry) {
yyerrorAbort("gphAdd failed");
yyerrorAbort("gphAdd failed");
}
pgphentry->userPvt = ptext;
ellAdd(&pdbbase->registrarList,&ptext->node);
@@ -904,8 +908,8 @@ static void dbFunction(char *name)
static void dbVariable(char *name, char *type)
{
dbVariableDef *pvar;
GPHENTRY *pgphentry;
dbVariableDef *pvar;
GPHENTRY *pgphentry;
if (!*name) {
yyerrorAbort("dbVariable: Variable name can't be empty");
@@ -913,14 +917,14 @@ static void dbVariable(char *name, char *type)
}
pgphentry = gphFind(pdbbase->pgpHash,name,&pdbbase->variableList);
if(pgphentry) {
return;
return;
}
pvar = dbCalloc(1,sizeof(dbVariableDef));
pvar->name = epicsStrDup(name);
pvar->type = epicsStrDup(type);
pgphentry = gphAdd(pdbbase->pgpHash,pvar->name,&pdbbase->variableList);
if(!pgphentry) {
yyerrorAbort("gphAdd failed");
yyerrorAbort("gphAdd failed");
}
pgphentry->userPvt = pvar;
ellAdd(&pdbbase->variableList,&pvar->node);
@@ -928,8 +932,8 @@ static void dbVariable(char *name, char *type)
static void dbBreakHead(char *name)
{
brkTable *pbrkTable;
GPHENTRY *pgphentry;
brkTable *pbrkTable;
GPHENTRY *pgphentry;
if (!*name) {
yyerrorAbort("dbBreakHead: Breaktable name can't be empty");
@@ -937,8 +941,8 @@ static void dbBreakHead(char *name)
}
pgphentry = gphFind(pdbbase->pgpHash,name,&pdbbase->bptList);
if(pgphentry) {
duplicate = TRUE;
return;
duplicate = TRUE;
return;
}
pbrkTable = dbCalloc(1,sizeof(brkTable));
pbrkTable->name = epicsStrDup(name);
@@ -951,82 +955,82 @@ static void dbBreakItem(char *value)
double dummy;
if (duplicate) return;
if (epicsScanDouble(value, &dummy) != 1) {
yyerrorAbort("Non-numeric value in breaktable");
yyerrorAbort("Non-numeric value in breaktable");
}
allocTemp(epicsStrDup(value));
}
static void dbBreakBody(void)
{
brkTable *pnewbrkTable;
brkInt *paBrkInt;
brkTable *pbrkTable;
int number, down=0;
int i;
GPHENTRY *pgphentry;
brkTable *pnewbrkTable;
brkInt *paBrkInt;
brkTable *pbrkTable;
int number, down=0;
int i;
GPHENTRY *pgphentry;
if (duplicate) {
duplicate = FALSE;
return;
duplicate = FALSE;
return;
}
pnewbrkTable = (brkTable *)popFirstTemp();
number = ellCount(&tempList);
if (number % 2) {
yyerrorAbort("breaktable: Raw value missing");
return;
yyerrorAbort("breaktable: Raw value missing");
return;
}
number /= 2;
if (number < 2) {
yyerrorAbort("breaktable: Must have at least two points!");
return;
yyerrorAbort("breaktable: Must have at least two points!");
return;
}
pnewbrkTable->number = number;
pnewbrkTable->paBrkInt = paBrkInt = dbCalloc(number, sizeof(brkInt));
for (i=0; i<number; i++) {
char *str;
char *str;
str = (char *)popFirstTemp();
(void) epicsScanDouble(str, &paBrkInt[i].raw);
free(str);
str = (char *)popFirstTemp();
(void) epicsScanDouble(str, &paBrkInt[i].raw);
free(str);
str = (char *)popFirstTemp();
(void) epicsScanDouble(str, &paBrkInt[i].eng);
free(str);
str = (char *)popFirstTemp();
(void) epicsScanDouble(str, &paBrkInt[i].eng);
free(str);
}
/* Compute slopes */
for (i=0; i<number-1; i++) {
double slope =
(paBrkInt[i+1].eng - paBrkInt[i].eng)/
(paBrkInt[i+1].raw - paBrkInt[i].raw);
if (!dbBptNotMonotonic && slope == 0) {
yyerrorAbort("breaktable slope is zero");
return;
}
if (i == 0) {
down = (slope < 0);
} else if (!dbBptNotMonotonic && down != (slope < 0)) {
yyerrorAbort("breaktable slope changes sign");
return;
}
paBrkInt[i].slope = slope;
double slope =
(paBrkInt[i+1].eng - paBrkInt[i].eng)/
(paBrkInt[i+1].raw - paBrkInt[i].raw);
if (!dbBptNotMonotonic && slope == 0) {
yyerrorAbort("breaktable slope is zero");
return;
}
if (i == 0) {
down = (slope < 0);
} else if (!dbBptNotMonotonic && down != (slope < 0)) {
yyerrorAbort("breaktable slope changes sign");
return;
}
paBrkInt[i].slope = slope;
}
/* Continue with last slope beyond the final point */
paBrkInt[number-1].slope = paBrkInt[number-2].slope;
/* Add brkTable in sorted order */
pbrkTable = (brkTable *)ellFirst(&pdbbase->bptList);
while (pbrkTable) {
if (strcmp(pbrkTable->name, pnewbrkTable->name) > 0) {
ellInsert(&pdbbase->bptList, ellPrevious((ELLNODE *)pbrkTable),
(ELLNODE *)pnewbrkTable);
break;
}
pbrkTable = (brkTable *)ellNext(&pbrkTable->node);
if (strcmp(pbrkTable->name, pnewbrkTable->name) > 0) {
ellInsert(&pdbbase->bptList, ellPrevious((ELLNODE *)pbrkTable),
(ELLNODE *)pnewbrkTable);
break;
}
pbrkTable = (brkTable *)ellNext(&pbrkTable->node);
}
if (!pbrkTable) ellAdd(&pdbbase->bptList, &pnewbrkTable->node);
pgphentry = gphAdd(pdbbase->pgpHash,pnewbrkTable->name,&pdbbase->bptList);
if (!pgphentry) {
yyerrorAbort("dbBreakBody: gphAdd failed");
return;
yyerrorAbort("dbBreakBody: gphAdd failed");
return;
}
pgphentry->userPvt = pnewbrkTable;
}

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbPvdLib.c */
@@ -84,7 +84,7 @@ PVDENTRY *dbPvdFind(dbBase *pdbbase, const char *name, size_t lenName)
dbPvd *ppvd = pdbbase->ppvd;
dbPvdBucket *pbucket;
PVDENTRY *ppvdNode;
pbucket = ppvd->buckets[epicsMemHash(name, lenName, 0) & ppvd->mask];
if (pbucket == NULL) return NULL;

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include "iocsh.h"
@@ -22,7 +22,8 @@ static const iocshArg argRecType = { "recordTypeName", iocshArgString};
/* dbDumpPath */
static const iocshArg * const dbDumpPathArgs[] = {&argPdbbase};
static const iocshFuncDef dbDumpPathFuncDef = {"dbDumpPath",1,dbDumpPathArgs};
static const iocshFuncDef dbDumpPathFuncDef = {"dbDumpPath",1,dbDumpPathArgs,
"Dump .db/.dbd file search path.\n"};
static void dbDumpPathCallFunc(const iocshArgBuf *args)
{
dbDumpPath(*iocshPpdbbase);

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef INC_dbStaticIocRegister_H

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author: Marty Kraimer
@@ -110,6 +110,7 @@ epicsShareFunc long dbFirstField(DBENTRY *pdbentry, int dctonly);
epicsShareFunc long dbNextField(DBENTRY *pdbentry, int dctonly);
epicsShareFunc int dbGetNFields(DBENTRY *pdbentry, int dctonly);
epicsShareFunc char * dbGetFieldName(DBENTRY *pdbentry);
epicsShareFunc int dbGetFieldDbfType(DBENTRY *pdbentry);
epicsShareFunc char * dbGetDefault(DBENTRY *pdbentry);
epicsShareFunc char * dbGetPrompt(DBENTRY *pdbentry);
epicsShareFunc int dbGetPromptGroup(DBENTRY *pdbentry);

View File

@@ -9,7 +9,7 @@
\*************************************************************************/
/* dbStaticPvt.h */
/*
* Author: Marty Kraimer
* Author: Marty Kraimer
* Date: 06Jun95
*/
@@ -79,8 +79,8 @@ epicsShareFunc void dbFreeLinkInfo(dbLinkInfo *pinfo);
/* The following is for path */
typedef struct dbPathNode {
ELLNODE node;
char *directory;
ELLNODE node;
char *directory;
} dbPathNode;
/* Element of the global gui group list */
@@ -93,13 +93,13 @@ typedef struct dbGuiGroup {
/*The following are in dbPvdLib.c*/
/*directory*/
typedef struct{
ELLNODE node;
dbRecordType *precordType;
dbRecordNode *precnode;
ELLNODE node;
dbRecordType *precordType;
dbRecordNode *precnode;
}PVDENTRY;
epicsShareFunc int dbPvdTableSize(int size);
extern int dbStaticDebug;
void dbPvdInitPvt(DBBASE *pdbbase);
void dbPvdInitPvt(DBBASE *pdbbase);
PVDENTRY *dbPvdFind(DBBASE *pdbbase,const char *name,size_t lenname);
PVDENTRY *dbPvdAdd(DBBASE *pdbbase,dbRecordType *precordType,dbRecordNode *precnode);
void dbPvdDelete(DBBASE *pdbbase,dbRecordNode *precnode);

View File

@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*dbStaticLibRun.c*/
@@ -31,7 +31,7 @@
#include "devSup.h"
#include "special.h"
epicsShareDef int dbConvertStrict = 0;
int dbConvertStrict = 0;
epicsExportAddress(int, dbConvertStrict);
static long do_nothing(struct dbCommon *precord) { return 0; }
@@ -68,14 +68,14 @@ void devExtend(dsxt *pdsxt)
long dbAllocRecord(DBENTRY *pdbentry,const char *precordName)
{
dbRecordType *pdbRecordType = pdbentry->precordType;
dbRecordNode *precnode = pdbentry->precnode;
dbFldDes *pflddes;
int i;
dbCommonPvt *ppvt;
dbCommon *precord;
char *pfield;
dbRecordType *pdbRecordType = pdbentry->precordType;
dbRecordNode *precnode = pdbentry->precnode;
dbFldDes *pflddes;
int i;
dbCommonPvt *ppvt;
dbCommon *precord;
char *pfield;
if(!pdbRecordType) return(S_dbLib_recordTypeNotFound);
if(!precnode) return(S_dbLib_recNotFound);
if(pdbRecordType->rec_size == 0) {
@@ -131,8 +131,8 @@ long dbAllocRecord(DBENTRY *pdbentry,const char *precordName)
case DBF_USHORT:
case DBF_LONG:
case DBF_ULONG:
case DBF_INT64:
case DBF_UINT64:
case DBF_INT64:
case DBF_UINT64:
case DBF_FLOAT:
case DBF_DOUBLE:
case DBF_ENUM:
@@ -188,7 +188,7 @@ long dbGetFieldAddress(DBENTRY *pdbentry)
{
dbRecordType *pdbRecordType = pdbentry->precordType;
dbRecordNode *precnode = pdbentry->precnode;
dbFldDes *pflddes = pdbentry->pflddes;
dbFldDes *pflddes = pdbentry->pflddes;
if(!pdbRecordType) return(S_dbLib_recordTypeNotFound);
if(!precnode) return(S_dbLib_recNotFound);
@@ -202,8 +202,8 @@ char *dbRecordName(DBENTRY *pdbentry)
{
dbRecordType *pdbRecordType = pdbentry->precordType;
dbRecordNode *precnode = pdbentry->precnode;
dbFldDes *pflddes;
char *precord;
dbFldDes *pflddes;
char *precord;
if(!pdbRecordType) return(0);
if(!precnode) return(0);

View File

@@ -19,7 +19,7 @@ static int yyAbort = 0;
%union
{
char *Str;
char *Str;
}
%token tokenINCLUDE tokenPATH tokenADDPATH
@@ -36,318 +36,318 @@ static int yyAbort = 0;
%%
database: /* empty */
| database_item_list
;
database: /* empty */
| database_item_list
;
database_item_list: database_item_list database_item
| database_item
;
database_item_list: database_item_list database_item
| database_item
;
database_item: include
| path
| addpath
| tokenMENU menu_head menu_body
| tokenRECORDTYPE recordtype_head recordtype_body
| device
| driver
| link
| registrar
| function
| variable
| tokenBREAKTABLE break_head break_body
| tokenRECORD record_head record_body
| tokenGRECORD grecord_head record_body
| alias
;
database_item: include
| path
| addpath
| tokenMENU menu_head menu_body
| tokenRECORDTYPE recordtype_head recordtype_body
| device
| driver
| link
| registrar
| function
| variable
| tokenBREAKTABLE break_head break_body
| tokenRECORD record_head record_body
| tokenGRECORD grecord_head record_body
| alias
;
include: tokenINCLUDE tokenSTRING
include: tokenINCLUDE tokenSTRING
{
if(dbStaticDebug>2) printf("include : %s\n",$2);
dbIncludeNew($2); dbmfFree($2);
if(dbStaticDebug>2) printf("include : %s\n",$2);
dbIncludeNew($2); dbmfFree($2);
};
path: tokenPATH tokenSTRING
path: tokenPATH tokenSTRING
{
if(dbStaticDebug>2) printf("path : %s\n",$2);
dbPathCmd($2); dbmfFree($2);
if(dbStaticDebug>2) printf("path : %s\n",$2);
dbPathCmd($2); dbmfFree($2);
};
addpath: tokenADDPATH tokenSTRING
addpath: tokenADDPATH tokenSTRING
{
if(dbStaticDebug>2) printf("addpath : %s\n",$2);
dbAddPathCmd($2); dbmfFree($2);
if(dbStaticDebug>2) printf("addpath : %s\n",$2);
dbAddPathCmd($2); dbmfFree($2);
};
menu_head: '(' tokenSTRING ')'
menu_head: '(' tokenSTRING ')'
{
if(dbStaticDebug>2) printf("menu_head %s\n",$2);
dbMenuHead($2); dbmfFree($2);
if(dbStaticDebug>2) printf("menu_head %s\n",$2);
dbMenuHead($2); dbmfFree($2);
};
menu_body: '{' choice_list '}'
menu_body: '{' choice_list '}'
{
if(dbStaticDebug>2) printf("menu_body\n");
dbMenuBody();
if(dbStaticDebug>2) printf("menu_body\n");
dbMenuBody();
};
choice_list: choice_list choice | choice;
choice_list: choice_list choice | choice;
choice: tokenCHOICE '(' tokenSTRING ',' tokenSTRING ')'
choice: tokenCHOICE '(' tokenSTRING ',' tokenSTRING ')'
{
if(dbStaticDebug>2) printf("choice %s %s\n",$3,$5);
dbMenuChoice($3,$5); dbmfFree($3); dbmfFree($5);
if(dbStaticDebug>2) printf("choice %s %s\n",$3,$5);
dbMenuChoice($3,$5); dbmfFree($3); dbmfFree($5);
}
| include;
| include;
recordtype_head: '(' tokenSTRING ')'
{
if(dbStaticDebug>2) printf("recordtype_head %s\n",$2);
dbRecordtypeHead($2); dbmfFree($2);
if(dbStaticDebug>2) printf("recordtype_head %s\n",$2);
dbRecordtypeHead($2); dbmfFree($2);
};
recordtype_body: '{' '}'
{
if(dbStaticDebug>2) printf("empty recordtype_body\n");
dbRecordtypeEmpty();
if(dbStaticDebug>2) printf("empty recordtype_body\n");
dbRecordtypeEmpty();
}
| '{' recordtype_field_list '}'
| '{' recordtype_field_list '}'
{
if(dbStaticDebug>2) printf("recordtype_body\n");
dbRecordtypeBody();
if(dbStaticDebug>2) printf("recordtype_body\n");
dbRecordtypeBody();
};
recordtype_field_list: recordtype_field_list recordtype_field
| recordtype_field;
recordtype_field_list: recordtype_field_list recordtype_field
| recordtype_field;
recordtype_field: tokenFIELD recordtype_field_head recordtype_field_body
| tokenCDEFS
| tokenCDEFS
{
if(dbStaticDebug>2) printf("recordtype_cdef %s", $1);
dbRecordtypeCdef($1); dbmfFree($1);
if(dbStaticDebug>2) printf("recordtype_cdef %s", $1);
dbRecordtypeCdef($1); dbmfFree($1);
}
| include ;
| include ;
recordtype_field_head: '(' tokenSTRING ',' tokenSTRING ')'
recordtype_field_head: '(' tokenSTRING ',' tokenSTRING ')'
{
if(dbStaticDebug>2) printf("recordtype_field_head %s %s\n",$2,$4);
dbRecordtypeFieldHead($2,$4); dbmfFree($2); dbmfFree($4);
if(dbStaticDebug>2) printf("recordtype_field_head %s %s\n",$2,$4);
dbRecordtypeFieldHead($2,$4); dbmfFree($2); dbmfFree($4);
};
recordtype_field_body: '{' recordtype_field_item_list '}' ;
recordtype_field_body: '{' recordtype_field_item_list '}' ;
recordtype_field_item_list: recordtype_field_item_list recordtype_field_item
| recordtype_field_item;
| recordtype_field_item;
recordtype_field_item: tokenSTRING '(' tokenSTRING ')'
recordtype_field_item: tokenSTRING '(' tokenSTRING ')'
{
if(dbStaticDebug>2) printf("recordtype_field_item %s %s\n",$1,$3);
dbRecordtypeFieldItem($1,$3); dbmfFree($1); dbmfFree($3);
if(dbStaticDebug>2) printf("recordtype_field_item %s %s\n",$1,$3);
dbRecordtypeFieldItem($1,$3); dbmfFree($1); dbmfFree($3);
}
| tokenMENU '(' tokenSTRING ')'
| tokenMENU '(' tokenSTRING ')'
{
if(dbStaticDebug>2) printf("recordtype_field_item %s (%s)\n","menu",$3);
dbRecordtypeFieldItem("menu",$3); dbmfFree($3);
if(dbStaticDebug>2) printf("recordtype_field_item %s (%s)\n","menu",$3);
dbRecordtypeFieldItem("menu",$3); dbmfFree($3);
};
device: tokenDEVICE '('
tokenSTRING ',' tokenSTRING ',' tokenSTRING ',' tokenSTRING ')'
tokenSTRING ',' tokenSTRING ',' tokenSTRING ',' tokenSTRING ')'
{
if(dbStaticDebug>2) printf("device %s %s %s %s\n",$3,$5,$7,$9);
dbDevice($3,$5,$7,$9);
dbmfFree($3); dbmfFree($5);
dbmfFree($7); dbmfFree($9);
if(dbStaticDebug>2) printf("device %s %s %s %s\n",$3,$5,$7,$9);
dbDevice($3,$5,$7,$9);
dbmfFree($3); dbmfFree($5);
dbmfFree($7); dbmfFree($9);
};
driver: tokenDRIVER '(' tokenSTRING ')'
{
if(dbStaticDebug>2) printf("driver %s\n",$3);
dbDriver($3); dbmfFree($3);
if(dbStaticDebug>2) printf("driver %s\n",$3);
dbDriver($3); dbmfFree($3);
};
link: tokenLINK '(' tokenSTRING ',' tokenSTRING ')'
{
if(dbStaticDebug>2) printf("link %s %s\n",$3,$5);
dbLinkType($3,$5);
dbmfFree($3); dbmfFree($5);
if(dbStaticDebug>2) printf("link %s %s\n",$3,$5);
dbLinkType($3,$5);
dbmfFree($3); dbmfFree($5);
};
registrar: tokenREGISTRAR '(' tokenSTRING ')'
{
if(dbStaticDebug>2) printf("registrar %s\n",$3);
dbRegistrar($3); dbmfFree($3);
if(dbStaticDebug>2) printf("registrar %s\n",$3);
dbRegistrar($3); dbmfFree($3);
};
function: tokenFUNCTION '(' tokenSTRING ')'
{
if(dbStaticDebug>2) printf("function %s\n",$3);
dbFunction($3); dbmfFree($3);
if(dbStaticDebug>2) printf("function %s\n",$3);
dbFunction($3); dbmfFree($3);
};
variable: tokenVARIABLE '(' tokenSTRING ')'
{
if(dbStaticDebug>2) printf("variable %s\n",$3);
dbVariable($3,"int"); dbmfFree($3);
if(dbStaticDebug>2) printf("variable %s\n",$3);
dbVariable($3,"int"); dbmfFree($3);
}
| tokenVARIABLE '(' tokenSTRING ',' tokenSTRING ')'
{
if(dbStaticDebug>2) printf("variable %s, %s\n",$3,$5);
dbVariable($3,$5); dbmfFree($3); dbmfFree($5);
if(dbStaticDebug>2) printf("variable %s, %s\n",$3,$5);
dbVariable($3,$5); dbmfFree($3); dbmfFree($5);
};
break_head: '(' tokenSTRING ')'
{
if(dbStaticDebug>2) printf("break_head %s\n",$2);
dbBreakHead($2); dbmfFree($2);
if(dbStaticDebug>2) printf("break_head %s\n",$2);
dbBreakHead($2); dbmfFree($2);
};
break_body : '{' break_list '}'
{
if(dbStaticDebug>2) printf("break_body\n");
dbBreakBody();
if(dbStaticDebug>2) printf("break_body\n");
dbBreakBody();
};
break_list: break_list ',' break_item
| break_list break_item
| break_item;
| break_list break_item
| break_item;
break_item: tokenSTRING
{
if(dbStaticDebug>2) printf("break_item tokenSTRING %s\n",$1);
dbBreakItem($1); dbmfFree($1);
if(dbStaticDebug>2) printf("break_item tokenSTRING %s\n",$1);
dbBreakItem($1); dbmfFree($1);
};
grecord_head: '(' tokenSTRING ',' tokenSTRING ')'
{
if(dbStaticDebug>2) printf("grecord_head %s %s\n",$2,$4);
dbRecordHead($2,$4,1); dbmfFree($2); dbmfFree($4);
if(dbStaticDebug>2) printf("grecord_head %s %s\n",$2,$4);
dbRecordHead($2,$4,1); dbmfFree($2); dbmfFree($4);
};
record_head: '(' tokenSTRING ',' tokenSTRING ')'
{
if(dbStaticDebug>2) printf("record_head %s %s\n",$2,$4);
dbRecordHead($2,$4,0); dbmfFree($2); dbmfFree($4);
if(dbStaticDebug>2) printf("record_head %s %s\n",$2,$4);
dbRecordHead($2,$4,0); dbmfFree($2); dbmfFree($4);
};
record_body: /* empty */
{
if(dbStaticDebug>2) printf("null record_body\n");
dbRecordBody();
if(dbStaticDebug>2) printf("null record_body\n");
dbRecordBody();
}
| '{' '}'
| '{' '}'
{
if(dbStaticDebug>2) printf("empty record_body\n");
dbRecordBody();
if(dbStaticDebug>2) printf("empty record_body\n");
dbRecordBody();
}
| '{' record_field_list '}'
{
if(dbStaticDebug>2) printf("record_body\n");
dbRecordBody();
if(dbStaticDebug>2) printf("record_body\n");
dbRecordBody();
};
record_field_list: record_field_list record_field
| record_field;
record_field_list: record_field_list record_field
| record_field;
record_field: tokenFIELD '(' tokenSTRING ','
{ BEGIN JSON; } json_value { BEGIN INITIAL; } ')'
{ BEGIN JSON; } json_value { BEGIN INITIAL; } ')'
{
if(dbStaticDebug>2) printf("record_field %s %s\n",$3,$6);
dbRecordField($3,$6); dbmfFree($3); dbmfFree($6);
if(dbStaticDebug>2) printf("record_field %s %s\n",$3,$6);
dbRecordField($3,$6); dbmfFree($3); dbmfFree($6);
}
| tokenINFO '(' tokenSTRING ','
{ BEGIN JSON; } json_value { BEGIN INITIAL; } ')'
| tokenINFO '(' tokenSTRING ','
{ BEGIN JSON; } json_value { BEGIN INITIAL; } ')'
{
if(dbStaticDebug>2) printf("record_info %s %s\n",$3,$6);
dbRecordInfo($3,$6); dbmfFree($3); dbmfFree($6);
if(dbStaticDebug>2) printf("record_info %s %s\n",$3,$6);
dbRecordInfo($3,$6); dbmfFree($3); dbmfFree($6);
}
| tokenALIAS '(' tokenSTRING ')'
| tokenALIAS '(' tokenSTRING ')'
{
if(dbStaticDebug>2) printf("record_alias %s\n",$3);
dbRecordAlias($3); dbmfFree($3);
if(dbStaticDebug>2) printf("record_alias %s\n",$3);
dbRecordAlias($3); dbmfFree($3);
}
| include ;
| include ;
alias: tokenALIAS '(' tokenSTRING ',' tokenSTRING ')'
{
if(dbStaticDebug>2) printf("alias %s %s\n",$3,$5);
dbAlias($3,$5); dbmfFree($3); dbmfFree($5);
if(dbStaticDebug>2) printf("alias %s %s\n",$3,$5);
dbAlias($3,$5); dbmfFree($3); dbmfFree($5);
};
json_object: '{' '}'
{
$$ = dbmfStrdup("{}");
if (dbStaticDebug>2) printf("json %s\n", $$);
$$ = dbmfStrdup("{}");
if (dbStaticDebug>2) printf("json %s\n", $$);
}
| '{' json_members '}'
| '{' json_members '}'
{
$$ = dbmfStrcat3("{", $2, "}");
dbmfFree($2);
if (dbStaticDebug>2) printf("json %s\n", $$);
$$ = dbmfStrcat3("{", $2, "}");
dbmfFree($2);
if (dbStaticDebug>2) printf("json %s\n", $$);
};
json_members: json_pair
| json_pair ','
| json_pair ',' json_members
| json_pair ','
| json_pair ',' json_members
{
$$ = dbmfStrcat3($1, ",", $3);
dbmfFree($1); dbmfFree($3);
if (dbStaticDebug>2) printf("json %s\n", $$);
$$ = dbmfStrcat3($1, ",", $3);
dbmfFree($1); dbmfFree($3);
if (dbStaticDebug>2) printf("json %s\n", $$);
};
json_pair: json_string ':' json_value
{
$$ = dbmfStrcat3($1, ":", $3);
dbmfFree($1); dbmfFree($3);
if (dbStaticDebug>2) printf("json %s\n", $$);
$$ = dbmfStrcat3($1, ":", $3);
dbmfFree($1); dbmfFree($3);
if (dbStaticDebug>2) printf("json %s\n", $$);
};
json_string: jsonSTRING
| jsonBARE
| jsonBARE
{
$$ = dbmfStrcat3("\"", $1, "\"");
dbmfFree($1);
if (dbStaticDebug>2) printf("json %s\n", $$);
$$ = dbmfStrcat3("\"", $1, "\"");
dbmfFree($1);
if (dbStaticDebug>2) printf("json %s\n", $$);
};
json_array: '[' ']'
{
$$ = dbmfStrdup("[]");
if (dbStaticDebug>2) printf("json %s\n", $$);
$$ = dbmfStrdup("[]");
if (dbStaticDebug>2) printf("json %s\n", $$);
}
| '[' json_elements ']'
| '[' json_elements ']'
{
$$ = dbmfStrcat3("[", $2, "]");
dbmfFree($2);
if (dbStaticDebug>2) printf("json %s\n", $$);
$$ = dbmfStrcat3("[", $2, "]");
dbmfFree($2);
if (dbStaticDebug>2) printf("json %s\n", $$);
};
json_elements: json_value
| json_value ','
{ /* Retain the trailing ',' so link parser can distinguish a
* 1-element const list from a PV name (commas are illegal)
*/
$$ = dbmfStrcat3($1, ",", "");
dbmfFree($1);
if (dbStaticDebug>2) printf("json %s\n", $$);
| json_value ','
{ /* Retain the trailing ',' so link parser can distinguish a
* 1-element const list from a PV name (commas are illegal)
*/
$$ = dbmfStrcat3($1, ",", "");
dbmfFree($1);
if (dbStaticDebug>2) printf("json %s\n", $$);
};
| json_value ',' json_elements
| json_value ',' json_elements
{
$$ = dbmfStrcat3($1, ",", $3);
dbmfFree($1); dbmfFree($3);
if (dbStaticDebug>2) printf("json %s\n", $$);
$$ = dbmfStrcat3($1, ",", $3);
dbmfFree($1); dbmfFree($3);
if (dbStaticDebug>2) printf("json %s\n", $$);
};
json_value: jsonNULL { $$ = dbmfStrdup("null"); }
| jsonTRUE { $$ = dbmfStrdup("true"); }
| jsonFALSE { $$ = dbmfStrdup("false"); }
| jsonNUMBER
| json_string
| json_array
| json_object ;
json_value: jsonNULL { $$ = dbmfStrdup("null"); }
| jsonTRUE { $$ = dbmfStrdup("true"); }
| jsonFALSE { $$ = dbmfStrdup("false"); }
| jsonNUMBER
| json_string
| json_array
| json_object ;
%%
@@ -370,14 +370,14 @@ static int yyerror(char *str)
}
static long pvt_yy_parse(void)
{
static int FirstFlag = 1;
long rtnval;
static int FirstFlag = 1;
long rtnval;
if (!FirstFlag) {
yyAbort = FALSE;
yyFailed = FALSE;
yyreset();
yyrestart(NULL);
yyAbort = FALSE;
yyFailed = FALSE;
yyreset();
yyrestart(NULL);
}
FirstFlag = 0;
rtnval = yyparse();

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/** @file devSup.h
*
@@ -34,7 +34,7 @@ struct link; /* aka DBLINK */
*
* In Makefile:
@code
USR_CFLAGS += -DUSE_TYPED_RSET -DUSE_TYPED_DSET
USR_CPPFLAGS += -DUSE_TYPED_RSET -DUSE_TYPED_DSET
@endcode
*
* In C source file:
@@ -48,10 +48,7 @@ struct link; /* aka DBLINK */
static long get_iointr_info(int detach, dbCommon *prec, IOCSCANPVT* pscan);
static long longin_read(longinRecord *prec);
const struct {
dset common;
long (*read)(longinRecord *prec);
} devLiDevName = {
longindset devLiDevName = {
{
5, // 4 from dset + 1 from longinRecord
NULL,
@@ -133,19 +130,19 @@ typedef struct dsxt {
#ifdef __cplusplus
extern "C" {
typedef long (*DEVSUPFUN)(void *); /* ptr to device support function*/
typedef long (*DEVSUPFUN)(void *); /* ptr to device support function*/
#else
typedef long (*DEVSUPFUN)(); /* ptr to device support function*/
typedef long (*DEVSUPFUN)(); /* ptr to device support function*/
#endif
#ifndef USE_TYPED_DSET
typedef struct dset { /* device support entry table */
long number; /*number of support routines*/
DEVSUPFUN report; /*print report*/
DEVSUPFUN init; /*init support layer*/
DEVSUPFUN init_record; /*init device for particular record*/
DEVSUPFUN get_ioint_info; /* get io interrupt information*/
long number; /*number of support routines*/
DEVSUPFUN report; /*print report*/
DEVSUPFUN init; /*init support layer*/
DEVSUPFUN init_record; /*init device for particular record*/
DEVSUPFUN get_ioint_info; /* get io interrupt information*/
/*other functions are record dependent*/
} dset;

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/** @file drvSup.h
*
@@ -40,7 +40,7 @@ typedef typed_drvet drvet;
/* These interfaces may eventually get deprecated */
typedef long (*DRVSUPFUN) (); /* ptr to driver support function */
typedef long (*DRVSUPFUN) (); /* ptr to driver support function */
typedef struct drvet { /* driver entry table */
long number; /* number of support routines */

View File

@@ -5,12 +5,12 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
these are used in the pmt (prompt) field of the record support
ascii files. They represent field groupings for dct tools
these are used in the pmt (prompt) field of the record support
ascii files. They represent field groupings for dct tools
*/
#ifndef __gui_group_h__

View File

@@ -24,22 +24,22 @@ extern "C" {
#endif
/* link types */
#define CONSTANT 0
#define PV_LINK 1
#define VME_IO 2
#define CAMAC_IO 3
#define AB_IO 4
#define GPIB_IO 5
#define BITBUS_IO 6
#define MACRO_LINK 7
#define CONSTANT 0
#define PV_LINK 1
#define VME_IO 2
#define CAMAC_IO 3
#define AB_IO 4
#define GPIB_IO 5
#define BITBUS_IO 6
#define MACRO_LINK 7
#define JSON_LINK 8
#define PN_LINK 9
#define DB_LINK 10
#define CA_LINK 11
#define INST_IO 12 /* instrument */
#define BBGPIB_IO 13 /* bitbus -> gpib */
#define RF_IO 14
#define VXI_IO 15
#define PN_LINK 9
#define DB_LINK 10
#define CA_LINK 11
#define INST_IO 12 /* instrument */
#define BBGPIB_IO 13 /* bitbus -> gpib */
#define RF_IO 14
#define VXI_IO 15
#define LINK_NTYPES 16
typedef struct maplinkType {
char *strvalue;
@@ -48,25 +48,25 @@ typedef struct maplinkType {
epicsShareExtern maplinkType pamaplinkType[];
#define VXIDYNAMIC 0
#define VXISTATIC 1
#define VXIDYNAMIC 0
#define VXISTATIC 1
/* structure of a PV_LINK DB_LINK and a CA_LINK */
/*Options defined by pvlMask */
#define pvlOptMsMode 0x3 /*Maximize Severity mode selection*/
#define pvlOptNMS 0 /*Don't Maximize Severity*/
#define pvlOptMS 1 /*Maximize Severity always*/
#define pvlOptMSI 2 /*Maximize Severity if INVALID*/
#define pvlOptMSS 3 /*Maximize Severity and copy Status*/
#define pvlOptPP 0x4 /*Process Passive*/
#define pvlOptCA 0x8 /*Always make it a CA link*/
#define pvlOptCP 0x10 /*CA + process on monitor*/
#define pvlOptCPP 0x20 /*CA + process passive record on monitor*/
#define pvlOptFWD 0x40 /*Generate ca_put for forward link*/
#define pvlOptInpNative 0x80 /*Input native*/
#define pvlOptInpString 0x100 /*Input as string*/
#define pvlOptOutNative 0x200 /*Output native*/
#define pvlOptOutString 0x400 /*Output as string*/
/* structure of a PV_LINK DB_LINK and a CA_LINK */
/*Options defined by pvlMask */
#define pvlOptMsMode 0x3 /*Maximize Severity mode selection*/
#define pvlOptNMS 0 /*Don't Maximize Severity*/
#define pvlOptMS 1 /*Maximize Severity always*/
#define pvlOptMSI 2 /*Maximize Severity if INVALID*/
#define pvlOptMSS 3 /*Maximize Severity and copy Status*/
#define pvlOptPP 0x4 /*Process Passive*/
#define pvlOptCA 0x8 /*Always make it a CA link*/
#define pvlOptCP 0x10 /*CA + process on monitor*/
#define pvlOptCPP 0x20 /*CA + process passive record on monitor*/
#define pvlOptFWD 0x40 /*Generate ca_put for forward link*/
#define pvlOptInpNative 0x80 /*Input native*/
#define pvlOptInpString 0x100 /*Input as string*/
#define pvlOptOutNative 0x200 /*Output native*/
#define pvlOptOutString 0x400 /*Output as string*/
/* DBLINK Flag bits */
#define DBLINK_FLAG_INITIALIZED 1 /* dbInitLink() called */
@@ -80,12 +80,12 @@ struct dbCommon;
typedef long (*LINKCVT)();
struct pv_link {
ELLNODE backlinknode;
char *pvname; /* pvname link points to */
void *pvt; /* CA or DB private */
LINKCVT getCvt; /* input conversion function */
short pvlMask; /* Options mask */
short lastGetdbrType; /* last dbrType for DB or CA get */
ELLNODE backlinknode;
char *pvname; /* pvname link points to */
void *pvt; /* CA or DB private */
LINKCVT getCvt; /* input conversion function */
short pvlMask; /* Options mask */
short lastGetdbrType; /* last dbrType for DB or CA get */
};
struct jlink;
@@ -96,63 +96,63 @@ struct json_link {
/* structure of a VME io channel */
struct vmeio {
short card;
short signal;
char *parm;
short card;
short signal;
char *parm;
};
/* structure of a CAMAC io channel */
struct camacio {
short b;
short c;
short n;
short a;
short f;
char *parm;
short b;
short c;
short n;
short a;
short f;
char *parm;
};
/* structure of a RF io channel */
struct rfio {
short branch;
short cryo;
short micro;
short dataset;
short element;
long ext;
short branch;
short cryo;
short micro;
short dataset;
short element;
long ext;
};
/* structure of a Allen-Bradley io channel */
struct abio {
short link;
short adapter;
short card;
short signal;
char *parm;
short link;
short adapter;
short card;
short signal;
char *parm;
};
/* structure of a gpib io channel */
struct gpibio {
short link;
short addr; /* device address */
char *parm;
short link;
short addr; /* device address */
char *parm;
};
/* structure of a bitbus io channel */
struct bitbusio {
unsigned char link;
unsigned char node;
unsigned char port;
unsigned char signal;
char *parm;
unsigned char link;
unsigned char node;
unsigned char port;
unsigned char signal;
char *parm;
};
/* structure of a bitbus to gpib io channel */
struct bbgpibio {
unsigned char link;
unsigned char bbaddr;
unsigned char gpibaddr;
unsigned char pad;
char *parm;
unsigned char link;
unsigned char bbaddr;
unsigned char gpibaddr;
unsigned char pad;
char *parm;
};
/* structure of an instrument io link */
@@ -162,35 +162,35 @@ struct instio {
/* structure of a vxi link */
struct vxiio {
short flag; /* 0 = frame/slot, 1 = SA */
short frame;
short slot;
short la; /* logical address if flag =1 */
short signal;
char *parm;
short flag; /* 0 = frame/slot, 1 = SA */
short frame;
short slot;
short la; /* logical address if flag =1 */
short signal;
char *parm;
};
/* union of possible address structures */
union value {
char *constantStr; /*constant string*/
struct macro_link macro_link; /* link containing macro substitution*/
char *constantStr; /*constant string*/
struct macro_link macro_link; /* link containing macro substitution*/
struct json_link json; /* JSON-encoded link */
struct pv_link pv_link; /* link to process variable*/
struct vmeio vmeio; /* vme io point */
struct camacio camacio; /* camac io point */
struct rfio rfio; /* CEBAF RF buffer interface */
struct abio abio; /* allen-bradley io point */
struct gpibio gpibio;
struct bitbusio bitbusio;
struct instio instio; /* instrument io link */
struct bbgpibio bbgpibio; /* bitbus to gpib io link */
struct vxiio vxiio; /* vxi io */
struct pv_link pv_link; /* link to process variable*/
struct vmeio vmeio; /* vme io point */
struct camacio camacio; /* camac io point */
struct rfio rfio; /* CEBAF RF buffer interface */
struct abio abio; /* allen-bradley io point */
struct gpibio gpibio;
struct bitbusio bitbusio;
struct instio instio; /* instrument io link */
struct bbgpibio bbgpibio; /* bitbus to gpib io link */
struct vxiio vxiio; /* vxi io */
};
struct lset;
struct link {
struct dbCommon *precord; /* Pointer to record owning link */
struct dbCommon *precord; /* Pointer to record owning link */
short type;
short flags;
struct lset *lset;

View File

@@ -4,10 +4,10 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* recSup.h
* Record Support
* Record Support
* Author: Marty Kraimer
* Date: 6-1-90
*/
@@ -64,22 +64,22 @@ typedef struct typed_rset rset;
typedef long (*RECSUPFUN) () EPICS_DEPRECATED; /* ptr to record support function*/
struct rset { /* record support entry table */
long number; /*number of support routines */
long (*report)(); /*print report */
long (*init)(); /*init support */
long (*init_record)(); /*init record */
long (*process)(); /*process record */
long (*special)(); /*special processing */
long (*get_value)(); /*no longer used */
long (*cvt_dbaddr)(); /*cvt dbAddr */
struct rset { /* record support entry table */
long number; /*number of support routines*/
long (*report)(); /*print report */
long (*init)(); /*init support */
long (*init_record)(); /*init record */
long (*process)(); /*process record */
long (*special)(); /*special processing */
long (*get_value)(); /*no longer used */
long (*cvt_dbaddr)(); /*cvt dbAddr */
long (*get_array_info)();
long (*put_array_info)();
long (*get_units)();
long (*get_precision)();
long (*get_enum_str)(); /*get string from enum item*/
long (*get_enum_strs)();/*get all enum strings */
long (*put_enum_str)(); /*put string from enum item*/
long (*get_enum_str)(); /*get string from enum item */
long (*get_enum_strs)();/*get all enum strings */
long (*put_enum_str)(); /*put string from enum item */
long (*get_graphic_double)();
long (*get_control_double)();
long (*get_alarm_double)();

View File

@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* special.h */
@@ -23,41 +23,41 @@ extern "C" {
/*NOTE Do NOT add aditional definitions with out modifying dbLexRoutines.c */
/* types 1-99 are global. Record specific must start with 100 */
#define SPC_NOMOD 1 /*Field must not be modified */
#define SPC_DBADDR 2 /*db_name_to_addr must call cvt_dbaddr */
#define SPC_SCAN 3 /*A scan related field is being changed */
#define SPC_ALARMACK 5 /*Special Alarm Acknowledgement*/
#define SPC_AS 6 /* Access Security*/
#define SPC_ATTRIBUTE 7 /* psuedo field, i.e. attribute field*/
#define SPC_NOMOD 1 /*Field must not be modified*/
#define SPC_DBADDR 2 /*db_name_to_addr must call cvt_dbaddr*/
#define SPC_SCAN 3 /*A scan related field is being changed*/
#define SPC_ALARMACK 5 /*Special Alarm Acknowledgement*/
#define SPC_AS 6 /* Access Security*/
#define SPC_ATTRIBUTE 7 /* psuedo field, i.e. attribute field*/
/* useful when record support must be notified of a field changing value*/
#define SPC_MOD 100
/* used by all records that support a reset field */
#define SPC_RESET 101 /*The res field is being modified*/
#define SPC_MOD 100
/* used by all records that support a reset field*/
#define SPC_RESET 101 /*The res field is being modified*/
/* Specific to conversion (Currently only ai */
#define SPC_LINCONV 102 /*A linear conversion field is being changed*/
#define SPC_LINCONV 102 /*A linear conversion field is being changed*/
/* Specific to calculation records */
#define SPC_CALC 103 /*The CALC field is being changed*/
#define SPC_CALC 103 /*The CALC field is being changed*/
#define SPC_NTYPES 9
typedef struct mapspcType{
char *strvalue;
int value;
char *strvalue;
int value;
}mapspcType;
#ifndef SPECIAL_GBLSOURCE
extern mapspcType pamapspcType[];
#else
mapspcType pamapspcType[SPC_NTYPES] = {
{"SPC_NOMOD",SPC_NOMOD},
{"SPC_DBADDR",SPC_DBADDR},
{"SPC_SCAN",SPC_SCAN},
{"SPC_ALARMACK",SPC_ALARMACK},
{"SPC_AS",SPC_AS},
{"SPC_MOD",SPC_MOD},
{"SPC_RESET",SPC_RESET},
{"SPC_LINCONV",SPC_LINCONV},
{"SPC_CALC",SPC_CALC}
{"SPC_NOMOD",SPC_NOMOD},
{"SPC_DBADDR",SPC_DBADDR},
{"SPC_SCAN",SPC_SCAN},
{"SPC_ALARMACK",SPC_ALARMACK},
{"SPC_AS",SPC_AS},
{"SPC_MOD",SPC_MOD},
{"SPC_RESET",SPC_RESET},
{"SPC_LINCONV",SPC_LINCONV},
{"SPC_CALC",SPC_CALC}
};
#endif /*SPECIAL_GBLSOURCE*/

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbLoadTemplate.h */

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2006 UChicago, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include <stdio.h>
@@ -307,9 +307,9 @@ variable_definition: WORD EQUALS WORD
;
%%
#include "dbLoadTemplate_lex.c"
static int yyerror(char* str)
{
if (str)

View File

@@ -2,7 +2,7 @@
* Copyright (c) 2006 UChicago, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
newline "\n"

View File

@@ -2,7 +2,7 @@
* Copyright (c) 2007 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include "iocsh.h"

View File

@@ -2,7 +2,7 @@
* Copyright (c) 2007 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef INC_dbtoolsIocRegister_H

View File

@@ -2,7 +2,7 @@
* Copyright (c) 2009 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include "epicsFindSymbol.h"

View File

@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* epicsRelease.h */

View File

@@ -70,9 +70,7 @@
#include "registryJLinks.h"
#include "registryRecordType.h"
static enum {
iocVirgin, iocBuilding, iocBuilt, iocRunning, iocPaused, iocStopped
} iocState = iocVirgin;
static enum iocStateEnum iocState = iocVoid;
static enum {
buildServers, buildIsolated
} iocBuildMode;
@@ -99,6 +97,11 @@ static void iterateRecords(recIterFunc func, void *user);
int dbThreadRealtimeLock = 1;
epicsExportAddress(int, dbThreadRealtimeLock);
enum iocStateEnum getIocState(void)
{
return iocState;
}
/*
* Initialize EPICS on the IOC.
*/
@@ -109,7 +112,7 @@ int iocInit(void)
static int iocBuild_1(void)
{
if (iocState != iocVirgin && iocState != iocStopped) {
if (iocState != iocVoid) {
errlogPrintf("iocBuild: IOC can only be initialized from uninitialized or stopped state\n");
return -1;
}
@@ -505,7 +508,7 @@ static void doInitRecord0(dbRecordType *pdbRecordType, dbCommon *precord,
/* Initial UDF severity */
if (precord->udf && precord->stat == UDF_ALARM)
precord->sevr = precord->udfs;
precord->sevr = precord->udfs;
/* Init DSET NOTE that result may be NULL */
pdevSup = dbDTYPtoDevSup(pdbRecordType, precord->dtyp);
@@ -705,23 +708,29 @@ static void doFreeRecord(dbRecordType *pdbRecordType, dbCommon *precord,
int iocShutdown(void)
{
if (iocState == iocVirgin || iocState == iocStopped)
return 0;
if (iocState == iocVoid) return 0;
initHookAnnounce(initHookAtShutdown);
iterateRecords(doCloseLinks, NULL);
initHookAnnounce(initHookAfterCloseLinks);
if (iocBuildMode == buildIsolated) {
/* stop and "join" threads */
scanStop();
initHookAnnounce(initHookAfterStopScan);
callbackStop();
}
else
initHookAnnounce(initHookAfterStopCallback);
} else {
dbStopServers();
}
dbCaShutdown(); /* must be before dbFreeRecord and dbChannelExit */
initHookAnnounce(initHookAfterStopLinks);
if (iocBuildMode == buildIsolated) {
/* free resources */
initHookAnnounce(initHookBeforeFree);
scanCleanup();
callbackCleanup();
@@ -734,8 +743,10 @@ int iocShutdown(void)
iocshFree();
}
iocState = iocStopped;
iocState = iocVoid;
iocBuildMode = buildServers;
initHookAnnounce(initHookAfterShutdown);
return 0;
}

View File

@@ -4,19 +4,24 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* iocInit.h ioc initialization */
/* iocInit.h ioc initialization */
#ifndef INCiocInith
#define INCiocInith
#include "shareLib.h"
enum iocStateEnum {
iocVoid, iocBuilding, iocBuilt, iocRunning, iocPaused
};
#ifdef __cplusplus
extern "C" {
#endif
epicsShareFunc enum iocStateEnum getIocState(void);
epicsShareFunc int iocInit(void);
epicsShareFunc int iocBuild(void);
epicsShareFunc int iocBuildIsolated(void);

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* iocshRegisterCommon.h */
/* Author: Marty Kraimer Date: 27APR2000 */

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include <stdlib.h>

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef INC_miscIocRegister_H

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* registryCommon.c */

Some files were not shown because too many files have changed in this diff Show More