Make info tags also JSON objects
This commit is contained in:
@@ -1072,6 +1072,12 @@ static void dbRecordInfo(char *name, char *value)
|
||||
if(duplicate) return;
|
||||
ptempListNode = (tempListNode *)ellFirst(&tempList);
|
||||
pdbentry = ptempListNode->item;
|
||||
if (*value == '"') {
|
||||
/* jsonSTRING values still have their quotes */
|
||||
value++;
|
||||
value[strlen(value) - 1] = 0;
|
||||
}
|
||||
dbTranslateEscape(value, value); /* yuck: in-place, but safe */
|
||||
status = dbPutInfo(pdbentry,name,value);
|
||||
if(status) {
|
||||
epicsPrintf("Can't set \"%s\" info \"%s\" to \"%s\"\n",
|
||||
|
||||
@@ -258,10 +258,11 @@ record_field: tokenFIELD '(' tokenSTRING ','
|
||||
if(dbStaticDebug>2) printf("record_field %s %s\n",$3,$6);
|
||||
dbRecordField($3,$6); dbmfFree($3); dbmfFree($6);
|
||||
}
|
||||
| tokenINFO '(' tokenSTRING ',' tokenSTRING ')'
|
||||
| tokenINFO '(' tokenSTRING ','
|
||||
{ BEGIN JSON; } json_value { BEGIN INITIAL; } ')'
|
||||
{
|
||||
if(dbStaticDebug>2) printf("record_info %s %s\n",$3,$5);
|
||||
dbRecordInfo($3,$5); dbmfFree($3); dbmfFree($5);
|
||||
if(dbStaticDebug>2) printf("record_info %s %s\n",$3,$6);
|
||||
dbRecordInfo($3,$6); dbmfFree($3); dbmfFree($6);
|
||||
}
|
||||
| tokenALIAS '(' tokenSTRING ')'
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user