The include path now supports the unix convention that an empty directory name means the current directory.
The lex grammer was changed so that it for quoted strings can contain any ascii character except a quote.
This commit is contained in:
@@ -27,21 +27,21 @@ of this distribution.
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <dbmf.h>
|
||||
#include "dbmf.h"
|
||||
|
||||
#include <dbDefs.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <epicsPrint.h>
|
||||
#include <errMdef.h>
|
||||
#include <dbStaticLib.h>
|
||||
#include <dbStaticPvt.h>
|
||||
#include <ellLib.h>
|
||||
#include <gpHash.h>
|
||||
#include <freeList.h>
|
||||
#include <guigroup.h>
|
||||
#include <special.h>
|
||||
#include <link.h>
|
||||
#include <macLib.h>
|
||||
#include "dbDefs.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "errMdef.h"
|
||||
#include "dbStaticLib.h"
|
||||
#include "dbStaticPvt.h"
|
||||
#include "ellLib.h"
|
||||
#include "gpHash.h"
|
||||
#include "freeList.h"
|
||||
#include "guigroup.h"
|
||||
#include "special.h"
|
||||
#include "link.h"
|
||||
#include "macLib.h"
|
||||
|
||||
/*private routines */
|
||||
static void yyerrorAbort(char *str);
|
||||
|
||||
@@ -17,10 +17,10 @@ of this distribution.
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <ellLib.h>
|
||||
#include <dbDefs.h>
|
||||
#include <dbStaticLib.h>
|
||||
#include <dbStaticPvt.h>
|
||||
#include "dbDefs.h"
|
||||
#include "ellLib.h"
|
||||
#include "dbStaticLib.h"
|
||||
#include "dbStaticPvt.h"
|
||||
|
||||
int dbPvdHashTableSize = 512;
|
||||
static int dbPvdHashTableShift;
|
||||
|
||||
@@ -19,12 +19,14 @@ of this distribution.
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <epicsPrint.h>
|
||||
#include <errMdef.h>
|
||||
#include <dbStaticLib.h>
|
||||
#include <dbStaticPvt.h>
|
||||
#include <dbBase.h>
|
||||
#include <gpHash.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "errMdef.h"
|
||||
#include "dbStaticLib.h"
|
||||
#include "dbStaticPvt.h"
|
||||
#include "dbBase.h"
|
||||
#include "gpHash.h"
|
||||
|
||||
DBBASE *pdbbase = NULL;
|
||||
|
||||
@@ -45,7 +47,7 @@ int main(int argc,char **argv)
|
||||
|
||||
/*Look for options*/
|
||||
if(argc<2) {
|
||||
printf("usage: dbReadTest -Idir -Idir file.dbd file.dbd \n");
|
||||
printf("usage: dbReadTest -Idir -Smacsub file.dbd file.db \n");
|
||||
exit(0);
|
||||
}
|
||||
while((strncmp(argv[1],"-I",2)==0)||(strncmp(argv[1],"-S",2)==0)) {
|
||||
@@ -84,8 +86,8 @@ int main(int argc,char **argv)
|
||||
dbPvdDump(pdbbase);
|
||||
gphDump(pdbbase->pgpHash);
|
||||
dbDumpMenu(pdbbase,NULL);
|
||||
*/
|
||||
dbDumpRecord(pdbbase,NULL,0);
|
||||
dbFreeBase(pdbbase);
|
||||
*/
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -32,24 +32,24 @@ of this distribution.
|
||||
#define DBFLDTYPES_GBLSOURCE
|
||||
#define GUIGROUPS_GBLSOURCE
|
||||
#define SPECIAL_GBLSOURCE
|
||||
#include <dbDefs.h>
|
||||
#include "dbDefs.h"
|
||||
#define LINK_GBLSOURCE
|
||||
#include <link.h>
|
||||
#include "link.h"
|
||||
#undef LINK_GBLSOURCE
|
||||
#include <dbFldTypes.h>
|
||||
#include <epicsPrint.h>
|
||||
#include <errMdef.h>
|
||||
#include <ellLib.h>
|
||||
#include <cvtFast.h>
|
||||
#include <dbStaticLib.h>
|
||||
#include <dbStaticPvt.h>
|
||||
#include <devSup.h>
|
||||
#include <drvSup.h>
|
||||
#include <special.h>
|
||||
#include <gpHash.h>
|
||||
#include <guigroup.h>
|
||||
#include <special.h>
|
||||
#include <dbmf.h>
|
||||
#include "dbFldTypes.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "errMdef.h"
|
||||
#include "ellLib.h"
|
||||
#include "cvtFast.h"
|
||||
#include "dbStaticLib.h"
|
||||
#include "dbStaticPvt.h"
|
||||
#include "devSup.h"
|
||||
#include "drvSup.h"
|
||||
#include "special.h"
|
||||
#include "gpHash.h"
|
||||
#include "guigroup.h"
|
||||
#include "special.h"
|
||||
#include "dbmf.h"
|
||||
|
||||
int dbStaticDebug = 0;
|
||||
#define messagesize 100
|
||||
@@ -760,6 +760,7 @@ long dbAddPath(DBBASE *pdbbase,const char *path)
|
||||
const char *pcolon;
|
||||
const char *pdir;
|
||||
int len;
|
||||
int emptyName;
|
||||
|
||||
if(!pdbbase) return(-1);
|
||||
ppathList = (ELLLIST *)pdbbase->pathPvt;
|
||||
@@ -769,18 +770,29 @@ long dbAddPath(DBBASE *pdbbase,const char *path)
|
||||
pdbbase->pathPvt = (void *)ppathList;
|
||||
}
|
||||
pdir = path;
|
||||
while(pdir) {
|
||||
if(*pdir == ':') {
|
||||
pdir++;
|
||||
continue;
|
||||
}
|
||||
pdbPathNode = (dbPathNode *)dbCalloc(1,sizeof(dbPathNode));
|
||||
/*an empty name at beginning, middle, or end means current directory*/
|
||||
while(pdir && *pdir) {
|
||||
emptyName = ((*pdir == ':') ? TRUE : FALSE);
|
||||
if(emptyName) ++pdir;
|
||||
pdbPathNode = (dbPathNode *)calloc(1,sizeof(dbPathNode));
|
||||
ellAdd(ppathList,&pdbPathNode->node);
|
||||
pcolon = strchr(pdir,':');
|
||||
len = (pcolon ? (pcolon - pdir) : strlen(pdir));
|
||||
pdbPathNode->directory = (char *)dbCalloc(1,len + 1);
|
||||
strncpy(pdbPathNode->directory,pdir,len);
|
||||
pdir = (pcolon ? (pcolon+1) : 0);
|
||||
if(!emptyName) {
|
||||
pcolon = strchr(pdir,':');
|
||||
len = (pcolon ? (pcolon - pdir) : strlen(pdir));
|
||||
if(len>0) {
|
||||
pdbPathNode->directory = (char *)calloc(len+1,sizeof(char));
|
||||
strncpy(pdbPathNode->directory,pdir,len);
|
||||
pdir = pcolon;
|
||||
/*unless at end skip past first colon*/
|
||||
if(pdir && *(pdir+1)!=0) ++pdir;
|
||||
} else { /*must have been trailing : */
|
||||
emptyName=TRUE;
|
||||
}
|
||||
}
|
||||
if(emptyName) {
|
||||
pdbPathNode->directory = (char *)calloc(2,sizeof(char));
|
||||
strcpy(pdbPathNode->directory,".");
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
@@ -1114,7 +1126,7 @@ long dbWriteBreaktableFP(DBBASE *pdbbase,FILE *fp)
|
||||
fprintf(fp,"breaktable(%s) {\n",pbrkTable->name);
|
||||
for(ind=0; ind<pbrkTable->number; ind++) {
|
||||
pbrkInt = pbrkTable->papBrkInt[ind];
|
||||
fprintf(fp,"\t%f %f\n",pbrkInt->raw,pbrkInt->eng);
|
||||
fprintf(fp,"\t%e %e\n",pbrkInt->raw,pbrkInt->eng);
|
||||
}
|
||||
fprintf(fp,"}\n");
|
||||
}
|
||||
|
||||
@@ -22,12 +22,12 @@ of this distribution.
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <dbDefs.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <epicsPrint.h>
|
||||
#include <errMdef.h>
|
||||
#include <dbStaticLib.h>
|
||||
#include <dbStaticPvt.h>
|
||||
#include "dbDefs.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "errMdef.h"
|
||||
#include "dbStaticLib.h"
|
||||
#include "dbStaticPvt.h"
|
||||
|
||||
long dbAllocRecord(DBENTRY *pdbentry,char *precordName)
|
||||
{
|
||||
@@ -206,9 +206,7 @@ int dbIsDefaultValue(DBENTRY *pdbentry)
|
||||
case DBF_DOUBLE:
|
||||
case DBF_ENUM:
|
||||
if(!pflddes->initial) {
|
||||
if((strtod((char *)pfield,&endp)==0.0) && (*endp=='\0'))
|
||||
return(TRUE);
|
||||
return(FALSE);
|
||||
return((strlen((char *)pfield)==0)?TRUE:FALSE);
|
||||
}
|
||||
return(strcmp((char *)pfield,(char *)pflddes->initial)==0);
|
||||
case DBF_MENU: {
|
||||
@@ -240,11 +238,8 @@ int dbIsDefaultValue(DBENTRY *pdbentry)
|
||||
if(!plink) return(FALSE);
|
||||
if(plink->type!=CONSTANT) return(FALSE);
|
||||
if(!plink->value.constantStr) return(TRUE);
|
||||
if(!pflddes->initial) {
|
||||
if((strtod((char *)plink->value.constantStr,&endp)==0.0)
|
||||
&& (*endp=='\0')) return(TRUE);
|
||||
return(FALSE);
|
||||
}
|
||||
if(!pflddes->initial)
|
||||
return((strlen((char *)plink->value.constantStr)==0)?TRUE:FALSE);
|
||||
if(strcmp(plink->value.constantStr,pflddes->initial)==0)
|
||||
return(TRUE);
|
||||
return(FALSE);
|
||||
|
||||
@@ -27,15 +27,15 @@ of this distribution.
|
||||
#include <symLib.h>
|
||||
#include <sysSymTbl.h> /* for sysSymTbl*/
|
||||
|
||||
#include <dbDefs.h>
|
||||
#include <errMdef.h>
|
||||
#include <epicsPrint.h>
|
||||
#include <ellLib.h>
|
||||
#include <dbDefs.h>
|
||||
#include <cvtFast.h>
|
||||
#include <dbStaticLib.h>
|
||||
#include <dbStaticPvt.h>
|
||||
#include <special.h>
|
||||
#include "dbDefs.h"
|
||||
#include "errMdef.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "ellLib.h"
|
||||
#include "dbDefs.h"
|
||||
#include "cvtFast.h"
|
||||
#include "dbStaticLib.h"
|
||||
#include "dbStaticPvt.h"
|
||||
#include "special.h"
|
||||
|
||||
static char hex_digit_to_ascii[16]={'0','1','2','3','4','5','6','7','8','9',
|
||||
'a','b','c','d','e','f'};
|
||||
|
||||
@@ -19,12 +19,14 @@ of this distribution.
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <epicsPrint.h>
|
||||
#include <errMdef.h>
|
||||
#include <dbStaticLib.h>
|
||||
#include <dbStaticPvt.h>
|
||||
#include <dbBase.h>
|
||||
#include <gpHash.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "errMdef.h"
|
||||
#include "dbStaticLib.h"
|
||||
#include "dbStaticPvt.h"
|
||||
#include "dbBase.h"
|
||||
#include "gpHash.h"
|
||||
|
||||
DBBASE *pdbbase = NULL;
|
||||
|
||||
|
||||
@@ -19,12 +19,14 @@ of this distribution.
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <epicsPrint.h>
|
||||
#include <errMdef.h>
|
||||
#include <dbStaticLib.h>
|
||||
#include <dbStaticPvt.h>
|
||||
#include <dbBase.h>
|
||||
#include <gpHash.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "errMdef.h"
|
||||
#include "dbStaticLib.h"
|
||||
#include "dbStaticPvt.h"
|
||||
#include "dbBase.h"
|
||||
#include "gpHash.h"
|
||||
|
||||
DBBASE *pdbbase = NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user