From e421af1c662f90a1e2be3bc91781a463a2bbb6fb Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 26 Jul 2023 22:44:21 -0500 Subject: [PATCH] Update: Remove unused fl_signal and fl_signal_state_interrupt. The fl_signal_state_interrupt() function is not used and is replaced by fll_program_standard_signal_received(). The entire fl_signal can be and is removed. --- build/disable/level_1/fl_signal.h | 2 - build/level_1/settings | 2 - build/monolithic/settings | 2 - build/scripts/bootstrap-example.sh | 2 +- build/scripts/test.sh | 2 +- level_1/fl_signal/c/signal.c | 52 ---------------------- level_1/fl_signal/c/signal.h | 68 ----------------------------- level_1/fl_signal/c/signal/common.h | 49 --------------------- level_1/fl_signal/data/build/defines | 2 - level_1/fl_signal/data/build/dependencies | 5 --- level_1/fl_signal/data/build/fakefile | 12 ------ level_1/fl_signal/data/build/settings | 71 ------------------------------- level_3/iki_read/data/build/dependencies | 1 - level_3/iki_read/data/build/settings | 2 +- 14 files changed, 3 insertions(+), 269 deletions(-) delete mode 100644 build/disable/level_1/fl_signal.h delete mode 100644 level_1/fl_signal/c/signal.c delete mode 100644 level_1/fl_signal/c/signal.h delete mode 100644 level_1/fl_signal/c/signal/common.h delete mode 100644 level_1/fl_signal/data/build/defines delete mode 100644 level_1/fl_signal/data/build/dependencies delete mode 100644 level_1/fl_signal/data/build/fakefile delete mode 100644 level_1/fl_signal/data/build/settings diff --git a/build/disable/level_1/fl_signal.h b/build/disable/level_1/fl_signal.h deleted file mode 100644 index e045811..0000000 --- a/build/disable/level_1/fl_signal.h +++ /dev/null @@ -1,2 +0,0 @@ -#define _di_fl_signal_interrupt_t_ -#define _di_fl_signal_state_interrupt_ diff --git a/build/level_1/settings b/build/level_1/settings index 3cb05e1..924c12e 100644 --- a/build/level_1/settings +++ b/build/level_1/settings @@ -42,7 +42,6 @@ build_sources_library private-fss.c fss/basic.c fss/basic_list.c fss/embedded_li build_sources_library iki.c build_sources_library path.c build_sources_library print.c private-print.c print/common.c -build_sources_library signal.c build_sources_library status_string.c build_sources_library utf_file.c private-utf_file.c @@ -55,7 +54,6 @@ build_sources_headers fss.h fss/basic.h fss/basic_list.h fss/embedded_list.h fss build_sources_headers iki.h build_sources_headers path.h build_sources_headers print.h print/common.h -build_sources_headers signal.h signal/common.h build_sources_headers status_string.h build_sources_headers utf_file.h diff --git a/build/monolithic/settings b/build/monolithic/settings index ae95a17..6a50e28 100644 --- a/build/monolithic/settings +++ b/build/monolithic/settings @@ -99,7 +99,6 @@ build_sources_library level_1/private-fss.c level_1/fss/basic.c level_1/fss/basi build_sources_library level_1/iki.c build_sources_library level_1/path.c build_sources_library level_1/print.c level_1/private-print.c level_1/print/common.c -build_sources_library level_1/signal.c build_sources_library level_1/status_string.c build_sources_library level_1/utf_file.c level_1/private-utf_file.c @@ -163,7 +162,6 @@ build_sources_headers level_1/fss.h level_1/fss/basic.h level_1/fss/basic_list.h build_sources_headers level_1/iki.h build_sources_headers level_1/path.h build_sources_headers level_1/print.h level_1/print/common.h -build_sources_headers level_1/signal.h level_1/signal/common.h build_sources_headers level_1/status_string.h build_sources_headers level_1/utf_file.h diff --git a/build/scripts/bootstrap-example.sh b/build/scripts/bootstrap-example.sh index 7398f55..a09f7e6 100644 --- a/build/scripts/bootstrap-example.sh +++ b/build/scripts/bootstrap-example.sh @@ -130,7 +130,7 @@ if [[ ${1} == "individual" ]] ; then ${shell_command} build/scripts/package.sh ${verbose} ${color} rebuild -i if [[ ${?} -eq 0 ]] ; then - for i in f_type f_status f_memory f_type_array f_string f_utf f_account f_capability f_color f_compare f_console f_control_group f_conversion f_directory f_environment f_execute f_file f_fss f_iki f_limit f_network f_parse f_path f_pipe f_print f_rip f_status_string f_serialize f_signal f_socket f_thread fl_control_group fl_conversion fl_directory fl_environment fl_execute fl_fss fl_iki fl_path fl_print fl_signal fl_status_string fl_utf_file fll_control_group fll_error fll_execute fll_file fll_fss fll_fss_status_string fll_iki fll_print fll_program ; do + for i in f_type f_status f_memory f_type_array f_string f_utf f_account f_capability f_color f_compare f_console f_control_group f_conversion f_directory f_environment f_execute f_file f_fss f_iki f_limit f_network f_parse f_path f_pipe f_print f_rip f_status_string f_serialize f_signal f_socket f_thread fl_control_group fl_conversion fl_directory fl_environment fl_execute fl_fss fl_iki fl_path fl_print fl_status_string fl_utf_file fll_control_group fll_error fll_execute fll_file fll_fss fll_fss_status_string fll_iki fll_print fll_program ; do echo && echo "Processing ${i}." && cd package/individual/${i}-${version}/ && diff --git a/build/scripts/test.sh b/build/scripts/test.sh index 2d20b75..870078d 100644 --- a/build/scripts/test.sh +++ b/build/scripts/test.sh @@ -71,7 +71,7 @@ test_main() { local verbose= local verbose_common= - local projects="f_type f_status f_memory f_type_array f_string f_utf f_account f_capability f_color f_compare f_console f_control_group f_conversion f_directory f_environment f_execute f_file f_fss f_iki f_limit f_network f_parse f_path f_pipe f_print f_rip f_serialize f_signal f_socket f_status_string f_thread fl_control_group fl_conversion fl_directory fl_environment fl_execute fl_fss fl_iki fl_path fl_print fl_signal fl_status_string fl_utf_file fll_control_group fll_error fll_execute fll_file fll_fss fll_fss_status_string fll_iki fll_print fll_program" + local projects="f_type f_status f_memory f_type_array f_string f_utf f_account f_capability f_color f_compare f_console f_control_group f_conversion f_directory f_environment f_execute f_file f_fss f_iki f_limit f_network f_parse f_path f_pipe f_print f_rip f_serialize f_signal f_socket f_status_string f_thread fl_control_group fl_conversion fl_directory fl_environment fl_execute fl_fss fl_iki fl_path fl_print fl_status_string fl_utf_file fll_control_group fll_error fll_execute fll_file fll_fss fll_fss_status_string fll_iki fll_print fll_program" local projects_no_tests="f_type" local programs="fss_read" diff --git a/level_1/fl_signal/c/signal.c b/level_1/fl_signal/c/signal.c deleted file mode 100644 index d915c27..0000000 --- a/level_1/fl_signal/c/signal.c +++ /dev/null @@ -1,52 +0,0 @@ -#include "signal.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _di_fl_signal_state_interrupt_ - f_status_t fl_signal_state_interrupt(void * const state, void * const internal) { - #ifndef _di_level_1_parameter_checking_ - if (!state) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_state_t *state_ptr = (f_state_t *) state; - - if (!state_ptr->custom) { - return F_status_set_error(F_parameter); - } - - fl_signal_interrupt_t *signal_interrupt = (fl_signal_interrupt_t *) state_ptr->custom; - - if (!signal_interrupt || !signal_interrupt->signal.id) { - return F_enable_not; - } - - if (!signal_interrupt->interrupts.used) { - return F_interrupt_not; - } - - struct signalfd_siginfo information; - - memset(&information, 0, sizeof(struct signalfd_siginfo)); - - const f_status_t status = f_signal_read(signal_interrupt->signal, 0, &information); - - if (F_status_set_fine(status) == F_interrupt) { - for (f_number_unsigned_t i = 0; i < signal_interrupt->interrupts.used; ++i) { - - if (information.ssi_signo == signal_interrupt->interrupts.array[i]) { - signal_interrupt->trigger = information.ssi_signo; - - return F_status_set_error(F_interrupt); - } - } // for - } - - return F_interrupt_not; - } -#endif // _di_fl_signal_state_interrupt_ - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_1/fl_signal/c/signal.h b/level_1/fl_signal/c/signal.h deleted file mode 100644 index 6e19732..0000000 --- a/level_1/fl_signal/c/signal.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * FLL - Level 1 - * - * Project: Signal - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides common signal functions. - */ -#ifndef _FL_signal_h -#define _FL_signal_h - -// Libc includes. -#include -#include -#include - -// FLL-0 includes. -#include -#include -#include - -// FLL-1 signal includes. -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Check to see if a given signal is received. - * - * Provides a simple interrupt checker for general use. - * - * This is intended to be explicitly use for the interrupt() callback defined in f_state_t. - * - * This checks all interrupts provided in state->data.interrupts and if a signal is found, store that signal in state->data.trigger and returns F_interrupt (with error bit set). - * If state->data.signal.id is NULL, then F_enable_not is returned. - * - * @param state - * The state such that: - * - state->handle: Ignored. - * - state->interrupt: A pointer to this function. - * - state->callbacks: Ignored. - * - state->custom: The interrupt data, of the type fl_signal_interrupt_t (Must not be NULL). - * - state->data: Ignored. - * @param internal - * This is ignored. - * - * @return - * F_none on success. - * F_enable_not on success but signals are not requested to be processed. - * F_interrupt_not on success and no requested signal was found. - * - * F_interrupt (with error bit) if a requested signal is confirmed to be found. - * F_parameter (with error bit) if a parameter is invalid. - * - * @see f_signal_read() - */ -#ifndef _di_fl_signal_state_interrupt_ - extern f_status_t fl_signal_state_interrupt(void * const state, void * const internal); -#endif // _di_fl_signal_state_interrupt_ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _FL_signal_h diff --git a/level_1/fl_signal/c/signal/common.h b/level_1/fl_signal/c/signal/common.h deleted file mode 100644 index da86c49..0000000 --- a/level_1/fl_signal/c/signal/common.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * FLL - Level 1 - * - * Project: Signal - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Defines common data to be used for/by project execute. - * - * This is auto-included by execute.h and should not need to be explicitly included. - */ -#ifndef _FL_signal_common_h -#define _FL_signal_common_h - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * A structure intended to be used as the "data" structure for f_state_t for interrupt related functionality. - * - * Properties: - * - interrupts: An array of signal codes to treat as interrupts. - * - signal: The signal structure to use. - * - trigger: The signal that triggered the interrupt, if applicable. - */ -#ifndef _di_fl_signal_interrupt_t_ - typedef struct { - f_int32s_t interrupts; - f_signal_t signal; - int32_t trigger; - } fl_signal_interrupt_t; - - #define fl_signal_interrupt_t_initialize { f_int32s_t_initialize, f_signal_t_initialize, 0 } - - #define macro_fl_signal_interrupt_t_initialize_1(interrupts, signal) { interrupts, signal, 0 } - #define macro_fl_signal_interrupt_t_initialize_2(interrupts, signal, trigger) { interrupts, signal, trigger } - - #define macro_fl_signal_interrupt_t_clear(structure) \ - macro_f_int32s_t_clear(structure.interrupts) \ - macro_f_signal_t_clear(structure.signal) \ - structure.trigger = 0; -#endif // _di_fl_signal_interrupt_t_ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _FL_signal_common_h diff --git a/level_1/fl_signal/data/build/defines b/level_1/fl_signal/data/build/defines deleted file mode 100644 index c665317..0000000 --- a/level_1/fl_signal/data/build/defines +++ /dev/null @@ -1,2 +0,0 @@ -# fss-0000 - diff --git a/level_1/fl_signal/data/build/dependencies b/level_1/fl_signal/data/build/dependencies deleted file mode 100644 index 01e8165..0000000 --- a/level_1/fl_signal/data/build/dependencies +++ /dev/null @@ -1,5 +0,0 @@ -# fss-0000 - -f_type -f_status -f_signal diff --git a/level_1/fl_signal/data/build/fakefile b/level_1/fl_signal/data/build/fakefile deleted file mode 100644 index 90a7134..0000000 --- a/level_1/fl_signal/data/build/fakefile +++ /dev/null @@ -1,12 +0,0 @@ -# fss-0005 iki-0002 - -settings: - fail exit - modes individual individual_thread level monolithic clang test fanalyzer thread threadless - - 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 - -main: - - build diff --git a/level_1/fl_signal/data/build/settings b/level_1/fl_signal/data/build/settings deleted file mode 100644 index a384c62..0000000 --- a/level_1/fl_signal/data/build/settings +++ /dev/null @@ -1,71 +0,0 @@ -# fss-0001 -# -# Modes: -# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. -# - individual_thread: This is required when compiling in individual mode with "thread" mode. -# - level: Compile using per level libraries. -# - monolithic: Compile using per monolithic libraries. -# - clang: Use clang rather than the default, which is generally gcc. -# - test: Compile for a test, such as unit testing. -# - fanalyzer: Compile using GCC's -fanalyzer compile time option. -# - thread: Compile with thread support. -# - threadless: Compile without thread support. -# - -build_name fl_signal - -version_major 0 -version_minor 7 -version_micro 0 -version_file micro -version_target minor - -modes individual individual_thread level monolithic clang test fanalyzer thread threadless -modes_default individual individual_thread thread - -build_compiler gcc -build_compiler-clang clang -build_indexer ar -build_indexer_arguments rcs -build_language c - -build_libraries -lc -build_libraries-individual -lf_signal - -build_sources_library signal.c - -build_sources_headers signal.h signal/common.h - -build_script yes -build_shared yes -build_static no - -path_headers fll/level_1 -path_library_script script -path_library_shared shared -path_library_static static -path_object_script script -path_object_shared shared -path_object_static static -path_program_script script -path_program_shared shared -path_program_static static - -has_path_standard yes -preserve_path_headers yes - -search_exclusive yes -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 - -flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -flags-clang -Wno-logical-op-parentheses -flags-test -O0 -fstack-protector -Wall -flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/ - -flags_library -fPIC -flags_object -fPIC -flags_program -fPIE diff --git a/level_3/iki_read/data/build/dependencies b/level_3/iki_read/data/build/dependencies index 606d058..e0e68d7 100644 --- a/level_3/iki_read/data/build/dependencies +++ b/level_3/iki_read/data/build/dependencies @@ -21,7 +21,6 @@ f_thread fl_conversion fl_iki fl_print -fl_signal fll_error fll_print diff --git a/level_3/iki_read/data/build/settings b/level_3/iki_read/data/build/settings index 7a6873c..318257b 100644 --- a/level_3/iki_read/data/build/settings +++ b/level_3/iki_read/data/build/settings @@ -30,7 +30,7 @@ build_indexer_arguments rcs build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_conversion -lfl_iki -lfl_print -lfl_signal -lf_color -lf_compare -lf_console -lf_conversion -lf_file -lf_iki -lf_memory -lf_pipe -lf_print -lf_rip -lf_signal -lf_string -lf_type_array -lf_utf +build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_conversion -lfl_iki -lfl_print -lf_color -lf_compare -lf_console -lf_conversion -lf_file -lf_iki -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 -- 1.8.3.1