diff --git a/code/4ed_api_parser_main.cpp b/code/4ed_api_parser_main.cpp index c4bae1c6..aba3eafd 100644 --- a/code/4ed_api_parser_main.cpp +++ b/code/4ed_api_parser_main.cpp @@ -37,49 +37,21 @@ main(int argc, char **argv){ exit(1); } - String_Const_u8 exe = SCu8("4ed_api_parser_main.exe"); - u32 command_line_length = exe.size + 1; - String_Const_u8 command_line = { 0 }; + String_Const_u8 exe = SCu8("code/4ed_api_parser_main.exe"); + u32 command_line_length = exe.size; for (i32 i = 1; i < argc; i+=1){ - command_line_length += cstring_length(argv[i]) + 1; + command_line_length += 1 + cstring_length(argv[i]); } - command_line = push_data(&arena, command_line_length); - u8* command_line_current = command_line.str; - u8* command_line_end = command_line.str + command_line.size; - - { - char* c = ( char* ) exe.str; - - while ( *c != 0 && command_line_current < command_line_end ) { - *command_line_current = *c; - command_line_current++; - c++; - } - } - - if ( command_line_current < command_line_end ) { - *command_line_current = ' '; - command_line_current++; - } + String_u8 command_line = string_u8_push(&arena, command_line_length ); + string_append(&command_line, exe); API_Definition_List list = {}; for (i32 i = 1; i < argc; i += 1){ char *file_name = argv[i]; - - char* c = file_name; - while ( *c != 0 && command_line_current < command_line_end ) { - *command_line_current = *c; - command_line_current++; - c++; - } - - if ( command_line_current < command_line_end ) { - *command_line_current = ' '; - command_line_current++; - } - + string_append_character(&command_line, ' '); + string_append(&command_line, SCu8(argv[i])); FILE *file = fopen(file_name, "rb"); if (file == 0){ printf("error: could not open input file: '%s'\n", argv[i]); @@ -97,7 +69,7 @@ main(int argc, char **argv){ for (API_Definition *node = list.first; node != 0; node = node->next){ - api_definition_generate_api_includes(&arena, node, GeneratedGroup_Custom, APIGeneration_NoAPINameOnCallables, command_line); + api_definition_generate_api_includes(&arena, node, GeneratedGroup_Custom, APIGeneration_NoAPINameOnCallables, SCu8(command_line)); } } diff --git a/code/4ed_font_api.cpp b/code/4ed_font_api.cpp index c79892c4..02142a50 100644 --- a/code/4ed_font_api.cpp +++ b/code/4ed_font_api.cpp @@ -9,7 +9,7 @@ // TOP -#define GENERATED_BY "4ed_font_api.cpp" +#define GENERATED_BY "code/4ed_font_api.cpp" #include "4ed_api_definition_main.cpp" diff --git a/code/4ed_graphics_api.cpp b/code/4ed_graphics_api.cpp index 22b6de60..e334e60d 100644 --- a/code/4ed_graphics_api.cpp +++ b/code/4ed_graphics_api.cpp @@ -9,7 +9,7 @@ // TOP -#define GENERATED_BY "4ed_graphics_api.cpp" +#define GENERATED_BY "code/4ed_graphics_api.cpp" #include "4ed_api_definition_main.cpp" diff --git a/code/4ed_system_api.cpp b/code/4ed_system_api.cpp index 2f863c33..e88db654 100644 --- a/code/4ed_system_api.cpp +++ b/code/4ed_system_api.cpp @@ -9,7 +9,7 @@ // TOP -#define GENERATED_BY "4ed_system_api.cpp" +#define GENERATED_BY "code/4ed_system_api.cpp" #include "4ed_api_definition_main.cpp" diff --git a/code/custom/generated/custom_api.cpp b/code/custom/generated/custom_api.cpp index d591819c..d0d02fdb 100644 --- a/code/custom/generated/custom_api.cpp +++ b/code/custom/generated/custom_api.cpp @@ -1,4 +1,4 @@ -/* Generated by "4ed_api_parser_main.exe 4ed_api_implementation.cpp " */ +/* Generated by "code/4ed_api_parser_main.exe 4ed_api_implementation.cpp" */ function void custom_api_fill_vtable(API_VTable_custom *vtable){ diff --git a/code/custom/generated/custom_api.h b/code/custom/generated/custom_api.h index eaf2f98f..e7ef7e3c 100644 --- a/code/custom/generated/custom_api.h +++ b/code/custom/generated/custom_api.h @@ -1,4 +1,4 @@ -/* Generated by "4ed_api_parser_main.exe 4ed_api_implementation.cpp " */ +/* Generated by "code/4ed_api_parser_main.exe 4ed_api_implementation.cpp" */ #define custom_global_set_setting_sig() b32 custom_global_set_setting(Application_Links* app, Global_Setting_ID setting, i64 value) #define custom_global_get_screen_rectangle_sig() Rect_f32 custom_global_get_screen_rectangle(Application_Links* app) diff --git a/code/custom/generated/custom_api_constructor.cpp b/code/custom/generated/custom_api_constructor.cpp index e54eb5a2..a63d6def 100644 --- a/code/custom/generated/custom_api_constructor.cpp +++ b/code/custom/generated/custom_api_constructor.cpp @@ -1,4 +1,4 @@ -/* Generated by "4ed_api_parser_main.exe 4ed_api_implementation.cpp " */ +/* Generated by "code/4ed_api_parser_main.exe 4ed_api_implementation.cpp" */ function API_Definition* custom_api_construct(Arena *arena){ diff --git a/code/custom/generated/custom_api_master_list.h b/code/custom/generated/custom_api_master_list.h index 8cf762fc..f05f6f73 100644 --- a/code/custom/generated/custom_api_master_list.h +++ b/code/custom/generated/custom_api_master_list.h @@ -1,4 +1,4 @@ -/* Generated by "4ed_api_parser_main.exe 4ed_api_implementation.cpp " */ +/* Generated by "code/4ed_api_parser_main.exe 4ed_api_implementation.cpp" */ api(custom) function b32 global_set_setting(Application_Links* app, Global_Setting_ID setting, i64 value); api(custom) function Rect_f32 global_get_screen_rectangle(Application_Links* app); diff --git a/code/custom/generated/system_api.cpp b/code/custom/generated/system_api.cpp index 8b9714eb..5494dd8d 100644 --- a/code/custom/generated/system_api.cpp +++ b/code/custom/generated/system_api.cpp @@ -1,4 +1,4 @@ -/* Generated by "4ed_system_api.cpp" */ +/* Generated by "code/4ed_system_api.cpp" */ function void system_api_fill_vtable(API_VTable_system *vtable){ diff --git a/code/custom/generated/system_api.h b/code/custom/generated/system_api.h index 3ff44fba..73809bcf 100644 --- a/code/custom/generated/system_api.h +++ b/code/custom/generated/system_api.h @@ -1,4 +1,4 @@ -/* Generated by "4ed_system_api.cpp" */ +/* Generated by "code/4ed_system_api.cpp" */ #define system_error_box_sig() void system_error_box(char* msg) #define system_get_path_sig() String_Const_u8 system_get_path(Arena* arena, System_Path_Code path_code) diff --git a/code/custom/generated/system_api_constructor.cpp b/code/custom/generated/system_api_constructor.cpp index 40527789..351c3054 100644 --- a/code/custom/generated/system_api_constructor.cpp +++ b/code/custom/generated/system_api_constructor.cpp @@ -1,4 +1,4 @@ -/* Generated by "4ed_system_api.cpp" */ +/* Generated by "code/4ed_system_api.cpp" */ function API_Definition* system_api_construct(Arena *arena){ diff --git a/code/custom/generated/system_api_master_list.h b/code/custom/generated/system_api_master_list.h index bfe30c31..fc9f7620 100644 --- a/code/custom/generated/system_api_master_list.h +++ b/code/custom/generated/system_api_master_list.h @@ -1,4 +1,4 @@ -/* Generated by "4ed_system_api.cpp" */ +/* Generated by "code/4ed_system_api.cpp" */ api(system) function void error_box(char* msg); api(system) function String_Const_u8 get_path(Arena* arena, System_Path_Code path_code); diff --git a/code/generated/font_api.cpp b/code/generated/font_api.cpp index 32480cf0..14e33ad0 100644 --- a/code/generated/font_api.cpp +++ b/code/generated/font_api.cpp @@ -1,4 +1,4 @@ -/* Generated by "4ed_font_api.cpp" */ +/* Generated by "code/4ed_font_api.cpp" */ function void font_api_fill_vtable(API_VTable_font *vtable){ diff --git a/code/generated/font_api.h b/code/generated/font_api.h index 95e85ad0..b1bf6fc5 100644 --- a/code/generated/font_api.h +++ b/code/generated/font_api.h @@ -1,4 +1,4 @@ -/* Generated by "4ed_font_api.cpp" */ +/* Generated by "code/4ed_font_api.cpp" */ #define font_make_face_sig() Face* font_make_face(Arena* arena, Face_Description* description, f32 scale_factor) diff --git a/code/generated/graphics_api.cpp b/code/generated/graphics_api.cpp index 21ed6d4c..963de39b 100644 --- a/code/generated/graphics_api.cpp +++ b/code/generated/graphics_api.cpp @@ -1,4 +1,4 @@ -/* Generated by "4ed_graphics_api.cpp" */ +/* Generated by "code/4ed_graphics_api.cpp" */ function void graphics_api_fill_vtable(API_VTable_graphics *vtable){ diff --git a/code/generated/graphics_api.h b/code/generated/graphics_api.h index 0d233ad7..da3c1a5b 100644 --- a/code/generated/graphics_api.h +++ b/code/generated/graphics_api.h @@ -1,4 +1,4 @@ -/* Generated by "4ed_graphics_api.cpp" */ +/* Generated by "code/4ed_graphics_api.cpp" */ #define graphics_get_texture_sig() u32 graphics_get_texture(Vec3_i32 dim, Texture_Kind texture_kind) #define graphics_fill_texture_sig() b32 graphics_fill_texture(Texture_Kind texture_kind, u32 texture, Vec3_i32 p, Vec3_i32 dim, void* data)