Пример #1
0
/*			perform_an_assembly_pass()
 *
 * Here to attempt 1 pass over each input file.
 * We scan argv[*] looking for filenames or exactly "" which is
 * shorthand for stdin. Any argv that is NULL is not a file-name.
 * We set need_pass_2 TRUE if, after this, we still have unresolved
 * expressions of the form (unknown value)+-(unknown value).
 *
 * Note the un*x semantics: there is only 1 logical input file, but it
 * may be a catenation of many 'physical' input files.
 */
static
void
perform_an_assembly_pass(
int argc,
char **argv)
{
    char *buffer;		/* Where each bufferful of lines will start. */
    int saw_a_file;

	saw_a_file = 0;

	argv++;			/* skip argv[0] */
	argc--;			/* skip argv[0] */
	while(argc--){
	    if(*argv){		/* Is it a file-name argument? */
		/* argv -> "" if stdin desired, else -> filename */
		if((buffer = input_scrub_new_file(*argv))){
		    saw_a_file++;
		    read_a_source_file(buffer);
		}
	    }
	    argv++;			/* completed that argv */
	}
	if(!saw_a_file)
	    if((buffer = input_scrub_new_file("")))
		    read_a_source_file(buffer);
}
Пример #2
0
char *
input_scrub_include_file (char *filename, char *position)
{
  next_saved_file = input_scrub_push (position);
  return input_scrub_new_file (filename);
}