Another helper, dbLoadLinkLS
Replaces recGblInitConstantLink(..., DBF_STRING, ...)
This commit is contained in:
@@ -651,6 +651,20 @@ void dbScanFwdLink(struct link *plink)
|
||||
|
||||
/* Helper functions for long string support */
|
||||
|
||||
long dbLoadLinkLS(struct link *plink, char *pbuffer, epicsUInt32 size,
|
||||
epicsUInt32 *plen)
|
||||
{
|
||||
if (plink->type == CONSTANT &&
|
||||
plink->value.constantStr) {
|
||||
strncpy(pbuffer, plink->value.constantStr, --size);
|
||||
pbuffer[size] = 0;
|
||||
*plen = strlen(pbuffer) + 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return S_db_notFound;
|
||||
}
|
||||
|
||||
long dbGetLinkLS(struct link *plink, char *pbuffer, epicsUInt32 size,
|
||||
epicsUInt32 *plen)
|
||||
{
|
||||
|
||||
@@ -80,6 +80,9 @@ epicsShareFunc long dbGetTimeStamp(const struct link *plink,
|
||||
epicsShareFunc long dbPutLink(struct link *, short dbrType,
|
||||
const void *pbuffer, long nRequest);
|
||||
epicsShareFunc void dbScanFwdLink(struct link *plink);
|
||||
|
||||
epicsShareFunc long dbLoadLinkLS(struct link *plink, char *pbuffer,
|
||||
epicsUInt32 size, epicsUInt32 *plen);
|
||||
epicsShareFunc long dbGetLinkLS(struct link *plink, char *pbuffer,
|
||||
epicsUInt32 buffer_size, epicsUInt32 *plen);
|
||||
epicsShareFunc long dbPutLinkLS(struct link *plink, char *pbuffer,
|
||||
|
||||
Reference in New Issue
Block a user