New approach, new lexer
This commit is contained in:
21
file.c
Normal file
21
file.c
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
global FILE *global_output_file;
|
||||
global FILE *global_all_files[32];
|
||||
global U32 global_all_files_count;
|
||||
|
||||
#define lex_print(...) fprintf(global_output_file, __VA_ARGS__)
|
||||
#define lex_new_line() lex_print("\n")
|
||||
|
||||
function void
|
||||
use_write_file(const char *file){
|
||||
global_output_file = fopen(file, "w");
|
||||
global_all_files[global_all_files_count++] = global_output_file;
|
||||
assert_msg(global_output_file, "Failed to open file:%s", file);
|
||||
}
|
||||
|
||||
function void
|
||||
close_all_files(){
|
||||
for(U32 i = 0; i < global_all_files_count; i++){
|
||||
fclose(global_all_files[i]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user