From: Kevin Day Date: Sat, 1 May 2021 22:31:49 +0000 (-0500) Subject: Cleanup: Always have private-common.h and private-common.c for programs. X-Git-Tag: 0.5.4~72 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=0d3ee9f643bedd0bbdbc7cdcb6dcba8a498704e4;p=fll Cleanup: Always have private-common.h and private-common.c for programs. I am now introducing a new standard practice of always having a private-common.h and private-common.c for programs. The private data types shared across the program will be stored in these. These will also provide any functions for allocating, deallocating, or otherwise managing those private structures. This makes no effort to move over or implement any of the allocation/deallocation functions. Individual programs will be updated on an as able basis to address this. The Controller program already has this but it has a bit more than this practice. The Controller program will see some structural cleanup in the future. --- diff --git a/level_3/byte_dump/c/byte_dump.c b/level_3/byte_dump/c/byte_dump.c index c12ccdc..e41fcee 100644 --- a/level_3/byte_dump/c/byte_dump.c +++ b/level_3/byte_dump/c/byte_dump.c @@ -1,4 +1,5 @@ #include "byte_dump.h" +#include "private-common.h" #include "private-byte_dump.h" #ifdef __cplusplus diff --git a/level_3/byte_dump/c/private-byte_dump.c b/level_3/byte_dump/c/private-byte_dump.c index 130df38..53eda39 100644 --- a/level_3/byte_dump/c/private-byte_dump.c +++ b/level_3/byte_dump/c/private-byte_dump.c @@ -1,4 +1,5 @@ #include "byte_dump.h" +#include "private-common.h" #include "private-byte_dump.h" #ifdef __cplusplus diff --git a/level_3/byte_dump/c/private-byte_dump.h b/level_3/byte_dump/c/private-byte_dump.h index 982bd52..9fb714a 100644 --- a/level_3/byte_dump/c/private-byte_dump.h +++ b/level_3/byte_dump/c/private-byte_dump.h @@ -13,49 +13,6 @@ extern "C" { #endif /** - * A main structure for character row and column position (cell). - * - * column: The column position associated with the character cell. - * row: The row position associated with the character cell. - */ -#ifndef _di_byte_dump_cell_t_ - typedef struct { - uint8_t column; - uint64_t row; - } byte_dump_cell_t; - - #define byte_dump_cell_t_initialize \ - { \ - 0, \ - 0, \ - } -#endif // _di_byte_dump_cell_t_ - -/** - * A main structure for character main that overflowed from a previous line. - * - * UTF-8 Characters bytes may overflow beyond the main.width. - * These overflowed bytes should still have placeholders printed in the next text-mode print. - * - * bytes: The number of previous bytes that overflowed from the previous line. - * This is used to print the placeholders for the "text" option. - * invalid: The specific invalid value provided representing the overflowed bytes. - * This is used to print the placeholders. - */ -#ifndef _di_byte_dump_previous_t_ - typedef struct { - uint8_t bytes; - uint8_t invalid; - } byte_dump_previous_t; - - #define byte_dump_previous_t_initialize \ - { \ - 0, \ - 0, \ - } -#endif // _di_byte_previous_cell_ - -/** * Dump the contents of the file to standard out. * * @param main diff --git a/level_3/byte_dump/c/private-common.c b/level_3/byte_dump/c/private-common.c new file mode 100644 index 0000000..820be90 --- /dev/null +++ b/level_3/byte_dump/c/private-common.c @@ -0,0 +1,10 @@ +#include "byte_dump.h" +#include "private-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/byte_dump/c/private-common.h b/level_3/byte_dump/c/private-common.h new file mode 100644 index 0000000..6604c7e --- /dev/null +++ b/level_3/byte_dump/c/private-common.h @@ -0,0 +1,62 @@ +/** + * FLL - Level 3 + * + * Project: Byte Dump + * API Version: 0.5 + * Licenses: lgplv2.1 + */ +#ifndef _PRIVATE_common_h +#define _PRIVATE_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * A main structure for character row and column position (cell). + * + * column: The column position associated with the character cell. + * row: The row position associated with the character cell. + */ +#ifndef _di_byte_dump_cell_t_ + typedef struct { + uint8_t column; + uint64_t row; + } byte_dump_cell_t; + + #define byte_dump_cell_t_initialize \ + { \ + 0, \ + 0, \ + } +#endif // _di_byte_dump_cell_t_ + +/** + * A main structure for character main that overflowed from a previous line. + * + * UTF-8 Characters bytes may overflow beyond the main.width. + * These overflowed bytes should still have placeholders printed in the next text-mode print. + * + * bytes: The number of previous bytes that overflowed from the previous line. + * This is used to print the placeholders for the "text" option. + * invalid: The specific invalid value provided representing the overflowed bytes. + * This is used to print the placeholders. + */ +#ifndef _di_byte_dump_previous_t_ + typedef struct { + uint8_t bytes; + uint8_t invalid; + } byte_dump_previous_t; + + #define byte_dump_previous_t_initialize \ + { \ + 0, \ + 0, \ + } +#endif // _di_byte_previous_cell_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_common_h diff --git a/level_3/byte_dump/data/build/settings b/level_3/byte_dump/data/build/settings index 29d5142..32acc07 100644 --- a/level_3/byte_dump/data/build/settings +++ b/level_3/byte_dump/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-individual -lfll_error -lfll_program -lfl_console -lfl_conversion -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library byte_dump.c private-byte_dump.c +build_sources_library byte_dump.c private-common.c private-byte_dump.c build_sources_program main.c build_sources_headers byte_dump.h build_sources_script diff --git a/level_3/control/c/control.c b/level_3/control/c/control.c index a848a74..c73006f 100644 --- a/level_3/control/c/control.c +++ b/level_3/control/c/control.c @@ -1,4 +1,5 @@ #include "control.h" +#include "private-common.h" #include "private-control.h" #ifdef __cplusplus diff --git a/level_3/control/c/private-common.c b/level_3/control/c/private-common.c new file mode 100644 index 0000000..d869788 --- /dev/null +++ b/level_3/control/c/private-common.c @@ -0,0 +1,10 @@ +#include "control.h" +#include "private-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/control/c/private-common.h b/level_3/control/c/private-common.h new file mode 100644 index 0000000..e69de29 diff --git a/level_3/control/c/private-control.c b/level_3/control/c/private-control.c index 6000946..36996d8 100644 --- a/level_3/control/c/private-control.c +++ b/level_3/control/c/private-control.c @@ -1,2 +1,3 @@ #include "control.h" +#include "private-common.h" #include "private-control.h" diff --git a/level_3/control/data/build/settings b/level_3/control/data/build/settings index 652563f..812d9ab 100644 --- a/level_3/control/data/build/settings +++ b/level_3/control/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-individual -lfll_error -lfll_program -lfl_console -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library control.c private-control.c +build_sources_library control.c private-common.c private-control.c build_sources_program main.c build_sources_headers control.h build_sources_script diff --git a/level_3/fake/c/fake.c b/level_3/fake/c/fake.c index b5a78a5..1c4bdea 100644 --- a/level_3/fake/c/fake.c +++ b/level_3/fake/c/fake.c @@ -1,4 +1,5 @@ #include "fake.h" +#include "private-common.h" #include "private-fake.h" #include "private-build.h" #include "private-clean.h" diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index 8fc0e17..8968852 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -1,4 +1,5 @@ #include "fake.h" +#include "private-common.h" #include "private-fake.h" #include "private-build.h" #include "private-make.h" diff --git a/level_3/fake/c/private-build.h b/level_3/fake/c/private-build.h index 077fabd..9745131 100644 --- a/level_3/fake/c/private-build.h +++ b/level_3/fake/c/private-build.h @@ -12,379 +12,6 @@ extern "C" { #endif -#ifndef _di_fake_build_setting_t_ - typedef struct { - uint8_t build_language; - - uint8_t version_target; - - bool build_script; - bool build_shared; - bool build_static; - - bool path_standard; - bool path_headers_preserve; - - bool search_exclusive; - bool search_shared; - bool search_static; - - f_string_dynamic_t build_compiler; - f_string_dynamic_t build_indexer; - f_string_dynamic_t path_headers; - f_string_dynamic_t path_language; - f_string_dynamic_t path_library_script; - f_string_dynamic_t path_library_shared; - f_string_dynamic_t path_library_static; - f_string_dynamic_t path_program_script; - f_string_dynamic_t path_program_shared; - f_string_dynamic_t path_program_static; - f_string_dynamic_t path_sources; - f_string_dynamic_t process_post; - f_string_dynamic_t process_pre; - f_string_dynamic_t project_name; - f_string_dynamic_t version_major; - f_string_dynamic_t version_micro; - f_string_dynamic_t version_minor; - - f_string_dynamics_t build_libraries; - f_string_dynamics_t build_sources_headers; - f_string_dynamics_t build_sources_library; - f_string_dynamics_t build_sources_program; - f_string_dynamics_t build_sources_setting; - f_string_dynamics_t build_sources_script; - f_string_dynamics_t defines_all; - f_string_dynamics_t defines_shared; - f_string_dynamics_t defines_static; - f_string_dynamics_t environment; - f_string_dynamics_t flags_all; - f_string_dynamics_t flags_library; - f_string_dynamics_t flags_program; - f_string_dynamics_t flags_shared; - f_string_dynamics_t flags_static; - f_string_dynamics_t modes; - f_string_dynamics_t modes_default; - } fake_build_setting_t; - - #define fake_build_setting_t_initialize { \ - 0, \ - 0, \ - F_true, \ - F_true, \ - F_true, \ - F_true, \ - F_true, \ - F_true, \ - F_true, \ - F_true, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - } - - #define macro_fake_build_setting_t_delete_simple(setting) \ - macro_f_string_dynamic_t_delete_simple(setting.build_compiler); \ - macro_f_string_dynamic_t_delete_simple(setting.build_indexer); \ - macro_f_string_dynamic_t_delete_simple(setting.path_headers); \ - macro_f_string_dynamic_t_delete_simple(setting.path_language); \ - macro_f_string_dynamic_t_delete_simple(setting.path_library_script); \ - macro_f_string_dynamic_t_delete_simple(setting.path_library_shared); \ - macro_f_string_dynamic_t_delete_simple(setting.path_library_static); \ - macro_f_string_dynamic_t_delete_simple(setting.path_program_script); \ - macro_f_string_dynamic_t_delete_simple(setting.path_program_shared); \ - macro_f_string_dynamic_t_delete_simple(setting.path_program_static); \ - macro_f_string_dynamic_t_delete_simple(setting.path_sources); \ - macro_f_string_dynamic_t_delete_simple(setting.process_post); \ - macro_f_string_dynamic_t_delete_simple(setting.process_pre); \ - macro_f_string_dynamic_t_delete_simple(setting.project_name); \ - macro_f_string_dynamic_t_delete_simple(setting.version_major); \ - macro_f_string_dynamic_t_delete_simple(setting.version_micro); \ - macro_f_string_dynamic_t_delete_simple(setting.version_minor); \ - macro_f_string_dynamics_t_delete_simple(setting.build_libraries); \ - macro_f_string_dynamics_t_delete_simple(setting.build_sources_headers); \ - macro_f_string_dynamics_t_delete_simple(setting.build_sources_library); \ - macro_f_string_dynamics_t_delete_simple(setting.build_sources_program); \ - macro_f_string_dynamics_t_delete_simple(setting.build_sources_setting); \ - macro_f_string_dynamics_t_delete_simple(setting.build_sources_script); \ - macro_f_string_dynamics_t_delete_simple(setting.defines_all); \ - macro_f_string_dynamics_t_delete_simple(setting.defines_shared); \ - macro_f_string_dynamics_t_delete_simple(setting.defines_static); \ - macro_f_string_dynamics_t_delete_simple(setting.environment); \ - macro_f_string_dynamics_t_delete_simple(setting.flags_all); \ - macro_f_string_dynamics_t_delete_simple(setting.flags_library); \ - macro_f_string_dynamics_t_delete_simple(setting.flags_program); \ - macro_f_string_dynamics_t_delete_simple(setting.flags_shared); \ - macro_f_string_dynamics_t_delete_simple(setting.flags_static); \ - macro_f_string_dynamics_t_delete_simple(setting.modes); \ - macro_f_string_dynamics_t_delete_simple(setting.modes_default); - - #define fake_build_setting_name_build_compiler "build_compiler" - #define fake_build_setting_name_build_language "build_language" - #define fake_build_setting_name_build_libraries "build_libraries" - #define fake_build_setting_name_build_indexer "build_indexer" - #define fake_build_setting_name_build_script "build_script" - #define fake_build_setting_name_build_shared "build_shared" - #define fake_build_setting_name_build_sources_headers "build_sources_headers" - #define fake_build_setting_name_build_sources_library "build_sources_library" - #define fake_build_setting_name_build_sources_program "build_sources_program" - #define fake_build_setting_name_build_sources_settings "build_sources_setting" - #define fake_build_setting_name_build_sources_script "build_sources_script" - #define fake_build_setting_name_build_static "build_static" - #define fake_build_setting_name_defines_all "defines_all" - #define fake_build_setting_name_defines_shared "defines_shared" - #define fake_build_setting_name_defines_static "defines_static" - #define fake_build_setting_name_environment "environment" - #define fake_build_setting_name_flags_all "flags_all" - #define fake_build_setting_name_flags_library "flags_library" - #define fake_build_setting_name_flags_program "flags_program" - #define fake_build_setting_name_flags_shared "flags_shared" - #define fake_build_setting_name_flags_static "flags_static" - #define fake_build_setting_name_modes "modes" - #define fake_build_setting_name_modes_default "modes_default" - #define fake_build_setting_name_path_headers "path_headers" - #define fake_build_setting_name_path_headers_preserve "path_headers_preserve" - #define fake_build_setting_name_path_language "path_language" - #define fake_build_setting_name_path_library_script "path_library_script" - #define fake_build_setting_name_path_library_shared "path_library_shared" - #define fake_build_setting_name_path_library_static "path_library_static" - #define fake_build_setting_name_path_program_script "path_program_script" - #define fake_build_setting_name_path_program_shared "path_program_shared" - #define fake_build_setting_name_path_program_static "path_program_static" - #define fake_build_setting_name_path_sources "path_sources" - #define fake_build_setting_name_path_standard "path_standard" - #define fake_build_setting_name_process_post "process_post" - #define fake_build_setting_name_process_pre "process_pre" - #define fake_build_setting_name_project_name "project_name" - #define fake_build_setting_name_search_exclusive "search_exclusive" - #define fake_build_setting_name_search_shared "search_shared" - #define fake_build_setting_name_search_static "search_static" - #define fake_build_setting_name_version_major "version_major" - #define fake_build_setting_name_version_micro "version_micro" - #define fake_build_setting_name_version_minor "version_minor" - #define fake_build_setting_name_version_target "version_target" - - #define fake_build_setting_name_build_compiler_length 14 - #define fake_build_setting_name_build_language_length 14 - #define fake_build_setting_name_build_libraries_length 15 - #define fake_build_setting_name_build_indexer_length 13 - #define fake_build_setting_name_build_script_length 12 - #define fake_build_setting_name_build_shared_length 12 - #define fake_build_setting_name_build_sources_headers_length 21 - #define fake_build_setting_name_build_sources_library_length 21 - #define fake_build_setting_name_build_sources_program_length 21 - #define fake_build_setting_name_build_sources_settings_length 22 - #define fake_build_setting_name_build_sources_script_length 20 - #define fake_build_setting_name_build_static_length 12 - #define fake_build_setting_name_environment_length 11 - #define fake_build_setting_name_defines_all_length 11 - #define fake_build_setting_name_defines_shared_length 14 - #define fake_build_setting_name_defines_static_length 14 - #define fake_build_setting_name_flags_all_length 9 - #define fake_build_setting_name_flags_library_length 13 - #define fake_build_setting_name_flags_program_length 13 - #define fake_build_setting_name_flags_shared_length 12 - #define fake_build_setting_name_flags_static_length 12 - #define fake_build_setting_name_modes_length 5 - #define fake_build_setting_name_modes_default_length 13 - #define fake_build_setting_name_path_headers_length 12 - #define fake_build_setting_name_path_headers_preserve_length 21 - #define fake_build_setting_name_path_language_length 13 - #define fake_build_setting_name_path_library_script_length 19 - #define fake_build_setting_name_path_library_shared_length 19 - #define fake_build_setting_name_path_library_static_length 19 - #define fake_build_setting_name_path_program_script_length 19 - #define fake_build_setting_name_path_program_shared_length 19 - #define fake_build_setting_name_path_program_static_length 19 - #define fake_build_setting_name_path_sources_length 12 - #define fake_build_setting_name_path_standard_length 13 - #define fake_build_setting_name_process_post_length 12 - #define fake_build_setting_name_process_pre_length 11 - #define fake_build_setting_name_project_name_length 12 - #define fake_build_setting_name_search_exclusive_length 16 - #define fake_build_setting_name_search_shared_length 13 - #define fake_build_setting_name_search_static_length 13 - #define fake_build_setting_name_version_major_length 13 - #define fake_build_setting_name_version_micro_length 13 - #define fake_build_setting_name_version_minor_length 13 - #define fake_build_setting_name_version_target_length 14 - - #define fake_build_setting_total 44 - - #define fake_build_setting_default_version "0" - - #define fake_build_setting_default_version_length 1 -#endif // _di_fake_build_setting_t_ - -#ifndef _di_fake_build_stage_t_ - typedef struct { - f_string_dynamic_t file_libraries_script; - f_string_dynamic_t file_libraries_shared; - f_string_dynamic_t file_libraries_static; - f_string_dynamic_t file_objects_static; - f_string_dynamic_t file_process_post; - f_string_dynamic_t file_process_pre; - f_string_dynamic_t file_programs_script; - f_string_dynamic_t file_programs_shared; - f_string_dynamic_t file_programs_static; - f_string_dynamic_t file_skeleton; - f_string_dynamic_t file_sources_headers; - f_string_dynamic_t file_sources_script; - f_string_dynamic_t file_sources_settings; - } fake_build_stage_t; - - #define fake_build_stage_t_initialize { \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - } - - #define fake_build_stage_total 13 - - #define macro_fake_build_stage_t_delete_simple(stage) \ - macro_f_string_dynamic_t_delete_simple(stage.file_libraries_script); \ - macro_f_string_dynamic_t_delete_simple(stage.file_libraries_shared); \ - macro_f_string_dynamic_t_delete_simple(stage.file_libraries_static); \ - macro_f_string_dynamic_t_delete_simple(stage.file_objects_static); \ - macro_f_string_dynamic_t_delete_simple(stage.file_process_post); \ - macro_f_string_dynamic_t_delete_simple(stage.file_process_pre); \ - macro_f_string_dynamic_t_delete_simple(stage.file_programs_script); \ - macro_f_string_dynamic_t_delete_simple(stage.file_programs_shared); \ - macro_f_string_dynamic_t_delete_simple(stage.file_programs_static); \ - macro_f_string_dynamic_t_delete_simple(stage.file_skeleton); \ - macro_f_string_dynamic_t_delete_simple(stage.file_sources_headers); \ - macro_f_string_dynamic_t_delete_simple(stage.file_sources_script); \ - macro_f_string_dynamic_t_delete_simple(stage.file_sources_settings); - - #define fake_build_stage_built ".built" - #define fake_build_stage_libraries_script "libraries_script" - #define fake_build_stage_libraries_shared "libraries_shared" - #define fake_build_stage_libraries_static "libraries_static" - #define fake_build_stage_objects_static "objects_static" - #define fake_build_stage_process_post "process_post" - #define fake_build_stage_process_pre "process_pre" - #define fake_build_stage_programs_script "programs_script" - #define fake_build_stage_programs_shared "programs_shared" - #define fake_build_stage_programs_static "programs_static" - #define fake_build_stage_separate "-" - #define fake_build_stage_skeleton "skeleton" - #define fake_build_stage_sources_headers "sources_headers" - #define fake_build_stage_sources_script "sources_script" - #define fake_build_stage_sources_settings "sources_settings" - - #define fake_build_stage_built_length 6 - #define fake_build_stage_libraries_script_length 16 - #define fake_build_stage_libraries_shared_length 16 - #define fake_build_stage_libraries_static_length 16 - #define fake_build_stage_objects_static_length 14 - #define fake_build_stage_process_post_length 12 - #define fake_build_stage_process_pre_length 11 - #define fake_build_stage_programs_script_length 15 - #define fake_build_stage_programs_shared_length 15 - #define fake_build_stage_programs_static_length 15 - #define fake_build_stage_separate_length 1 - #define fake_build_stage_skeleton_length 8 - #define fake_build_stage_sources_headers_length 15 - #define fake_build_stage_sources_script_length 14 - #define fake_build_stage_sources_settings_length 16 -#endif // _di_fake_build_stage_t_ - -#ifndef _di_fake_build_data_t_ - typedef struct { - fake_build_setting_t setting; - f_string_maps_t environment; - } fake_build_data_t; - - #define fake_build_data_t_initialize { \ - fake_build_setting_t_initialize, \ - f_string_maps_t_initialize, \ - } - - #define macro_fake_build_main_delete_simple(build) \ - macro_fake_build_setting_t_delete_simple(build.setting) \ - macro_f_string_maps_t_delete_simple(build.environment); -#endif // _di_fake_build_data_t_ - -#ifndef _di_fake_build_parameter_ - #define fake_build_parameter_library_include "-I" - #define fake_build_parameter_library_link_file "-l" - #define fake_build_parameter_library_link_path "-L" - #define fake_build_parameter_library_name_prefix "lib" - #define fake_build_parameter_library_name_suffix_shared ".so" - #define fake_build_parameter_library_name_suffix_static ".a" - #define fake_build_parameter_library_output "-o" - #define fake_build_parameter_library_separator "." - #define fake_build_parameter_library_shared "-shared" - #define fake_build_parameter_library_static "-static" - #define fake_build_parameter_library_shared_prefix "-Wl,-soname," - - #define fake_build_parameter_library_include_length 2 - #define fake_build_parameter_library_link_file_length 2 - #define fake_build_parameter_library_link_path_length 2 - #define fake_build_parameter_library_name_prefix_length 3 - #define fake_build_parameter_library_name_suffix_shared_length 3 - #define fake_build_parameter_library_name_suffix_static_length 2 - #define fake_build_parameter_library_output_length 2 - #define fake_build_parameter_library_separator_length 1 - #define fake_build_parameter_library_shared_length 7 - #define fake_build_parameter_library_static_length 7 - #define fake_build_parameter_library_shared_prefix_length 12 - - #define fake_build_parameter_object_compile "-c" - #define fake_build_parameter_object_name_suffix ".o" - #define fake_build_parameter_object_output "-o" - #define fake_build_parameter_object_static "-static" - - #define fake_build_parameter_object_compile_length 2 - #define fake_build_parameter_object_name_suffix_length 2 - #define fake_build_parameter_object_output_length 2 - #define fake_build_parameter_object_static_length 7 - - #define fake_build_parameter_object_link_arguments "rcs" - - #define fake_build_parameter_object_link_arguments_length 3 -#endif // _di_fake_build_parameter_ - /** * Add the standard arguments for building a library/program. * diff --git a/level_3/fake/c/private-clean.c b/level_3/fake/c/private-clean.c index e04bd68..c002ce9 100644 --- a/level_3/fake/c/private-clean.c +++ b/level_3/fake/c/private-clean.c @@ -1,4 +1,5 @@ #include "fake.h" +#include "private-common.h" #include "private-fake.h" #include "private-build.h" #include "private-clean.h" diff --git a/level_3/fake/c/private-common.c b/level_3/fake/c/private-common.c new file mode 100644 index 0000000..1d7722e --- /dev/null +++ b/level_3/fake/c/private-common.c @@ -0,0 +1,10 @@ +#include "fake.h" +#include "private-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fake/c/private-common.h b/level_3/fake/c/private-common.h new file mode 100644 index 0000000..3dd5aba --- /dev/null +++ b/level_3/fake/c/private-common.h @@ -0,0 +1,794 @@ +/** + * FLL - Level 3 + * + * Project: Featureless Make + * API Version: 0.5 + * Licenses: lgplv2.1 + */ +#ifndef _PRIVATE_common_h +#define _PRIVATE_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_fake_build_setting_t_ + typedef struct { + uint8_t build_language; + + uint8_t version_target; + + bool build_script; + bool build_shared; + bool build_static; + + bool path_standard; + bool path_headers_preserve; + + bool search_exclusive; + bool search_shared; + bool search_static; + + f_string_dynamic_t build_compiler; + f_string_dynamic_t build_indexer; + f_string_dynamic_t path_headers; + f_string_dynamic_t path_language; + f_string_dynamic_t path_library_script; + f_string_dynamic_t path_library_shared; + f_string_dynamic_t path_library_static; + f_string_dynamic_t path_program_script; + f_string_dynamic_t path_program_shared; + f_string_dynamic_t path_program_static; + f_string_dynamic_t path_sources; + f_string_dynamic_t process_post; + f_string_dynamic_t process_pre; + f_string_dynamic_t project_name; + f_string_dynamic_t version_major; + f_string_dynamic_t version_micro; + f_string_dynamic_t version_minor; + + f_string_dynamics_t build_libraries; + f_string_dynamics_t build_sources_headers; + f_string_dynamics_t build_sources_library; + f_string_dynamics_t build_sources_program; + f_string_dynamics_t build_sources_setting; + f_string_dynamics_t build_sources_script; + f_string_dynamics_t defines_all; + f_string_dynamics_t defines_shared; + f_string_dynamics_t defines_static; + f_string_dynamics_t environment; + f_string_dynamics_t flags_all; + f_string_dynamics_t flags_library; + f_string_dynamics_t flags_program; + f_string_dynamics_t flags_shared; + f_string_dynamics_t flags_static; + f_string_dynamics_t modes; + f_string_dynamics_t modes_default; + } fake_build_setting_t; + + #define fake_build_setting_t_initialize { \ + 0, \ + 0, \ + F_true, \ + F_true, \ + F_true, \ + F_true, \ + F_true, \ + F_true, \ + F_true, \ + F_true, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + } + + #define macro_fake_build_setting_t_delete_simple(setting) \ + macro_f_string_dynamic_t_delete_simple(setting.build_compiler); \ + macro_f_string_dynamic_t_delete_simple(setting.build_indexer); \ + macro_f_string_dynamic_t_delete_simple(setting.path_headers); \ + macro_f_string_dynamic_t_delete_simple(setting.path_language); \ + macro_f_string_dynamic_t_delete_simple(setting.path_library_script); \ + macro_f_string_dynamic_t_delete_simple(setting.path_library_shared); \ + macro_f_string_dynamic_t_delete_simple(setting.path_library_static); \ + macro_f_string_dynamic_t_delete_simple(setting.path_program_script); \ + macro_f_string_dynamic_t_delete_simple(setting.path_program_shared); \ + macro_f_string_dynamic_t_delete_simple(setting.path_program_static); \ + macro_f_string_dynamic_t_delete_simple(setting.path_sources); \ + macro_f_string_dynamic_t_delete_simple(setting.process_post); \ + macro_f_string_dynamic_t_delete_simple(setting.process_pre); \ + macro_f_string_dynamic_t_delete_simple(setting.project_name); \ + macro_f_string_dynamic_t_delete_simple(setting.version_major); \ + macro_f_string_dynamic_t_delete_simple(setting.version_micro); \ + macro_f_string_dynamic_t_delete_simple(setting.version_minor); \ + macro_f_string_dynamics_t_delete_simple(setting.build_libraries); \ + macro_f_string_dynamics_t_delete_simple(setting.build_sources_headers); \ + macro_f_string_dynamics_t_delete_simple(setting.build_sources_library); \ + macro_f_string_dynamics_t_delete_simple(setting.build_sources_program); \ + macro_f_string_dynamics_t_delete_simple(setting.build_sources_setting); \ + macro_f_string_dynamics_t_delete_simple(setting.build_sources_script); \ + macro_f_string_dynamics_t_delete_simple(setting.defines_all); \ + macro_f_string_dynamics_t_delete_simple(setting.defines_shared); \ + macro_f_string_dynamics_t_delete_simple(setting.defines_static); \ + macro_f_string_dynamics_t_delete_simple(setting.environment); \ + macro_f_string_dynamics_t_delete_simple(setting.flags_all); \ + macro_f_string_dynamics_t_delete_simple(setting.flags_library); \ + macro_f_string_dynamics_t_delete_simple(setting.flags_program); \ + macro_f_string_dynamics_t_delete_simple(setting.flags_shared); \ + macro_f_string_dynamics_t_delete_simple(setting.flags_static); \ + macro_f_string_dynamics_t_delete_simple(setting.modes); \ + macro_f_string_dynamics_t_delete_simple(setting.modes_default); + + #define fake_build_setting_name_build_compiler "build_compiler" + #define fake_build_setting_name_build_language "build_language" + #define fake_build_setting_name_build_libraries "build_libraries" + #define fake_build_setting_name_build_indexer "build_indexer" + #define fake_build_setting_name_build_script "build_script" + #define fake_build_setting_name_build_shared "build_shared" + #define fake_build_setting_name_build_sources_headers "build_sources_headers" + #define fake_build_setting_name_build_sources_library "build_sources_library" + #define fake_build_setting_name_build_sources_program "build_sources_program" + #define fake_build_setting_name_build_sources_settings "build_sources_setting" + #define fake_build_setting_name_build_sources_script "build_sources_script" + #define fake_build_setting_name_build_static "build_static" + #define fake_build_setting_name_defines_all "defines_all" + #define fake_build_setting_name_defines_shared "defines_shared" + #define fake_build_setting_name_defines_static "defines_static" + #define fake_build_setting_name_environment "environment" + #define fake_build_setting_name_flags_all "flags_all" + #define fake_build_setting_name_flags_library "flags_library" + #define fake_build_setting_name_flags_program "flags_program" + #define fake_build_setting_name_flags_shared "flags_shared" + #define fake_build_setting_name_flags_static "flags_static" + #define fake_build_setting_name_modes "modes" + #define fake_build_setting_name_modes_default "modes_default" + #define fake_build_setting_name_path_headers "path_headers" + #define fake_build_setting_name_path_headers_preserve "path_headers_preserve" + #define fake_build_setting_name_path_language "path_language" + #define fake_build_setting_name_path_library_script "path_library_script" + #define fake_build_setting_name_path_library_shared "path_library_shared" + #define fake_build_setting_name_path_library_static "path_library_static" + #define fake_build_setting_name_path_program_script "path_program_script" + #define fake_build_setting_name_path_program_shared "path_program_shared" + #define fake_build_setting_name_path_program_static "path_program_static" + #define fake_build_setting_name_path_sources "path_sources" + #define fake_build_setting_name_path_standard "path_standard" + #define fake_build_setting_name_process_post "process_post" + #define fake_build_setting_name_process_pre "process_pre" + #define fake_build_setting_name_project_name "project_name" + #define fake_build_setting_name_search_exclusive "search_exclusive" + #define fake_build_setting_name_search_shared "search_shared" + #define fake_build_setting_name_search_static "search_static" + #define fake_build_setting_name_version_major "version_major" + #define fake_build_setting_name_version_micro "version_micro" + #define fake_build_setting_name_version_minor "version_minor" + #define fake_build_setting_name_version_target "version_target" + + #define fake_build_setting_name_build_compiler_length 14 + #define fake_build_setting_name_build_language_length 14 + #define fake_build_setting_name_build_libraries_length 15 + #define fake_build_setting_name_build_indexer_length 13 + #define fake_build_setting_name_build_script_length 12 + #define fake_build_setting_name_build_shared_length 12 + #define fake_build_setting_name_build_sources_headers_length 21 + #define fake_build_setting_name_build_sources_library_length 21 + #define fake_build_setting_name_build_sources_program_length 21 + #define fake_build_setting_name_build_sources_settings_length 22 + #define fake_build_setting_name_build_sources_script_length 20 + #define fake_build_setting_name_build_static_length 12 + #define fake_build_setting_name_environment_length 11 + #define fake_build_setting_name_defines_all_length 11 + #define fake_build_setting_name_defines_shared_length 14 + #define fake_build_setting_name_defines_static_length 14 + #define fake_build_setting_name_flags_all_length 9 + #define fake_build_setting_name_flags_library_length 13 + #define fake_build_setting_name_flags_program_length 13 + #define fake_build_setting_name_flags_shared_length 12 + #define fake_build_setting_name_flags_static_length 12 + #define fake_build_setting_name_modes_length 5 + #define fake_build_setting_name_modes_default_length 13 + #define fake_build_setting_name_path_headers_length 12 + #define fake_build_setting_name_path_headers_preserve_length 21 + #define fake_build_setting_name_path_language_length 13 + #define fake_build_setting_name_path_library_script_length 19 + #define fake_build_setting_name_path_library_shared_length 19 + #define fake_build_setting_name_path_library_static_length 19 + #define fake_build_setting_name_path_program_script_length 19 + #define fake_build_setting_name_path_program_shared_length 19 + #define fake_build_setting_name_path_program_static_length 19 + #define fake_build_setting_name_path_sources_length 12 + #define fake_build_setting_name_path_standard_length 13 + #define fake_build_setting_name_process_post_length 12 + #define fake_build_setting_name_process_pre_length 11 + #define fake_build_setting_name_project_name_length 12 + #define fake_build_setting_name_search_exclusive_length 16 + #define fake_build_setting_name_search_shared_length 13 + #define fake_build_setting_name_search_static_length 13 + #define fake_build_setting_name_version_major_length 13 + #define fake_build_setting_name_version_micro_length 13 + #define fake_build_setting_name_version_minor_length 13 + #define fake_build_setting_name_version_target_length 14 + + #define fake_build_setting_total 44 + + #define fake_build_setting_default_version "0" + + #define fake_build_setting_default_version_length 1 +#endif // _di_fake_build_setting_t_ + +#ifndef _di_fake_build_stage_t_ + typedef struct { + f_string_dynamic_t file_libraries_script; + f_string_dynamic_t file_libraries_shared; + f_string_dynamic_t file_libraries_static; + f_string_dynamic_t file_objects_static; + f_string_dynamic_t file_process_post; + f_string_dynamic_t file_process_pre; + f_string_dynamic_t file_programs_script; + f_string_dynamic_t file_programs_shared; + f_string_dynamic_t file_programs_static; + f_string_dynamic_t file_skeleton; + f_string_dynamic_t file_sources_headers; + f_string_dynamic_t file_sources_script; + f_string_dynamic_t file_sources_settings; + } fake_build_stage_t; + + #define fake_build_stage_t_initialize { \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + } + + #define fake_build_stage_total 13 + + #define macro_fake_build_stage_t_delete_simple(stage) \ + macro_f_string_dynamic_t_delete_simple(stage.file_libraries_script); \ + macro_f_string_dynamic_t_delete_simple(stage.file_libraries_shared); \ + macro_f_string_dynamic_t_delete_simple(stage.file_libraries_static); \ + macro_f_string_dynamic_t_delete_simple(stage.file_objects_static); \ + macro_f_string_dynamic_t_delete_simple(stage.file_process_post); \ + macro_f_string_dynamic_t_delete_simple(stage.file_process_pre); \ + macro_f_string_dynamic_t_delete_simple(stage.file_programs_script); \ + macro_f_string_dynamic_t_delete_simple(stage.file_programs_shared); \ + macro_f_string_dynamic_t_delete_simple(stage.file_programs_static); \ + macro_f_string_dynamic_t_delete_simple(stage.file_skeleton); \ + macro_f_string_dynamic_t_delete_simple(stage.file_sources_headers); \ + macro_f_string_dynamic_t_delete_simple(stage.file_sources_script); \ + macro_f_string_dynamic_t_delete_simple(stage.file_sources_settings); + + #define fake_build_stage_built ".built" + #define fake_build_stage_libraries_script "libraries_script" + #define fake_build_stage_libraries_shared "libraries_shared" + #define fake_build_stage_libraries_static "libraries_static" + #define fake_build_stage_objects_static "objects_static" + #define fake_build_stage_process_post "process_post" + #define fake_build_stage_process_pre "process_pre" + #define fake_build_stage_programs_script "programs_script" + #define fake_build_stage_programs_shared "programs_shared" + #define fake_build_stage_programs_static "programs_static" + #define fake_build_stage_separate "-" + #define fake_build_stage_skeleton "skeleton" + #define fake_build_stage_sources_headers "sources_headers" + #define fake_build_stage_sources_script "sources_script" + #define fake_build_stage_sources_settings "sources_settings" + + #define fake_build_stage_built_length 6 + #define fake_build_stage_libraries_script_length 16 + #define fake_build_stage_libraries_shared_length 16 + #define fake_build_stage_libraries_static_length 16 + #define fake_build_stage_objects_static_length 14 + #define fake_build_stage_process_post_length 12 + #define fake_build_stage_process_pre_length 11 + #define fake_build_stage_programs_script_length 15 + #define fake_build_stage_programs_shared_length 15 + #define fake_build_stage_programs_static_length 15 + #define fake_build_stage_separate_length 1 + #define fake_build_stage_skeleton_length 8 + #define fake_build_stage_sources_headers_length 15 + #define fake_build_stage_sources_script_length 14 + #define fake_build_stage_sources_settings_length 16 +#endif // _di_fake_build_stage_t_ + +#ifndef _di_fake_build_data_t_ + typedef struct { + fake_build_setting_t setting; + f_string_maps_t environment; + } fake_build_data_t; + + #define fake_build_data_t_initialize { \ + fake_build_setting_t_initialize, \ + f_string_maps_t_initialize, \ + } + + #define macro_fake_build_main_delete_simple(build) \ + macro_fake_build_setting_t_delete_simple(build.setting) \ + macro_f_string_maps_t_delete_simple(build.environment); +#endif // _di_fake_build_data_t_ + +#ifndef _di_fake_build_parameter_ + #define fake_build_parameter_library_include "-I" + #define fake_build_parameter_library_link_file "-l" + #define fake_build_parameter_library_link_path "-L" + #define fake_build_parameter_library_name_prefix "lib" + #define fake_build_parameter_library_name_suffix_shared ".so" + #define fake_build_parameter_library_name_suffix_static ".a" + #define fake_build_parameter_library_output "-o" + #define fake_build_parameter_library_separator "." + #define fake_build_parameter_library_shared "-shared" + #define fake_build_parameter_library_static "-static" + #define fake_build_parameter_library_shared_prefix "-Wl,-soname," + + #define fake_build_parameter_library_include_length 2 + #define fake_build_parameter_library_link_file_length 2 + #define fake_build_parameter_library_link_path_length 2 + #define fake_build_parameter_library_name_prefix_length 3 + #define fake_build_parameter_library_name_suffix_shared_length 3 + #define fake_build_parameter_library_name_suffix_static_length 2 + #define fake_build_parameter_library_output_length 2 + #define fake_build_parameter_library_separator_length 1 + #define fake_build_parameter_library_shared_length 7 + #define fake_build_parameter_library_static_length 7 + #define fake_build_parameter_library_shared_prefix_length 12 + + #define fake_build_parameter_object_compile "-c" + #define fake_build_parameter_object_name_suffix ".o" + #define fake_build_parameter_object_output "-o" + #define fake_build_parameter_object_static "-static" + + #define fake_build_parameter_object_compile_length 2 + #define fake_build_parameter_object_name_suffix_length 2 + #define fake_build_parameter_object_output_length 2 + #define fake_build_parameter_object_static_length 7 + + #define fake_build_parameter_object_link_arguments "rcs" + + #define fake_build_parameter_object_link_arguments_length 3 +#endif // _di_fake_build_parameter_ + +#ifndef _di_fake_common_ + #define fake_common_initial_buffer_max 131072 // 128k max default initial buffer size. + + #define fake_common_setting_bool_yes "yes" + #define fake_common_setting_bool_no "no" + + #define fake_common_setting_bool_yes_length 3 + #define fake_common_setting_bool_no_length 2 +#endif // _di_fake_common_ + +#ifndef _di_fake_make_section_ + #define fake_make_section_main "main" + #define fake_make_section_settings "settings" + + #define fake_make_section_main_length 4 + #define fake_make_section_settings_length 8 + + #define fake_make_section_stack_max 8192 // maximum stack call depth. +#endif // _di_fake_make_section_ + +#ifndef _di_fake_make_setting_t_ + typedef struct { + bool load_build; + + uint8_t fail; + + f_string_map_multis_t parameter; + } fake_make_setting_t; + + #define fake_make_setting_t_initialize { \ + 0, \ + 0, \ + f_string_map_multis_t_initialize, \ + } + + #define macro_fake_make_setting_t_delete_simple(setting) \ + macro_f_string_map_multis_t_delete_simple(setting.parameter) + + #define fake_make_setting_compiler "compiler" + #define fake_make_setting_define "define" + #define fake_make_setting_environment "environment" + #define fake_make_setting_fail "fail" + #define fake_make_setting_linker "linker" + #define fake_make_setting_load_build "load_build" + #define fake_make_setting_parameter "parameter" + #define fake_make_setting_return "return" + + #define fake_make_setting_compiler_length 8 + #define fake_make_setting_define_length 6 + #define fake_make_setting_environment_length 11 + #define fake_make_setting_fail_length 4 + #define fake_make_setting_linker_length 6 + #define fake_make_setting_load_build_length 10 + #define fake_make_setting_parameter_length 9 + #define fake_make_setting_return_length 6 +#endif // _di_fake_make_setting_t_ + +#ifndef _di_fake_make_operation_ + #define fake_make_operation_break "break" + #define fake_make_operation_build "build" + #define fake_make_operation_clean "clean" + #define fake_make_operation_clone "clone" + #define fake_make_operation_compile "compile" + #define fake_make_operation_copy "copy" + #define fake_make_operation_define "define" + #define fake_make_operation_delete "delete" + #define fake_make_operation_deletes "deletes" + #define fake_make_operation_else "else" + #define fake_make_operation_exit "exit" + #define fake_make_operation_fail "fail" + #define fake_make_operation_group "group" + #define fake_make_operation_groups "groups" + #define fake_make_operation_if "if" + #define fake_make_operation_index "index" + #define fake_make_operation_link "link" + #define fake_make_operation_mode "mode" + #define fake_make_operation_modes "modes" + #define fake_make_operation_move "move" + #define fake_make_operation_operate "operate" + #define fake_make_operation_owner "owner" + #define fake_make_operation_owners "owners" + #define fake_make_operation_pop "pop" + #define fake_make_operation_print "print" + #define fake_make_operation_run "run" + #define fake_make_operation_shell "shell" + #define fake_make_operation_skeleton "skeleton" + #define fake_make_operation_to "to" + #define fake_make_operation_top "top" + #define fake_make_operation_touch "touch" + + #define fake_make_operation_break_length 5 + #define fake_make_operation_build_length 5 + #define fake_make_operation_clean_length 5 + #define fake_make_operation_clone_length 5 + #define fake_make_operation_compile_length 7 + #define fake_make_operation_copy_length 4 + #define fake_make_operation_define_length 6 + #define fake_make_operation_delete_length 6 + #define fake_make_operation_deletes_length 7 + #define fake_make_operation_else_length 4 + #define fake_make_operation_exit_length 4 + #define fake_make_operation_fail_length 4 + #define fake_make_operation_group_length 5 + #define fake_make_operation_groups_length 6 + #define fake_make_operation_if_length 2 + #define fake_make_operation_index_length 5 + #define fake_make_operation_link_length 4 + #define fake_make_operation_mode_length 4 + #define fake_make_operation_modes_length 5 + #define fake_make_operation_move_length 4 + #define fake_make_operation_operate_length 7 + #define fake_make_operation_owner_length 5 + #define fake_make_operation_owners_length 6 + #define fake_make_operation_pop_length 3 + #define fake_make_operation_print_length 5 + #define fake_make_operation_run_length 3 + #define fake_make_operation_shell_length 5 + #define fake_make_operation_skeleton_length 8 + #define fake_make_operation_to_length 2 + #define fake_make_operation_top_length 3 + #define fake_make_operation_touch_length 5 + + enum { + fake_make_operation_type_break = 1, + fake_make_operation_type_build, + fake_make_operation_type_clean, + fake_make_operation_type_clone, + fake_make_operation_type_compile, + fake_make_operation_type_copy, + fake_make_operation_type_define, + fake_make_operation_type_delete, + fake_make_operation_type_deletes, + fake_make_operation_type_else, + fake_make_operation_type_exit, + fake_make_operation_type_fail, + fake_make_operation_type_group, + fake_make_operation_type_groups, + fake_make_operation_type_if, + fake_make_operation_type_index, + fake_make_operation_type_link, + fake_make_operation_type_mode, + fake_make_operation_type_modes, + fake_make_operation_type_move, + fake_make_operation_type_operate, + fake_make_operation_type_owner, + fake_make_operation_type_owners, + fake_make_operation_type_pop, + fake_make_operation_type_print, + fake_make_operation_type_run, + fake_make_operation_type_shell, + fake_make_operation_type_skeleton, + fake_make_operation_type_to, + fake_make_operation_type_top, + fake_make_operation_type_touch, + }; + + #define fake_make_operation_total 31 + + #define fake_make_operation_argument_environment "environment" + #define fake_make_operation_argument_failure "failure" + #define fake_make_operation_argument_file "file" + #define fake_make_operation_argument_directory "directory" + #define fake_make_operation_argument_error "error" + #define fake_make_operation_argument_exit "exit" + #define fake_make_operation_argument_has "has" + #define fake_make_operation_argument_ignore "ignore" + #define fake_make_operation_argument_is "is" + #define fake_make_operation_argument_parameter "parameter" + #define fake_make_operation_argument_point "point" + #define fake_make_operation_argument_recursive "recursive" + #define fake_make_operation_argument_success "success" + #define fake_make_operation_argument_target "target" + #define fake_make_operation_argument_warn "warn" + + #define fake_make_operation_argument_environment_length 11 + #define fake_make_operation_argument_failure_length 7 + #define fake_make_operation_argument_file_length 4 + #define fake_make_operation_argument_directory_length 9 + #define fake_make_operation_argument_error_length 5 + #define fake_make_operation_argument_exit_length 4 + #define fake_make_operation_argument_has_length 3 + #define fake_make_operation_argument_ignore_length 6 + #define fake_make_operation_argument_is_length 2 + #define fake_make_operation_argument_parameter_length 9 + #define fake_make_operation_argument_point_length 5 + #define fake_make_operation_argument_recursive_length 9 + #define fake_make_operation_argument_success_length 7 + #define fake_make_operation_argument_target_length 6 + #define fake_make_operation_argument_warn_length 4 + + #define fake_make_operation_argument_if_defined "defined" + #define fake_make_operation_argument_if_equal "==" + #define fake_make_operation_argument_if_equal_not "<>" + #define fake_make_operation_argument_if_exists "exists" + #define fake_make_operation_argument_if_failure "failure" + #define fake_make_operation_argument_if_greater ">" + #define fake_make_operation_argument_if_greater_equal ">=" + #define fake_make_operation_argument_if_group "group" + #define fake_make_operation_argument_if_is "is" + #define fake_make_operation_argument_if_is_for "for" + #define fake_make_operation_argument_if_less "<" + #define fake_make_operation_argument_if_less_equal "<=" + #define fake_make_operation_argument_if_mode "mode" + #define fake_make_operation_argument_if_owner "owner" + #define fake_make_operation_argument_if_success "success" + + #define fake_make_operation_argument_if_defined_length 7 + #define fake_make_operation_argument_if_equal_length 2 + #define fake_make_operation_argument_if_equal_not_length 2 + #define fake_make_operation_argument_if_exists_length 6 + #define fake_make_operation_argument_if_failure_length 7 + #define fake_make_operation_argument_if_greater_length 1 + #define fake_make_operation_argument_if_greater_equal_length 2 + #define fake_make_operation_argument_if_group_length 5 + #define fake_make_operation_argument_if_is_length 2 + #define fake_make_operation_argument_if_is_for_length 3 + #define fake_make_operation_argument_if_less_length 1 + #define fake_make_operation_argument_if_less_equal_length 2 + #define fake_make_operation_argument_if_mode_length 4 + #define fake_make_operation_argument_if_owner_length 5 + #define fake_make_operation_argument_if_success_length 7 + + enum { + fake_make_operation_if_type_else_false = 1, + fake_make_operation_if_type_else_false_next, + fake_make_operation_if_type_else_false_next_always, + fake_make_operation_if_type_else_true, + fake_make_operation_if_type_else_true_next, + fake_make_operation_if_type_false, + fake_make_operation_if_type_false_always, + fake_make_operation_if_type_false_always_next, + fake_make_operation_if_type_false_next, + fake_make_operation_if_type_if_defined, + fake_make_operation_if_type_if_equal, + fake_make_operation_if_type_if_equal_not, + fake_make_operation_if_type_if_exists, + fake_make_operation_if_type_if_failure, + fake_make_operation_if_type_if_greater, + fake_make_operation_if_type_if_greater_equal, + fake_make_operation_if_type_if_group, + fake_make_operation_if_type_if_is, + fake_make_operation_if_type_if_less, + fake_make_operation_if_type_if_less_equal, + fake_make_operation_if_type_if_mode, + fake_make_operation_if_type_if_owner, + fake_make_operation_if_type_if_success, + fake_make_operation_if_type_true, + fake_make_operation_if_type_true_next, + }; + + enum { + fake_make_operation_fail_type_exit = 1, + fake_make_operation_fail_type_warn, + fake_make_operation_fail_type_ignore, + }; + + #define fake_make_operation_recursion_depth_max 65535 +#endif // _di_fake_make_operation_ + +#ifndef _di_fake_make_parameter_t_ + #define fake_make_parameter_variable_build "build" + #define fake_make_parameter_variable_color "color" + #define fake_make_parameter_variable_data "data" + #define fake_make_parameter_variable_define "define" + #define fake_make_parameter_variable_fakefile "fakefile" + #define fake_make_parameter_variable_mode "mode" + #define fake_make_parameter_variable_process "process" + #define fake_make_parameter_variable_return "return" + #define fake_make_parameter_variable_settings "settings" + #define fake_make_parameter_variable_sources "sources" + #define fake_make_parameter_variable_verbosity "verbosity" + #define fake_make_parameter_variable_work "work" + + #define fake_make_parameter_variable_build_length 5 + #define fake_make_parameter_variable_color_length 5 + #define fake_make_parameter_variable_data_length 4 + #define fake_make_parameter_variable_define_length 6 + #define fake_make_parameter_variable_fakefile_length 8 + #define fake_make_parameter_variable_mode_length 4 + #define fake_make_parameter_variable_process_length 7 + #define fake_make_parameter_variable_return_length 6 + #define fake_make_parameter_variable_settings_length 8 + #define fake_make_parameter_variable_sources_length 7 + #define fake_make_parameter_variable_verbosity_length 9 + #define fake_make_parameter_variable_work_length 4 + + typedef struct { + f_string_dynamics_t build; + f_string_dynamics_t color; + f_string_dynamics_t data; + f_string_dynamics_t define; + f_string_dynamics_t fakefile; + f_string_dynamics_t mode; + f_string_dynamics_t process; + f_string_dynamics_t settings; + f_string_dynamics_t sources; + f_string_dynamics_t verbosity; + f_string_dynamics_t work; + } fake_make_parameter_t; + + #define fake_make_parameter_t_initialize { \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + } + + #define macro_fake_make_parameter_delete_simple(parameter) \ + macro_f_string_dynamics_t_delete_simple(parameter.build); \ + macro_f_string_dynamics_t_delete_simple(parameter.color); \ + macro_f_string_dynamics_t_delete_simple(parameter.data); \ + macro_f_string_dynamics_t_delete_simple(parameter.define); \ + macro_f_string_dynamics_t_delete_simple(parameter.fakefile); \ + macro_f_string_dynamics_t_delete_simple(parameter.mode); \ + macro_f_string_dynamics_t_delete_simple(parameter.process); \ + macro_f_string_dynamics_t_delete_simple(parameter.settings); \ + macro_f_string_dynamics_t_delete_simple(parameter.sources); \ + macro_f_string_dynamics_t_delete_simple(parameter.verbosity); \ + macro_f_string_dynamics_t_delete_simple(parameter.work); +#endif // _di_fake_make_parameter_t_ + +#ifndef _di_fake_make_path_t_ + typedef struct { + f_file_t top; + f_file_t current; + + f_string_dynamics_t stack; + } fake_make_path_t; + + #define fake_make_path_t_initialize { \ + f_file_t_initialize, \ + f_file_t_initialize, \ + f_string_dynamics_t_initialize, \ + } + + #define macro_fake_make_path_delete_simple(path) \ + macro_f_string_dynamics_t_delete_simple(path.stack); +#endif // _di_fake_make_path_t_ + +#ifndef _di_fake_make_data_t_ + typedef struct { + fake_build_setting_t setting_build; + fake_make_setting_t setting_make; + + f_string_maps_t environment; + + fake_make_parameter_t parameter; + fake_make_path_t path; // @todo review this, check if path.current is used anymore. + + fll_error_print_t error; + + f_fss_nameds_t fakefile; + + f_string_dynamic_t buffer; + f_string_dynamic_t path_cache; + + f_array_length_t main; + } fake_make_data_t; + + #define fake_make_data_t_initialize { \ + fake_build_setting_t_initialize, \ + fake_make_setting_t_initialize, \ + f_string_maps_t_initialize, \ + fake_make_parameter_t_initialize, \ + fake_make_path_t_initialize, \ + fll_error_print_t_initialize, \ + f_fss_nameds_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + 0, \ + } + + #define macro_fake_make_data_t_delete_simple(structure) \ + macro_fake_build_setting_t_delete_simple(structure.setting_build) \ + macro_fake_make_setting_t_delete_simple(structure.setting_make) \ + macro_f_string_maps_t_delete_simple(structure.environment); \ + macro_fake_make_parameter_delete_simple(structure.parameter) \ + macro_fake_make_path_delete_simple(structure.path) \ + macro_f_fss_nameds_t_delete_simple(structure.fakefile) \ + macro_f_string_dynamic_t_delete_simple(structure.buffer); \ + macro_f_string_dynamic_t_delete_simple(structure.path_cache); +#endif // _di_fake_make_data_t_ + +#ifndef _di_fake_skeleton_content_ + #define fake_make_skeleton_content_defines "# fss-0000\n\n" + #define fake_make_skeleton_content_dependencies "# fss-0000\n\n" + #define fake_make_skeleton_content_fakefile "# fss-0005 iki-0002\n\nsettings:\n fail exit\n\nmain:\n\n" + #define fake_make_skeleton_content_settings "# fss-0001\n\n" + + #define fake_make_skeleton_content_defines_length 12 + #define fake_make_skeleton_content_dependencies_length 12 + #define fake_make_skeleton_content_fakefile_length 51 + #define fake_make_skeleton_content_settings_length 12 +#endif // _di_fake_skeleton_content_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_common_h diff --git a/level_3/fake/c/private-fake.c b/level_3/fake/c/private-fake.c index 2f5d1b9..c18d14e 100644 --- a/level_3/fake/c/private-fake.c +++ b/level_3/fake/c/private-fake.c @@ -1,4 +1,5 @@ #include "fake.h" +#include "private-common.h" #include "private-fake.h" #include "private-build.h" #include "private-make.h" diff --git a/level_3/fake/c/private-fake.h b/level_3/fake/c/private-fake.h index 4e77124..e7f87b9 100644 --- a/level_3/fake/c/private-fake.h +++ b/level_3/fake/c/private-fake.h @@ -12,16 +12,6 @@ extern "C" { #endif -#ifndef _di_fake_common_ - #define fake_common_initial_buffer_max 131072 // 128k max default initial buffer size. - - #define fake_common_setting_bool_yes "yes" - #define fake_common_setting_bool_no "no" - - #define fake_common_setting_bool_yes_length 3 - #define fake_common_setting_bool_no_length 2 -#endif // _di_fake_common_ - /** * Execute the given command and arguments. * diff --git a/level_3/fake/c/private-make.c b/level_3/fake/c/private-make.c index a9ee57a..b8a3f00 100644 --- a/level_3/fake/c/private-make.c +++ b/level_3/fake/c/private-make.c @@ -1,4 +1,5 @@ #include "fake.h" +#include "private-common.h" #include "private-fake.h" #include "private-build.h" #include "private-clean.h" diff --git a/level_3/fake/c/private-make.h b/level_3/fake/c/private-make.h index b9e92cb..0cbd5f6 100644 --- a/level_3/fake/c/private-make.h +++ b/level_3/fake/c/private-make.h @@ -12,386 +12,6 @@ extern "C" { #endif -#ifndef _di_fake_make_section_ - #define fake_make_section_main "main" - #define fake_make_section_settings "settings" - - #define fake_make_section_main_length 4 - #define fake_make_section_settings_length 8 - - #define fake_make_section_stack_max 8192 // maximum stack call depth. -#endif // _di_fake_make_section_ - -#ifndef _di_fake_make_setting_t_ - typedef struct { - bool load_build; - - uint8_t fail; - - f_string_map_multis_t parameter; - } fake_make_setting_t; - - #define fake_make_setting_t_initialize { \ - 0, \ - 0, \ - f_string_map_multis_t_initialize, \ - } - - #define macro_fake_make_setting_t_delete_simple(setting) \ - macro_f_string_map_multis_t_delete_simple(setting.parameter) - - #define fake_make_setting_compiler "compiler" - #define fake_make_setting_define "define" - #define fake_make_setting_environment "environment" - #define fake_make_setting_fail "fail" - #define fake_make_setting_linker "linker" - #define fake_make_setting_load_build "load_build" - #define fake_make_setting_parameter "parameter" - #define fake_make_setting_return "return" - - #define fake_make_setting_compiler_length 8 - #define fake_make_setting_define_length 6 - #define fake_make_setting_environment_length 11 - #define fake_make_setting_fail_length 4 - #define fake_make_setting_linker_length 6 - #define fake_make_setting_load_build_length 10 - #define fake_make_setting_parameter_length 9 - #define fake_make_setting_return_length 6 -#endif // _di_fake_make_setting_t_ - -#ifndef _di_fake_make_operation_ - #define fake_make_operation_break "break" - #define fake_make_operation_build "build" - #define fake_make_operation_clean "clean" - #define fake_make_operation_clone "clone" - #define fake_make_operation_compile "compile" - #define fake_make_operation_copy "copy" - #define fake_make_operation_define "define" - #define fake_make_operation_delete "delete" - #define fake_make_operation_deletes "deletes" - #define fake_make_operation_else "else" - #define fake_make_operation_exit "exit" - #define fake_make_operation_fail "fail" - #define fake_make_operation_group "group" - #define fake_make_operation_groups "groups" - #define fake_make_operation_if "if" - #define fake_make_operation_index "index" - #define fake_make_operation_link "link" - #define fake_make_operation_mode "mode" - #define fake_make_operation_modes "modes" - #define fake_make_operation_move "move" - #define fake_make_operation_operate "operate" - #define fake_make_operation_owner "owner" - #define fake_make_operation_owners "owners" - #define fake_make_operation_pop "pop" - #define fake_make_operation_print "print" - #define fake_make_operation_run "run" - #define fake_make_operation_shell "shell" - #define fake_make_operation_skeleton "skeleton" - #define fake_make_operation_to "to" - #define fake_make_operation_top "top" - #define fake_make_operation_touch "touch" - - #define fake_make_operation_break_length 5 - #define fake_make_operation_build_length 5 - #define fake_make_operation_clean_length 5 - #define fake_make_operation_clone_length 5 - #define fake_make_operation_compile_length 7 - #define fake_make_operation_copy_length 4 - #define fake_make_operation_define_length 6 - #define fake_make_operation_delete_length 6 - #define fake_make_operation_deletes_length 7 - #define fake_make_operation_else_length 4 - #define fake_make_operation_exit_length 4 - #define fake_make_operation_fail_length 4 - #define fake_make_operation_group_length 5 - #define fake_make_operation_groups_length 6 - #define fake_make_operation_if_length 2 - #define fake_make_operation_index_length 5 - #define fake_make_operation_link_length 4 - #define fake_make_operation_mode_length 4 - #define fake_make_operation_modes_length 5 - #define fake_make_operation_move_length 4 - #define fake_make_operation_operate_length 7 - #define fake_make_operation_owner_length 5 - #define fake_make_operation_owners_length 6 - #define fake_make_operation_pop_length 3 - #define fake_make_operation_print_length 5 - #define fake_make_operation_run_length 3 - #define fake_make_operation_shell_length 5 - #define fake_make_operation_skeleton_length 8 - #define fake_make_operation_to_length 2 - #define fake_make_operation_top_length 3 - #define fake_make_operation_touch_length 5 - - enum { - fake_make_operation_type_break = 1, - fake_make_operation_type_build, - fake_make_operation_type_clean, - fake_make_operation_type_clone, - fake_make_operation_type_compile, - fake_make_operation_type_copy, - fake_make_operation_type_define, - fake_make_operation_type_delete, - fake_make_operation_type_deletes, - fake_make_operation_type_else, - fake_make_operation_type_exit, - fake_make_operation_type_fail, - fake_make_operation_type_group, - fake_make_operation_type_groups, - fake_make_operation_type_if, - fake_make_operation_type_index, - fake_make_operation_type_link, - fake_make_operation_type_mode, - fake_make_operation_type_modes, - fake_make_operation_type_move, - fake_make_operation_type_operate, - fake_make_operation_type_owner, - fake_make_operation_type_owners, - fake_make_operation_type_pop, - fake_make_operation_type_print, - fake_make_operation_type_run, - fake_make_operation_type_shell, - fake_make_operation_type_skeleton, - fake_make_operation_type_to, - fake_make_operation_type_top, - fake_make_operation_type_touch, - }; - - #define fake_make_operation_total 31 - - #define fake_make_operation_argument_environment "environment" - #define fake_make_operation_argument_failure "failure" - #define fake_make_operation_argument_file "file" - #define fake_make_operation_argument_directory "directory" - #define fake_make_operation_argument_error "error" - #define fake_make_operation_argument_exit "exit" - #define fake_make_operation_argument_has "has" - #define fake_make_operation_argument_ignore "ignore" - #define fake_make_operation_argument_is "is" - #define fake_make_operation_argument_parameter "parameter" - #define fake_make_operation_argument_point "point" - #define fake_make_operation_argument_recursive "recursive" - #define fake_make_operation_argument_success "success" - #define fake_make_operation_argument_target "target" - #define fake_make_operation_argument_warn "warn" - - #define fake_make_operation_argument_environment_length 11 - #define fake_make_operation_argument_failure_length 7 - #define fake_make_operation_argument_file_length 4 - #define fake_make_operation_argument_directory_length 9 - #define fake_make_operation_argument_error_length 5 - #define fake_make_operation_argument_exit_length 4 - #define fake_make_operation_argument_has_length 3 - #define fake_make_operation_argument_ignore_length 6 - #define fake_make_operation_argument_is_length 2 - #define fake_make_operation_argument_parameter_length 9 - #define fake_make_operation_argument_point_length 5 - #define fake_make_operation_argument_recursive_length 9 - #define fake_make_operation_argument_success_length 7 - #define fake_make_operation_argument_target_length 6 - #define fake_make_operation_argument_warn_length 4 - - #define fake_make_operation_argument_if_defined "defined" - #define fake_make_operation_argument_if_equal "==" - #define fake_make_operation_argument_if_equal_not "<>" - #define fake_make_operation_argument_if_exists "exists" - #define fake_make_operation_argument_if_failure "failure" - #define fake_make_operation_argument_if_greater ">" - #define fake_make_operation_argument_if_greater_equal ">=" - #define fake_make_operation_argument_if_group "group" - #define fake_make_operation_argument_if_is "is" - #define fake_make_operation_argument_if_is_for "for" - #define fake_make_operation_argument_if_less "<" - #define fake_make_operation_argument_if_less_equal "<=" - #define fake_make_operation_argument_if_mode "mode" - #define fake_make_operation_argument_if_owner "owner" - #define fake_make_operation_argument_if_success "success" - - #define fake_make_operation_argument_if_defined_length 7 - #define fake_make_operation_argument_if_equal_length 2 - #define fake_make_operation_argument_if_equal_not_length 2 - #define fake_make_operation_argument_if_exists_length 6 - #define fake_make_operation_argument_if_failure_length 7 - #define fake_make_operation_argument_if_greater_length 1 - #define fake_make_operation_argument_if_greater_equal_length 2 - #define fake_make_operation_argument_if_group_length 5 - #define fake_make_operation_argument_if_is_length 2 - #define fake_make_operation_argument_if_is_for_length 3 - #define fake_make_operation_argument_if_less_length 1 - #define fake_make_operation_argument_if_less_equal_length 2 - #define fake_make_operation_argument_if_mode_length 4 - #define fake_make_operation_argument_if_owner_length 5 - #define fake_make_operation_argument_if_success_length 7 - - enum { - fake_make_operation_if_type_else_false = 1, - fake_make_operation_if_type_else_false_next, - fake_make_operation_if_type_else_false_next_always, - fake_make_operation_if_type_else_true, - fake_make_operation_if_type_else_true_next, - fake_make_operation_if_type_false, - fake_make_operation_if_type_false_always, - fake_make_operation_if_type_false_always_next, - fake_make_operation_if_type_false_next, - fake_make_operation_if_type_if_defined, - fake_make_operation_if_type_if_equal, - fake_make_operation_if_type_if_equal_not, - fake_make_operation_if_type_if_exists, - fake_make_operation_if_type_if_failure, - fake_make_operation_if_type_if_greater, - fake_make_operation_if_type_if_greater_equal, - fake_make_operation_if_type_if_group, - fake_make_operation_if_type_if_is, - fake_make_operation_if_type_if_less, - fake_make_operation_if_type_if_less_equal, - fake_make_operation_if_type_if_mode, - fake_make_operation_if_type_if_owner, - fake_make_operation_if_type_if_success, - fake_make_operation_if_type_true, - fake_make_operation_if_type_true_next, - }; - - enum { - fake_make_operation_fail_type_exit = 1, - fake_make_operation_fail_type_warn, - fake_make_operation_fail_type_ignore, - }; - - #define fake_make_operation_recursion_depth_max 65535 -#endif // _di_fake_make_operation_ - -#ifndef _di_fake_make_parameter_t_ - #define fake_make_parameter_variable_build "build" - #define fake_make_parameter_variable_color "color" - #define fake_make_parameter_variable_data "data" - #define fake_make_parameter_variable_define "define" - #define fake_make_parameter_variable_fakefile "fakefile" - #define fake_make_parameter_variable_mode "mode" - #define fake_make_parameter_variable_process "process" - #define fake_make_parameter_variable_return "return" - #define fake_make_parameter_variable_settings "settings" - #define fake_make_parameter_variable_sources "sources" - #define fake_make_parameter_variable_verbosity "verbosity" - #define fake_make_parameter_variable_work "work" - - #define fake_make_parameter_variable_build_length 5 - #define fake_make_parameter_variable_color_length 5 - #define fake_make_parameter_variable_data_length 4 - #define fake_make_parameter_variable_define_length 6 - #define fake_make_parameter_variable_fakefile_length 8 - #define fake_make_parameter_variable_mode_length 4 - #define fake_make_parameter_variable_process_length 7 - #define fake_make_parameter_variable_return_length 6 - #define fake_make_parameter_variable_settings_length 8 - #define fake_make_parameter_variable_sources_length 7 - #define fake_make_parameter_variable_verbosity_length 9 - #define fake_make_parameter_variable_work_length 4 - - typedef struct { - f_string_dynamics_t build; - f_string_dynamics_t color; - f_string_dynamics_t data; - f_string_dynamics_t define; - f_string_dynamics_t fakefile; - f_string_dynamics_t mode; - f_string_dynamics_t process; - f_string_dynamics_t settings; - f_string_dynamics_t sources; - f_string_dynamics_t verbosity; - f_string_dynamics_t work; - } fake_make_parameter_t; - - #define fake_make_parameter_t_initialize { \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - f_string_dynamics_t_initialize, \ - } - - #define macro_fake_make_parameter_delete_simple(parameter) \ - macro_f_string_dynamics_t_delete_simple(parameter.build); \ - macro_f_string_dynamics_t_delete_simple(parameter.color); \ - macro_f_string_dynamics_t_delete_simple(parameter.data); \ - macro_f_string_dynamics_t_delete_simple(parameter.define); \ - macro_f_string_dynamics_t_delete_simple(parameter.fakefile); \ - macro_f_string_dynamics_t_delete_simple(parameter.mode); \ - macro_f_string_dynamics_t_delete_simple(parameter.process); \ - macro_f_string_dynamics_t_delete_simple(parameter.settings); \ - macro_f_string_dynamics_t_delete_simple(parameter.sources); \ - macro_f_string_dynamics_t_delete_simple(parameter.verbosity); \ - macro_f_string_dynamics_t_delete_simple(parameter.work); -#endif // _di_fake_make_parameter_t_ - -#ifndef _di_fake_make_path_t_ - typedef struct { - f_file_t top; - f_file_t current; - - f_string_dynamics_t stack; - } fake_make_path_t; - - #define fake_make_path_t_initialize { \ - f_file_t_initialize, \ - f_file_t_initialize, \ - f_string_dynamics_t_initialize, \ - } - - #define macro_fake_make_path_delete_simple(path) \ - macro_f_string_dynamics_t_delete_simple(path.stack); -#endif // _di_fake_make_path_t_ - -#ifndef _di_fake_make_data_t_ - typedef struct { - fake_build_setting_t setting_build; - fake_make_setting_t setting_make; - - f_string_maps_t environment; - - fake_make_parameter_t parameter; - fake_make_path_t path; // @todo review this, check if path.current is used anymore. - - fll_error_print_t error; - - f_fss_nameds_t fakefile; - - f_string_dynamic_t buffer; - f_string_dynamic_t path_cache; - - f_array_length_t main; - } fake_make_data_t; - - #define fake_make_data_t_initialize { \ - fake_build_setting_t_initialize, \ - fake_make_setting_t_initialize, \ - f_string_maps_t_initialize, \ - fake_make_parameter_t_initialize, \ - fake_make_path_t_initialize, \ - fll_error_print_t_initialize, \ - f_fss_nameds_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ - 0, \ - } - - #define macro_fake_make_data_t_delete_simple(structure) \ - macro_fake_build_setting_t_delete_simple(structure.setting_build) \ - macro_fake_make_setting_t_delete_simple(structure.setting_make) \ - macro_f_string_maps_t_delete_simple(structure.environment); \ - macro_fake_make_parameter_delete_simple(structure.parameter) \ - macro_fake_make_path_delete_simple(structure.path) \ - macro_f_fss_nameds_t_delete_simple(structure.fakefile) \ - macro_f_string_dynamic_t_delete_simple(structure.buffer); \ - macro_f_string_dynamic_t_delete_simple(structure.path_cache); -#endif // _di_fake_make_data_t_ - /** * Assure that a path is within the project root path. * diff --git a/level_3/fake/c/private-print.c b/level_3/fake/c/private-print.c index 06ca369..8b976df 100644 --- a/level_3/fake/c/private-print.c +++ b/level_3/fake/c/private-print.c @@ -1,4 +1,5 @@ #include "fake.h" +#include "private-common.h" #include "private-fake.h" #include "private-build.h" #include "private-clean.h" diff --git a/level_3/fake/c/private-skeleton.c b/level_3/fake/c/private-skeleton.c index 1c6797b..ee3af32 100644 --- a/level_3/fake/c/private-skeleton.c +++ b/level_3/fake/c/private-skeleton.c @@ -1,4 +1,5 @@ #include "fake.h" +#include "private-common.h" #include "private-fake.h" #include "private-build.h" #include "private-make.h" diff --git a/level_3/fake/c/private-skeleton.h b/level_3/fake/c/private-skeleton.h index ceeb41e..b3273ad 100644 --- a/level_3/fake/c/private-skeleton.h +++ b/level_3/fake/c/private-skeleton.h @@ -8,18 +8,6 @@ #ifndef _PRIVATE_skeleton_h #define _PRIVATE_skeleton_h -#ifndef _di_fake_skeleton_content_ - #define fake_make_skeleton_content_defines "# fss-0000\n\n" - #define fake_make_skeleton_content_dependencies "# fss-0000\n\n" - #define fake_make_skeleton_content_fakefile "# fss-0005 iki-0002\n\nsettings:\n fail exit\n\nmain:\n\n" - #define fake_make_skeleton_content_settings "# fss-0001\n\n" - - #define fake_make_skeleton_content_defines_length 12 - #define fake_make_skeleton_content_dependencies_length 12 - #define fake_make_skeleton_content_fakefile_length 51 - #define fake_make_skeleton_content_settings_length 12 -#endif // _di_fake_skeleton_content_ - #ifdef __cplusplus extern "C" { #endif diff --git a/level_3/fake/data/build/settings b/level_3/fake/data/build/settings index ac580c7..3b53d9e 100644 --- a/level_3/fake/data/build/settings +++ b/level_3/fake/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc -lcap build_libraries-individual -lfll_error -lfll_execute -lfll_file -lfll_fss -lfll_path -lfll_program -lfl_console -lfl_control_group -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_iki -lfl_status -lfl_string -lf_account -lf_capability -lf_color -lf_console -lf_control_group -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_iki -lf_limit -lf_memory -lf_path -lf_print -lf_signal -lf_string -lf_thread -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library fake.c private-fake.c private-clean.c private-build.c private-make.c private-print.c private-skeleton.c +build_sources_library fake.c private-common.c private-fake.c private-clean.c private-build.c private-make.c private-print.c private-skeleton.c build_sources_program main.c build_sources_headers fake.h build_sources_script diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index 34c78ba..744063f 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -5,6 +5,7 @@ * Licenses: lgplv2.1 */ #include "firewall.h" +#include "private-common.h" #include "private-firewall.h" #ifdef __cplusplus diff --git a/level_3/firewall/c/private-common.c b/level_3/firewall/c/private-common.c new file mode 100644 index 0000000..5fb28f6 --- /dev/null +++ b/level_3/firewall/c/private-common.c @@ -0,0 +1,10 @@ +#include "firewall.h" +#include "private-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/firewall/c/private-common.h b/level_3/firewall/c/private-common.h new file mode 100644 index 0000000..a2a18af --- /dev/null +++ b/level_3/firewall/c/private-common.h @@ -0,0 +1,107 @@ +/** + * FLL - Level 3 + * + * Project: Firewall + * API Version: 0.5 + * Licenses: lgplv2.1 + */ +#ifndef _PRIVATE_common_h +#define _PRIVATE_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + bool is_global; + bool is_main; + bool is_stop; + bool is_lock; + + f_array_length_t device; + + f_string_dynamic_t buffer; + f_array_length_t chain; + f_array_lengths_t chain_ids; + f_fss_objects_t chain_objects; + f_fss_contents_t chain_contents; + f_fss_objects_t rule_objects; + f_fss_contents_t rule_contents; +} firewall_local_data_t; + +#define firewall_local_data_t_initialize \ + { \ + F_true, \ + F_false, \ + F_false, \ + F_false, \ + 0, \ + f_string_dynamic_t_initialize, \ + 0, \ + f_array_lengths_t_initialize, \ + f_fss_objects_t_initialize, \ + f_fss_contents_t_initialize, \ + f_fss_objects_t_initialize, \ + f_fss_contents_t_initialize, \ + } + +typedef struct { + bool has_main; + bool has_stop; + bool has_lock; + + f_array_length_t main_at; + f_array_length_t stop_at; + f_array_length_t lock_at; +} firewall_reserved_chains_t; + +#define firewall_reserved_chains_t_initialize \ + { \ + F_false, \ + F_false, \ + F_false, \ + 0, \ + 0, \ + 0, \ + } + +#define macro_firewall_delete_fss_buffers(status, buffer, objects, contents) \ + macro_f_string_dynamic_t_delete_simple(buffer); \ + macro_f_fss_objects_t_delete_simple(objects); \ + macro_f_fss_contents_t_delete_simple(contents); + +#define macro_firewall_concat_string(destination, source, length) \ + memcpy((void *)(destination), source, length); + +#define macro_firewall_rule_contents_has_incorrect_items(index, total_items) \ + local.rule_contents.array[index].used <= 0 || local.rule_contents.array[index].used > total_items + +// the buffer start to stop points are inclusive such that the size is ((stop - start) + 1). +#define macro_firewall_string_dynamic_size(structure, index) \ + (structure.string[index].stop - structure.string[index].start) + 1 + +// the buffer start to stop points are inclusive such that the size is ((stop - start) + 1). +#define macro_firewall_structure_size(structure, index) \ + (structure.array[index].stop - structure.array[index].start) + 1 + +// TODO: temporarily added, convert this to a function below. +// TODO: also report: f_color_print(main.error.to.stream, main.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol_s[0]); +#define macro_firewall_append_argument_to_arguments(status, arguments, argument) \ + if (arguments.used == arguments.size) { \ + macro_f_string_dynamics_t_resize(status, arguments, arguments.used + firewall_default_allocation_step); \ + \ + if (F_status_is_error(status)) break; \ + } \ + \ + arguments.array[arguments.used].string = argument.string; \ + arguments.array[arguments.used].size = argument.size; \ + arguments.array[arguments.used].used = argument.used; \ + arguments.used++; \ + \ + macro_f_string_dynamic_t_clear(argument); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_common_h diff --git a/level_3/firewall/c/private-firewall.c b/level_3/firewall/c/private-firewall.c index 4bf70b1..5831b17 100644 --- a/level_3/firewall/c/private-firewall.c +++ b/level_3/firewall/c/private-firewall.c @@ -1,4 +1,5 @@ #include "firewall.h" +#include "private-common.h" #include "private-firewall.h" #ifdef __cplusplus diff --git a/level_3/firewall/c/private-firewall.h b/level_3/firewall/c/private-firewall.h index e2e5e6c..8bb836a 100644 --- a/level_3/firewall/c/private-firewall.h +++ b/level_3/firewall/c/private-firewall.h @@ -12,94 +12,6 @@ extern "C" { #endif -typedef struct { - bool is_global; - bool is_main; - bool is_stop; - bool is_lock; - - f_array_length_t device; - - f_string_dynamic_t buffer; - f_array_length_t chain; - f_array_lengths_t chain_ids; - f_fss_objects_t chain_objects; - f_fss_contents_t chain_contents; - f_fss_objects_t rule_objects; - f_fss_contents_t rule_contents; -} firewall_local_data_t; - -#define firewall_local_data_t_initialize \ - { \ - F_true, \ - F_false, \ - F_false, \ - F_false, \ - 0, \ - f_string_dynamic_t_initialize, \ - 0, \ - f_array_lengths_t_initialize, \ - f_fss_objects_t_initialize, \ - f_fss_contents_t_initialize, \ - f_fss_objects_t_initialize, \ - f_fss_contents_t_initialize, \ - } - -typedef struct { - bool has_main; - bool has_stop; - bool has_lock; - - f_array_length_t main_at; - f_array_length_t stop_at; - f_array_length_t lock_at; -} firewall_reserved_chains_t; - -#define firewall_reserved_chains_t_initialize \ - { \ - F_false, \ - F_false, \ - F_false, \ - 0, \ - 0, \ - 0, \ - } - -#define macro_firewall_delete_fss_buffers(status, buffer, objects, contents) \ - macro_f_string_dynamic_t_delete_simple(buffer); \ - macro_f_fss_objects_t_delete_simple(objects); \ - macro_f_fss_contents_t_delete_simple(contents); - -#define macro_firewall_concat_string(destination, source, length) \ - memcpy((void *)(destination), source, length); - -#define macro_firewall_rule_contents_has_incorrect_items(index, total_items) \ - local.rule_contents.array[index].used <= 0 || local.rule_contents.array[index].used > total_items - -// the buffer start to stop points are inclusive such that the size is ((stop - start) + 1). -#define macro_firewall_string_dynamic_size(structure, index) \ - (structure.string[index].stop - structure.string[index].start) + 1 - -// the buffer start to stop points are inclusive such that the size is ((stop - start) + 1). -#define macro_firewall_structure_size(structure, index) \ - (structure.array[index].stop - structure.array[index].start) + 1 - -// TODO: temporarily added, convert this to a function below. -// TODO: also report: f_color_print(main.error.to.stream, main.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol_s[0]); -#define macro_firewall_append_argument_to_arguments(status, arguments, argument) \ - if (arguments.used == arguments.size) { \ - macro_f_string_dynamics_t_resize(status, arguments, arguments.used + firewall_default_allocation_step); \ - \ - if (F_status_is_error(status)) break; \ - } \ - \ - arguments.array[arguments.used].string = argument.string; \ - arguments.array[arguments.used].size = argument.size; \ - arguments.array[arguments.used].used = argument.used; \ - arguments.used++; \ - \ - macro_f_string_dynamic_t_clear(argument); - /** * Perform commands. * diff --git a/level_3/firewall/data/build/settings b/level_3/firewall/data/build/settings index 9c3df9a..f7e6c1d 100644 --- a/level_3/firewall/data/build/settings +++ b/level_3/firewall/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc -lcap build_libraries-individual -lfll_error -lfll_execute -lfll_fss -lfll_program -lfl_console -lfl_control_group -lfl_conversion -lfl_environment -lfl_fss -lfl_status -lfl_string -lf_account -lf_capability -lf_color -lf_console -lf_control_group -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_limit -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_string -lf_thread -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library firewall.c private-firewall.c +build_sources_library firewall.c private-common.c private-firewall.c build_sources_program main.c build_sources_headers firewall.h build_sources_script diff --git a/level_3/fss_basic_list_read/c/fss_basic_list_read.c b/level_3/fss_basic_list_read/c/fss_basic_list_read.c index 8f60b67..8bad606 100644 --- a/level_3/fss_basic_list_read/c/fss_basic_list_read.c +++ b/level_3/fss_basic_list_read/c/fss_basic_list_read.c @@ -1,4 +1,5 @@ #include "fss_basic_list_read.h" +#include "private-common.h" #include "private-fss_basic_list_read.h" #ifdef __cplusplus diff --git a/level_3/fss_basic_list_read/c/private-common.c b/level_3/fss_basic_list_read/c/private-common.c new file mode 100644 index 0000000..745408c --- /dev/null +++ b/level_3/fss_basic_list_read/c/private-common.c @@ -0,0 +1,10 @@ +#include "fss_basic_list_read.h" +#include "private-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fss_basic_list_read/c/private-common.h b/level_3/fss_basic_list_read/c/private-common.h new file mode 100644 index 0000000..93ad6b7 --- /dev/null +++ b/level_3/fss_basic_list_read/c/private-common.h @@ -0,0 +1,116 @@ +/** + * FLL - Level 3 + * + * Project: FSS Basic List Read + * API Version: 0.5 + * Licenses: lgplv2.1 + */ +#ifndef _PRIVATE_common_h +#define _PRIVATE_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * A structure of parameters applied at some depth. + * + * depth: the depth number in which this is to be processed at. + * + * index_at: position of the "--at" parameter value in the argv list, when 0 there is no parameter. + * index_name: position of the "--name" parameter value in the argv list, when 0 there is no parameter. + * + * value_at: the value of the "--at" parameter, already processed and ready to use, only when index_at > 0. + * value_name: the value of the "--name" parameter, already processed and ready to use, only when index_name > 0. + */ +#ifndef _di_fss_basic_list_read_depth_t_ + typedef struct { + f_array_length_t depth; + + f_array_length_t index_at; + f_array_length_t index_name; + + f_number_unsigned_t value_at; + f_string_dynamic_t value_name; + } fss_basic_list_read_depth_t; + + #define fss_basic_list_read_depth_t_initialize \ + { \ + 0, \ + 0, \ + 0, \ + 0, \ + f_string_dynamic_t_initialize, \ + } + + #define macro_fss_basic_list_read_depth_t_clear(structure) \ + structure.depth = 0; \ + structure.index_at = 0; \ + structure.index_name = 0; \ + structure.value_at = 0; \ + macro_f_string_dynamic_t_clear(structure.value_name) + + #define macro_fss_basic_list_read_depth_t_delete_simple(structure) macro_f_string_dynamic_t_delete_simple(structure.value_name); +#endif // _di_fss_basic_list_read_depth_t_ + +/** + * An array of depth parameters. + * + * array: the array of depths. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_fss_basic_list_read_depths_t_ + typedef struct { + fss_basic_list_read_depth_t *array; + + f_array_length_t size; + f_array_length_t used; + } fss_basic_list_read_depths_t; + + #define fss_basic_list_read_depths_t_initialize { 0, 0, 0 } + + #define macro_fss_basic_list_read_depths_t_clear(depths) macro_f_memory_structure_clear(depths) + + #define macro_fss_basic_list_read_depths_t_delete_simple(depths) \ + depths.used = depths.size; \ + while (depths.used > 0) { \ + depths.used--; \ + macro_fss_basic_list_read_depth_t_delete_simple(depths.array[depths.used]); \ + } \ + if (!depths.used) macro_f_memory_structure_delete_simple(depths, fss_basic_list_read_depth_t) + + #define macro_fss_basic_list_read_depths_t_resize(status, depths, new_length) \ + status = F_none; \ + if (new_length < depths.size) { \ + f_array_length_t i = depths.size - new_length; \ + for (; i < depths.size; i++) { \ + macro_fss_basic_list_read_depth_t_delete_simple(depths.array[i]); \ + } \ + } \ + if (status == F_none) status = f_memory_resize(depths.size, new_length, sizeof(fss_basic_list_read_depth_t), (void **) & depths.array); \ + if (status == F_none) { \ + depths.size = new_length; \ + if (depths.used > depths.size) depths.used = new_length; \ + } + + #define macro_fss_basic_list_read_depths_t_adjust(status, depths, new_length) \ + status = F_none; \ + if (new_length < depths.size) { \ + f_array_length_t i = depths.size - new_length; \ + for (; i < depths.size; i++) { \ + macro_fss_basic_list_read_depth_t_delete_simple(depths.array[i]); \ + } \ + } \ + if (status == F_none) status = f_memory_adjust(depths.size, new_length, sizeof(fss_basic_list_read_depth_t), (void **) & depths.array); \ + if (status == F_none) { \ + depths.size = new_length; \ + if (depths.used > depths.size) depths.used = new_length; \ + } +#endif // _di_fss_basic_list_read_depths_t_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_common_h diff --git a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c index ea29bfd..8b70e6e 100644 --- a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c +++ b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c @@ -1,4 +1,5 @@ #include "fss_basic_list_read.h" +#include "private-common.h" #include "private-fss_basic_list_read.h" #ifdef __cplusplus diff --git a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h index 4165637..53e834f 100644 --- a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h +++ b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h @@ -13,103 +13,6 @@ extern "C" { #endif /** - * A structure of parameters applied at some depth. - * - * depth: the depth number in which this is to be processed at. - * - * index_at: position of the "--at" parameter value in the argv list, when 0 there is no parameter. - * index_name: position of the "--name" parameter value in the argv list, when 0 there is no parameter. - * - * value_at: the value of the "--at" parameter, already processed and ready to use, only when index_at > 0. - * value_name: the value of the "--name" parameter, already processed and ready to use, only when index_name > 0. - */ -#ifndef _di_fss_basic_list_read_depth_t_ - typedef struct { - f_array_length_t depth; - - f_array_length_t index_at; - f_array_length_t index_name; - - f_number_unsigned_t value_at; - f_string_dynamic_t value_name; - } fss_basic_list_read_depth_t; - - #define fss_basic_list_read_depth_t_initialize \ - { \ - 0, \ - 0, \ - 0, \ - 0, \ - f_string_dynamic_t_initialize, \ - } - - #define macro_fss_basic_list_read_depth_t_clear(structure) \ - structure.depth = 0; \ - structure.index_at = 0; \ - structure.index_name = 0; \ - structure.value_at = 0; \ - macro_f_string_dynamic_t_clear(structure.value_name) - - #define macro_fss_basic_list_read_depth_t_delete_simple(structure) macro_f_string_dynamic_t_delete_simple(structure.value_name); -#endif // _di_fss_basic_list_read_depth_t_ - -/** - * An array of depth parameters. - * - * array: the array of depths. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ -#ifndef _di_fss_basic_list_read_depths_t_ - typedef struct { - fss_basic_list_read_depth_t *array; - - f_array_length_t size; - f_array_length_t used; - } fss_basic_list_read_depths_t; - - #define fss_basic_list_read_depths_t_initialize { 0, 0, 0 } - - #define macro_fss_basic_list_read_depths_t_clear(depths) macro_f_memory_structure_clear(depths) - - #define macro_fss_basic_list_read_depths_t_delete_simple(depths) \ - depths.used = depths.size; \ - while (depths.used > 0) { \ - depths.used--; \ - macro_fss_basic_list_read_depth_t_delete_simple(depths.array[depths.used]); \ - } \ - if (!depths.used) macro_f_memory_structure_delete_simple(depths, fss_basic_list_read_depth_t) - - #define macro_fss_basic_list_read_depths_t_resize(status, depths, new_length) \ - status = F_none; \ - if (new_length < depths.size) { \ - f_array_length_t i = depths.size - new_length; \ - for (; i < depths.size; i++) { \ - macro_fss_basic_list_read_depth_t_delete_simple(depths.array[i]); \ - } \ - } \ - if (status == F_none) status = f_memory_resize(depths.size, new_length, sizeof(fss_basic_list_read_depth_t), (void **) & depths.array); \ - if (status == F_none) { \ - depths.size = new_length; \ - if (depths.used > depths.size) depths.used = new_length; \ - } - - #define macro_fss_basic_list_read_depths_t_adjust(status, depths, new_length) \ - status = F_none; \ - if (new_length < depths.size) { \ - f_array_length_t i = depths.size - new_length; \ - for (; i < depths.size; i++) { \ - macro_fss_basic_list_read_depth_t_delete_simple(depths.array[i]); \ - } \ - } \ - if (status == F_none) status = f_memory_adjust(depths.size, new_length, sizeof(fss_basic_list_read_depth_t), (void **) & depths.array); \ - if (status == F_none) { \ - depths.size = new_length; \ - if (depths.used > depths.size) depths.used = new_length; \ - } -#endif // _di_fss_basic_list_read_depths_t_ - -/** * Pre-process the parameters, parsing out and handling the depth and depth related parameters. * * Will handle depth-sensitive parameter conflicts, such as --name being used with --at (which is not allowed). diff --git a/level_3/fss_basic_list_read/data/build/settings b/level_3/fss_basic_list_read/data/build/settings index b7d6b5f..73eb879 100644 --- a/level_3/fss_basic_list_read/data/build/settings +++ b/level_3/fss_basic_list_read/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library fss_basic_list_read.c private-fss_basic_list_read.c +build_sources_library fss_basic_list_read.c private-common.c private-fss_basic_list_read.c build_sources_program main.c build_sources_headers fss_basic_list_read.h build_sources_script diff --git a/level_3/fss_basic_list_write/c/fss_basic_list_write.c b/level_3/fss_basic_list_write/c/fss_basic_list_write.c index 2015af2..7747257 100644 --- a/level_3/fss_basic_list_write/c/fss_basic_list_write.c +++ b/level_3/fss_basic_list_write/c/fss_basic_list_write.c @@ -1,4 +1,5 @@ #include "fss_basic_list_write.h" +#include "private-common.h" #include "private-fss_basic_list_write.h" #ifdef __cplusplus diff --git a/level_3/fss_basic_list_write/c/private-common.c b/level_3/fss_basic_list_write/c/private-common.c new file mode 100644 index 0000000..1975491 --- /dev/null +++ b/level_3/fss_basic_list_write/c/private-common.c @@ -0,0 +1,10 @@ +#include "fss_basic_list_write.h" +#include "private-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fss_basic_list_write/c/private-common.h b/level_3/fss_basic_list_write/c/private-common.h new file mode 100644 index 0000000..2c5f723 --- /dev/null +++ b/level_3/fss_basic_list_write/c/private-common.h @@ -0,0 +1,19 @@ +/** + * FLL - Level 3 + * + * Project: FSS Basic List Write + * API Version: 0.5 + * Licenses: lgplv2.1 + */ +#ifndef _PRIVATE_common_h +#define _PRIVATE_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_common_h diff --git a/level_3/fss_basic_list_write/c/private-fss_basic_list_write.c b/level_3/fss_basic_list_write/c/private-fss_basic_list_write.c index a7745b5..fdca799 100644 --- a/level_3/fss_basic_list_write/c/private-fss_basic_list_write.c +++ b/level_3/fss_basic_list_write/c/private-fss_basic_list_write.c @@ -1,4 +1,5 @@ #include "fss_basic_list_write.h" +#include "private-common.h" #include "private-fss_basic_list_write.h" #ifdef __cplusplus diff --git a/level_3/fss_basic_list_write/data/build/settings b/level_3/fss_basic_list_write/data/build/settings index 4708f21..5a68360 100644 --- a/level_3/fss_basic_list_write/data/build/settings +++ b/level_3/fss_basic_list_write/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library fss_basic_list_write.c private-fss_basic_list_write.c +build_sources_library fss_basic_list_write.c private-common.c private-fss_basic_list_write.c build_sources_program main.c build_sources_headers fss_basic_list_write.h build_sources_script diff --git a/level_3/fss_basic_read/c/fss_basic_read.c b/level_3/fss_basic_read/c/fss_basic_read.c index 4135112..38a135b 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.c +++ b/level_3/fss_basic_read/c/fss_basic_read.c @@ -1,4 +1,5 @@ #include "fss_basic_read.h" +#include "private-common.h" #include "private-fss_basic_read.h" #ifdef __cplusplus diff --git a/level_3/fss_basic_read/c/private-common.c b/level_3/fss_basic_read/c/private-common.c new file mode 100644 index 0000000..b5e5148 --- /dev/null +++ b/level_3/fss_basic_read/c/private-common.c @@ -0,0 +1,10 @@ +#include "fss_basic_read.h" +#include "private-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fss_basic_read/c/private-common.h b/level_3/fss_basic_read/c/private-common.h new file mode 100644 index 0000000..3857fed --- /dev/null +++ b/level_3/fss_basic_read/c/private-common.h @@ -0,0 +1,169 @@ +/** + * FLL - Level 3 + * + * Project: FSS Basic Read + * API Version: 0.5 + * Licenses: lgplv2.1 + */ +#ifndef _PRIVATE_common_h +#define _PRIVATE_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * A structure of parameters applied at some depth. + * + * depth: the depth number in which this is to be processed at. + * + * index_at: position of the "--at" parameter value in the argv list, when 0 there is no parameter. + * index_name: position of the "--name" parameter value in the argv list, when 0 there is no parameter. + * + * value_at: the value of the "--at" parameter, already processed and ready to use, only when index_at > 0. + * value_name: the value of the "--name" parameter, already processed and ready to use, only when index_name > 0. + */ +#ifndef _di_fss_basic_read_depth_t_ + typedef struct { + f_array_length_t depth; + + f_array_length_t index_at; + f_array_length_t index_name; + + f_number_unsigned_t value_at; + f_string_dynamic_t value_name; + } fss_basic_read_depth_t; + + #define fss_basic_read_depth_t_initialize \ + { \ + 0, \ + 0, \ + 0, \ + 0, \ + f_string_dynamic_t_initialize, \ + } + + #define macro_fss_basic_read_depth_t_clear(structure) \ + structure.depth = 0; \ + structure.index_at = 0; \ + structure.index_name = 0; \ + structure.value_at = 0; \ + macro_f_string_dynamic_t_clear(structure.value_name) + + #define macro_fss_basic_read_depth_t_delete(status, structure) status = macro_f_string_dynamic_t_delete_simple(structure.value_name); + #define macro_fss_basic_read_depth_t_delete_simple(structure) macro_f_string_dynamic_t_delete_simple(structure.value_name); +#endif // _di_fss_basic_read_depth_t_ + +/** + * An array of depth parameters. + * + * array: the array of depths. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_fss_basic_read_depths_t_ + typedef struct { + fss_basic_read_depth_t *array; + + f_array_length_t size; + f_array_length_t used; + } fss_basic_read_depths_t; + + #define fss_basic_read_depths_t_initialize { 0, 0, 0 } + + #define macro_fss_basic_read_depths_t_clear(depths) macro_f_memory_structure_clear(depths) + + #define macro_fss_basic_read_depths_t_delete(status, depths) \ + status = F_none; \ + depths.used = depths.size; \ + while (depths.used > 0) { \ + depths.used--; \ + macro_fss_basic_read_depth_t_delete(status, depths.array[depths.used]); \ + if (F_status_is_error(status)) break; \ + } \ + if (status == F_none) macro_f_memory_structure_delete(depths, fss_basic_read_depth_t) + + #define macro_fss_basic_read_depths_t_delete_simple(depths) \ + depths.used = depths.size; \ + while (depths.used > 0) { \ + depths.used--; \ + macro_fss_basic_read_depth_t_delete_simple(depths.array[depths.used]); \ + } \ + if (!depths.used) macro_f_memory_structure_delete_simple(depths, fss_basic_read_depth_t) + + #define macro_fss_basic_read_depths_t_resize(status, depths, new_length) \ + status = F_none; \ + if (new_length < depths.size) { \ + f_array_length_t i = depths.size - new_length; \ + for (; i < depths.size; i++) { \ + macro_fss_basic_read_depth_t_delete(status, depths.array[i]); \ + if (F_status_is_error(status)) break; \ + } \ + } \ + if (status == F_none) status = f_memory_resize(depths.size, new_length, sizeof(fss_basic_read_depth_t), (void **) & depths.array); \ + if (status == F_none) { \ + depths.size = new_length; \ + if (depths.used > depths.size) depths.used = new_length; \ + } + + #define macro_fss_basic_read_depths_t_adjust(status, depths, new_length) \ + status = F_none; \ + if (new_length < depths.size) { \ + f_array_length_t i = depths.size - new_length; \ + for (; i < depths.size; i++) { \ + macro_fss_basic_read_depth_t_delete(status, depths.array[i]); \ + if (F_status_is_error(status)) break; \ + } \ + } \ + if (status == F_none) status = f_memory_adjust(depths.size, new_length, sizeof(fss_basic_read_depth_t), (void **) & depths.array); \ + if (status == F_none) { \ + depths.size = new_length; \ + if (depths.used > depths.size) depths.used = new_length; \ + } +#endif // _di_fss_basic_read_depths_t_ + +/** + * A structure for designating where within the buffer a particular file exists, using a statically allocated array. + * + * name: The name of the file representing the range. Set string to NULL to represent the STDIN pipe. + */ +#ifndef _di_fss_basic_read_file_t_ + typedef struct { + f_string_t name; + f_string_range_t range; + } fss_basic_read_file_t; + + #define fss_basic_read_file_t_initialize \ + { \ + f_string_t_initialize, \ + f_string_range_t_initialize, \ + } +#endif // _di_fss_basic_read_file_t_ + +/** + * An array of depth parameters. + * + * This is intended to be defined and used statically allocated and as such no dynamic allocation or dynamic deallocation methods are provided. + * + * The STDIN pipe is reserved for index 0 and as such size and used must be initialized to 1. + * + * array: The array of depths. + * size: Total amount of allocated space. + * used: Total number of allocated spaces used. + */ +#ifndef _di_fss_basic_read_files_t_ + typedef struct { + fss_basic_read_file_t *array; + + f_array_length_t size; + f_array_length_t used; + } fss_basic_read_files_t; + + #define fss_basic_read_files_t_initialize { 0, 1, 1 } +#endif // _di_fss_basic_read_files_t_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_common_h diff --git a/level_3/fss_basic_read/c/private-fss_basic_read.c b/level_3/fss_basic_read/c/private-fss_basic_read.c index 0087bdc..6be3eca 100644 --- a/level_3/fss_basic_read/c/private-fss_basic_read.c +++ b/level_3/fss_basic_read/c/private-fss_basic_read.c @@ -1,4 +1,5 @@ #include "fss_basic_read.h" +#include "private-common.h" #include "private-fss_basic_read.h" #ifdef __cplusplus diff --git a/level_3/fss_basic_read/c/private-fss_basic_read.h b/level_3/fss_basic_read/c/private-fss_basic_read.h index d1b6448..bd1d4ef 100644 --- a/level_3/fss_basic_read/c/private-fss_basic_read.h +++ b/level_3/fss_basic_read/c/private-fss_basic_read.h @@ -13,156 +13,6 @@ extern "C" { #endif /** - * A structure of parameters applied at some depth. - * - * depth: the depth number in which this is to be processed at. - * - * index_at: position of the "--at" parameter value in the argv list, when 0 there is no parameter. - * index_name: position of the "--name" parameter value in the argv list, when 0 there is no parameter. - * - * value_at: the value of the "--at" parameter, already processed and ready to use, only when index_at > 0. - * value_name: the value of the "--name" parameter, already processed and ready to use, only when index_name > 0. - */ -#ifndef _di_fss_basic_read_depth_t_ - typedef struct { - f_array_length_t depth; - - f_array_length_t index_at; - f_array_length_t index_name; - - f_number_unsigned_t value_at; - f_string_dynamic_t value_name; - } fss_basic_read_depth_t; - - #define fss_basic_read_depth_t_initialize \ - { \ - 0, \ - 0, \ - 0, \ - 0, \ - f_string_dynamic_t_initialize, \ - } - - #define macro_fss_basic_read_depth_t_clear(structure) \ - structure.depth = 0; \ - structure.index_at = 0; \ - structure.index_name = 0; \ - structure.value_at = 0; \ - macro_f_string_dynamic_t_clear(structure.value_name) - - #define macro_fss_basic_read_depth_t_delete(status, structure) status = macro_f_string_dynamic_t_delete_simple(structure.value_name); - #define macro_fss_basic_read_depth_t_delete_simple(structure) macro_f_string_dynamic_t_delete_simple(structure.value_name); -#endif // _di_fss_basic_read_depth_t_ - -/** - * An array of depth parameters. - * - * array: the array of depths. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ -#ifndef _di_fss_basic_read_depths_t_ - typedef struct { - fss_basic_read_depth_t *array; - - f_array_length_t size; - f_array_length_t used; - } fss_basic_read_depths_t; - - #define fss_basic_read_depths_t_initialize { 0, 0, 0 } - - #define macro_fss_basic_read_depths_t_clear(depths) macro_f_memory_structure_clear(depths) - - #define macro_fss_basic_read_depths_t_delete(status, depths) \ - status = F_none; \ - depths.used = depths.size; \ - while (depths.used > 0) { \ - depths.used--; \ - macro_fss_basic_read_depth_t_delete(status, depths.array[depths.used]); \ - if (F_status_is_error(status)) break; \ - } \ - if (status == F_none) macro_f_memory_structure_delete(depths, fss_basic_read_depth_t) - - #define macro_fss_basic_read_depths_t_delete_simple(depths) \ - depths.used = depths.size; \ - while (depths.used > 0) { \ - depths.used--; \ - macro_fss_basic_read_depth_t_delete_simple(depths.array[depths.used]); \ - } \ - if (!depths.used) macro_f_memory_structure_delete_simple(depths, fss_basic_read_depth_t) - - #define macro_fss_basic_read_depths_t_resize(status, depths, new_length) \ - status = F_none; \ - if (new_length < depths.size) { \ - f_array_length_t i = depths.size - new_length; \ - for (; i < depths.size; i++) { \ - macro_fss_basic_read_depth_t_delete(status, depths.array[i]); \ - if (F_status_is_error(status)) break; \ - } \ - } \ - if (status == F_none) status = f_memory_resize(depths.size, new_length, sizeof(fss_basic_read_depth_t), (void **) & depths.array); \ - if (status == F_none) { \ - depths.size = new_length; \ - if (depths.used > depths.size) depths.used = new_length; \ - } - - #define macro_fss_basic_read_depths_t_adjust(status, depths, new_length) \ - status = F_none; \ - if (new_length < depths.size) { \ - f_array_length_t i = depths.size - new_length; \ - for (; i < depths.size; i++) { \ - macro_fss_basic_read_depth_t_delete(status, depths.array[i]); \ - if (F_status_is_error(status)) break; \ - } \ - } \ - if (status == F_none) status = f_memory_adjust(depths.size, new_length, sizeof(fss_basic_read_depth_t), (void **) & depths.array); \ - if (status == F_none) { \ - depths.size = new_length; \ - if (depths.used > depths.size) depths.used = new_length; \ - } -#endif // _di_fss_basic_read_depths_t_ - -/** - * A structure for designating where within the buffer a particular file exists, using a statically allocated array. - * - * name: The name of the file representing the range. Set string to NULL to represent the STDIN pipe. - */ -#ifndef _di_fss_basic_read_file_t_ - typedef struct { - f_string_t name; - f_string_range_t range; - } fss_basic_read_file_t; - - #define fss_basic_read_file_t_initialize \ - { \ - f_string_t_initialize, \ - f_string_range_t_initialize, \ - } -#endif // _di_fss_basic_read_file_t_ - -/** - * An array of depth parameters. - * - * This is intended to be defined and used statically allocated and as such no dynamic allocation or dynamic deallocation methods are provided. - * - * The STDIN pipe is reserved for index 0 and as such size and used must be initialized to 1. - * - * array: The array of depths. - * size: Total amount of allocated space. - * used: Total number of allocated spaces used. - */ -#ifndef _di_fss_basic_read_files_t_ - typedef struct { - fss_basic_read_file_t *array; - - f_array_length_t size; - f_array_length_t used; - } fss_basic_read_files_t; - - #define fss_basic_read_files_t_initialize { 0, 1, 1 } -#endif // _di_fss_basic_read_files_t_ - -/** * Process the parameters, parsing out and handling the depth and depth related parameters. * * Will handle depth-sensitive parameter conflicts, such as --name being used with --at (which is not allowed). diff --git a/level_3/fss_basic_read/data/build/settings b/level_3/fss_basic_read/data/build/settings index 1a85cda..fd52409 100644 --- a/level_3/fss_basic_read/data/build/settings +++ b/level_3/fss_basic_read/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library fss_basic_read.c private-fss_basic_read.c +build_sources_library fss_basic_read.c private-common.c private-fss_basic_read.c build_sources_program main.c build_sources_headers fss_basic_read.h build_sources_script diff --git a/level_3/fss_basic_write/c/fss_basic_write.c b/level_3/fss_basic_write/c/fss_basic_write.c index e5a591b..9ec2ec8 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -1,4 +1,5 @@ #include "fss_basic_write.h" +#include "private-common.h" #include "private-fss_basic_write.h" #ifdef __cplusplus diff --git a/level_3/fss_basic_write/c/private-common.c b/level_3/fss_basic_write/c/private-common.c new file mode 100644 index 0000000..d1c0ac4 --- /dev/null +++ b/level_3/fss_basic_write/c/private-common.c @@ -0,0 +1,10 @@ +#include "fss_basic_write.h" +#include "private-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fss_basic_write/c/private-common.h b/level_3/fss_basic_write/c/private-common.h new file mode 100644 index 0000000..bbd31e0 --- /dev/null +++ b/level_3/fss_basic_write/c/private-common.h @@ -0,0 +1,19 @@ +/** + * FLL - Level 3 + * + * Project: FSS Basic Write + * API Version: 0.5 + * Licenses: lgplv2.1 + */ +#ifndef _PRIVATE_common_h +#define _PRIVATE_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_common_h diff --git a/level_3/fss_basic_write/c/private-fss_basic_write.c b/level_3/fss_basic_write/c/private-fss_basic_write.c index d22004f..7946323 100644 --- a/level_3/fss_basic_write/c/private-fss_basic_write.c +++ b/level_3/fss_basic_write/c/private-fss_basic_write.c @@ -1,4 +1,5 @@ #include "fss_basic_write.h" +#include "private-common.h" #include "private-fss_basic_write.h" #ifdef __cplusplus diff --git a/level_3/fss_basic_write/data/build/settings b/level_3/fss_basic_write/data/build/settings index 48aa610..207bb58 100644 --- a/level_3/fss_basic_write/data/build/settings +++ b/level_3/fss_basic_write/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library fss_basic_write.c private-fss_basic_write.c +build_sources_library fss_basic_write.c private-common.c private-fss_basic_write.c build_sources_program main.c build_sources_headers fss_basic_write.h build_sources_script diff --git a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c index 0c075b4..6c6a611 100644 --- a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c +++ b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c @@ -1,4 +1,5 @@ #include "fss_embedded_list_read.h" +#include "private-common.h" #include "private-fss_embedded_list_read.h" #ifdef __cplusplus diff --git a/level_3/fss_embedded_list_read/c/private-common.c b/level_3/fss_embedded_list_read/c/private-common.c new file mode 100644 index 0000000..d62fdfa --- /dev/null +++ b/level_3/fss_embedded_list_read/c/private-common.c @@ -0,0 +1,10 @@ +#include "fss_embedded_list_read.h" +#include "private-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fss_embedded_list_read/c/private-common.h b/level_3/fss_embedded_list_read/c/private-common.h new file mode 100644 index 0000000..6402e84 --- /dev/null +++ b/level_3/fss_embedded_list_read/c/private-common.h @@ -0,0 +1,141 @@ +/** + * FLL - Level 3 + * + * Project: FSS Embedded List Read + * API Version: 0.5 + * Licenses: lgplv2.1 + */ +#ifndef _PRIVATE_common_h +#define _PRIVATE_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * A structure of parameters applied at some depth. + * + * depth: the depth number in which this is to be processed at. + * + * index_at: position of the "--at" parameter value in the argv list, when 0 there is no parameter. + * index_name: position of the "--name" parameter value in the argv list, when 0 there is no parameter. + * + * value_at: the value of the "--at" parameter, already processed and ready to use, only when index_at > 0. + * value_name: the value of the "--name" parameter, already processed and ready to use, only when index_name > 0. + */ +#ifndef _di_fss_embedded_list_read_depth_t_ + typedef struct { + f_array_length_t depth; + + f_array_length_t index_at; + f_array_length_t index_name; + + f_number_unsigned_t value_at; + f_string_dynamic_t value_name; + } fss_embedded_list_read_depth_t; + + #define fss_embedded_list_read_depth_t_initialize \ + { \ + 0, \ + 0, \ + 0, \ + 0, \ + f_string_dynamic_t_initialize, \ + } + + #define macro_fss_embedded_list_read_depth_t_clear(structure) \ + structure.depth = 0; \ + structure.index_at = 0; \ + structure.index_name = 0; \ + structure.value_at = 0; \ + macro_f_string_dynamic_t_clear(structure.value_name) + + #define macro_fss_embedded_list_read_depth_t_delete_simple(structure) macro_f_string_dynamic_t_delete_simple(structure.value_name) +#endif // _di_fss_embedded_list_read_depth_t_ + +/** + * A structure containing a statically allocated array of booleans and the array length. + * + * skip: a statically allocated array representing list items that are to be skipped. + * used: the length of the statically allocated skip array. + */ +#ifndef _di_fss_embedded_list_read_skip_t_ + typedef struct { + bool *skip; + f_array_length_t used; + } fss_embedded_list_read_skip_t; + + #define fss_embedded_list_read_skip_t_initialize \ + { \ + 0, \ + 0, \ + } + + #define macro_fss_embedded_list_read_skip_t_initialize(skip, used) \ + { \ + skip, \ + used, \ + } +#endif // _di_fss_embedded_list_read_skip_t_ + +/** + * An array of depth parameters. + * + * array: the array of depths. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_fss_embedded_list_read_depths_t_ + typedef struct { + fss_embedded_list_read_depth_t *array; + + f_array_length_t size; + f_array_length_t used; + } fss_embedded_list_read_depths_t; + + #define fss_embedded_list_read_depths_t_initialize { 0, 0, 0 } + + #define macro_fss_embedded_list_read_depths_t_clear(depths) macro_f_memory_structure_clear(depths) + + #define macro_fss_embedded_list_read_depths_t_delete_simple(depths) \ + depths.used = depths.size; \ + while (depths.used > 0) { \ + depths.used--; \ + macro_fss_embedded_list_read_depth_t_delete_simple(depths.array[depths.used]); \ + } \ + if (!depths.used) macro_f_memory_structure_delete_simple(depths, fss_embedded_list_read_depth_t) + + #define macro_fss_embedded_list_read_depths_t_resize(status, depths, new_length) \ + status = F_none; \ + if (new_length < depths.size) { \ + f_array_length_t i = depths.size - new_length; \ + for (; i < depths.size; i++) { \ + macro_fss_embedded_list_read_depth_t_delete_simple(depths.array[i]); \ + } \ + } \ + if (status == F_none) status = f_memory_resize(depths.size, new_length, sizeof(fss_embedded_list_read_depth_t), (void **) & depths.array); \ + if (status == F_none) { \ + depths.size = new_length; \ + if (depths.used > depths.size) depths.used = new_length; \ + } + + #define macro_fss_embedded_list_read_depths_t_adjust(status, depths, new_length) \ + status = F_none; \ + if (new_length < depths.size) { \ + f_array_length_t i = depths.size - new_length; \ + for (; i < depths.size; i++) { \ + macro_fss_embedded_list_read_depth_t_delete_simple(depths.array[i]); \ + } \ + } \ + if (status == F_none) status = f_memory_adjust(depths.size, new_length, sizeof(fss_embedded_list_read_depth_t), (void **) & depths.array); \ + if (status == F_none) { \ + depths.size = new_length; \ + if (depths.used > depths.size) depths.used = new_length; \ + } +#endif // _di_fss_embedded_list_read_depths_t_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_common_h diff --git a/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c b/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c index 0ff8104..26a1fa4 100644 --- a/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c +++ b/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c @@ -1,4 +1,5 @@ #include "fss_embedded_list_read.h" +#include "private-common.h" #include "private-fss_embedded_list_read.h" #ifdef __cplusplus diff --git a/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.h b/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.h index cb6e720..31a946a 100644 --- a/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.h +++ b/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.h @@ -13,128 +13,6 @@ extern "C" { #endif /** - * A structure of parameters applied at some depth. - * - * depth: the depth number in which this is to be processed at. - * - * index_at: position of the "--at" parameter value in the argv list, when 0 there is no parameter. - * index_name: position of the "--name" parameter value in the argv list, when 0 there is no parameter. - * - * value_at: the value of the "--at" parameter, already processed and ready to use, only when index_at > 0. - * value_name: the value of the "--name" parameter, already processed and ready to use, only when index_name > 0. - */ -#ifndef _di_fss_embedded_list_read_depth_t_ - typedef struct { - f_array_length_t depth; - - f_array_length_t index_at; - f_array_length_t index_name; - - f_number_unsigned_t value_at; - f_string_dynamic_t value_name; - } fss_embedded_list_read_depth_t; - - #define fss_embedded_list_read_depth_t_initialize \ - { \ - 0, \ - 0, \ - 0, \ - 0, \ - f_string_dynamic_t_initialize, \ - } - - #define macro_fss_embedded_list_read_depth_t_clear(structure) \ - structure.depth = 0; \ - structure.index_at = 0; \ - structure.index_name = 0; \ - structure.value_at = 0; \ - macro_f_string_dynamic_t_clear(structure.value_name) - - #define macro_fss_embedded_list_read_depth_t_delete_simple(structure) macro_f_string_dynamic_t_delete_simple(structure.value_name) -#endif // _di_fss_embedded_list_read_depth_t_ - -/** - * A structure containing a statically allocated array of booleans and the array length. - * - * skip: a statically allocated array representing list items that are to be skipped. - * used: the length of the statically allocated skip array. - */ -#ifndef _di_fss_embedded_list_read_skip_t_ - typedef struct { - bool *skip; - f_array_length_t used; - } fss_embedded_list_read_skip_t; - - #define fss_embedded_list_read_skip_t_initialize \ - { \ - 0, \ - 0, \ - } - - #define macro_fss_embedded_list_read_skip_t_initialize(skip, used) \ - { \ - skip, \ - used, \ - } -#endif // _di_fss_embedded_list_read_skip_t_ - -/** - * An array of depth parameters. - * - * array: the array of depths. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ -#ifndef _di_fss_embedded_list_read_depths_t_ - typedef struct { - fss_embedded_list_read_depth_t *array; - - f_array_length_t size; - f_array_length_t used; - } fss_embedded_list_read_depths_t; - - #define fss_embedded_list_read_depths_t_initialize { 0, 0, 0 } - - #define macro_fss_embedded_list_read_depths_t_clear(depths) macro_f_memory_structure_clear(depths) - - #define macro_fss_embedded_list_read_depths_t_delete_simple(depths) \ - depths.used = depths.size; \ - while (depths.used > 0) { \ - depths.used--; \ - macro_fss_embedded_list_read_depth_t_delete_simple(depths.array[depths.used]); \ - } \ - if (!depths.used) macro_f_memory_structure_delete_simple(depths, fss_embedded_list_read_depth_t) - - #define macro_fss_embedded_list_read_depths_t_resize(status, depths, new_length) \ - status = F_none; \ - if (new_length < depths.size) { \ - f_array_length_t i = depths.size - new_length; \ - for (; i < depths.size; i++) { \ - macro_fss_embedded_list_read_depth_t_delete_simple(depths.array[i]); \ - } \ - } \ - if (status == F_none) status = f_memory_resize(depths.size, new_length, sizeof(fss_embedded_list_read_depth_t), (void **) & depths.array); \ - if (status == F_none) { \ - depths.size = new_length; \ - if (depths.used > depths.size) depths.used = new_length; \ - } - - #define macro_fss_embedded_list_read_depths_t_adjust(status, depths, new_length) \ - status = F_none; \ - if (new_length < depths.size) { \ - f_array_length_t i = depths.size - new_length; \ - for (; i < depths.size; i++) { \ - macro_fss_embedded_list_read_depth_t_delete_simple(depths.array[i]); \ - } \ - } \ - if (status == F_none) status = f_memory_adjust(depths.size, new_length, sizeof(fss_embedded_list_read_depth_t), (void **) & depths.array); \ - if (status == F_none) { \ - depths.size = new_length; \ - if (depths.used > depths.size) depths.used = new_length; \ - } -#endif // _di_fss_embedded_list_read_depths_t_ - -/** * Pre-process the parameters, parsing out and handling the depth and depth related parameters. * * Will handle depth-sensitive parameter conflicts, such as --name being used with --at (which is not allowed). diff --git a/level_3/fss_embedded_list_read/data/build/settings b/level_3/fss_embedded_list_read/data/build/settings index 8c646b3..1d03e1e 100644 --- a/level_3/fss_embedded_list_read/data/build/settings +++ b/level_3/fss_embedded_list_read/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library fss_embedded_list_read.c private-fss_embedded_list_read.c +build_sources_library fss_embedded_list_read.c private-common.c private-fss_embedded_list_read.c build_sources_program main.c build_sources_headers fss_embedded_list_read.h build_sources_script diff --git a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c index 08dd966..07c7e8f 100644 --- a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c +++ b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c @@ -1,4 +1,5 @@ #include "fss_embedded_list_write.h" +#include "private-common.h" #include "private-fss_embedded_list_write.h" #ifdef __cplusplus diff --git a/level_3/fss_embedded_list_write/c/private-common.c b/level_3/fss_embedded_list_write/c/private-common.c new file mode 100644 index 0000000..16c4cbb --- /dev/null +++ b/level_3/fss_embedded_list_write/c/private-common.c @@ -0,0 +1,10 @@ +#include "fss_embedded_list_write.h" +#include "private-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fss_embedded_list_write/c/private-common.h b/level_3/fss_embedded_list_write/c/private-common.h new file mode 100644 index 0000000..db0f899 --- /dev/null +++ b/level_3/fss_embedded_list_write/c/private-common.h @@ -0,0 +1,19 @@ +/** + * FLL - Level 3 + * + * Project: FSS Embedded List Write + * API Version: 0.5 + * Licenses: lgplv2.1 + */ +#ifndef _PRIVATE_common_h +#define _PRIVATE_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_common_h diff --git a/level_3/fss_embedded_list_write/c/private-fss_embedded_list_write.c b/level_3/fss_embedded_list_write/c/private-fss_embedded_list_write.c index e79e99d..324fb06 100644 --- a/level_3/fss_embedded_list_write/c/private-fss_embedded_list_write.c +++ b/level_3/fss_embedded_list_write/c/private-fss_embedded_list_write.c @@ -1,4 +1,5 @@ #include "fss_embedded_list_write.h" +#include "private-common.h" #include "private-fss_embedded_list_write.h" #ifdef __cplusplus diff --git a/level_3/fss_embedded_list_write/data/build/settings b/level_3/fss_embedded_list_write/data/build/settings index 7595f7f..a564014 100644 --- a/level_3/fss_embedded_list_write/data/build/settings +++ b/level_3/fss_embedded_list_write/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library fss_embedded_list_write.c private-fss_embedded_list_write.c +build_sources_library fss_embedded_list_write.c private-common.c private-fss_embedded_list_write.c build_sources_program main.c build_sources_headers fss_embedded_list_write.h build_sources_script diff --git a/level_3/fss_extended_list_read/c/fss_extended_list_read.c b/level_3/fss_extended_list_read/c/fss_extended_list_read.c index 567fc2c..e9fc321 100644 --- a/level_3/fss_extended_list_read/c/fss_extended_list_read.c +++ b/level_3/fss_extended_list_read/c/fss_extended_list_read.c @@ -1,4 +1,5 @@ #include "fss_extended_list_read.h" +#include "private-common.h" #include "private-fss_extended_list_read.h" #ifdef __cplusplus diff --git a/level_3/fss_extended_list_read/c/private-common.c b/level_3/fss_extended_list_read/c/private-common.c new file mode 100644 index 0000000..24bf332 --- /dev/null +++ b/level_3/fss_extended_list_read/c/private-common.c @@ -0,0 +1,10 @@ +#include "fss_extended_list_read.h" +#include "private-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fss_extended_list_read/c/private-common.h b/level_3/fss_extended_list_read/c/private-common.h new file mode 100644 index 0000000..34e928d --- /dev/null +++ b/level_3/fss_extended_list_read/c/private-common.h @@ -0,0 +1,118 @@ +/** + * FLL - Level 3 + * + * Project: Extended List Read + * API Version: 0.5 + * Licenses: lgplv2.1 + */ +#ifndef _PRIVATE_common_h +#define _PRIVATE_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * A structure of parameters applied at some depth. + * + * depth: the depth number in which this is to be processed at. + * + * index_at: position of the "--at" parameter value in the argv list, when 0 there is no parameter. + * index_name: position of the "--name" parameter value in the argv list, when 0 there is no parameter. + * + * value_at: the value of the "--at" parameter, already processed and ready to use, only when index_at > 0. + * value_name: the value of the "--name" parameter, already processed and ready to use, only when index_name > 0. + */ +#ifndef _di_fss_extended_list_read_depth_t_ + typedef struct { + f_array_length_t depth; + + f_array_length_t index_at; + f_array_length_t index_name; + + f_number_unsigned_t value_at; + f_string_dynamic_t value_name; + } fss_extended_list_read_depth_t; + + #define fss_extended_list_read_depth_t_initialize \ + { \ + 0, \ + 0, \ + 0, \ + 0, \ + f_string_dynamic_t_initialize, \ + } + + #define macro_fss_extended_list_read_depth_t_clear(structure) \ + structure.depth = 0; \ + structure.index_at = 0; \ + structure.index_name = 0; \ + structure.value_at = 0; \ + macro_f_string_dynamic_t_clear(structure.value_name) + + #define macro_fss_extended_list_read_depth_t_delete_simple(structure) macro_f_string_dynamic_t_delete_simple(structure.value_name) +#endif // _di_fss_extended_list_read_depth_t_ + +/** + * An array of depth parameters. + * + * array: the array of depths. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_fss_extended_list_read_depths_t_ + typedef struct { + fss_extended_list_read_depth_t *array; + + f_array_length_t size; + f_array_length_t used; + } fss_extended_list_read_depths_t; + + #define fss_extended_list_read_depths_t_initialize { 0, 0, 0 } + + #define macro_fss_extended_list_read_depths_t_clear(depths) macro_f_memory_structure_clear(depths) + + #define macro_fss_extended_list_read_depths_t_delete_simple(depths) \ + depths.used = depths.size; \ + while (depths.used > 0) { \ + depths.used--; \ + macro_fss_extended_list_read_depth_t_delete_simple(depths.array[depths.used]); \ + } \ + if (!depths.used) macro_f_memory_structure_delete_simple(depths, fss_extended_list_read_depth_t) + + #define macro_fss_extended_list_read_depths_t_resize(status, depths, new_length) \ + status = F_none; \ + if (new_length < depths.size) { \ + f_array_length_t i = depths.size - new_length; \ + for (; i < depths.size; i++) { \ + macro_fss_extended_list_read_depth_t_delete_simple(depths.array[i]); \ + if (F_status_is_error(status)) break; \ + } \ + } \ + if (status == F_none) status = f_memory_resize(depths.size, new_length, sizeof(fss_extended_list_read_depth_t), (void **) & depths.array); \ + if (status == F_none) { \ + depths.size = new_length; \ + if (depths.used > depths.size) depths.used = new_length; \ + } + + #define macro_fss_extended_list_read_depths_t_adjust(status, depths, new_length) \ + status = F_none; \ + if (new_length < depths.size) { \ + f_array_length_t i = depths.size - new_length; \ + for (; i < depths.size; i++) { \ + macro_fss_extended_list_read_depth_t_delete_simple(depths.array[i]); \ + if (F_status_is_error(status)) break; \ + } \ + } \ + if (status == F_none) status = f_memory_adjust(depths.size, new_length, sizeof(fss_extended_list_read_depth_t), (void **) & depths.array); \ + if (status == F_none) { \ + depths.size = new_length; \ + if (depths.used > depths.size) depths.used = new_length; \ + } +#endif // _di_fss_extended_list_read_depths_t_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_common_h diff --git a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c index fa58750..c5a105f 100644 --- a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c +++ b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c @@ -1,4 +1,5 @@ #include "fss_extended_list_read.h" +#include "private-common.h" #include "private-fss_extended_list_read.h" #ifdef __cplusplus diff --git a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h index 1825471..3eb9ed5 100644 --- a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h +++ b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h @@ -13,105 +13,6 @@ extern "C" { #endif /** - * A structure of parameters applied at some depth. - * - * depth: the depth number in which this is to be processed at. - * - * index_at: position of the "--at" parameter value in the argv list, when 0 there is no parameter. - * index_name: position of the "--name" parameter value in the argv list, when 0 there is no parameter. - * - * value_at: the value of the "--at" parameter, already processed and ready to use, only when index_at > 0. - * value_name: the value of the "--name" parameter, already processed and ready to use, only when index_name > 0. - */ -#ifndef _di_fss_extended_list_read_depth_t_ - typedef struct { - f_array_length_t depth; - - f_array_length_t index_at; - f_array_length_t index_name; - - f_number_unsigned_t value_at; - f_string_dynamic_t value_name; - } fss_extended_list_read_depth_t; - - #define fss_extended_list_read_depth_t_initialize \ - { \ - 0, \ - 0, \ - 0, \ - 0, \ - f_string_dynamic_t_initialize, \ - } - - #define macro_fss_extended_list_read_depth_t_clear(structure) \ - structure.depth = 0; \ - structure.index_at = 0; \ - structure.index_name = 0; \ - structure.value_at = 0; \ - macro_f_string_dynamic_t_clear(structure.value_name) - - #define macro_fss_extended_list_read_depth_t_delete_simple(structure) macro_f_string_dynamic_t_delete_simple(structure.value_name) -#endif // _di_fss_extended_list_read_depth_t_ - -/** - * An array of depth parameters. - * - * array: the array of depths. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ -#ifndef _di_fss_extended_list_read_depths_t_ - typedef struct { - fss_extended_list_read_depth_t *array; - - f_array_length_t size; - f_array_length_t used; - } fss_extended_list_read_depths_t; - - #define fss_extended_list_read_depths_t_initialize { 0, 0, 0 } - - #define macro_fss_extended_list_read_depths_t_clear(depths) macro_f_memory_structure_clear(depths) - - #define macro_fss_extended_list_read_depths_t_delete_simple(depths) \ - depths.used = depths.size; \ - while (depths.used > 0) { \ - depths.used--; \ - macro_fss_extended_list_read_depth_t_delete_simple(depths.array[depths.used]); \ - } \ - if (!depths.used) macro_f_memory_structure_delete_simple(depths, fss_extended_list_read_depth_t) - - #define macro_fss_extended_list_read_depths_t_resize(status, depths, new_length) \ - status = F_none; \ - if (new_length < depths.size) { \ - f_array_length_t i = depths.size - new_length; \ - for (; i < depths.size; i++) { \ - macro_fss_extended_list_read_depth_t_delete_simple(depths.array[i]); \ - if (F_status_is_error(status)) break; \ - } \ - } \ - if (status == F_none) status = f_memory_resize(depths.size, new_length, sizeof(fss_extended_list_read_depth_t), (void **) & depths.array); \ - if (status == F_none) { \ - depths.size = new_length; \ - if (depths.used > depths.size) depths.used = new_length; \ - } - - #define macro_fss_extended_list_read_depths_t_adjust(status, depths, new_length) \ - status = F_none; \ - if (new_length < depths.size) { \ - f_array_length_t i = depths.size - new_length; \ - for (; i < depths.size; i++) { \ - macro_fss_extended_list_read_depth_t_delete_simple(depths.array[i]); \ - if (F_status_is_error(status)) break; \ - } \ - } \ - if (status == F_none) status = f_memory_adjust(depths.size, new_length, sizeof(fss_extended_list_read_depth_t), (void **) & depths.array); \ - if (status == F_none) { \ - depths.size = new_length; \ - if (depths.used > depths.size) depths.used = new_length; \ - } -#endif // _di_fss_extended_list_read_depths_t_ - -/** * Pre-process the parameters, parsing out and handling the depth and depth related parameters. * * Will handle depth-sensitive parameter conflicts, such as --name being used with --at (which is not allowed). diff --git a/level_3/fss_extended_list_read/data/build/settings b/level_3/fss_extended_list_read/data/build/settings index b312f39..b8448f6 100644 --- a/level_3/fss_extended_list_read/data/build/settings +++ b/level_3/fss_extended_list_read/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library fss_extended_list_read.c private-fss_extended_list_read.c +build_sources_library fss_extended_list_read.c private-common.c private-fss_extended_list_read.c build_sources_program main.c build_sources_headers fss_extended_list_read.h build_sources_script diff --git a/level_3/fss_extended_list_write/c/fss_extended_list_write.c b/level_3/fss_extended_list_write/c/fss_extended_list_write.c index e105cfb..78869db 100644 --- a/level_3/fss_extended_list_write/c/fss_extended_list_write.c +++ b/level_3/fss_extended_list_write/c/fss_extended_list_write.c @@ -1,4 +1,5 @@ #include "fss_extended_list_write.h" +#include "private-common.h" #include "private-fss_extended_list_write.h" #ifdef __cplusplus diff --git a/level_3/fss_extended_list_write/c/private-common.c b/level_3/fss_extended_list_write/c/private-common.c new file mode 100644 index 0000000..4e3d529 --- /dev/null +++ b/level_3/fss_extended_list_write/c/private-common.c @@ -0,0 +1,10 @@ +#include "fss_extended_list_write.h" +#include "private-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fss_extended_list_write/c/private-common.h b/level_3/fss_extended_list_write/c/private-common.h new file mode 100644 index 0000000..e72a46d --- /dev/null +++ b/level_3/fss_extended_list_write/c/private-common.h @@ -0,0 +1,19 @@ +/** + * FLL - Level 3 + * + * Project: FSS Extended List Write + * API Version: 0.5 + * Licenses: lgplv2.1 + */ +#ifndef _PRIVATE_common_h +#define _PRIVATE_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_common_h diff --git a/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c b/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c index 561a46c..acdb66c 100644 --- a/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c +++ b/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c @@ -1,4 +1,5 @@ #include "fss_extended_list_write.h" +#include "private-common.h" #include "private-fss_extended_list_write.h" #ifdef __cplusplus diff --git a/level_3/fss_extended_list_write/data/build/settings b/level_3/fss_extended_list_write/data/build/settings index 13dbe49..1c4b86a 100644 --- a/level_3/fss_extended_list_write/data/build/settings +++ b/level_3/fss_extended_list_write/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library fss_extended_list_write.c private-fss_extended_list_write.c +build_sources_library fss_extended_list_write.c private-common.c private-fss_extended_list_write.c build_sources_program main.c build_sources_headers fss_extended_list_write.h build_sources_script diff --git a/level_3/fss_extended_read/c/fss_extended_read.c b/level_3/fss_extended_read/c/fss_extended_read.c index 0677a84..4d2a597 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.c +++ b/level_3/fss_extended_read/c/fss_extended_read.c @@ -1,4 +1,5 @@ #include "fss_extended_read.h" +#include "private-common.h" #include "private-fss_extended_read.h" #ifdef __cplusplus diff --git a/level_3/fss_extended_read/c/private-common.c b/level_3/fss_extended_read/c/private-common.c new file mode 100644 index 0000000..71344c8 --- /dev/null +++ b/level_3/fss_extended_read/c/private-common.c @@ -0,0 +1,10 @@ +#include "fss_extended_read.h" +#include "private-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fss_extended_read/c/private-common.h b/level_3/fss_extended_read/c/private-common.h new file mode 100644 index 0000000..5644c68 --- /dev/null +++ b/level_3/fss_extended_read/c/private-common.h @@ -0,0 +1,116 @@ +/** + * FLL - Level 3 + * + * Project: Extended Read + * API Version: 0.5 + * Licenses: lgplv2.1 + */ +#ifndef _PRIVATE_common_h +#define _PRIVATE_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * A structure of parameters applied at some depth. + * + * depth: the depth number in which this is to be processed at. + * + * index_at: position of the "--at" parameter value in the argv list, when 0 there is no parameter. + * index_name: position of the "--name" parameter value in the argv list, when 0 there is no parameter. + * + * value_at: the value of the "--at" parameter, already processed and ready to use, only when index_at > 0. + * value_name: the value of the "--name" parameter, already processed and ready to use, only when index_name > 0. + */ +#ifndef _di_fss_extended_read_depth_t_ + typedef struct { + f_array_length_t depth; + + f_array_length_t index_at; + f_array_length_t index_name; + + f_number_unsigned_t value_at; + f_string_dynamic_t value_name; + } fss_extended_read_depth_t; + + #define fss_extended_read_depth_t_initialize \ + { \ + 0, \ + 0, \ + 0, \ + 0, \ + f_string_dynamic_t_initialize, \ + } + + #define macro_fss_extended_read_depth_t_clear(structure) \ + structure.depth = 0; \ + structure.index_at = 0; \ + structure.index_name = 0; \ + structure.value_at = 0; \ + macro_f_string_dynamic_t_clear(structure.value_name) + + #define macro_fss_extended_read_depth_t_delete_simple(structure) macro_f_string_dynamic_t_delete_simple(structure.value_name) +#endif // _di_fss_extended_read_depth_t_ + +/** + * An array of depth parameters. + * + * array: the array of depths. + * size: total amount of allocated space. + * used: total number of allocated spaces used. + */ +#ifndef _di_fss_extended_read_depths_t_ + typedef struct { + fss_extended_read_depth_t *array; + + f_array_length_t size; + f_array_length_t used; + } fss_extended_read_depths_t; + + #define fss_extended_read_depths_t_initialize { 0, 0, 0 } + + #define macro_fss_extended_read_depths_t_clear(depths) macro_f_memory_structure_clear(depths) + + #define macro_fss_extended_read_depths_t_delete_simple(depths) \ + depths.used = depths.size; \ + while (depths.used > 0) { \ + depths.used--; \ + macro_fss_extended_read_depth_t_delete_simple(depths.array[depths.used]); \ + } \ + if (!depths.used) macro_f_memory_structure_delete_simple(depths, fss_extended_read_depth_t) + + #define macro_fss_extended_read_depths_t_resize(status, depths, new_length) \ + status = F_none; \ + if (new_length < depths.size) { \ + f_array_length_t i = depths.size - new_length; \ + for (; i < depths.size; i++) { \ + macro_fss_extended_read_depth_t_delete_simple(depths.array[i]); \ + } \ + } \ + if (status == F_none) status = f_memory_resize(depths.size, new_length, sizeof(fss_extended_read_depth_t), (void **) & depths.array); \ + if (status == F_none) { \ + depths.size = new_length; \ + if (depths.used > depths.size) depths.used = new_length; \ + } + + #define macro_fss_extended_read_depths_t_adjust(status, depths, new_length) \ + status = F_none; \ + if (new_length < depths.size) { \ + f_array_length_t i = depths.size - new_length; \ + for (; i < depths.size; i++) { \ + macro_fss_extended_read_depth_t_delete_simple(depths.array[i]); \ + } \ + } \ + if (status == F_none) status = f_memory_adjust(depths.size, new_length, sizeof(fss_extended_read_depth_t), (void **) & depths.array); \ + if (status == F_none) { \ + depths.size = new_length; \ + if (depths.used > depths.size) depths.used = new_length; \ + } +#endif // _di_fss_extended_read_depths_t_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_common_h diff --git a/level_3/fss_extended_read/c/private-fss_extended_read.c b/level_3/fss_extended_read/c/private-fss_extended_read.c index 56931c9..78bc3db 100644 --- a/level_3/fss_extended_read/c/private-fss_extended_read.c +++ b/level_3/fss_extended_read/c/private-fss_extended_read.c @@ -1,4 +1,5 @@ #include "fss_extended_read.h" +#include "private-common.h" #include "private-fss_extended_read.h" #ifdef __cplusplus diff --git a/level_3/fss_extended_read/c/private-fss_extended_read.h b/level_3/fss_extended_read/c/private-fss_extended_read.h index 71e787d..bcf4be7 100644 --- a/level_3/fss_extended_read/c/private-fss_extended_read.h +++ b/level_3/fss_extended_read/c/private-fss_extended_read.h @@ -13,103 +13,6 @@ extern "C" { #endif /** - * A structure of parameters applied at some depth. - * - * depth: the depth number in which this is to be processed at. - * - * index_at: position of the "--at" parameter value in the argv list, when 0 there is no parameter. - * index_name: position of the "--name" parameter value in the argv list, when 0 there is no parameter. - * - * value_at: the value of the "--at" parameter, already processed and ready to use, only when index_at > 0. - * value_name: the value of the "--name" parameter, already processed and ready to use, only when index_name > 0. - */ -#ifndef _di_fss_extended_read_depth_t_ - typedef struct { - f_array_length_t depth; - - f_array_length_t index_at; - f_array_length_t index_name; - - f_number_unsigned_t value_at; - f_string_dynamic_t value_name; - } fss_extended_read_depth_t; - - #define fss_extended_read_depth_t_initialize \ - { \ - 0, \ - 0, \ - 0, \ - 0, \ - f_string_dynamic_t_initialize, \ - } - - #define macro_fss_extended_read_depth_t_clear(structure) \ - structure.depth = 0; \ - structure.index_at = 0; \ - structure.index_name = 0; \ - structure.value_at = 0; \ - macro_f_string_dynamic_t_clear(structure.value_name) - - #define macro_fss_extended_read_depth_t_delete_simple(structure) macro_f_string_dynamic_t_delete_simple(structure.value_name) -#endif // _di_fss_extended_read_depth_t_ - -/** - * An array of depth parameters. - * - * array: the array of depths. - * size: total amount of allocated space. - * used: total number of allocated spaces used. - */ -#ifndef _di_fss_extended_read_depths_t_ - typedef struct { - fss_extended_read_depth_t *array; - - f_array_length_t size; - f_array_length_t used; - } fss_extended_read_depths_t; - - #define fss_extended_read_depths_t_initialize { 0, 0, 0 } - - #define macro_fss_extended_read_depths_t_clear(depths) macro_f_memory_structure_clear(depths) - - #define macro_fss_extended_read_depths_t_delete_simple(depths) \ - depths.used = depths.size; \ - while (depths.used > 0) { \ - depths.used--; \ - macro_fss_extended_read_depth_t_delete_simple(depths.array[depths.used]); \ - } \ - if (!depths.used) macro_f_memory_structure_delete_simple(depths, fss_extended_read_depth_t) - - #define macro_fss_extended_read_depths_t_resize(status, depths, new_length) \ - status = F_none; \ - if (new_length < depths.size) { \ - f_array_length_t i = depths.size - new_length; \ - for (; i < depths.size; i++) { \ - macro_fss_extended_read_depth_t_delete_simple(depths.array[i]); \ - } \ - } \ - if (status == F_none) status = f_memory_resize(depths.size, new_length, sizeof(fss_extended_read_depth_t), (void **) & depths.array); \ - if (status == F_none) { \ - depths.size = new_length; \ - if (depths.used > depths.size) depths.used = new_length; \ - } - - #define macro_fss_extended_read_depths_t_adjust(status, depths, new_length) \ - status = F_none; \ - if (new_length < depths.size) { \ - f_array_length_t i = depths.size - new_length; \ - for (; i < depths.size; i++) { \ - macro_fss_extended_read_depth_t_delete_simple(depths.array[i]); \ - } \ - } \ - if (status == F_none) status = f_memory_adjust(depths.size, new_length, sizeof(fss_extended_read_depth_t), (void **) & depths.array); \ - if (status == F_none) { \ - depths.size = new_length; \ - if (depths.used > depths.size) depths.used = new_length; \ - } -#endif // _di_fss_extended_read_depths_t_ - -/** * Determine if the given depth is to be delimited or not. * * @param main diff --git a/level_3/fss_extended_read/data/build/settings b/level_3/fss_extended_read/data/build/settings index 4f0e65f..3e13798 100644 --- a/level_3/fss_extended_read/data/build/settings +++ b/level_3/fss_extended_read/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library fss_extended_read.c private-fss_extended_read.c +build_sources_library fss_extended_read.c private-common.c private-fss_extended_read.c build_sources_program main.c build_sources_headers fss_extended_read.h build_sources_script diff --git a/level_3/fss_extended_write/c/fss_extended_write.c b/level_3/fss_extended_write/c/fss_extended_write.c index 6263be9..2f8029e 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -1,4 +1,5 @@ #include "fss_extended_write.h" +#include "private-common.h" #include "private-fss_extended_write.h" #ifdef __cplusplus diff --git a/level_3/fss_extended_write/c/private-common.c b/level_3/fss_extended_write/c/private-common.c new file mode 100644 index 0000000..635db9c --- /dev/null +++ b/level_3/fss_extended_write/c/private-common.c @@ -0,0 +1,10 @@ +#include "fss_extended_write.h" +#include "private-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fss_extended_write/c/private-common.h b/level_3/fss_extended_write/c/private-common.h new file mode 100644 index 0000000..3416f30 --- /dev/null +++ b/level_3/fss_extended_write/c/private-common.h @@ -0,0 +1,19 @@ +/** + * FLL - Level 3 + * + * Project: FSS Extended Write + * API Version: 0.5 + * Licenses: lgplv2.1 + */ +#ifndef _PRIVATE_common_h +#define _PRIVATE_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_common_h diff --git a/level_3/fss_extended_write/c/private-fss_extended_write.c b/level_3/fss_extended_write/c/private-fss_extended_write.c index 9382e1c..bd98de2 100644 --- a/level_3/fss_extended_write/c/private-fss_extended_write.c +++ b/level_3/fss_extended_write/c/private-fss_extended_write.c @@ -1,4 +1,5 @@ #include "fss_extended_write.h" +#include "private-common.h" #include "private-fss_extended_write.h" #ifdef __cplusplus diff --git a/level_3/fss_extended_write/data/build/settings b/level_3/fss_extended_write/data/build/settings index 3e04701..9ddbc34 100644 --- a/level_3/fss_extended_write/data/build/settings +++ b/level_3/fss_extended_write/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library fss_extended_write.c private-fss_extended_write.c +build_sources_library fss_extended_write.c private-common.c private-fss_extended_write.c build_sources_program main.c build_sources_headers fss_extended_write.h build_sources_script diff --git a/level_3/fss_status_code/c/fss_status_code.c b/level_3/fss_status_code/c/fss_status_code.c index 17f35b1..aa6fa35 100644 --- a/level_3/fss_status_code/c/fss_status_code.c +++ b/level_3/fss_status_code/c/fss_status_code.c @@ -1,4 +1,5 @@ #include "fss_status_code.h" +#include "private-common.h" #include "private-fss_status_code.h" #ifdef __cplusplus diff --git a/level_3/fss_status_code/c/private-common.c b/level_3/fss_status_code/c/private-common.c new file mode 100644 index 0000000..24a88a7 --- /dev/null +++ b/level_3/fss_status_code/c/private-common.c @@ -0,0 +1,10 @@ +#include "fss_status_code.h" +#include "private-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fss_status_code/c/private-common.h b/level_3/fss_status_code/c/private-common.h new file mode 100644 index 0000000..9d44e9a --- /dev/null +++ b/level_3/fss_status_code/c/private-common.h @@ -0,0 +1,19 @@ +/** + * FLL - Level 3 + * + * Project: FSS Status Code + * API Version: 0.5 + * Licenses: lgplv2.1 + */ +#ifndef _PRIVATE_common_h +#define _PRIVATE_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_common_h diff --git a/level_3/fss_status_code/c/private-fss_status_code.c b/level_3/fss_status_code/c/private-fss_status_code.c index 3179684..4b1f433 100644 --- a/level_3/fss_status_code/c/private-fss_status_code.c +++ b/level_3/fss_status_code/c/private-fss_status_code.c @@ -1,4 +1,5 @@ #include "fss_status_code.h" +#include "private-common.h" #include "private-fss_status_code.h" #ifdef __cplusplus diff --git a/level_3/fss_status_code/data/build/settings b/level_3/fss_status_code/data/build/settings index 4b8748e..0e5dc2c 100644 --- a/level_3/fss_status_code/data/build/settings +++ b/level_3/fss_status_code/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfll_status -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library fss_status_code.c private-fss_status_code.c +build_sources_library fss_status_code.c private-common.c private-fss_status_code.c build_sources_program main.c build_sources_headers fss_status_code.h build_sources_script diff --git a/level_3/iki_read/c/iki_read.c b/level_3/iki_read/c/iki_read.c index 077874c..b7fc172 100644 --- a/level_3/iki_read/c/iki_read.c +++ b/level_3/iki_read/c/iki_read.c @@ -1,4 +1,5 @@ #include "iki_read.h" +#include "private-common.h" #include "private-iki_read.h" #ifdef __cplusplus diff --git a/level_3/iki_read/c/private-common.c b/level_3/iki_read/c/private-common.c new file mode 100644 index 0000000..ea6bcd8 --- /dev/null +++ b/level_3/iki_read/c/private-common.c @@ -0,0 +1,10 @@ +#include "iki_read.h" +#include "private-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/iki_read/c/private-common.h b/level_3/iki_read/c/private-common.h new file mode 100644 index 0000000..0b00619 --- /dev/null +++ b/level_3/iki_read/c/private-common.h @@ -0,0 +1,19 @@ +/** + * FLL - Level 3 + * + * Project: IKI Read + * API Version: 0.5 + * Licenses: lgplv2.1 + */ +#ifndef _PRIVATE_common_h +#define _PRIVATE_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_common_h diff --git a/level_3/iki_read/c/private-iki_read.c b/level_3/iki_read/c/private-iki_read.c index 80ea438..b8a9147 100644 --- a/level_3/iki_read/c/private-iki_read.c +++ b/level_3/iki_read/c/private-iki_read.c @@ -1,4 +1,5 @@ #include "iki_read.h" +#include "private-common.h" #include "private-iki_read.h" #ifdef __cplusplus diff --git a/level_3/iki_read/data/build/settings b/level_3/iki_read/data/build/settings index ff22151..e80ded2 100644 --- a/level_3/iki_read/data/build/settings +++ b/level_3/iki_read/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-individual -lfll_error -lfll_program -lfl_console -lfl_conversion -lfl_iki -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_iki -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library iki_read.c private-iki_read.c +build_sources_library iki_read.c private-common.c private-iki_read.c build_sources_program main.c build_sources_headers iki_read.h build_sources_script diff --git a/level_3/iki_write/c/iki_write.c b/level_3/iki_write/c/iki_write.c index db5e836..6017a12 100644 --- a/level_3/iki_write/c/iki_write.c +++ b/level_3/iki_write/c/iki_write.c @@ -1,4 +1,5 @@ #include "iki_write.h" +#include "private-common.h" #include "private-iki_write.h" #ifdef __cplusplus diff --git a/level_3/iki_write/c/private-common.c b/level_3/iki_write/c/private-common.c new file mode 100644 index 0000000..f860d81 --- /dev/null +++ b/level_3/iki_write/c/private-common.c @@ -0,0 +1,10 @@ +#include "iki_write.h" +#include "private-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/iki_write/c/private-common.h b/level_3/iki_write/c/private-common.h new file mode 100644 index 0000000..114ebf9 --- /dev/null +++ b/level_3/iki_write/c/private-common.h @@ -0,0 +1,19 @@ +/** + * FLL - Level 3 + * + * Project: IKI Write + * API Version: 0.5 + * Licenses: lgplv2.1 + */ +#ifndef _PRIVATE_common_h +#define _PRIVATE_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_common_h diff --git a/level_3/iki_write/c/private-iki_write.c b/level_3/iki_write/c/private-iki_write.c index 510449b..a0142c6 100644 --- a/level_3/iki_write/c/private-iki_write.c +++ b/level_3/iki_write/c/private-iki_write.c @@ -1,4 +1,5 @@ #include "iki_write.h" +#include "private-common.h" #include "private-iki_write.h" #ifdef __cplusplus diff --git a/level_3/iki_write/data/build/settings b/level_3/iki_write/data/build/settings index 62b66fa..5e72495 100644 --- a/level_3/iki_write/data/build/settings +++ b/level_3/iki_write/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-individual -lfll_error -lfll_iki -lfll_program -lfl_console -lfl_iki -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_iki -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library iki_write.c private-iki_write.c +build_sources_library iki_write.c private-common.c private-iki_write.c build_sources_program main.c build_sources_headers iki_write.h build_sources_script diff --git a/level_3/status_code/c/private-common.c b/level_3/status_code/c/private-common.c new file mode 100644 index 0000000..7540b79 --- /dev/null +++ b/level_3/status_code/c/private-common.c @@ -0,0 +1,10 @@ +#include "status_code.h" +#include "private-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/status_code/c/private-common.h b/level_3/status_code/c/private-common.h new file mode 100644 index 0000000..1b7c102 --- /dev/null +++ b/level_3/status_code/c/private-common.h @@ -0,0 +1,19 @@ +/** + * FLL - Level 3 + * + * Project: Status Code + * API Version: 0.5 + * Licenses: lgplv2.1 + */ +#ifndef _PRIVATE_common_h +#define _PRIVATE_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_common_h diff --git a/level_3/status_code/c/private-status_code.c b/level_3/status_code/c/private-status_code.c index b0e6bdd..5ebe036 100644 --- a/level_3/status_code/c/private-status_code.c +++ b/level_3/status_code/c/private-status_code.c @@ -1,4 +1,5 @@ #include "status_code.h" +#include "private-common.h" #include "private-status_code.h" #ifdef __cplusplus diff --git a/level_3/status_code/c/status_code.c b/level_3/status_code/c/status_code.c index 81e0f44..5cd7440 100644 --- a/level_3/status_code/c/status_code.c +++ b/level_3/status_code/c/status_code.c @@ -1,4 +1,5 @@ #include "status_code.h" +#include "private-common.h" #include "private-status_code.h" #ifdef __cplusplus diff --git a/level_3/status_code/data/build/settings b/level_3/status_code/data/build/settings index 4249e00..110a5f5 100644 --- a/level_3/status_code/data/build/settings +++ b/level_3/status_code/data/build/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-individual -lfll_error -lfll_program -lfll_status -lfl_console -lfl_conversion -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library status_code.c private-status_code.c +build_sources_library status_code.c private-common.c private-status_code.c build_sources_program main.c build_sources_headers status_code.h build_sources_script