ioc/dbStatic: add dbGetDevLink()

This commit is contained in:
Michael Davidsaver
2017-10-24 10:44:47 -05:00
parent fef15d6c91
commit c0cbbd8bee
2 changed files with 19 additions and 0 deletions

View File

@@ -709,6 +709,18 @@ void dbInitEntryFromRecord(struct dbCommon *prec, DBENTRY *pdbentry)
pdbentry->precnode = ppvt->recnode;
}
struct link* dbGetDevLink(struct dbCommon* prec)
{
DBLINK *plink = 0;
DBENTRY entry;
dbInitEntryFromRecord(prec, &entry);
if(dbFindField(&entry, "INP")==0 || dbFindField(&entry, "OUT")==0) {
plink = (DBLINK*)entry.pfield;
}
dbFinishEntry(&entry);
return plink;
}
long dbValueSize(short dbr_type)
{
/* sizes for value associated with each DBR request type */

View File

@@ -22,6 +22,7 @@
struct dbCommon;
struct devSup;
struct ioscan_head; /* aka IOSCANPVT */
struct link; /* aka DBLINK */
#ifdef __cplusplus
extern "C" {
@@ -112,6 +113,12 @@ typedef struct dsxt { /* device support extension table */
/* Recordtypes are *not* allowed to extend this table */
} dsxt;
/** Fetch INP or OUT link (or NULL if record type has neither).
*
* Recommended for use in device support init_record()
*/
epicsShareFunc struct link* dbGetDevLink(struct dbCommon* prec);
epicsShareExtern dsxt devSoft_DSXT; /* Allow anything table */
epicsShareFunc void devExtend(dsxt *pdsxt);