]> Kevux Git Server - controller/commitdiff
Progress: Do some initial clean up and preparations.
authorKevin Day <kevin@kevux.org>
Sat, 23 Mar 2024 04:03:57 +0000 (23:03 -0500)
committerKevin Day <kevin@kevux.org>
Sat, 23 Mar 2024 04:03:57 +0000 (23:03 -0500)
14 files changed:
.gitignore [new file with mode: 0644]
build/includes/program/controller/main/thread.h
data/build/settings.controller
data/build/settings.init
sources/c/controller/controller.c
sources/c/controller/controller.h
sources/c/controller/main.c
sources/c/init/init.c
sources/c/init/init.h
sources/c/init/main.c
sources/c/main/common.c
sources/c/main/signal.c
sources/c/main/thread.c
sources/c/main/thread.h

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..84c048a
--- /dev/null
@@ -0,0 +1 @@
+/build/
index df7fe9e33a1b7adb3761c5e572db16f16c36f6a2..088e795731970572601582d5531fd0c1fedf59ae 100644 (file)
@@ -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);
index 3431701504c446fac475693d0ab3e0ea28211921..6330ad06b82a9757e3997393bed01b1d03628dc5 100644 (file)
@@ -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
 
index 1f30305e8c0bc3906cd7cc6dd7a68c1be89b0e4e..ed9ae18265d9a3e729ecceea524728141037114a 100644 (file)
@@ -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
 
index c421697f1de9edf7e5cf59d1a1aefa5c45edde22..a74c3a894ea1d0086b25985375043c5814da0bce 100644 (file)
@@ -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);
index 85ada23365148b046f3dc6e6c01c818a30ea95cc..65b6fa72b40266fc3512050b50c22b3f8af590ea 100644 (file)
@@ -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
index 4919f9264242205e7b1c7c8aa1b3f69bbf8b856a..935616e811f434976fa41b0140933018a528d600 100644 (file)
@@ -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);
index 9c5f4c33d520efff4d1f7042a78224f8c86ec1cb..7a62eeeb07accfdd58ab91118948e9bf816dbe43 100644 (file)
@@ -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);
     }
   }
index 2517a771712751f86d4a55a057090905b5fd2546..aa55ecac0ae37aaa0aecf06262d11711bf18e533 100644 (file)
@@ -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
index 85b214bfd77454b545b4bb5ee421006b83dae148..5c5003a054cbbf33461666811f24d0f55612a211 100644 (file)
@@ -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);
index 1f0fa6679d0d66585d9aeb5b44beeaf8c2519fd4..8c1f8a369fc0366fe75674b524097db6c4f65a49 100644 (file)
@@ -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;
     }
index 00bdd7ad9a2f6f0314b4b31694cb7e3e6038e019..1ecafde06cdf92e7e763c9e71489b0b09cd3c71c 100644 (file)
@@ -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) {
index 0564d20e5c6ca4e8a7d4fd9c766e14c698062084..12af9a7f709dee91db33daf5958343017451bc0b 100644 (file)
@@ -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;
index df7fe9e33a1b7adb3761c5e572db16f16c36f6a2..088e795731970572601582d5531fd0c1fedf59ae 100644 (file)
@@ -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);