From: Kevin Day Date: Sun, 26 Mar 2023 00:40:51 +0000 (-0500) Subject: Update: Add fl_directory_do(), add new status codes, update fl_directory_copy(),... X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=abaed1570edab133e91d5731d6afb324d4fc12a8;p=fll Update: Add fl_directory_do(), add new status codes, update fl_directory_copy(), and other changes. An alternative to the ftw() is desired. The function, fl_directory_do() is provided to perform generic recursive tasks. This is based off of the fl_directory_copy() function. This is not yet tested and there may be changes in the future once this is tested. I noticed some things that could be improved in fl_directory_copy(). The recursion structure is actually specific to fl_directory_copy(), so rename it with "copy" in the name. Add additional status codes that might be useful: - F_bottom - F_bottom_not - F_character - F_character_not - F_fifo - F_fifo_not - F_middle - F_middle_not - F_regular - F_regular_not - F_top - F_top_not Provide a standard macro initializer and use it to make project maintenance easier. This reduces lines of code in the programs. Update the program flags: - Use "in" and "out" instead of "to" and "from". - Separate the "file" from the now "in" and "out". Update the build settings files, making sure the locale and language environment variables are exposed by default. Relocate the utf-8 code that previously didn't properly get properly relocated. --- diff --git a/build/stand_alone/fake.config.h b/build/stand_alone/fake.config.h index f61d2c2..48e2c1b 100644 --- a/build/stand_alone/fake.config.h +++ b/build/stand_alone/fake.config.h @@ -295,10 +295,14 @@ #define _di_f_directory_mode_ //#define _di_f_directory_open_ #define _di_f_directory_open_at_ -//#define _di_f_directory_recurse_delete_ -#define _di_f_directory_recurse_destroy_ -//#define _di_f_directory_recurse_flag_e_ -//#define _di_f_directory_recurse_t_ +//#define _di_f_directory_recurse_copy_delete_ +#define _di_f_directory_recurse_copy_destroy_ +//#define _di_f_directory_recurse_copy_flag_e_ +//#define _di_f_directory_recurse_copy_t_ +#define _di_f_directory_recurse_do_delete_ +#define _di_f_directory_recurse_do_destroy_ +#define _di_f_directory_recurse_do_flag_e_ +#define _di_f_directory_recurse_do_t_ //#define _di_f_directory_remove_ //#define _di_f_directory_remove_custom_ #define _di_f_directory_s_ @@ -806,6 +810,7 @@ //#define _di_fl_directory_copy_ //#define _di_fl_directory_create_ +#define _di_fl_directory_do_ //#define _di_fl_directory_list_ #define _di_fl_directory_path_pop_ #define _di_fl_directory_path_push_ diff --git a/level_0/f_directory/c/directory/common.h b/level_0/f_directory/c/directory/common.h index 45f91d5..d691cea 100644 --- a/level_0/f_directory/c/directory/common.h +++ b/level_0/f_directory/c/directory/common.h @@ -103,9 +103,9 @@ extern "C" { #endif // _di_f_directory_max_d_ /** - * Directory recurse flags. + * Directory recurse copy flags. * - * f_directory_recurse_flag_*: + * f_directory_recurse_copy_flag_*_e: * - none: No flags are set. * - clone: Operate as clone instead of as copy, if applicable. * - dereference: Dereference symbolic links rather than operating on the link itself. @@ -114,17 +114,60 @@ extern "C" { * - owner: File flag representing copying the owner. * - top: Operate on top directory and not just inside the directory. */ -#ifndef _di_f_directory_recurse_flag_e_ +#ifndef _di_f_directory_recurse_copy_flag_e_ enum { - f_directory_recurse_flag_none_e = 0, - f_directory_recurse_flag_clone_e = 0x1, - f_directory_recurse_flag_dereference_e = 0x2, - f_directory_recurse_flag_exclusive_e = 0x4, - f_directory_recurse_flag_group_e = 0x8, - f_directory_recurse_flag_owner_e = 0x10, - f_directory_recurse_flag_top_e = 0x20, + f_directory_recurse_copy_flag_none_e = 0, + f_directory_recurse_copy_flag_clone_e = 0x1, + f_directory_recurse_copy_flag_dereference_e = 0x2, + f_directory_recurse_copy_flag_exclusive_e = 0x4, + f_directory_recurse_copy_flag_group_e = 0x8, + f_directory_recurse_copy_flag_owner_e = 0x10, + f_directory_recurse_copy_flag_top_e = 0x20, }; // enum -#endif // _di_f_directory_recurse_flag_e_ +#endif // _di_f_directory_recurse_copy_flag_e_ + +/** + * Directory recurse do flags. + * + * f_directory_recurse_do_flag_*_e: + * For the recurse flag property. + * - none: No flags are set. + * - dereference: Dereference symbolic links rather than operating on the link itself. + * - first: Operate on directory first (before recursion). + * - last: Operate on directory last (after recursion). + * - top: Operate on top-most directory, or for the callback parameter, designate that this is the top path. + * + * For the action callback parameter. + * - block: File is a block. + * - character: File is a character. + * - directory: File is a directory. + * - fifo: File is a file-in/file-out. + * - link: File is a link. + * - regular: File is a regular file. + * - socket: File is a socket. + * - unknown: File is an unknown type. + */ +#ifndef _di_f_directory_recurse_do_flag_e_ + enum { + + // For the recurse flag property. + f_directory_recurse_do_flag_none_e = 0, + f_directory_recurse_do_flag_dereference_e = 0x1, + f_directory_recurse_do_flag_first_e = 0x2, + f_directory_recurse_do_flag_last_e = 0x4, + f_directory_recurse_do_flag_top_e = 0x8, + + // For the action callback parameter. + f_directory_recurse_do_flag_block_e = 0x10, + f_directory_recurse_do_flag_character_e = 0x20, + f_directory_recurse_do_flag_directory_e = 0x40, + f_directory_recurse_do_flag_fifo_e = 0x80, + f_directory_recurse_do_flag_link_e = 0x100, + f_directory_recurse_do_flag_regular_e = 0x200, + f_directory_recurse_do_flag_socket_e = 0x400, + f_directory_recurse_do_flag_unknown_e = 0x800, + }; // enum +#endif // _di_f_directory_recurse_do_flag_e_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_directory/c/directory/type.c b/level_0/f_directory/c/directory/type.c index 3dd22b9..85e6f71 100644 --- a/level_0/f_directory/c/directory/type.c +++ b/level_0/f_directory/c/directory/type.c @@ -43,8 +43,8 @@ extern "C" { } #endif // _di_f_directory_listing_destroy_ -#ifndef _di_f_directory_recurse_delete_ - f_status_t f_directory_recurse_delete(f_directory_recurse_t * const recurse) { +#ifndef _di_f_directory_recurse_copy_delete_ + f_status_t f_directory_recurse_copy_delete(f_directory_recurse_copy_t * const recurse) { #ifndef _di_level_0_parameter_checking_ if (!recurse) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -53,10 +53,10 @@ extern "C" { return F_none; } -#endif // _di_f_directory_recurse_delete_ +#endif // _di_f_directory_recurse_copy_delete_ -#ifndef _di_f_directory_recurse_destroy_ - f_status_t f_directory_recurse_destroy(f_directory_recurse_t * const recurse) { +#ifndef _di_f_directory_recurse_copy_destroy_ + f_status_t f_directory_recurse_copy_destroy(f_directory_recurse_copy_t * const recurse) { #ifndef _di_level_0_parameter_checking_ if (!recurse) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -65,7 +65,31 @@ extern "C" { return F_none; } -#endif // _di_f_directory_recurse_destroy_ +#endif // _di_f_directory_recurse_copy_destroy_ + +#ifndef _di_f_directory_recurse_do_delete_ + f_status_t f_directory_recurse_do_delete(f_directory_recurse_do_t * const recurse) { + #ifndef _di_level_0_parameter_checking_ + if (!recurse) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + f_directory_listing_delete(&recurse->listing); + + return F_none; + } +#endif // _di_f_directory_recurse_do_delete_ + +#ifndef _di_f_directory_recurse_do_destroy_ + f_status_t f_directory_recurse_do_destroy(f_directory_recurse_do_t * const recurse) { + #ifndef _di_level_0_parameter_checking_ + if (!recurse) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + f_directory_listing_destroy(&recurse->listing); + + return F_none; + } +#endif // _di_f_directory_recurse_do_destroy_ #ifndef _di_f_directory_statuss_adjust_ f_status_t f_directory_statuss_adjust(const f_array_length_t length, f_directory_statuss_t * const statuss) { diff --git a/level_0/f_directory/c/directory/type.h b/level_0/f_directory/c/directory/type.h index a69ae6b..ffe1d4b 100644 --- a/level_0/f_directory/c/directory/type.h +++ b/level_0/f_directory/c/directory/type.h @@ -112,7 +112,7 @@ extern "C" { #endif // _di_f_directory_statuss_t_ /** - * A structure containing directory recursion information. + * A structure containing directory recursion information for copy or clone operations. * * The flag is processed as follows (using f_file_stat_flags_*_e): * - f_file_stat_flag_exclusive_e: @@ -132,7 +132,7 @@ extern "C" { * * (For a clone operation, the file mode is always copied.) * - * The failure() and verbose() callbacks provide full access to this f_directory_recurse_t structure. + * The verbose() callbacks provide full access to this f_directory_recurse_copy_t structure. * These callbacks must take care to properly modify the structure or they could cause security, integrity, or functionality problems. * * flag: A set of flags used exclusively by the directory recurse process (not to be confused with state.flag). @@ -148,10 +148,10 @@ extern "C" { * destination_top: A pointer to the top destination string, used for error handling and printing (generally assigned internally). * verbose: A callback used for printing verbose messages (Set to NULL to not use). * - * The macro_f_directory_recurse_t_initialize_1() all arguments. - * The macro_f_directory_recurse_t_initialize_2() all arguments except for internally managed source, destination, mode, and depth. + * The macro_f_directory_recurse_copy_t_initialize_1() all arguments. + * The macro_f_directory_recurse_copy_t_initialize_2() all arguments except for internally managed source, destination, mode, and depth. */ -#ifndef _di_f_directory_recurse_t_ +#ifndef _di_f_directory_recurse_copy_t_ typedef struct { f_number_unsigned_t max_depth; f_number_unsigned_t size_block; @@ -168,9 +168,9 @@ extern "C" { const f_string_static_t *destination_top; void (*verbose)(const f_string_static_t source, const f_string_static_t destination, void * const recurse); - } f_directory_recurse_t; + } f_directory_recurse_copy_t; - #define f_directory_recurse_t_initialize { \ + #define f_directory_recurse_copy_t_initialize { \ F_directory_max_recurse_depth_d, \ F_file_default_read_size_d, \ F_file_flag_write_only_d, \ @@ -185,7 +185,7 @@ extern "C" { 0, \ } - #define macro_f_directory_recurse_t_initialize_1(max_depth, size_block, flag, depth, mode, state, listing, source, source_top, destination, destination_top, verbose) { \ + #define macro_f_directory_recurse_copy_t_initialize_1(max_depth, size_block, flag, depth, mode, state, listing, source, source_top, destination, destination_top, verbose) { \ max_depth, \ size_block, \ flag, \ @@ -200,7 +200,7 @@ extern "C" { verbose, \ } - #define macro_f_directory_recurse_t_initialize_2(max_depth, size_block, flag, depth, mode, state, verbose) { \ + #define macro_f_directory_recurse_copy_t_initialize_2(max_depth, size_block, flag, depth, mode, state, verbose) { \ max_depth, \ size_block, \ flag, \ @@ -214,7 +214,79 @@ extern "C" { 0, \ verbose, \ } -#endif // _di_f_directory_recurse_t_ +#endif // _di_f_directory_recurse_copy_t_ + +/** + * A structure containing directory recursion information. + * + * The action() callbacks provide full access to this f_directory_recurse_do_t structure. + * The callback must take care to properly modify the structure or they could cause security, integrity, or functionality problems. + * The action callback may set any of the following on the state.status to have the following effects: + * - Any status (with error bit set): Immediately return as error. + * - F_break: Break out of the current loop. + * - F_continue: Skip to the next iteration in the current loop. + * - F_done: immedately return as success but do nothing else in this recursion. + * + * max_depth: The maximum recursion depth to use. + * depth: A number representing the depth recursed thus far (generally assigned internally). + * flag: A set of flags used exclusively by the directory recurse process (not to be confused with state.flag). + * state: A pointer to the state information. + * listing: A directory listing structure used internally to help reduce repeated memory allocation overhead. + * path: A pointer to the current path string, used for error handling and printing (generally assigned internally). + * path_top: A pointer to the top path string, used for error handling and printing (generally assigned internally). + * action: A callback used for performing some action (this is required to do anything). + * + * The macro_f_directory_recurse_do_t_initialize_1() all arguments. + * The macro_f_directory_recurse_do_t_initialize_2() all arguments except for internally managed source, destination, mode, and depth. + */ +#ifndef _di_f_directory_recurse_do_t_ + typedef struct { + f_number_unsigned_t max_depth; + f_array_length_t depth; + uint8_t flag; + + f_state_t state; + f_directory_listing_t listing; + + const f_string_static_t *path; + const f_string_static_t *path_top; + + void (*action)(void * const recurse, const uint16_t flag); + } f_directory_recurse_do_t; + + #define f_directory_recurse_do_t_initialize { \ + F_directory_max_recurse_depth_d, \ + 0, \ + f_directory_recurse_do_flag_none_e, \ + f_state_t_initialize, \ + f_directory_listing_t_initialize, \ + 0, \ + 0, \ + 0, \ + } + + #define macro_f_directory_recurse_do_t_initialize_1(max_depth, depth, flag, state, listing, path, path_top, action) { \ + max_depth, \ + depth, \ + flag, \ + state, \ + listing, \ + path, \ + path_top, \ + action, \ + } + + #define macro_f_directory_recurse_do_t_initialize_2(max_depth, depth, flag, state, action) { \ + max_depth, \ + depth,\ + flag, \ + state, \ + f_directory_listing_t_initialize, \ + 0, \ + 0, \ + action, \ + } +#endif // _di_f_directory_recurse_do_t_ /** * Delete all arrays within the listing. @@ -269,9 +341,47 @@ extern "C" { * * @see f_string_dynamics_resize() */ -#ifndef _di_f_directory_recurse_delete_ - extern f_status_t f_directory_recurse_delete(f_directory_recurse_t * const recurse); -#endif // _di_f_directory_recurse_delete_ +#ifndef _di_f_directory_recurse_copy_delete_ + extern f_status_t f_directory_recurse_copy_delete(f_directory_recurse_copy_t * const recurse); +#endif // _di_f_directory_recurse_copy_delete_ + +/** + * Destroy all non-pointer based dynamic arrays within the recurse. + * + * @param recurse + * The recurse to fully destroy. + * + * @return + * F_none on success. + * + * F_parameter (with error bit) if a parameter is invalid. + * + * Errors (with error bit) from: f_string_dynamics_adjust(). + * + * @see f_string_dynamics_adjust() + */ +#ifndef _di_f_directory_recurse_copy_destroy_ + extern f_status_t f_directory_recurse_copy_destroy(f_directory_recurse_copy_t * const recurse); +#endif // _di_f_directory_recurse_copy_destroy_ + +/** + * Delete all non-pointer based dynamic arrays within the recurse. + * + * @param recurse + * The recurse to fully delete. + * + * @return + * F_none on success. + * + * F_parameter (with error bit) if a parameter is invalid. + * + * Errors (with error bit) from: f_string_dynamics_resize(). + * + * @see f_string_dynamics_resize() + */ +#ifndef _di_f_directory_recurse_do_delete_ + extern f_status_t f_directory_recurse_do_delete(f_directory_recurse_do_t * const recurse); +#endif // _di_f_directory_recurse_do_delete_ /** * Destroy all non-pointer based dynamic arrays within the recurse. @@ -288,9 +398,9 @@ extern "C" { * * @see f_string_dynamics_adjust() */ -#ifndef _di_f_directory_recurse_destroy_ - extern f_status_t f_directory_recurse_destroy(f_directory_recurse_t * const recurse); -#endif // _di_f_directory_recurse_destroy_ +#ifndef _di_f_directory_recurse_do_destroy_ + extern f_status_t f_directory_recurse_do_destroy(f_directory_recurse_do_t * const recurse); +#endif // _di_f_directory_recurse_do_destroy_ /** * Resize all parts of the directory statuss structure using the same length. diff --git a/level_0/f_status/c/status.h b/level_0/f_status/c/status.h index 87a0c7b..6b285fa 100644 --- a/level_0/f_status/c/status.h +++ b/level_0/f_status/c/status.h @@ -223,6 +223,8 @@ extern "C" { F_block_not, F_body, F_body_not, + F_bottom, + F_bottom_not, F_bound, F_bound_not, F_break, @@ -231,6 +233,8 @@ extern "C" { F_call_not, F_capability, F_capability_not, + F_character, + F_character_not, F_child, F_child_not, F_complete, @@ -301,6 +305,8 @@ extern "C" { F_failure_not, F_family, F_family_not, + F_fifo, + F_fifo_not, F_first, F_first_not, F_footer, @@ -354,6 +360,8 @@ extern "C" { F_memory_not, F_message, F_message_not, + F_middle, + F_middle_not, F_minor, F_minor_not, F_moderate, @@ -417,6 +425,8 @@ extern "C" { F_recover_not, F_recurse, F_recurse_not, + F_regular, + F_regular_not, F_relative, F_relative_not, F_remote, @@ -476,6 +486,8 @@ extern "C" { F_time_out, F_too_large, F_too_small, + F_top, + F_top_not, F_type, F_type_not, F_user, diff --git a/level_0/f_status_string/c/status_string.c b/level_0/f_status_string/c/status_string.c index 626331b..5ecd72a 100644 --- a/level_0/f_status_string/c/status_string.c +++ b/level_0/f_status_string/c/status_string.c @@ -97,6 +97,8 @@ extern "C" { const f_string_static_t f_status_block_not_s = macro_f_string_static_t_initialize(F_status_block_not_s, 0, F_status_block_not_s_length); const f_string_static_t f_status_body_s = macro_f_string_static_t_initialize(F_status_body_s, 0, F_status_body_s_length); const f_string_static_t f_status_body_not_s = macro_f_string_static_t_initialize(F_status_body_not_s, 0, F_status_body_not_s_length); + const f_string_static_t f_status_bottom_s = macro_f_string_static_t_initialize(F_status_bottom_s, 0, F_status_bottom_s_length); + const f_string_static_t f_status_bottom_not_s = macro_f_string_static_t_initialize(F_status_bottom_not_s, 0, F_status_bottom_not_s_length); const f_string_static_t f_status_bound_s = macro_f_string_static_t_initialize(F_status_bound_s, 0, F_status_bound_s_length); const f_string_static_t f_status_bound_not_s = macro_f_string_static_t_initialize(F_status_bound_not_s, 0, F_status_bound_not_s_length); const f_string_static_t f_status_break_s = macro_f_string_static_t_initialize(F_status_break_s, 0, F_status_break_s_length); @@ -105,6 +107,8 @@ extern "C" { const f_string_static_t f_status_call_not_s = macro_f_string_static_t_initialize(F_status_call_not_s, 0, F_status_call_not_s_length); const f_string_static_t f_status_capability_s = macro_f_string_static_t_initialize(F_status_capability_s, 0, F_status_capability_s_length); const f_string_static_t f_status_capability_not_s = macro_f_string_static_t_initialize(F_status_capability_not_s, 0, F_status_capability_not_s_length); + const f_string_static_t f_status_character_s = macro_f_string_static_t_initialize(F_status_character_s, 0, F_status_character_s_length); + const f_string_static_t f_status_character_not_s = macro_f_string_static_t_initialize(F_status_character_not_s, 0, F_status_character_not_s_length); const f_string_static_t f_status_child_s = macro_f_string_static_t_initialize(F_status_child_s, 0, F_status_child_s_length); const f_string_static_t f_status_child_not_s = macro_f_string_static_t_initialize(F_status_child_not_s, 0, F_status_child_not_s_length); const f_string_static_t f_status_complete_s = macro_f_string_static_t_initialize(F_status_complete_s, 0, F_status_complete_s_length); @@ -175,6 +179,8 @@ extern "C" { const f_string_static_t f_status_failure_not_s = macro_f_string_static_t_initialize(F_status_failure_not_s, 0, F_status_failure_not_s_length); const f_string_static_t f_status_family_s = macro_f_string_static_t_initialize(F_status_family_s, 0, F_status_family_s_length); const f_string_static_t f_status_family_not_s = macro_f_string_static_t_initialize(F_status_family_not_s, 0, F_status_family_not_s_length); + const f_string_static_t f_status_fifo_s = macro_f_string_static_t_initialize(F_status_fifo_s, 0, F_status_fifo_s_length); + const f_string_static_t f_status_fifo_not_s = macro_f_string_static_t_initialize(F_status_fifo_not_s, 0, F_status_fifo_not_s_length); const f_string_static_t f_status_first_s = macro_f_string_static_t_initialize(F_status_first_s, 0, F_status_first_s_length); const f_string_static_t f_status_first_not_s = macro_f_string_static_t_initialize(F_status_first_not_s, 0, F_status_first_not_s_length); const f_string_static_t f_status_footer_s = macro_f_string_static_t_initialize(F_status_footer_s, 0, F_status_footer_s_length); @@ -228,6 +234,8 @@ extern "C" { const f_string_static_t f_status_memory_not_s = macro_f_string_static_t_initialize(F_status_memory_not_s, 0, F_status_memory_not_s_length); const f_string_static_t f_status_message_s = macro_f_string_static_t_initialize(F_status_message_s, 0, F_status_message_s_length); const f_string_static_t f_status_message_not_s = macro_f_string_static_t_initialize(F_status_message_not_s, 0, F_status_message_not_s_length); + const f_string_static_t f_status_middle_s = macro_f_string_static_t_initialize(F_status_middle_s, 0, F_status_middle_s_length); + const f_string_static_t f_status_middle_not_s = macro_f_string_static_t_initialize(F_status_middle_not_s, 0, F_status_middle_not_s_length); const f_string_static_t f_status_minor_s = macro_f_string_static_t_initialize(F_status_minor_s, 0, F_status_minor_s_length); const f_string_static_t f_status_minor_not_s = macro_f_string_static_t_initialize(F_status_minor_not_s, 0, F_status_minor_not_s_length); const f_string_static_t f_status_moderate_s = macro_f_string_static_t_initialize(F_status_moderate_s, 0, F_status_moderate_s_length); @@ -291,6 +299,8 @@ extern "C" { const f_string_static_t f_status_recover_not_s = macro_f_string_static_t_initialize(F_status_recover_not_s, 0, F_status_recover_not_s_length); const f_string_static_t f_status_recurse_s = macro_f_string_static_t_initialize(F_status_recurse_s, 0, F_status_recurse_s_length); const f_string_static_t f_status_recurse_not_s = macro_f_string_static_t_initialize(F_status_recurse_not_s, 0, F_status_recurse_not_s_length); + const f_string_static_t f_status_regular_s = macro_f_string_static_t_initialize(F_status_regular_s, 0, F_status_regular_s_length); + const f_string_static_t f_status_regular_not_s = macro_f_string_static_t_initialize(F_status_regular_not_s, 0, F_status_regular_not_s_length); const f_string_static_t f_status_relative_s = macro_f_string_static_t_initialize(F_status_relative_s, 0, F_status_relative_s_length); const f_string_static_t f_status_relative_not_s = macro_f_string_static_t_initialize(F_status_relative_not_s, 0, F_status_relative_not_s_length); const f_string_static_t f_status_remote_s = macro_f_string_static_t_initialize(F_status_remote_s, 0, F_status_remote_s_length); @@ -346,6 +356,8 @@ extern "C" { const f_string_static_t f_status_time_out_s = macro_f_string_static_t_initialize(F_status_time_out_s, 0, F_status_time_out_s_length); const f_string_static_t f_status_too_large_s = macro_f_string_static_t_initialize(F_status_too_large_s, 0, F_status_too_large_s_length); const f_string_static_t f_status_too_small_s = macro_f_string_static_t_initialize(F_status_too_small_s, 0, F_status_too_small_s_length); + const f_string_static_t f_status_top_s = macro_f_string_static_t_initialize(F_status_top_s, 0, F_status_top_s_length); + const f_string_static_t f_status_top_not_s = macro_f_string_static_t_initialize(F_status_top_not_s, 0, F_status_top_not_s_length); const f_string_static_t f_status_type_s = macro_f_string_static_t_initialize(F_status_type_s, 0, F_status_type_s_length); const f_string_static_t f_status_type_not_s = macro_f_string_static_t_initialize(F_status_type_not_s, 0, F_status_type_not_s_length); const f_string_static_t f_status_success_s = macro_f_string_static_t_initialize(F_status_success_s, 0, F_status_success_s_length); @@ -1108,6 +1120,16 @@ extern "C" { break; + case F_bottom: + *name = f_status_bottom_s; + + break; + + case F_bottom_not: + *name = f_status_bottom_not_s; + + break; + case F_bound: *name = f_status_bound_s; @@ -1138,6 +1160,16 @@ extern "C" { break; + case F_character: + *name = f_status_character_s; + + break; + + case F_character_not: + *name = f_status_character_not_s; + + break; + case F_child: *name = f_status_child_s; @@ -1488,6 +1520,16 @@ extern "C" { break; + case F_fifo: + *name = f_status_fifo_s; + + break; + + case F_fifo_not: + *name = f_status_fifo_not_s; + + break; + case F_first: *name = f_status_first_s; @@ -1733,6 +1775,16 @@ extern "C" { break; + case F_middle: + *name = f_status_middle_s; + + break; + + case F_middle_not: + *name = f_status_middle_not_s; + + break; + case F_minor: *name = f_status_minor_s; @@ -2048,6 +2100,16 @@ extern "C" { break; + case F_regular: + *name = f_status_regular_s; + + break; + + case F_regular_not: + *name = f_status_regular_not_s; + + break; + case F_relative: *name = f_status_relative_s; @@ -2323,6 +2385,16 @@ extern "C" { break; + case F_top: + *name = f_status_top_s; + + break; + + case F_top_not: + *name = f_status_top_not_s; + + break; + case F_type: *name = f_status_type_s; diff --git a/level_0/f_status_string/c/status_string.h b/level_0/f_status_string/c/status_string.h index c703faa..683f09c 100644 --- a/level_0/f_status_string/c/status_string.h +++ b/level_0/f_status_string/c/status_string.h @@ -250,6 +250,8 @@ extern "C" { #define F_status_block_not_s "F_block_not" #define F_status_body_s "F_body" #define F_status_body_not_s "F_body_not" + #define F_status_bottom_s "F_bottom" + #define F_status_bottom_not_s "F_bottom_not" #define F_status_bound_s "F_bound" #define F_status_bound_not_s "F_bound_not" #define F_status_break_s "F_break" @@ -258,6 +260,8 @@ extern "C" { #define F_status_call_not_s "F_call_not" #define F_status_capability_s "F_capability" #define F_status_capability_not_s "F_capability_not" + #define F_status_character_s "F_character" + #define F_status_character_not_s "F_character_not" #define F_status_child_s "F_child" #define F_status_child_not_s "F_child_not" #define F_status_complete_s "F_complete" @@ -328,6 +332,8 @@ extern "C" { #define F_status_failure_not_s "F_failure_not" #define F_status_family_s "F_family" #define F_status_family_not_s "F_family_not" + #define F_status_fifo_s "F_fifo" + #define F_status_fifo_not_s "F_fifo_not" #define F_status_first_s "F_first" #define F_status_first_not_s "F_first_not" #define F_status_footer_s "F_footer" @@ -381,6 +387,8 @@ extern "C" { #define F_status_memory_not_s "F_memory_not" #define F_status_message_s "F_message" #define F_status_message_not_s "F_message_not" + #define F_status_middle_s "F_middle" + #define F_status_middle_not_s "F_middle_not" #define F_status_minor_s "F_minor" #define F_status_minor_not_s "F_minor_not" #define F_status_moderate_s "F_moderate" @@ -444,6 +452,8 @@ extern "C" { #define F_status_recover_not_s "F_recover_not" #define F_status_recurse_s "F_recurse" #define F_status_recurse_not_s "F_recurse_not" + #define F_status_regular_s "F_regular" + #define F_status_regular_not_s "F_regular_not" #define F_status_relative_s "F_relative" #define F_status_relative_not_s "F_relative_not" #define F_status_remote_s "F_remote" @@ -499,12 +509,14 @@ extern "C" { #define F_status_time_out_s "F_time_out" #define F_status_too_large_s "F_too_large" #define F_status_too_small_s "F_too_small" + #define F_status_top_s "F_top" + #define F_status_top_not_s "F_top_not" #define F_status_type_s "F_type" #define F_status_type_not_s "F_type_not" #define F_status_success_s "F_success" #define F_status_success_not_s "F_success_not" - #define F_status_support_s "F_support" - #define F_status_support_not_s "F_support_not" + #define F_status_support_s "F_support" + #define F_status_support_not_s "F_support_not" #define F_status_user_s "F_user" #define F_status_user_not_s "F_user_not" #define F_status_utf_s "F_utf" @@ -550,12 +562,16 @@ extern "C" { #define F_status_block_not_s_length 11 #define F_status_body_s_length 6 #define F_status_body_not_s_length 10 + #define F_status_bottom_s_length 8 + #define F_status_bottom_not_s_length 12 #define F_status_bound_s_length 7 #define F_status_bound_not_s_length 11 #define F_status_call_s_length 6 #define F_status_call_not_s_length 10 #define F_status_capability_s_length 12 #define F_status_capability_not_s_length 16 + #define F_status_character_s_length 11 + #define F_status_character_not_s_length 15 #define F_status_child_s_length 7 #define F_status_child_not_s_length 11 #define F_status_complete_s_length 10 @@ -626,6 +642,8 @@ extern "C" { #define F_status_failure_not_s_length 13 #define F_status_family_s_length 8 #define F_status_family_not_s_length 12 + #define F_status_fifo_s_length 6 + #define F_status_fifo_not_s_length 10 #define F_status_first_s_length 7 #define F_status_first_not_s_length 11 #define F_status_footer_s_length 8 @@ -679,6 +697,8 @@ extern "C" { #define F_status_memory_not_s_length 12 #define F_status_message_s_length 9 #define F_status_message_not_s_length 13 + #define F_status_middle_s_length 8 + #define F_status_middle_not_s_length 12 #define F_status_minor_s_length 7 #define F_status_minor_not_s_length 11 #define F_status_moderate_s_length 10 @@ -742,6 +762,8 @@ extern "C" { #define F_status_recover_not_s_length 13 #define F_status_recurse_s_length 9 #define F_status_recurse_not_s_length 13 + #define F_status_regular_s_length 9 + #define F_status_regular_not_s_length 13 #define F_status_relative_s_length 10 #define F_status_relative_not_s_length 14 #define F_status_remote_s_length 8 @@ -801,6 +823,8 @@ extern "C" { #define F_status_time_out_s_length 10 #define F_status_too_large_s_length 11 #define F_status_too_small_s_length 11 + #define F_status_top_s_length 5 + #define F_status_top_not_s_length 9 #define F_status_type_s_length 6 #define F_status_type_not_s_length 10 #define F_status_user_s_length 6 @@ -846,6 +870,8 @@ extern "C" { extern const f_string_static_t f_status_block_not_s; extern const f_string_static_t f_status_body_s; extern const f_string_static_t f_status_body_not_s; + extern const f_string_static_t f_status_bottom_s; + extern const f_string_static_t f_status_bottom_not_s; extern const f_string_static_t f_status_bound_s; extern const f_string_static_t f_status_bound_not_s; extern const f_string_static_t f_status_break_s; @@ -854,6 +880,8 @@ extern "C" { extern const f_string_static_t f_status_call_not_s; extern const f_string_static_t f_status_capability_s; extern const f_string_static_t f_status_capability_not_s; + extern const f_string_static_t f_status_character_s; + extern const f_string_static_t f_status_character_not_s; extern const f_string_static_t f_status_child_s; extern const f_string_static_t f_status_child_not_s; extern const f_string_static_t f_status_complete_s; @@ -926,6 +954,8 @@ extern "C" { extern const f_string_static_t f_status_failure_not_s; extern const f_string_static_t f_status_family_s; extern const f_string_static_t f_status_family_not_s; + extern const f_string_static_t f_status_fifo_s; + extern const f_string_static_t f_status_fifo_not_s; extern const f_string_static_t f_status_first_s; extern const f_string_static_t f_status_first_not_s; extern const f_string_static_t f_status_footer_s; @@ -979,6 +1009,8 @@ extern "C" { extern const f_string_static_t f_status_memory_not_s; extern const f_string_static_t f_status_message_s; extern const f_string_static_t f_status_message_not_s; + extern const f_string_static_t f_status_middle_s; + extern const f_string_static_t f_status_middle_not_s; extern const f_string_static_t f_status_minor_s; extern const f_string_static_t f_status_minor_not_s; extern const f_string_static_t f_status_moderate_s; @@ -1042,6 +1074,8 @@ extern "C" { extern const f_string_static_t f_status_recover_not_s; extern const f_string_static_t f_status_recurse_s; extern const f_string_static_t f_status_recurse_not_s; + extern const f_string_static_t f_status_regular_s; + extern const f_string_static_t f_status_regular_not_s; extern const f_string_static_t f_status_relative_s; extern const f_string_static_t f_status_relative_not_s; extern const f_string_static_t f_status_remote_s; @@ -1097,6 +1131,8 @@ extern "C" { extern const f_string_static_t f_status_time_out_s; extern const f_string_static_t f_status_too_large_s; extern const f_string_static_t f_status_too_small_s; + extern const f_string_static_t f_status_top_s; + extern const f_string_static_t f_status_top_not_s; extern const f_string_static_t f_status_type_s; extern const f_string_static_t f_status_type_not_s; extern const f_string_static_t f_status_success_s; diff --git a/level_1/fl_directory/c/directory.c b/level_1/fl_directory/c/directory.c index 743e897..bc668da 100644 --- a/level_1/fl_directory/c/directory.c +++ b/level_1/fl_directory/c/directory.c @@ -48,7 +48,7 @@ extern "C" { #endif // _di_fl_directory_create_ #ifndef _di_fl_directory_copy_ - void fl_directory_copy(const f_string_static_t source, const f_string_static_t destination, f_directory_recurse_t * const recurse) { + void fl_directory_copy(const f_string_static_t source, const f_string_static_t destination, f_directory_recurse_copy_t * const recurse) { #ifndef _di_level_1_parameter_checking_ if (!recurse) return; #endif // _di_level_1_parameter_checking_ @@ -58,7 +58,6 @@ extern "C" { recurse->destination = recurse->destination_top; recurse->destination_top = &destination; recurse->depth = 0; - recurse->mode = recurse->mode; recurse->state.status = F_none; recurse->state.data = (void *) recurse; @@ -86,13 +85,13 @@ extern "C" { return; } - if (recurse->flag & f_directory_recurse_flag_top_e) { - if (recurse->flag & f_directory_recurse_flag_clone_e) { + if (recurse->flag & f_directory_recurse_copy_flag_top_e) { + if (recurse->flag & f_directory_recurse_copy_flag_clone_e) { struct stat source_stat; memset(&source_stat, 0, sizeof(struct stat)); - recurse->state.status = f_file_stat(*recurse->source_top, recurse->flag & f_directory_recurse_flag_dereference_e, &source_stat); + recurse->state.status = f_file_stat(*recurse->source_top, recurse->flag & f_directory_recurse_copy_flag_dereference_e, &source_stat); if (F_status_is_error_not(recurse->state.status)) { recurse->state.status = f_directory_exists(*recurse->destination_top); @@ -100,7 +99,7 @@ extern "C" { if (F_status_is_error_not(recurse->state.status)) { if (recurse->state.status == F_true) { - if (recurse->flag & f_directory_recurse_flag_exclusive_e) { + if (recurse->flag & f_directory_recurse_copy_flag_exclusive_e) { recurse->state.status = F_status_set_error(F_directory_found); } else { @@ -112,13 +111,13 @@ extern "C" { } } - if (F_status_is_error_not(recurse->state.status) && (recurse->flag & (f_directory_recurse_flag_group_e | f_directory_recurse_flag_owner_e))) { - recurse->state.status = f_file_role_change(*recurse->destination_top, (recurse->flag & f_directory_recurse_flag_owner_e) ? source_stat.st_uid : -1, (recurse->flag & f_directory_recurse_flag_group_e) ? source_stat.st_gid : -1, recurse->flag & f_directory_recurse_flag_dereference_e); + if (F_status_is_error_not(recurse->state.status) && (recurse->flag & (f_directory_recurse_copy_flag_group_e | f_directory_recurse_copy_flag_owner_e))) { + recurse->state.status = f_file_role_change(*recurse->destination_top, (recurse->flag & f_directory_recurse_copy_flag_owner_e) ? source_stat.st_uid : -1, (recurse->flag & f_directory_recurse_copy_flag_group_e) ? source_stat.st_gid : -1, recurse->flag & f_directory_recurse_copy_flag_dereference_e); } } else { if (recurse->state.status == F_true) { - if (recurse->flag & f_directory_recurse_flag_exclusive_e) { + if (recurse->flag & f_directory_recurse_copy_flag_exclusive_e) { recurse->state.status = F_status_set_error(F_directory_found); } else { @@ -195,6 +194,96 @@ extern "C" { } #endif // _di_fl_directory_copy_ +#ifndef _di_fl_directory_do_ + void fl_directory_do(const f_string_static_t path, f_directory_recurse_do_t * const recurse) { + #ifndef _di_level_1_parameter_checking_ + if (!recurse) return; + + if (!recurse->action) { + recurse->state.status = F_status_set_error(F_parameter); + return; + } + #endif // _di_level_1_parameter_checking_ + + recurse->path = recurse->path_top; + recurse->path_top = &path; + recurse->depth = 0; + recurse->state.status = F_none; + recurse->state.data = (void *) recurse; + + if (!recurse->path_top->used) { + recurse->state.status = F_data_not; + + if (recurse->state.handle) { + recurse->state.handle(&recurse->state, (void *) recurse); + } + + return; + } + + recurse->state.status = f_directory_exists(*recurse->path_top); + + if (recurse->state.status == F_false) { + recurse->state.status = F_status_set_error(F_directory_not); + } + + if (F_status_is_error(recurse->state.status)) { + if (recurse->state.handle) { + recurse->state.handle(&recurse->state, (void *) recurse); + } + + return; + } + + if ((recurse->flag & f_directory_recurse_do_flag_top_e) && (recurse->flag & f_directory_recurse_do_flag_first_e)) { + recurse->action((void *) recurse, f_directory_recurse_do_flag_top_e | f_directory_recurse_do_flag_first_e); + } + + if (F_status_is_error_not(recurse->state.status)) { + if (recurse->max_depth) { + f_array_length_t i = recurse->path_top->used; + + // Do not allow null termination or trailing path separators in the string's length calculation. + for (; i > 0; --i) { + + if (!recurse->path_top->string[i - 1]) continue; + if (recurse->path_top->string[i - 1] == f_path_separator_s.string[0]) continue; + + break; + } // for + + const f_string_static_t static_path = macro_f_string_static_t_initialize(recurse->path_top->string, recurse->path_top->size, i); + + recurse->path = &static_path; + recurse->depth = 1; + + private_fl_directory_do_recurse(recurse); + + recurse->path = recurse->path_top; + recurse->depth = 0; + } + else { + recurse->state.status = F_none; + } + } + + if (F_status_is_error_not(recurse->state.status)) { + if ((recurse->flag & f_directory_recurse_do_flag_top_e) && (recurse->flag & f_directory_recurse_do_flag_last_e)) { + recurse->action((void *) recurse, f_directory_recurse_do_flag_top_e | f_directory_recurse_do_flag_last_e); + } + } + + if (F_status_is_error(recurse->state.status)) { + if (recurse->state.handle) { + recurse->state.handle(&recurse->state, (void *) &recurse); + } + } + else { + recurse->state.status = F_none; + } + } +#endif // _di_fl_directory_do_ + #ifndef _di_fl_directory_list_ f_status_t fl_directory_list(const f_string_static_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing_t * const listing) { #ifndef _di_level_1_parameter_checking_ diff --git a/level_1/fl_directory/c/directory.h b/level_1/fl_directory/c/directory.h index 6d79772..117d0f8 100644 --- a/level_1/fl_directory/c/directory.h +++ b/level_1/fl_directory/c/directory.h @@ -94,16 +94,16 @@ extern "C" { * The source and destination must be NULL terminated. * * Symbolic links are by default not followed, they are copied as the symbolic link itself. - * Set the f_directory_recurse_flag_dereference_e to follow the symbolic links rather than copying the link itself. + * Set the f_directory_recurse_copy_flag_dereference_e to follow the symbolic links rather than copying the link itself. * * This does not copy unknown file types. * - * If recurse.flag has f_directory_recurse_flag_top_e set, then this operates on the top directory otherwise only the content within the directory is operated on. + * If recurse.flag has f_directory_recurse_copy_flag_top_e set, then this operates on the top directory otherwise only the content within the directory is operated on. * - * If recurse.flag has f_directory_recurse_flag_clone_e set, then this operates a clone operation rather than a copy operation. + * If recurse.flag has f_directory_recurse_copy_flag_clone_e set, then this operates a clone operation rather than a copy operation. * - * When using f_directory_recurse_flag_clone_e, the recurse.mode is not used. - * When not using f_directory_recurse_flag_clone_e, the recurse.mode is used and should be set accordingly. + * When using f_directory_recurse_copy_flag_clone_e, the recurse.mode is not used. + * When not using f_directory_recurse_copy_flag_clone_e, the recurse.mode is used and should be set accordingly. * To not used recurse.mode, set the point to NULL. * * The recurse.state.handle() callback is used for processing and reporting errors. @@ -150,10 +150,49 @@ extern "C" { * @see f_file_stat() */ #ifndef _di_fl_directory_copy_ - extern void fl_directory_copy(const f_string_static_t source, const f_string_static_t destination, f_directory_recurse_t * const recurse); + extern void fl_directory_copy(const f_string_static_t source, const f_string_static_t destination, f_directory_recurse_copy_t * const recurse); #endif // _di_fl_directory_copy_ /** + * Perform a recursive action on some directory. + * + * This is intended to be used as an alternative to functions like fl_directory_list(), giving more control over the recursion process. + * + * @param path + * The directory file path. + * Must be NULL terminated. + * @param recurse + * The directory recurse data. + * This must not be NULL. + * + * This alters recurse.state.status: + * F_none on success. + * F_data_not if source.used or destination.used is 0. + * + * F_directory_not (with error bit) if the source directory does not exist. + * F_failure (with error bit) for any other failure, failures might be populated with individual status codes. + * + * Errors (with error bit) from: f_directory_create(). + * Errors (with error bit) from: f_directory_exists(). + * Errors (with error bit) from: f_string_dynamic_resize(). + * Errors (with error bit) from: f_string_dynamics_resize(). + * Errors (with error bit) from: f_file_mode_set(). + * Errors (with error bit) from: f_file_role_change(). + * Errors (with error bit) from: f_file_stat(). + * + * @see f_directory_create() + * @see f_directory_exists() + * @see f_string_dynamic_resize() + * @see f_string_dynamics_resize() + * @see f_file_mode_set() + * @see f_file_role_change() + * @see f_file_stat() + */ +#ifndef _di_fl_directory_do_ + extern void fl_directory_do(const f_string_static_t path, f_directory_recurse_do_t * const recurse); +#endif // _di_fl_directory_do_ + +/** * For some given path, print the names of each file and/or directory inside the directory, stored as a directory listing. * * Allows specifying a custom filter and custom sort. diff --git a/level_1/fl_directory/c/private-directory.c b/level_1/fl_directory/c/private-directory.c index bc9220e..ebd5225 100644 --- a/level_1/fl_directory/c/private-directory.c +++ b/level_1/fl_directory/c/private-directory.c @@ -6,7 +6,7 @@ extern "C" { #endif #if !defined(_di_fl_directory_copy_) - void private_fl_directory_copy_recurse(f_directory_recurse_t * const recurse) { + void private_fl_directory_copy_recurse(f_directory_recurse_copy_t * const recurse) { f_string_dynamics_t directories_original = f_string_dynamics_t_initialize; @@ -28,7 +28,7 @@ extern "C" { recurse->listing.socket.used = 0; recurse->listing.unknown.used = 0; - recurse->state.status = private_fl_directory_list(*recurse->source, 0, 0, recurse->flag & f_directory_recurse_flag_dereference_e, &recurse->listing); + recurse->state.status = private_fl_directory_list(*recurse->source, 0, 0, recurse->flag & f_directory_recurse_copy_flag_dereference_e, &recurse->listing); if (F_status_is_error(recurse->state.status)) { @@ -60,6 +60,12 @@ extern "C" { for (uint8_t i = 0; i < 7; ++i) { for (j = 0; F_status_is_fine(recurse->state.status) && j < list[i]->used; ++j) { + + if (recurse->state.interrupt) { + recurse->state.interrupt((void *) &recurse->state, (void *) recurse); + if (F_status_set_fine(recurse->state.status) == F_interrupt) break; + } + private_fl_directory_copy_recurse_file(list[i]->array[j], recurse); } // for @@ -127,19 +133,19 @@ extern "C" { break; } - if (recurse->flag & f_directory_recurse_flag_clone_e) { + if (recurse->flag & f_directory_recurse_copy_flag_clone_e) { struct stat source_stat; memset(&source_stat, 0, sizeof(struct stat)); - recurse->state.status = f_file_stat(source_sub, recurse->flag & f_directory_recurse_flag_dereference_e, &source_stat); + recurse->state.status = f_file_stat(source_sub, recurse->flag & f_directory_recurse_copy_flag_dereference_e, &source_stat); if (F_status_is_error(recurse->state.status)) break; recurse->state.status = f_directory_exists(destination_sub); if (F_status_is_error(recurse->state.status)) break; if (recurse->state.status == F_true) { - if (recurse->flag & f_directory_recurse_flag_exclusive_e) { + if (recurse->flag & f_directory_recurse_copy_flag_exclusive_e) { recurse->state.status = F_status_set_error(F_directory_found); break; @@ -153,14 +159,14 @@ extern "C" { if (F_status_is_error(recurse->state.status)) break; } - if (recurse->flag & (f_directory_recurse_flag_group_e | f_directory_recurse_flag_owner_e)) { - recurse->state.status = f_file_role_change(destination_sub, (recurse->flag & f_directory_recurse_flag_owner_e) ? source_stat.st_uid : -1, (recurse->flag & f_directory_recurse_flag_group_e) ? source_stat.st_gid : -1, recurse->flag & f_directory_recurse_flag_dereference_e); + if (recurse->flag & (f_directory_recurse_copy_flag_group_e | f_directory_recurse_copy_flag_owner_e)) { + recurse->state.status = f_file_role_change(destination_sub, (recurse->flag & f_directory_recurse_copy_flag_owner_e) ? source_stat.st_uid : -1, (recurse->flag & f_directory_recurse_copy_flag_group_e) ? source_stat.st_gid : -1, recurse->flag & f_directory_recurse_copy_flag_dereference_e); if (F_status_is_error(recurse->state.status)) break; } } else { if (recurse->state.status == F_true) { - if (recurse->flag & f_directory_recurse_flag_exclusive_e) { + if (recurse->flag & f_directory_recurse_copy_flag_exclusive_e) { recurse->state.status = F_status_set_error(F_directory_found); break; @@ -197,7 +203,7 @@ extern "C" { } // Errors in the recursed function are handled outside the recursed function here. - if (F_status_is_error(recurse->state.status)) { + else if (F_status_is_error(recurse->state.status)) { if (recurse->state.handle) { recurse->state.handle(&recurse->state, (void *) &recurse); } @@ -227,7 +233,7 @@ extern "C" { #endif // !defined(_di_fl_directory_copy_) #if !defined(_di_fl_directory_copy_) - void private_fl_directory_copy_recurse_file(const f_string_static_t file, f_directory_recurse_t * const recurse) { + void private_fl_directory_copy_recurse_file(const f_string_static_t file, f_directory_recurse_copy_t * const recurse) { f_string_static_t path_source = f_string_static_t_initialize; f_string_static_t path_destination = f_string_static_t_initialize; @@ -252,21 +258,21 @@ extern "C" { path_destination_string[recurse->destination->used + file.used + 1] = 0; f_status_t status = F_none; - int flag = (recurse->flag & f_directory_recurse_flag_dereference_e) ? 0 : f_file_stat_flag_reference_e; + int flag = (recurse->flag & f_directory_recurse_copy_flag_dereference_e) ? 0 : f_file_stat_flag_reference_e; - if (recurse->flag & f_directory_recurse_flag_exclusive_e) { + if (recurse->flag & f_directory_recurse_copy_flag_exclusive_e) { flag |= f_file_stat_flag_exclusive_e; } - if (recurse->flag & f_directory_recurse_flag_group_e) { + if (recurse->flag & f_directory_recurse_copy_flag_group_e) { flag |= f_file_stat_flag_group_e; } - if (recurse->flag & f_directory_recurse_flag_owner_e) { + if (recurse->flag & f_directory_recurse_copy_flag_owner_e) { flag |= f_file_stat_flag_owner_e; } - if (recurse->flag & f_directory_recurse_flag_clone_e) { + if (recurse->flag & f_directory_recurse_copy_flag_clone_e) { recurse->state.status = f_file_clone(path_source, path_destination, recurse->size_block, flag); } else { @@ -293,7 +299,198 @@ extern "C" { } #endif // !defined(_di_fl_directory_copy_) -#if !defined(_di_fl_directory_copy_) || !defined(_di_fl_directory_list_) +#if !defined(_di_fl_directory_do_) + void private_fl_directory_do_recurse(f_directory_recurse_do_t * const recurse) { + + f_string_dynamics_t directories_original = f_string_dynamics_t_initialize; + + directories_original.array = recurse->listing.directory.array; + directories_original.used = recurse->listing.directory.used; + directories_original.size = recurse->listing.directory.size; + + recurse->listing.directory.array = 0; + recurse->listing.directory.used = 0; + recurse->listing.directory.size = 0; + + // Use a clean set for each recursion. + recurse->listing.block.used = 0; + recurse->listing.character.used = 0; + recurse->listing.directory.used = 0; + recurse->listing.regular.used = 0; + recurse->listing.link.used = 0; + recurse->listing.fifo.used = 0; + recurse->listing.socket.used = 0; + recurse->listing.unknown.used = 0; + + recurse->state.status = private_fl_directory_list(*recurse->path, 0, 0, recurse->flag & f_directory_recurse_do_flag_dereference_e, &recurse->listing); + + if (F_status_is_error(recurse->state.status)) { + + // Only the directory is to be freed because all others are preserved between recursions. + f_string_dynamics_resize(0, &recurse->listing.directory); + + recurse->listing.directory.array = directories_original.array; + recurse->listing.directory.used = directories_original.used; + recurse->listing.directory.size = directories_original.size; + + return; + } + + recurse->state.status = F_none; + + { + f_string_dynamics_t * const list[] = { + &recurse->listing.block, + &recurse->listing.character, + &recurse->listing.regular, + &recurse->listing.link, + &recurse->listing.fifo, + &recurse->listing.socket, + &recurse->listing.unknown, + }; + + const uint16_t flags[] = { + f_directory_recurse_do_flag_block_e, + f_directory_recurse_do_flag_character_e, + f_directory_recurse_do_flag_regular_e, + f_directory_recurse_do_flag_link_e, + f_directory_recurse_do_flag_fifo_e, + f_directory_recurse_do_flag_socket_e, + f_directory_recurse_do_flag_unknown_e, + }; + + // + + f_array_length_t j = 0; + + for (uint8_t i = 0; i < 7; ++i) { + + for (j = 0; j < list[i]->used; ++j) { + + if (recurse->state.interrupt) { + recurse->state.interrupt((void *) &recurse->state, (void *) recurse); + if (F_status_set_fine(recurse->state.status) == F_interrupt) break; + } + + recurse->state.status = F_none; + + recurse->action((void *) recurse, flags[i]); + if (F_status_is_error(recurse->state.status)) break; + if (recurse->state.status == F_break) break; + if (recurse->state.status == F_done) break; + } // for + + if (F_status_is_error(recurse->state.status)) break; + if (recurse->state.status == F_done) break; + + list[i]->used = 0; + + // Use an upper limit when retaining memory between recursion calls. + if (list[i]->size > F_directory_max_list_d) { + recurse->state.status = f_string_dynamics_resize(F_directory_max_list_d, list[i]); + if (F_status_is_error(recurse->state.status)) break; + } + + for (j = 0; j < list[i]->used; ++j) { + + list[i]->array[j].used = 0; + + if (list[i]->array[j].size > F_directory_max_string_d) { + recurse->state.status = f_string_dynamic_resize(F_directory_max_string_d, &list[i]->array[j]); + if (F_status_is_error(recurse->state.status)) break; + } + } // for + } // for + } + + if (recurse->state.status != F_done && F_status_is_error_not(recurse->state.status)) { + for (f_array_length_t i = 0; i < recurse->listing.directory.used; ++i) { + + if (recurse->state.interrupt) { + recurse->state.interrupt((void *) &recurse->state, (void *) recurse); + if (F_status_set_fine(recurse->state.status) == F_interrupt) break; + } + + f_string_static_t path_sub = f_string_static_t_initialize; + + path_sub.used = recurse->path->used + recurse->listing.directory.array[i].used + 1; + path_sub.size = path_sub.used; + + f_char_t path_full_sub[path_sub.used + 1]; + + memcpy(path_full_sub, recurse->path->string, sizeof(f_char_t) * recurse->path->used); + memcpy(path_full_sub + recurse->path->used + 1, recurse->listing.directory.array[i].string, sizeof(f_char_t) * recurse->listing.directory.array[i].used); + + path_full_sub[recurse->path->used] = f_path_separator_s.string[0]; + path_full_sub[path_sub.used] = 0; + + path_sub.string = path_full_sub; + + recurse->state.status = f_directory_exists(path_sub); + if (F_status_is_error(recurse->state.status)) break; + + if (recurse->state.status == F_false) { + recurse->state.status = F_status_set_error(F_directory); + + break; + } + + if (recurse->flag & f_directory_recurse_do_flag_first_e) { + recurse->action((void *) recurse, f_directory_recurse_do_flag_first_e); + } + + if (recurse->depth < recurse->max_depth) { + recurse->path = (f_string_static_t * const) & path_sub; + + ++recurse->depth; + + private_fl_directory_do_recurse(recurse); + + // Data must be restored after recursion. + recurse->path = (f_string_static_t * const) & path_sub; + + // Success inside the recursed function is handled inside the recursed function, so handle at the current depth. + if (recurse->state.status == F_none) { + --recurse->depth; + } + + // Errors in the recursed function are handled outside the recursed function here. + else if (F_status_is_error(recurse->state.status)) { + if (recurse->state.handle) { + recurse->state.handle(&recurse->state, (void *) &recurse); + } + + recurse->state.status = F_failure; + } + + // Error is now handled or is done, so update the depth and exit. + if (recurse->state.status == F_done || recurse->state.status == F_failure) { + --recurse->depth; + + break; + } + } + + recurse->state.status = F_none; + + if (recurse->flag & f_directory_recurse_do_flag_last_e) { + recurse->action((void *) recurse, f_directory_recurse_do_flag_last_e); + } + + recurse->state.status = F_none; + } // for + } + + // Only the directory is to be freed because all others are preserved between recursions. + f_string_dynamics_resize(0, &recurse->listing.directory); + + recurse->listing.directory.array = directories_original.array; + recurse->listing.directory.used = directories_original.used; + recurse->listing.directory.size = directories_original.size; + } +#endif // !defined(_di_fl_directory_do_) + +#if !defined(_di_fl_directory_copy_) || !defined(_di_fl_directory_do_) || !defined(_di_fl_directory_list_) f_status_t private_fl_directory_list(const f_string_static_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing_t * const listing) { struct dirent **entity = 0; @@ -413,7 +610,7 @@ extern "C" { return F_none; } -#endif // !defined(_di_fl_directory_copy_) || !defined(_di_fl_directory_list_) +#endif // !defined(_di_fl_directory_copy_) || !defined(_di_fl_directory_do_) || !defined(_di_fl_directory_list_) #if !defined(_di_fl_directory_path_push_) || !defined(_di_fl_directory_path_push_dynamic_) f_status_t private_fl_directory_path_push(const f_string_static_t source, f_string_dynamic_t * const destination) { diff --git a/level_1/fl_directory/c/private-directory.h b/level_1/fl_directory/c/private-directory.h index 1e26ec4..facc945 100644 --- a/level_1/fl_directory/c/private-directory.h +++ b/level_1/fl_directory/c/private-directory.h @@ -19,16 +19,8 @@ extern "C" { * * Intended to be shared to each of the different implementation variations. * - * @param source - * The source file path. - * Must be NULL terminated. - * @param destination - * The destination file path. - * Must be NULL terminated. * @param recurse * The directory recurse data. - * @param depth - * The current depth. * * @return * F_none on success. @@ -38,7 +30,7 @@ extern "C" { * @see fl_directory_copy() */ #if !defined(_di_fl_directory_copy_) - extern void private_fl_directory_copy_recurse(f_directory_recurse_t * const recurse) F_attribute_visibility_internal_d; + extern void private_fl_directory_copy_recurse(f_directory_recurse_copy_t * const recurse) F_attribute_visibility_internal_d; #endif // !defined(_di_fl_directory_copy_) /** @@ -47,16 +39,7 @@ extern "C" { * Will only copy a single file and record any detected errors. * * @param file - * The name of the file within source to copy into destination. - * Must be NULL terminated. - * @param source - * The source file path. - * Must be NULL terminated. - * @param destination - * The destination file path. - * Must be NULL terminated. - * @param mode - * The mode for each file type. + * The name of the current file. * @param recurse * The directory recurse data. * @@ -69,10 +52,29 @@ extern "C" { * @see fl_directory_copy() */ #if !defined(_di_fl_directory_copy_) - extern void private_fl_directory_copy_recurse_file(const f_string_static_t file, f_directory_recurse_t * const recurse) F_attribute_visibility_internal_d; + extern void private_fl_directory_copy_recurse_file(const f_string_static_t file, f_directory_recurse_copy_t * const recurse) F_attribute_visibility_internal_d; #endif // !defined(_di_fl_directory_copy_) /** + * Private implementation of fl_directory_do(). + * + * Intended to be shared to each of the different implementation variations. + * + * @param recurse + * The directory recurse data. + * + * @return + * F_none on success. + * + * F_failure (with error bit) for any other failure, failures might be populated with individual status codes. + * + * @see fl_directory_do() + */ +#if !defined(_di_fl_directory_do_) + extern void private_fl_directory_do_recurse(f_directory_recurse_do_t * const recurse) F_attribute_visibility_internal_d; +#endif // !defined(_di_fl_directory_do_) + +/** * A special function intended to be used directly by fl_directory_list(). * * @param path @@ -112,11 +114,12 @@ extern "C" { * @see f_string_dynamics_increase_by() * * @see fl_directory_copy() + * @see fl_directory_do() * @see fl_directory_list() */ -#if !defined(_di_fl_directory_copy_) || !defined(_di_fl_directory_list_) +#if !defined(_di_fl_directory_copy_) || !defined(_di_fl_directory_do_) || !defined(_di_fl_directory_list_) extern f_status_t private_fl_directory_list(const f_string_static_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing_t * const listing) F_attribute_visibility_internal_d; -#endif // !defined(_di_fl_directory_copy_) || !defined(_di_fl_directory_list_) +#endif // !defined(_di_fl_directory_copy_) || !defined(_di_fl_directory_do_) || !defined(_di_fl_directory_list_) /** * Private implementation of fl_directory_path_push(). diff --git a/level_2/fll_file/c/file.c b/level_2/fll_file/c/file.c index aa8c189..c330061 100644 --- a/level_2/fll_file/c/file.c +++ b/level_2/fll_file/c/file.c @@ -15,7 +15,7 @@ extern "C" { #endif // _di_fll_file_mode_set_all_ #ifndef _di_fll_file_move_ - void fll_file_move(const f_string_static_t source, const f_string_static_t destination, f_directory_recurse_t * const recurse) { + void fll_file_move(const f_string_static_t source, const f_string_static_t destination, f_directory_recurse_copy_t * const recurse) { #ifndef _di_level_2_parameter_checking_ if (!recurse) return; #endif // _di_level_2_parameter_checking_ @@ -47,7 +47,7 @@ extern "C" { if (recurse->state.status == F_true) { const uint8_t flag_original = recurse->flag; - recurse->flag = f_directory_recurse_flag_clone_e; + recurse->flag = f_directory_recurse_copy_flag_clone_e; fl_directory_copy(source, destination, recurse); diff --git a/level_2/fll_file/c/file.h b/level_2/fll_file/c/file.h index ea66076..67e834c 100644 --- a/level_2/fll_file/c/file.h +++ b/level_2/fll_file/c/file.h @@ -127,7 +127,7 @@ extern "C" { * @see fl_directory_copy() */ #ifndef _di_fll_file_move_ - extern void fll_file_move(const f_string_static_t source, const f_string_static_t destination, f_directory_recurse_t * const recurse); + extern void fll_file_move(const f_string_static_t source, const f_string_static_t destination, f_directory_recurse_copy_t * const recurse); #endif // _di_fll_file_move_ /** diff --git a/level_2/fll_program/c/program/common.h b/level_2/fll_program/c/program/common.h index eebc492..efb3c73 100644 --- a/level_2/fll_program/c/program/common.h +++ b/level_2/fll_program/c/program/common.h @@ -60,6 +60,9 @@ extern "C" { * The umask() has design flaws as per specification that requires the umask be changed to read the value! * As a work-around, a umask variable is provided here so that umask() only ever need be called once. * + * The macro macro_fll_program_console_parameter_standard_initialize provides the standard program parameters to include when initializing the parameters variable. + * The last comma is not provided, the caller should add the comma to macro_fll_program_console_parameter_standard_initialize as necessary. + * * parameters: The state of pre-defined parameters passed to the program. * environment: Environment variables passed to the program. * @@ -138,6 +141,21 @@ extern "C" { debug, \ context, \ } + + #define macro_fll_program_console_parameter_standard_initialize \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e) #endif // _di_fll_program_data_t_ /** diff --git a/level_2/fll_status_string/c/status_string.c b/level_2/fll_status_string/c/status_string.c index d496036..29c6415 100644 --- a/level_2/fll_status_string/c/status_string.c +++ b/level_2/fll_status_string/c/status_string.c @@ -540,6 +540,18 @@ extern "C" { return F_none; } + if (fl_string_dynamic_compare(name, f_status_bottom_s) == F_equal_to) { + *code = F_bottom; + + return F_none; + } + + if (fl_string_dynamic_compare(name, f_status_bottom_not_s) == F_equal_to) { + *code = F_bottom_not; + + return F_none; + } + if (fl_string_dynamic_compare(name, f_status_bound_s) == F_equal_to) { *code = F_bound; @@ -594,6 +606,18 @@ extern "C" { return F_none; } + if (fl_string_dynamic_compare(name, f_status_character_s) == F_equal_to) { + *code = F_character; + + return F_none; + } + + if (fl_string_dynamic_compare(name, f_status_character_not_s) == F_equal_to) { + *code = F_character_not; + + return F_none; + } + if (fl_string_dynamic_compare(name, f_status_child_not_s) == F_equal_to) { *code = F_child_not; @@ -1008,6 +1032,18 @@ extern "C" { return F_none; } + if (fl_string_dynamic_compare(name, f_status_fifo_s) == F_equal_to) { + *code = F_fifo; + + return F_none; + } + + if (fl_string_dynamic_compare(name, f_status_fifo_not_s) == F_equal_to) { + *code = F_fifo_not; + + return F_none; + } + if (fl_string_dynamic_compare(name, f_status_first_s) == F_equal_to) { *code = F_first; @@ -1326,6 +1362,18 @@ extern "C" { return F_none; } + if (fl_string_dynamic_compare(name, f_status_middle_s) == F_equal_to) { + *code = F_middle; + + return F_none; + } + + if (fl_string_dynamic_compare(name, f_status_middle_not_s) == F_equal_to) { + *code = F_middle_not; + + return F_none; + } + if (fl_string_dynamic_compare(name, f_status_minor_s) == F_equal_to) { *code = F_minor; @@ -1692,6 +1740,18 @@ extern "C" { return F_none; } + if (fl_string_dynamic_compare(name, f_status_regular_s) == F_equal_to) { + *code = F_regular; + + return F_none; + } + + if (fl_string_dynamic_compare(name, f_status_regular_not_s) == F_equal_to) { + *code = F_regular_not; + + return F_none; + } + if (fl_string_dynamic_compare(name, f_status_relative_s) == F_equal_to) { *code = F_relative; @@ -2046,6 +2106,18 @@ extern "C" { return F_none; } + if (fl_string_dynamic_compare(name, f_status_top_s) == F_equal_to) { + *code = F_top; + + return F_none; + } + + if (fl_string_dynamic_compare(name, f_status_top_not_s) == F_equal_to) { + *code = F_top_not; + + return F_none; + } + if (fl_string_dynamic_compare(name, f_status_type_s) == F_equal_to) { *code = F_type; diff --git a/level_3/byte_dump/c/common.h b/level_3/byte_dump/c/common.h index 76d2630..b5898fa 100644 --- a/level_3/byte_dump/c/common.h +++ b/level_3/byte_dump/c/common.h @@ -62,7 +62,7 @@ extern "C" { /** * The program defines. * - * byte_dump_*: + * byte_dump_*_d: * - allocation_console: An allocation step used for small buffers specifically for console parameter. * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. @@ -336,19 +336,7 @@ extern "C" { #define byte_dump_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \ + macro_fll_program_console_parameter_standard_initialize, \ \ macro_f_console_parameter_t_initialize_3(byte_dump_short_binary_s, byte_dump_long_binary_s, 0, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize_3(byte_dump_short_decimal_s, byte_dump_long_decimal_s, 0, f_console_flag_normal_e), \ diff --git a/level_3/byte_dump/c/main.c b/level_3/byte_dump/c/main.c index be9c1d8..a064288 100644 --- a/level_3/byte_dump/c/main.c +++ b/level_3/byte_dump/c/main.c @@ -4,15 +4,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { byte_dump_main_t data = byte_dump_main_t_initialize; - data.program.debug.flag |= byte_dump_print_flag_debug_e; - data.program.error.flag |= byte_dump_print_flag_error_e; - data.program.message.flag |= byte_dump_print_flag_message_e; - data.program.warning.flag |= byte_dump_print_flag_warning_e; + data.program.debug.flag |= byte_dump_print_flag_debug_e | byte_dump_print_flag_out_e; + data.program.error.flag |= byte_dump_print_flag_error_e | byte_dump_print_flag_out_e; + data.program.output.flag |= byte_dump_print_flag_out_e; + data.program.message.flag |= byte_dump_print_flag_message_e | byte_dump_print_flag_out_e; + data.program.warning.flag |= byte_dump_print_flag_warning_e | byte_dump_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; f_console_parameter_t parameters[] = byte_dump_console_parameter_t_initialize; data.program.parameters.array = parameters; diff --git a/level_3/byte_dump/data/build/settings b/level_3/byte_dump/data/build/settings index efecc3d..de67e8a 100644 --- a/level_3/byte_dump/data/build/settings +++ b/level_3/byte_dump/data/build/settings @@ -53,6 +53,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/control/c/common.h b/level_3/control/c/common.h index 8833cbc..2096cbb 100644 --- a/level_3/control/c/common.h +++ b/level_3/control/c/common.h @@ -62,7 +62,7 @@ extern "C" { /** * The program defines. * - * control_*: + * control_*_d: * - allocation_console: An allocation step used for small buffers specifically for console parameter. * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. @@ -132,19 +132,7 @@ extern "C" { #define control_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \ + macro_fll_program_console_parameter_standard_initialize, \ \ macro_f_console_parameter_t_initialize_3(control_short_name_s, control_long_name_s, 1, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize_3(control_short_return_s, control_long_return_s, 1, f_console_flag_normal_e), \ diff --git a/level_3/control/c/main.c b/level_3/control/c/main.c index c2c0e3d..ae61a63 100644 --- a/level_3/control/c/main.c +++ b/level_3/control/c/main.c @@ -4,15 +4,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { control_main_t data = control_main_t_initialize; - data.program.debug.flag |= control_print_flag_debug_e; - data.program.error.flag |= control_print_flag_error_e; - data.program.message.flag |= control_print_flag_message_e; - data.program.warning.flag |= control_print_flag_warning_e; + data.program.debug.flag |= control_print_flag_debug_e | control_print_flag_out_e; + data.program.error.flag |= control_print_flag_error_e | control_print_flag_out_e; + data.program.output.flag |= control_print_flag_out_e; + data.program.message.flag |= control_print_flag_message_e | control_print_flag_out_e; + data.program.warning.flag |= control_print_flag_warning_e | control_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; f_console_parameter_t parameters[] = control_console_parameter_t_initialize; data.program.parameters.array = parameters; diff --git a/level_3/control/data/build/settings b/level_3/control/data/build/settings index 16ce80c..4d6d757 100644 --- a/level_3/control/data/build/settings +++ b/level_3/control/data/build/settings @@ -53,6 +53,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/controller/c/common.h b/level_3/controller/c/common.h index db9c43a..77cfa56 100644 --- a/level_3/controller/c/common.h +++ b/level_3/controller/c/common.h @@ -48,7 +48,7 @@ extern "C" { /** * The program defines. * - * controller_*: + * controller_*_d: * - allocation_console: An allocation step used for small buffers specifically for console parameter. * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. @@ -160,19 +160,7 @@ extern "C" { #define controller_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \ + macro_fll_program_console_parameter_standard_initialize, \ \ macro_f_console_parameter_t_initialize_3(controller_short_cgroup_s, controller_long_cgroup_s, 1, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize_3(controller_short_daemon_s, controller_long_daemon_s, 0, f_console_flag_normal_e), \ diff --git a/level_3/controller/c/main.c b/level_3/controller/c/main.c index 06dcbaa..981be25 100644 --- a/level_3/controller/c/main.c +++ b/level_3/controller/c/main.c @@ -5,15 +5,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { controller_main_t data = controller_main_t_initialize; - data.program.debug.flag |= controller_print_flag_debug_e; - data.program.error.flag |= controller_print_flag_error_e; - data.program.message.flag |= controller_print_flag_message_e; - data.program.warning.flag |= controller_print_flag_warning_e; + data.program.debug.flag |= controller_print_flag_debug_e | controller_print_flag_out_e; + data.program.error.flag |= controller_print_flag_error_e | controller_print_flag_out_e; + data.program.output.flag |= controller_print_flag_out_e; + data.program.message.flag |= controller_print_flag_message_e | controller_print_flag_out_e; + data.program.warning.flag |= controller_print_flag_warning_e | controller_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; f_console_parameter_t parameters[] = controller_console_parameter_t_initialize; data.program.parameters.array = parameters; diff --git a/level_3/controller/data/build/settings b/level_3/controller/data/build/settings index f3ea038..c410e17 100644 --- a/level_3/controller/data/build/settings +++ b/level_3/controller/data/build/settings @@ -65,6 +65,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/fake/c/main/build.c b/level_3/fake/c/main/build.c index 3a912e8..86a12d0 100644 --- a/level_3/fake/c/main/build.c +++ b/level_3/fake/c/main/build.c @@ -194,9 +194,9 @@ extern "C" { memcpy(path_source.string, source.string, sizeof(f_char_t) * source.used); - f_directory_recurse_t recurse = f_directory_recurse_t_initialize; + f_directory_recurse_copy_t recurse = f_directory_recurse_copy_t_initialize; recurse.verbose = &fake_print_verbose_recursive_copy; - //recurse.failures = &failures; // @fixme this now needs to be handled by a callback in recurse (recurse.state.handle)., maybe make this a callback on f_directory_recurse_t? + //recurse.failures = &failures; // @fixme this now needs to be handled by a callback in recurse (recurse.state.handle)., maybe make this a callback on f_directory_recurse_copy_t? recurse.mode = mode; for (f_array_length_t i = 0; i < files.used; ++i) { @@ -345,7 +345,7 @@ extern "C" { data->main->setting.state.status = F_none; } // for - f_directory_recurse_delete(&recurse); + f_directory_recurse_copy_delete(&recurse); f_string_dynamic_resize(0, &path_source); f_string_dynamic_resize(0, &destination_file); diff --git a/level_3/fake/c/main/common/enumeration.h b/level_3/fake/c/main/common/enumeration.h index a4e690f..e59794a 100644 --- a/level_3/fake/c/main/common/enumeration.h +++ b/level_3/fake/c/main/common/enumeration.h @@ -62,19 +62,7 @@ extern "C" { #define fake_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \ + macro_fll_program_console_parameter_standard_initialize, \ \ macro_f_console_parameter_t_initialize_3(fake_short_build_s, fake_long_build_s, 1, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize_3(fake_short_data_s, fake_long_data_s, 1, f_console_flag_normal_e), \ @@ -372,23 +360,24 @@ extern "C" { * Flags for fine-tuned print control. * * fake_print_flag_*_e: - * - none: No flags set. - * - debug: Stream is for debug printing. - * - error: Stream is for error printing. - * - message: Stream is for message printing. - * - warning: Stream is for warning printing. - * - file_to: Stream is a destination file. - * - file_from: Stream is a source file. + * - none: No flags set. + * - debug: Stream is for debug printing. + * - error: Stream is for error printing. + * - in: Stream is a source file. + * - message: Stream is for message printing. + * - out: Stream is a destination file. + * - warning: Stream is for warning printing. */ #ifndef _di_fake_print_flag_e_ enum { - fake_print_flag_none_e = 0x0, - fake_print_flag_debug_e = 0x1, - fake_print_flag_error_e = 0x2, - fake_print_flag_message_e = 0x4, - fake_print_flag_warning_e = 0x8, - fake_print_flag_file_to_e = 0x10, - fake_print_flag_file_from_e = 0x20, + fake_print_flag_none_e = 0x0, + fake_print_flag_debug_e = 0x1, + fake_print_flag_error_e = 0x2, + fake_print_flag_file_e = 0x4, + fake_print_flag_in_e = 0x8, + fake_print_flag_out_e = 0x10, + fake_print_flag_message_e = 0x20, + fake_print_flag_warning_e = 0x40, }; // enum #endif // _di_fake_print_flag_e_ diff --git a/level_3/fake/c/main/main.c b/level_3/fake/c/main/main.c index cb31e54..48e3669 100644 --- a/level_3/fake/c/main/main.c +++ b/level_3/fake/c/main/main.c @@ -4,15 +4,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fake_main_t data = fake_main_t_initialize; - data.program.debug.flag |= fake_print_flag_debug_e; - data.program.error.flag |= fake_print_flag_error_e; - data.program.message.flag |= fake_print_flag_message_e; - data.program.warning.flag |= fake_print_flag_warning_e; + data.program.debug.flag |= fake_print_flag_debug_e | fake_print_flag_out_e; + data.program.error.flag |= fake_print_flag_error_e | fake_print_flag_out_e; + data.program.output.flag |= fake_print_flag_out_e; + data.program.message.flag |= fake_print_flag_message_e | fake_print_flag_out_e; + data.program.warning.flag |= fake_print_flag_warning_e | fake_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; data.setting.flag |= fake_main_flag_enable_documents_e; data.setting.flag |= fake_main_flag_enable_shared_e; diff --git a/level_3/fake/c/main/make/operate_process_type.c b/level_3/fake/c/main/make/operate_process_type.c index dbc746c..b290718 100644 --- a/level_3/fake/c/main/make/operate_process_type.c +++ b/level_3/fake/c/main/make/operate_process_type.c @@ -199,7 +199,7 @@ extern "C" { const f_array_length_t total = data_make->cache_arguments.used - 1; f_string_static_t destination = f_string_static_t_initialize; - f_directory_recurse_t recurse = f_directory_recurse_t_initialize; + f_directory_recurse_copy_t recurse = f_directory_recurse_copy_t_initialize; if (data_make->main->program.error.verbosity > f_console_verbosity_normal_e) { recurse.state.custom = data_make->main; @@ -230,7 +230,7 @@ extern "C" { data_make->main->setting.state.status = F_status_set_error(F_failure); - f_directory_recurse_delete(&recurse); + f_directory_recurse_copy_delete(&recurse); return; } @@ -254,7 +254,7 @@ extern "C" { data_make->main->setting.state.status = F_status_set_error(F_failure); - f_directory_recurse_delete(&recurse); + f_directory_recurse_copy_delete(&recurse); return; } @@ -290,10 +290,10 @@ extern "C" { if (data_make->main->setting.state.status == F_true) { if (clone) { - recurse.flag |= f_directory_recurse_flag_clone_e; + recurse.flag |= f_directory_recurse_copy_flag_clone_e; } else { - recurse.flag -= recurse.flag & f_directory_recurse_flag_clone_e; + recurse.flag -= recurse.flag & f_directory_recurse_copy_flag_clone_e; } fl_directory_copy(data_make->cache_arguments.array[i], destination, &recurse); @@ -333,7 +333,7 @@ extern "C" { } } // for - f_directory_recurse_delete(&recurse); + f_directory_recurse_copy_delete(&recurse); if (F_status_is_error_not(data_make->main->setting.state.status)) { data_make->main->setting.state.status = F_none; @@ -1451,7 +1451,7 @@ extern "C" { const f_array_length_t total = data_make->cache_arguments.used -1; - f_directory_recurse_t recurse = f_directory_recurse_t_initialize; + f_directory_recurse_copy_t recurse = f_directory_recurse_copy_t_initialize; f_string_static_t destination = f_string_static_t_initialize; if (data_make->main->program.error.verbosity > f_console_verbosity_normal_e) { @@ -1471,7 +1471,7 @@ extern "C" { data_make->main->setting.state.status = F_status_set_error(F_failure); - f_directory_recurse_delete(&recurse); + f_directory_recurse_copy_delete(&recurse); return; } @@ -1495,7 +1495,7 @@ extern "C" { data_make->main->setting.state.status = F_status_set_error(F_failure); - f_directory_recurse_delete(&recurse); + f_directory_recurse_copy_delete(&recurse); return; } @@ -1535,13 +1535,13 @@ extern "C" { data_make->main->setting.state.status = F_status_set_error(F_failure); - f_directory_recurse_delete(&recurse); + f_directory_recurse_copy_delete(&recurse); return; } } // for - f_directory_recurse_delete(&recurse); + f_directory_recurse_copy_delete(&recurse); data_make->main->setting.state.status = F_none; } diff --git a/level_3/fake/c/main/print/verbose.c b/level_3/fake/c/main/print/verbose.c index 4d76b2d..be49445 100644 --- a/level_3/fake/c/main/print/verbose.c +++ b/level_3/fake/c/main/print/verbose.c @@ -83,7 +83,7 @@ extern "C" { if (!void_recurse) return; - f_directory_recurse_t * const recurse = (f_directory_recurse_t * const) void_recurse; + f_directory_recurse_copy_t * const recurse = (f_directory_recurse_copy_t * const) void_recurse; if (!recurse->state.custom) { recurse->state.status = F_output_not; @@ -108,7 +108,7 @@ extern "C" { if (!void_recurse) return; - f_directory_recurse_t * const recurse = (f_directory_recurse_t * const) void_recurse; + f_directory_recurse_copy_t * const recurse = (f_directory_recurse_copy_t * const) void_recurse; if (!recurse->state.custom) { recurse->state.status = F_output_not; @@ -133,7 +133,7 @@ extern "C" { if (!void_recurse) return; - f_directory_recurse_t * const recurse = (f_directory_recurse_t * const) void_recurse; + f_directory_recurse_copy_t * const recurse = (f_directory_recurse_copy_t * const) void_recurse; if (!recurse->state.custom) { recurse->state.status = F_output_not; diff --git a/level_3/fake/c/main/print/verbose.h b/level_3/fake/c/main/print/verbose.h index 1a7dc6a..a116229 100644 --- a/level_3/fake/c/main/print/verbose.h +++ b/level_3/fake/c/main/print/verbose.h @@ -181,8 +181,8 @@ extern "C" { /** * Helper function for performing a verbose print for a file clone operation. * - * This is intended to be passed as a callback to f_directory_recurse_t.verbose. - * The f_directory_recurse_t.state.custom must be the fake_data_t. + * This is intended to be passed as a callback to f_directory_recurse_copy_t.verbose. + * The f_directory_recurse_copy_t.state.custom must be the fake_data_t. * * @param source * The source string. @@ -204,8 +204,8 @@ extern "C" { /** * Helper function for performing a verbose print for a file copy operation. * - * This is intended to be passed as a callback to f_directory_recurse_t.verbose. - * The f_directory_recurse_t.state.custom must be the fake_data_t. + * This is intended to be passed as a callback to f_directory_recurse_copy_t.verbose. + * The f_directory_recurse_copy_t.state.custom must be the fake_data_t. * * @param source * The source string. @@ -227,8 +227,8 @@ extern "C" { /** * Print a verbose message for when a file is moved. * - * This is intended to be passed as a callback to f_directory_recurse_t.verbose. - * The f_directory_recurse_t.state.custom must be the fake_data_t. + * This is intended to be passed as a callback to f_directory_recurse_copy_t.verbose. + * The f_directory_recurse_copy_t.state.custom must be the fake_data_t. * * @param source * The source string. diff --git a/level_3/fake/data/build/settings b/level_3/fake/data/build/settings index 6512ba8..43b1e4f 100644 --- a/level_3/fake/data/build/settings +++ b/level_3/fake/data/build/settings @@ -66,6 +66,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/firewall/c/common.h b/level_3/firewall/c/common.h index b8b1f6a..9e9c6a0 100644 --- a/level_3/firewall/c/common.h +++ b/level_3/firewall/c/common.h @@ -101,7 +101,7 @@ extern "C" { /** * The program defines. * - * firewall_*: + * firewall_*_d: * - allocation_console: An allocation step used for small buffers specifically for console parameter. * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. diff --git a/level_3/firewall/c/main.c b/level_3/firewall/c/main.c index a1c424e..270814b 100644 --- a/level_3/firewall/c/main.c +++ b/level_3/firewall/c/main.c @@ -4,15 +4,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { firewall_main_t data = firewall_main_t_initialize; - data.program.debug.flag |= firewall_read_print_flag_debug_e; - data.program.error.flag |= firewall_read_print_flag_error_e; - data.program.message.flag |= firewall_read_print_flag_message_e; - data.program.warning.flag |= firewall_read_print_flag_warning_e; + data.program.debug.flag |= firewall_print_flag_debug_e | firewall_print_flag_out_e; + data.program.error.flag |= firewall_print_flag_error_e | firewall_print_flag_out_e; + data.program.output.flag |= firewall_print_flag_out_e; + data.program.message.flag |= firewall_print_flag_message_e | firewall_print_flag_out_e; + data.program.warning.flag |= firewall_print_flag_warning_e | firewall_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; f_console_parameter_t parameters[] = firewall_console_parameter_t_initialize; data.program.parameters.array = parameters; diff --git a/level_3/firewall/data/build/settings b/level_3/firewall/data/build/settings index 09b8c8e..745694a 100644 --- a/level_3/firewall/data/build/settings +++ b/level_3/firewall/data/build/settings @@ -55,6 +55,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/fss_basic_list_read/c/common.h b/level_3/fss_basic_list_read/c/common.h index 76fd57f..0c9a6c5 100644 --- a/level_3/fss_basic_list_read/c/common.h +++ b/level_3/fss_basic_list_read/c/common.h @@ -62,7 +62,7 @@ extern "C" { /** * The program defines. * - * fss_basic_list_read_*: + * fss_basic_list_read_*_d: * - allocation_console: An allocation step used for small buffers specifically for console parameter. * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. @@ -233,19 +233,7 @@ extern "C" { #define fss_basic_list_read_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \ + macro_fll_program_console_parameter_standard_initialize, \ \ macro_f_console_parameter_t_initialize_3(fss_basic_list_read_short_at_s, fss_basic_list_read_long_at_s, 0, 1, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize_3(fss_basic_list_read_short_content_s, fss_basic_list_read_long_content_s, 0, 0, f_console_flag_normal_e), \ diff --git a/level_3/fss_basic_list_read/c/main.c b/level_3/fss_basic_list_read/c/main.c index be01e36..992156a 100644 --- a/level_3/fss_basic_list_read/c/main.c +++ b/level_3/fss_basic_list_read/c/main.c @@ -4,15 +4,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_basic_list_read_main_t data = fss_basic_list_read_main_t_initialize; - data.program.debug.flag |= fss_basic_list_read_print_flag_debug_e; - data.program.error.flag |= fss_basic_list_read_print_flag_error_e; - data.program.message.flag |= fss_basic_list_read_print_flag_message_e; - data.program.warning.flag |= fss_basic_list_read_print_flag_warning_e; + data.program.debug.flag |= fss_basic_list_read_print_flag_debug_e | fss_basic_list_read_print_flag_out_e; + data.program.error.flag |= fss_basic_list_read_print_flag_error_e | fss_basic_list_read_print_flag_out_e; + data.program.output.flag |= fss_basic_list_read_print_flag_out_e; + data.program.message.flag |= fss_basic_list_read_print_flag_message_e | fss_basic_list_read_print_flag_out_e; + data.program.warning.flag |= fss_basic_list_read_print_flag_warning_e | fss_basic_list_read_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; f_console_parameter_t parameters[] = fss_basic_list_read_console_parameter_t_initialize; data.program.parameters.array = parameters; diff --git a/level_3/fss_basic_list_read/data/build/settings b/level_3/fss_basic_list_read/data/build/settings index e1ae7ba..a86aba4 100644 --- a/level_3/fss_basic_list_read/data/build/settings +++ b/level_3/fss_basic_list_read/data/build/settings @@ -53,6 +53,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/fss_basic_read/c/common.h b/level_3/fss_basic_read/c/common.h index a9e37f4..465ea77 100644 --- a/level_3/fss_basic_read/c/common.h +++ b/level_3/fss_basic_read/c/common.h @@ -62,7 +62,7 @@ extern "C" { /** * The program defines. * - * fss_basic_read_*: + * fss_basic_read_*_d: * - allocation_console: An allocation step used for small buffers specifically for console parameter. * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. @@ -231,19 +231,7 @@ extern "C" { #define fss_basic_read_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \ + macro_fll_program_console_parameter_standard_initialize, \ \ macro_f_console_parameter_t_initialize_3(fss_basic_read_short_at_s, fss_basic_read_long_at_s, 0, 1, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize_3(fss_basic_read_short_content_s, fss_basic_read_long_content_s, 0, 0, f_console_flag_normal_e), \ diff --git a/level_3/fss_basic_read/c/main.c b/level_3/fss_basic_read/c/main.c index 771393c..3f4a035 100644 --- a/level_3/fss_basic_read/c/main.c +++ b/level_3/fss_basic_read/c/main.c @@ -4,15 +4,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_basic_read_main_t data = fss_basic_read_main_t_initialize; - data.program.debug.flag |= fss_basic_read_print_flag_debug_e; - data.program.error.flag |= fss_basic_read_print_flag_error_e; - data.program.message.flag |= fss_basic_read_print_flag_message_e; - data.program.warning.flag |= fss_basic_read_print_flag_warning_e; + data.program.debug.flag |= fss_basic_read_print_flag_debug_e | fss_basic_read_print_flag_out_e; + data.program.error.flag |= fss_basic_read_print_flag_error_e | fss_basic_read_print_flag_out_e; + data.program.output.flag |= fss_basic_read_print_flag_out_e; + data.program.message.flag |= fss_basic_read_print_flag_message_e | fss_basic_read_print_flag_out_e; + data.program.warning.flag |= fss_basic_read_print_flag_warning_e | fss_basic_read_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; f_console_parameter_t parameters[] = fss_basic_read_console_parameter_t_initialize; data.program.parameters.array = parameters; diff --git a/level_3/fss_basic_read/data/build/settings b/level_3/fss_basic_read/data/build/settings index b1e1c6e..cdcd002 100644 --- a/level_3/fss_basic_read/data/build/settings +++ b/level_3/fss_basic_read/data/build/settings @@ -53,6 +53,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/fss_embedded_list_read/c/common.h b/level_3/fss_embedded_list_read/c/common.h index 40b1479..3fe43bc 100644 --- a/level_3/fss_embedded_list_read/c/common.h +++ b/level_3/fss_embedded_list_read/c/common.h @@ -62,7 +62,7 @@ extern "C" { /** * The program defines. * - * fss_embedded_list_read_*: + * fss_embedded_list_read_*_d: * - allocation_console: An allocation step used for small buffers specifically for console parameter. * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. @@ -231,19 +231,7 @@ extern "C" { #define fss_embedded_list_read_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \ + macro_fll_program_console_parameter_standard_initialize, \ \ macro_f_console_parameter_t_initialize_3(fss_embedded_list_read_short_at_s.string, fss_embedded_list_read_long_at_s.string, 0, 1, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize_3(fss_embedded_list_read_short_content_s.string, fss_embedded_list_read_long_content_s.string, 0, 0, f_console_flag_normal_e), \ diff --git a/level_3/fss_embedded_list_read/c/main.c b/level_3/fss_embedded_list_read/c/main.c index fc94ae9..d5c85ab 100644 --- a/level_3/fss_embedded_list_read/c/main.c +++ b/level_3/fss_embedded_list_read/c/main.c @@ -4,15 +4,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_embedded_list_read_main_t data = fss_embedded_list_read_main_t_initialize; - data.program.debug.flag |= fss_embedded_list_read_print_flag_debug_e; - data.program.error.flag |= fss_embedded_list_read_print_flag_error_e; - data.program.message.flag |= fss_embedded_list_read_print_flag_message_e; - data.program.warning.flag |= fss_embedded_list_read_print_flag_warning_e; + data.program.debug.flag |= fss_embedded_list_read_print_flag_debug_e | fss_embedded_list_read_print_flag_out_e; + data.program.error.flag |= fss_embedded_list_read_print_flag_error_e | fss_embedded_list_read_print_flag_out_e; + data.program.output.flag |= fss_embedded_list_read_print_flag_out_e; + data.program.message.flag |= fss_embedded_list_read_print_flag_message_e | fss_embedded_list_read_print_flag_out_e; + data.program.warning.flag |= fss_embedded_list_read_print_flag_warning_e | fss_embedded_list_read_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; f_console_parameter_t parameters[] = fss_embedded_list_read_console_parameter_t_initialize; data.program.parameters.array = parameters; diff --git a/level_3/fss_embedded_list_read/data/build/settings b/level_3/fss_embedded_list_read/data/build/settings index 9221107..6fddecc 100644 --- a/level_3/fss_embedded_list_read/data/build/settings +++ b/level_3/fss_embedded_list_read/data/build/settings @@ -44,6 +44,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/fss_extended_list_read/c/common.h b/level_3/fss_extended_list_read/c/common.h index 0eea8ee..112ed18 100644 --- a/level_3/fss_extended_list_read/c/common.h +++ b/level_3/fss_extended_list_read/c/common.h @@ -68,7 +68,7 @@ extern "C" { /** * The program defines. * - * fss_extended_list_read_*: + * fss_extended_list_read_*_d: * - allocation_console: An allocation step used for small buffers specifically for console parameter. * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. @@ -231,19 +231,7 @@ extern "C" { #define fss_extended_list_read_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \ + macro_fll_program_console_parameter_standard_initialize, \ \ macro_f_console_parameter_t_initialize_3(fss_extended_list_read_short_at_s, fss_extended_list_read_long_at_s, 0, 1, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize_3(fss_extended_list_read_short_content_s, fss_extended_list_read_long_content_s, 0, 0, f_console_flag_normal_e), \ diff --git a/level_3/fss_extended_list_read/c/main.c b/level_3/fss_extended_list_read/c/main.c index bfcbedf..d8b7554 100644 --- a/level_3/fss_extended_list_read/c/main.c +++ b/level_3/fss_extended_list_read/c/main.c @@ -4,15 +4,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_extended_list_read_main_t data = fss_extended_list_read_main_t_initialize; - data.program.debug.flag |= fss_extended_list_read_print_flag_debug_e; - data.program.error.flag |= fss_extended_list_read_print_flag_error_e; - data.program.message.flag |= fss_extended_list_read_print_flag_message_e; - data.program.warning.flag |= fss_extended_list_read_print_flag_warning_e; + data.program.debug.flag |= fss_extended_list_read_print_flag_debug_e | fss_extended_list_read_print_flag_out_e; + data.program.error.flag |= fss_extended_list_read_print_flag_error_e | fss_extended_list_read_print_flag_out_e; + data.program.output.flag |= fss_extended_list_read_print_flag_out_e; + data.program.message.flag |= fss_extended_list_read_print_flag_message_e | fss_extended_list_read_print_flag_out_e; + data.program.warning.flag |= fss_extended_list_read_print_flag_warning_e | fss_extended_list_read_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; f_console_parameter_t parameters[] = fss_extended_list_read_console_parameter_t_initialize; data.program.parameters.array = parameters; diff --git a/level_3/fss_extended_list_read/data/build/settings b/level_3/fss_extended_list_read/data/build/settings index 536dfe6..79e0fea 100644 --- a/level_3/fss_extended_list_read/data/build/settings +++ b/level_3/fss_extended_list_read/data/build/settings @@ -44,6 +44,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/fss_extended_read/c/common.h b/level_3/fss_extended_read/c/common.h index 215338a..77ed652 100644 --- a/level_3/fss_extended_read/c/common.h +++ b/level_3/fss_extended_read/c/common.h @@ -78,7 +78,7 @@ extern "C" { /** * The program pipe strings. * - * fss_extended_read_pipe_*: + * fss_extended_read_pipe_*_d: * - name: A name used to represent the pipe when printing file names. * - content_end: A code used to represent the end of Content for use in binary formats. * - content_ignore: A code used to represent the ignoring Content for use in binary formats. @@ -231,19 +231,7 @@ extern "C" { #define fss_extended_read_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \ + macro_fll_program_console_parameter_standard_initialize, \ \ macro_f_console_parameter_t_initialize_3(fss_extended_read_short_content_s, fss_extended_read_long_content_s, 0, 0, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize_3(fss_extended_read_short_columns_s, fss_extended_read_long_columns_s, 0, 0, f_console_flag_normal_e), \ diff --git a/level_3/fss_extended_read/c/main.c b/level_3/fss_extended_read/c/main.c index 45f6899..d3eb8d5 100644 --- a/level_3/fss_extended_read/c/main.c +++ b/level_3/fss_extended_read/c/main.c @@ -4,15 +4,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_extended_read_main_t data = fss_extended_read_main_t_initialize; - data.program.debug.flag |= fss_extended_read_print_flag_debug_e; - data.program.error.flag |= fss_extended_read_print_flag_error_e; - data.program.message.flag |= fss_extended_read_print_flag_message_e; - data.program.warning.flag |= fss_extended_read_print_flag_warning_e; + data.program.debug.flag |= fss_extended_read_print_flag_debug_e | fss_extended_read_print_flag_out_e; + data.program.error.flag |= fss_extended_read_print_flag_error_e | fss_extended_read_print_flag_out_e; + data.program.output.flag |= fss_extended_read_print_flag_out_e; + data.program.message.flag |= fss_extended_read_print_flag_message_e | fss_extended_read_print_flag_out_e; + data.program.warning.flag |= fss_extended_read_print_flag_warning_e | fss_extended_read_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; f_console_parameter_t parameters[] = fss_extended_read_console_parameter_t_initialize; data.program.parameters.array = parameters; diff --git a/level_3/fss_extended_read/data/build/settings b/level_3/fss_extended_read/data/build/settings index f93619d..2c3c037 100644 --- a/level_3/fss_extended_read/data/build/settings +++ b/level_3/fss_extended_read/data/build/settings @@ -53,6 +53,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/fss_identify/c/common.h b/level_3/fss_identify/c/common.h index 802d9b2..73936db 100644 --- a/level_3/fss_identify/c/common.h +++ b/level_3/fss_identify/c/common.h @@ -62,7 +62,7 @@ extern "C" { /** * The program defines. * - * fss_identify_*: + * fss_identify_*_d: * - allocation_console: An allocation step used for small buffers specifically for console parameter. * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. @@ -139,19 +139,7 @@ extern "C" { #define fss_identify_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \ + macro_fll_program_console_parameter_standard_initialize, \ \ macro_f_console_parameter_t_initialize_3(fss_identify_short_content_s, fss_identify_long_content_s, 0, 0, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize_3(fss_identify_short_line_s, fss_identify_long_line_s, 0, 1, f_console_flag_normal_e), \ diff --git a/level_3/fss_identify/c/main.c b/level_3/fss_identify/c/main.c index d94ad0e..814b2c2 100644 --- a/level_3/fss_identify/c/main.c +++ b/level_3/fss_identify/c/main.c @@ -4,15 +4,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_identify_main_t data = fss_identify_main_t_initialize; - data.program.debug.flag |= fss_identify_print_flag_debug_e; - data.program.error.flag |= fss_identify_print_flag_error_e; - data.program.message.flag |= fss_identify_print_flag_message_e; - data.program.warning.flag |= fss_identify_print_flag_warning_e; + data.program.debug.flag |= fss_identify_print_flag_debug_e | fss_identify_print_flag_out_e; + data.program.error.flag |= fss_identify_print_flag_error_e | fss_identify_print_flag_out_e; + data.program.output.flag |= fss_identify_print_flag_out_e; + data.program.message.flag |= fss_identify_print_flag_message_e | fss_identify_print_flag_out_e; + data.program.warning.flag |= fss_identify_print_flag_warning_e | fss_identify_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; f_console_parameter_t parameters[] = fss_identify_console_parameter_t_initialize; data.program.parameters.array = parameters; diff --git a/level_3/fss_identify/data/build/settings b/level_3/fss_identify/data/build/settings index ea53a89..9c6bbcf 100644 --- a/level_3/fss_identify/data/build/settings +++ b/level_3/fss_identify/data/build/settings @@ -53,6 +53,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/fss_payload_read/c/common.h b/level_3/fss_payload_read/c/common.h index e4d69e5..cb49abf 100644 --- a/level_3/fss_payload_read/c/common.h +++ b/level_3/fss_payload_read/c/common.h @@ -216,19 +216,7 @@ extern "C" { #define fss_payload_read_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \ + macro_fll_program_console_parameter_standard_initialize, \ \ macro_f_console_parameter_t_initialize_3(fss_payload_read_short_at_s, fss_payload_read_long_at_s, 0, 1, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize_3(fss_payload_read_short_content_s, fss_payload_read_long_content_s, 0, 0, f_console_flag_normal_e), \ diff --git a/level_3/fss_payload_read/c/main.c b/level_3/fss_payload_read/c/main.c index 9058dd7..9ab56c1 100644 --- a/level_3/fss_payload_read/c/main.c +++ b/level_3/fss_payload_read/c/main.c @@ -4,15 +4,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_payload_read_main_t data = fss_payload_read_main_t_initialize; - data.program.debug.flag |= fss_payload_read_print_flag_debug_e; - data.program.error.flag |= fss_payload_read_print_flag_error_e; - data.program.message.flag |= fss_payload_read_print_flag_message_e; - data.program.warning.flag |= fss_payload_read_print_flag_warning_e; + data.program.debug.flag |= fss_payload_read_print_flag_debug_e | fss_payload_read_print_flag_out_e; + data.program.error.flag |= fss_payload_read_print_flag_error_e | fss_payload_read_print_flag_out_e; + data.program.output.flag |= fss_payload_read_print_flag_out_e; + data.program.message.flag |= fss_payload_read_print_flag_message_e | fss_payload_read_print_flag_out_e; + data.program.warning.flag |= fss_payload_read_print_flag_warning_e | fss_payload_read_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; f_console_parameter_t parameters[] = fss_payload_read_console_parameter_t_initialize; data.program.parameters.array = parameters; diff --git a/level_3/fss_payload_read/data/build/settings b/level_3/fss_payload_read/data/build/settings index ae17552..728c203 100644 --- a/level_3/fss_payload_read/data/build/settings +++ b/level_3/fss_payload_read/data/build/settings @@ -53,6 +53,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/fss_write/c/basic/main.c b/level_3/fss_write/c/basic/main.c index 702e839..60ce513 100644 --- a/level_3/fss_write/c/basic/main.c +++ b/level_3/fss_write/c/basic/main.c @@ -5,15 +5,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_write_main_t data = fss_write_main_t_initialize; - data.program.debug.flag |= fss_write_print_flag_debug_e; - data.program.error.flag |= fss_write_print_flag_error_e; - data.program.message.flag |= fss_write_print_flag_message_e; - data.program.warning.flag |= fss_write_print_flag_warning_e; + data.program.debug.flag |= fss_write_print_flag_debug_e | fss_write_print_flag_out_e; + data.program.error.flag |= fss_write_print_flag_error_e | fss_write_print_flag_out_e; + data.program.output.flag |= fss_write_print_flag_out_e; + data.program.message.flag |= fss_write_print_flag_message_e | fss_write_print_flag_out_e; + data.program.warning.flag |= fss_write_print_flag_warning_e | fss_write_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; data.setting.state.custom = (void *) &data; data.setting.standard = fss_write_basic_standard_s; diff --git a/level_3/fss_write/c/basic_list/main.c b/level_3/fss_write/c/basic_list/main.c index 78fdb2b..eae411c 100644 --- a/level_3/fss_write/c/basic_list/main.c +++ b/level_3/fss_write/c/basic_list/main.c @@ -5,15 +5,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_write_main_t data = fss_write_main_t_initialize; - data.program.debug.flag |= fss_write_print_flag_debug_e; - data.program.error.flag |= fss_write_print_flag_error_e; - data.program.message.flag |= fss_write_print_flag_message_e; - data.program.warning.flag |= fss_write_print_flag_warning_e; + data.program.debug.flag |= fss_write_print_flag_debug_e | fss_write_print_flag_out_e; + data.program.error.flag |= fss_write_print_flag_error_e | fss_write_print_flag_out_e; + data.program.output.flag |= fss_write_print_flag_out_e; + data.program.message.flag |= fss_write_print_flag_message_e | fss_write_print_flag_out_e; + data.program.warning.flag |= fss_write_print_flag_warning_e | fss_write_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; data.setting.state.custom = (void *) &data; data.setting.standard = fss_write_basic_list_standard_s; diff --git a/level_3/fss_write/c/embedded_list/main.c b/level_3/fss_write/c/embedded_list/main.c index 21a9696..851d9c1 100644 --- a/level_3/fss_write/c/embedded_list/main.c +++ b/level_3/fss_write/c/embedded_list/main.c @@ -5,15 +5,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_write_main_t data = fss_write_main_t_initialize; - data.program.debug.flag |= fss_write_print_flag_debug_e; - data.program.error.flag |= fss_write_print_flag_error_e; - data.program.message.flag |= fss_write_print_flag_message_e; - data.program.warning.flag |= fss_write_print_flag_warning_e; + data.program.debug.flag |= fss_write_print_flag_debug_e | fss_write_print_flag_out_e; + data.program.error.flag |= fss_write_print_flag_error_e | fss_write_print_flag_out_e; + data.program.output.flag |= fss_write_print_flag_out_e; + data.program.message.flag |= fss_write_print_flag_message_e | fss_write_print_flag_out_e; + data.program.warning.flag |= fss_write_print_flag_warning_e | fss_write_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; data.setting.state.custom = (void *) &data; data.setting.standard = fss_write_embedded_list_standard_s; diff --git a/level_3/fss_write/c/extended/main.c b/level_3/fss_write/c/extended/main.c index 8218952..cade2d6 100644 --- a/level_3/fss_write/c/extended/main.c +++ b/level_3/fss_write/c/extended/main.c @@ -5,15 +5,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_write_main_t data = fss_write_main_t_initialize; - data.program.debug.flag |= fss_write_print_flag_debug_e; - data.program.error.flag |= fss_write_print_flag_error_e; - data.program.message.flag |= fss_write_print_flag_message_e; - data.program.warning.flag |= fss_write_print_flag_warning_e; + data.program.debug.flag |= fss_write_print_flag_debug_e | fss_write_print_flag_out_e; + data.program.error.flag |= fss_write_print_flag_error_e | fss_write_print_flag_out_e; + data.program.output.flag |= fss_write_print_flag_out_e; + data.program.message.flag |= fss_write_print_flag_message_e | fss_write_print_flag_out_e; + data.program.warning.flag |= fss_write_print_flag_warning_e | fss_write_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; data.setting.state.custom = (void *) &data; data.setting.standard = fss_write_extended_standard_s; diff --git a/level_3/fss_write/c/extended_list/main.c b/level_3/fss_write/c/extended_list/main.c index 38ebe50..a5786cc 100644 --- a/level_3/fss_write/c/extended_list/main.c +++ b/level_3/fss_write/c/extended_list/main.c @@ -5,15 +5,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_write_main_t data = fss_write_main_t_initialize; - data.program.debug.flag |= fss_write_print_flag_debug_e; - data.program.error.flag |= fss_write_print_flag_error_e; - data.program.message.flag |= fss_write_print_flag_message_e; - data.program.warning.flag |= fss_write_print_flag_warning_e; + data.program.debug.flag |= fss_write_print_flag_debug_e | fss_write_print_flag_out_e; + data.program.error.flag |= fss_write_print_flag_error_e | fss_write_print_flag_out_e; + data.program.output.flag |= fss_write_print_flag_out_e; + data.program.message.flag |= fss_write_print_flag_message_e | fss_write_print_flag_out_e; + data.program.warning.flag |= fss_write_print_flag_warning_e | fss_write_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; data.setting.state.custom = (void *) &data; data.setting.standard = fss_write_extended_list_standard_s; diff --git a/level_3/fss_write/c/main/common/define.h b/level_3/fss_write/c/main/common/define.h index 1e7785a..fd06f24 100644 --- a/level_3/fss_write/c/main/common/define.h +++ b/level_3/fss_write/c/main/common/define.h @@ -19,7 +19,7 @@ extern "C" { /** * The program default defines. * - * fss_write_*: + * fss_write_*_d: * - allocation_console: An allocation step used for small buffers specifically for console parameter. * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. diff --git a/level_3/fss_write/c/main/common/enumeration.h b/level_3/fss_write/c/main/common/enumeration.h index f6fc743..54160c0 100644 --- a/level_3/fss_write/c/main/common/enumeration.h +++ b/level_3/fss_write/c/main/common/enumeration.h @@ -96,19 +96,7 @@ extern "C" { #define fss_write_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \ + macro_fll_program_console_parameter_standard_initialize, \ \ macro_f_console_parameter_t_initialize_3(fss_write_short_as_s, fss_write_long_as_s, 1, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize_3(fss_write_short_backtick_s, fss_write_long_backtick_s, 0, f_console_flag_normal_e), \ @@ -133,23 +121,24 @@ extern "C" { * Flags for fine-tuned print control. * * fss_write_print_flag_*_e: - * - none: No flags set. - * - debug: Stream is for debug printing. - * - error: Stream is for error printing. - * - message: Stream is for message printing. - * - warning: Stream is for warning printing. - * - file_to: Stream is a destination file. - * - file_from: Stream is a source file. + * - none: No flags set. + * - debug: Stream is for debug printing. + * - error: Stream is for error printing. + * - in: Stream is a source file. + * - message: Stream is for message printing. + * - out: Stream is a destination file. + * - warning: Stream is for warning printing. */ #ifndef _di_fss_write_print_flag_e_ enum { - fss_write_print_flag_none_e = 0x0, - fss_write_print_flag_debug_e = 0x1, - fss_write_print_flag_error_e = 0x2, - fss_write_print_flag_message_e = 0x4, - fss_write_print_flag_warning_e = 0x8, - fss_write_print_flag_file_to_e = 0x10, - fss_write_print_flag_file_from_e = 0x20, + fss_write_print_flag_none_e = 0x0, + fss_write_print_flag_debug_e = 0x1, + fss_write_print_flag_error_e = 0x2, + fss_write_print_flag_file_e = 0x4, + fss_write_print_flag_in_e = 0x8, + fss_write_print_flag_out_e = 0x10, + fss_write_print_flag_message_e = 0x20, + fss_write_print_flag_warning_e = 0x40, }; // enum #endif // _di_fss_write_print_flag_e_ diff --git a/level_3/fss_write/c/main/main.c b/level_3/fss_write/c/main/main.c index aee7ebe..38586b7 100644 --- a/level_3/fss_write/c/main/main.c +++ b/level_3/fss_write/c/main/main.c @@ -12,15 +12,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_write_main_t data = fss_write_main_t_initialize; - data.program.debug.flag |= fss_write_print_flag_debug_e; - data.program.error.flag |= fss_write_print_flag_error_e; - data.program.message.flag |= fss_write_print_flag_message_e; - data.program.warning.flag |= fss_write_print_flag_warning_e; + data.program.debug.flag |= fss_write_print_flag_debug_e | fss_write_print_flag_out_e; + data.program.error.flag |= fss_write_print_flag_error_e | fss_write_print_flag_out_e; + data.program.output.flag |= fss_write_print_flag_out_e; + data.program.message.flag |= fss_write_print_flag_message_e | fss_write_print_flag_out_e; + data.program.warning.flag |= fss_write_print_flag_warning_e | fss_write_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; data.setting.state.custom = (void *) &data; diff --git a/level_3/fss_write/c/payload/main.c b/level_3/fss_write/c/payload/main.c index 06c96b5..5f581ce 100644 --- a/level_3/fss_write/c/payload/main.c +++ b/level_3/fss_write/c/payload/main.c @@ -5,15 +5,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_write_main_t data = fss_write_main_t_initialize; - data.program.debug.flag |= fss_write_print_flag_debug_e; - data.program.error.flag |= fss_write_print_flag_error_e; - data.program.message.flag |= fss_write_print_flag_message_e; - data.program.warning.flag |= fss_write_print_flag_warning_e; + data.program.debug.flag |= fss_write_print_flag_debug_e | fss_write_print_flag_out_e; + data.program.error.flag |= fss_write_print_flag_error_e | fss_write_print_flag_out_e; + data.program.output.flag |= fss_write_print_flag_out_e; + data.program.message.flag |= fss_write_print_flag_message_e | fss_write_print_flag_out_e; + data.program.warning.flag |= fss_write_print_flag_warning_e | fss_write_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; data.setting.state.custom = (void *) &data; data.setting.standard = fss_write_payload_standard_s; diff --git a/level_3/fss_write/data/build/settings b/level_3/fss_write/data/build/settings index 4a5bd26..dad2881 100644 --- a/level_3/fss_write/data/build/settings +++ b/level_3/fss_write/data/build/settings @@ -55,6 +55,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/fss_write/data/build/settings.basic b/level_3/fss_write/data/build/settings.basic index cf1d896..47a3931 100644 --- a/level_3/fss_write/data/build/settings.basic +++ b/level_3/fss_write/data/build/settings.basic @@ -44,6 +44,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/fss_write/data/build/settings.basic_list b/level_3/fss_write/data/build/settings.basic_list index 29991af..3585ebf 100644 --- a/level_3/fss_write/data/build/settings.basic_list +++ b/level_3/fss_write/data/build/settings.basic_list @@ -44,6 +44,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/fss_write/data/build/settings.embedded_list b/level_3/fss_write/data/build/settings.embedded_list index 5097879..70c9b0b 100644 --- a/level_3/fss_write/data/build/settings.embedded_list +++ b/level_3/fss_write/data/build/settings.embedded_list @@ -44,6 +44,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/fss_write/data/build/settings.extended b/level_3/fss_write/data/build/settings.extended index e89b303..d6f46c0 100644 --- a/level_3/fss_write/data/build/settings.extended +++ b/level_3/fss_write/data/build/settings.extended @@ -44,6 +44,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/fss_write/data/build/settings.extended_list b/level_3/fss_write/data/build/settings.extended_list index 7182f37..d294bc3 100644 --- a/level_3/fss_write/data/build/settings.extended_list +++ b/level_3/fss_write/data/build/settings.extended_list @@ -44,6 +44,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/fss_write/data/build/settings.main b/level_3/fss_write/data/build/settings.main index 72d0c10..5fbc167 100644 --- a/level_3/fss_write/data/build/settings.main +++ b/level_3/fss_write/data/build/settings.main @@ -44,6 +44,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/fss_write/data/build/settings.payload b/level_3/fss_write/data/build/settings.payload index 88bd5f6..30ddb33 100644 --- a/level_3/fss_write/data/build/settings.payload +++ b/level_3/fss_write/data/build/settings.payload @@ -44,6 +44,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/iki_read/c/main/common/define.h b/level_3/iki_read/c/main/common/define.h index 124e161..aa8e33e 100644 --- a/level_3/iki_read/c/main/common/define.h +++ b/level_3/iki_read/c/main/common/define.h @@ -19,7 +19,7 @@ extern "C" { /** * The program defines. * - * iki_read_*: + * iki_read_*_d: * - allocation_console: An allocation step used for small buffers specifically for console parameter. * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. diff --git a/level_3/iki_read/c/main/common/enumeration.h b/level_3/iki_read/c/main/common/enumeration.h index 0849e1f..500c932 100644 --- a/level_3/iki_read/c/main/common/enumeration.h +++ b/level_3/iki_read/c/main/common/enumeration.h @@ -97,19 +97,7 @@ extern "C" { #define iki_read_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \ + macro_fll_program_console_parameter_standard_initialize, \ \ macro_f_console_parameter_t_initialize_3(iki_read_short_at_s, iki_read_long_at_s, 1, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize_3(iki_read_short_content_s, iki_read_long_content_s, 0, f_console_flag_normal_e), \ @@ -132,23 +120,24 @@ extern "C" { * Flags for fine-tuned print control. * * iki_read_print_flag_*_e: - * - none: No flags set. - * - debug: Stream is for debug printing. - * - error: Stream is for error printing. - * - message: Stream is for message printing. - * - warning: Stream is for warning printing. - * - file_to: Stream is a destination file. - * - file_from: Stream is a source file. + * - none: No flags set. + * - debug: Stream is for debug printing. + * - error: Stream is for error printing. + * - in: Stream is a source file. + * - message: Stream is for message printing. + * - out: Stream is a destination file. + * - warning: Stream is for warning printing. */ #ifndef _di_iki_read_print_flag_e_ enum { - iki_read_print_flag_none_e = 0x0, - iki_read_print_flag_debug_e = 0x1, - iki_read_print_flag_error_e = 0x2, - iki_read_print_flag_message_e = 0x4, - iki_read_print_flag_warning_e = 0x8, - iki_read_print_flag_file_to_e = 0x10, - iki_read_print_flag_file_from_e = 0x20, + iki_read_print_flag_none_e = 0x0, + iki_read_print_flag_debug_e = 0x1, + iki_read_print_flag_error_e = 0x2, + iki_read_print_flag_file_e = 0x4, + iki_read_print_flag_in_e = 0x8, + iki_read_print_flag_out_e = 0x10, + iki_read_print_flag_message_e = 0x20, + iki_read_print_flag_warning_e = 0x40, }; // enum #endif // _di_iki_read_print_flag_e_ diff --git a/level_3/iki_read/c/main/main.c b/level_3/iki_read/c/main/main.c index 5d628b5..39ab620 100644 --- a/level_3/iki_read/c/main/main.c +++ b/level_3/iki_read/c/main/main.c @@ -4,15 +4,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { iki_read_main_t data = iki_read_main_t_initialize; - data.program.debug.flag |= iki_read_print_flag_debug_e; - data.program.error.flag |= iki_read_print_flag_error_e; - data.program.message.flag |= iki_read_print_flag_message_e; - data.program.warning.flag |= iki_read_print_flag_warning_e; + data.program.debug.flag |= iki_read_print_flag_debug_e | iki_read_print_flag_out_e; + data.program.error.flag |= iki_read_print_flag_error_e | iki_read_print_flag_out_e; + data.program.output.flag |= iki_read_print_flag_out_e; + data.program.message.flag |= iki_read_print_flag_message_e | iki_read_print_flag_out_e; + data.program.warning.flag |= iki_read_print_flag_warning_e | iki_read_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; data.setting.state.custom = (void *) &data; data.setting.state.handle = &fll_program_standard_signal_handle; diff --git a/level_3/iki_read/data/build/settings b/level_3/iki_read/data/build/settings index 1de300f..a10f980 100644 --- a/level_3/iki_read/data/build/settings +++ b/level_3/iki_read/data/build/settings @@ -53,6 +53,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/iki_write/c/main/common/define.h b/level_3/iki_write/c/main/common/define.h index c1bf1f5..143f350 100644 --- a/level_3/iki_write/c/main/common/define.h +++ b/level_3/iki_write/c/main/common/define.h @@ -19,7 +19,7 @@ extern "C" { /** * The program defines. * - * iki_write_*: + * iki_write_*_d: * - allocation_console: An allocation step used for small buffers specifically for console parameter. * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. diff --git a/level_3/iki_write/c/main/common/enumeration.h b/level_3/iki_write/c/main/common/enumeration.h index e1dffba..b2b9788 100644 --- a/level_3/iki_write/c/main/common/enumeration.h +++ b/level_3/iki_write/c/main/common/enumeration.h @@ -77,19 +77,7 @@ extern "C" { #define iki_write_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \ + macro_fll_program_console_parameter_standard_initialize, \ \ macro_f_console_parameter_t_initialize_3(iki_write_short_backtick_s, iki_write_long_backtick_s, 0, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize_3(iki_write_short_content_s, iki_write_long_content_s, 1, f_console_flag_normal_e), \ @@ -107,23 +95,24 @@ extern "C" { * Flags for fine-tuned print control. * * iki_write_print_flag_*_e: - * - none: No flags set. - * - debug: Stream is for debug printing. - * - error: Stream is for error printing. - * - message: Stream is for message printing. - * - warning: Stream is for warning printing. - * - file_to: Stream is a destination file. - * - file_from: Stream is a source file. + * - none: No flags set. + * - debug: Stream is for debug printing. + * - error: Stream is for error printing. + * - in: Stream is a source file. + * - message: Stream is for message printing. + * - out: Stream is a destination file. + * - warning: Stream is for warning printing. */ #ifndef _di_iki_write_print_flag_e_ enum { - iki_write_print_flag_none_e = 0x0, - iki_write_print_flag_debug_e = 0x1, - iki_write_print_flag_error_e = 0x2, - iki_write_print_flag_message_e = 0x4, - iki_write_print_flag_warning_e = 0x8, - iki_write_print_flag_file_to_e = 0x10, - iki_write_print_flag_file_from_e = 0x20, + iki_write_print_flag_none_e = 0x0, + iki_write_print_flag_debug_e = 0x1, + iki_write_print_flag_error_e = 0x2, + iki_write_print_flag_file_e = 0x4, + iki_write_print_flag_in_e = 0x8, + iki_write_print_flag_out_e = 0x10, + iki_write_print_flag_message_e = 0x20, + iki_write_print_flag_warning_e = 0x40, }; // enum #endif // _di_iki_write_print_flag_e_ diff --git a/level_3/iki_write/c/main/main.c b/level_3/iki_write/c/main/main.c index 309567e..9ead595 100644 --- a/level_3/iki_write/c/main/main.c +++ b/level_3/iki_write/c/main/main.c @@ -4,15 +4,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { iki_write_main_t data = iki_write_main_t_initialize; - data.program.debug.flag |= iki_write_print_flag_debug_e; - data.program.error.flag |= iki_write_print_flag_error_e; - data.program.message.flag |= iki_write_print_flag_message_e; - data.program.warning.flag |= iki_write_print_flag_warning_e; + data.program.debug.flag |= iki_write_print_flag_debug_e | iki_write_print_flag_out_e; + data.program.error.flag |= iki_write_print_flag_error_e | iki_write_print_flag_out_e; + data.program.output.flag |= iki_write_print_flag_out_e; + data.program.message.flag |= iki_write_print_flag_message_e | iki_write_print_flag_out_e; + data.program.warning.flag |= iki_write_print_flag_warning_e | iki_write_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; f_console_parameter_t parameters[] = iki_write_console_parameter_t_initialize; data.program.parameters.array = parameters; diff --git a/level_3/iki_write/data/build/settings b/level_3/iki_write/data/build/settings index 6647d94..b8cb892 100644 --- a/level_3/iki_write/data/build/settings +++ b/level_3/iki_write/data/build/settings @@ -52,6 +52,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/status_code/c/fss/main.c b/level_3/status_code/c/fss/main.c index f1768e2..22b1187 100644 --- a/level_3/status_code/c/fss/main.c +++ b/level_3/status_code/c/fss/main.c @@ -6,15 +6,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { status_code_main_t data = status_code_main_t_initialize; - data.program.debug.flag |= status_code_print_flag_debug_e; - data.program.error.flag |= status_code_print_flag_error_e; - data.program.message.flag |= status_code_print_flag_message_e; - data.program.warning.flag |= status_code_print_flag_warning_e; + data.program.debug.flag |= status_code_print_flag_debug_e | status_code_print_flag_out_e; + data.program.error.flag |= status_code_print_flag_error_e | status_code_print_flag_out_e; + data.program.output.flag |= status_code_print_flag_out_e; + data.program.message.flag |= status_code_print_flag_message_e | status_code_print_flag_out_e; + data.program.warning.flag |= status_code_print_flag_warning_e | status_code_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; data.setting.program_name = &status_code_fss_program_name_s; data.setting.program_name_long = &status_code_fss_program_name_long_s; diff --git a/level_3/status_code/c/main/common/define.h b/level_3/status_code/c/main/common/define.h index 573bb10..9909e32 100644 --- a/level_3/status_code/c/main/common/define.h +++ b/level_3/status_code/c/main/common/define.h @@ -19,7 +19,7 @@ extern "C" { /** * The program defines. * - * status_code_*: + * status_code_*_d: * - allocation_console: An allocation step used for small buffers specifically for console parameter. * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. diff --git a/level_3/status_code/c/main/common/enumeration.h b/level_3/status_code/c/main/common/enumeration.h index ecba561..d342b92 100644 --- a/level_3/status_code/c/main/common/enumeration.h +++ b/level_3/status_code/c/main/common/enumeration.h @@ -75,19 +75,7 @@ extern "C" { #define status_code_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \ + macro_fll_program_console_parameter_standard_initialize, \ \ macro_f_console_parameter_t_initialize_3(status_code_short_fine_s, status_code_long_fine_s, 0, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize_3(status_code_short_warning_s, status_code_long_warning_s, 0, f_console_flag_normal_e), \ @@ -102,23 +90,24 @@ extern "C" { * Flags for fine-tuned print control. * * status_code_print_flag_*_e: - * - none: No flags set. - * - debug: Stream is for debug printing. - * - error: Stream is for error printing. - * - message: Stream is for message printing. - * - warning: Stream is for warning printing. - * - file_to: Stream is a destination file. - * - file_from: Stream is a source file. + * - none: No flags set. + * - debug: Stream is for debug printing. + * - error: Stream is for error printing. + * - in: Stream is a source file. + * - message: Stream is for message printing. + * - out: Stream is a destination file. + * - warning: Stream is for warning printing. */ #ifndef _di_status_code_print_flag_e_ enum { - status_code_print_flag_none_e = 0x0, - status_code_print_flag_debug_e = 0x1, - status_code_print_flag_error_e = 0x2, - status_code_print_flag_message_e = 0x4, - status_code_print_flag_warning_e = 0x8, - status_code_print_flag_file_to_e = 0x10, - status_code_print_flag_file_from_e = 0x20, + status_code_print_flag_none_e = 0x0, + status_code_print_flag_debug_e = 0x1, + status_code_print_flag_error_e = 0x2, + status_code_print_flag_file_e = 0x4, + status_code_print_flag_in_e = 0x8, + status_code_print_flag_out_e = 0x10, + status_code_print_flag_message_e = 0x20, + status_code_print_flag_warning_e = 0x40, }; // enum #endif // _di_status_code_print_flag_e_ diff --git a/level_3/status_code/c/main/main.c b/level_3/status_code/c/main/main.c index fcd6b5d..6bfd985 100644 --- a/level_3/status_code/c/main/main.c +++ b/level_3/status_code/c/main/main.c @@ -4,15 +4,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { status_code_main_t data = status_code_main_t_initialize; - data.program.debug.flag |= status_code_print_flag_debug_e; - data.program.error.flag |= status_code_print_flag_error_e; - data.program.message.flag |= status_code_print_flag_message_e; - data.program.warning.flag |= status_code_print_flag_warning_e; + data.program.debug.flag |= status_code_print_flag_debug_e | status_code_print_flag_out_e; + data.program.error.flag |= status_code_print_flag_error_e | status_code_print_flag_out_e; + data.program.output.flag |= status_code_print_flag_out_e; + data.program.message.flag |= status_code_print_flag_message_e | status_code_print_flag_out_e; + data.program.warning.flag |= status_code_print_flag_warning_e | status_code_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; data.setting.program_name = &status_code_program_name_s; data.setting.program_name_long = &status_code_program_name_long_s; diff --git a/level_3/status_code/c/main/status_code.h b/level_3/status_code/c/main/status_code.h index aa6846f..de97c2f 100644 --- a/level_3/status_code/c/main/status_code.h +++ b/level_3/status_code/c/main/status_code.h @@ -70,11 +70,9 @@ extern "C" { * - F_signal_termination * * @param main - * The main program data. - * @param setting - * The main program settings. + * The main program data and settings. * - * This alters setting.state.status: + * This alters main.setting.state.status: * F_none on success. * F_true on success when performing verification and verify passed. * F_false on success when performing verification and verify failed. diff --git a/level_3/status_code/data/build/settings b/level_3/status_code/data/build/settings index c092268..d201d64 100644 --- a/level_3/status_code/data/build/settings +++ b/level_3/status_code/data/build/settings @@ -56,6 +56,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/status_code/data/build/settings.fss b/level_3/status_code/data/build/settings.fss index d8a5ad9..f3c03b7 100644 --- a/level_3/status_code/data/build/settings.fss +++ b/level_3/status_code/data/build/settings.fss @@ -53,6 +53,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/status_code/data/build/settings.main b/level_3/status_code/data/build/settings.main index 2ae2606..9f2682f 100644 --- a/level_3/status_code/data/build/settings.main +++ b/level_3/status_code/data/build/settings.main @@ -53,6 +53,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ diff --git a/level_3/utf8/c/main/common/define.h b/level_3/utf8/c/main/common/define.h index b3a0cdd..dd5b66d 100644 --- a/level_3/utf8/c/main/common/define.h +++ b/level_3/utf8/c/main/common/define.h @@ -26,7 +26,7 @@ extern "C" { /** * The program defines. * - * utf8_*: + * utf8_*_d: * - allocation_console: An allocation step used for small buffers specifically for console parameter. * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. diff --git a/level_3/utf8/c/main/common/enumeration.h b/level_3/utf8/c/main/common/enumeration.h index 44a9123..1bc8b47 100644 --- a/level_3/utf8/c/main/common/enumeration.h +++ b/level_3/utf8/c/main/common/enumeration.h @@ -151,19 +151,7 @@ extern "C" { #define utf8_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \ + macro_fll_program_console_parameter_standard_initialize, \ \ macro_f_console_parameter_t_initialize_3(utf8_short_from_bytesequence_s, utf8_long_from_bytesequence_s, 0, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize_3(utf8_short_from_codepoint_s, utf8_long_from_codepoint_s, 0, f_console_flag_normal_e), \ @@ -186,23 +174,24 @@ extern "C" { * Flags for fine-tuned print control. * * utf8_print_flag_*_e: - * - none: No flags set. - * - debug: Stream is for debug printing. - * - error: Stream is for error printing. - * - message: Stream is for message printing. - * - warning: Stream is for warning printing. - * - file_to: Stream is a destination file. - * - file_from: Stream is a source file. + * - none: No flags set. + * - debug: Stream is for debug printing. + * - error: Stream is for error printing. + * - in: Stream is a source file. + * - message: Stream is for message printing. + * - out: Stream is a destination file. + * - warning: Stream is for warning printing. */ #ifndef _di_utf8_print_flag_e_ enum { - utf8_print_flag_none_e = 0x0, - utf8_print_flag_debug_e = 0x1, - utf8_print_flag_error_e = 0x2, - utf8_print_flag_message_e = 0x4, - utf8_print_flag_warning_e = 0x8, - utf8_print_flag_file_to_e = 0x10, - utf8_print_flag_file_from_e = 0x20, + utf8_print_flag_none_e = 0x0, + utf8_print_flag_debug_e = 0x1, + utf8_print_flag_error_e = 0x2, + utf8_print_flag_file_e = 0x4, + utf8_print_flag_in_e = 0x8, + utf8_print_flag_out_e = 0x10, + utf8_print_flag_message_e = 0x20, + utf8_print_flag_warning_e = 0x40, }; // enum #endif // _di_utf8_print_flag_e_ diff --git a/level_3/utf8/c/main/common/type.h b/level_3/utf8/c/main/common/type.h index 5a41ebd..25abea3 100644 --- a/level_3/utf8/c/main/common/type.h +++ b/level_3/utf8/c/main/common/type.h @@ -17,29 +17,6 @@ extern "C" { #endif /** - * Set to at least 4 to provide a UTF-8 friendly allocation step. - */ -#ifndef _di_utf8_default_d_ - #define utf8_default_allocation_step_d 16 -#endif // _di_utf8_default_d_ - -/** - * The program defines. - * - * utf8_*: - * - allocation_console: An allocation step used for small buffers specifically for console parameter. - * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. - * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. - * - signal_check: Number of iterations before performing signal check in non-threaded signal handling. - */ -#ifndef _di_utf8_d_ - #define utf8_allocation_console_d 4 - #define utf8_allocation_large_d 256 - #define utf8_allocation_small_d 16 - #define utf8_signal_check_d 20000 -#endif // _di_utf8_d_ - -/** * The utf8 main program settings. * * This is passed to the program-specific main entry point to designate program settings. diff --git a/level_3/utf8/c/main/main.c b/level_3/utf8/c/main/main.c index 16bf333..7b616db 100644 --- a/level_3/utf8/c/main/main.c +++ b/level_3/utf8/c/main/main.c @@ -4,15 +4,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { utf8_main_t data = utf8_main_t_initialize; - data.program.debug.flag |= utf8_print_flag_debug_e; - data.program.error.flag |= utf8_print_flag_error_e; - data.program.message.flag |= utf8_print_flag_message_e; - data.program.warning.flag |= utf8_print_flag_warning_e; + data.program.debug.flag |= utf8_print_flag_debug_e | utf8_print_flag_out_e; + data.program.error.flag |= utf8_print_flag_error_e | utf8_print_flag_out_e; + data.program.output.flag |= utf8_print_flag_out_e; + data.program.message.flag |= utf8_print_flag_message_e | utf8_print_flag_out_e; + data.program.warning.flag |= utf8_print_flag_warning_e | utf8_print_flag_out_e; + data.program.error.custom = (void *) &data; + data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; - data.program.error.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.program.debug.custom = (void *) &data; f_console_parameter_t parameters[] = utf8_console_parameter_t_initialize; diff --git a/level_3/utf8/data/build/settings b/level_3/utf8/data/build/settings index 3dfd18b..87672db 100644 --- a/level_3/utf8/data/build/settings +++ b/level_3/utf8/data/build/settings @@ -53,6 +53,7 @@ search_shared yes search_static yes environment PATH LD_LIBRARY_PATH +environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -D_di_thread_support_ defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_