comparison lwasm/main.c @ 330:81c005b82775

More tinkering with input subsystem
author lost
date Sun, 28 Feb 2010 05:35:50 +0000
parents c15cca3ae6a2
children 67224d8d1024
comparison
equal deleted inserted replaced
329:c15cca3ae6a2 330:81c005b82775
28 #include <lw_alloc.h> 28 #include <lw_alloc.h>
29 #include <lw_string.h> 29 #include <lw_string.h>
30 #include <lw_stringlist.h> 30 #include <lw_stringlist.h>
31 31
32 #include "lwasm.h" 32 #include "lwasm.h"
33 #include "input.h"
33 34
34 extern int parse_pragma_string(asmstate_t *as, char *str); 35 extern int parse_pragma_string(asmstate_t *as, char *str);
35 36
36 /* command line option handling */ 37 /* command line option handling */
37 const char *argp_program_version = "lwasm from " PACKAGE_STRING; 38 const char *argp_program_version = "lwasm from " PACKAGE_STRING;
169 program_name = argv[0]; 170 program_name = argv[0];
170 171
171 /* initialize assembler state */ 172 /* initialize assembler state */
172 asmstate.include_list = lw_stringlist_create(); 173 asmstate.include_list = lw_stringlist_create();
173 asmstate.input_files = lw_stringlist_create(); 174 asmstate.input_files = lw_stringlist_create();
174 asmstate.file_dir = lw_stack_create(lw_free);
175 input_init();
176 175
177 /* parse command line arguments */ 176 /* parse command line arguments */
178 argp_parse(&argp, argc, argv, 0, 0, &asmstate); 177 argp_parse(&argp, argc, argv, 0, 0, &asmstate);
179 178
180 if (!asmstate.output_file) 179 if (!asmstate.output_file)
181 { 180 {
182 asmstate.output_file = lw_strdup("a.out"); 181 asmstate.output_file = lw_strdup("a.out");
183 } 182 }
184 183
184 input_init(&asmstate);
185
185 exit(0); 186 exit(0);
186 } 187 }