From 95dfd8a179e4d183ad24ead90c34ccde5dbc9b9a Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Thu, 24 Feb 2000 20:33:42 +0000 Subject: [PATCH] moved from libCom/misc --- src/dbStatic/Makefile | 3 ++ src/dbStatic/dbStaticRun.c | 1 - src/dbStatic/devSup.h | 66 +++++++++++++++++++++++ src/dbStatic/drvSup.h | 51 ++++++++++++++++++ src/dbStatic/recSup.h | 105 +++++++++++++++++++++++++++++++++++++ 5 files changed, 225 insertions(+), 1 deletion(-) create mode 100644 src/dbStatic/devSup.h create mode 100644 src/dbStatic/drvSup.h create mode 100644 src/dbStatic/recSup.h diff --git a/src/dbStatic/Makefile b/src/dbStatic/Makefile index e03729c59..027bf9568 100644 --- a/src/dbStatic/Makefile +++ b/src/dbStatic/Makefile @@ -10,6 +10,9 @@ INC += dbStaticLib.h INC += link.h INC += special.h INC += guigroup.h +INC += devSup.h +INC += drvSup.h +INC += recSup.h LIBSRCS += dbStaticLib.c LIBSRCS += dbYacc.c diff --git a/src/dbStatic/dbStaticRun.c b/src/dbStatic/dbStaticRun.c index 3c52d79f9..aac6656a6 100644 --- a/src/dbStatic/dbStaticRun.c +++ b/src/dbStatic/dbStaticRun.c @@ -24,7 +24,6 @@ of this distribution. #include "dbDefs.h" #include "errMdef.h" -#include "registryRecordType.h" #include "epicsPrint.h" #include "ellLib.h" #include "cvtFast.h" diff --git a/src/dbStatic/devSup.h b/src/dbStatic/devSup.h new file mode 100644 index 000000000..b68f96b87 --- /dev/null +++ b/src/dbStatic/devSup.h @@ -0,0 +1,66 @@ +/* devSup.h Device Support */ +/* share/epicsH $Id$ */ +/* + * Author: Marty Kraimer + * Date: 6-1-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 10-04-91 jba Added error message + * .02 05-18-92 rcz Changed macro "GET_DEVSUP(" to "GET_PDEVSUP(precDevSup," + * .03 05-18-92 rcz Structure devSup changed element name from dsetName to papDsetName + * .04 05-18-92 rcz New database access + */ + +#ifndef INCdevSuph +#define INCdevSuph 1 + +#ifdef __cplusplus +typedef long (*DEVSUPFUN)(void*); /* ptr to device support function*/ +#else +typedef long (*DEVSUPFUN)(); /* ptr to device support function*/ +#endif + +struct dset { /* device support entry table */ + long number; /*number of support routines*/ + DEVSUPFUN report; /*print report*/ + DEVSUPFUN init; /*init support*/ + DEVSUPFUN init_record; /*init support for particular record*/ + DEVSUPFUN get_ioint_info; /* get io interrupt information*/ + /*other functions are record dependent*/ + }; + +#define S_dev_noDevSup (M_devSup| 1) /*SDR_DEVSUP: Device support missing*/ +#define S_dev_noDSET (M_devSup| 3) /*Missing device support entry table*/ +#define S_dev_missingSup (M_devSup| 5) /*Missing device support routine*/ +#define S_dev_badInpType (M_devSup| 7) /*Bad INP link type*/ +#define S_dev_badOutType (M_devSup| 9) /*Bad OUT link type*/ +#define S_dev_badInitRet (M_devSup|11) /*Bad init_rec return value */ +#define S_dev_badBus (M_devSup|13) /*Illegal bus type*/ +#define S_dev_badCard (M_devSup|15) /*Illegal or nonexistant module*/ +#define S_dev_badSignal (M_devSup|17) /*Illegal signal*/ +#define S_dev_NoInit (M_devSup|19) /*No init*/ +#define S_dev_Conflict (M_devSup|21) /*Multiple records accessing same signal*/ + +#endif diff --git a/src/dbStatic/drvSup.h b/src/dbStatic/drvSup.h new file mode 100644 index 000000000..6c344ea32 --- /dev/null +++ b/src/dbStatic/drvSup.h @@ -0,0 +1,51 @@ +/* drvSup.h Driver Support */ +/* share/epicsH $Id$ */ + +/* + * Author: Marty Kraimer + * Date: 6-1-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 05-21-92 rcz changed drvetName to papDrvName + * .02 05-18-92 rcz New database access (removed extern) + */ + +#ifndef INCdrvSuph +#define INCdrvSuph 1 + +typedef long (*DRVSUPFUN) (); /* ptr to driver support function*/ + +struct drvet { /* driver entry table */ + long number; /*number of support routines*/ + DRVSUPFUN report; /*print report*/ + DRVSUPFUN init; /*init support*/ + /*other functions are device dependent*/ + }; +#define DRVETNUMBER ( (sizeof(struct drvet) -sizeof(long))/sizeof(DRVSUPFUN) ) + +#define S_drv_noDrvSup (M_drvSup| 1) /*SDR_DRVSUP: Driver support missing*/ +#define S_drv_noDrvet (M_drvSup| 3) /*Missing driver support entry table*/ + +#endif diff --git a/src/dbStatic/recSup.h b/src/dbStatic/recSup.h new file mode 100644 index 000000000..f8e7abe7e --- /dev/null +++ b/src/dbStatic/recSup.h @@ -0,0 +1,105 @@ +/* recSup.h + * Record Support + * Author: Marty Kraimer + * Date: 6-1-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 11-11-91 jba Added include dbCommon.h,recGblSetSevr,recGblResetSevr + * .02 12-18-91 jba Changed caddr_t to void * + * .03 03-04-92 jba Added include for dbAccess.h + * .04 05-18-92 rcz removed extern + * .05 05-18-92 rcz Changed macro "GET_PRSET(" to "GET_PRSET(precSup," + * .06 05-18-92 rcz New database access (removed extern) + * .07 07-16-92 jba Added macro recGblFwdLink + * .08 07-16-92 jba changed VALID_ALARM to INVALID_ALARM + * .09 08-10-92 jba added #defines for SIMM processing + * .10 08-11-92 jba added DB_INTEREST masks + * .11 08-13-92 jba added prototype for recGblGetAlarmDouble, + * .12 08-14-92 jba added prototypes recGblGetLinkValue,recGblPutLinkValue + * .13 09-15-92 jba added vxWorks ifdef + * .14 -7-27-93 mrk remove recGblResetSevr add recGblResetAlarms + * .15 03-18-94 mcn added fast link macros and prototypes + * .16 06-13-95 mrk moved recGbl defs to recGbl.h + */ + +#ifndef INCrecSuph +#define INCrecSuph 1 +typedef long (*RECSUPFUN) (); /* ptr to record support function*/ + +struct rset { /* record support entry table */ + long number; /*number of support routines */ + RECSUPFUN report; /*print report */ + RECSUPFUN init; /*init support */ + RECSUPFUN init_record; /*init record */ + RECSUPFUN process; /*process record */ + RECSUPFUN special; /*special processing */ + RECSUPFUN get_value; /*get value field */ + RECSUPFUN cvt_dbaddr; /*cvt dbAddr */ + RECSUPFUN get_array_info; + RECSUPFUN put_array_info; + RECSUPFUN get_units; + RECSUPFUN get_precision; + RECSUPFUN get_enum_str; /*get string from enum item*/ + RECSUPFUN get_enum_strs; /*get all enum strings */ + RECSUPFUN put_enum_str; /*put string from enum item*/ + RECSUPFUN get_graphic_double; + RECSUPFUN get_control_double; + RECSUPFUN get_alarm_double; + }; +#define RSETNUMBER ( (sizeof(struct rset) - sizeof(long))/sizeof(RECSUPFUN) ) + +#define S_rec_noRSET (M_recSup| 1) /*Missing record support entry table*/ +#define S_rec_noSizeOffset (M_recSup| 2) /*Missing SizeOffset Routine*/ +#define S_rec_outMem (M_recSup| 3) /*Out of Memory*/ + + +/* Definition os structure for routine get_value */ + +struct valueDes { + long field_type; + long no_elements; + void * pvalue; +}; + +/************************************************************************ + * report(FILE fp,void *precord); + * init(); + * init_record(precord,pass); + * process(void *precord); + * special(struct dbAddr *paddr, after); + * get_value(precord,struct valueDes *p); + * cvt_dbaddr(struct dbAddr *paddr); + * get_array_info(paddr,long *no_elements,long *offset); + * put_array_info(paddr,nNew); + * get_units(paddr,char units[8]); + * get_precision(struct dbAddr *paddr,long *precision); + * get_enum_str(paddr,pbuffer); + * get_enum_strs(paddr,struct dbr_enumStrs *p); + * put_enum_str(paddr,pbuffer); + * get_graphic_double(paddr,struct dbr_grDouble *p); + * get_control_double(paddr,struct dbr_ctrlDouble *p); + * get_alarm_double(paddr,struct dbr_ctrlDouble *p); + ***********************************************************************/ +#endif /*INCrecSuph*/