1) Fixed bug that caused asRegisterClientCallback to fail on UNIX

2) asLib_lex.l changed to allow more characters(like dbLoadxxx)
This commit is contained in:
Marty Kraimer
1997-10-14 13:40:39 +00:00
parent 61f1e8b12f
commit d0a8812231
4 changed files with 21 additions and 29 deletions
+8 -2
View File
@@ -119,9 +119,15 @@ int asDumpHash(void);
#define ASMAXINP 12
#ifdef vxWorks
#include <fast_lock.h>
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;
+2 -24
View File
@@ -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;
}
+3 -1
View File
@@ -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;
+8 -2
View File
@@ -119,9 +119,15 @@ int asDumpHash(void);
#define ASMAXINP 12
#ifdef vxWorks
#include <fast_lock.h>
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;