From: Kevin Day Date: Tue, 13 Dec 2022 04:45:42 +0000 (-0600) Subject: Progress: Begin working on Featureless Make. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=fa9f5ee2e5a1fc940be0fc01ceb6ade8daaeb4dc;p=fll Progress: Begin working on Featureless Make. These are the initial changes I made while looking at what I am going to need to do. --- diff --git a/level_3/fake/c/common.c b/level_3/fake/c/common.c index 52ce637..84b220b 100644 --- a/level_3/fake/c/common.c +++ b/level_3/fake/c/common.c @@ -17,12 +17,7 @@ extern "C" { const f_string_static_t fake_program_help_parameters_s = macro_f_string_static_t_initialize(FAKE_program_help_parameters_s, 0, FAKE_program_help_parameters_s_length); #endif // _di_fake_program_help_parameter_s_ -/** - * The build operation utilizes pre-defined path structures. - * These structures are hard-coded by their individual pieces to be constructed later on. - */ #ifndef _di_fake_path_s_ - const f_string_static_t fake_path_part_bash_s = macro_f_string_static_t_initialize(FAKE_path_part_bash_s, 0, FAKE_path_part_bash_s_length); const f_string_static_t fake_path_part_build_s = macro_f_string_static_t_initialize(FAKE_path_part_build_s, 0, FAKE_path_part_build_s_length); const f_string_static_t fake_path_part_c_s = macro_f_string_static_t_initialize(FAKE_path_part_c_s, 0, FAKE_path_part_c_s_length); const f_string_static_t fake_path_part_cpp_s = macro_f_string_static_t_initialize(FAKE_path_part_cpp_s, 0, FAKE_path_part_cpp_s_length); @@ -37,6 +32,7 @@ extern "C" { const f_string_static_t fake_path_part_script_s = macro_f_string_static_t_initialize(FAKE_path_part_script_s, 0, FAKE_path_part_script_s_length); const f_string_static_t fake_path_part_settings_s = macro_f_string_static_t_initialize(FAKE_path_part_settings_s, 0, FAKE_path_part_settings_s_length); const f_string_static_t fake_path_part_shared_s = macro_f_string_static_t_initialize(FAKE_path_part_shared_s, 0, FAKE_path_part_shared_s_length); + const f_string_static_t fake_path_part_shell_s = macro_f_string_static_t_initialize(FAKE_path_part_shell_s, 0, FAKE_path_part_shell_s_length); const f_string_static_t fake_path_part_specifications_s = macro_f_string_static_t_initialize(FAKE_path_part_specifications_s, 0, FAKE_path_part_specifications_s_length); const f_string_static_t fake_path_part_stage_s = macro_f_string_static_t_initialize(FAKE_path_part_stage_s, 0, FAKE_path_part_stage_s_length); const f_string_static_t fake_path_part_static_s = macro_f_string_static_t_initialize(FAKE_path_part_static_s, 0, FAKE_path_part_static_s_length); @@ -70,6 +66,7 @@ extern "C" { const f_string_static_t fake_build_language_bash_s = macro_f_string_static_t_initialize(FAKE_build_language_bash_s, 0, FAKE_build_language_bash_s_length); const f_string_static_t fake_build_language_c_s = macro_f_string_static_t_initialize(FAKE_build_language_c_s, 0, FAKE_build_language_c_s_length); const f_string_static_t fake_build_language_cpp_s = macro_f_string_static_t_initialize(FAKE_build_language_cpp_s, 0, FAKE_build_language_cpp_s_length); + const f_string_static_t fake_build_language_zsh_s = macro_f_string_static_t_initialize(FAKE_build_language_zsh_s, 0, FAKE_build_language_zsh_s_length); #endif // _di_fake_build_language_s_ #ifndef _di_fake_build_version_s_ diff --git a/level_3/fake/c/common.h b/level_3/fake/c/common.h index 344153f..bda8931 100644 --- a/level_3/fake/c/common.h +++ b/level_3/fake/c/common.h @@ -64,6 +64,7 @@ extern "C" { */ #ifndef _di_fake_program_help_parameter_s_ #define FAKE_program_help_parameters_s "operation" + #define FAKE_program_help_parameters_s_length 9 extern const f_string_static_t fake_program_help_parameters_s; @@ -74,7 +75,6 @@ extern "C" { * These structures are hard-coded by their individual pieces to be constructed later on. */ #ifndef _di_fake_path_s_ - #define FAKE_path_part_bash_s "bash" F_path_separator_s #define FAKE_path_part_build_s "build" F_path_separator_s #define FAKE_path_part_c_s "c" F_path_separator_s #define FAKE_path_part_cpp_s "c++" F_path_separator_s @@ -89,11 +89,11 @@ extern "C" { #define FAKE_path_part_script_s "script" F_path_separator_s #define FAKE_path_part_settings_s "settings" F_path_separator_s #define FAKE_path_part_shared_s "shared" F_path_separator_s + #define FAKE_path_part_shell_s "shell" F_path_separator_s #define FAKE_path_part_specifications_s "specifications" F_path_separator_s #define FAKE_path_part_stage_s "stage" F_path_separator_s #define FAKE_path_part_static_s "static" F_path_separator_s - #define FAKE_path_part_bash_s_length 4 + F_path_separator_s_length #define FAKE_path_part_build_s_length 5 + F_path_separator_s_length #define FAKE_path_part_c_s_length 1 + F_path_separator_s_length #define FAKE_path_part_cpp_s_length 3 + F_path_separator_s_length @@ -108,11 +108,11 @@ extern "C" { #define FAKE_path_part_script_s_length 6 + F_path_separator_s_length #define FAKE_path_part_settings_s_length 8 + F_path_separator_s_length #define FAKE_path_part_shared_s_length 6 + F_path_separator_s_length + #define FAKE_path_part_shell_s_length 5 + F_path_separator_s_length #define FAKE_path_part_specifications_s_length 14 + F_path_separator_s_length #define FAKE_path_part_stage_s_length 5 + F_path_separator_s_length #define FAKE_path_part_static_s_length 6 + F_path_separator_s_length - extern const f_string_static_t fake_path_part_bash_s; extern const f_string_static_t fake_path_part_build_s; extern const f_string_static_t fake_path_part_c_s; extern const f_string_static_t fake_path_part_cpp_s; @@ -127,6 +127,7 @@ extern "C" { extern const f_string_static_t fake_path_part_script_s; extern const f_string_static_t fake_path_part_settings_s; extern const f_string_static_t fake_path_part_shared_s; + extern const f_string_static_t fake_path_part_shell_s; extern const f_string_static_t fake_path_part_specifications_s; extern const f_string_static_t fake_path_part_stage_s; extern const f_string_static_t fake_path_part_static_s; @@ -140,13 +141,13 @@ extern "C" { #define FAKE_file_dependencies_s "dependencies" #define FAKE_file_process_pre_s "process_pre.sh" #define FAKE_file_process_post_s "process_post.sh" - #define FAKE_file_readme_s "readme" + #define FAKE_file_readme_s "readme.txt" #define FAKE_file_defines_s_length 7 #define FAKE_file_dependencies_s_length 12 #define FAKE_file_process_pre_s_length 14 #define FAKE_file_process_post_s_length 15 - #define FAKE_file_readme_s_length 6 + #define FAKE_file_readme_s_length 10 extern const f_string_static_t fake_file_defines_s; extern const f_string_static_t fake_file_dependencies_s; @@ -159,10 +160,15 @@ extern "C" { * Default allocations. * * Set to at least 4 to provide a UTF-8 friendly allocation step. + * + * fake_default_allocation_*_d: + * - large: A buffer size used for large allocations. + * - pipe: A buffer size used for processing piped data. + * - small: A buffer size used for small allocations. */ #ifndef _di_fake_default_d_ - #define fake_default_allocation_pipe_d 16384 #define fake_default_allocation_large_d 64 + #define fake_default_allocation_pipe_d 16384 #define fake_default_allocation_small_d 8 #endif // _di_fake_default_d_ @@ -206,30 +212,46 @@ extern "C" { /** * The build language enumerations. + * + * fake_build_language_type_*_e: + * - bash: The GNU Bash language. + * - c: The C language. + * - cpp: The C++ language. + * - zsh: The ZSH language (Similar to and somewhat compatible with GNU Bash). */ #ifndef _di_fake_build_language_e_ enum { fake_build_language_type_bash_e = 1, fake_build_language_type_c_e, fake_build_language_type_cpp_e, + fake_build_language_type_zsh_e, }; // enum #endif // _di_fake_build_language_e_ /** * The build language strings. + * + * fake_build_language_*_s: + * - bash: The GNU Bash language. + * - c: The C language. + * - cpp: The C++ language. + * - zsh: The ZSH language (Similar to and somewhat compatible with GNU Bash). */ #ifndef _di_fake_build_language_s_ #define FAKE_build_language_bash_s "bash" #define FAKE_build_language_c_s "c" #define FAKE_build_language_cpp_s "c++" + #define FAKE_build_language_zsh_s "zsh" #define FAKE_build_language_bash_s_length 4 #define FAKE_build_language_c_s_length 1 #define FAKE_build_language_cpp_s_length 3 + #define FAKE_build_language_zsh_s_length 3 extern const f_string_static_t fake_build_language_bash_s; extern const f_string_static_t fake_build_language_c_s; extern const f_string_static_t fake_build_language_cpp_s; + extern const f_string_static_t fake_build_language_zsh_s; #endif // _di_fake_build_language_s_ /** @@ -266,6 +288,12 @@ extern "C" { /** * The program operation enumerations. + * + * fake_operation_*_e: + * - build: The build operation. + * - clean: The clean operation. + * - make: The make operation. + * - skeleton: The skeleton operation. */ #ifndef _di_fake_operation_e_ enum { @@ -278,12 +306,17 @@ extern "C" { /** * The program defines. + * + * fake_signal_*_d: + * - check: The normal signal check (@fixme is needed anymore as-is?). + * - check_tiny: The tiny check (@fixme is needed anymore as-is?). + * - check_short: The short signal check (@fixme this is used everywhere). */ -#ifndef _di_fake_d_ +#ifndef _di_fake_signal_d_ #define fake_signal_check_d 500000 #define fake_signal_check_tiny_d 4 #define fake_signal_check_short_d 16 -#endif // _di_fake_d_ +#endif // _di_fake_signal_d_ /** * The main program parameters. @@ -505,6 +538,7 @@ extern "C" { * * flag: Flags passed to the main function. * + * state: The state data used when processing the FSS data. * status: The main status code, generally used by the load settings and main functions. * * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not. @@ -514,6 +548,7 @@ extern "C" { typedef struct { uint16_t flag; + f_state_t state; f_status_t status; f_string_static_t line_first; @@ -524,6 +559,7 @@ extern "C" { { \ fake_main_flag_none_e, \ F_none, \ + f_state_t_initialize, \ f_string_static_t_initialize, \ f_string_static_t_initialize, \ } diff --git a/level_3/fake/c/fake.h b/level_3/fake/c/fake.h index 254ce0a..9657aa1 100644 --- a/level_3/fake/c/fake.h +++ b/level_3/fake/c/fake.h @@ -125,23 +125,6 @@ extern "C" { extern f_status_t fake_main(fll_program_data_t * const main, fake_setting_t * const setting); #endif // _di_fake_main_ -/** - * Deallocate main. - * - * @param main - * The main program data. - * - * @return - * F_none on success. - * - * Status codes (with error bit) are returned on any problem. - * - * @see fake_main() - */ -#ifndef _di_fake_main_delete_ - extern f_status_t fake_main_delete(fll_program_data_t * const main); -#endif // _di_fake_main_delete_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/fake/c/main.c b/level_3/fake/c/main.c index 1a1da04..dfba70a 100644 --- a/level_3/fake/c/main.c +++ b/level_3/fake/c/main.c @@ -1,19 +1,5 @@ #include "fake.h" -/** - * Standard entry point for fake program. - * - * @param argc - * The number of arguments. - * @param argv - * The array of arguments. - * - * @return - * 0 on success. - * 1 on error. - * - * @see exit() - */ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fll_program_data_t data = fll_program_data_t_initialize; diff --git a/level_3/fake/c/private-make-operate_process.h b/level_3/fake/c/private-make-operate_process.h index de77517..55b6e55 100644 --- a/level_3/fake/c/private-make-operate_process.h +++ b/level_3/fake/c/private-make-operate_process.h @@ -50,7 +50,7 @@ extern "C" { * - "\v": Vertical Tab. * - "\\": Backslash Character (may require additional slashes in certain circumstances.) * - "\0": NULL Character. - * - "\U+": Unicode Sequence (followed by a valid Unicode sequence with a minimum 4 hexidecimal digits and a maximum of 6 hexidecimal digits). + * - "\U+": Unicode Sequence (followed by a valid Unicode sequence with a minimum 4 hexadecimal digits and a maximum of 6 hexadecimal digits). * - "\!": Non-printing separator, allowing for "\U+000A\ 5" to be equivalent to "\n5". * * If the Unicode is invalid, then nothing is copied for that character (the invalid character is skipped when printing). @@ -58,7 +58,7 @@ extern "C" { * - "\U+000A": Prints a new line, equivalent to "\n". * - "\U+2E19": Prints the Unicode feather-like character "⸙". * - * Only ASCII alpha-numeric hexidecimal digits are allowed in the Unicode sequence (upper or lower case). + * Only ASCII alpha-numeric hexadecimal digits are allowed in the Unicode sequence (upper or lower case). * * Invalid or unknown escape sequences are not copied. * diff --git a/level_3/fake/c/private-skeleton.c b/level_3/fake/c/private-skeleton.c index 4a54032..c99a9b2 100644 --- a/level_3/fake/c/private-skeleton.c +++ b/level_3/fake/c/private-skeleton.c @@ -27,10 +27,10 @@ extern "C" { f_string_static_t sources_script = f_string_static_t_initialize; fake_skeleton_path_source_length(data, &f_string_empty_s, &sources); - fake_skeleton_path_source_length(data, &fake_path_part_bash_s, &sources_bash); fake_skeleton_path_source_length(data, &fake_path_part_c_s, &sources_c); fake_skeleton_path_source_length(data, &fake_path_part_cpp_s, &sources_cpp); fake_skeleton_path_source_length(data, &fake_path_part_script_s, &sources_script); + fake_skeleton_path_source_length(data, &fake_path_part_shell_s, &sources_bash); f_char_t sources_string[sources.used + 1]; f_char_t sources_bash_string[sources_bash.used + 1]; @@ -45,10 +45,10 @@ extern "C" { sources_script.string = sources_script_string; fake_skeleton_path_source_string(data, &f_string_empty_s, &sources); - fake_skeleton_path_source_string(data, &fake_path_part_bash_s, &sources_bash); fake_skeleton_path_source_string(data, &fake_path_part_c_s, &sources_c); fake_skeleton_path_source_string(data, &fake_path_part_cpp_s, &sources_cpp); fake_skeleton_path_source_string(data, &fake_path_part_script_s, &sources_script); + fake_skeleton_path_source_string(data, &fake_path_part_shell_s, &sources_bash); const f_string_static_t *parameters_value[] = { &data->path_build,