コード例 #1
0
ファイル: srchook.c プロジェクト: pavanvunnava/open-watcom-v2
/*
 * HookScriptCheck - check for hook scripts
 */
void HookScriptCheck( void )
{
    if( findHook( "Rd" ) != NULL ) {
        ReadErrorTokens();
    }

} /* HookScriptCheck */
コード例 #2
0
ファイル: expr.c プロジェクト: ABratovic/open-watcom-v2
/*
 * nextToken - fetch the next real token from the buffer
 */
static token nextToken( void )
{
    int         j;
    char        *endptr;

    currToken = _nextToken();
    if( currToken == T_UNKNOWN ) {
        currToken = T_CONSTANT;
        if( isdigit( tokenBuff[0] ) ) {
            constantVal = strtol( tokenBuff, &endptr, 10 );
            if( (endptr - tokenBuff) != tokenBuffCnt ) {
                constantVal = strtol( tokenBuff, &endptr, 16 );
                if( (endptr - tokenBuff) != tokenBuffCnt ) {
                    abortExpr( ERR_INVALID_VALUE );
                }
            }
        } else {
            if( tokenBuff[0] == '.' ) {
                strcpy( tokenBuff, GetASetVal( &tokenBuff[1] ) );
                constantVal = strtol( tokenBuff, NULL, 0 );
                j = tokenBuffCnt - 1;
                while( j >= 0 ) {
                    if( !isdigit( tokenBuff[j] ) ) {
                        currToken = T_STRING;
                        break;
                    }
                    j--;
                }
           } else if( !strcmp( tokenBuff, "config" ) ) {
                constantVal = EditFlags.Color * 100 + EditFlags.BlackAndWhite * 10 +
                    EditFlags.Monocolor;
            } else if( !strcmp( tokenBuff, "rdonly" ) ) {
                constantVal = CFileReadOnly();
            } else if( !strcmp( tokenBuff, "lastrc" ) ) {
                constantVal = (long)LastRC;
            } else if( !strcmp( tokenBuff, "pagelen" ) ) {
                constantVal = EditVars.WindMaxHeight;
            } else if( !strcmp( tokenBuff, "endcolumn" ) ) {
                constantVal = EditVars.WindMaxWidth;
            } else if( !strcmp( tokenBuff, "numundos" ) ) {
                if( UndoStack == NULL ) {
                    constantVal = 0;
                } else {
                    constantVal = UndoStack->current + 1;
                }
            } else if( !strcmp( tokenBuff, "numredos" ) ) {
                if( UndoUndoStack == NULL ) {
                    constantVal = 0;
                } else {
                    constantVal = UndoUndoStack->current + 1;
                }
            } else if( !strcmp( tokenBuff, "hassel" ) ) {
                constantVal = SelRgn.selected;
            } else if( !strcmp( tokenBuff, "hasfile" ) ) {
                constantVal = (CurrentFile != NULL);
            } else if( !strncmp( tokenBuff, "emptybuf", 8 ) ) {
                j = tokenBuff[8];
                constantVal = IsEmptySavebuf( j );
            } else if( (j = Tokenize( colorTokens, tokenBuff, true )) != TOK_INVALID ) {
                constantVal = j;
#ifdef __WIN__
            } else if( (j = Tokenize( ddeTokens, tokenBuff, true )) != TOK_INVALID ) {
                constantVal = ddeNums[j];
#endif
            } else {
                ReadErrorTokens();
                j = Tokenize( ErrorTokens, tokenBuff, true );
                if( j != TOK_INVALID ) {
                    constantVal = ErrorValues[j];
                } else {
                    currToken = T_STRING;
                }
            }
        }
    }
    return( currToken );

} /* nextToken */