dbStatic: Allow empty recordtype bodies in DBD files
A record type with an empty body is a declaration. The IOC will accept one of these in a DBD file as long as it has already loaded the full record type definition. This will allow device support to provide a DBD file that declares each record type it uses before giving the related device() entry. Later commits will explain why.
This commit is contained in:
@@ -62,6 +62,7 @@ static void dbMenuChoice(char *name,char *value);
|
||||
static void dbMenuBody(void);
|
||||
|
||||
static void dbRecordtypeHead(char *name);
|
||||
static void dbRecordtypeEmpty(void);
|
||||
static void dbRecordtypeBody(void);
|
||||
static void dbRecordtypeFieldHead(char *name,char *type);
|
||||
static void dbRecordtypeFieldItem(char *name,char *value);
|
||||
@@ -607,6 +608,23 @@ static void dbRecordtypeCdef(char *text) {
|
||||
return;
|
||||
}
|
||||
|
||||
static void dbRecordtypeEmpty(void)
|
||||
{
|
||||
tempListNode *ptempListNode;
|
||||
dbRecordType *pdbRecordType;
|
||||
|
||||
if (duplicate) {
|
||||
duplicate = FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
ptempListNode = (tempListNode *)ellFirst(&tempList);
|
||||
pdbRecordType = ptempListNode->item;
|
||||
epicsPrintf("Declaration of recordtype(%s) preceeded full definition.\n",
|
||||
pdbRecordType->name);
|
||||
yyerrorAbort(NULL);
|
||||
}
|
||||
|
||||
static void dbRecordtypeBody(void)
|
||||
{
|
||||
dbRecordType *pdbRecordType;
|
||||
|
||||
@@ -100,7 +100,12 @@ recordtype_head: '(' tokenSTRING ')'
|
||||
dbRecordtypeHead($2); dbmfFree($2);
|
||||
};
|
||||
|
||||
recordtype_body: '{' recordtype_field_list '}'
|
||||
recordtype_body: '{' '}'
|
||||
{
|
||||
if(dbStaticDebug>2) printf("empty recordtype_body\n");
|
||||
dbRecordtypeEmpty();
|
||||
}
|
||||
| '{' recordtype_field_list '}'
|
||||
{
|
||||
if(dbStaticDebug>2) printf("recordtype_body\n");
|
||||
dbRecordtypeBody();
|
||||
@@ -215,14 +220,14 @@ record_head: '(' tokenSTRING ',' tokenSTRING ')'
|
||||
dbRecordHead($2,$4,0); dbmfFree($2); dbmfFree($4);
|
||||
};
|
||||
|
||||
record_body: /*Null*/
|
||||
record_body: /* empty */
|
||||
{
|
||||
if(dbStaticDebug>2) printf("null record_body\n");
|
||||
dbRecordBody();
|
||||
}
|
||||
| '{' '}'
|
||||
{
|
||||
if(dbStaticDebug>2) printf("record_body - no fields\n");
|
||||
if(dbStaticDebug>2) printf("empty record_body\n");
|
||||
dbRecordBody();
|
||||
}
|
||||
| '{' record_field_list '}'
|
||||
|
||||
Reference in New Issue
Block a user