From d0a881223165f98ebf5763eeaa222e7a41f38e05 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Tue, 14 Oct 1997 13:40:39 +0000 Subject: [PATCH] 1) Fixed bug that caused asRegisterClientCallback to fail on UNIX 2) asLib_lex.l changed to allow more characters(like dbLoadxxx) --- src/as/asLib.h | 10 ++++++++-- src/as/asLibRoutines.c | 26 ++------------------------ src/as/asLib_lex.l | 4 +++- src/include/asLib.h | 10 ++++++++-- 4 files changed, 21 insertions(+), 29 deletions(-) diff --git a/src/as/asLib.h b/src/as/asLib.h index b7347bc41..e3e6cf9b9 100644 --- a/src/as/asLib.h +++ b/src/as/asLib.h @@ -119,9 +119,15 @@ int asDumpHash(void); #define ASMAXINP 12 #ifdef vxWorks #include -extern FAST_LOCK asLock; -extern int asLockInit; +#else +/*This only works in a single threaded environment */ +#define FAST_LOCK int +#define FASTLOCKINIT(PFAST_LOCK) +#define FASTLOCK(PFAST_LOCK) +#define FASTUNLOCK(PFAST_LOCK) #endif +extern int asLockInit; +extern FAST_LOCK asLock; extern int asActive; /* definition of access rights*/ typedef enum{asNOACCESS,asREAD,asWRITE} asAccessRights; diff --git a/src/as/asLibRoutines.c b/src/as/asLibRoutines.c index ea5d78907..f130411ec 100644 --- a/src/as/asLibRoutines.c +++ b/src/as/asLibRoutines.c @@ -229,22 +229,16 @@ long asChangeGroup(ASMEMBERPVT *asMemberPvt,char *newAsgName) if(!asActive) return(S_asLib_asNotActive); pasgmember = *asMemberPvt; if(!pasgmember) return(S_asLib_badMember); -#ifdef vxWorks FASTLOCK(&asLock); -#endif if(pasgmember->pasg) { ellDelete(&pasgmember->pasg->memberList,(ELLNODE *)pasgmember); } else { errMessage(-1,"Logic error in asChangeGroup"); -#ifdef vxWorks FASTUNLOCK(&asLock); -#endif exit(-1); } status = asAddMember(asMemberPvt,newAsgName); -#ifdef vxWorks FASTUNLOCK(&asLock); -#endif return(status); } @@ -283,14 +277,10 @@ long asAddClient(ASCLIENTPVT *pasClientPvt,ASMEMBERPVT asMemberPvt, pasgclient->level = asl; pasgclient->user = user; pasgclient->host = host; -#ifdef vxWorks FASTLOCK(&asLock); -#endif ellAdd(&pasgmember->clientList,(ELLNODE *)pasgclient); status = asCompute(pasgclient); -#ifdef vxWorks FASTUNLOCK(&asLock); -#endif return(status); } @@ -304,13 +294,9 @@ long asChangeClient(ASCLIENTPVT asClientPvt,int asl,char *user,char *host) pasgclient->level = asl; pasgclient->user = user; pasgclient->host = host; -#ifdef vxWorks FASTLOCK(&asLock); -#endif status = asCompute(pasgclient); -#ifdef vxWorks FASTUNLOCK(&asLock); -#endif return(status); } @@ -321,21 +307,15 @@ long asRemoveClient(ASCLIENTPVT *asClientPvt) if(!asActive) return(S_asLib_asNotActive); if(!pasgclient) return(S_asLib_badClient); -#ifdef vxWorks FASTLOCK(&asLock); -#endif pasgMember = pasgclient->pasgMember; if(!pasgMember) { errMessage(-1,"asRemoveClient: No ASGMEMBER"); -#ifdef vxWorks FASTUNLOCK(&asLock); -#endif return(-1); } ellDelete(&pasgMember->clientList,(ELLNODE *)pasgclient); -#ifdef vxWorks FASTUNLOCK(&asLock); -#endif freeListFree(freeListPvt,pasgclient); *asClientPvt = NULL; return(0); @@ -346,14 +326,12 @@ long asRegisterClientCallback(ASCLIENTPVT asClientPvt, { ASGCLIENT *pasgclient = asClientPvt; -#ifdef vxWorks if(!asActive) return(S_asLib_asNotActive); if(!pasgclient) return(S_asLib_badClient); FASTLOCK(&asLock); pasgclient->pcallback = pcallback; (*pasgclient->pcallback)(pasgclient,asClientCOAR); FASTUNLOCK(&asLock); -#endif return(0); } @@ -452,7 +430,7 @@ long asCompute(ASCLIENTPVT asClientPvt) pasguag = (ASGUAG *)ellFirst(&pasgrule->uagList); while(pasguag) { - if(puag = pasguag->puag) { + if((puag = pasguag->puag)) { pgphentry = gphFind(pasbase->phash,pasgclient->user,puag); if(pgphentry) goto check_hag; } @@ -468,7 +446,7 @@ check_hag: pasghag = (ASGHAG *)ellFirst(&pasgrule->hagList); while(pasghag) { - if(phag = pasghag->phag) { + if((phag = pasghag->phag)) { pgphentry=gphFind(pasbase->phash,pasgclient->host,phag); if(pgphentry) goto check_calc; } diff --git a/src/as/asLib_lex.l b/src/as/asLib_lex.l index d17026950..8b5ec4870 100644 --- a/src/as/asLib_lex.l +++ b/src/as/asLib_lex.l @@ -1,7 +1,9 @@ integer [0-9] name [a-zA-Z0-9_\.] pvname [a-zA-Z0-9_\-:\.\[\]<>;] -string [a-zA-Z0-9_\,\./\*#\[\]%: ;!|\'\-&\(\)@\?\+<>=\$] +notquote [^\"] +escapequote \\\" +string {notquote}|{escapequote} %{ static ASINPUTFUNCPTR *my_yyinput; diff --git a/src/include/asLib.h b/src/include/asLib.h index b7347bc41..e3e6cf9b9 100644 --- a/src/include/asLib.h +++ b/src/include/asLib.h @@ -119,9 +119,15 @@ int asDumpHash(void); #define ASMAXINP 12 #ifdef vxWorks #include -extern FAST_LOCK asLock; -extern int asLockInit; +#else +/*This only works in a single threaded environment */ +#define FAST_LOCK int +#define FASTLOCKINIT(PFAST_LOCK) +#define FASTLOCK(PFAST_LOCK) +#define FASTUNLOCK(PFAST_LOCK) #endif +extern int asLockInit; +extern FAST_LOCK asLock; extern int asActive; /* definition of access rights*/ typedef enum{asNOACCESS,asREAD,asWRITE} asAccessRights;