24 #include "dbAccessDefs.h" 26 #include "dbConvertFast.h" 46 static lset lnkState_lset;
74 static void lnkState_free(
jlink *pjlink)
82 static jlif_result lnkState_string(
jlink *pjlink,
const char *
val,
size_t len)
86 if (len > 1 &&
val[0] ==
'!') {
95 static struct lset* lnkState_get_lset(
const jlink *pjlink)
97 return &lnkState_lset;
100 static void lnkState_report(
const jlink *pjlink,
int level,
int indent)
104 printf(
"%*s'state': \"%s\" = %s%s\n", indent,
"",
105 slink->
name, slink->
invert ?
"! " :
"", slink->
val ?
"TRUE" :
"FALSE");
110 static void lnkState_open(
struct link *plink)
115 slink->
state = dbStateCreate(slink->
name);
118 static void lnkState_remove(
struct dbLocker *locker,
struct link *plink)
129 static int lnkState_getDBFtype(
const struct link *plink)
134 static long lnkState_getElements(
const struct link *plink,
long *nelements)
140 static long lnkState_getValue(
struct link *plink,
short dbrType,
void *
pbuffer,
148 return S_db_badDbrtype;
150 conv = dbFastPutConvertRoutine[
DBR_SHORT][dbrType];
156 static long lnkState_putValue(
struct link *plink,
short dbrType,
157 const void *
pbuffer,
long nRequest)
198 val = (pstr[0] != 0) && ((pstr[0] !=
'0') || (pstr[1] != 0));
202 return S_db_badDbrtype;
207 (val ? dbStateSet : dbStateClear)(slink->
state);
214 static lset lnkState_lset = {
216 lnkState_open, lnkState_remove,
218 NULL, lnkState_getDBFtype, lnkState_getElements,
223 lnkState_putValue,
NULL,
227 static jlif lnkStateIf = {
228 "state", lnkState_alloc, lnkState_free,
232 NULL, lnkState_get_lset,
233 lnkState_report,
NULL, NULL
An EPICS-specific replacement for ANSI C's assert.
#define CONTAINER(ptr, structure, member)
Find parent object from a member pointer.
#define INVALID_DB_REQ(x)
epicsExportAddress(jlif, lnkStateIf)
Miscellaneous macro definitions.
int errlogPrintf(const char *pFormat,...)
char * epicsStrnDup(const char *s, size_t len)
struct state_link state_link