示例#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
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;
    }