Beispiel #1
0
static bool CreatePreprocFile( void ) {
    int         hdl;
    bool        error;
    int         ch;
    char        ch1;
    int         len;

    error = FALSE;
    hdl = RcOpen( CmdLineParms.OutResFileName,
                O_WRONLY | O_TEXT | O_CREAT | O_TRUNC,
                S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH );
    if( hdl == -1 ) {
        RcError( ERR_CANT_OPEN_FILE, CmdLineParms.OutResFileName,
                        strerror( errno ) );
        error = TRUE;
    } else {
        ch = RcIoGetChar();
        while( ch != RC_EOF ) {
            ch1 = (char) ch;
            len = RcWrite( hdl, &ch1, 1 );
            if( len != 1 ) {
                RcError( ERR_WRITTING_FILE, CmdLineParms.OutResFileName,
                                strerror( errno ) );
                error = TRUE;
            }
            ch = RcIoGetChar();
        }
    }
    if( hdl != -1 ) RcClose( hdl );
    return( error );
}
Beispiel #2
0
static void GetNextChar( void )
{
    for( ;; ) {
        LookAhead = _next;
        if( LookAhead != EOF ) {
            _next = RcIoGetChar();
            if( LookAhead == '\\' && _next == '\n' ) {
                _next = RcIoGetChar();
                continue;
            }
        }
        break;
    }
} /* GetNextChar */
Beispiel #3
0
static void CharInit( void )
{
    _next = RcIoGetChar();
    GetNextChar();
} /* CharInit */