diff --git a/modules/database/src/ioc/dbStatic/dbBase.h b/modules/database/src/ioc/dbStatic/dbBase.h index 35ca0a638..f0a954b50 100644 --- a/modules/database/src/ioc/dbStatic/dbBase.h +++ b/modules/database/src/ioc/dbStatic/dbBase.h @@ -118,6 +118,10 @@ typedef struct dbRecordNode { char *recordname; ELLLIST infoList; /*LIST head of info nodes*/ int flags; + /** Parse order of this record() + * @since UNRELEASED + */ + unsigned order; struct dbRecordNode *aliasedRecnode; /* NULL unless flags|DBRN_FLAGS_ISALIAS */ }dbRecordNode; @@ -184,5 +188,9 @@ typedef struct dbBase { struct gphPvt *pgpHash; short ignoreMissingMenus; short loadCdefs; + /** Total number of records. + * @since UNRELEASED + */ + unsigned no_records; }dbBase; #endif diff --git a/modules/database/src/ioc/dbStatic/dbStaticLib.c b/modules/database/src/ioc/dbStatic/dbStaticLib.c index eb008fb87..fda3cbf51 100644 --- a/modules/database/src/ioc/dbStatic/dbStaticLib.c +++ b/modules/database/src/ioc/dbStatic/dbStaticLib.c @@ -1445,6 +1445,7 @@ long dbCreateRecord(DBENTRY *pdbentry,const char *precordName) pdbentry->precnode = pNewRecNode; ppvd = dbPvdAdd(pdbentry->pdbbase,precordType,pNewRecNode); if(!ppvd) {errMessage(-1,"Logic Err: Could not add to PVD");return(-1);} + pNewRecNode->order = pdbentry->pdbbase->no_records++; return(0); } @@ -1686,6 +1687,7 @@ long dbCreateAlias(DBENTRY *pdbentry, const char *alias) } ellAdd(&precordType->recList, &pnewnode->node); + pnewnode->order = pdbentry->pdbbase->no_records++; precordType->no_aliases++; return 0;