changes for creating DLLs
This commit is contained in:
@@ -4,17 +4,19 @@ include $(TOP)/configure/CONFIG
|
||||
# includes to install from this sub-project
|
||||
#
|
||||
INC += callback.h
|
||||
INC += dbLock.h
|
||||
INC += dbAccess.h
|
||||
INC += dbAddr.h
|
||||
INC += dbBkpt.h
|
||||
INC += dbConvert.h
|
||||
INC += dbEvent.h
|
||||
INC += dbLock.h
|
||||
INC += dbNotify.h
|
||||
INC += dbScan.h
|
||||
INC += dbTest.h
|
||||
INC += db_access.h
|
||||
INC += dbAddr.h
|
||||
INC += db_field_log.h
|
||||
INC += initHooks.h
|
||||
INC += recGbl.h
|
||||
INC += dbBkpt.h
|
||||
|
||||
MENUS += menuAlarmSevr.h
|
||||
MENUS += menuAlarmStat.h
|
||||
|
||||
@@ -24,13 +24,14 @@ of this distribution.
|
||||
#include "osiTimer.h"
|
||||
#include "osiRing.h"
|
||||
#include "errlog.h"
|
||||
#include "callback.h"
|
||||
#include "dbAccess.h"
|
||||
#include "recSup.h"
|
||||
#include "taskwd.h"
|
||||
#include "errMdef.h"
|
||||
#include "dbCommon.h"
|
||||
#include "dbLock.h"
|
||||
#define epicsExportSharedSymbols
|
||||
#include "callback.h"
|
||||
|
||||
int callbackQueueSize = 2000;
|
||||
static semBinaryId callbackSem[NUM_CALLBACK_PRIORITIES];
|
||||
@@ -56,13 +57,13 @@ static void wdCallback(void *ind); /*callback from taskwd*/
|
||||
static void start(int ind); /*start or restart a callbackTask*/
|
||||
|
||||
/*public routines */
|
||||
int callbackSetQueueSize(int size)
|
||||
int epicsShareAPI callbackSetQueueSize(int size)
|
||||
{
|
||||
callbackQueueSize = size;
|
||||
return(0);
|
||||
}
|
||||
|
||||
long callbackInit()
|
||||
long epicsShareAPI callbackInit()
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -75,7 +76,7 @@ long callbackInit()
|
||||
|
||||
/* Routine which places requests into callback queue*/
|
||||
/* This routine can be called from interrupt routine*/
|
||||
void callbackRequest(CALLBACK *pcallback)
|
||||
void epicsShareAPI callbackRequest(CALLBACK *pcallback)
|
||||
{
|
||||
int priority = pcallback->priority;
|
||||
int nput;
|
||||
@@ -169,7 +170,7 @@ static void ProcessCallback(CALLBACK *pcallback)
|
||||
(*pRec->rset->process)(pRec);
|
||||
dbScanUnlock(pRec);
|
||||
}
|
||||
void callbackRequestProcessCallback(CALLBACK *pcallback,
|
||||
void epicsShareAPI callbackRequestProcessCallback(CALLBACK *pcallback,
|
||||
int Priority, void *pRec)
|
||||
{
|
||||
callbackSetCallback(ProcessCallback, pcallback);
|
||||
@@ -205,7 +206,7 @@ void show(void *pPrivate, unsigned level)
|
||||
}
|
||||
|
||||
|
||||
void callbackRequestDelayed(CALLBACK *pcallback,double seconds)
|
||||
void epicsShareAPI callbackRequestDelayed(CALLBACK *pcallback,double seconds)
|
||||
{
|
||||
osiTimerId timer = (osiTimerId *)pcallback->timer;
|
||||
|
||||
@@ -216,7 +217,7 @@ void callbackRequestDelayed(CALLBACK *pcallback,double seconds)
|
||||
osiTimerArm(timer,timerQueue,seconds);
|
||||
}
|
||||
|
||||
void callbackRequestProcessCallbackDelayed(CALLBACK *pcallback,
|
||||
void epicsShareAPI callbackRequestProcessCallbackDelayed(CALLBACK *pcallback,
|
||||
int Priority, void *pRec,double seconds)
|
||||
{
|
||||
callbackSetCallback(ProcessCallback, pcallback);
|
||||
|
||||
@@ -23,7 +23,9 @@ of this distribution.
|
||||
|
||||
#ifndef INCcallbackh
|
||||
#define INCcallbackh 1
|
||||
|
||||
|
||||
#include "shareLib.h"
|
||||
|
||||
/*
|
||||
* WINDOWS also has a "CALLBACK" type def
|
||||
*/
|
||||
@@ -32,28 +34,20 @@ of this distribution.
|
||||
# undef CALLBACK
|
||||
# endif /*CALLBACK*/
|
||||
#endif /*_WIN32*/
|
||||
|
||||
|
||||
#define NUM_CALLBACK_PRIORITIES 3
|
||||
#define priorityLow 0
|
||||
#define priorityMedium 1
|
||||
#define priorityHigh 2
|
||||
|
||||
typedef struct callbackPvt {
|
||||
#ifdef __STDC__
|
||||
void (*callback)(struct callbackPvt*);
|
||||
#else
|
||||
void(*callback)();
|
||||
#endif
|
||||
int priority;
|
||||
void *user; /*for use by callback user*/
|
||||
void *timer; /*for use by callback itself*/
|
||||
}CALLBACK;
|
||||
|
||||
#ifdef __STDC__
|
||||
typedef void (*CALLBACKFUNC)(struct callbackPvt*);
|
||||
#else
|
||||
typedef void (*CALLBACKFUNC)();
|
||||
#endif
|
||||
|
||||
#define callbackSetCallback(PFUN,PCALLBACK)\
|
||||
( (PCALLBACK)->callback = (PFUN) )
|
||||
@@ -64,22 +58,14 @@ typedef void (*CALLBACKFUNC)();
|
||||
#define callbackGetUser(USER,PCALLBACK)\
|
||||
( (USER) = (void *)((CALLBACK *)(PCALLBACK))->user )
|
||||
|
||||
#ifdef __STDC__
|
||||
long callbackInit();
|
||||
void callbackRequest(CALLBACK *pCallback);
|
||||
void callbackRequestProcessCallback(CALLBACK *pCallback,
|
||||
int Priority, void *pRec);
|
||||
void callbackRequestDelayed(CALLBACK *pCallback,double seconds);
|
||||
void callbackRequestProcessCallbackDelayed(CALLBACK *pCallback,
|
||||
int Priority, void *pRec,double seconds);
|
||||
int callbackSetQueueSize(int size);
|
||||
#else
|
||||
long callbackInit();
|
||||
void callbackRequest();
|
||||
void callbackRequestProcessCallback();
|
||||
void callbackRequestDelayed();
|
||||
void callbackRequestProcessCallbackDelayed();
|
||||
int callbackSetQueueSize();
|
||||
#endif /*__STDC__*/
|
||||
epicsShareFunc long epicsShareAPI callbackInit();
|
||||
epicsShareFunc void epicsShareAPI callbackRequest(CALLBACK *pCallback);
|
||||
epicsShareFunc void epicsShareAPI callbackRequestProcessCallback(
|
||||
CALLBACK *pCallback,int Priority, void *pRec);
|
||||
epicsShareFunc void epicsShareAPI callbackRequestDelayed(
|
||||
CALLBACK *pCallback,double seconds);
|
||||
epicsShareFunc void epicsShareAPI callbackRequestProcessCallbackDelayed(
|
||||
CALLBACK *pCallback, int Priority, void *pRec,double seconds);
|
||||
epicsShareFunc int epicsShareAPI callbackSetQueueSize(int size);
|
||||
|
||||
#endif /*INCcallbackh*/
|
||||
|
||||
@@ -46,28 +46,38 @@ of this distribution.
|
||||
#include <string.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "osiThread.h"
|
||||
#include "errlog.h"
|
||||
#include "cantProceed.h"
|
||||
#include "cvtFast.h"
|
||||
#include "tsStamp.h"
|
||||
#include "alarm.h"
|
||||
#include "dbBase.h"
|
||||
#include "dbAccess.h"
|
||||
#include "ellLib.h"
|
||||
#include "dbStaticLib.h"
|
||||
#include "dbConvert.h"
|
||||
#include "dbBkpt.h"
|
||||
#include "link.h"
|
||||
#include "recSup.h"
|
||||
#include "caeventmask.h"
|
||||
#include "dbScan.h"
|
||||
#include "dbCommon.h"
|
||||
#include "dbLock.h"
|
||||
#include "callback.h"
|
||||
#include "dbAddr.h"
|
||||
#include "dbBase.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "dbEvent.h"
|
||||
#include "db_field_log.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "special.h"
|
||||
#include "dbConvert.h"
|
||||
#include "dbCa.h"
|
||||
#include "dbBkpt.h"
|
||||
#include "dbNotify.h"
|
||||
#define epicsExportSharedSymbols
|
||||
#include "dbAccess.h"
|
||||
|
||||
extern long lset_stack_not_empty;
|
||||
struct dbBase *pdbbase=NULL;
|
||||
epicsShareDef struct dbBase *pdbbase;
|
||||
|
||||
static short mapDBFToDBR[DBF_NTYPES] = {
|
||||
DBR_STRING, DBR_CHAR, DBR_UCHAR, DBR_SHORT, DBR_USHORT,
|
||||
@@ -87,7 +97,7 @@ static short mapDBFToDBR[DBF_NTYPES] = {
|
||||
/* The following is to handle SPC_AS */
|
||||
static SPC_ASCALLBACK spcAsCallback = 0;
|
||||
|
||||
void dbSpcAsRegisterCallback(SPC_ASCALLBACK func)
|
||||
void epicsShareAPI dbSpcAsRegisterCallback(SPC_ASCALLBACK func)
|
||||
{
|
||||
spcAsCallback = func;
|
||||
}
|
||||
@@ -379,7 +389,7 @@ static void getOptions(DBADDR *paddr,void **poriginal,long *options,void *pflin)
|
||||
*poriginal = pbuffer;
|
||||
}
|
||||
|
||||
struct rset *dbGetRset(struct dbAddr *paddr)
|
||||
struct rset * epicsShareAPI dbGetRset(struct dbAddr *paddr)
|
||||
{
|
||||
struct dbFldDes *pfldDes = (struct dbFldDes *)paddr->pfldDes;
|
||||
|
||||
@@ -387,7 +397,7 @@ struct rset *dbGetRset(struct dbAddr *paddr)
|
||||
return(pfldDes->pdbRecordType->prset);
|
||||
}
|
||||
|
||||
long dbPutAttribute(char *recordTypename,char *name,char*value)
|
||||
long epicsShareAPI dbPutAttribute(char *recordTypename,char *name,char*value)
|
||||
{
|
||||
DBENTRY dbEntry;
|
||||
DBENTRY *pdbEntry = &dbEntry;
|
||||
@@ -402,7 +412,7 @@ long dbPutAttribute(char *recordTypename,char *name,char*value)
|
||||
return(status);
|
||||
}
|
||||
|
||||
int dbIsValueField(struct dbFldDes *pdbFldDes)
|
||||
int epicsShareAPI dbIsValueField(struct dbFldDes *pdbFldDes)
|
||||
{
|
||||
if(pdbFldDes->pdbRecordType->indvalFlddes == pdbFldDes->indRecordType)
|
||||
return(TRUE);
|
||||
@@ -410,12 +420,12 @@ int dbIsValueField(struct dbFldDes *pdbFldDes)
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
int dbGetFieldIndex(struct dbAddr *paddr)
|
||||
int epicsShareAPI dbGetFieldIndex(struct dbAddr *paddr)
|
||||
{
|
||||
return(((struct dbFldDes *)paddr->pfldDes)->indRecordType);
|
||||
}
|
||||
|
||||
long dbGetNelements(struct link *plink,long *nelements)
|
||||
long epicsShareAPI dbGetNelements(struct link *plink,long *nelements)
|
||||
{
|
||||
switch(plink->type) {
|
||||
case CONSTANT:
|
||||
@@ -434,7 +444,7 @@ long dbGetNelements(struct link *plink,long *nelements)
|
||||
return(S_db_badField);
|
||||
}
|
||||
|
||||
int dbIsLinkConnected(struct link *plink)
|
||||
int epicsShareAPI dbIsLinkConnected(struct link *plink)
|
||||
{
|
||||
switch(plink->type) {
|
||||
case DB_LINK: return(TRUE);
|
||||
@@ -444,7 +454,7 @@ int dbIsLinkConnected(struct link *plink)
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
int dbGetLinkDBFtype(struct link *plink)
|
||||
int epicsShareAPI dbGetLinkDBFtype(struct link *plink)
|
||||
{
|
||||
switch(plink->type) {
|
||||
case DB_LINK:
|
||||
@@ -464,7 +474,7 @@ int dbGetLinkDBFtype(struct link *plink)
|
||||
* Will notify if processing is complete by callback.
|
||||
* (only if you are interested in completion)
|
||||
*/
|
||||
long dbScanPassive(dbCommon *pfrom, dbCommon *pto)
|
||||
long epicsShareAPI dbScanPassive(dbCommon *pfrom, dbCommon *pto)
|
||||
{
|
||||
long status;
|
||||
|
||||
@@ -477,7 +487,7 @@ long dbScanPassive(dbCommon *pfrom, dbCommon *pto)
|
||||
}
|
||||
|
||||
/*KLUDGE: Following needed so that dbPutLink to PROC field works correctly*/
|
||||
long dbScanLink(dbCommon *pfrom, dbCommon *pto)
|
||||
long epicsShareAPI dbScanLink(dbCommon *pfrom, dbCommon *pto)
|
||||
{
|
||||
long status;
|
||||
unsigned char pact;
|
||||
@@ -490,7 +500,7 @@ long dbScanLink(dbCommon *pfrom, dbCommon *pto)
|
||||
return(status);
|
||||
}
|
||||
|
||||
void dbScanFwdLink(struct link *plink)
|
||||
void epicsShareAPI dbScanFwdLink(struct link *plink)
|
||||
{
|
||||
dbCommon *precord;
|
||||
struct pv_link *pvlink;
|
||||
@@ -519,7 +529,7 @@ void dbScanFwdLink(struct link *plink)
|
||||
* 5. Run the process routine specific to the record type.
|
||||
* 6. Check to see if record contents should be automatically printed.
|
||||
*/
|
||||
long dbProcess(dbCommon *precord)
|
||||
long epicsShareAPI dbProcess(dbCommon *precord)
|
||||
{
|
||||
struct rset *prset = precord->rset;
|
||||
dbRecordType *pdbRecordType = precord->rdes;
|
||||
@@ -646,7 +656,7 @@ all_done:
|
||||
* Returns error codes from StaticLib module, not
|
||||
* from dbAccess.
|
||||
*/
|
||||
long dbNameToAddr(const char *pname,DBADDR *paddr)
|
||||
long epicsShareAPI dbNameToAddr(const char *pname,DBADDR *paddr)
|
||||
{
|
||||
DBENTRY dbEntry;
|
||||
long status=0;
|
||||
@@ -681,7 +691,7 @@ long dbNameToAddr(const char *pname,DBADDR *paddr)
|
||||
return(status);
|
||||
}
|
||||
|
||||
long dbValueSize(
|
||||
long epicsShareAPI dbValueSize(
|
||||
short dbr_type
|
||||
)
|
||||
{
|
||||
@@ -702,7 +712,7 @@ long dbValueSize(
|
||||
}
|
||||
|
||||
|
||||
long dbBufferSize(
|
||||
long epicsShareAPI dbBufferSize(
|
||||
short dbr_type,
|
||||
long options,
|
||||
long no_elements
|
||||
@@ -725,7 +735,7 @@ long dbBufferSize(
|
||||
return(nbytes);
|
||||
}
|
||||
|
||||
long dbGetLinkValue(struct link *plink, short dbrType, void *pbuffer,
|
||||
long epicsShareAPI dbGetLinkValue(struct link *plink, short dbrType, void *pbuffer,
|
||||
long *poptions, long *pnRequest)
|
||||
{
|
||||
long status = 0;
|
||||
@@ -800,7 +810,7 @@ long dbGetLinkValue(struct link *plink, short dbrType, void *pbuffer,
|
||||
return(status);
|
||||
}
|
||||
|
||||
long dbPutLinkValue(struct link *plink,short dbrType,
|
||||
long epicsShareAPI dbPutLinkValue(struct link *plink,short dbrType,
|
||||
const void *pbuffer,long nRequest)
|
||||
{
|
||||
long status=0;
|
||||
@@ -837,7 +847,7 @@ long dbPutLinkValue(struct link *plink,short dbrType,
|
||||
return(status);
|
||||
}
|
||||
|
||||
long dbGetField( DBADDR *paddr,short dbrType,void *pbuffer,
|
||||
long epicsShareAPI dbGetField( DBADDR *paddr,short dbrType,void *pbuffer,
|
||||
long *options,long *nRequest,void *pflin)
|
||||
{
|
||||
short dbfType = paddr->field_type;
|
||||
@@ -880,7 +890,7 @@ done:
|
||||
return(status);
|
||||
}
|
||||
|
||||
long dbGet(DBADDR *paddr,short dbrType,void *pbuffer,long *options,
|
||||
long epicsShareAPI dbGet(DBADDR *paddr,short dbrType,void *pbuffer,long *options,
|
||||
long *nRequest,void *pflin)
|
||||
{
|
||||
db_field_log *pfl= (db_field_log *)pflin;
|
||||
@@ -964,7 +974,7 @@ long dbGet(DBADDR *paddr,short dbrType,void *pbuffer,long *options,
|
||||
return(status);
|
||||
}
|
||||
|
||||
long dbPutField(DBADDR *paddr,short dbrType,const void *pbuffer,long nRequest)
|
||||
long epicsShareAPI dbPutField(DBADDR *paddr,short dbrType,const void *pbuffer,long nRequest)
|
||||
{
|
||||
long status = 0;
|
||||
long special=paddr->special;
|
||||
@@ -1124,7 +1134,7 @@ long offset;
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dbPut(DBADDR *paddr,short dbrType,const void *pbuffer,long nRequest)
|
||||
long epicsShareAPI dbPut(DBADDR *paddr,short dbrType,const void *pbuffer,long nRequest)
|
||||
{
|
||||
long no_elements=paddr->no_elements;
|
||||
long dummy;
|
||||
|
||||
@@ -29,17 +29,10 @@ of this distribution.
|
||||
|
||||
#ifndef INCdbAccessh
|
||||
#define INCdbAccessh
|
||||
#include "dbDefs.h"
|
||||
#include "dbBase.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "link.h"
|
||||
#include "dbCommon.h"
|
||||
#include "dbLock.h"
|
||||
#include "tsStamp.h"
|
||||
#include "callback.h"
|
||||
#include "ellLib.h"
|
||||
#include "caeventmask.h"
|
||||
#include "dbAddr.h"
|
||||
|
||||
#include "shareLib.h"
|
||||
|
||||
epicsShareExtern struct dbBase *pdbbase;
|
||||
|
||||
/* The database field and request types are defined in dbFldTypes.h*/
|
||||
/* Data Base Request Options */
|
||||
@@ -217,86 +210,43 @@ struct dbr_alDouble {DBRalDouble};
|
||||
: (((DBADDR*)((PLNK)->value.pv_link.pvt))) \
|
||||
)
|
||||
|
||||
#ifdef __STDC__
|
||||
struct rset *dbGetRset(struct dbAddr *paddr);
|
||||
long dbPutAttribute(char *recordTypename,char *name,char*value);
|
||||
int dbIsValueField(struct dbFldDes *pdbFldDes);
|
||||
int dbGetFieldIndex(struct dbAddr *paddr);
|
||||
long dbGetNelements(struct link *plink,long *nelements);
|
||||
int dbIsLinkConnected(struct link *plink);
|
||||
int dbGetLinkDBFtype(struct link *plink);
|
||||
long dbScanLink(struct dbCommon *pfrom, struct dbCommon *pto);
|
||||
long dbScanPassive(struct dbCommon *pfrom,struct dbCommon *pto);
|
||||
void dbScanFwdLink(struct link *plink);
|
||||
long dbProcess(struct dbCommon *precord);
|
||||
long dbNameToAddr(const char *pname,struct dbAddr *);
|
||||
long dbGetLinkValue(struct link *,short dbrType,
|
||||
void *pbuffer,long *options,long *nRequest);
|
||||
long dbGetField(struct dbAddr *,short dbrType,void *pbuffer,long *options,
|
||||
long *nRequest,void *pfl);
|
||||
long dbGet(struct dbAddr *,short dbrType,void *pbuffer,long *options,
|
||||
long *nRequest,void *pfl);
|
||||
long dbPutLinkValue(struct link *,short dbrType,const void *pbuffer,long nRequest);
|
||||
long dbPutField(struct dbAddr *,short dbrType,const void *pbuffer,long nRequest);
|
||||
long dbPut(struct dbAddr *,short dbrType,const void *pbuffer,long nRequest);
|
||||
long dbPutNotify(PUTNOTIFY *pputnotify);
|
||||
/*dbNotifyAdd called by dbScanPassive and dbScanLink*/
|
||||
void dbNotifyAdd(struct dbCommon *pfrom,struct dbCommon *pto);
|
||||
void dbNotifyCancel(PUTNOTIFY *pputnotify);
|
||||
/*dbNotifyCompletion called by recGblFwdLink */
|
||||
void dbNotifyCompletion(struct dbCommon *precord);
|
||||
epicsShareFunc struct rset * epicsShareAPI dbGetRset(struct dbAddr *paddr);
|
||||
epicsShareFunc long epicsShareAPI dbPutAttribute(
|
||||
char *recordTypename,char *name,char*value);
|
||||
epicsShareFunc int epicsShareAPI dbIsValueField(struct dbFldDes *pdbFldDes);
|
||||
epicsShareFunc int epicsShareAPI dbGetFieldIndex(struct dbAddr *paddr);
|
||||
epicsShareFunc long epicsShareAPI dbGetNelements(
|
||||
struct link *plink,long *nelements);
|
||||
epicsShareFunc int epicsShareAPI dbIsLinkConnected(struct link *plink);
|
||||
epicsShareFunc int epicsShareAPI dbGetLinkDBFtype(struct link *plink);
|
||||
epicsShareFunc long epicsShareAPI dbScanLink(
|
||||
struct dbCommon *pfrom, struct dbCommon *pto);
|
||||
epicsShareFunc long epicsShareAPI dbScanPassive(
|
||||
struct dbCommon *pfrom,struct dbCommon *pto);
|
||||
epicsShareFunc void epicsShareAPI dbScanFwdLink(struct link *plink);
|
||||
epicsShareFunc long epicsShareAPI dbProcess(struct dbCommon *precord);
|
||||
epicsShareFunc long epicsShareAPI dbNameToAddr(
|
||||
const char *pname,struct dbAddr *);
|
||||
epicsShareFunc long epicsShareAPI dbGetLinkValue(
|
||||
struct link *,short dbrType,void *pbuffer,long *options,long *nRequest);
|
||||
epicsShareFunc long epicsShareAPI dbGetField(
|
||||
struct dbAddr *,short dbrType,void *pbuffer,long *options,
|
||||
long *nRequest,void *pfl);
|
||||
epicsShareFunc long epicsShareAPI dbGet(
|
||||
struct dbAddr *,short dbrType,void *pbuffer,long *options,
|
||||
long *nRequest,void *pfl);
|
||||
epicsShareFunc long epicsShareAPI dbPutLinkValue(
|
||||
struct link *,short dbrType,const void *pbuffer,long nRequest);
|
||||
epicsShareFunc long epicsShareAPI dbPutField(
|
||||
struct dbAddr *,short dbrType,const void *pbuffer,long nRequest);
|
||||
epicsShareFunc long epicsShareAPI dbPut(
|
||||
struct dbAddr *,short dbrType,const void *pbuffer,long nRequest);
|
||||
epicsShareFunc long epicsShareAPI dbPutNotify(PUTNOTIFY *pputnotify);
|
||||
typedef void(*SPC_ASCALLBACK)(struct dbCommon *);
|
||||
/*dbSpcAsRegisterCallback called by access security */
|
||||
void dbSpcAsRegisterCallback(SPC_ASCALLBACK func);
|
||||
long dbBufferSize(short dbrType,long options,long nRequest);
|
||||
long dbValueSize(short dbrType);
|
||||
|
||||
void dbCaLinkInit(void);
|
||||
void dbCaAddLink(struct link *plink);
|
||||
void dbCaRemoveLink(struct link *plink);
|
||||
long dbCaGetLink(struct link *plink,short dbrType,void *pbuffer,
|
||||
unsigned short *psevr,long *nRequest);
|
||||
long dbCaPutLink(struct link *plink,short dbrType,
|
||||
const void *pbuffer,long nRequest);
|
||||
long dbCaGetAttributes(struct link *plink,
|
||||
void (*callback)(void *usrPvt),void *usrPvt);
|
||||
long dbCaGetControlLimits(struct link *plink,double *low, double *high);
|
||||
long dbCaGetGraphicLimits(struct link *plink,double *low, double *high);
|
||||
long dbCaGetAlarmLimits(struct link *plink,
|
||||
double *lolo, double *low, double *high, double *hihi);
|
||||
long dbCaGetNelements(struct link *plink,long *nelements);
|
||||
long dbCaGetPrecision(struct link *plink,short *precision);
|
||||
long dbCaGetSevr(struct link *plink,short *severity);
|
||||
long dbCaGetTimeStamp(struct link *plink,TS_STAMP *pstamp);
|
||||
long dbCaGetUnits(struct link *plink,char *units,int unitsSize);
|
||||
int dbCaIsLinkConnected(struct link *plink);
|
||||
int dbCaGetLinkDBFtype(struct link *plink);
|
||||
|
||||
#else
|
||||
struct rset *dbGetRset();
|
||||
int dbIsValueField();
|
||||
int dbGetFieldIndex();
|
||||
long dbScanPassive();
|
||||
long dbScanLink();
|
||||
long dbProcess();
|
||||
long dbNameToAddr();
|
||||
long dbGetLinkValue();
|
||||
long dbGetField();
|
||||
long dbGet();
|
||||
long dbPutLinkValue();
|
||||
long dbPutField();
|
||||
long dbPut();
|
||||
long dbPutNotify();
|
||||
void dbNotifyAdd();
|
||||
void dbNotifyCancel();
|
||||
void dbNotifyCompletion();
|
||||
long dbBufferSize();
|
||||
long dbValueSize();
|
||||
void dbCaLinkInit();
|
||||
void dbCaAddLink();
|
||||
void dbCaRemoveLink();
|
||||
long dbCaGetLink();
|
||||
long dbCaPutLink();
|
||||
#endif /*__STDC__*/
|
||||
epicsShareFunc void epicsShareAPI dbSpcAsRegisterCallback(SPC_ASCALLBACK func);
|
||||
epicsShareFunc long epicsShareAPI dbBufferSize(
|
||||
short dbrType,long options,long nRequest);
|
||||
epicsShareFunc long epicsShareAPI dbValueSize(short dbrType);
|
||||
|
||||
#endif /*INCdbAccessh*/
|
||||
|
||||
@@ -32,11 +32,7 @@ typedef struct pnRestartNode {
|
||||
|
||||
typedef struct putNotify{
|
||||
/*The following members MUST be set by user*/
|
||||
#ifdef __STDC__
|
||||
void (*userCallback)(struct putNotify *); /*callback provided by user*/
|
||||
#else
|
||||
void (*userCallback)(); /*callback provided by user*/
|
||||
#endif
|
||||
void (*userCallback)(struct putNotify *);
|
||||
struct dbAddr *paddr; /*dbAddr set by dbNameToAddr*/
|
||||
void *pbuffer; /*address of data*/
|
||||
long nRequest; /*number of elements to be written*/
|
||||
@@ -45,7 +41,7 @@ typedef struct putNotify{
|
||||
/*The following is status of request. Set by dbPutNotify*/
|
||||
long status;
|
||||
/*The following are private to database access*/
|
||||
CALLBACK callback;
|
||||
struct callbackPvt *callback;
|
||||
ELLLIST waitList; /*list of records for which to wait*/
|
||||
ELLLIST restartList; /*list of PUTNOTIFYs to restart*/
|
||||
PNRESTARTNODE restartNode;
|
||||
|
||||
@@ -14,6 +14,9 @@ of this distribution.
|
||||
/* Modification Log:
|
||||
* -----------------
|
||||
* $Log$
|
||||
* Revision 1.15 2000/02/08 20:14:59 norume
|
||||
* Remove task argument to threadSuspend().
|
||||
*
|
||||
* Revision 1.14 2000/01/27 19:46:40 mrk
|
||||
* semId => semBinaryId and semMutexId
|
||||
*
|
||||
@@ -89,12 +92,14 @@ of this distribution.
|
||||
#include "dbCommon.h"
|
||||
#include "dbLock.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "dbBkpt.h"
|
||||
#include "db_field_log.h"
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "special.h"
|
||||
#include "dbTest.h"
|
||||
#define epicsExportSharedSymbols
|
||||
#include "dbBkpt.h"
|
||||
|
||||
/* private routines */
|
||||
static void dbBkptCont();
|
||||
@@ -284,7 +289,7 @@ static long FIND_CONT_NODE(
|
||||
* 7. Add breakpoint to list of breakpoints in structure.
|
||||
* 8. Spawn continuation task if it isn't already running.
|
||||
*/
|
||||
long dbb(char *record_name)
|
||||
long epicsShareAPI dbb(char *record_name)
|
||||
{
|
||||
struct dbAddr addr;
|
||||
struct LS_LIST *pnode;
|
||||
@@ -413,7 +418,7 @@ long dbb(char *record_name)
|
||||
* 5. Turn off break point field.
|
||||
* 6. Give up semaphore to "signal" bkptCont task to quit.
|
||||
*/
|
||||
long dbd(char *record_name)
|
||||
long epicsShareAPI dbd(char *record_name)
|
||||
{
|
||||
struct dbAddr addr;
|
||||
struct LS_LIST *pnode;
|
||||
@@ -499,7 +504,7 @@ long dbd(char *record_name)
|
||||
* 2. Turn off stepping mode.
|
||||
* 2. Resume dbBkptCont.
|
||||
*/
|
||||
long dbc(char *record_name)
|
||||
long epicsShareAPI dbc(char *record_name)
|
||||
{
|
||||
struct LS_LIST *pnode;
|
||||
struct dbCommon *precord = NULL;
|
||||
@@ -538,7 +543,7 @@ long dbc(char *record_name)
|
||||
* 1. Find top node in lockset stack.
|
||||
* 2. Resume dbBkptCont.
|
||||
*/
|
||||
long dbs(char *record_name)
|
||||
long epicsShareAPI dbs(char *record_name)
|
||||
{
|
||||
struct LS_LIST *pnode;
|
||||
struct dbCommon *precord = NULL;
|
||||
@@ -671,7 +676,7 @@ static void dbBkptCont(struct dbCommon *precord)
|
||||
* if so, turn on stepping mode.
|
||||
* 6. If stepping mode is set, stop and report the breakpoint.
|
||||
*/
|
||||
int dbBkpt(struct dbCommon *precord)
|
||||
int epicsShareAPI dbBkpt(struct dbCommon *precord)
|
||||
{
|
||||
struct LS_LIST *pnode;
|
||||
struct EP_LIST *pqe;
|
||||
@@ -824,7 +829,7 @@ int dbBkpt(struct dbCommon *precord)
|
||||
}
|
||||
|
||||
/* print record after processing */
|
||||
void dbPrint(struct dbCommon *precord)
|
||||
void epicsShareAPI dbPrint(struct dbCommon *precord)
|
||||
{
|
||||
struct LS_LIST *pnode;
|
||||
|
||||
@@ -898,7 +903,7 @@ long dbap(char *record_name)
|
||||
}
|
||||
|
||||
/* print list of stopped records, and breakpoints set in locksets */
|
||||
long dbstat()
|
||||
long epicsShareAPI dbstat()
|
||||
{
|
||||
struct LS_LIST *pnode;
|
||||
struct BP_LIST *pbl;
|
||||
|
||||
@@ -32,12 +32,7 @@
|
||||
#ifndef INCdbBkptsh
|
||||
#define INCdbBkptsh 1
|
||||
|
||||
#include <ellLib.h>
|
||||
#include <osiSem.h>
|
||||
#include <tsStamp.h>
|
||||
#include <osiThread.h>
|
||||
/* Needs to be put into dbTest.h ! */
|
||||
long dbpr(char *name, int level);
|
||||
#include "shareLib.h"
|
||||
|
||||
/*
|
||||
* Structure containing a list of set breakpoints
|
||||
@@ -95,14 +90,13 @@ struct LS_LIST {
|
||||
|
||||
#define MAX_EP_COUNT 99999
|
||||
|
||||
long dbb();
|
||||
long dbd();
|
||||
long dbc();
|
||||
long dbs();
|
||||
long dbstat();
|
||||
long dbtap();
|
||||
int dbBkpt();
|
||||
void dbPrint();
|
||||
epicsShareFunc long epicsShareAPI dbb();
|
||||
epicsShareFunc long epicsShareAPI dbd();
|
||||
epicsShareFunc long epicsShareAPI dbc();
|
||||
epicsShareFunc long epicsShareAPI dbs();
|
||||
epicsShareFunc long epicsShareAPI dbstat();
|
||||
epicsShareFunc int epicsShareAPI dbBkpt();
|
||||
epicsShareFunc void epicsShareAPI dbPrint();
|
||||
|
||||
extern long lset_stack_not_empty;
|
||||
|
||||
|
||||
@@ -43,7 +43,9 @@ of this distribution.
|
||||
#include "errMdef.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "dbCommon.h"
|
||||
#define epicsExportSharedSymbols
|
||||
#include "dbCa.h"
|
||||
#include "dbCaPvt.h"
|
||||
/*Following is because we cant include dbAccess.h*/
|
||||
void *dbCalloc(size_t nobj,size_t size);
|
||||
/*Following is because dbScan.h causes include for dbAccess.h*/
|
||||
@@ -77,7 +79,7 @@ static void addAction(caLink *pca, short link_action)
|
||||
if(callAdd) semBinaryGive(caWakeupSem);
|
||||
}
|
||||
|
||||
void dbCaLinkInit(void)
|
||||
void epicsShareAPI dbCaLinkInit(void)
|
||||
{
|
||||
ellInit(&caList);
|
||||
caListSem = semMutexMustCreate();
|
||||
@@ -90,7 +92,7 @@ void dbCaLinkInit(void)
|
||||
threadGetStackSize(threadStackBig), (THREADFUNC) dbCaTask,0);
|
||||
}
|
||||
|
||||
void dbCaAddLink( struct link *plink)
|
||||
void epicsShareAPI dbCaAddLink( struct link *plink)
|
||||
{
|
||||
caLink *pca;
|
||||
|
||||
@@ -103,7 +105,7 @@ void dbCaAddLink( struct link *plink)
|
||||
return;
|
||||
}
|
||||
|
||||
void dbCaRemoveLink( struct link *plink)
|
||||
void epicsShareAPI dbCaRemoveLink( struct link *plink)
|
||||
{
|
||||
caLink *pca = (caLink *)plink->value.pv_link.pvt;
|
||||
|
||||
@@ -116,7 +118,7 @@ void dbCaRemoveLink( struct link *plink)
|
||||
}
|
||||
|
||||
|
||||
long dbCaGetLink(struct link *plink,short dbrType, char *pdest,
|
||||
long epicsShareAPI dbCaGetLink(struct link *plink,short dbrType, void *pdest,
|
||||
unsigned short *psevr,long *nelements)
|
||||
{
|
||||
caLink *pca = (caLink *)plink->value.pv_link.pvt;
|
||||
@@ -186,7 +188,7 @@ done:
|
||||
return(status);
|
||||
}
|
||||
|
||||
long dbCaPutLink(struct link *plink,short dbrType,
|
||||
long epicsShareAPI dbCaPutLink(struct link *plink,short dbrType,
|
||||
const void *psource,long nelements)
|
||||
{
|
||||
caLink *pca = (caLink *)plink->value.pv_link.pvt;
|
||||
@@ -247,7 +249,7 @@ long dbCaPutLink(struct link *plink,short dbrType,
|
||||
return(status);
|
||||
}
|
||||
|
||||
long dbCaGetAttributes(struct link *plink,
|
||||
long epicsShareAPI dbCaGetAttributes(struct link *plink,
|
||||
void (*callback)(void *usrPvt),void *usrPvt)
|
||||
{
|
||||
caLink *pca;
|
||||
@@ -291,7 +293,7 @@ caAttributes *getpcaAttributes(struct link *plink)
|
||||
return(pca->pcaAttributes);
|
||||
}
|
||||
|
||||
long dbCaGetControlLimits(struct link *plink,double *low, double *high)
|
||||
long epicsShareAPI dbCaGetControlLimits(struct link *plink,double *low, double *high)
|
||||
{
|
||||
caAttributes *pcaAttributes;
|
||||
|
||||
@@ -302,7 +304,7 @@ long dbCaGetControlLimits(struct link *plink,double *low, double *high)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dbCaGetGraphicLimits(struct link *plink,double *low, double *high)
|
||||
long epicsShareAPI dbCaGetGraphicLimits(struct link *plink,double *low, double *high)
|
||||
{
|
||||
caAttributes *pcaAttributes;
|
||||
|
||||
@@ -313,7 +315,7 @@ long dbCaGetGraphicLimits(struct link *plink,double *low, double *high)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dbCaGetAlarmLimits(struct link *plink,
|
||||
long epicsShareAPI dbCaGetAlarmLimits(struct link *plink,
|
||||
double *lolo, double *low, double *high, double *hihi)
|
||||
{
|
||||
caAttributes *pcaAttributes;
|
||||
@@ -327,7 +329,7 @@ long dbCaGetAlarmLimits(struct link *plink,
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dbCaGetPrecision(struct link *plink,short *precision)
|
||||
long epicsShareAPI dbCaGetPrecision(struct link *plink,short *precision)
|
||||
{
|
||||
caAttributes *pcaAttributes;
|
||||
|
||||
@@ -337,7 +339,7 @@ long dbCaGetPrecision(struct link *plink,short *precision)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dbCaGetUnits(struct link *plink,char *units,int unitsSize)
|
||||
long epicsShareAPI dbCaGetUnits(struct link *plink,char *units,int unitsSize)
|
||||
{
|
||||
caAttributes *pcaAttributes;
|
||||
|
||||
@@ -348,7 +350,7 @@ long dbCaGetUnits(struct link *plink,char *units,int unitsSize)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dbCaGetNelements(struct link *plink,long *nelements)
|
||||
long epicsShareAPI dbCaGetNelements(struct link *plink,long *nelements)
|
||||
{
|
||||
caLink *pca;
|
||||
|
||||
@@ -360,7 +362,7 @@ long dbCaGetNelements(struct link *plink,long *nelements)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dbCaGetSevr(struct link *plink,short *severity)
|
||||
long epicsShareAPI dbCaGetSevr(struct link *plink,short *severity)
|
||||
{
|
||||
caLink *pca;
|
||||
|
||||
@@ -372,7 +374,7 @@ long dbCaGetSevr(struct link *plink,short *severity)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dbCaGetTimeStamp(struct link *plink,TS_STAMP *pstamp)
|
||||
long epicsShareAPI dbCaGetTimeStamp(struct link *plink,TS_STAMP *pstamp)
|
||||
{
|
||||
caLink *pca;
|
||||
|
||||
@@ -384,7 +386,7 @@ long dbCaGetTimeStamp(struct link *plink,TS_STAMP *pstamp)
|
||||
return(0);
|
||||
}
|
||||
|
||||
int dbCaIsLinkConnected(struct link *plink)
|
||||
int epicsShareAPI dbCaIsLinkConnected(struct link *plink)
|
||||
{
|
||||
caLink *pca;
|
||||
|
||||
@@ -396,7 +398,7 @@ int dbCaIsLinkConnected(struct link *plink)
|
||||
if(ca_state(pca->chid)==cs_conn) return(TRUE);
|
||||
return(FALSE);
|
||||
}
|
||||
int dbCaGetLinkDBFtype(struct link *plink)
|
||||
int epicsShareAPI dbCaGetLinkDBFtype(struct link *plink)
|
||||
{
|
||||
caLink *pca;
|
||||
|
||||
|
||||
@@ -1,68 +1,47 @@
|
||||
/* dbCa.h */
|
||||
/* dbCa.h */
|
||||
/*****************************************************************
|
||||
COPYRIGHT NOTIFICATION
|
||||
*****************************************************************
|
||||
|
||||
(C) COPYRIGHT 1991 Regents of the University of California,
|
||||
and the University of Chicago Board of Governors.
|
||||
(C) COPYRIGHT 1993 UNIVERSITY OF CHICAGO
|
||||
|
||||
This software was developed under a United States Government license
|
||||
described on the COPYRIGHT_Combined file included as part
|
||||
described on the COPYRIGHT_UniversityOfChicago file included as part
|
||||
of this distribution.
|
||||
**********************************************************************/
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Current Author: Bob Dalesio
|
||||
* Contributing Author: Marty Kraimer
|
||||
* Date: 08APR96
|
||||
*
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 08APR96 mrk Made separate module for dbcar
|
||||
****************************************************************/
|
||||
#ifndef INCdbCah
|
||||
#define INCdbCah
|
||||
|
||||
/* link_action mask */
|
||||
#define CA_DELETE 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
|
||||
#include "shareLib.h"
|
||||
|
||||
typedef struct caAttributes
|
||||
{
|
||||
void (*callback)(void *usrPvt);
|
||||
struct dbr_ctrl_double data;
|
||||
void *usrPvt;
|
||||
int gotData;
|
||||
}caAttributes;
|
||||
epicsShareFunc void epicsShareAPI dbCaLinkInit(void);
|
||||
epicsShareFunc void epicsShareAPI dbCaAddLink(struct link *plink);
|
||||
epicsShareFunc void epicsShareAPI dbCaRemoveLink(struct link *plink);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetLink(
|
||||
struct link *plink,short dbrType,void *pbuffer,
|
||||
unsigned short *psevr,long *nRequest);
|
||||
epicsShareFunc long epicsShareAPI dbCaPutLink(
|
||||
struct link *plink,short dbrType,const void *pbuffer,long nRequest);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetAttributes(
|
||||
struct link *plink,void (*callback)(void *usrPvt),void *usrPvt);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetControlLimits(
|
||||
struct link *plink,double *low, double *high);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetGraphicLimits(
|
||||
struct link *plink,double *low, double *high);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetAlarmLimits(
|
||||
struct link *plink,double *lolo, double *low, double *high, double *hihi);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetPrecision(
|
||||
struct link *plink,short *precision);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetUnits(
|
||||
struct link *plink,char *units,int unitsSize);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetNelements(
|
||||
struct link *plink,long *nelements);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetSevr(
|
||||
struct link *plink,short *severity);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetTimeStamp(
|
||||
struct link *plink,TS_STAMP *pstamp);
|
||||
epicsShareFunc int epicsShareAPI dbCaIsLinkConnected(struct link *plink);
|
||||
epicsShareFunc int epicsShareAPI dbCaGetLinkDBFtype(struct link *plink);
|
||||
|
||||
typedef struct caLink
|
||||
{
|
||||
ELLNODE node;
|
||||
struct link *plink;
|
||||
chid chid;
|
||||
void *pgetNative;
|
||||
void *pputNative;
|
||||
char *pgetString;
|
||||
char *pputString;
|
||||
caAttributes *pcaAttributes;
|
||||
long nelements;
|
||||
semMutexId lock;
|
||||
unsigned long nDisconnect;
|
||||
unsigned long nNoWrite;
|
||||
short dbrType;
|
||||
short link_action;
|
||||
unsigned short sevr;
|
||||
TS_STAMP timeStamp;
|
||||
char gotInNative;
|
||||
char gotOutNative;
|
||||
char gotInString;
|
||||
char gotOutString;
|
||||
char newOutNative;
|
||||
char newOutString;
|
||||
char gotFirstConnection;
|
||||
}caLink;
|
||||
#endif /*INCdbCah*/
|
||||
|
||||
73
src/db/dbCaPvt.h
Normal file
73
src/db/dbCaPvt.h
Normal file
@@ -0,0 +1,73 @@
|
||||
/* dbCaPvt.h */
|
||||
/*****************************************************************
|
||||
COPYRIGHT NOTIFICATION
|
||||
*****************************************************************
|
||||
|
||||
(C) COPYRIGHT 1991 Regents of the University of California,
|
||||
and the University of Chicago Board of Governors.
|
||||
|
||||
This software was developed under a United States Government license
|
||||
described on the COPYRIGHT_Combined file included as part
|
||||
of this distribution.
|
||||
**********************************************************************/
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Current Author: Bob Dalesio
|
||||
* Contributing Author: Marty Kraimer
|
||||
* Date: 08APR96
|
||||
*
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 08APR96 mrk Made separate module for dbcar
|
||||
****************************************************************/
|
||||
|
||||
#ifndef INCdbCaPvth
|
||||
#define INCdbCaPvth 1
|
||||
|
||||
/* link_action mask */
|
||||
#define CA_DELETE 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
|
||||
|
||||
typedef struct caAttributes
|
||||
{
|
||||
void (*callback)(void *usrPvt);
|
||||
struct dbr_ctrl_double data;
|
||||
void *usrPvt;
|
||||
int gotData;
|
||||
}caAttributes;
|
||||
|
||||
typedef struct caLink
|
||||
{
|
||||
ELLNODE node;
|
||||
struct link *plink;
|
||||
chid chid;
|
||||
void *pgetNative;
|
||||
void *pputNative;
|
||||
char *pgetString;
|
||||
char *pputString;
|
||||
caAttributes *pcaAttributes;
|
||||
long nelements;
|
||||
semMutexId lock;
|
||||
unsigned long nDisconnect;
|
||||
unsigned long nNoWrite;
|
||||
short dbrType;
|
||||
short link_action;
|
||||
unsigned short sevr;
|
||||
TS_STAMP timeStamp;
|
||||
char gotInNative;
|
||||
char gotOutNative;
|
||||
char gotInString;
|
||||
char gotOutString;
|
||||
char newOutNative;
|
||||
char newOutString;
|
||||
char gotFirstConnection;
|
||||
}caLink;
|
||||
|
||||
#endif /*INCdbCaPvth*/
|
||||
@@ -32,11 +32,18 @@ of this distribution.
|
||||
#include "errlog.h"
|
||||
#include "taskwd.h"
|
||||
#include "freeList.h"
|
||||
#include "dbBase.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "dbAddr.h"
|
||||
#include "dbLock.h"
|
||||
#include "link.h"
|
||||
#include "tsStamp.h"
|
||||
#include "dbCommon.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "caeventmask.h"
|
||||
#include "db_field_log.h"
|
||||
#define epicsExportSharedSymbols
|
||||
#include "dbEvent.h"
|
||||
|
||||
#define EVENTSPERQUE 32
|
||||
#define EVENTQUESIZE (EVENTENTRIES * EVENTSPERQUE)
|
||||
@@ -144,7 +151,7 @@ static char *EVENT_PEND_NAME = "eventTask";
|
||||
/*
|
||||
* db_event_list ()
|
||||
*/
|
||||
int db_event_list (const char *pname, unsigned level)
|
||||
int epicsShareAPI db_event_list (const char *pname, unsigned level)
|
||||
{
|
||||
return dbel (pname, level);
|
||||
}
|
||||
@@ -152,7 +159,7 @@ int db_event_list (const char *pname, unsigned level)
|
||||
/*
|
||||
* dbel ()
|
||||
*/
|
||||
int dbel (const char *pname, unsigned level)
|
||||
int epicsShareAPI dbel (const char *pname, unsigned level)
|
||||
{
|
||||
DBADDR addr;
|
||||
long status;
|
||||
@@ -184,7 +191,7 @@ int dbel (const char *pname, unsigned level)
|
||||
|
||||
/* they should never see this one */
|
||||
if (pevent->ev_que->evUser->queovr) {
|
||||
printf (" !! joint event discard count=%ld !!",
|
||||
printf (" !! joint event discard count=%d !!",
|
||||
pevent->ev_que->evUser->queovr);
|
||||
}
|
||||
|
||||
@@ -236,7 +243,7 @@ int dbel (const char *pname, unsigned level)
|
||||
*
|
||||
* returns: ptr to event user block or NULL if memory can't be allocated
|
||||
*/
|
||||
dbEventCtx db_init_events (void)
|
||||
dbEventCtx epicsShareAPI db_init_events (void)
|
||||
{
|
||||
struct event_user *evUser;
|
||||
|
||||
@@ -288,7 +295,7 @@ dbEventCtx db_init_events (void)
|
||||
* itself
|
||||
*
|
||||
*/
|
||||
void db_close_events (dbEventCtx ctx)
|
||||
void epicsShareAPI db_close_events (dbEventCtx ctx)
|
||||
{
|
||||
struct event_user *evUser = (struct event_user *) ctx;
|
||||
|
||||
@@ -310,7 +317,8 @@ void db_close_events (dbEventCtx ctx)
|
||||
/*
|
||||
* DB_ADD_EVENT()
|
||||
*/
|
||||
dbEventSubscription db_add_event (dbEventCtx ctx, struct dbAddr *paddr,
|
||||
dbEventSubscription epicsShareAPI db_add_event (
|
||||
dbEventCtx ctx, struct dbAddr *paddr,
|
||||
EVENTFUNC *user_sub, void *user_arg, unsigned select)
|
||||
{
|
||||
struct event_user *evUser = (struct event_user *) ctx;
|
||||
@@ -397,7 +405,7 @@ dbEventSubscription db_add_event (dbEventCtx ctx, struct dbAddr *paddr,
|
||||
/*
|
||||
* db_event_enable()
|
||||
*/
|
||||
void db_event_enable (dbEventSubscription es)
|
||||
void epicsShareAPI db_event_enable (dbEventSubscription es)
|
||||
{
|
||||
struct evSubscrip *pevent = (struct evSubscrip *) es;
|
||||
struct dbCommon *precord;
|
||||
@@ -419,7 +427,7 @@ void db_event_enable (dbEventSubscription es)
|
||||
/*
|
||||
* db_event_disable()
|
||||
*/
|
||||
void db_event_disable (dbEventSubscription es)
|
||||
void epicsShareAPI db_event_disable (dbEventSubscription es)
|
||||
{
|
||||
struct evSubscrip *pevent = (struct evSubscrip *) es;
|
||||
struct dbCommon *precord;
|
||||
@@ -448,7 +456,7 @@ void db_event_disable (dbEventSubscription es)
|
||||
* This routine does not deallocate the event block since it normally will be
|
||||
* part of a larger structure.
|
||||
*/
|
||||
void db_cancel_event (dbEventSubscription es)
|
||||
void epicsShareAPI db_cancel_event (dbEventSubscription es)
|
||||
{
|
||||
struct evSubscrip *pevent = (struct evSubscrip *) es;
|
||||
struct dbCommon *precord;
|
||||
@@ -497,8 +505,8 @@ void db_cancel_event (dbEventSubscription es)
|
||||
*
|
||||
* Specify a routine to be executed for event que overflow condition
|
||||
*/
|
||||
int db_add_overflow_event (dbEventCtx ctx, OVRFFUNC *overflow_sub,
|
||||
void *overflow_arg)
|
||||
int epicsShareAPI db_add_overflow_event (
|
||||
dbEventCtx ctx, OVRFFUNC *overflow_sub, void *overflow_arg)
|
||||
{
|
||||
struct event_user *evUser = (struct event_user *) ctx;
|
||||
|
||||
@@ -513,7 +521,7 @@ int db_add_overflow_event (dbEventCtx ctx, OVRFFUNC *overflow_sub,
|
||||
*
|
||||
* waits for extra labor in progress to finish
|
||||
*/
|
||||
int db_flush_extra_labor_event (dbEventCtx ctx)
|
||||
int epicsShareAPI db_flush_extra_labor_event (dbEventCtx ctx)
|
||||
{
|
||||
struct event_user *evUser = (struct event_user *) ctx;
|
||||
|
||||
@@ -531,8 +539,8 @@ int db_flush_extra_labor_event (dbEventCtx ctx)
|
||||
* when labor is offloaded to the
|
||||
* event task
|
||||
*/
|
||||
int db_add_extra_labor_event (dbEventCtx ctx,
|
||||
EXTRALABORFUNC *func, void *arg)
|
||||
int epicsShareAPI db_add_extra_labor_event (
|
||||
dbEventCtx ctx, EXTRALABORFUNC *func, void *arg)
|
||||
{
|
||||
struct event_user *evUser = (struct event_user *) ctx;
|
||||
|
||||
@@ -545,7 +553,7 @@ int db_add_extra_labor_event (dbEventCtx ctx,
|
||||
/*
|
||||
* DB_POST_EXTRA_LABOR()
|
||||
*/
|
||||
int db_post_extra_labor (dbEventCtx ctx)
|
||||
int epicsShareAPI db_post_extra_labor (dbEventCtx ctx)
|
||||
{
|
||||
struct event_user *evUser = (struct event_user *) ctx;
|
||||
|
||||
@@ -560,7 +568,7 @@ int db_post_extra_labor (dbEventCtx ctx)
|
||||
*
|
||||
* NOTE: This assumes that the db scan lock is already applied
|
||||
*/
|
||||
LOCAL void db_post_single_event_private (struct evSubscrip *event)
|
||||
LOCAL void epicsShareAPI db_post_single_event_private (struct evSubscrip *event)
|
||||
{
|
||||
struct event_que *ev_que;
|
||||
db_field_log *pLog;
|
||||
@@ -684,7 +692,7 @@ LOCAL void db_post_single_event_private (struct evSubscrip *event)
|
||||
* NOTE: This assumes that the db scan lock is already applied
|
||||
*
|
||||
*/
|
||||
int db_post_events(
|
||||
int epicsShareAPI db_post_events(
|
||||
void *prec,
|
||||
void *pval,
|
||||
unsigned int select
|
||||
@@ -941,8 +949,9 @@ LOCAL void event_task (void *pParm)
|
||||
/*
|
||||
* DB_START_EVENTS()
|
||||
*/
|
||||
int db_start_events (dbEventCtx ctx, char *taskname, int (*init_func)(void *),
|
||||
void *init_func_arg, int priority_offset)
|
||||
int epicsShareAPI db_start_events (
|
||||
dbEventCtx ctx, char *taskname, int (*init_func)(threadId),
|
||||
void *init_func_arg, int priority_offset)
|
||||
{
|
||||
struct event_user *evUser = (struct event_user *) ctx;
|
||||
int taskpri;
|
||||
@@ -980,7 +989,7 @@ int db_start_events (dbEventCtx ctx, char *taskname, int (*init_func)(void *),
|
||||
/*
|
||||
* db_event_flow_ctrl_mode_on()
|
||||
*/
|
||||
void db_event_flow_ctrl_mode_on (dbEventCtx ctx)
|
||||
void epicsShareAPI db_event_flow_ctrl_mode_on (dbEventCtx ctx)
|
||||
{
|
||||
struct event_user *evUser = (struct event_user *) ctx;
|
||||
|
||||
@@ -997,7 +1006,7 @@ void db_event_flow_ctrl_mode_on (dbEventCtx ctx)
|
||||
/*
|
||||
* db_event_flow_ctrl_mode_off()
|
||||
*/
|
||||
void db_event_flow_ctrl_mode_off (dbEventCtx ctx)
|
||||
void epicsShareAPI db_event_flow_ctrl_mode_off (dbEventCtx ctx)
|
||||
{
|
||||
struct event_user *evUser = (struct event_user *) ctx;
|
||||
|
||||
|
||||
@@ -30,46 +30,45 @@
|
||||
#ifndef INCLdbEventh
|
||||
#define INCLdbEventh
|
||||
|
||||
/*
|
||||
* collides with db_access.h used in the CA client
|
||||
*/
|
||||
#ifndef caClient
|
||||
#include <dbCommon.h>
|
||||
#endif /*caClient*/
|
||||
#include "shareLib.h"
|
||||
|
||||
#include <db_field_log.h>
|
||||
#include <osiThread.h>
|
||||
|
||||
int db_event_list (const char *name, unsigned level);
|
||||
int dbel (const char *name, unsigned level);
|
||||
int db_post_events (void *precord, void *pvalue, unsigned select);
|
||||
epicsShareFunc int epicsShareAPI db_event_list (
|
||||
const char *name, unsigned level);
|
||||
epicsShareFunc int epicsShareAPI dbel (
|
||||
const char *name, unsigned level);
|
||||
epicsShareFunc int epicsShareAPI db_post_events (
|
||||
void *precord, void *pvalue, unsigned select);
|
||||
|
||||
typedef void * dbEventCtx;
|
||||
|
||||
typedef void OVRFFUNC (void *overflow_arg, unsigned count);
|
||||
typedef void EXTRALABORFUNC (void *extralabor_arg);
|
||||
dbEventCtx db_init_events (void);
|
||||
int db_start_events (dbEventCtx ctx, char *taskname, int (*init_func)(threadId),
|
||||
threadId init_func_arg, int priority_offset);
|
||||
void db_close_events (dbEventCtx ctx);
|
||||
void db_event_flow_ctrl_mode_on (dbEventCtx ctx);
|
||||
void db_event_flow_ctrl_mode_off (dbEventCtx ctx);
|
||||
int db_add_overflow_event (dbEventCtx ctx, OVRFFUNC *overflow_sub,
|
||||
void *overflow_arg);
|
||||
int db_add_extra_labor_event (dbEventCtx ctx, EXTRALABORFUNC *func, void *arg);
|
||||
int db_flush_extra_labor_event (dbEventCtx);
|
||||
int db_post_extra_labor (dbEventCtx ctx);
|
||||
epicsShareFunc dbEventCtx epicsShareAPI db_init_events (void);
|
||||
epicsShareFunc int epicsShareAPI db_start_events (
|
||||
dbEventCtx ctx, char *taskname, int (*init_func)(threadId),
|
||||
void *init_func_arg, int priority_offset);
|
||||
epicsShareFunc void epicsShareAPI db_close_events (dbEventCtx ctx);
|
||||
epicsShareFunc void epicsShareAPI db_event_flow_ctrl_mode_on (dbEventCtx ctx);
|
||||
epicsShareFunc void epicsShareAPI db_event_flow_ctrl_mode_off (dbEventCtx ctx);
|
||||
epicsShareFunc int epicsShareAPI db_add_overflow_event (
|
||||
dbEventCtx ctx, OVRFFUNC *overflow_sub, void *overflow_arg);
|
||||
epicsShareFunc int epicsShareAPI db_add_extra_labor_event (
|
||||
dbEventCtx ctx, EXTRALABORFUNC *func, void *arg);
|
||||
epicsShareFunc int epicsShareAPI db_flush_extra_labor_event (dbEventCtx);
|
||||
epicsShareFunc int epicsShareAPI db_post_extra_labor (dbEventCtx ctx);
|
||||
|
||||
typedef void EVENTFUNC (void *user_arg, struct dbAddr *paddr,
|
||||
int eventsRemaining, struct db_field_log *pfl);
|
||||
|
||||
typedef void * dbEventSubscription;
|
||||
dbEventSubscription db_add_event (dbEventCtx ctx, struct dbAddr *paddr,
|
||||
epicsShareFunc dbEventSubscription epicsShareAPI db_add_event (
|
||||
dbEventCtx ctx, struct dbAddr *paddr,
|
||||
EVENTFUNC *user_sub, void *user_arg, unsigned select);
|
||||
void db_cancel_event (dbEventSubscription es);
|
||||
void db_post_single_event (dbEventSubscription es);
|
||||
void db_event_enable (dbEventSubscription es);
|
||||
void db_event_disable (dbEventSubscription es);
|
||||
epicsShareFunc void epicsShareAPI db_cancel_event (dbEventSubscription es);
|
||||
epicsShareFunc void epicsShareAPI db_post_single_event (dbEventSubscription es);
|
||||
epicsShareFunc void epicsShareAPI db_event_enable (dbEventSubscription es);
|
||||
epicsShareFunc void epicsShareAPI db_event_disable (dbEventSubscription es);
|
||||
|
||||
#define DB_EVENT_OK 0
|
||||
#define DB_EVENT_ERROR (-1)
|
||||
|
||||
@@ -75,10 +75,11 @@ since this will delay all other threads.
|
||||
#include "dbStaticLib.h"
|
||||
#include "dbConvert.h"
|
||||
#include "dbCommon.h"
|
||||
#include "dbLock.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "errMdef.h"
|
||||
#define epicsExportSharedSymbols
|
||||
#include "dbLock.h"
|
||||
|
||||
#define STATIC static
|
||||
|
||||
@@ -136,21 +137,21 @@ STATIC void lockAddRecord(lockSet *plockSet,lockRecord *pnew)
|
||||
ellAdd(&plockSet->recordList,&pnew->node);
|
||||
}
|
||||
|
||||
void dbLockSetGblLock(void)
|
||||
void epicsShareAPI dbLockSetGblLock(void)
|
||||
{
|
||||
if(!lockListInitialized) initLockList();
|
||||
semMutexMustTake(globalLock);
|
||||
changingLockSets = TRUE;
|
||||
}
|
||||
|
||||
void dbLockSetGblUnlock(void)
|
||||
void epicsShareAPI dbLockSetGblUnlock(void)
|
||||
{
|
||||
changingLockSets = FALSE;
|
||||
semMutexGive(globalLock);
|
||||
return;
|
||||
}
|
||||
|
||||
void dbLockSetRecordLock(dbCommon *precord)
|
||||
void epicsShareAPI dbLockSetRecordLock(dbCommon *precord)
|
||||
{
|
||||
lockRecord *plockRecord = precord->lset;
|
||||
lockSet *plockSet;
|
||||
@@ -182,7 +183,7 @@ void dbLockSetRecordLock(dbCommon *precord)
|
||||
return;
|
||||
}
|
||||
|
||||
void dbScanLock(dbCommon *precord)
|
||||
void epicsShareAPI dbScanLock(dbCommon *precord)
|
||||
{
|
||||
lockRecord *plockRecord;
|
||||
lockSet *plockSet;
|
||||
@@ -206,7 +207,7 @@ void dbScanLock(dbCommon *precord)
|
||||
return;
|
||||
}
|
||||
|
||||
void dbScanUnlock(dbCommon *precord)
|
||||
void epicsShareAPI dbScanUnlock(dbCommon *precord)
|
||||
{
|
||||
lockRecord *plockRecord = precord->lset;
|
||||
|
||||
@@ -218,7 +219,7 @@ void dbScanUnlock(dbCommon *precord)
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned long dbLockGetLockId(dbCommon *precord)
|
||||
unsigned long epicsShareAPI dbLockGetLockId(dbCommon *precord)
|
||||
{
|
||||
lockRecord *plockRecord = precord->lset;
|
||||
lockSet *plockSet;
|
||||
@@ -229,7 +230,7 @@ unsigned long dbLockGetLockId(dbCommon *precord)
|
||||
return(plockSet->id);
|
||||
}
|
||||
|
||||
void dbLockInitRecords(dbBase *pdbbase)
|
||||
void epicsShareAPI dbLockInitRecords(dbBase *pdbbase)
|
||||
{
|
||||
int link;
|
||||
dbRecordType *pdbRecordType;
|
||||
@@ -291,7 +292,7 @@ void dbLockInitRecords(dbBase *pdbbase)
|
||||
}
|
||||
}
|
||||
|
||||
void dbLockSetMerge(dbCommon *pfirst,dbCommon *psecond)
|
||||
void epicsShareAPI dbLockSetMerge(dbCommon *pfirst,dbCommon *psecond)
|
||||
{
|
||||
lockRecord *p1lockRecord = pfirst->lset;
|
||||
lockRecord *p2lockRecord = psecond->lset;
|
||||
@@ -326,7 +327,7 @@ void dbLockSetMerge(dbCommon *pfirst,dbCommon *psecond)
|
||||
return;
|
||||
}
|
||||
|
||||
void dbLockSetSplit(dbCommon *psource)
|
||||
void epicsShareAPI dbLockSetSplit(dbCommon *psource)
|
||||
{
|
||||
lockSet *plockSet;
|
||||
lockRecord *plockRecord;
|
||||
@@ -386,7 +387,7 @@ void dbLockSetSplit(dbCommon *psource)
|
||||
}
|
||||
|
||||
extern struct dbBase *pdbbase;
|
||||
long dblsr(char *recordname,int level)
|
||||
long epicsShareAPI dblsr(char *recordname,int level)
|
||||
{
|
||||
int link;
|
||||
DBENTRY dbentry;
|
||||
|
||||
@@ -17,19 +17,25 @@ of this distribution.
|
||||
*/
|
||||
#ifndef INCdbLockh
|
||||
#define INCdbLockh
|
||||
void dbScanLock(struct dbCommon *precord);
|
||||
void dbScanUnlock(struct dbCommon *precord);
|
||||
unsigned long dbLockGetLockId(struct dbCommon *precord);
|
||||
|
||||
void dbLockInitRecords(dbBase *pdbbase);
|
||||
void dbLockSetMerge(struct dbCommon *pfirst,struct dbCommon *psecond);
|
||||
void dbLockSetSplit(struct dbCommon *psource);
|
||||
#include "shareLib.h"
|
||||
|
||||
epicsShareFunc void epicsShareAPI dbScanLock(struct dbCommon *precord);
|
||||
epicsShareFunc void epicsShareAPI dbScanUnlock(struct dbCommon *precord);
|
||||
epicsShareFunc unsigned long epicsShareAPI dbLockGetLockId(
|
||||
struct dbCommon *precord);
|
||||
|
||||
epicsShareFunc void epicsShareAPI dbLockInitRecords(dbBase *pdbbase);
|
||||
epicsShareFunc void epicsShareAPI dbLockSetMerge(
|
||||
struct dbCommon *pfirst,struct dbCommon *psecond);
|
||||
epicsShareFunc void epicsShareAPI dbLockSetSplit(struct dbCommon *psource);
|
||||
/*The following are for code that modifies lock sets*/
|
||||
void dbLockSetGblLock(void);
|
||||
void dbLockSetGblUnlock(void);
|
||||
void dbLockSetRecordLock(struct dbCommon *precord);
|
||||
epicsShareFunc void epicsShareAPI dbLockSetGblLock(void);
|
||||
epicsShareFunc void epicsShareAPI dbLockSetGblUnlock(void);
|
||||
epicsShareFunc void epicsShareAPI dbLockSetRecordLock(struct dbCommon *precord);
|
||||
|
||||
long dblsr(char *recordname,int level);/*Lock Set Report */
|
||||
/* Lock Set Report */
|
||||
epicsShareFunc long epicsShareAPI dblsr(char *recordname,int level);
|
||||
/* If recordname NULL then all records*/
|
||||
/* level = (0,1,2) (lock set state, + recordname, +DB links) */
|
||||
|
||||
|
||||
@@ -39,14 +39,22 @@
|
||||
#include "dbDefs.h"
|
||||
#include "osiSem.h"
|
||||
#include "errlog.h"
|
||||
#include "dbBase.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbStaticLib.h"
|
||||
#include "dbScan.h"
|
||||
#include "dbCommon.h"
|
||||
#include "errMdef.h"
|
||||
#include "ellLib.h"
|
||||
#include "tsStamp.h"
|
||||
#include "dbBase.h"
|
||||
#include "dbStaticLib.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "link.h"
|
||||
#include "dbScan.h"
|
||||
#include "dbCommon.h"
|
||||
#include "dbLock.h"
|
||||
#include "callback.h"
|
||||
#include "dbAddr.h"
|
||||
#include "dbAccess.h"
|
||||
#include "recGbl.h"
|
||||
#define epicsExportSharedSymbols
|
||||
#include "dbNotify.h"
|
||||
|
||||
/*NODE structure attached to ppnn field of each record in list*/
|
||||
typedef struct pnWaitNode {
|
||||
@@ -127,9 +135,10 @@ long dbPutNotify(PUTNOTIFY *ppn)
|
||||
|
||||
if(dbfType>=DBF_INLINK && dbfType<=DBF_FWDLINK) {
|
||||
/*Initialize everything in PUTNOTIFY except restart list and node*/
|
||||
callbackSetCallback(notifyCallback,&ppn->callback);
|
||||
callbackSetUser(ppn,&ppn->callback);
|
||||
callbackSetPriority(priorityLow,&ppn->callback);
|
||||
if(!ppn->callback) ppn->callback = dbCalloc(1,sizeof(CALLBACK));
|
||||
callbackSetCallback(notifyCallback,ppn->callback);
|
||||
callbackSetUser(ppn,ppn->callback);
|
||||
callbackSetPriority(priorityLow,ppn->callback);
|
||||
ppn->status = 0;
|
||||
ppn->restart = FALSE;
|
||||
ppn->callbackState = callbackNotActive;
|
||||
@@ -160,9 +169,10 @@ static long putNotify(PUTNOTIFY *ppn)
|
||||
return(S_db_Blocked);
|
||||
}
|
||||
/*Initialize everything in PUTNOTIFY except restart list and node*/
|
||||
callbackSetCallback(notifyCallback,&ppn->callback);
|
||||
callbackSetUser(ppn,&ppn->callback);
|
||||
callbackSetPriority(priorityLow,&ppn->callback);
|
||||
if(!ppn->callback) ppn->callback = dbCalloc(1,sizeof(CALLBACK));
|
||||
callbackSetCallback(notifyCallback,ppn->callback);
|
||||
callbackSetUser(ppn,ppn->callback);
|
||||
callbackSetPriority(priorityLow,ppn->callback);
|
||||
ppn->status = 0;
|
||||
ppn->restart = FALSE;
|
||||
ppn->callbackState = callbackNotActive;
|
||||
@@ -237,10 +247,10 @@ static void issueCallback(PUTNOTIFY *ppn)
|
||||
{
|
||||
notifyCancel(ppn);
|
||||
ppn->callbackState = callbackActive;
|
||||
callbackRequest(&ppn->callback);
|
||||
callbackRequest(ppn->callback);
|
||||
}
|
||||
|
||||
void dbNotifyCancel(PUTNOTIFY *ppn)
|
||||
void epicsShareAPI dbNotifyCancel(PUTNOTIFY *ppn)
|
||||
{
|
||||
struct dbCommon *precord = ppn->paddr->precord;;
|
||||
|
||||
@@ -291,12 +301,12 @@ static void notifyCancel(PUTNOTIFY *ppn)
|
||||
}
|
||||
pfirstppn->restart = TRUE;
|
||||
pfirstppn->callbackState = callbackActive;
|
||||
callbackRequest(&pfirstppn->callback);
|
||||
callbackRequest(pfirstppn->callback);
|
||||
}
|
||||
memset(&ppn->restartNode,'\0',sizeof(PNRESTARTNODE));
|
||||
}
|
||||
|
||||
void dbNotifyCompletion(struct dbCommon *precord)
|
||||
void epicsShareAPI dbNotifyCompletion(struct dbCommon *precord)
|
||||
{
|
||||
PUTNOTIFY *ppn = precord->ppn;
|
||||
PNWAITNODE *ppnnode = precord->ppnn;;
|
||||
@@ -307,7 +317,7 @@ void dbNotifyCompletion(struct dbCommon *precord)
|
||||
issueCallback(ppn);
|
||||
}
|
||||
|
||||
void dbNotifyAdd(struct dbCommon *pfrom, struct dbCommon *pto)
|
||||
void epicsShareAPI dbNotifyAdd(struct dbCommon *pfrom, struct dbCommon *pto)
|
||||
{
|
||||
PUTNOTIFY *pfromppn = pfrom->ppn;
|
||||
PUTNOTIFY *ppn=NULL;
|
||||
|
||||
26
src/db/dbNotify.h
Normal file
26
src/db/dbNotify.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/* dbNotify.h */
|
||||
/*****************************************************************
|
||||
COPYRIGHT NOTIFICATION
|
||||
*****************************************************************
|
||||
|
||||
(C) COPYRIGHT 1993 UNIVERSITY OF CHICAGO
|
||||
|
||||
This software was developed under a United States Government license
|
||||
described on the COPYRIGHT_UniversityOfChicago file included as part
|
||||
of this distribution.
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#ifndef INCdbNotifyh
|
||||
#define INCdbNotifyh
|
||||
|
||||
#include "shareLib.h"
|
||||
|
||||
/*dbNotifyAdd called by dbScanPassive and dbScanLink*/
|
||||
epicsShareFunc void epicsShareAPI dbNotifyAdd(
|
||||
struct dbCommon *pfrom,struct dbCommon *pto);
|
||||
epicsShareFunc void epicsShareAPI dbNotifyCancel(PUTNOTIFY *pputnotify);
|
||||
/*dbNotifyCompletion called by recGblFwdLink */
|
||||
epicsShareFunc void epicsShareAPI dbNotifyCompletion(struct dbCommon *precord);
|
||||
|
||||
#endif /*INCdbNotifyh*/
|
||||
@@ -51,6 +51,7 @@
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "ellLib.h"
|
||||
#include "taskwd.h"
|
||||
#include "osiSem.h"
|
||||
#include "osiInterrupt.h"
|
||||
#include "osiThread.h"
|
||||
@@ -60,18 +61,18 @@
|
||||
#include "epicsPrint.h"
|
||||
#include "dbBase.h"
|
||||
#include "dbStaticLib.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbScan.h"
|
||||
#include "taskwd.h"
|
||||
#include "dbAddr.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "link.h"
|
||||
#include "devSup.h"
|
||||
#include "callback.h"
|
||||
#include "dbBase.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbCommon.h"
|
||||
#include "dbLock.h"
|
||||
#include "devSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "dbStaticLib.h"
|
||||
#define epicsExportSharedSymbols
|
||||
#include "dbScan.h"
|
||||
|
||||
extern struct dbBase *pdbbase;
|
||||
|
||||
/* SCAN ONCE */
|
||||
int onceQueueSize = 1000;
|
||||
@@ -132,7 +133,7 @@ static void buildScanLists(void);
|
||||
static void addToList(struct dbCommon *precord,scan_list *psl);
|
||||
static void deleteFromList(struct dbCommon *precord,scan_list *psl);
|
||||
|
||||
long scanInit()
|
||||
long epicsShareAPI scanInit()
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -144,7 +145,7 @@ long scanInit()
|
||||
return(0);
|
||||
}
|
||||
|
||||
void scanAdd(struct dbCommon *precord)
|
||||
void epicsShareAPI scanAdd(struct dbCommon *precord)
|
||||
{
|
||||
short scan;
|
||||
scan_list *psl;
|
||||
@@ -233,7 +234,7 @@ void scanAdd(struct dbCommon *precord)
|
||||
return;
|
||||
}
|
||||
|
||||
void scanDelete(struct dbCommon *precord)
|
||||
void epicsShareAPI scanDelete(struct dbCommon *precord)
|
||||
{
|
||||
short scan;
|
||||
scan_list *psl = 0;
|
||||
@@ -310,7 +311,7 @@ void scanDelete(struct dbCommon *precord)
|
||||
return;
|
||||
}
|
||||
|
||||
int scanppl(double rate) /*print periodic list*/
|
||||
int epicsShareAPI scanppl(double rate) /*print periodic list*/
|
||||
{
|
||||
scan_list *psl;
|
||||
char message[80];
|
||||
@@ -326,7 +327,7 @@ int scanppl(double rate) /*print periodic list*/
|
||||
return(0);
|
||||
}
|
||||
|
||||
int scanpel(int event_number) /*print event list */
|
||||
int epicsShareAPI scanpel(int event_number) /*print event list */
|
||||
{
|
||||
char message[80];
|
||||
int priority,evnt;
|
||||
@@ -346,7 +347,7 @@ int scanpel(int event_number) /*print event list */
|
||||
return(0);
|
||||
}
|
||||
|
||||
int scanpiol() /* print io_event list */
|
||||
int epicsShareAPI scanpiol() /* print io_event list */
|
||||
{
|
||||
io_scan_list *piosl;
|
||||
int priority;
|
||||
@@ -383,7 +384,7 @@ static void initEvent(void)
|
||||
}
|
||||
}
|
||||
|
||||
void post_event(int event)
|
||||
void epicsShareAPI post_event(int event)
|
||||
{
|
||||
unsigned char evnt;
|
||||
int priority;
|
||||
@@ -403,7 +404,7 @@ void post_event(int event)
|
||||
}
|
||||
}
|
||||
|
||||
void scanIoInit(IOSCANPVT *ppioscanpvt)
|
||||
void epicsShareAPI scanIoInit(IOSCANPVT *ppioscanpvt)
|
||||
{
|
||||
io_scan_list *piosl;
|
||||
int priority;
|
||||
@@ -425,7 +426,7 @@ void scanIoInit(IOSCANPVT *ppioscanpvt)
|
||||
}
|
||||
|
||||
|
||||
void scanIoRequest(IOSCANPVT pioscanpvt)
|
||||
void epicsShareAPI scanIoRequest(IOSCANPVT pioscanpvt)
|
||||
{
|
||||
io_scan_list *piosl;
|
||||
int priority;
|
||||
@@ -437,7 +438,7 @@ void scanIoRequest(IOSCANPVT pioscanpvt)
|
||||
}
|
||||
}
|
||||
|
||||
void scanOnce(void *precord)
|
||||
void epicsShareAPI scanOnce(void *precord)
|
||||
{
|
||||
static int newOverflow=TRUE;
|
||||
int lockKey;
|
||||
@@ -474,7 +475,7 @@ static void onceTask(void)
|
||||
}
|
||||
}
|
||||
|
||||
int scanOnceSetQueueSize(int size)
|
||||
int epicsShareAPI scanOnceSetQueueSize(int size)
|
||||
{
|
||||
onceQueueSize = size;
|
||||
return(0);
|
||||
|
||||
@@ -2,38 +2,19 @@
|
||||
*
|
||||
* Author: Marty Kraimer
|
||||
* Date: 07-17-91
|
||||
*
|
||||
* Experimental Physics and Industrial Control System (EPICS)
|
||||
*
|
||||
* Copyright 1991, the Regents of the University of California,
|
||||
* and the University of Chicago Board of Governors.
|
||||
*
|
||||
* This software was produced under U.S. Government contracts:
|
||||
* (W-7405-ENG-36) at the Los Alamos National Laboratory,
|
||||
* and (W-31-109-ENG-38) at Argonne National Laboratory.
|
||||
*
|
||||
* Initial development by:
|
||||
* The Controls and Automation Group (AT-8)
|
||||
* Ground Test Accelerator
|
||||
* Accelerator Technology Division
|
||||
* Los Alamos National Laboratory
|
||||
*
|
||||
* Co-developed with
|
||||
* The Controls and Computing Group
|
||||
* Accelerator Systems Division
|
||||
* Advanced Photon Source
|
||||
* Argonne National Laboratory
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 mm-dd-yy mrk Initial version
|
||||
*/
|
||||
|
||||
|
||||
/********************COPYRIGHT NOTIFICATION**********************************
|
||||
This software was developed under a United States Government license
|
||||
described on the COPYRIGHT_UniversityOfChicago file included as part
|
||||
of this distribution.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef INCdbScanh
|
||||
#define INCdbScanh 1
|
||||
#include <ellLib.h>
|
||||
#include <dbAccess.h>
|
||||
#include <callback.h>
|
||||
|
||||
#include "shareLib.h"
|
||||
|
||||
/* Note that these must match the first three definitions in choiceGbl.ascii*/
|
||||
#define SCAN_PASSIVE 0
|
||||
#define SCAN_EVENT 1
|
||||
@@ -44,28 +25,19 @@
|
||||
typedef void * IOSCANPVT;
|
||||
extern volatile int interruptAccept;
|
||||
|
||||
#ifdef __STDC__
|
||||
long scanInit(void);
|
||||
void post_event(int event);
|
||||
void scanAdd(struct dbCommon *);
|
||||
void scanDelete(struct dbCommon *);
|
||||
void scanOnce(void *precord);
|
||||
int scanOnceSetQueueSize(int size);
|
||||
int scanppl(double rate); /*print periodic lists*/
|
||||
int scanpel(int event_number); /*print event lists*/
|
||||
int scanpiol(void); /*print io_event list*/
|
||||
void scanIoInit(IOSCANPVT *);
|
||||
void scanIoRequest(IOSCANPVT);
|
||||
epicsShareFunc long epicsShareAPI scanInit(void);
|
||||
epicsShareFunc void epicsShareAPI post_event(int event);
|
||||
epicsShareFunc void epicsShareAPI scanAdd(struct dbCommon *);
|
||||
epicsShareFunc void epicsShareAPI scanDelete(struct dbCommon *);
|
||||
epicsShareFunc void epicsShareAPI scanOnce(void *precord);
|
||||
epicsShareFunc int epicsShareAPI scanOnceSetQueueSize(int size);
|
||||
/*print periodic lists*/
|
||||
epicsShareFunc int epicsShareAPI scanppl(double rate);
|
||||
/*print event lists*/
|
||||
epicsShareFunc int epicsShareAPI scanpel(int event_number);
|
||||
/*print io_event list*/
|
||||
epicsShareFunc int epicsShareAPI scanpiol(void);
|
||||
epicsShareFunc void epicsShareAPI scanIoInit(IOSCANPVT *);
|
||||
epicsShareFunc void epicsShareAPI scanIoRequest(IOSCANPVT);
|
||||
|
||||
#else
|
||||
long scanInit();
|
||||
void post_event();
|
||||
void scanAdd();
|
||||
void scanDelete();
|
||||
void scanppl();
|
||||
void scanpel();
|
||||
void scanpiol();
|
||||
void scanIoInit();
|
||||
void scanIoRequest();
|
||||
#endif /*__STDC__*/
|
||||
#endif
|
||||
|
||||
@@ -1,62 +1,17 @@
|
||||
/* dbTest.c */
|
||||
/* base/src/db $Id$ */
|
||||
/* database access test subroutines */
|
||||
/*
|
||||
* Original Author: Bob Dalesio
|
||||
* Current Author: Marty Kraimer
|
||||
* Date: 11-7-90
|
||||
*
|
||||
* Experimental Physics and Industrial Control System (EPICS)
|
||||
*
|
||||
* Copyright 1991, the Regents of the University of California,
|
||||
* and the University of Chicago Board of Governors.
|
||||
*
|
||||
* This software was produced under U.S. Government contracts:
|
||||
* (W-7405-ENG-36) at the Los Alamos National Laboratory,
|
||||
* and (W-31-109-ENG-38) at Argonne National Laboratory.
|
||||
*
|
||||
* Initial development by:
|
||||
* The Controls and Automation Group (AT-8)
|
||||
* Ground Test Accelerator
|
||||
* Accelerator Technology Division
|
||||
* Los Alamos National Laboratory
|
||||
*
|
||||
* Co-developed with
|
||||
* The Controls and Computing Group
|
||||
* Accelerator Systems Division
|
||||
* Advanced Photon Source
|
||||
* Argonne National Laboratory
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 08-13-91 mrk Added extra NULL arg to dbGetField calls
|
||||
* .02 10-23-91 mrk Changed dbior so it also reports device support
|
||||
* .03 11-26-91 jba Fixed initializations and added hex print to printBuffer
|
||||
* .04 02-05-92 jba Changed function arguments from paddr to precord
|
||||
* .05 02-28-92 jba ANSI C changes
|
||||
* .06 04-17-92 rcz removed dbPvd for mrk
|
||||
* .07 05-19-92 mrk Mods for changes to internal database structures
|
||||
* .08 07-21-92 jba ansi c changes
|
||||
* .09 09-24-93 jbk adjusted dbpr to print vxi links correctly
|
||||
* .10 02-02-94 mrk added dbtpn (test dbPutNotify)
|
||||
* .11 03-18-94 mcn added dbgrep and timing routines.
|
||||
* .12 08-14-95 mrk Moved dbtpn to dbNotify
|
||||
*/
|
||||
|
||||
/* Global Database Test Routines - All can be invoked via vxWorks shell*/
|
||||
long dba(char*pname); /*dbAddr info */
|
||||
long dbl(char *precordTypename,char *filename,char *fields); /*list records*/
|
||||
long dbnr(int verbose); /*list number of records of each type*/
|
||||
long dbgrep(char *pmask); /*list records with mask*/
|
||||
long dbgf(char *pname); /*get field value*/
|
||||
long dbpf(char *pname,char *pvalue); /*put field value*/
|
||||
long dbpr(char *pname,int interest_level); /*print record*/
|
||||
long dbtr(char *pname); /*test record*/
|
||||
long dbtgf(char *pname); /*test get field*/
|
||||
long dbtpf(char *pname,char *pvalue); /*test put field*/
|
||||
long dbior(char *pdrvName,int type); /*I/O report */
|
||||
int dbhcr(char *filename); /*Hardware Configuration Report*/
|
||||
|
||||
/*****************************************************************
|
||||
COPYRIGHT NOTIFICATION
|
||||
*****************************************************************
|
||||
|
||||
(C) COPYRIGHT 1993 UNIVERSITY OF CHICAGO
|
||||
|
||||
This software was developed under a United States Government license
|
||||
described on the COPYRIGHT_UniversityOfChicago file included as part
|
||||
of this distribution.
|
||||
**********************************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
@@ -80,9 +35,10 @@ int dbhcr(char *filename); /*Hardware Configuration Report*/
|
||||
#include "dbEvent.h"
|
||||
#include "ellLib.h"
|
||||
#include "callback.h"
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "dbTest.h"
|
||||
|
||||
extern struct dbBase *pdbbase;
|
||||
|
||||
#define MAXLINE 80
|
||||
struct msgBuff { /* line output structure */
|
||||
char out_buff[MAXLINE + 1];
|
||||
@@ -109,7 +65,7 @@ static void dbpr_init_msg(TAB_BUFFER *pMsgBuff,int tab_size);
|
||||
static void dbpr_insert_msg(TAB_BUFFER *pMsgBuff,int len,int tab_size);
|
||||
static void dbpr_msg_flush(TAB_BUFFER *pMsgBuff,int tab_size);
|
||||
|
||||
long dba(char*pname)
|
||||
long epicsShareAPI dba(char*pname)
|
||||
{
|
||||
DBADDR addr;
|
||||
long status;
|
||||
@@ -119,7 +75,7 @@ long dba(char*pname)
|
||||
return(status);
|
||||
}
|
||||
|
||||
long dbl(char *precordTypename,char *filename,char *fields)
|
||||
long epicsShareAPI dbl(char *precordTypename,char *filename,char *fields)
|
||||
{
|
||||
DBENTRY dbentry;
|
||||
DBENTRY *pdbentry=&dbentry;
|
||||
@@ -205,7 +161,7 @@ long dbl(char *precordTypename,char *filename,char *fields)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dbnr(int verbose)
|
||||
long epicsShareAPI dbnr(int verbose)
|
||||
{
|
||||
DBENTRY dbentry;
|
||||
DBENTRY *pdbentry=&dbentry;
|
||||
@@ -275,7 +231,7 @@ static int specified_by(char *ptest, char *pspec)
|
||||
}
|
||||
}
|
||||
|
||||
long dbgrep(char *pmask)
|
||||
long epicsShareAPI dbgrep(char *pmask)
|
||||
{
|
||||
DBENTRY dbentry;
|
||||
DBENTRY *pdbentry=&dbentry;
|
||||
@@ -297,7 +253,7 @@ long dbgrep(char *pmask)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dbgf(char *pname)
|
||||
long epicsShareAPI dbgf(char *pname)
|
||||
{
|
||||
/* declare buffer long just to ensure correct alignment */
|
||||
long buffer[100];
|
||||
@@ -334,7 +290,7 @@ long dbgf(char *pname)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dbpf(char *pname,char *pvalue)
|
||||
long epicsShareAPI dbpf(char *pname,char *pvalue)
|
||||
{
|
||||
/* declare buffer long just to ensure correct alignment */
|
||||
DBADDR addr;
|
||||
@@ -369,7 +325,7 @@ long dbpf(char *pname,char *pvalue)
|
||||
return(status);
|
||||
}
|
||||
|
||||
long dbpr(char *pname,int interest_level)
|
||||
long epicsShareAPI dbpr(char *pname,int interest_level)
|
||||
{
|
||||
static TAB_BUFFER msg_Buff;
|
||||
TAB_BUFFER *pMsgBuff = &msg_Buff;
|
||||
@@ -393,7 +349,7 @@ long dbpr(char *pname,int interest_level)
|
||||
return (0);
|
||||
}
|
||||
|
||||
long dbtr(char *pname)
|
||||
long epicsShareAPI dbtr(char *pname)
|
||||
{
|
||||
DBADDR addr;
|
||||
long status;
|
||||
@@ -421,7 +377,7 @@ long dbtr(char *pname)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dbtgf(char *pname)
|
||||
long epicsShareAPI dbtgf(char *pname)
|
||||
{
|
||||
/* declare buffer long just to ensure correct alignment */
|
||||
long buffer[400];
|
||||
@@ -496,7 +452,7 @@ long dbtgf(char *pname)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dbtpf(char *pname,char *pvalue)
|
||||
long epicsShareAPI dbtpf(char *pname,char *pvalue)
|
||||
{
|
||||
/* declare buffer long just to ensure correct alignment */
|
||||
long buffer[100];
|
||||
@@ -661,7 +617,7 @@ long dbtpf(char *pname,char *pvalue)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dbior(char *pdrvName,int type)
|
||||
long epicsShareAPI dbior(char *pdrvName,int type)
|
||||
{
|
||||
char *pname;
|
||||
drvSup *pdrvSup;
|
||||
@@ -704,7 +660,7 @@ long dbior(char *pdrvName,int type)
|
||||
return(0);
|
||||
}
|
||||
|
||||
int dbhcr(char *filename)
|
||||
int epicsShareAPI dbhcr(char *filename)
|
||||
{
|
||||
FILE *stream = NULL;
|
||||
int isStdout = TRUE;
|
||||
|
||||
44
src/db/dbTest.h
Normal file
44
src/db/dbTest.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/* dbTest.h */
|
||||
|
||||
/* Author: Marty Kraimer Date: 25FEB2000 */
|
||||
/*****************************************************************
|
||||
COPYRIGHT NOTIFICATION
|
||||
*****************************************************************
|
||||
|
||||
(C) COPYRIGHT 1993 UNIVERSITY OF CHICAGO
|
||||
|
||||
This software was developed under a United States Government license
|
||||
described on the COPYRIGHT_UniversityOfChicago file included as part
|
||||
of this distribution.
|
||||
**********************************************************************/
|
||||
#ifndef INCdbTesth
|
||||
#define INCdbTesth 1
|
||||
|
||||
#include "shareLib.h"
|
||||
|
||||
/*dbAddr info */
|
||||
epicsShareFunc long epicsShareAPI dba(char*pname);
|
||||
/*list records*/
|
||||
epicsShareFunc long epicsShareAPI dbl(char *precordTypename,char *filename,char *fields);
|
||||
/*list number of records of each type*/
|
||||
epicsShareFunc long epicsShareAPI dbnr(int verbose);
|
||||
/*list records with mask*/
|
||||
epicsShareFunc long epicsShareAPI dbgrep(char *pmask);
|
||||
/*get field value*/
|
||||
epicsShareFunc long epicsShareAPI dbgf(char *pname);
|
||||
/*put field value*/
|
||||
epicsShareFunc long epicsShareAPI dbpf(char *pname,char *pvalue);
|
||||
/*print record*/
|
||||
epicsShareFunc long epicsShareAPI dbpr(char *pname,int interest_level);
|
||||
/*test record*/
|
||||
epicsShareFunc long epicsShareAPI dbtr(char *pname);
|
||||
/*test get field*/
|
||||
epicsShareFunc long epicsShareAPI dbtgf(char *pname);
|
||||
/*test put field*/
|
||||
epicsShareFunc long epicsShareAPI dbtpf(char *pname,char *pvalue);
|
||||
/*I/O report */
|
||||
epicsShareFunc long dbior(char *pdrvName,int type);
|
||||
/*Hardware Configuration Report*/
|
||||
epicsShareFunc int dbhcr(char *filename);
|
||||
|
||||
#endif /*INCdbTesth */
|
||||
@@ -97,7 +97,6 @@ extern "C" {
|
||||
|
||||
#include "epicsTypes.h"
|
||||
#include "tsStamp.h"
|
||||
#include "callback.h"
|
||||
#include "ellLib.h"
|
||||
#include "dbAddr.h"
|
||||
|
||||
|
||||
@@ -40,8 +40,10 @@ of this distribution.
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "dbCommon.h"
|
||||
#include "shareLib.h"
|
||||
#include "dbCaPvt.h"
|
||||
epicsShareExtern struct dbBase *pdbbase;
|
||||
#include "dbCa.h"
|
||||
extern struct dbBase *pdbbase;
|
||||
|
||||
long dbcar(char *precordname,int level)
|
||||
{
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <dbDefs.h>
|
||||
|
||||
#include "ellLib.h"
|
||||
#define epicsExportSharedSymbols
|
||||
#include "initHooks.h"
|
||||
|
||||
typedef struct initHookLink {
|
||||
@@ -62,7 +63,7 @@ static void initFunctionList(void)
|
||||
/*
|
||||
* To be called before iocInit reaches state desired.
|
||||
*/
|
||||
int initHookRegister(initHookFunction func)
|
||||
int epicsShareAPI initHookRegister(initHookFunction func)
|
||||
{
|
||||
initHookLink *newHook;
|
||||
|
||||
@@ -82,7 +83,7 @@ int initHookRegister(initHookFunction func)
|
||||
* Called by iocInit at various points during initialization.
|
||||
* Do not call this function from any other function than iocInit.
|
||||
*/
|
||||
void initHooks(initHookState state)
|
||||
void epicsShareAPI initHooks(initHookState state)
|
||||
{
|
||||
initHookLink *hook;
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
#ifndef INCinitHooksh
|
||||
#define INCinitHooksh 1
|
||||
|
||||
#include "shareLib.h"
|
||||
|
||||
typedef enum {
|
||||
initHookAtBeginning,
|
||||
initHookAfterCallbackInit,
|
||||
@@ -56,15 +58,9 @@ typedef enum {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __STDC__
|
||||
typedef void (*initHookFunction)(initHookState state);
|
||||
int initHookRegister(initHookFunction func);
|
||||
void initHooks(initHookState state);
|
||||
#else /*__STDC__*/
|
||||
typedef void (*initHookFunction)();
|
||||
int initHookRegister();
|
||||
void initHooks();
|
||||
#endif /*__STDC__*/
|
||||
epicsShareFunc int epicsShareAPI initHookRegister(initHookFunction func);
|
||||
epicsShareFunc void epicsShareAPI initHooks(initHookState state);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -48,17 +48,26 @@
|
||||
#include <limits.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "osiThread.h"
|
||||
#include "tsStamp.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "dbBase.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "link.h"
|
||||
#include "dbAddr.h"
|
||||
#include "dbAccess.h"
|
||||
#include "db_field_log.h"
|
||||
#include "dbNotify.h"
|
||||
#include "dbCa.h"
|
||||
#include "dbEvent.h"
|
||||
#include "errlog.h"
|
||||
#include "dbConvert.h"
|
||||
#include "dbScan.h"
|
||||
#include "devSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "dbCommon.h"
|
||||
#include "caeventmask.h"
|
||||
#define epicsExportSharedSymbols
|
||||
#include "recGbl.h"
|
||||
|
||||
|
||||
/* local routines */
|
||||
@@ -66,7 +75,8 @@ static void getMaxRangeValues();
|
||||
|
||||
|
||||
|
||||
void recGblDbaddrError(long status,struct dbAddr *paddr,char *pcaller_name)
|
||||
void epicsShareAPI recGblDbaddrError(
|
||||
long status,struct dbAddr *paddr,char *pcaller_name)
|
||||
{
|
||||
char buffer[200];
|
||||
struct dbCommon *precord;
|
||||
@@ -89,7 +99,7 @@ void recGblDbaddrError(long status,struct dbAddr *paddr,char *pcaller_name)
|
||||
return;
|
||||
}
|
||||
|
||||
void recGblRecordError(long status,void *pdbc,char *pcaller_name)
|
||||
void epicsShareAPI recGblRecordError(long status,void *pdbc,char *pcaller_name)
|
||||
{
|
||||
struct dbCommon *precord = pdbc;
|
||||
char buffer[200];
|
||||
@@ -107,8 +117,9 @@ void recGblRecordError(long status,void *pdbc,char *pcaller_name)
|
||||
return;
|
||||
}
|
||||
|
||||
void recGblRecSupError(long status,struct dbAddr *paddr,char *pcaller_name,
|
||||
char *psupport_name)
|
||||
void epicsShareAPI recGblRecSupError(
|
||||
long status,struct dbAddr *paddr,char *pcaller_name,
|
||||
char *psupport_name)
|
||||
{
|
||||
char buffer[200];
|
||||
struct dbCommon *precord;
|
||||
@@ -144,7 +155,7 @@ void recGblRecSupError(long status,struct dbAddr *paddr,char *pcaller_name,
|
||||
return;
|
||||
}
|
||||
|
||||
void recGblGetPrec(struct dbAddr *paddr,long *precision)
|
||||
void epicsShareAPI recGblGetPrec(struct dbAddr *paddr,long *precision)
|
||||
{
|
||||
dbFldDes *pdbFldDes=(dbFldDes *)(paddr->pfldDes);
|
||||
|
||||
@@ -171,7 +182,8 @@ void recGblGetPrec(struct dbAddr *paddr,long *precision)
|
||||
return;
|
||||
}
|
||||
|
||||
void recGblGetGraphicDouble(struct dbAddr *paddr,struct dbr_grDouble *pgd)
|
||||
void epicsShareAPI recGblGetGraphicDouble(
|
||||
struct dbAddr *paddr,struct dbr_grDouble *pgd)
|
||||
{
|
||||
dbFldDes *pdbFldDes=(dbFldDes *)(paddr->pfldDes);
|
||||
|
||||
@@ -181,7 +193,8 @@ void recGblGetGraphicDouble(struct dbAddr *paddr,struct dbr_grDouble *pgd)
|
||||
return;
|
||||
}
|
||||
|
||||
void recGblGetAlarmDouble(struct dbAddr *paddr,struct dbr_alDouble *pad)
|
||||
void epicsShareAPI recGblGetAlarmDouble(
|
||||
struct dbAddr *paddr,struct dbr_alDouble *pad)
|
||||
{
|
||||
pad->upper_alarm_limit = 0;
|
||||
pad->upper_warning_limit = 0;
|
||||
@@ -191,7 +204,8 @@ void recGblGetAlarmDouble(struct dbAddr *paddr,struct dbr_alDouble *pad)
|
||||
return;
|
||||
}
|
||||
|
||||
void recGblGetControlDouble(struct dbAddr *paddr,struct dbr_ctrlDouble *pcd)
|
||||
void epicsShareAPI recGblGetControlDouble(
|
||||
struct dbAddr *paddr,struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
dbFldDes *pdbFldDes=(dbFldDes *)(paddr->pfldDes);
|
||||
|
||||
@@ -201,7 +215,8 @@ void recGblGetControlDouble(struct dbAddr *paddr,struct dbr_ctrlDouble *pcd)
|
||||
return;
|
||||
}
|
||||
|
||||
int recGblInitConstantLink(struct link *plink,short dbftype,void *pdest)
|
||||
int epicsShareAPI recGblInitConstantLink(
|
||||
struct link *plink,short dbftype,void *pdest)
|
||||
{
|
||||
if(plink->type != CONSTANT) return(FALSE);
|
||||
if(!plink->value.constantStr) return(FALSE);
|
||||
@@ -253,7 +268,7 @@ int recGblInitConstantLink(struct link *plink,short dbftype,void *pdest)
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
unsigned short recGblResetAlarms(void *precord)
|
||||
unsigned short epicsShareAPI recGblResetAlarms(void *precord)
|
||||
{
|
||||
struct dbCommon *pdbc = precord;
|
||||
unsigned short mask,stat,sevr,nsta,nsev,ackt,acks;
|
||||
@@ -282,7 +297,7 @@ unsigned short recGblResetAlarms(void *precord)
|
||||
return(mask);
|
||||
}
|
||||
|
||||
void recGblFwdLink(void *precord)
|
||||
void epicsShareAPI recGblFwdLink(void *precord)
|
||||
{
|
||||
struct dbCommon *pdbc = precord;
|
||||
static short fwdLinkValue = 1;
|
||||
@@ -307,7 +322,7 @@ void recGblFwdLink(void *precord)
|
||||
}
|
||||
|
||||
|
||||
void recGblGetTimeStamp(void* prec)
|
||||
void epicsShareAPI recGblGetTimeStamp(void* prec)
|
||||
{
|
||||
struct dbCommon* pr = (struct dbCommon*)prec;
|
||||
int status;
|
||||
|
||||
@@ -32,21 +32,8 @@
|
||||
#define INCrecGblh 1
|
||||
|
||||
|
||||
#include <dbCommon.h>
|
||||
#include "shareLib.h"
|
||||
|
||||
/*
|
||||
* One ABSOLUTELY must include dbAccess.h before the
|
||||
* definitions in this file
|
||||
*/
|
||||
|
||||
#ifndef INCdbAccessh
|
||||
#include <dbAccess.h>
|
||||
#endif
|
||||
#ifndef INCalarmh
|
||||
#include <alarm.h>
|
||||
#endif
|
||||
#include <dbFldTypes.h>
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
#define recGblSetSevr(PREC,NSTA,NSEV) \
|
||||
@@ -58,15 +45,23 @@
|
||||
|
||||
|
||||
/* Global Record Support Routines*/
|
||||
void recGblDbaddrError(long status, struct dbAddr *paddr, char *pcaller_name);
|
||||
void recGblRecordError(long status, void *precord, char *pcaller_name);
|
||||
void recGblRecSupError(long status, struct dbAddr *paddr, char *pcaller_name, char *psupport_name);
|
||||
void recGblGetGraphicDouble(struct dbAddr *paddr, struct dbr_grDouble *pgd);
|
||||
void recGblGetControlDouble(struct dbAddr *paddr, struct dbr_ctrlDouble *pcd);
|
||||
void recGblGetAlarmDouble(struct dbAddr *paddr, struct dbr_alDouble *pad);
|
||||
void recGblGetPrec(struct dbAddr *paddr, long *pprecision);
|
||||
int recGblInitConstantLink(struct link *plink,short dbftype,void *pdest);
|
||||
unsigned short recGblResetAlarms(void *precord);
|
||||
void recGblFwdLink(void *precord);
|
||||
void recGblGetTimeStamp(void *precord);
|
||||
epicsShareFunc void epicsShareAPI recGblDbaddrError(
|
||||
long status, struct dbAddr *paddr, char *pcaller_name);
|
||||
epicsShareFunc void epicsShareAPI recGblRecordError(
|
||||
long status, void *precord, char *pcaller_name);
|
||||
epicsShareFunc void epicsShareAPI recGblRecSupError(
|
||||
long status, struct dbAddr *paddr, char *pcaller_name, char *psupport_name);
|
||||
epicsShareFunc void epicsShareAPI recGblGetGraphicDouble(
|
||||
struct dbAddr *paddr, struct dbr_grDouble *pgd);
|
||||
epicsShareFunc void epicsShareAPI recGblGetControlDouble(
|
||||
struct dbAddr *paddr, struct dbr_ctrlDouble *pcd);
|
||||
epicsShareFunc void epicsShareAPI recGblGetAlarmDouble(
|
||||
struct dbAddr *paddr, struct dbr_alDouble *pad);
|
||||
epicsShareFunc void epicsShareAPI recGblGetPrec(
|
||||
struct dbAddr *paddr, long *pprecision);
|
||||
epicsShareFunc int epicsShareAPI recGblInitConstantLink(
|
||||
struct link *plink,short dbftype,void *pdest);
|
||||
epicsShareFunc unsigned short epicsShareAPI recGblResetAlarms(void *precord);
|
||||
epicsShareFunc void epicsShareAPI recGblFwdLink(void *precord);
|
||||
epicsShareFunc void epicsShareAPI recGblGetTimeStamp(void *precord);
|
||||
#endif /*INCrecGblh*/
|
||||
|
||||
@@ -67,7 +67,7 @@ void callbackTest(void)
|
||||
tsStampGetCurrent(&start);
|
||||
wait[i]->start = start;
|
||||
wait[i]->requestedDiff = (double)i;
|
||||
callbackRequest(&wait[i]->callback);
|
||||
callbackRequestDelayed(&wait[i]->callback,wait[i]->requestedDiff);
|
||||
}
|
||||
threadSleep((double)(ncallbacks + 2));
|
||||
printf("callbackTest returning\n");
|
||||
|
||||
Reference in New Issue
Block a user