From: Kevin Day Date: Tue, 16 Jul 2024 01:43:33 +0000 (-0500) Subject: Update: Finish migrating the project. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=cf922552770a93b355a12299ea6053e2a9e55a3e;p=controller Update: Finish migrating the project. The project appears to work as far as basic testing and code reviewing goes. I imagine that once I put this to regular use I will fine additional problems. Commits after this point will be normal commits rather than migration progress commits. --- diff --git a/data/build/settings b/data/build/settings index b5c1f44..1c2296f 100644 --- a/data/build/settings +++ b/data/build/settings @@ -48,7 +48,6 @@ build_sources_library entry.c entry/action.c entry/preprocess.c entry/process.c build_sources_library file.c lock.c path.c process.c build_sources_library rule.c rule/action.c rule/execute.c rule/expand.c rule/instance.c rule/is.c rule/item.c rule/parameter.c rule/read.c rule/setting.c rule/wait.c build_sources_library perform.c -build_sources_library print/data.c build_sources_library print/debug.c print/debug/rule/action.c print/debug/rule/execute.c print/debug/rule/instance.c print/debug/perform/control.c print/debug/perform/pid.c build_sources_library print/error.c build_sources_library print/error/entry.c print/error/entry/action.c print/error/entry/item.c print/error/entry/setting.c @@ -57,8 +56,7 @@ build_sources_library print/error/rule.c print/error/rule/action.c print/error/r build_sources_library print/lock.c print/error/lock.c build_sources_library print/output/entry/setting.c print/output/rule/execute.c print/output/rule/setting.c print/output/rule/validate.c build_sources_library print/message.c print/message/entry.c print/message/entry/action.c print/message/entry/item.c -build_sources_library print/verbose.c -build_sources_library print/warning.c print/warning/entry/action.c print/warning/entry/item.c print/warning/entry/setting.c print/warning/rule/action.c print/warning/rule/item.c print/warning/rule/setting.c +build_sources_library print/warning/entry/action.c print/warning/entry/item.c print/warning/entry/setting.c print/warning/rule/action.c print/warning/rule/item.c print/warning/rule/setting.c build_sources_library signal.c status.c time.c build_sources_library thread.c thread/cleanup.c thread/control.c thread/entry.c thread/instance.c thread/is.c thread/rule.c thread/signal.c build_sources_library validate.c @@ -73,7 +71,6 @@ build_sources_headers entry.h entry/action.h entry/preprocess.h entry/process.h build_sources_headers file.h lock.h path.h process.h build_sources_headers rule.h rule/action.h rule/execute.h rule/expand.h rule/instance.h rule/is.h rule/item.h rule/parameter.h rule/read.h rule/setting.h rule/wait.h build_sources_headers perform.h -build_sources_headers print/data.h build_sources_headers print/debug.h print/debug/rule/action.h print/debug/rule/execute.h print/debug/rule/instance.h print/debug/perform/control.h print/debug/perform/pid.h build_sources_headers print/error.h build_sources_headers print/error/entry.h print/error/entry/action.h print/error/entry/item.h print/error/entry/setting.h @@ -82,8 +79,7 @@ build_sources_headers print/error/rule.h print/error/rule/action.h print/error/r build_sources_headers print/lock.h print/error/lock.h build_sources_headers print/output/entry/setting.h print/output/rule/execute.h print/output/rule/setting.h print/output/rule/validate.h build_sources_headers print/message.h print/message/entry.h print/message/entry/action.h print/message/entry/item.h -build_sources_headers print/verbose.h -build_sources_headers print/warning.h print/warning/entry/action.h print/warning/entry/item.h print/warning/entry/setting.h print/warning/rule/action.h print/warning/rule/item.h print/warning/rule/setting.h +build_sources_headers print/warning/entry/action.h print/warning/entry/item.h print/warning/entry/setting.h print/warning/rule/action.h print/warning/rule/item.h print/warning/rule/setting.h build_sources_headers signal.h status.h time.h build_sources_headers thread.h thread/cleanup.h thread/control.h thread/entry.h thread/instance.h thread/is.h thread/rule.h thread/signal.h build_sources_headers validate.h diff --git a/data/data/controller/example/miscellaneous/rules/delay/long.rule b/data/data/controller/example/miscellaneous/rules/delay/long.rule index 19ebc2a..7e77bb7 100644 --- a/data/data/controller/example/miscellaneous/rules/delay/long.rule +++ b/data/data/controller/example/miscellaneous/rules/delay/long.rule @@ -4,7 +4,7 @@ # settings: - name "Delay for 3 minutes." + name "Delay for 10 seconds." script: - start sleep 3m + start sleep 10s diff --git a/data/data/controller/example/miscellaneous/rules/environment/fake-nothing.rule b/data/data/controller/example/miscellaneous/rules/environment/fake-nothing.rule index b0e596a..cfdfb9c 100644 --- a/data/data/controller/example/miscellaneous/rules/environment/fake-nothing.rule +++ b/data/data/controller/example/miscellaneous/rules/environment/fake-nothing.rule @@ -4,8 +4,9 @@ settings: name "Environment using fake as an engine" engine fake ++quiet + # LD_LIBRARY_PATH might be required in certain circumstances. # PATH must be expoted so that "run env" works. - environment PATH + environment LD_LIBRARY_PATH PATH script: start { diff --git a/data/data/controller/example/miscellaneous/rules/environment/fake-something.rule b/data/data/controller/example/miscellaneous/rules/environment/fake-something.rule index bfe6851..77c22f1 100644 --- a/data/data/controller/example/miscellaneous/rules/environment/fake-something.rule +++ b/data/data/controller/example/miscellaneous/rules/environment/fake-something.rule @@ -4,7 +4,7 @@ settings: name "Environment using fake as an engine" engine fake ++quiet - environment PATH PWD + environment LD_LIBRARY_PATH PATH PWD script: start { diff --git a/sources/c/main/common.c b/sources/c/main/common.c index 907efdd..d1c2f1e 100644 --- a/sources/c/main/common.c +++ b/sources/c/main/common.c @@ -208,7 +208,7 @@ extern "C" { }; for (index = 0; index < 3; ++index) { - if (main->program.parameters.array[codes[index]].result & f_console_result_value_e) main->setting.flag |= flags[index]; + if (main->program.parameters.array[codes[index]].result & f_console_result_found_e) main->setting.flag |= flags[index]; } // for } diff --git a/sources/c/main/common/type/rule.c b/sources/c/main/common/type/rule.c index 81388b9..2f3bf65 100644 --- a/sources/c/main/common/type/rule.c +++ b/sources/c/main/common/type/rule.c @@ -41,8 +41,7 @@ extern "C" { if (!action) return; f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &action->parameters.array, &action->parameters.used, &action->parameters.size, &f_string_dynamics_delete_callback); - - f_memory_array_resize(0, sizeof(f_iki_data_t), (void **) &action->ikis.array, &action->ikis.used, &action->ikis.size); + f_memory_arrays_resize(0, sizeof(f_iki_data_t), (void **) &action->ikis.array, &action->ikis.used, &action->ikis.size, &f_iki_datas_delete_callback); } #endif // _di_controller_rule_action_delete_ diff --git a/sources/c/main/controller.h b/sources/c/main/controller.h index 848db82..4023b00 100644 --- a/sources/c/main/controller.h +++ b/sources/c/main/controller.h @@ -110,7 +110,6 @@ #include #include #include -#include #include #include #include @@ -138,8 +137,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/sources/c/main/entry/process.c b/sources/c/main/entry/process.c index 4bd84de..c0ef3ae 100644 --- a/sources/c/main/entry/process.c +++ b/sources/c/main/entry/process.c @@ -298,9 +298,7 @@ extern "C" { if (!(main->setting.flag & controller_main_flag_simulate_e)) { f_thread_unlock(&main->thread.lock.rule); - if (entry_action->code & controller_entry_rule_code_require_d) { - return F_status_set_error(F_require); - } + if (entry_action->code & controller_entry_rule_code_require_d) return F_status_set_error(F_require); ++cache->ats.array[at_j]; @@ -475,7 +473,7 @@ extern "C" { if (status_wait == F_require) return F_status_set_error(F_require); } - if ((main->setting.flag & controller_main_flag_simulate_e && main->program.error.verbosity > f_console_verbosity_error_e) || main->program.error.verbosity > f_console_verbosity_normal_e) { + if (((main->setting.flag & controller_main_flag_simulate_e) && main->program.error.verbosity > f_console_verbosity_error_e) || main->program.error.verbosity > f_console_verbosity_normal_e) { controller_print_message_entry_item_done(&main->program.message, is_entry, failsafe, controller_main_s); } diff --git a/sources/c/main/print/data.c b/sources/c/main/print/data.c deleted file mode 100644 index 61f0547..0000000 --- a/sources/c/main/print/data.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "../controller.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/sources/c/main/print/data.h b/sources/c/main/print/data.h deleted file mode 100644 index 17ef811..0000000 --- a/sources/c/main/print/data.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the print data functionality. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_print_data_h -#define _controller_main_print_data_h - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_print_data_h diff --git a/sources/c/main/print/verbose.c b/sources/c/main/print/verbose.c deleted file mode 100644 index 61f0547..0000000 --- a/sources/c/main/print/verbose.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "../controller.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/sources/c/main/print/verbose.h b/sources/c/main/print/verbose.h deleted file mode 100644 index 0cab65e..0000000 --- a/sources/c/main/print/verbose.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the print verbose functionality. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_print_verbose_h -#define _controller_main_print_verbose_h - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_print_verbose_h diff --git a/sources/c/main/print/warning.c b/sources/c/main/print/warning.c deleted file mode 100644 index 61f0547..0000000 --- a/sources/c/main/print/warning.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "../controller.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/sources/c/main/print/warning.h b/sources/c/main/print/warning.h deleted file mode 100644 index 654e77f..0000000 --- a/sources/c/main/print/warning.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the print warning functionality. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_print_warning_h -#define _controller_main_print_warning_h - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_print_warning_h diff --git a/sources/c/main/rule/parameter.c b/sources/c/main/rule/parameter.c index 925d1e4..5df6afc 100644 --- a/sources/c/main/rule/parameter.c +++ b/sources/c/main/rule/parameter.c @@ -28,7 +28,7 @@ extern "C" { if (F_status_is_error_not(state->status)) { state->status = content - ? f_memory_array_increase_by(content->used + 1, sizeof(f_iki_data_t), (void **) &action->ikis.array, &action->ikis.used, &action->ikis.size); + ? f_memory_array_increase_by(content->used + 1, sizeof(f_iki_data_t), (void **) &action->ikis.array, &action->ikis.used, &action->ikis.size) : f_memory_array_increase(controller_allocation_small_d, sizeof(f_iki_data_t), (void **) &action->ikis.array, &action->ikis.used, &action->ikis.size); }