X-Git-Url: http://git.harvie.cz/?p=svn%2FPrometheus-QoS%2F.git;a=blobdiff_plain;f=cll1-0.6.2.h;h=6edbd8353427d25e9d41196ace6dfcb75bd59a6d;hp=12d27bfcf81ee64ecfa8a240b574a8e9bc18b9ce;hb=67120c6224470998a5f772a8e1e3ebda3203aade;hpb=208112af094ee6be512e5f4d60ca6051f0908cff diff --git a/cll1-0.6.2.h b/cll1-0.6.2.h index 12d27bf..6edbd83 100644 --- a/cll1-0.6.2.h +++ b/cll1-0.6.2.h @@ -34,6 +34,8 @@ /* Section For Dummies part 1, updated 2004-05-07 by xCh. */ #define not ! +#define and && +#define or || #define TRUE 1 #define FALSE 0 #define loop while(1) @@ -71,7 +73,8 @@ /* String macros & sequences, updated 2004-04-19 by xCh. */ -#define eq(A,B) !strcmp(A,B) +#define eq(A,B) ((A) && (B) && !strcmp(A,B)) +#define eqi(A,B) ((A) && (B) && !strcmpi(A,B)) #define strcmpi(A,B) strcasecmp(A,B) #define strlwr(A) {char *_S=A; while(_&&*_S){*_S=tolower(*_S);_S++;}} #define strupr(A) {char *_S=A; while(_&&*_S){*_S=toupper(*_S);_S++;}} @@ -117,6 +120,7 @@ #define option(STR,SETVAR) if(_){char *_K,*_V,*_O,*_Q; duplicate(_,_Q); _O=_Q; tr(_O,'\t',' '); prefix(_K,_O,' '); if(eq(STR,_K)) {skipspaces(_O); prefix(_V,_O,'#'); cutspaces(_V); SETVAR=_V; _=NULL;} else free(_Q);} #define ioption(STR,SETVAR) if(_){char *_K,*_V,*_O,*_Q; duplicate(_,_Q); _O=_Q; tr(_O,'\t',' '); prefix(_K,_O,' '); if(eq(STR,_K)) {skipspaces(_O); prefix(_V,_O,'#'); cutspaces(_V); SETVAR=atoi(_V); _=NULL;} free(_Q);} #define loption(STR,SETVAR) if(_){char *_K,*_V,*_O,*_Q; duplicate(_,_Q); _O=_Q; tr(_O,'\t',' '); prefix(_K,_O,' '); if(eq(STR,_K)) {skipspaces(_O); prefix(_V,_O,'#'); cutspaces(_V); SETVAR=atol(_V); _=NULL;} free(_Q);} +#define foption(STR,SETVAR) if(_){char *_K,*_V,*_O,*_Q; duplicate(_,_Q); _O=_Q; tr(_O,'\t',' '); prefix(_K,_O,' '); if(eq(STR,_K)) {skipspaces(_O); prefix(_V,_O,'#'); cutspaces(_V); SETVAR=atof(_V); _=NULL;} free(_Q);} #define lloption(STR,SETVAR) if(_){char *_K,*_V,*_O,*_Q; duplicate(_,_Q); _O=_Q; tr(_O,'\t',' '); prefix(_K,_O,' '); if(eq(STR,_K)) {skipspaces(_O); prefix(_V,_O,'#'); cutspaces(_V); SETVAR=atoll(_V); _=NULL;} free(_Q);} /* Dynamic list advanced I/O, updated 2003-05-30 by xCh. */