/* * Print a help message. */ void PrintHelpMessage( void ) /***************************/ { int num; int ch; char const *p; char const *page_text; BannerMessage(); p = page_text = usageMsg; num = 0; while( *(p = NextUsage( p )) != '\0' ) { if( num == LINE_COUNT ) { printf( page_text ); fflush( stdout ); ch = get_key(); printf( "\n" ); if( ch == 'q' ) break; num = -1; } printf( "%s\n", p ); ++num; } }
/* * Program entry point. */ void main( int argc, char *argv[] ) /*********************************/ { OPT_STORAGE cmdOpts; CmdLine * compCmdLine; CmdLine * linkCmdLine; int itemsParsed; int compRc = COMPILE_NOACTION; int linkRc = LINK_NOACTION; #ifndef __WATCOMC__ _argc = argc; _argv = argv; #endif /*** Initialize ***/ SetBannerFuncError( BannerMessage ); compCmdLine = InitCmdLine( CL_C_NUM_SECTIONS ); linkCmdLine = InitCmdLine( CL_L_NUM_SECTIONS ); SetDefaultFile( TYPE_C_FILE, "source" ); AllowTypeFile( TYPE_C_FILE, TYPE_CPP_FILE, TYPE_DEF_FILE, TYPE_OBJ_FILE, TYPE_LIB_FILE, TYPE_RES_FILE, TYPE_INVALID_FILE ); InitMacro(); /*** Parse the command line and translate to Watcom options ***/ InitParse( &cmdOpts ); itemsParsed = do_parsing( &cmdOpts ); if( itemsParsed==0 || cmdOpts.help ) { if( !cmdOpts.nologo ) BannerMessage(); PrintHelpMessage(); exit( EXIT_SUCCESS ); } OptionsTranslate( &cmdOpts, compCmdLine, linkCmdLine ); /*** Spawn the compiler ***/ compRc = compile( &cmdOpts, compCmdLine ); if( compRc == COMPILE_ERROR ) exit( EXIT_FAILURE ); if( !cmdOpts.c ) { linkRc = link( &cmdOpts, linkCmdLine ); } if( compRc == COMPILE_NOACTION && linkRc == LINK_NOACTION ) { FatalError( "Nothing to do!" ); } FiniParse( &cmdOpts ); exit( EXIT_SUCCESS ); }
/* * Translate scanned MS options to Watcom options. */ void OptionsTranslate( OPT_STORAGE *cmdOpts, CmdLine *compCmdLine, CmdLine *linkCmdLine ) /****************************************************************/ { /*** Parse the /nologo switch now so we can print the banner ***/ init_status( &status ); if( cmdOpts->nologo ) { QuietModeMessage(); } else { BannerMessage(); } /*** Parse everything ***/ unsupported_opts( cmdOpts ); default_opts( &status, cmdOpts, compCmdLine, linkCmdLine ); compiler_opts( &status, cmdOpts, compCmdLine ); linker_opts( &status, cmdOpts, linkCmdLine ); merge_opts( &status, cmdOpts, compCmdLine, linkCmdLine ); }
/* * Print a help message. */ void PrintHelpMessage( void ) /***************************/ { const int lineCount = 15; int count; int num; int ch; BannerMessage(); for( count=0,num=0; usageMsg[count]!=NULL; count++,num++ ) { if( num == lineCount ) { printf( "\t(Press return to continue)" ); fflush( stdout ); ch = get_key(); printf( "\n" ); if( ch == 'q' ) break; num = 0; } printf( "%s\n", usageMsg[count] ); } }
static void CPROC Easter2( uintptr_t psv ) { BannerMessage( WIDE("Enabled Sequence 2") ); }