static void RcIoPrintHelp( void ) /*******************************/ { char progfname[_MAX_FNAME]; int index; char buf[256]; OutPutInfo errinfo; char imageName[_MAX_PATH]; _cmdname( imageName ); InitOutPutInfo( &errinfo ); errinfo.severity = SEV_BANNER; #ifdef __OSI__ if( _Copyright != NULL ) { RcMsgFprintf( stdout, &errinfo, "%s\n", _Copyright ); } #endif _splitpath( imageName, NULL, NULL, progfname, NULL ); strlwr( progfname ); index = USAGE_MSG_FIRST; GetRcMsg( index, buf, sizeof( buf ) ); RcMsgFprintf( stdout, &errinfo, buf, progfname ); RcMsgFprintf( stdout, &errinfo, "\n" ); for( ++index; index <= USAGE_MSG_LAST; index++ ) { GetRcMsg( index, buf, sizeof( buf ) ); RcMsgFprintf( stdout, &errinfo, "%s\n", buf ); } }
static void puts_far( const char YYFAR *string ) { const char YYFAR *p; if( CmdLineParms.DebugParser ) { for( p = string; *p; ++p ) { RcMsgFprintf( stdout, NULL, "%c", *p ); } RcMsgFprintf( stdout, NULL, "%c", '\n' ); } }
static void RcIoPrintBanner( void ) /*********************************/ { OutPutInfo errinfo; InitOutPutInfo( &errinfo ); errinfo.severity = SEV_BANNER; RcMsgFprintf( stderr, &errinfo, BannerText ); }
static void flushPrintf( void ) { /********************************/ OutPutInfo info; if( curBufPos != formatBuffer ) { InitOutPutInfo( &info ); info.severity = SEV_WARNING; RcMsgFprintf( NULL, &info, "\n" ); } }
static void dump_rule( unsigned rule ) { unsigned i; const YYTOKENTYPE YYFAR *tok; const char YYFAR *p; if( CmdLineParms.DebugParser ) { for( p = yytoknames[yyplhstab[rule]]; *p; ++p ) { RcMsgFprintf( stdout, NULL, "%c", *p ); } RcMsgFprintf( stdout, NULL, " <-" ); tok = &yyrhstoks[yyrulebase[rule]]; for( i = yyplentab[rule]; i != 0; --i ) { RcMsgFprintf( stdout, NULL, " " ); for( p = yytoknames[*tok]; *p; ++p ) { RcMsgFprintf( stdout, NULL, "%c", *p ); } ++tok; } RcMsgFprintf( stdout, NULL, "\n" ); } }
static void PutScanString( const char *string ) { if( CmdLineParms.DebugScanner && string != NULL ) { RcMsgFprintf( NULL, "%s\n", string ); } } /* PutScanString */
static void RcMsgV( unsigned errornum, OutputSeverity sev, va_list arglist ) /***************************************************************************/ { const LogicalFileInfo *currfile; OutPutInfo errinfo; InitOutPutInfo( &errinfo ); errinfo.severity = sev; errinfo.flags |= OUTFLAG_ERRID; errinfo.errid = errornum; switch (errornum) { case ERR_CANT_OPEN_FILE: case ERR_READING_TMP: case ERR_WRITTING_TMP: case ERR_OPENING_TMP: case ERR_UNEXPECTED_EOF: case ERR_WRITTING_FILE: case ERR_READING_FILE: case ERR_WRITTING_RES_FILE: case ERR_CANT_FIND_FILE: case ERR_FILENAME_NEEDED: case ERR_NO_OPT_SPECIFIED: case ERR_NOT_BITMAP_FILE: case ERR_NOT_CURSOR_FILE: case ERR_NOT_ICON_FILE: case ERR_NOT_VALID_EXE: case ERR_OUT_OF_MEMORY: case ERR_PARSER_INTERNAL: case ERR_RENAMEING_TMP_FILE: case ERR_TOO_MANY_ARGS: case ERR_UNKNOWN_MULT_OPTION: case ERR_UNKNOWN_OPTION: case ERR_NONNT_RES_TO_NT_EXE: case ERR_NONWIN_RES_TO_WIN_EXE: case ERR_NONOS2_RES_TO_OS2_EXE: case ERR_OLD_RESOURCE_OBJECT: case ERR_READING_EXE: case ERR_READING_ICON: case ERR_READING_CURSOR: case ERR_READING_BITMAP: case ERR_READING_FONT: case ERR_READING_DATA: case ERR_READING_RES: case ERR_BAD_RES_VER: case ERR_INVALID_RES: case ERR_INTERNAL: /* don't print the filename & line number before these errors */ GetRcMsg( errornum, errBuffer, sizeof( errBuffer ) ); vsprintf( rcStrBuf, errBuffer, arglist ); sprintf( errBuffer, "%s", rcStrBuf ); break; case ERR_RCSTR_NOT_FOUND: /* this message means the error strings cannot be obtained from * the exe so its text is hard coded */ sprintf( errBuffer, "Resource strings not found" ); break; case ERR_NO_MSG: /* dont print anything */ return; default: GetRcMsg( errornum, errBuffer, sizeof( errBuffer ) ); vsprintf( rcStrBuf, errBuffer, arglist ); currfile = RcIoGetLogicalFileInfo(); if (currfile != NULL) { errinfo.flags |= OUTFLAG_FILE | OUTFLAG_LINE; errinfo.file = currfile->Filename; errinfo.lineno = currfile->LineNum; } sprintf( errBuffer, "%s", rcStrBuf ); break; } RcMsgFprintf( stdout, &errinfo, "%s\n", errBuffer ); }