static void DoGetItem( char *buff, bool stop_on_first ) { for( ;; ) { if( CurrChar == ' ' ) break; if( CurrChar == '\t' ) break; if( CurrChar == ARG_TERMINATE ) break; if( CurrChar == ';' ) break; if( CurrChar == '{' ) break; if( OptDelim( CurrChar ) && stop_on_first ) break; *buff++ = CurrChar; NextChar(); stop_on_first = TRUE; } *buff = NULLCHAR; }
static void ProcOptList( int pass ) { char buff[80]; char err_buff[CMD_LEN]; char *curr; unsigned long mem; SetupChar(); /* initialize scanner */ for( ;; ) { SkipSpaces(); if( !OptDelim( CurrChar ) ) break; NextChar(); curr = buff; #ifndef __GUI__ if( CurrChar == '?' ) { PrintUsage( MSG_USAGE_BASE ); StartupErr( "" ); } #endif while( isalnum( CurrChar ) ) { *curr++ = CurrChar; NextChar(); } if( curr == buff ) { if( OptDelim( CurrChar ) ) { NextChar(); SkipSpaces(); break; } OptError( LIT_ENG( STARTUP_No_Recog_Optn ) ); } switch( Lookup( OptNameTab, buff, curr - buff ) ) { case OPT_CONTINUE_UNEXPECTED_BREAK: _SwitchOn( SW_CONTINUE_UNEXPECTED_BREAK ); break; case OPT_DEFERSYM: _SwitchOn( SW_DEFER_SYM_LOAD ); break; case OPT_DOWNLOAD: DownLoadTask = true; break; case OPT_NOEXPORTS: _SwitchOn( SW_NO_EXPORT_SYMS ); break; case OPT_LOCALINFO: if( pass == 2 ) { char *symfile = GetFileName( pass ); FindLocalDebugInfo( symfile ); _Free( symfile ); } break; case OPT_INVOKE: if( pass == 2 ) _Free( InvokeFile ); InvokeFile = GetFileName( pass ); break; case OPT_NOINVOKE: if( pass == 2 ) _Free( InvokeFile ); InvokeFile = NULL; break; case OPT_NOSOURCECHECK: _SwitchOff( SW_CHECK_SOURCE_EXISTS ); break; case OPT_NOSYMBOLS: _SwitchOff( SW_LOAD_SYMS ); break; case OPT_NOMOUSE: _SwitchOff( SW_USE_MOUSE ); break; case OPT_DYNAMIC: mem = GetMemory(); if( pass == 1 ) { if( mem < MIN_MEM_SIZE ) mem = MIN_MEM_SIZE; MemSize = mem; } break; case OPT_DIP: { int i; for( i = 0; DipFiles[i] != NULL; ++i ) ; DipFiles[i] = GetFileName( pass ); } break; case OPT_TRAP: if( pass == 2 ) _Free( TrapParms ); TrapParms = GetFileName( pass ); SkipSpaces(); if( CurrChar == TRAP_PARM_SEPARATOR ) { NextChar(); GetTrapParm( pass ); } else if( CurrChar == '{' ) { GetTrapParm( pass ); } break; #ifdef ENABLE_TRAP_LOGGING case OPT_TRAP_DEBUG_FLUSH: if( pass == 2 ) _Free( TrapTraceFileName ); TrapTraceFileName = GetFileName( pass ); TrapTraceFileFlush = true; break; case OPT_TRAP_DEBUG: if( pass == 2 ) _Free( TrapTraceFileName ); TrapTraceFileName = GetFileName( pass ); TrapTraceFileFlush = false; break; #endif case OPT_REMOTE_FILES: _SwitchOn( SW_REMOTE_FILES ); break; case OPT_LINES: DUISetNumLines( GetValue() ); break; case OPT_COLUMNS: DUISetNumColumns( GetValue() ); break; #ifdef BACKWARDS case OPT_NO_FPU: case OPT_NO_ALTSYM: break; case OPT_REGISTERS: GetValue(); break; #endif case OPT_INITCMD: GetInitCmd( pass ); break; case OPT_POWERBUILDER: _SwitchOn( SW_POWERBUILDER ); break; case OPT_HELP: #ifndef __GUI__ PrintUsage( MSG_USAGE_BASE ); StartupErr( "" ); #endif break; default: if( !ProcSysOption( buff, curr - buff, pass ) && !DUIScreenOption( buff, curr - buff, pass ) ) { Format( err_buff, LIT_ENG( STARTUP_Invalid_Option ), buff, curr - buff ); StartupErr( err_buff ); } break; } } }