예제 #1
0
// @ 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);

}
예제 #2
0
파일: jbhlp.c 프로젝트: TheCycoONE/jfsw
// @ 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);

}
예제 #3
0
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;
}
예제 #4
0
파일: swconfig.c 프로젝트: TermiT/sw-redux
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;
    }