// @ symbol precedes a tag name target // # symbol precedes a comment in the help file long GetAToken(char *name, char *tc, long length) { int i,x=0; char t,*tmp,tokenfound=0; char *token; long count=0; if(!(token = (char *)malloc(9))) { Msg("Out of heap space!",M_RED); return(tokenfound); } do{ // Find the token symbol do { t = *tc; tc++; count++; } while(t!='@' && count < length); if(t=='@') { tmp = token; x=1; do { // Read in the token *tmp = t; tmp++; t = *tc; tc++; x++; count++; } while((t>=48 && t<=127) && t!='@' && x < 9 && count < length); *tmp = 0; if(!strcmp(name,Bstrupr(token))) tokenfound = 1; } } while(!tokenfound && count < length); if(!tokenfound) count=0; return(count); }
// @ symbol precedes a tag name target // # symbol precedes a comment in the help file long GetAToken(char *name, char *tc, long length) { int i,x=0; char t,*tmp,tokenfound=0; char token[10]; long count=0; do{ // Find the token symbol do { t = *tc; tc++; count++; } while(t!='@' && count < length); if(t=='@') { tmp = token; x=1; do { // Read in the token *tmp = t; tmp++; t = *tc; tc++; x++; count++; } while(t>=48 && t!='@' && x < 9 && count < length); *tmp = 0; if(!strcmp(name,Bstrupr(token))) tokenfound = 1; } } while(!tokenfound && count < length); if(!tokenfound) count=0; return(count); }
void DecodePassword(char *pw) { int bak_DrawScreen = DrawScreen; int bak_randomseed = randomseed; int i; int len; DrawScreen = FALSE; randomseed = 1234L; Bstrupr(pw); len = strlen(pw); for (i = 0; i < len; i++) pw[i] -= RANDOM_RANGE(26); randomseed = bak_randomseed; DrawScreen = bak_DrawScreen; }
void EncodePassword(char *pw) { long bak_DrawScreen = DrawScreen; long bak_randomseed = randomseed; long i; long len; DrawScreen = FALSE; randomseed = 1234L; Bstrupr(pw); len = strlen(pw); for (i = 0; i < len; i++) pw[i] += RANDOM_RANGE(26); randomseed = bak_randomseed; DrawScreen = bak_DrawScreen; }