From: Kevin Day Date: Wed, 28 Jun 2023 03:12:12 +0000 (-0500) Subject: Progress: Miscellaneous improvements to the Remove program. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=b05d02ab80a492cecddb7957f9407e69d28a8762;p=kevux-tools Progress: Miscellaneous improvements to the Remove program. Update the build settings file to be more in line with the FLL program build settings files. Update the structure where I noticed it has become out of synchronization with the FLL programs structure. Fix minor mistakes such as "utf8" is present in the file when it should instead be "remove". --- diff --git a/data/build/remove/settings b/data/build/remove/settings index 83fd3d2..49f5db6 100644 --- a/data/build/remove/settings +++ b/data/build/remove/settings @@ -22,7 +22,7 @@ version_micro 0 version_file micro version_target minor -modes individual individual level monolithic clang test fanalyzer coverage thread threadless +modes individual individual_thread level monolithic clang test fanalyzer thread threadless modes_default monolithic thread build_compiler gcc @@ -32,7 +32,8 @@ build_indexer_arguments rcs build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_conversion -fl_directory -lfl_print -lf_account -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_file -lf_memory -lf_pipe -lf_print -lf_rip -lf_signal -lf_string -lf_thread -lf_type_array -lf_utf +build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_conversion -fl_directory -lfl_print -lf_account -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_file -lf_memory -lf_pipe -lf_print -lf_rip -lf_signal -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll diff --git a/sources/c/remove/main/common.c b/sources/c/remove/main/common.c index ff21ee8..dca8aec 100644 --- a/sources/c/remove/main/common.c +++ b/sources/c/remove/main/common.c @@ -44,28 +44,6 @@ extern "C" { } #endif // _di_kt_remove_modes_resize_ -#ifndef _di_kt_remove_setting_delete_ - f_status_t kt_remove_setting_delete(kt_remove_setting_t * const setting) { - - if (!setting) return F_status_set_error(F_parameter); - - f_string_dynamic_resize(0, &setting->buffer); - f_string_dynamics_resize(0, &setting->files); - - kt_remove_dates_resize(0, &setting->accessed); - kt_remove_dates_resize(0, &setting->changed); - kt_remove_dates_resize(0, &setting->updated); - kt_remove_modes_resize(0, &setting->modes); - - f_uint32s_resize(0, &setting->groups); - f_uint32s_resize(0, &setting->users); - - f_directory_recurse_do_delete(&setting->recurse); - - return F_none; - } -#endif // _di_kt_remove_setting_delete_ - #ifndef _di_kt_remove_setting_load_ void kt_remove_setting_load(const f_console_arguments_t arguments, kt_remove_main_t * const main) { @@ -162,14 +140,23 @@ extern "C" { if (main->program.parameters.array[kt_remove_parameter_help_e].result & f_console_result_found_e) { main->setting.flag |= kt_remove_main_flag_help_e; } + else { + main->setting.flag -= main->setting.flag & kt_remove_main_flag_help_e; + } if (main->program.parameters.array[kt_remove_parameter_version_e].result & f_console_result_found_e) { main->setting.flag |= kt_remove_main_flag_version_e; } + else { + main->setting.flag -= main->setting.flag & kt_remove_main_flag_version_e; + } if (main->program.parameters.array[kt_remove_parameter_copyright_e].result & f_console_result_found_e) { main->setting.flag |= kt_remove_main_flag_copyright_e; } + else { + main->setting.flag -= main->setting.flag & kt_remove_main_flag_copyright_e; + } if (main->program.parameters.array[kt_remove_parameter_block_e].result & f_console_result_found_e) { main->setting.flag |= kt_remove_main_flag_block_e; @@ -884,17 +871,6 @@ extern "C" { } #endif // _di_kt_remove_setting_load_ -#ifndef _di_kt_remove_setting_unload_ - f_status_t kt_remove_setting_unload(kt_remove_main_t * const main) { - - if (!main) return F_status_set_error(F_parameter); - - kt_remove_setting_delete(&main->setting); - - return F_none; - } -#endif // _di_kt_remove_setting_unload_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/sources/c/remove/main/common.h b/sources/c/remove/main/common.h index 8ed0341..252367f 100644 --- a/sources/c/remove/main/common.h +++ b/sources/c/remove/main/common.h @@ -57,23 +57,6 @@ extern "C" { #endif // _di_kt_remove_modes_resize_ /** - * Delete the program main setting data. - * - * @param setting - * The program main setting data. - * - * This does not alter main.setting.state.status. - * - * @return - * F_none on success. - * - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_kt_remove_setting_delete_ - extern f_status_t kt_remove_setting_delete(kt_remove_setting_t * const setting); -#endif // _di_kt_remove_setting_delete_ - -/** * Perform the standard program setting load process. * * This prints error messages as appropriate. @@ -105,29 +88,6 @@ extern "C" { extern void kt_remove_setting_load(const f_console_arguments_t arguments, kt_remove_main_t * const main); #endif // _di_kt_remove_setting_load_ -/** - * Perform the standard program setting unload process. - * - * @param main - * The main program and settings data. - * - * All buffers are deallocated. - * - * This does not alter setting.status. - * - * @return - * F_none on success. - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: kt_remove_setting_delete(). - * - * @see kt_remove_setting_delete() - */ -#ifndef _di_kt_remove_setting_unload_ - extern f_status_t kt_remove_setting_unload(kt_remove_main_t * const main); -#endif // _di_kt_remove_setting_unload_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/sources/c/remove/main/common/string.h b/sources/c/remove/main/common/string.h index 5638072..afaf3ee 100644 --- a/sources/c/remove/main/common/string.h +++ b/sources/c/remove/main/common/string.h @@ -67,7 +67,7 @@ extern "C" { #define KT_REMOVE_program_help_parameters_s_length 7 extern const f_string_static_t kt_remove_program_help_parameters_s; -#endif // _di_utf8_program_help_parameters_s_ +#endif // kt_remove_program_help_parameters_s_ /** * Additional strings used for various purposes. diff --git a/sources/c/remove/main/common/type.c b/sources/c/remove/main/common/type.c index 7a21078..51ec0eb 100644 --- a/sources/c/remove/main/common/type.c +++ b/sources/c/remove/main/common/type.c @@ -4,6 +4,38 @@ extern "C" { #endif +#ifndef _di_kt_remove_main_delete_ + void kt_remove_main_delete(kt_remove_main_t * const main) { + + if (!main) return; + + fll_program_data_delete(&main->program); + kt_remove_setting_delete(&main->setting); + } +#endif // _di_kt_remove_main_delete_ + +#ifndef _di_kt_remove_setting_delete_ + f_status_t kt_remove_setting_delete(kt_remove_setting_t * const setting) { + + if (!setting) return F_status_set_error(F_parameter); + + f_string_dynamic_resize(0, &setting->buffer); + f_string_dynamics_resize(0, &setting->files); + + kt_remove_dates_resize(0, &setting->accessed); + kt_remove_dates_resize(0, &setting->changed); + kt_remove_dates_resize(0, &setting->updated); + kt_remove_modes_resize(0, &setting->modes); + + f_uint32s_resize(0, &setting->groups); + f_uint32s_resize(0, &setting->users); + + f_directory_recurse_do_delete(&setting->recurse); + + return F_none; + } +#endif // _di_kt_remove_setting_delete_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/sources/c/remove/main/common/type.h b/sources/c/remove/main/common/type.h index b674921..25f17d9 100644 --- a/sources/c/remove/main/common/type.h +++ b/sources/c/remove/main/common/type.h @@ -224,6 +224,35 @@ extern "C" { } #endif // _di_kt_remove_main_t_ +/** + * Deallocate main program data. + * + * @param setting_make + * The make setting data. + * + * This does not alter main.setting.state.status. + */ +#ifndef _di_kt_remove_main_delete_ + extern void kt_remove_main_delete(kt_remove_main_t * const main); +#endif // _di_kt_remove_main_delete_ + +/** + * Delete the program main setting data. + * + * @param setting + * The program main setting data. + * + * This does not alter setting.state.status. + * + * @return + * F_none on success. + * + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_kt_remove_setting_delete_ + extern f_status_t kt_remove_setting_delete(kt_remove_setting_t * const setting); +#endif // _di_kt_remove_setting_delete_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/sources/c/remove/main/main.c b/sources/c/remove/main/main.c index 6c9d8be..896126e 100644 --- a/sources/c/remove/main/main.c +++ b/sources/c/remove/main/main.c @@ -81,9 +81,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { } #endif // _di_thread_support_ - kt_remove_setting_unload(&data); - - fll_program_data_delete(&data.program); + kt_remove_main_delete(&data); fll_program_standard_set_down(&data.program); diff --git a/sources/c/remove/main/print/message.c b/sources/c/remove/main/print/message.c index 77cd70e..3161cdd 100644 --- a/sources/c/remove/main/print/message.c +++ b/sources/c/remove/main/print/message.c @@ -65,7 +65,7 @@ extern "C" { kt_remove_program_help_parameters_s ); - fl_print_format(" The parameters '%[%r%r%]', ", print->to, context.set.notable, f_console_symbol_long_normal_s, kt_remove_long_accessed_s, context.set.notable); + fl_print_format("%r The parameters '%[%r%r%]', ", print->to, f_string_eol_s, context.set.notable, f_console_symbol_long_normal_s, kt_remove_long_accessed_s, context.set.notable); fl_print_format("'%[%r%r%]', ", print->to, context.set.notable, f_console_symbol_long_normal_s, kt_remove_long_changed_s, context.set.notable); fl_print_format("'%[%r%r%]', ", print->to, context.set.notable, f_console_symbol_long_normal_s, kt_remove_long_group_s, context.set.notable); fl_print_format("'%[%r%r%]', ", print->to, context.set.notable, f_console_symbol_long_normal_s, kt_remove_long_mode_s, context.set.notable);