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 ); }
static void GetNextChar( void ) { for( ;; ) { LookAhead = _next; if( LookAhead != EOF ) { _next = RcIoGetChar(); if( LookAhead == '\\' && _next == '\n' ) { _next = RcIoGetChar(); continue; } } break; } } /* GetNextChar */
static void CharInit( void ) { _next = RcIoGetChar(); GetNextChar(); } /* CharInit */