From: Kevin Day Date: Sat, 23 Mar 2024 04:03:57 +0000 (-0500) Subject: Progress: Do some initial clean up and preparations. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=bc923c676fa645918a6141774d1fe6e7f844334e;p=controller Progress: Do some initial clean up and preparations. --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..84c048a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/build/ diff --git a/build/includes/program/controller/main/thread.h b/build/includes/program/controller/main/thread.h index df7fe9e..088e795 100644 --- a/build/includes/program/controller/main/thread.h +++ b/build/includes/program/controller/main/thread.h @@ -33,7 +33,7 @@ * * @see f_thread_cancel_state_set() * - * @see controller_signal_handler() + * @see controller_main_thread_signal() */ #if !defined(_di_controller_main_thread_signal_) && !defined(_di_thread_support_) extern void * controller_main_thread_signal(void * const main); diff --git a/data/build/settings.controller b/data/build/settings.controller index 3431701..6330ad0 100644 --- a/data/build/settings.controller +++ b/data/build/settings.controller @@ -40,7 +40,9 @@ build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_objects_library main/controller.o +build_objects_library main/common.o main/common/define.o main/common/enumeration.o main/common/print.o main/common/string.o main/common/type.o +build_objects_library main/print/data.o main/print/debug.o main/print/error.o main/print/message.o main/print/verbose.o main/print/warning.o +build_objects_library main/signal.o main/thread.o build_sources_library controller/controller.c diff --git a/data/build/settings.init b/data/build/settings.init index 1f30305..ed9ae18 100644 --- a/data/build/settings.init +++ b/data/build/settings.init @@ -40,7 +40,9 @@ build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_objects_library main/controller.o +build_objects_library main/common.o main/common/define.o main/common/enumeration.o main/common/print.o main/common/string.o main/common/type.o +build_objects_library main/print/data.o main/print/debug.o main/print/error.o main/print/message.o main/print/verbose.o main/print/warning.o +build_objects_library main/signal.o main/thread.o build_sources_library init/init.c diff --git a/sources/c/controller/controller.c b/sources/c/controller/controller.c index c421697..a74c3a8 100644 --- a/sources/c/controller/controller.c +++ b/sources/c/controller/controller.c @@ -25,7 +25,7 @@ extern "C" { if (main->setting.flag & controller_main_flag_version_copyright_help_e) { if (main->setting.flag & controller_main_flag_help_e) { - controller_print_message_help(&main->program.message); + controller_main_print_message_help(&main->program.message); } else if (main->setting.flag & controller_main_flag_version_e) { fll_program_print_version(&main->program.message, controller_program_version_s); diff --git a/sources/c/controller/controller.h b/sources/c/controller/controller.h index 85ada23..65b6fa7 100644 --- a/sources/c/controller/controller.h +++ b/sources/c/controller/controller.h @@ -92,8 +92,8 @@ extern "C" { extern void controller_controller_main(controller_main_t * const main); #endif // _di_controller_controller_main_ -#ifdef _controller_controller_h +#ifdef __cplusplus } // extern "C" #endif -#endif // _controller_h +#endif // _controller_controller_h diff --git a/sources/c/controller/main.c b/sources/c/controller/main.c index 4919f92..935616e 100644 --- a/sources/c/controller/main.c +++ b/sources/c/controller/main.c @@ -36,30 +36,30 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { { const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize_1(argc, argv, envp); - controller_setting_load(arguments, &data); + controller_main_setting_load(arguments, &data); } - controller_main(&data); + controller_controller_main(&data); #else { f_thread_id_t id_signal; memset(&id_signal, 0, sizeof(f_thread_id_t)); - data.setting.state.status = f_thread_create(0, &id_signal, &controller_thread_signal, (void *) &data); + data.setting.state.status = f_thread_create(0, &id_signal, &controller_main_thread_signal, (void *) &data); if (F_status_is_error(data.setting.state.status)) { - controller_print_error(&data.program.error, macro_controller_f(f_thread_create)); + controller_main_print_error(&data.program.error, macro_controller_f(f_thread_create)); } else { { const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize_1(argc, argv, envp); - controller_setting_load(arguments, &data); + controller_main_setting_load(arguments, &data); } - if (!controller_signal_check(&data)) { - controller_main(&data); + if (!controller_main_signal_check(&data)) { + controller_controller_main(&data); } f_thread_cancel(id_signal); diff --git a/sources/c/init/init.c b/sources/c/init/init.c index 9c5f4c3..7a62eee 100644 --- a/sources/c/init/init.c +++ b/sources/c/init/init.c @@ -5,36 +5,36 @@ extern "C" { #endif #ifndef _di_controller_init_main_ - void controller_init_main(controller_init_main_t * const main) { + void controller_init_main(controller_main_t * const main) { if (!main) return; if (F_status_is_error(main->setting.state.status)) { - if ((main->setting.flag & controller_init_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) { + if ((main->setting.flag & controller_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } return; } - if ((main->setting.flag & controller_init_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { + if ((main->setting.flag & controller_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } main->setting.state.status = F_okay; - if (main->setting.flag & controller_init_main_flag_version_copyright_help_e) { - if (main->setting.flag & controller_init_main_flag_help_e) { - controller_print_message_help(&main->program.message); + if (main->setting.flag & controller_main_flag_version_copyright_help_e) { + if (main->setting.flag & controller_main_flag_help_e) { + controller_main_print_message_help(&main->program.message); } - else if (main->setting.flag & controller_init_main_flag_version_e) { + else if (main->setting.flag & controller_main_flag_version_e) { fll_program_print_version(&main->program.message, controller_program_version_s); } - else if (main->setting.flag & controller_init_main_flag_copyright_e) { + else if (main->setting.flag & controller_main_flag_copyright_e) { fll_program_print_copyright(&main->program.message); } - if ((main->setting.flag & controller_init_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) { + if ((main->setting.flag & controller_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } @@ -45,7 +45,7 @@ extern "C" { fll_program_print_signal_received(&main->program.warning, main->program.signal_received); } - if ((main->setting.flag & controller_init_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) { + if ((main->setting.flag & controller_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } } diff --git a/sources/c/init/init.h b/sources/c/init/init.h index 2517a77..aa55eca 100644 --- a/sources/c/init/init.h +++ b/sources/c/init/init.h @@ -89,7 +89,7 @@ extern "C" { * F_parameter (with error bit) if main is NULL or setting is NULL. */ #ifndef _di_controller_init_main_ - extern void controller_init_main(controller_init_main_t * const main); + extern void controller_init_main(controller_main_t * const main); #endif // _di_controller_init_main_ #ifdef __cplusplus diff --git a/sources/c/init/main.c b/sources/c/init/main.c index 85b214b..5c5003a 100644 --- a/sources/c/init/main.c +++ b/sources/c/init/main.c @@ -36,30 +36,30 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { { const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize_1(argc, argv, envp); - controller_setting_load(arguments, &data); + controller_main_setting_load(arguments, &data); } - controller_main(&data); + controller_init_main(&data); #else { f_thread_id_t id_signal; memset(&id_signal, 0, sizeof(f_thread_id_t)); - data.setting.state.status = f_thread_create(0, &id_signal, &controller_thread_signal, (void *) &data); + data.setting.state.status = f_thread_create(0, &id_signal, &controller_main_thread_signal, (void *) &data); if (F_status_is_error(data.setting.state.status)) { - controller_print_error(&data.program.error, macro_controller_f(f_thread_create)); + controller_main_print_error(&data.program.error, macro_controller_f(f_thread_create)); } else { { const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize_1(argc, argv, envp); - controller_setting_load(arguments, &data); + controller_main_setting_load(arguments, &data); } - if (!controller_signal_check(&data)) { - controller_main(&data); + if (!controller_main_signal_check(&data)) { + controller_init_main(&data); } f_thread_cancel(id_signal); diff --git a/sources/c/main/common.c b/sources/c/main/common.c index 1f0fa66..8c1f8a3 100644 --- a/sources/c/main/common.c +++ b/sources/c/main/common.c @@ -34,7 +34,7 @@ extern "C" { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - controller_print_error(&main->program.error, macro_controller_f(f_console_parameter_process)); + controller_main_print_error(&main->program.error, macro_controller_f(f_console_parameter_process)); return; } @@ -46,7 +46,7 @@ extern "C" { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - controller_print_error(&main->program.error, macro_controller_f(fll_program_parameter_process_context_standard)); + controller_main_print_error(&main->program.error, macro_controller_f(fll_program_parameter_process_context_standard)); return; } @@ -58,7 +58,7 @@ extern "C" { fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); } - controller_print_error(&main->program.error, macro_controller_f(fll_program_parameter_process_verbosity_standard)); + controller_main_print_error(&main->program.error, macro_controller_f(fll_program_parameter_process_verbosity_standard)); return; } diff --git a/sources/c/main/signal.c b/sources/c/main/signal.c index 00bdd7a..1ecafde 100644 --- a/sources/c/main/signal.c +++ b/sources/c/main/signal.c @@ -78,7 +78,7 @@ extern "C" { main->setting.status_signal = f_signal_wait(&main->program.signal.set, &information); if (F_status_is_error(main->setting.status_signal) && F_status_set_fine(main->setting.status_signal) != F_interrupt) { - if (++failsafe >= controller_main_signal_check_failsafe_d) break; + if (++failsafe >= controller_signal_check_failsafe_d) break; } switch (information.si_signo) { diff --git a/sources/c/main/thread.c b/sources/c/main/thread.c index 0564d20..12af9a7 100644 --- a/sources/c/main/thread.c +++ b/sources/c/main/thread.c @@ -10,7 +10,7 @@ extern "C" { f_thread_cancel_state_set(PTHREAD_CANCEL_DEFERRED, 0); if (main) { - controller_signal_handler((controller_main_t *) main); + controller_main_thread_signal((controller_main_t *) main); } return 0; diff --git a/sources/c/main/thread.h b/sources/c/main/thread.h index df7fe9e..088e795 100644 --- a/sources/c/main/thread.h +++ b/sources/c/main/thread.h @@ -33,7 +33,7 @@ * * @see f_thread_cancel_state_set() * - * @see controller_signal_handler() + * @see controller_main_thread_signal() */ #if !defined(_di_controller_main_thread_signal_) && !defined(_di_thread_support_) extern void * controller_main_thread_signal(void * const main);