diff --git a/4ed_api_implementation.cpp b/4ed_api_implementation.cpp index 08012fe2..cca22b59 100644 --- a/4ed_api_implementation.cpp +++ b/4ed_api_implementation.cpp @@ -580,6 +580,10 @@ DOC_PARAM(name, The name parameter specifies the buffer name to try to get. The DOC_PARAM(len, The len parameter specifies the length of the name string.) DOC_PARAM(access, The access parameter determines what levels of protection this call can access.) DOC_RETURN(This call returns a summary that describes the indicated buffer if it exists and is accessible.) + +DOC(This call searches the buffers by their buffer name. The buffer name is the short name in the file bar. The name must match exactly including any alterations put on the buffer name to avoid duplicates.) + +DOC_SEE(get_buffer_by_file_name) DOC_SEE(Buffer_Summary) DOC_SEE(Access_Flag) */{ @@ -599,7 +603,20 @@ DOC_SEE(Access_Flag) } API_EXPORT Buffer_Summary -Get_Buffer_By_File_Name(Application_Links *app, char *name, int32_t len, Access_Flag access){ +Get_Buffer_By_File_Name(Application_Links *app, char *name, int32_t len, Access_Flag access) +/* +DOC_PARAM(name, The name parameter specifies the buffer name to try to get. The string need not be null terminated.) +DOC_PARAM(len, The len parameter specifies the length of the name string.) +DOC_PARAM(access, The access parameter determines what levels of protection this call can access.) +DOC_RETURN(This call returns a summary that describes the indicated buffer if it exists and is accessible.) + +DOC(This call searches the buffers by their canonicalized file names. Not all buffers have file names, only buffers that are tied to files. For instance *scratch* does not have a file name. Every file has one canonicalized file name. For instance on windows this involves converting w:/a/b into W:\a\b. If the name passed is not canonicalized a canonicalized copy is made first. This includes turning relative paths to files that exist into full paths. So the passed in name can be relative to the working directory.) + +DOC_SEE(get_buffer_by_name) +DOC_SEE(Buffer_Summary) +DOC_SEE(Access_Flag) +*/ +{ Command_Data *cmd = (Command_Data*)app->cmd_context; Buffer_Summary buffer = {0}; System_Functions *system = cmd->system; diff --git a/meta/build.cpp b/meta/build.cpp index dc9afd5f..f67190b1 100644 --- a/meta/build.cpp +++ b/meta/build.cpp @@ -152,7 +152,7 @@ init_build_line(Build_Line *line){ #define CL_X86 "-MACHINE:X86" static void -build(u32 flags, char *code_path, char *code_file, char *out_path, char *out_file, char *exports){ +build(u32 flags, char *code_path, char **code_files, char *out_path, char *out_file, char *exports, char *inc_flags){ Build_Line line; init_build_line(&line); @@ -186,6 +186,10 @@ build(u32 flags, char *code_path, char *code_file, char *out_path, char *out_fil build_ap(line, CL_SITE_INCLUDES); } + if (inc_flags != 0 && inc_flags[0] != 0){ + build_ap(line, "%s", inc_flags); + } + if (flags & LIBS){ if (flags & X86){ build_ap(line, CL_LIBS_X86); @@ -241,12 +245,16 @@ build(u32 flags, char *code_path, char *code_file, char *out_path, char *out_fil } build_ap(link_line, "%s", link_type_string); + for (u32 i = 0; code_files[i]; ++i){ + build_ap(line, "\"%s\\%s\"", code_path, code_files[i]); + } + swap_ptr(&line.build_options, &line.build_options_prev); swap_ptr(&link_line.build_options, &link_line.build_options_prev); swap_ptr(&line_prefix.build_options, &line_prefix.build_options_prev); Temp_Dir temp = pushdir(out_path); - systemf("%scl %s \"%s\\%s\" /Fe%s /link /INCREMENTAL:NO %s", line_prefix.build_options, line.build_options, code_path, code_file, out_file, link_line.build_options); + systemf("%scl %s /Fe%s /link /INCREMENTAL:NO %s", line_prefix.build_options, line.build_options, out_file, link_line.build_options); popdir(temp); } @@ -415,9 +423,9 @@ buildsuper(char *code_path, char *out_path, char *filename, b32 x86_build){ #if defined(IS_WINDOWS) -char *PLAT_LAYER[] = { "win32_4ed.cpp", 0 }; +char *PLAT_LAYER[] = { "platform_win32\\win32_4ed.cpp", 0 }; # if defined(IS_CL) -# define PLAT_INC "/I..\\code\\platform_all" +# define PLAT_INC "/I..\\code /I..\\code\\platform_all" # else # error PLAT_INC not defines for this compiler/platform combo # endif diff --git a/win32_4ed.cpp b/platform_win32/win32_4ed.cpp similarity index 100% rename from win32_4ed.cpp rename to platform_win32/win32_4ed.cpp diff --git a/win32_4ed_file_track.cpp b/platform_win32/win32_4ed_file_track.cpp similarity index 100% rename from win32_4ed_file_track.cpp rename to platform_win32/win32_4ed_file_track.cpp diff --git a/win32_4ed_fonts.cpp b/platform_win32/win32_4ed_fonts.cpp similarity index 100% rename from win32_4ed_fonts.cpp rename to platform_win32/win32_4ed_fonts.cpp diff --git a/win32_gl.h b/platform_win32/win32_gl.h similarity index 100% rename from win32_gl.h rename to platform_win32/win32_gl.h diff --git a/win32_utf8.cpp b/platform_win32/win32_utf8.cpp similarity index 100% rename from win32_utf8.cpp rename to platform_win32/win32_utf8.cpp diff --git a/win32_utf8.h b/platform_win32/win32_utf8.h similarity index 100% rename from win32_utf8.h rename to platform_win32/win32_utf8.h