From 66faec05f8948cf686d6bbf78d9c7c01c4a959a0 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 23 Jan 2025 00:53:25 -0600 Subject: [PATCH] Feature: Implement fll_program_standard_signal_received_wait(). The `fll_program_standard_signal_received_wait()` is now added because a lot of this code is repeated forr every single FLL program. The `fll_program_standard_signal_received()` is refactored to return a status code to match the newly added `ll_program_standard_signal_received_wait()`. The `status_signal` can now be moved into the main program settings structure. The `status_signal` is renamed to `signal_status` to keep the naming more consistent. This also exposes and fixes a race condition in how the pre-existing threaded signal handling is being used. The check for `program.signal.id` that then opens a signal via `f_signal_open()` in the thread is not necessary because the signal id from the parent thread is preserved. The `f_signal_close()` in the thread ends up prematurely closing the signal because the parent thread signal id is passed to the child thread. The `main->program.signal.id == -1` checks in the signal check functions end up preventing the interrupt cancel from being triggered because of the `f_signal_close()` being called in a separate thread that shares the same signal id. --- build/stand_alone/byte_dump.config.h | 1 + build/stand_alone/example.config.h | 1 + build/stand_alone/fake.config.h | 1 + build/stand_alone/firewall.config.h | 1 + build/stand_alone/utf8.config.h | 1 + level_2/fll_program/c/private-program.c | 13 +++--- level_2/fll_program/c/private-program.h | 12 ++++-- level_2/fll_program/c/program.c | 68 ++++++++++++++++++++++++++---- level_2/fll_program/c/program.h | 65 +++++++++++++++++++++++++--- level_2/fll_program/c/program/common.h | 4 ++ level_3/byte_dump/c/main/common/type.h | 9 +--- level_3/byte_dump/c/main/signal.c | 54 +++--------------------- level_3/byte_dump/c/main/signal.h | 9 ++-- level_3/example/c/main/common/type.h | 11 +++-- level_3/example/c/main/signal.c | 52 +++-------------------- level_3/example/c/main/signal.h | 9 ++-- level_3/fake/c/main/build/skeleton.h | 1 - level_3/fake/c/main/common/type.h | 9 +--- level_3/fake/c/main/fake.h | 5 --- level_3/fake/c/main/make/load_fakefile.h | 1 - level_3/fake/c/main/make/operate_process.c | 16 +------ level_3/fake/c/main/make/operate_process.h | 1 - level_3/fake/c/main/signal.c | 52 +++-------------------- level_3/fake/c/main/signal.h | 9 ++-- level_3/firewall/c/main/common/type.h | 9 +--- level_3/firewall/c/main/signal.c | 52 +++-------------------- level_3/firewall/c/main/signal.h | 9 ++-- level_3/fss_identify/c/main/common/type.h | 13 ++---- level_3/fss_identify/c/main/signal.c | 52 +++-------------------- level_3/fss_identify/c/main/signal.h | 9 ++-- level_3/fss_read/c/main/common/type.h | 7 +-- level_3/fss_read/c/main/signal.c | 52 +++-------------------- level_3/fss_read/c/main/signal.h | 9 ++-- level_3/fss_write/c/main/common/type.h | 9 +--- level_3/fss_write/c/main/signal.c | 52 +++-------------------- level_3/fss_write/c/main/signal.h | 9 ++-- level_3/iki_read/c/main/common/type.h | 9 +--- level_3/iki_read/c/main/signal.c | 52 +++-------------------- level_3/iki_read/c/main/signal.h | 9 ++-- level_3/iki_write/c/main/common/type.h | 9 +--- level_3/iki_write/c/main/signal.c | 52 +++-------------------- level_3/iki_write/c/main/signal.h | 9 ++-- level_3/status_code/c/main/common/type.h | 9 +--- level_3/status_code/c/main/signal.c | 52 +++-------------------- level_3/status_code/c/main/signal.h | 9 ++-- level_3/utf8/c/main/common/type.h | 11 ++--- level_3/utf8/c/main/signal.c | 52 +++-------------------- level_3/utf8/c/main/signal.h | 9 ++-- 48 files changed, 262 insertions(+), 707 deletions(-) diff --git a/build/stand_alone/byte_dump.config.h b/build/stand_alone/byte_dump.config.h index 5b5a939..a8afed6 100644 --- a/build/stand_alone/byte_dump.config.h +++ b/build/stand_alone/byte_dump.config.h @@ -1681,5 +1681,6 @@ //#define _di_fll_program_standard_set_up_ //#define _di_fll_program_standard_signal_handle_ //#define _di_fll_program_standard_signal_received_ +//#define _di_fll_program_standard_signal_received_wait_ #define _di_private_inline_f_print_to_error_ #define _di_private_inline_private_f_print_to_error_ diff --git a/build/stand_alone/example.config.h b/build/stand_alone/example.config.h index f489fc1..89a196b 100644 --- a/build/stand_alone/example.config.h +++ b/build/stand_alone/example.config.h @@ -1620,6 +1620,7 @@ //#define _di_fll_program_standard_set_up_ //#define _di_fll_program_standard_signal_handle_ //#define _di_fll_program_standard_signal_received_ +//#define _di_fll_program_standard_signal_received_wait_ #define _di_private_inline_f_print_to_error_ #define _di_private_inline_private_f_print_to_error_ diff --git a/build/stand_alone/fake.config.h b/build/stand_alone/fake.config.h index 2ba8618..09ee980 100644 --- a/build/stand_alone/fake.config.h +++ b/build/stand_alone/fake.config.h @@ -2188,5 +2188,6 @@ //#define _di_fll_program_standard_set_up_ //#define _di_fll_program_standard_signal_handle_ //#define _di_fll_program_standard_signal_received_ +//#define _di_fll_program_standard_signal_received_wait_ #define _di_private_inline_f_print_to_error_ #define _di_private_inline_private_f_print_to_error_ diff --git a/build/stand_alone/firewall.config.h b/build/stand_alone/firewall.config.h index 9e6d8e5..efe20b7 100644 --- a/build/stand_alone/firewall.config.h +++ b/build/stand_alone/firewall.config.h @@ -2272,5 +2272,6 @@ //#define _di_fll_program_standard_set_up_ //#define _di_fll_program_standard_signal_handle_ //#define _di_fll_program_standard_signal_received_ +//#define _di_fll_program_standard_signal_received_wait_ #define _di_private_inline_f_print_to_error_ #define _di_private_inline_private_f_print_to_error_ diff --git a/build/stand_alone/utf8.config.h b/build/stand_alone/utf8.config.h index 0be76fc..3fe3487 100644 --- a/build/stand_alone/utf8.config.h +++ b/build/stand_alone/utf8.config.h @@ -1699,5 +1699,6 @@ //#define _di_fll_program_standard_set_up_ //#define _di_fll_program_standard_signal_handle_ //#define _di_fll_program_standard_signal_received_ +//#define _di_fll_program_standard_signal_received_wait_ #define _di_private_inline_f_print_to_error_ #define _di_private_inline_private_f_print_to_error_ diff --git a/level_2/fll_program/c/private-program.c b/level_2/fll_program/c/private-program.c index 5194b12..66dbc31 100644 --- a/level_2/fll_program/c/private-program.c +++ b/level_2/fll_program/c/private-program.c @@ -78,15 +78,18 @@ extern "C" { #endif // !defined(_di_fll_program_print_help_option_) || !defined(_di_fll_program_print_help_option_standard_) #if !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_handle_) - uint32_t private_fll_program_standard_signal_received(fll_program_data_t * const program) { + f_status_t private_fll_program_standard_signal_received(fll_program_data_t * const program) { - if (!program || program->signal.id == -1) return 0; + if (!program || program->signal.id == -1) return F_status_set_error(F_parameter); struct signalfd_siginfo information; memset(&information, 0, sizeof(struct signalfd_siginfo)); - if (f_signal_read(program->signal, 0, &information) == F_signal) { + program->signal_status = f_signal_read(program->signal, 0, &information); + if (F_status_is_error(program->signal_status)) return program->signal_status; + + if (program->signal_status == F_signal) { switch (information.ssi_signo) { case F_signal_abort: case F_signal_broken_pipe: @@ -96,11 +99,11 @@ extern "C" { case F_signal_termination: program->signal_received = information.ssi_signo; - return information.ssi_signo; + return F_interrupt; } } - return 0; + return F_interrupt_not; } #endif // !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_handle_) diff --git a/level_2/fll_program/c/private-program.h b/level_2/fll_program/c/private-program.h index 4891331..3db7ba5 100644 --- a/level_2/fll_program/c/private-program.h +++ b/level_2/fll_program/c/private-program.h @@ -91,9 +91,15 @@ extern "C" { * @param program * The program data. * + * This alters program: + * - signal_received: Stores the signal received if deemed appropraite. + * - signal_status: Stores the status of the signal checking function. + * * @return - * A positive number representing a valid signal on signal received. - * 0 on no signal received or when main is NULL. + * F_interrupt on success with interrupt received. + * F_interrupt_not on success without interrupt received. + * + * Errors (with error bit) from: f_signal_read(). * * @see f_signal_read() * @@ -101,7 +107,7 @@ extern "C" { * @see fll_program_standard_signal_handle() */ #if !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_handle_) - uint32_t private_fll_program_standard_signal_received(fll_program_data_t * const program) F_attribute_visibility_internal_d; + f_status_t private_fll_program_standard_signal_received(fll_program_data_t * const program) F_attribute_visibility_internal_d; #endif // !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_handle_) /** diff --git a/level_2/fll_program/c/program.c b/level_2/fll_program/c/program.c index ee6cb75..d8b438b 100644 --- a/level_2/fll_program/c/program.c +++ b/level_2/fll_program/c/program.c @@ -522,15 +522,68 @@ extern "C" { #endif // _di_fll_program_standard_set_up_ #ifndef _di_fll_program_standard_signal_received_ - uint32_t fll_program_standard_signal_received(fll_program_data_t * const program) { + f_status_t fll_program_standard_signal_received(fll_program_data_t * const program) { #ifndef _di_level_2_parameter_checking_ - if (!program) return 0; + if (!program || program->signal.id == -1) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ return private_fll_program_standard_signal_received(program); } #endif // _di_fll_program_standard_signal_received_ +#ifndef _di_fll_program_standard_signal_received_wait_ + f_status_t fll_program_standard_signal_received_wait(fll_program_data_t * const program, const f_number_unsigned_t max) { + #ifndef _di_level_2_parameter_checking_ + if (!program || program->signal.id == -1) return F_status_set_error(F_parameter); + #endif // _di_level_2_parameter_checking_ + + // This utilizes a local status to better control the status within this scope as this function is expected to be run in a threaded environment. + siginfo_t information; + f_number_unsigned_t failsafe = 0; + f_status_t status = F_okay; + + memset(&information, 0, sizeof(siginfo_t)); + + program->signal_received = 0; + + do { + memset(&information, 0, sizeof(siginfo_t)); + + program->signal_status = status = f_signal_wait(&program->signal.set, &information); + + if (F_status_is_error(status) && F_status_set_fine(status) != F_interrupt) { + if (++failsafe >= max) { + status = F_status_set_error(F_maximum); + + break; + } + } + + switch (information.si_signo) { + case F_signal_abort: + case F_signal_broken_pipe: + case F_signal_hangup: + case F_signal_interrupt: + case F_signal_quit: + case F_signal_termination: + program->signal_received = information.si_signo; + program->signal_status = status = F_interrupt; + + break; + + default: + failsafe = 0; + program->signal_status = F_okay; + + break; + } + + } while (F_status_set_fine(status) != F_interrupt); + + return status; + } +#endif // _di_fll_program_standard_signal_received_wait_ + #ifndef _di_fll_program_standard_signal_handle_ void fll_program_standard_signal_handle(f_state_t * const state, void * const internal) { #ifndef _di_level_2_parameter_checking_ @@ -545,14 +598,11 @@ extern "C" { fll_program_data_t * const program = (fll_program_data_t *) state->custom; - program->signal_received = private_fll_program_standard_signal_received(program); + const f_status_t status = program->signal.id == -1 + ? F_interrupt_not + : private_fll_program_standard_signal_received(program); - if (program->signal_received == F_signal_abort || program->signal_received == F_signal_broken_pipe || program->signal_received == F_signal_hangup || program->signal_received == F_signal_interrupt || program->signal_received == F_signal_quit || program->signal_received == F_signal_termination) { - state->status = F_status_set_error(F_interrupt); - } - else { - state->status = F_interrupt_not; - } + state->status = F_status_set_fine(status) == F_interrupt ? F_status_set_error(F_interrupt) : status; } #endif // _di_fll_program_standard_signal_handle_ diff --git a/level_2/fll_program/c/program.h b/level_2/fll_program/c/program.h index ef0608e..46bf712 100644 --- a/level_2/fll_program/c/program.h +++ b/level_2/fll_program/c/program.h @@ -367,25 +367,78 @@ extern "C" { /** * Check to see if a process signal is received. * - * Only signals that are blocked via main.signal will be received. + * Only signals that are blocked via program.signal will be received. * - * If no signals are blocked, then this always returns F_false. + * If no signals are blocked, then this always returns F_interrupt_not. + * + * This only reacts on the following signals: + * - F_signal_abort + * - F_signal_broken_pipe + * - F_signal_hangup + * - F_signal_interrupt + * - F_signal_quit + * - F_signal_termination * * @param program * The program data. - * The program.signal must be used to designate blocked signals. + * + * This alters program: + * - signal_received: Stores the signal received if deemed appropraite. + * - signal_status: Stores the status of the signal checking function. * * @return - * A positive number representing a valid signal on signal received. - * 0 on no signal received or when main is NULL. + * F_interrupt on success with interrupt received. + * F_interrupt_not on success without interrupt received. + * + * F_parameter (with error bit) if a parameter is invalid. + * + * Errors (with error bit) from: f_signal_read(). * * @see f_signal_read() */ #ifndef _di_fll_program_standard_signal_received_ - extern uint32_t fll_program_standard_signal_received(fll_program_data_t * const program); + extern f_status_t fll_program_standard_signal_received(fll_program_data_t * const program); #endif // _di_fll_program_standard_signal_received_ /** + * Check to see if a process signal is received, in a blocking manner. + * + * This will attempt to wait infinitely until a signal is received or enough sequential errors are greater than the given max. + * + * Only signals that are blocked via program.signal will be received. + * + * This only reacts on the following signals: + * - F_signal_abort + * - F_signal_broken_pipe + * - F_signal_hangup + * - F_signal_interrupt + * - F_signal_quit + * - F_signal_termination + * + * @param program + * The program data. + * + * This alters program: + * - signal.id: At start and on return. + * - signal_received: Stores the signal received if deemed appropraite. + * - signal_status: Stores the status of the signal checking function. + * + * @return + * F_interrupt on success with interrupt received. + * F_interrupt_not on success without interrupt received. + * + * F_maximum (with error bit) if max is reached on too many sequential errors. + * F_parameter (with error bit) if a parameter is invalid. + * + * Errors (with error bit) from: f_signal_wait(). + * + * @see f_signal_wait() + */ +#ifndef _di_fll_program_standard_signal_received_wait_ + extern f_status_t fll_program_standard_signal_received_wait(fll_program_data_t * const program, const f_number_unsigned_t max); +#endif // _di_fll_program_standard_signal_received_wait_ + +/** * Standardized callback for checking for interrupts via the f_state_t interrupt callback. * * This only checks for the signals: diff --git a/level_2/fll_program/c/program/common.h b/level_2/fll_program/c/program/common.h index ec352b8..5f3414b 100644 --- a/level_2/fll_program/c/program/common.h +++ b/level_2/fll_program/c/program/common.h @@ -98,6 +98,7 @@ extern "C" { * - signal_check: A counter used to map to for reducing the amount of actual signal check calls. * - signal_received: The signal received (if 0, then no signal is received). * - signal: The process signal management structure. + * - signal_status: The status of the signal handler. * * - message: The output file for normal output messages (often stdout). * - output: The output file for normal/non-message output, aka data output (often stdout or a file). @@ -120,6 +121,7 @@ extern "C" { uint32_t signal_received; uint16_t signal_check; f_signal_t signal; + f_status_t signal_status; fl_print_t message; fl_print_t output; @@ -141,6 +143,7 @@ extern "C" { 0, \ 0, \ f_signal_t_initialize, \ + F_okay, \ fl_print_t_initialize, \ fl_print_t_initialize, \ macro_fl_print_t_initialize_error_1(), \ @@ -159,6 +162,7 @@ extern "C" { signal_received, \ signal_check, \ signal, \ + F_okay, \ message, \ output, \ error, \ diff --git a/level_3/byte_dump/c/main/common/type.h b/level_3/byte_dump/c/main/common/type.h index 351fa64..a286725 100644 --- a/level_3/byte_dump/c/main/common/type.h +++ b/level_3/byte_dump/c/main/common/type.h @@ -75,10 +75,8 @@ extern "C" { * These program settings are often processed from the program arguments (often called the command line arguments). * * Properties: - * - flag: Flags passed to the main function. - * - * - status_signal: A status used eclusively by the threaded signal handler. - * - state: The state data used when processing data. + * - flag: Flags passed to the main function. + * - state: The state data used when processing data. * * - first: The first position. * - last: The last position. @@ -91,8 +89,6 @@ extern "C" { #ifndef _di_byte_dump_setting_t_ typedef struct { uint16_t flag; - - f_status_t status_signal; f_state_t state; uint64_t first; @@ -107,7 +103,6 @@ extern "C" { #define byte_dump_setting_t_initialize \ { \ byte_dump_main_flag_none_d, \ - F_okay, \ f_state_t_initialize, \ 0, \ 0, \ diff --git a/level_3/byte_dump/c/main/signal.c b/level_3/byte_dump/c/main/signal.c index f713b02..6e06493 100644 --- a/level_3/byte_dump/c/main/signal.c +++ b/level_3/byte_dump/c/main/signal.c @@ -7,10 +7,11 @@ extern "C" { #if !defined(_di_byte_dump_signal_check_) && defined(_di_thread_support_) f_status_t byte_dump_signal_check(byte_dump_main_t * const main) { - if (!main || main->program.signal.id == -1) return F_false; + if (!main) return F_false; + if (main->program.signal_received) return F_true; if (!((++main->program.signal_check) % byte_dump_signal_check_d)) { - if (fll_program_standard_signal_received(&main->program)) { + if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) { fll_program_print_signal_received(&main->program.warning, main->program.signal_received); main->setting.state.status = F_status_set_error(F_interrupt); @@ -28,7 +29,7 @@ extern "C" { #if !defined(_di_byte_dump_signal_check_) && !defined(_di_thread_support_) f_status_t byte_dump_signal_check(byte_dump_main_t * const main) { - if (!main || main->program.signal.id == -1) return F_false; + if (!main) return F_false; if (main->program.signal_received) { fll_program_print_signal_received(&main->program.warning, main->program.signal_received); @@ -47,13 +48,6 @@ extern "C" { if (!main) return; - siginfo_t information; - f_number_unsigned_t failsafe = 0; - - memset(&information, 0, sizeof(siginfo_t)); - - main->program.signal_received = 0; - f_signal_set_empty(&main->program.signal.set); f_signal_set_add(F_signal_abort, &main->program.signal.set); f_signal_set_add(F_signal_broken_pipe, &main->program.signal.set); @@ -62,45 +56,9 @@ extern "C" { f_signal_set_add(F_signal_quit, &main->program.signal.set); f_signal_set_add(F_signal_termination, &main->program.signal.set); - if (main->program.signal.id == -1) { - main->setting.status_signal = f_signal_open(&main->program.signal); - - if (F_status_is_error(main->setting.status_signal)) { - main->program.signal_received = F_signal_abort; - - return; - } - } - - do { - memset(&information, 0, sizeof(siginfo_t)); - - 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 >= byte_dump_signal_check_failsafe_d) break; - } - - switch (information.si_signo) { - case F_signal_abort: - case F_signal_broken_pipe: - case F_signal_hangup: - case F_signal_interrupt: - case F_signal_quit: - case F_signal_termination: - main->program.signal_received = information.si_signo; - - break; - } - - failsafe = 0; - main->setting.status_signal = F_okay; - - } while (!main->program.signal_received); - - f_signal_close(&main->program.signal); + fll_program_standard_signal_received_wait(&main->program, byte_dump_signal_check_failsafe_d); - if (F_status_is_error(main->setting.status_signal)) { + if (F_status_is_error(main->program.signal_status) && F_status_set_fine(main->program.signal_status) != F_interrupt) { main->program.signal_received = F_signal_abort; } } diff --git a/level_3/byte_dump/c/main/signal.h b/level_3/byte_dump/c/main/signal.h index 4a7f789..d2a8397 100644 --- a/level_3/byte_dump/c/main/signal.h +++ b/level_3/byte_dump/c/main/signal.h @@ -66,14 +66,11 @@ extern "C" { * The main program and settings data. * * This alters main.program.signal_received, setting it to a received signal. + * This alters main.program.signal_status. * - * This alters main.setting.state.status: - * Errors (with error bit) from: f_signal_open() - * Errors (with error bit) from: f_signal_wait() + * This does not alter main.setting.state.status. * - * @see f_signal_close() - * @see f_signal_open() - * @see f_signal_wait() + * @see fll_program_standard_signal_received_wait() */ #if !defined(_di_byte_dump_signal_handler_) && !defined(_di_thread_support_) extern void byte_dump_signal_handler(byte_dump_main_t * const main); diff --git a/level_3/example/c/main/common/type.h b/level_3/example/c/main/common/type.h index e920659..63805e6 100644 --- a/level_3/example/c/main/common/type.h +++ b/level_3/example/c/main/common/type.h @@ -45,16 +45,16 @@ extern "C" { * This is passed to the program-specific main entry point to designate program settings. * These program settings are often processed from the program arguments (often called the command line arguments). * - * flag: Flags passed to the main function. + * Properties: + * - flag: Flags passed to the main function. + * - state: The state data used when processing the FSS data. * - * status_signal: A status used eclusively by the threaded signal handler. - * state: The state data used when processing the FSS data. + * - program_name: The short program name. + * - program_name_long: The long program name. */ #ifndef _di_example_setting_t_ typedef struct { uint16_t flag; - - f_status_t status_signal; f_state_t state; const f_string_static_t *program_name; @@ -64,7 +64,6 @@ extern "C" { #define example_setting_t_initialize \ { \ example_main_flag_none_d, \ - F_okay, \ f_state_t_initialize, \ 0, \ 0, \ diff --git a/level_3/example/c/main/signal.c b/level_3/example/c/main/signal.c index 84969c8..624db5f 100644 --- a/level_3/example/c/main/signal.c +++ b/level_3/example/c/main/signal.c @@ -7,10 +7,11 @@ extern "C" { #if !defined(_di_example_signal_check_) && defined(_di_thread_support_) f_status_t example_signal_check(example_main_t * const main) { - if (!main || main->program.signal.id == -1) return F_false; + if (!main) return F_false; + if (main->program.signal_received) return F_true; if (!((++main->program.signal_check) % example_signal_check_d)) { - if (fll_program_standard_signal_received(&main->program)) { + if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) { fll_program_print_signal_received(&main->program.warning, main->program.signal_received); main->setting.state.status = F_status_set_error(F_interrupt); @@ -47,13 +48,6 @@ extern "C" { if (!main) return; - siginfo_t information; - f_number_unsigned_t failsafe = 0; - - memset(&information, 0, sizeof(siginfo_t)); - - main->program.signal_received = 0; - f_signal_set_empty(&main->program.signal.set); f_signal_set_add(F_signal_abort, &main->program.signal.set); f_signal_set_add(F_signal_broken_pipe, &main->program.signal.set); @@ -62,45 +56,9 @@ extern "C" { f_signal_set_add(F_signal_quit, &main->program.signal.set); f_signal_set_add(F_signal_termination, &main->program.signal.set); - if (main->program.signal.id == -1) { - main->setting.status_signal = f_signal_open(&main->program.signal); - - if (F_status_is_error(main->setting.status_signal)) { - main->program.signal_received = F_signal_abort; - - return; - } - } - - do { - memset(&information, 0, sizeof(siginfo_t)); - - 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 >= example_signal_check_failsafe_d) break; - } - - switch (information.si_signo) { - case F_signal_abort: - case F_signal_broken_pipe: - case F_signal_hangup: - case F_signal_interrupt: - case F_signal_quit: - case F_signal_termination: - main->program.signal_received = information.si_signo; - - break; - } - - failsafe = 0; - main->setting.status_signal = F_okay; - - } while (!main->program.signal_received); - - f_signal_close(&main->program.signal); + fll_program_standard_signal_received_wait(&main->program, example_signal_check_failsafe_d); - if (F_status_is_error(main->setting.status_signal)) { + if (F_status_is_error(main->program.signal_status) && F_status_set_fine(main->program.signal_status) != F_interrupt) { main->program.signal_received = F_signal_abort; } } diff --git a/level_3/example/c/main/signal.h b/level_3/example/c/main/signal.h index 5bbc615..d38c3e0 100644 --- a/level_3/example/c/main/signal.h +++ b/level_3/example/c/main/signal.h @@ -66,14 +66,11 @@ extern "C" { * The main program and settings data. * * This alters main.program.signal_received, setting it to a received signal. + * This alters main.program.signal_status. * - * This alters main.setting.state.status: - * Errors (with error bit) from: f_signal_open() - * Errors (with error bit) from: f_signal_wait() + * This does not alter main.setting.state.status. * - * @see f_signal_close() - * @see f_signal_open() - * @see f_signal_wait() + * @see fll_program_standard_signal_received_wait() */ #if !defined(_di_example_signal_handler_) && !defined(_di_thread_support_) extern void example_signal_handler(example_main_t * const main); diff --git a/level_3/fake/c/main/build/skeleton.h b/level_3/fake/c/main/build/skeleton.h index b7c7f4f..783009d 100644 --- a/level_3/fake/c/main/build/skeleton.h +++ b/level_3/fake/c/main/build/skeleton.h @@ -40,7 +40,6 @@ extern "C" { * * @see f_directory_create() * @see f_directory_exists() - * @see fll_program_standard_signal_received() * * @see fake_build_touch() */ diff --git a/level_3/fake/c/main/common/type.h b/level_3/fake/c/main/common/type.h index 2cc113e..8368341 100644 --- a/level_3/fake/c/main/common/type.h +++ b/level_3/fake/c/main/common/type.h @@ -67,10 +67,8 @@ extern "C" { * These program settings are often processed from the program arguments (often called the command line arguments). * * Properties: - * - flag: Flags passed to the main function. - * - * - status_signal: A status used eclusively by the threaded signal handler. - * - state: The state data used when processing the FSS data. + * - flag: Flags passed to the main function. + * - state: The state data used when processing the FSS data. * * - build: The build directory. * - data: The data directory. @@ -89,8 +87,6 @@ extern "C" { #ifndef _di_fake_setting_t_ typedef struct { uint32_t flag; - - f_status_t status_signal; f_state_t state; f_string_dynamic_t build; @@ -113,7 +109,6 @@ extern "C" { #define fake_setting_t_initialize \ { \ 0, \ - F_okay, \ f_state_t_initialize, \ f_string_dynamic_t_initialize, \ f_string_dynamic_t_initialize, \ diff --git a/level_3/fake/c/main/fake.h b/level_3/fake/c/main/fake.h index 4716250..b7aa641 100644 --- a/level_3/fake/c/main/fake.h +++ b/level_3/fake/c/main/fake.h @@ -175,7 +175,6 @@ extern "C" { * Errors (with error bit) from: fake_validate_parameter_paths() * * @see f_string_dynamic_append() - * @see fll_program_standard_signal_received() * @see fake_build_operate() * @see fake_clean_operate() * @see fake_make_operate() @@ -214,7 +213,6 @@ extern "C" { * A value of 1 is returned if status has the error bit set. * * @see fll_execute_program() - * @see fll_program_standard_signal_received() */ #ifndef _di_fake_execute_ extern int fake_execute(fake_data_t * const data, const f_string_maps_t environment, const f_string_static_t program); @@ -251,7 +249,6 @@ extern "C" { * @see f_file_stream_open() * @see f_file_stream_read() * @see f_memory_array_increase_by() - * @see fll_program_standard_signal_received() */ #ifndef _di_fake_file_buffer_ extern void fake_file_buffer(fake_data_t * const data, const f_string_static_t path_file, const bool required, f_string_dynamic_t * const buffer); @@ -275,7 +272,6 @@ extern "C" { * * @see f_file_stream_read_block() * @see f_memory_array_increase_by() - * @see fll_program_standard_signal_received() */ #ifndef _di_fake_pipe_buffer_ extern void fake_pipe_buffer(fake_data_t * const data, f_string_dynamic_t * const buffer); @@ -299,7 +295,6 @@ extern "C" { * * @see f_file_exists() * @see f_file_stat() - * @see fll_program_standard_signal_received() */ #ifndef _di_fake_validate_parameter_paths_ extern void fake_validate_parameter_paths(fake_data_t * const data); diff --git a/level_3/fake/c/main/make/load_fakefile.h b/level_3/fake/c/main/make/load_fakefile.h index b1757c3..118ba52 100644 --- a/level_3/fake/c/main/make/load_fakefile.h +++ b/level_3/fake/c/main/make/load_fakefile.h @@ -57,7 +57,6 @@ extern "C" { * @see f_string_dynamic_partial_append() * @see fll_fss_basic_list_read() * @see fll_fss_extended_read() - * @see fll_program_standard_signal_received() * * @see fake_build_load_setting() * @see fake_make_load_fakefile_setting_build() diff --git a/level_3/fake/c/main/make/operate_process.c b/level_3/fake/c/main/make/operate_process.c index 8d655a0..7f44aff 100644 --- a/level_3/fake/c/main/make/operate_process.c +++ b/level_3/fake/c/main/make/operate_process.c @@ -290,13 +290,7 @@ extern "C" { fake_main_t * const main = data_make->main; - if (fll_program_standard_signal_received(&main->program)) { - fll_program_print_signal_received(&main->program.warning, main->program.signal_received); - - main->setting.state.status = F_status_set_error(F_interrupt); - - return; - } + if (fake_signal_check(main)) return; // Reset the environment. for (f_number_unsigned_t i = 0; i < data_make->environment.used; ++i) { @@ -339,13 +333,7 @@ extern "C" { main->setting.state.status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code); - if (fll_program_standard_signal_received(&main->program)) { - fll_program_print_signal_received(&main->program.warning, main->program.signal_received); - - main->setting.state.status = F_status_set_error(F_interrupt); - - return; - } + if (fake_signal_check(main)) return; if (F_status_is_error(main->setting.state.status)) { if (F_status_set_fine(main->setting.state.status) == F_interrupt) return; diff --git a/level_3/fake/c/main/make/operate_process.h b/level_3/fake/c/main/make/operate_process.h index acc5646..2c0f7f1 100644 --- a/level_3/fake/c/main/make/operate_process.h +++ b/level_3/fake/c/main/make/operate_process.h @@ -183,7 +183,6 @@ extern "C" { * @see f_environment_get_all() * @see fl_environment_load_names() * @see fll_execute_program() - * @see fll_program_standard_signal_received() * * @see fake_make_operate_process_return() */ diff --git a/level_3/fake/c/main/signal.c b/level_3/fake/c/main/signal.c index d801843..dfb48cc 100644 --- a/level_3/fake/c/main/signal.c +++ b/level_3/fake/c/main/signal.c @@ -7,10 +7,11 @@ extern "C" { #if !defined(_di_fake_signal_check_) && defined(_di_thread_support_) f_status_t fake_signal_check(fake_main_t * const main) { - if (!main || main->program.signal.id == -1) return F_false; + if (!main) return F_false; + if (main->program.signal_received) return F_true; if (!((++main->program.signal_check) % fake_signal_check_d)) { - if (fll_program_standard_signal_received(&main->program)) { + if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) { fll_program_print_signal_received(&main->program.warning, main->program.signal_received); main->setting.state.status = F_status_set_error(F_interrupt); @@ -47,13 +48,6 @@ extern "C" { if (!main) return; - siginfo_t information; - f_number_unsigned_t failsafe = 0; - - memset(&information, 0, sizeof(siginfo_t)); - - main->program.signal_received = 0; - f_signal_set_empty(&main->program.signal.set); f_signal_set_add(F_signal_abort, &main->program.signal.set); f_signal_set_add(F_signal_broken_pipe, &main->program.signal.set); @@ -62,45 +56,9 @@ extern "C" { f_signal_set_add(F_signal_quit, &main->program.signal.set); f_signal_set_add(F_signal_termination, &main->program.signal.set); - if (main->program.signal.id == -1) { - main->setting.status_signal = f_signal_open(&main->program.signal); - - if (F_status_is_error(main->setting.status_signal)) { - main->program.signal_received = F_signal_abort; - - return; - } - } - - do { - memset(&information, 0, sizeof(siginfo_t)); - - 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 >= fake_signal_check_failsafe_d) break; - } - - switch (information.si_signo) { - case F_signal_abort: - case F_signal_broken_pipe: - case F_signal_hangup: - case F_signal_interrupt: - case F_signal_quit: - case F_signal_termination: - main->program.signal_received = information.si_signo; - - break; - } - - failsafe = 0; - main->setting.status_signal = F_okay; - - } while (!main->program.signal_received); - - f_signal_close(&main->program.signal); + fll_program_standard_signal_received_wait(&main->program, fake_signal_check_failsafe_d); - if (F_status_is_error(main->setting.status_signal)) { + if (F_status_is_error(main->program.signal_status) && F_status_set_fine(main->program.signal_status) != F_interrupt) { main->program.signal_received = F_signal_abort; } } diff --git a/level_3/fake/c/main/signal.h b/level_3/fake/c/main/signal.h index 0c3b7c4..b349e9c 100644 --- a/level_3/fake/c/main/signal.h +++ b/level_3/fake/c/main/signal.h @@ -66,14 +66,11 @@ extern "C" { * The main program and settings data. * * This alters main.program.signal_received, setting it to a received signal. + * This alters main.program.signal_status. * - * This alters main.setting.state.status: - * Errors (with error bit) from: f_signal_open() - * Errors (with error bit) from: f_signal_wait() + * This does not alter main.setting.state.status. * - * @see f_signal_close() - * @see f_signal_open() - * @see f_signal_wait() + * @see fll_program_standard_signal_received_wait() */ #if !defined(_di_fake_signal_handler_) && !defined(_di_thread_support_) extern void fake_signal_handler(fake_main_t * const main); diff --git a/level_3/firewall/c/main/common/type.h b/level_3/firewall/c/main/common/type.h index 3675ded..926c78b 100644 --- a/level_3/firewall/c/main/common/type.h +++ b/level_3/firewall/c/main/common/type.h @@ -152,10 +152,8 @@ extern "C" { * These program settings are often processed from the program arguments (often called the command line arguments). * * Properties: - * - flag: Flags passed to the main function. - * - * - status_signal: A status used eclusively by the threaded signal handler. - * - state: The state information. + * - flag: Flags passed to the main function. + * - state: The state information. * * - chains: An array of all chains. @todo probably should be moved into data. * - devices: An array of all devices. @todo probably should be moved into data. @@ -163,8 +161,6 @@ extern "C" { #ifndef _di_firewall_setting_t_ typedef struct { uint16_t flag; - - f_status_t status_signal; f_state_t state; f_string_dynamics_t chains; @@ -174,7 +170,6 @@ extern "C" { #define firewall_setting_t_initialize \ { \ firewall_main_flag_none_d, \ - F_okay, \ f_state_t_initialize, \ f_string_dynamics_t_initialize, \ f_string_dynamics_t_initialize, \ diff --git a/level_3/firewall/c/main/signal.c b/level_3/firewall/c/main/signal.c index 76c63fc..e35882e 100644 --- a/level_3/firewall/c/main/signal.c +++ b/level_3/firewall/c/main/signal.c @@ -7,10 +7,11 @@ extern "C" { #if !defined(_di_firewall_signal_check_) && defined(_di_thread_support_) f_status_t firewall_signal_check(firewall_main_t * const main) { - if (!main || main->program.signal.id == -1) return F_false; + if (!main) return F_false; + if (main->program.signal_received) return F_true; if (!((++main->program.signal_check) % firewall_signal_check_d)) { - if (fll_program_standard_signal_received(&main->program)) { + if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) { fll_program_print_signal_received(&main->program.warning, main->program.signal_received); main->setting.state.status = F_status_set_error(F_interrupt); @@ -47,13 +48,6 @@ extern "C" { if (!main) return; - siginfo_t information; - f_number_unsigned_t failsafe = 0; - - memset(&information, 0, sizeof(siginfo_t)); - - main->program.signal_received = 0; - f_signal_set_empty(&main->program.signal.set); f_signal_set_add(F_signal_abort, &main->program.signal.set); f_signal_set_add(F_signal_broken_pipe, &main->program.signal.set); @@ -62,45 +56,9 @@ extern "C" { f_signal_set_add(F_signal_quit, &main->program.signal.set); f_signal_set_add(F_signal_termination, &main->program.signal.set); - if (main->program.signal.id == -1) { - main->setting.status_signal = f_signal_open(&main->program.signal); - - if (F_status_is_error(main->setting.status_signal)) { - main->program.signal_received = F_signal_abort; - - return; - } - } - - do { - memset(&information, 0, sizeof(siginfo_t)); - - 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 >= firewall_signal_check_failsafe_d) break; - } - - switch (information.si_signo) { - case F_signal_abort: - case F_signal_broken_pipe: - case F_signal_hangup: - case F_signal_interrupt: - case F_signal_quit: - case F_signal_termination: - main->program.signal_received = information.si_signo; - - break; - } - - failsafe = 0; - main->setting.status_signal = F_okay; - - } while (!main->program.signal_received); - - f_signal_close(&main->program.signal); + fll_program_standard_signal_received_wait(&main->program, firewall_signal_check_failsafe_d); - if (F_status_is_error(main->setting.status_signal)) { + if (F_status_is_error(main->program.signal_status) && F_status_set_fine(main->program.signal_status) != F_interrupt) { main->program.signal_received = F_signal_abort; } } diff --git a/level_3/firewall/c/main/signal.h b/level_3/firewall/c/main/signal.h index 49156e3..e078f10 100644 --- a/level_3/firewall/c/main/signal.h +++ b/level_3/firewall/c/main/signal.h @@ -66,14 +66,11 @@ extern "C" { * The main program and settings data. * * This alters main.program.signal_received, setting it to a received signal. + * This alters main.program.signal_status. * - * This alters main.setting.state.status: - * Errors (with error bit) from: f_signal_open() - * Errors (with error bit) from: f_signal_wait() + * This does not alter main.setting.state.status. * - * @see f_signal_close() - * @see f_signal_open() - * @see f_signal_wait() + * @see fll_program_standard_signal_received_wait() */ #if !defined(_di_firewall_signal_handler_) && !defined(_di_thread_support_) extern void firewall_signal_handler(firewall_main_t * const main); diff --git a/level_3/fss_identify/c/main/common/type.h b/level_3/fss_identify/c/main/common/type.h index d4fc145..a58c8bb 100644 --- a/level_3/fss_identify/c/main/common/type.h +++ b/level_3/fss_identify/c/main/common/type.h @@ -30,16 +30,14 @@ extern "C" { * These program settings are often processed from the program arguments (often called the command line arguments). * * Properties: - * - flag: Flags passed to the main function. + * - flag: Flags passed to the main function. + * - state: The state information. * * - current: The current position within the ids, used to determine when the line is matched. * - line: The line number to select. * - total: The total ids across all files. * * - range: A range used for processing as needed. - * - - * - status_signal: A status used eclusively by the threaded signal handler. - * - state: The state information. * * - buffer: A buffer used for processing files. * - ids: A cache for FLL IDs. @@ -49,6 +47,7 @@ extern "C" { #ifndef _di_fss_identify_setting_t_ typedef struct { uint16_t flag; + f_state_t state; f_number_unsigned_t current; f_number_unsigned_t line; @@ -56,9 +55,6 @@ extern "C" { f_range_t range; - f_status_t status_signal; - f_state_t state; - f_file_t file; f_string_dynamic_t buffer; @@ -70,12 +66,11 @@ extern "C" { #define fss_identify_setting_t_initialize \ { \ fss_identify_main_flag_none_d, \ + f_state_t_initialize, \ 0, \ 0, \ 0, \ f_range_t_initialize, \ - F_okay, \ - f_state_t_initialize, \ f_file_t_initialize, \ f_string_dynamic_t_initialize, \ f_fll_ids_t_initialize, \ diff --git a/level_3/fss_identify/c/main/signal.c b/level_3/fss_identify/c/main/signal.c index 42ffca4..61262d7 100644 --- a/level_3/fss_identify/c/main/signal.c +++ b/level_3/fss_identify/c/main/signal.c @@ -7,10 +7,11 @@ extern "C" { #if !defined(_di_fss_identify_signal_check_) && defined(_di_thread_support_) f_status_t fss_identify_signal_check(fss_identify_main_t * const main) { - if (!main || main->program.signal.id == -1) return F_false; + if (!main) return F_false; + if (main->program.signal_received) return F_true; if (!((++main->program.signal_check) % fss_identify_signal_check_d)) { - if (fll_program_standard_signal_received(&main->program)) { + if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) { fll_program_print_signal_received(&main->program.warning, main->program.signal_received); main->setting.state.status = F_status_set_error(F_interrupt); @@ -47,13 +48,6 @@ extern "C" { if (!main) return; - siginfo_t information; - f_number_unsigned_t failsafe = 0; - - memset(&information, 0, sizeof(siginfo_t)); - - main->program.signal_received = 0; - f_signal_set_empty(&main->program.signal.set); f_signal_set_add(F_signal_abort, &main->program.signal.set); f_signal_set_add(F_signal_broken_pipe, &main->program.signal.set); @@ -62,45 +56,9 @@ extern "C" { f_signal_set_add(F_signal_quit, &main->program.signal.set); f_signal_set_add(F_signal_termination, &main->program.signal.set); - if (main->program.signal.id == -1) { - main->setting.status_signal = f_signal_open(&main->program.signal); - - if (F_status_is_error(main->setting.status_signal)) { - main->program.signal_received = F_signal_abort; - - return; - } - } - - do { - memset(&information, 0, sizeof(siginfo_t)); - - 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 >= fss_identify_signal_check_failsafe_d) break; - } - - switch (information.si_signo) { - case F_signal_abort: - case F_signal_broken_pipe: - case F_signal_hangup: - case F_signal_interrupt: - case F_signal_quit: - case F_signal_termination: - main->program.signal_received = information.si_signo; - - break; - } - - failsafe = 0; - main->setting.status_signal = F_okay; - - } while (!main->program.signal_received); - - f_signal_close(&main->program.signal); + fll_program_standard_signal_received_wait(&main->program, fss_identify_signal_check_failsafe_d); - if (F_status_is_error(main->setting.status_signal)) { + if (F_status_is_error(main->program.signal_status) && F_status_set_fine(main->program.signal_status) != F_interrupt) { main->program.signal_received = F_signal_abort; } } diff --git a/level_3/fss_identify/c/main/signal.h b/level_3/fss_identify/c/main/signal.h index 594492c..0aeba76 100644 --- a/level_3/fss_identify/c/main/signal.h +++ b/level_3/fss_identify/c/main/signal.h @@ -66,14 +66,11 @@ extern "C" { * The main program and settings data. * * This alters main.program.signal_received, setting it to a received signal. + * This alters main.program.signal_status. * - * This alters main.setting.state.status: - * Errors (with error bit) from: f_signal_open() - * Errors (with error bit) from: f_signal_wait() + * This does not alter main.setting.state.status. * - * @see f_signal_close() - * @see f_signal_open() - * @see f_signal_wait() + * @see fll_program_standard_signal_received_wait() */ #if !defined(_di_fss_identify_signal_handler_) && !defined(_di_thread_support_) extern void fss_identify_signal_handler(fss_identify_main_t * const main); diff --git a/level_3/fss_read/c/main/common/type.h b/level_3/fss_read/c/main/common/type.h index 2dc576d..6c56605 100644 --- a/level_3/fss_read/c/main/common/type.h +++ b/level_3/fss_read/c/main/common/type.h @@ -226,9 +226,7 @@ extern "C" { * feature: Flags not passed to the main function but instead assigned by individual standards to designate how they work. * flag: Flags passed to the main function. * delimit_mode: The delimit mode. - * - * status_signal: A status used eclusively by the threaded signal handler. - * state: The state data used when processing the FSS data. + * state: The state data used when processing the FSS data. * * delimit_depth: The delimit depth. * select: The Content to select (column number). @@ -258,8 +256,6 @@ extern "C" { uint16_t feature; uint32_t flag; uint8_t delimit_mode; - - f_status_t status_signal; f_state_t state; f_number_unsigned_t delimit_depth; @@ -293,7 +289,6 @@ extern "C" { fss_read_main_flag_none_d, \ fss_read_feature_flag_none_d, \ fss_read_delimit_mode_all_e, \ - F_okay, \ macro_f_state_t_initialize_1(fss_read_allocation_large_d, fss_read_allocation_small_d, F_okay, 0, 0, &fll_program_standard_signal_handle, 0, 0, 0, 0), \ 0, \ 0, \ diff --git a/level_3/fss_read/c/main/signal.c b/level_3/fss_read/c/main/signal.c index 78c45c8..023cb5b 100644 --- a/level_3/fss_read/c/main/signal.c +++ b/level_3/fss_read/c/main/signal.c @@ -7,10 +7,11 @@ extern "C" { #if !defined(_di_fss_read_signal_check_) && defined(_di_thread_support_) f_status_t fss_read_signal_check(fss_read_main_t * const main) { - if (!main || main->program.signal.id == -1) return F_false; + if (!main) return F_false; + if (main->program.signal_received) return F_true; if (!((++main->program.signal_check) % fss_read_signal_check_d)) { - if (fll_program_standard_signal_received(&main->program)) { + if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) { fll_program_print_signal_received(&main->program.warning, main->program.signal_received); main->setting.state.status = F_status_set_error(F_interrupt); @@ -47,13 +48,6 @@ extern "C" { if (!main) return; - siginfo_t information; - f_number_unsigned_t failsafe = 0; - - memset(&information, 0, sizeof(siginfo_t)); - - main->program.signal_received = 0; - f_signal_set_empty(&main->program.signal.set); f_signal_set_add(F_signal_abort, &main->program.signal.set); f_signal_set_add(F_signal_broken_pipe, &main->program.signal.set); @@ -62,45 +56,9 @@ extern "C" { f_signal_set_add(F_signal_quit, &main->program.signal.set); f_signal_set_add(F_signal_termination, &main->program.signal.set); - if (main->program.signal.id == -1) { - main->setting.status_signal = f_signal_open(&main->program.signal); - - if (F_status_is_error(main->setting.status_signal)) { - main->program.signal_received = F_signal_abort; - - return; - } - } - - do { - memset(&information, 0, sizeof(siginfo_t)); - - 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 >= fss_read_signal_check_failsafe_d) break; - } - - switch (information.si_signo) { - case F_signal_abort: - case F_signal_broken_pipe: - case F_signal_hangup: - case F_signal_interrupt: - case F_signal_quit: - case F_signal_termination: - main->program.signal_received = information.si_signo; - - break; - } - - failsafe = 0; - main->setting.status_signal = F_okay; - - } while (!main->program.signal_received); - - f_signal_close(&main->program.signal); + fll_program_standard_signal_received_wait(&main->program, fss_read_signal_check_failsafe_d); - if (F_status_is_error(main->setting.status_signal)) { + if (F_status_is_error(main->program.signal_status) && F_status_set_fine(main->program.signal_status) != F_interrupt) { main->program.signal_received = F_signal_abort; } } diff --git a/level_3/fss_read/c/main/signal.h b/level_3/fss_read/c/main/signal.h index 0b82211..6925b98 100644 --- a/level_3/fss_read/c/main/signal.h +++ b/level_3/fss_read/c/main/signal.h @@ -66,14 +66,11 @@ extern "C" { * The main program and settings data. * * This alters main.program.signal_received, setting it to a received signal. + * This alters main.program.signal_status. * - * This alters main.setting.state.status: - * Errors (with error bit) from: f_signal_open() - * Errors (with error bit) from: f_signal_wait() + * This does not alter main.setting.state.status. * - * @see f_signal_close() - * @see f_signal_open() - * @see f_signal_wait() + * @see fll_program_standard_signal_received_wait() */ #if !defined(_di_fss_read_signal_handler_) && !defined(_di_thread_support_) extern void fss_read_signal_handler(fss_read_main_t * const main); diff --git a/level_3/fss_write/c/main/common/type.h b/level_3/fss_write/c/main/common/type.h index dcd3ec7..f94dbaa 100644 --- a/level_3/fss_write/c/main/common/type.h +++ b/level_3/fss_write/c/main/common/type.h @@ -62,10 +62,8 @@ extern "C" { * * For all function pointers on this structure, the main variable must be of type fss_write_main_t. * - * flag: Flags passed to the main function. - * - * status_signal: A status used eclusively by the threaded signal handler. - * state: The state data used when processing the FSS data. + * flag: Flags passed to the main function. + * state: The state data used when processing the FSS data. * * range: A range used in conjunction with some buffer during processing. * @@ -89,8 +87,6 @@ extern "C" { #ifndef _di_fss_write_setting_t_ typedef struct { uint32_t flag; - - f_status_t status_signal; f_state_t state; f_range_t range; @@ -115,7 +111,6 @@ extern "C" { #define fss_write_setting_t_initialize \ { \ fss_write_main_flag_none_d, \ - F_okay, \ macro_f_state_t_initialize_1(fss_write_allocation_large_d, fss_write_allocation_small_d, F_okay, 0, 0, &fll_program_standard_signal_handle, 0, 0, 0, 0), \ f_range_t_initialize, \ f_string_static_t_initialize, \ diff --git a/level_3/fss_write/c/main/signal.c b/level_3/fss_write/c/main/signal.c index 4b71733..2b45589 100644 --- a/level_3/fss_write/c/main/signal.c +++ b/level_3/fss_write/c/main/signal.c @@ -7,10 +7,11 @@ extern "C" { #if !defined(_di_fss_write_signal_check_) && defined(_di_thread_support_) f_status_t fss_write_signal_check(fss_write_main_t * const main) { - if (!main || main->program.signal.id == -1) return F_false; + if (!main) return F_false; + if (main->program.signal_received) return F_true; if (!((++main->program.signal_check) % fss_write_signal_check_d)) { - if (fll_program_standard_signal_received(&main->program)) { + if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) { fll_program_print_signal_received(&main->program.warning, main->program.signal_received); main->setting.state.status = F_status_set_error(F_interrupt); @@ -47,13 +48,6 @@ extern "C" { if (!main) return; - siginfo_t information; - f_number_unsigned_t failsafe = 0; - - memset(&information, 0, sizeof(siginfo_t)); - - main->program.signal_received = 0; - f_signal_set_empty(&main->program.signal.set); f_signal_set_add(F_signal_abort, &main->program.signal.set); f_signal_set_add(F_signal_broken_pipe, &main->program.signal.set); @@ -62,45 +56,9 @@ extern "C" { f_signal_set_add(F_signal_quit, &main->program.signal.set); f_signal_set_add(F_signal_termination, &main->program.signal.set); - if (main->program.signal.id == -1) { - main->setting.status_signal = f_signal_open(&main->program.signal); - - if (F_status_is_error(main->setting.status_signal)) { - main->program.signal_received = F_signal_abort; - - return; - } - } - - do { - memset(&information, 0, sizeof(siginfo_t)); - - 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 >= fss_write_signal_check_failsafe_d) break; - } - - switch (information.si_signo) { - case F_signal_abort: - case F_signal_broken_pipe: - case F_signal_hangup: - case F_signal_interrupt: - case F_signal_quit: - case F_signal_termination: - main->program.signal_received = information.si_signo; - - break; - } - - failsafe = 0; - main->setting.status_signal = F_okay; - - } while (!main->program.signal_received); - - f_signal_close(&main->program.signal); + fll_program_standard_signal_received_wait(&main->program, fss_write_signal_check_failsafe_d); - if (F_status_is_error(main->setting.status_signal)) { + if (F_status_is_error(main->program.signal_status) && F_status_set_fine(main->program.signal_status) != F_interrupt) { main->program.signal_received = F_signal_abort; } } diff --git a/level_3/fss_write/c/main/signal.h b/level_3/fss_write/c/main/signal.h index 9c5c310..b301fa1 100644 --- a/level_3/fss_write/c/main/signal.h +++ b/level_3/fss_write/c/main/signal.h @@ -66,14 +66,11 @@ extern "C" { * The main program and settings data. * * This alters main.program.signal_received, setting it to a received signal. + * This alters main.program.signal_status. * - * This alters main.setting.state.status: - * Errors (with error bit) from: f_signal_open() - * Errors (with error bit) from: f_signal_wait() + * This does not alter main.setting.state.status. * - * @see f_signal_close() - * @see f_signal_open() - * @see f_signal_wait() + * @see fll_program_standard_signal_received_wait() */ #if !defined(_di_fss_write_signal_handler_) && !defined(_di_thread_support_) extern void fss_write_signal_handler(fss_write_main_t * const main); diff --git a/level_3/iki_read/c/main/common/type.h b/level_3/iki_read/c/main/common/type.h index 631c22c..f5c5abc 100644 --- a/level_3/iki_read/c/main/common/type.h +++ b/level_3/iki_read/c/main/common/type.h @@ -91,10 +91,8 @@ extern "C" { * These program settings are often processed from the program arguments (often called the command line arguments). * * Properties: - * - flag: Flags passed to the main function. - * - * - status_signal: A status used eclusively by the threaded signal handler. - * - state: The state data used when processing the FSS data. + * - flag: Flags passed to the main function. + * - state: The state data used when processing the FSS data. * * - at: The position representing the "at" index. * - line: The position representing the "line" index. @@ -114,8 +112,6 @@ extern "C" { #ifndef _di_iki_read_setting_t_ typedef struct { uint32_t flag; - - f_status_t status_signal; f_state_t state; f_number_unsigned_t at; @@ -137,7 +133,6 @@ extern "C" { #define iki_read_setting_t_initialize \ { \ iki_read_main_flag_none_d, \ - F_okay, \ macro_f_state_t_initialize_1(iki_read_allocation_large_d, iki_read_allocation_small_d, F_okay, 0, 0, 0, 0, 0, 0, 0), \ 0, \ 0, \ diff --git a/level_3/iki_read/c/main/signal.c b/level_3/iki_read/c/main/signal.c index 6ac504b..56cc1eb 100644 --- a/level_3/iki_read/c/main/signal.c +++ b/level_3/iki_read/c/main/signal.c @@ -7,10 +7,11 @@ extern "C" { #if !defined(_di_iki_read_signal_check_) && defined(_di_thread_support_) f_status_t iki_read_signal_check(iki_read_main_t * const main) { - if (!main || main->program.signal.id == -1) return F_false; + if (!main) return F_false; + if (main->program.signal_received) return F_true; if (!((++main->program.signal_check) % iki_read_signal_check_d)) { - if (fll_program_standard_signal_received(&main->program)) { + if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) { fll_program_print_signal_received(&main->program.warning, main->program.signal_received); main->setting.state.status = F_status_set_error(F_interrupt); @@ -47,13 +48,6 @@ extern "C" { if (!main) return; - siginfo_t information; - f_number_unsigned_t failsafe = 0; - - memset(&information, 0, sizeof(siginfo_t)); - - main->program.signal_received = 0; - f_signal_set_empty(&main->program.signal.set); f_signal_set_add(F_signal_abort, &main->program.signal.set); f_signal_set_add(F_signal_broken_pipe, &main->program.signal.set); @@ -62,45 +56,9 @@ extern "C" { f_signal_set_add(F_signal_quit, &main->program.signal.set); f_signal_set_add(F_signal_termination, &main->program.signal.set); - if (main->program.signal.id == -1) { - main->setting.status_signal = f_signal_open(&main->program.signal); - - if (F_status_is_error(main->setting.status_signal)) { - main->program.signal_received = F_signal_abort; - - return; - } - } - - do { - memset(&information, 0, sizeof(siginfo_t)); - - 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 >= iki_read_signal_check_failsafe_d) break; - } - - switch (information.si_signo) { - case F_signal_abort: - case F_signal_broken_pipe: - case F_signal_hangup: - case F_signal_interrupt: - case F_signal_quit: - case F_signal_termination: - main->program.signal_received = information.si_signo; - - break; - } - - failsafe = 0; - main->setting.status_signal = F_okay; - - } while (!main->program.signal_received); - - f_signal_close(&main->program.signal); + fll_program_standard_signal_received_wait(&main->program, iki_read_signal_check_failsafe_d); - if (F_status_is_error(main->setting.status_signal)) { + if (F_status_is_error(main->program.signal_status) && F_status_set_fine(main->program.signal_status) != F_interrupt) { main->program.signal_received = F_signal_abort; } } diff --git a/level_3/iki_read/c/main/signal.h b/level_3/iki_read/c/main/signal.h index bcec0e2..a8ece07 100644 --- a/level_3/iki_read/c/main/signal.h +++ b/level_3/iki_read/c/main/signal.h @@ -66,14 +66,11 @@ extern "C" { * The main program and settings data. * * This alters main.program.signal_received, setting it to a received signal. + * This alters main.program.signal_status. * - * This alters main.setting.state.status: - * Errors (with error bit) from: f_signal_open() - * Errors (with error bit) from: f_signal_wait() + * This does not alter main.setting.state.status. * - * @see f_signal_close() - * @see f_signal_open() - * @see f_signal_wait() + * @see fll_program_standard_signal_received_wait() */ #if !defined(_di_iki_read_signal_handler_) && !defined(_di_thread_support_) extern void iki_read_signal_handler(iki_read_main_t * const main); diff --git a/level_3/iki_write/c/main/common/type.h b/level_3/iki_write/c/main/common/type.h index 05e08fb..29f8a18 100644 --- a/level_3/iki_write/c/main/common/type.h +++ b/level_3/iki_write/c/main/common/type.h @@ -83,10 +83,8 @@ extern "C" { * These program settings are often processed from the program arguments (often called the command line arguments). * * Properties: - * - flag: Flags passed to the main function. - * - * - status_signal: A status used eclusively by the threaded signal handler. - * - state: The state data used when processing the FSS data. + * - flag: Flags passed to the main function. + * - state: The state data used when processing the FSS data. * * - quote: This holds the quote used during processing. * @@ -96,8 +94,6 @@ extern "C" { #ifndef _di_iki_write_setting_t_ typedef struct { uint16_t flag; - - f_status_t status_signal; f_state_t state; f_string_static_t quote; @@ -109,7 +105,6 @@ extern "C" { #define iki_write_setting_t_initialize \ { \ iki_write_main_flag_none_d, \ - F_okay, \ f_state_t_initialize, \ f_string_static_t_initialize, \ f_string_dynamics_t_initialize, \ diff --git a/level_3/iki_write/c/main/signal.c b/level_3/iki_write/c/main/signal.c index d458450..6357e75 100644 --- a/level_3/iki_write/c/main/signal.c +++ b/level_3/iki_write/c/main/signal.c @@ -7,10 +7,11 @@ extern "C" { #if !defined(_di_iki_write_signal_check_) && defined(_di_thread_support_) f_status_t iki_write_signal_check(iki_write_main_t * const main) { - if (!main || main->program.signal.id == -1) return F_false; + if (!main) return F_false; + if (main->program.signal_received) return F_true; if (!((++main->program.signal_check) % iki_write_signal_check_d)) { - if (fll_program_standard_signal_received(&main->program)) { + if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) { fll_program_print_signal_received(&main->program.warning, main->program.signal_received); main->setting.state.status = F_status_set_error(F_interrupt); @@ -47,13 +48,6 @@ extern "C" { if (!main) return; - siginfo_t information; - f_number_unsigned_t failsafe = 0; - - memset(&information, 0, sizeof(siginfo_t)); - - main->program.signal_received = 0; - f_signal_set_empty(&main->program.signal.set); f_signal_set_add(F_signal_abort, &main->program.signal.set); f_signal_set_add(F_signal_broken_pipe, &main->program.signal.set); @@ -62,45 +56,9 @@ extern "C" { f_signal_set_add(F_signal_quit, &main->program.signal.set); f_signal_set_add(F_signal_termination, &main->program.signal.set); - if (main->program.signal.id == -1) { - main->setting.status_signal = f_signal_open(&main->program.signal); - - if (F_status_is_error(main->setting.status_signal)) { - main->program.signal_received = F_signal_abort; - - return; - } - } - - do { - memset(&information, 0, sizeof(siginfo_t)); - - 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 >= iki_write_signal_check_failsafe_d) break; - } - - switch (information.si_signo) { - case F_signal_abort: - case F_signal_broken_pipe: - case F_signal_hangup: - case F_signal_interrupt: - case F_signal_quit: - case F_signal_termination: - main->program.signal_received = information.si_signo; - - break; - } - - failsafe = 0; - main->setting.status_signal = F_okay; - - } while (!main->program.signal_received); - - f_signal_close(&main->program.signal); + fll_program_standard_signal_received_wait(&main->program, iki_write_signal_check_failsafe_d); - if (F_status_is_error(main->setting.status_signal)) { + if (F_status_is_error(main->program.signal_status) && F_status_set_fine(main->program.signal_status) != F_interrupt) { main->program.signal_received = F_signal_abort; } } diff --git a/level_3/iki_write/c/main/signal.h b/level_3/iki_write/c/main/signal.h index 8918773..9940896 100644 --- a/level_3/iki_write/c/main/signal.h +++ b/level_3/iki_write/c/main/signal.h @@ -66,14 +66,11 @@ extern "C" { * The main program and settings data. * * This alters main.program.signal_received, setting it to a received signal. + * This alters main.program.signal_status. * - * This alters main.setting.state.status: - * Errors (with error bit) from: f_signal_open() - * Errors (with error bit) from: f_signal_wait() + * This does not alter main.setting.state.status. * - * @see f_signal_close() - * @see f_signal_open() - * @see f_signal_wait() + * @see fll_program_standard_signal_received_wait() */ #if !defined(_di_iki_write_signal_handler_) && !defined(_di_thread_support_) extern void iki_write_signal_handler(iki_write_main_t * const main); diff --git a/level_3/status_code/c/main/common/type.h b/level_3/status_code/c/main/common/type.h index fe08127..4efd0eb 100644 --- a/level_3/status_code/c/main/common/type.h +++ b/level_3/status_code/c/main/common/type.h @@ -29,10 +29,8 @@ extern "C" { * This is passed to the program-specific main entry point to designate program settings. * These program settings are often processed from the program arguments (often called the command line arguments). * - * flag: Flags passed to the main function. - * - * status_signal: A status used eclusively by the threaded signal handler. - * state: The state data used when processing the FSS data. + * flag: Flags passed to the main function. + * state: The state data used when processing the FSS data. * * status_string_from: A pointer to the status string function (usually either fl_status_string_from() or fll_fss_status_string_from()). * status_string_to: A pointer to the status string function (usually either f_status_string_to() or fll_fss_status_string_to()). @@ -41,8 +39,6 @@ extern "C" { #ifndef _di_status_code_setting_t_ typedef struct { uint16_t flag; - - f_status_t status_signal; f_state_t state; const f_string_static_t *program_name; @@ -56,7 +52,6 @@ extern "C" { #define status_code_setting_t_initialize \ { \ status_code_main_flag_none_d, \ - F_okay, \ f_state_t_initialize, \ 0, \ 0, \ diff --git a/level_3/status_code/c/main/signal.c b/level_3/status_code/c/main/signal.c index e82931e..183446b 100644 --- a/level_3/status_code/c/main/signal.c +++ b/level_3/status_code/c/main/signal.c @@ -7,10 +7,11 @@ extern "C" { #if !defined(_di_status_code_signal_check_) && defined(_di_thread_support_) f_status_t status_code_signal_check(status_code_main_t * const main) { - if (!main || main->program.signal.id == -1) return F_false; + if (!main) return F_false; + if (main->program.signal_received) return F_true; if (!((++main->program.signal_check) % status_code_signal_check_d)) { - if (fll_program_standard_signal_received(&main->program)) { + if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) { fll_program_print_signal_received(&main->program.warning, main->program.signal_received); main->setting.state.status = F_status_set_error(F_interrupt); @@ -47,13 +48,6 @@ extern "C" { if (!main) return; - siginfo_t information; - f_number_unsigned_t failsafe = 0; - - memset(&information, 0, sizeof(siginfo_t)); - - main->program.signal_received = 0; - f_signal_set_empty(&main->program.signal.set); f_signal_set_add(F_signal_abort, &main->program.signal.set); f_signal_set_add(F_signal_broken_pipe, &main->program.signal.set); @@ -62,45 +56,9 @@ extern "C" { f_signal_set_add(F_signal_quit, &main->program.signal.set); f_signal_set_add(F_signal_termination, &main->program.signal.set); - if (main->program.signal.id == -1) { - main->setting.status_signal = f_signal_open(&main->program.signal); - - if (F_status_is_error(main->setting.status_signal)) { - main->program.signal_received = F_signal_abort; - - return; - } - } - - do { - memset(&information, 0, sizeof(siginfo_t)); - - 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 >= status_code_signal_check_failsafe_d) break; - } - - switch (information.si_signo) { - case F_signal_abort: - case F_signal_broken_pipe: - case F_signal_hangup: - case F_signal_interrupt: - case F_signal_quit: - case F_signal_termination: - main->program.signal_received = information.si_signo; - - break; - } - - failsafe = 0; - main->setting.status_signal = F_okay; - - } while (!main->program.signal_received); - - f_signal_close(&main->program.signal); + fll_program_standard_signal_received_wait(&main->program, status_code_signal_check_failsafe_d); - if (F_status_is_error(main->setting.status_signal)) { + if (F_status_is_error(main->program.signal_status) && F_status_set_fine(main->program.signal_status) != F_interrupt) { main->program.signal_received = F_signal_abort; } } diff --git a/level_3/status_code/c/main/signal.h b/level_3/status_code/c/main/signal.h index 00134c2..bf9fb19 100644 --- a/level_3/status_code/c/main/signal.h +++ b/level_3/status_code/c/main/signal.h @@ -66,14 +66,11 @@ extern "C" { * The main program and settings data. * * This alters main.program.signal_received, setting it to a received signal. + * This alters main.program.signal_status. * - * This alters main.setting.state.status: - * Errors (with error bit) from: f_signal_open() - * Errors (with error bit) from: f_signal_wait() + * This does not alter main.setting.state.status. * - * @see f_signal_close() - * @see f_signal_open() - * @see f_signal_wait() + * @see fll_program_standard_signal_received_wait() */ #if !defined(_di_status_code_signal_handler_) && !defined(_di_thread_support_) extern void status_code_signal_handler(status_code_main_t * const main); diff --git a/level_3/utf8/c/main/common/type.h b/level_3/utf8/c/main/common/type.h index 7c10c6a..fd8a089 100644 --- a/level_3/utf8/c/main/common/type.h +++ b/level_3/utf8/c/main/common/type.h @@ -30,11 +30,9 @@ extern "C" { * These program settings are often processed from the program arguments (often called the command line arguments). * * Properties: - * - mode: The input/output mode (see utf8_modes_e). - * - flag: Flags passed to the main function. - * - * - status_signal: A status used eclusively by the threaded signal handler. - * - state: The state data used when processing the FSS data. + * - mode: The input/output mode (see utf8_modes_e). + * - flag: Flags passed to the main function. + * - state: The state data used when processing the FSS data. * * - valid: Designate the output context set for valid characters. * - valid_not: Designate the output context set for invalid characters. @@ -53,8 +51,6 @@ extern "C" { typedef struct { uint8_t mode; uint16_t flag; - - f_status_t status_signal; f_state_t state; f_color_set_t valid; @@ -75,7 +71,6 @@ extern "C" { { \ utf8_mode_from_bytesequence_e | utf8_mode_to_codepoint_e, \ utf8_main_flag_none_d, \ - F_okay, \ f_state_t_initialize, \ f_color_set_t_initialize, \ f_color_set_t_initialize, \ diff --git a/level_3/utf8/c/main/signal.c b/level_3/utf8/c/main/signal.c index 35ea429..fbe1248 100644 --- a/level_3/utf8/c/main/signal.c +++ b/level_3/utf8/c/main/signal.c @@ -7,10 +7,11 @@ extern "C" { #if !defined(_di_utf8_signal_check_) && defined(_di_thread_support_) f_status_t utf8_signal_check(utf8_main_t * const main) { - if (!main || main->program.signal.id == -1) return F_false; + if (!main) return F_false; + if (main->program.signal_received) return F_true; if (!((++main->program.signal_check) % utf8_signal_check_d)) { - if (fll_program_standard_signal_received(&main->program)) { + if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) { fll_program_print_signal_received(&main->program.warning, main->program.signal_received); main->setting.state.status = F_status_set_error(F_interrupt); @@ -47,13 +48,6 @@ extern "C" { if (!main) return; - siginfo_t information; - f_number_unsigned_t failsafe = 0; - - memset(&information, 0, sizeof(siginfo_t)); - - main->program.signal_received = 0; - f_signal_set_empty(&main->program.signal.set); f_signal_set_add(F_signal_abort, &main->program.signal.set); f_signal_set_add(F_signal_broken_pipe, &main->program.signal.set); @@ -62,45 +56,9 @@ extern "C" { f_signal_set_add(F_signal_quit, &main->program.signal.set); f_signal_set_add(F_signal_termination, &main->program.signal.set); - if (main->program.signal.id == -1) { - main->setting.status_signal = f_signal_open(&main->program.signal); - - if (F_status_is_error(main->setting.status_signal)) { - main->program.signal_received = F_signal_abort; - - return; - } - } - - do { - memset(&information, 0, sizeof(siginfo_t)); - - 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 >= utf8_signal_check_failsafe_d) break; - } - - switch (information.si_signo) { - case F_signal_abort: - case F_signal_broken_pipe: - case F_signal_hangup: - case F_signal_interrupt: - case F_signal_quit: - case F_signal_termination: - main->program.signal_received = information.si_signo; - - break; - } - - failsafe = 0; - main->setting.status_signal = F_okay; - - } while (!main->program.signal_received); - - f_signal_close(&main->program.signal); + fll_program_standard_signal_received_wait(&main->program, utf8_signal_check_failsafe_d); - if (F_status_is_error(main->setting.status_signal)) { + if (F_status_is_error(main->program.signal_status) && F_status_set_fine(main->program.signal_status) != F_interrupt) { main->program.signal_received = F_signal_abort; } } diff --git a/level_3/utf8/c/main/signal.h b/level_3/utf8/c/main/signal.h index 0d5bb92..c18cf59 100644 --- a/level_3/utf8/c/main/signal.h +++ b/level_3/utf8/c/main/signal.h @@ -66,14 +66,11 @@ extern "C" { * The main program and settings data. * * This alters main.program.signal_received, setting it to a received signal. + * This alters main.program.signal_status. * - * This alters main.setting.state.status: - * Errors (with error bit) from: f_signal_open() - * Errors (with error bit) from: f_signal_wait() + * This does not alter main.setting.state.status. * - * @see f_signal_close() - * @see f_signal_open() - * @see f_signal_wait() + * @see fll_program_standard_signal_received_wait() */ #if !defined(_di_utf8_signal_handler_) && !defined(_di_thread_support_) extern void utf8_signal_handler(utf8_main_t * const main); -- 1.8.3.1