static void DoOneObject( char *obj ) /**********************************/ // process a single object file { bool l_paren = false; bool r_paren = false; char *end; /* Find the end of the string. */ end = LastStringChar( obj ); /* The way Microsoft handles overlay syntax is pretty bizarre... */ /* First remove surrounding parentheses, if present. */ if( *obj == '(' ) { l_paren = true; ++obj; } if( *end == ')' ) { r_paren = true; *end-- = '\0'; } /* Only then process options. */ DoOptions( obj ); /* Now look for a right parenthesis *again*. */ end = LastStringChar( obj ); if( *end == ')' ) { if( r_paren ) Error( "nested right parentheses" ); r_paren = true; *end-- = '\0'; } /* Conditionally open an overlay. */ if( l_paren ) { char *sect; if( OverlayLevel ) Error( "nested left parentheses" ); sect = MemAlloc( 8 ); memcpy( sect, "section", 8 ); AddCommand( sect , OVERLAY_SLOT, true ); ++OverlayLevel; } /* If anything is left, add it to the list of object files. */ if( *obj ) { char *name; name = FileName( obj, strlen( obj ), OBJECT_SLOT, false ); AddCommand( name, OverlayLevel ? OVERLAY_SLOT : OBJECT_SLOT, false ); } /* Conditionally close the current overlay. */ if( r_paren ) { if( !OverlayLevel ) Error( "unmatched right parenthesis" ); --OverlayLevel; } }
static void GetNextInput( char *buf, size_t len, prompt_slot slot ) /*****************************************************************/ { if( !is_term ) { GetLine( buf, len, slot ); DoOptions( buf ); if( *buf != '\0' ) { AddCommand( FileName( buf, slot, false ), slot, false ); } } }
static void DoOneLib( char *lib ) /*******************************/ // process a single library { DoOptions( lib ); /* If anything is left, add it to the list of object files. */ if( *lib != '\0' ) { AddCommand( FileName( lib, LIBRARY_SLOT, false ), LIBRARY_SLOT, false ); } }
static void GetNextInput( char *buf, size_t len, prompt_slot prompt ) /*******************************************************************/ { if( !is_term ) { GetLine( buf, len, prompt ); DoOptions( buf ); if( *buf ) { char *name; name = FileName( buf, strlen( buf ), prompt, false ); AddCommand( name, prompt, false ); } } }
static void DoOneLib( char *lib ) /*******************************/ // process a single library { DoOptions( lib ); /* If anything is left, add it to the list of object files. */ if( *lib ) { char *name; name = FileName( lib, strlen( lib ), LIBRARY_SLOT, false ); AddCommand( name, LIBRARY_SLOT, false ); } }