]> Kevux Git Server - fll/commitdiff
Update: Ensure all programs are handling signals, adding signal_received to fll_progr...
authorKevin Day <thekevinday@gmail.com>
Fri, 1 Apr 2022 04:42:01 +0000 (23:42 -0500)
committerKevin Day <thekevinday@gmail.com>
Fri, 1 Apr 2022 04:42:01 +0000 (23:42 -0500)
Make sure fll_program_data_t supports storing the signal.
Move the commonly written functions that are pretty much identical across programs into fll_program:
- fll_program_standard_signal_received()
- fll_program_standard_signal_state()

Increase standard signal check from 10000 to 20000.
I really dislike the signal_check logic that exists purely as a work-around to the signal handling.
Most likely the only way to do this nicely that is available without rewritting the kernel and the libc will be to implement threads.
This will not be done for the 0.6.x versions and will likely happen for the 0.8.x versions.

123 files changed:
level_2/fll_program/c/program.c
level_2/fll_program/c/program.h
level_2/fll_program/c/program/common.h
level_3/byte_dump/c/common.h
level_3/byte_dump/c/private-byte_dump.c
level_3/byte_dump/c/private-common.c
level_3/byte_dump/c/private-common.h
level_3/control/c/private-common.c
level_3/control/c/private-common.h
level_3/control/c/private-control.c
level_3/control/c/private-print.c
level_3/controller/c/controller/private-controller_print.c
level_3/controller/c/thread/private-thread_signal.c
level_3/fake/c/common.h
level_3/fake/c/fake.c
level_3/fake/c/private-build-load.c
level_3/fake/c/private-build.c
level_3/fake/c/private-common.c
level_3/fake/c/private-common.h
level_3/fake/c/private-fake.c
level_3/fake/c/private-fake.h
level_3/fake/c/private-make-load_fakefile.c
level_3/fake/c/private-make-operate.c
level_3/fake/c/private-make-operate_process.c
level_3/fake/c/private-print.c
level_3/fake/c/private-print.h
level_3/firewall/c/common.h
level_3/firewall/c/private-common.c
level_3/fss_basic_list_read/c/common.h
level_3/fss_basic_list_read/c/fss_basic_list_read.c
level_3/fss_basic_list_read/c/private-common.c
level_3/fss_basic_list_read/c/private-common.h
level_3/fss_basic_list_read/c/private-read.c
level_3/fss_basic_list_write/c/common.h
level_3/fss_basic_list_write/c/fss_basic_list_write.c
level_3/fss_basic_list_write/c/private-common.c
level_3/fss_basic_list_write/c/private-common.h
level_3/fss_basic_list_write/c/private-write.c
level_3/fss_basic_read/c/common.h
level_3/fss_basic_read/c/fss_basic_read.c
level_3/fss_basic_read/c/private-common.c
level_3/fss_basic_read/c/private-common.h
level_3/fss_basic_read/c/private-read.c
level_3/fss_basic_write/c/common.h
level_3/fss_basic_write/c/fss_basic_write.c
level_3/fss_basic_write/c/private-common.c
level_3/fss_basic_write/c/private-common.h
level_3/fss_basic_write/c/private-write.c
level_3/fss_basic_write/c/private-write.h
level_3/fss_embedded_list_read/c/common.h
level_3/fss_embedded_list_read/c/fss_embedded_list_read.c
level_3/fss_embedded_list_read/c/private-common.c
level_3/fss_embedded_list_read/c/private-common.h
level_3/fss_embedded_list_read/c/private-read.c
level_3/fss_embedded_list_write/c/common.h
level_3/fss_embedded_list_write/c/fss_embedded_list_write.c
level_3/fss_embedded_list_write/c/private-common.c
level_3/fss_embedded_list_write/c/private-common.h
level_3/fss_embedded_list_write/c/private-write.c
level_3/fss_extended_list_read/c/common.h
level_3/fss_extended_list_read/c/fss_extended_list_read.c
level_3/fss_extended_list_read/c/private-common.c
level_3/fss_extended_list_read/c/private-common.h
level_3/fss_extended_list_read/c/private-read.c
level_3/fss_extended_list_write/c/common.h
level_3/fss_extended_list_write/c/fss_extended_list_write.c
level_3/fss_extended_list_write/c/private-common.c
level_3/fss_extended_list_write/c/private-common.h
level_3/fss_extended_list_write/c/private-write.c
level_3/fss_extended_read/c/common.h
level_3/fss_extended_read/c/fss_extended_read.c
level_3/fss_extended_read/c/private-common.c
level_3/fss_extended_read/c/private-common.h
level_3/fss_extended_read/c/private-read.c
level_3/fss_extended_write/c/common.h
level_3/fss_extended_write/c/fss_extended_write.c
level_3/fss_extended_write/c/private-common.c
level_3/fss_extended_write/c/private-common.h
level_3/fss_extended_write/c/private-write.c
level_3/fss_identify/c/common.h
level_3/fss_identify/c/fss_identify.c
level_3/fss_identify/c/private-common.c
level_3/fss_identify/c/private-common.h
level_3/fss_identify/c/private-identify.c
level_3/fss_payload_read/c/common.h
level_3/fss_payload_read/c/fss_payload_read.c
level_3/fss_payload_read/c/private-common.c
level_3/fss_payload_read/c/private-common.h
level_3/fss_payload_read/c/private-read.c
level_3/fss_payload_write/c/common.h
level_3/fss_payload_write/c/fss_payload_write.c
level_3/fss_payload_write/c/private-common.c
level_3/fss_payload_write/c/private-common.h
level_3/fss_payload_write/c/private-write.c
level_3/fss_status_code/c/common.h
level_3/fss_status_code/c/fss_status_code.c
level_3/fss_status_code/c/private-common.c
level_3/fss_status_code/c/private-common.h
level_3/iki_read/c/common.h
level_3/iki_read/c/iki_read.c
level_3/iki_read/c/private-common.c
level_3/iki_read/c/private-common.h
level_3/iki_read/c/private-read.c
level_3/iki_write/c/common.h
level_3/iki_write/c/iki_write.c
level_3/iki_write/c/private-common.c
level_3/iki_write/c/private-common.h
level_3/status_code/c/common.h
level_3/status_code/c/private-common.c
level_3/status_code/c/private-common.h
level_3/status_code/c/status_code.c
level_3/utf8/c/common.h
level_3/utf8/c/private-common.c
level_3/utf8/c/private-common.h
level_3/utf8/c/private-print.c
level_3/utf8/c/private-utf8.c
level_3/utf8/c/private-utf8.h
level_3/utf8/c/private-utf8_binary.c
level_3/utf8/c/private-utf8_binary.h
level_3/utf8/c/private-utf8_codepoint.c
level_3/utf8/c/private-utf8_codepoint.h
level_3/utf8/c/utf8.c
level_3/utf8/c/utf8.h

index a460303d620bfef01b064666b5a66bc03ee1eef6..0c9fe911a5b9a8edce4cbcc776339fa19c924e43 100644 (file)
@@ -320,6 +320,58 @@ extern "C" {
   }
 #endif // _di_fll_program_standard_setup_
 
+#ifndef _di_fll_program_standard_signal_received_
+  f_status_t fll_program_standard_signal_received(fll_program_data_t * const main) {
+
+    if (main->signal.id == -1) {
+      return F_false;
+    }
+
+    struct signalfd_siginfo information;
+
+    memset(&information, 0, sizeof(struct signalfd_siginfo));
+
+    if (f_signal_read(main->signal, 0, &information) == F_signal) {
+      switch (information.ssi_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:
+          return information.ssi_signo;
+      }
+    }
+
+    return F_false;
+  }
+#endif // _di_fss_basic_read_signal_received_
+
+#ifndef _di_fll_program_standard_signal_state_
+  f_status_t fll_program_standard_signal_state(void * const state, void * const internal) {
+
+    if (!state) {
+      return F_interrupt_not;
+    }
+
+    f_state_t *state_ptr = (f_state_t *) state;
+
+    if (!state_ptr->custom) {
+      return F_interrupt_not;
+    }
+
+    fll_program_data_t *main = (fll_program_data_t *) state_ptr->custom;
+
+    main->signal_received = fll_program_standard_signal_received(main);
+
+    if (main->signal_received == F_signal_abort || main->signal_received == F_signal_broken_pipe || main->signal_received == F_signal_hangup || main->signal_received == F_signal_interrupt || main->signal_received == F_signal_quit || main->signal_received == F_signal_termination) {
+      return F_status_set_error(F_interrupt);
+    }
+
+    return F_interrupt_not;
+  }
+#endif // _di_fll_program_standard_signal_state_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index bbf1bf14edd8f1d43181bbe77c633e2f4e9bf36c..f44fdc2ecfc47ab91ca8e97db8d7a1e75f61d33d 100644 (file)
@@ -401,6 +401,62 @@ extern "C" {
   extern f_status_t fll_program_standard_setup(f_signal_t * const signal);
 #endif // _di_fll_program_standard_setup_
 
+/**
+ * Check to see if a process signal is received.
+ *
+ * Only signals that are blocked via main.signal will be received.
+ *
+ * If no signals are blocked, then this always returns F_false.
+ *
+ * @param main
+ *   The main program data.
+ *   The main->signal must be used to designate blocked signals.
+ *
+ * @return
+ *   A positive number representing a valid signal on signal received.
+ *   F_false on no signal received.
+ *
+ * @see f_signal_read()
+ */
+#ifndef _di_fss_basic_read_signal_received_
+  extern f_status_t fll_program_standard_signal_received(fll_program_data_t * const main);
+#endif // _di_fss_basic_read_signal_received_
+
+/**
+ * Standardized callback for checking for interrupts via the f_state_t interrupt callback.
+ *
+ * This only checks for the signals:
+ *   - F_signal_abort
+ *   - F_signal_broken_pipe
+ *   - F_signal_hangup
+ *   - F_signal_interrupt
+ *   - F_signal_quit
+ *   - F_signal_termination
+ *
+ * These signals may not be checked if they are not also blocked via the fll_program_data_t.signals variable.
+ *
+ * When one of the above signals is both blocked and received, then this calls fll_program_standard_signal_received().
+ *
+ * @param state
+ *   The state data.
+ *   This must be of type (f_state_t *).
+ *
+ *   When constructing the f_state_t variable, a fll_program_data_t pointer must be passed into the f_state_t.custom variable.
+ *   This requires the state.custom variable to be of type (fll_program_data_t *).
+ * @param internal
+ *   Not used.
+ *
+ * @return
+ *   F_interrupt_not if not interrupted.
+ *
+ *   F_interrupt (with error bit) if interrupted.
+ *
+ * @see fll_program_standard_signal_received()
+ */
+#ifndef _di_fll_program_standard_signal_state_
+  extern f_status_t fll_program_standard_signal_state(void * const state, void * const internal);
+#endif // _di_fll_program_standard_signal_state_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 90fa9e4b9eaec3a316ae075217bc51972f364b63..5876b39e55fac9f4df49744af0bb13ecc6465865 100644 (file)
@@ -35,34 +35,36 @@ extern "C" {
  * The umask() has design flaws as per specification that requires the umask be changed to read the value!
  * As a work-around, a umask variable is provided here so that umask() only ever need be called once.
  *
- * child:        Reserved for a child process, often representing the child return status or the child process ID.
- * context:      The color context.
- * error:        The output file for error printing.
- * output:       The output file for general printing.
- * parameters:   The state of pre-defined parameters passed to the program.
- * pid:          The PID of the program.
- * process_pipe: Designate whether or not to process the input pipe.
- * signal:       The process signal management structure.
- * signal_check: A counter used to map to for reducing the amount of actual signal check calls.
- * umask:        The umask settings, needed for avoiding calls to umask() to read the current umask.
- * warning:      The output file for warning printing.
+ * child:           Reserved for a child process, often representing the child return status or the child process ID.
+ * context:         The color context.
+ * error:           The output file for error printing.
+ * output:          The output file for general printing.
+ * parameters:      The state of pre-defined parameters passed to the program.
+ * pid:             The PID of the program.
+ * process_pipe:    Designate whether or not to process the input pipe.
+ * signal:          The process signal management structure.
+ * 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).
+ * umask:           The umask settings, needed for avoiding calls to umask() to read the current umask.
+ * warning:         The output file for warning printing.
  */
 #ifndef _di_fll_program_data_t_
   typedef struct {
     f_console_parameters_t parameters;
 
-    uint16_t signal_check;
     mode_t umask;
     pid_t pid;
-    bool process_pipe;
     int child;
+    bool process_pipe;
+
+    int signal_received;
+    uint16_t signal_check;
+    f_signal_t signal;
 
     fl_print_t output;
     fl_print_t error;
     fl_print_t warning;
 
-    f_signal_t signal;
-
     f_color_context_t context;
   } fll_program_data_t;
 
@@ -72,23 +74,27 @@ extern "C" {
       0, \
       0, \
       0, \
-      0, \
       F_false, \
+      0, \
+      0, \
+      f_signal_t_initialize, \
       fl_print_t_initialize, \
       macro_fl_print_t_initialize_error(), \
       macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
       f_color_context_t_initialize, \
     }
 
-  #define macro_fll_program_data_t_initialize(parameters, signal_check, process_pipe, output, error, warning, signal, context) { \
-    parameters, \
-    signal_check, \
+  #define macro_fll_program_data_t_initialize(umask, pid, child, process_pipe, signal_received, signal_check, signal, output, error, warning, context) { \
+    umask, \
+    pid, \
+    child, \
     process_pipe, \
+    signal_received, \
+    signal_check, \
+    signal, \
     output, \
     error, \
     warning, \
-    signal, \
     context, \
   }
 #endif // _di_fll_program_data_t_
index a75ef87fc54812072f848b92cee638fe88962f57..d9249c476bac891e43f3f376331497c965e71e91 100644 (file)
@@ -121,7 +121,7 @@ extern "C" {
 
   #define byte_dump_option_wide_d 0x1
 
-  #define byte_dump_signal_check_d 10000
+  #define byte_dump_signal_check_d 20000
 
   #define BYTE_DUMP_character_wall_s        "|"
   #define BYTE_DUMP_character_placeholder_s "␣" // Other likely choices: (substitute form 1: '␚', substitute form 2: '␦').
index 99cf1427bf5e94621bb4a62852bd451f83c6895c..3ee16c41f0c6978ab9460019ab9cb3b1a273be95 100644 (file)
@@ -60,7 +60,9 @@ extern "C" {
       for (;;) {
 
         if (!((++data->main->signal_check) % byte_dump_signal_check_d)) {
-          if (byte_dump_signal_received(data)) {
+          if (fll_program_standard_signal_received(data->main)) {
+            byte_dump_print_signal_received(data);
+
             return F_status_set_error(F_interrupt);
           }
 
index 6cad075dd6a6ef53ffab749199b5d2be1939abd3..54d8b21668db178faa4de01a699e12e63672d91d 100644 (file)
@@ -6,9 +6,9 @@ extern "C" {
 #endif
 
 #ifndef _di_byte_dump_print_signal_received_
-  void byte_dump_print_signal_received(byte_dump_data_t * const data, const f_status_t signal) {
+  void byte_dump_print_signal_received(byte_dump_data_t * const data) {
 
-    if (data->main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (data->main->warning.verbosity != f_console_verbosity_verbose_e && data->main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(data->main->warning.to.stream);
@@ -16,42 +16,13 @@ extern "C" {
     flockfile(data->main->warning.to.stream);
 
     fl_print_format("%]%r%r%[Received signal code %]", data->main->warning.to.stream, data->main->context.set.reset, f_string_eol_s, f_string_eol_s, data->main->context.set.warning, data->main->context.set.warning);
-    fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, signal, data->main->context.set.notable);
+    fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, data->main->signal_received, data->main->context.set.notable);
     fl_print_format("%[.%]%r", data->main->warning.to.stream, data->main->context.set.warning, data->main->context.set.warning, f_string_eol_s);
 
     funlockfile(data->main->warning.to.stream);
   }
 #endif // _di_byte_dump_print_signal_received_
 
-#ifndef _di_byte_dump_signal_received_
-  f_status_t byte_dump_signal_received(byte_dump_data_t * const data) {
-
-    if (data->main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(data->main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          byte_dump_print_signal_received(data, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_byte_dump_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index ad8ade3fb1d33a1760928338a9ace568b87ba2bd..559d8af996d22e3d73c5355f9756d304185247ba 100644 (file)
@@ -98,31 +98,11 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param signal
- *   The signal received.
  */
 #ifndef _di_byte_dump_print_signal_received_
-  extern void byte_dump_print_signal_received(byte_dump_data_t * const data, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void byte_dump_print_signal_received(byte_dump_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_byte_dump_print_signal_received_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_byte_dump_signal_received_
-  extern f_status_t byte_dump_signal_received(byte_dump_data_t * const data) F_attribute_visibility_internal_d;
-#endif // _di_byte_dump_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 9051a2599917b67c1395781c609aeca3ab6bf526..4c62cf9713cbbaa8d82311f68651a2b87c23bf17 100644 (file)
@@ -61,62 +61,6 @@ extern "C" {
   }
 #endif // _di_control_data_delete_
 
-#ifndef _di_control_signal_received_
-  f_status_t control_signal_received(const fll_program_data_t * const main) {
-
-    if (main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          control_print_signal_received(main, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_control_signal_received_
-
-#ifndef _di_control_signal_state_interrupt_fss_
-  f_status_t control_signal_state_interrupt_fss(void * const state, void * const internal) {
-
-    if (!state) {
-      return F_interrupt_not;
-    }
-
-    f_state_t * const state_ptr = (f_state_t *) state;
-
-    if (!state_ptr->custom) {
-      return F_interrupt_not;
-    }
-
-    fll_program_data_t * const main = (fll_program_data_t *) state_ptr->custom;
-
-    if (!((++main->signal_check) % control_signal_check_d)) {
-      if (control_signal_received(main)) {
-        return F_status_set_error(F_interrupt);
-      }
-
-      main->signal_check = 0;
-    }
-
-    return F_interrupt_not;
-  }
-#endif // _di_control_signal_state_interrupt_fss_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index bd47084d18f3b42f4675d84f975c37d11d7e2860..19b9ed82ba619448600c8ef6ae4c064c471f0ace 100644 (file)
@@ -30,7 +30,7 @@ extern "C" {
   #define control_default_buffer_limit_soft_large_d 2048
   #define control_default_buffer_limit_soft_small_d 64
 
-  #define control_signal_check_d 10000
+  #define control_signal_check_d 20000
 
   #define control_allocation_large_d 256
   #define control_allocation_small_d 16
@@ -319,41 +319,6 @@ extern "C" {
   extern void control_data_delete(control_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_control_data_delete_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_control_signal_received_
-  extern f_status_t control_signal_received(const fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_control_signal_received_
-
-/**
- * Callback passed to FSS functions for checking for interrupts.
- *
- * @param state
- *   The f_state_t data.
- * @param internal
- *   Not used.
- *
- * @return
- *   F_interrupt_not if not interrupted.
- *
- *   F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal.
- */
-#ifndef _di_control_signal_state_interrupt_fss_
-  extern f_status_t control_signal_state_interrupt_fss(void * const state, void * const internal) F_attribute_visibility_internal_d;
-#endif // _di_control_signal_state_interrupt_fss_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 7078f279ef1402216a3c654ba2563668eaf741ec..da49a2ff6498c89ac01b1ede9447e4be14963706 100644 (file)
@@ -247,7 +247,7 @@ extern "C" {
     }
 
     {
-      f_state_t state = macro_f_state_t_initialize(control_allocation_large_d, control_allocation_small_d, 0, &control_signal_state_interrupt_fss, 0, (void *) main, 0);
+      f_state_t state = macro_f_state_t_initialize(control_allocation_large_d, control_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
       f_string_range_t range_packet = macro_f_string_range_t_initialize2(data->cache.large.used);
 
       status = fll_fss_basic_list_read(data->cache.large, state, &range_packet, &data->cache.packet_objects, &data->cache.packet_contents, &data->cache.delimits, 0, 0);
index 5b031dcf3d14f8af327ecc68cb79404f03f42f40..9acb7ecb484cf408463813fadae4c5b65687fd55 100644 (file)
@@ -344,7 +344,7 @@ extern "C" {
 #ifndef _di_control_print_signal_received_
   void control_print_signal_received(const fll_program_data_t * const main, const f_status_t signal) {
 
-    if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(main->warning.to.stream);
index da77117be00b3fdf7be8043339bafb8034d847f2..230c99ed81cda095fa454d1853ca82b350717757 100644 (file)
@@ -48,7 +48,7 @@ extern "C" {
 #ifndef _di_controller_print_signal_received_
   void controller_print_signal_received(controller_main_t * const main, const f_status_t signal) {
 
-    if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(main->warning.to.stream);
index 75cbc29aae999308d9eba3175d54111bf5db4ca7..79e6f01558add04770a6cfe0ea975a675f6dd0d3 100644 (file)
@@ -55,7 +55,7 @@ extern "C" {
       return F_interrupt_not;
     }
 
-    controller_state_interrupt_t *custom = (controller_state_interrupt_t *) state_ptr->custom;
+    fll_program_data_t *main = (fll_program_data_t *) state_ptr->custom;
     controller_thread_t *thread = custom->thread;
 
     if (!controller_thread_is_enabled(custom->is_normal, thread)) {
index dec7ff9c3cf587190c7b2d9dbce6f215c15399b8..1d5233cfa23f5cbda535d10d6460e27b995f914f 100644 (file)
@@ -264,7 +264,7 @@ extern "C" {
     fake_operation_skeleton_e,
   };
 
-  #define fake_signal_check_d       10000
+  #define fake_signal_check_d       500000
   #define fake_signal_check_tiny_d  4
   #define fake_signal_check_short_d 16
 
index 91c76a58e6ad810009988c43e8f5e159f58e765e..3d61ebda19d8a1f5683703f4a00f59e0f7acae17 100644 (file)
@@ -331,10 +331,16 @@ extern "C" {
 
         if (status == F_child) break;
 
-        if (F_status_set_fine(status) == F_interrupt || !(i % fake_signal_check_short_d) && fake_signal_received(&data)) {
-          status = F_status_set_error(F_interrupt);
+        if (F_status_set_fine(status) == F_interrupt || !(i % fake_signal_check_short_d)) {
+          if (fll_program_standard_signal_received(main)) {
+            fake_print_signal_received(&data);
 
-          break;
+            status = F_status_set_error(F_interrupt);
+
+            break;
+          }
+
+          data->main->signal_check = 0;
         }
 
         if (F_status_is_error(status)) {
index c269356d118207dad72b914e515f7366aa746a73..c5f8dffb73c5e9d2452df6710ef0dfbd37014322 100644 (file)
@@ -75,7 +75,9 @@ extern "C" {
 
     if (F_status_is_error(*status)) return;
 
-    if (fake_signal_received(data)) {
+    if (fll_program_standard_signal_received(data->main)) {
+      fake_print_signal_received(data);
+
       *status = F_status_set_error(F_interrupt);
 
       return;
@@ -109,7 +111,7 @@ extern "C" {
         f_fss_delimits_t delimits = f_fss_delimits_t_initialize;
 
         {
-          f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) data, 0);
+          f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) data->main, 0);
 
           *status = fll_fss_extended_read(buffer, state, &range, &objects, &contents, 0, 0, &delimits, 0);
         }
@@ -182,7 +184,9 @@ extern "C" {
 
     if (F_status_is_error(*status) && buffer.used) return;
 
-    if (fake_signal_received(data)) {
+    if (fll_program_standard_signal_received(data->main)) {
+      fake_print_signal_received(data);
+
       *status = F_status_set_error(F_interrupt);
 
       return;
@@ -1380,7 +1384,9 @@ extern "C" {
 
     if (F_status_is_error(*status)) return;
 
-    if (fake_signal_received(data)) {
+    if (fll_program_standard_signal_received(data->main)) {
+      fake_print_signal_received(data);
+
       *status = F_status_set_error(F_interrupt);
 
       return;
index c4c4f123683b478ebf210501ea2f5ed432a20b20..c3f5fa1c5595beb50a3782580a43bd2c33c6338f 100644 (file)
@@ -348,7 +348,9 @@ extern "C" {
 
     if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return;
 
-    if (fake_signal_received(data)) {
+    if (fll_program_standard_signal_received(data->main)) {
+      fake_print_signal_received(data);
+
       *status = F_status_set_error(F_interrupt);
 
       return;
@@ -391,10 +393,16 @@ extern "C" {
 
     for (f_array_length_t i = 0; i < files.used; ++i) {
 
-      if (!(i % fake_signal_check_short_d) && fake_signal_received(data)) {
-        *status = F_status_set_error(F_interrupt);
+      if (!(i % fake_signal_check_short_d)) {
+        if (fll_program_standard_signal_received(data->main)) {
+          fake_print_signal_received(data);
 
-        break;
+          *status = F_status_set_error(F_interrupt);
+
+          break;
+        }
+
+        data->main->signal_check = 0;
       }
 
       if (!files.array[i].used) continue;
@@ -703,7 +711,9 @@ extern "C" {
 
     f_string_dynamics_resize(0, &arguments);
 
-    if (fake_signal_received(data)) {
+    if (fll_program_standard_signal_received(data->main)) {
+      fake_print_signal_received(data);
+
       *status = F_status_set_error(F_interrupt);
     }
     else if (*status != F_child) {
@@ -805,7 +815,9 @@ extern "C" {
 #ifndef _di_fake_build_operate_
   f_status_t fake_build_operate(fake_data_t * const data, const f_string_static_t setting_file) {
 
-    if (fake_signal_received(data)) {
+    if (fll_program_standard_signal_received(data->main)) {
+      fake_print_signal_received(data);
+
       return F_status_set_error(F_interrupt);
     }
 
@@ -1088,7 +1100,9 @@ extern "C" {
 
     if (F_status_is_error(*status)) return;
 
-    if (fake_signal_received(data)) {
+    if (fll_program_standard_signal_received(data->main)) {
+      fake_print_signal_received(data);
+
       *status = F_status_set_error(F_interrupt);
 
       return;
index 3e3271f58c8bd0bda8a2539aa17d270367c4bc55..6013987c9dddeae46c3affd10cbac48f8ae79c8f 100644 (file)
@@ -399,35 +399,6 @@ extern "C" {
   }
 #endif // _di_fake_make_data_delete_
 
-#ifndef _di_fake_signal_received_
-  f_status_t fake_signal_received(fake_data_t * const data) {
-
-    if (data->main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(data->main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          fake_print_signal_received(data, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_fake_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 5648d80dab7854a074cf00e5942e921b28a31b44..01a712b6582d14a6c7872a2f3142b11613eb8c33 100644 (file)
@@ -1735,24 +1735,6 @@ extern "C" {
   extern f_status_t fake_make_data_delete(fake_make_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fake_make_data_delete_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param data
- *   The program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fake_signal_received_
-  extern f_status_t fake_signal_received(fake_data_t * const data) F_attribute_visibility_internal_d;
-#endif // _di_fake_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 1b277cd2c0f14d77e0d85d3cf1c6fddc36c2b7fc..442484a769575eb4646ee1cdeb44ac285a0a9557 100644 (file)
@@ -48,7 +48,9 @@ extern "C" {
 
       *status = fll_execute_program(program, arguments, &parameter, 0, (void *) &return_code);
 
-      if (fake_signal_received(data)) {
+      if (fll_program_standard_signal_received(data->main)) {
+        fake_print_signal_received(data);
+
         *status = F_status_set_error(F_interrupt);
 
         return 0;
@@ -95,7 +97,9 @@ extern "C" {
     char *name_function = "f_file_exists";
     f_status_t status = F_none;
 
-    if (fake_signal_received(data)) {
+    if (fll_program_standard_signal_received(data->main)) {
+      fake_print_signal_received(data);
+
       return F_status_set_error(F_interrupt);
     }
 
@@ -506,64 +510,12 @@ extern "C" {
   }
 #endif // _di_fake_process_console_parameters_
 
-#ifndef _di_fake_signal_state_interrupt_fss_
-  f_status_t fake_signal_state_interrupt_fss(void * const state, void * const internal) {
-
-    if (!state) {
-      return F_interrupt_not;
-    }
-
-    f_state_t * const state_ptr = (f_state_t *) state;
-
-    if (!state_ptr->custom) {
-      return F_interrupt_not;
-    }
-
-    fake_data_t * const data = (fake_data_t *) state_ptr->custom;
-
-    if (!((++data->main->signal_check) % fake_signal_check_d)) {
-      if (fake_signal_received(data)) {
-        return F_status_set_error(F_interrupt);
-      }
-
-      data->main->signal_check = 0;
-    }
-
-    return F_interrupt_not;
-  }
-#endif // _di_fake_signal_state_interrupt_fss_
-
-#ifndef _di_fake_signal_state_interrupt_iki_
-  f_status_t fake_signal_state_interrupt_iki(void * const state, void * const internal) {
-
-    if (!state) {
-      return F_interrupt_not;
-    }
-
-    f_state_t * const state_ptr = (f_state_t *) state;
-
-    if (!state_ptr->custom) {
-      return F_interrupt_not;
-    }
-
-    fake_data_t * const data = (fake_data_t *) state_ptr->custom;
-
-    if (!((++data->main->signal_check) % fake_signal_check_d)) {
-      if (fake_signal_received(data)) {
-        return F_status_set_error(F_interrupt);
-      }
-
-      data->main->signal_check = 0;
-    }
-
-    return F_interrupt_not;
-  }
-#endif // _di_fake_signal_state_interrupt_iki_
-
 #ifndef _di_fake_validate_directories_
   f_status_t fake_validate_parameter_directories(fake_data_t * const data) {
 
-    if (fake_signal_received(data)) {
+    if (fll_program_standard_signal_received(data->main)) {
+      fake_print_signal_received(data);
+
       return F_status_set_error(F_interrupt);
     }
 
index 2692b9497b1d602a50af0f000a5c5ec3ce045f22..77e5f733496cdb4d5432fb8a989784e375e2c486 100644 (file)
@@ -75,40 +75,6 @@ extern "C" {
 #endif // _di_validate_console_parameters_
 
 /**
- * Callback passed to FSS functions for checking for interrupts.
- *
- * @param state
- *   The f_state_t data.
- * @param internal
- *   Not used.
- *
- * @return
- *   F_interrupt_not if not interrupted.
- *
- *   F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal.
- */
-#ifndef _di_fake_signal_state_interrupt_fss_
-  extern f_status_t fake_signal_state_interrupt_fss(void * const state, void * const internal) F_attribute_visibility_internal_d;
-#endif // _di_fake_signal_state_interrupt_fss_
-
-/**
- * Callback passed to IKI functions for checking for interrupts.
- *
- * @param state
- *   The f_state_t data.
- * @param internal
- *   Not used.
- *
- * @return
- *   F_interrupt_not if not interrupted.
- *
- *   F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal.
- */
-#ifndef _di_fake_signal_state_interrupt_iki_
-  extern f_status_t fake_signal_state_interrupt_iki(void * const state, void * const internal) F_attribute_visibility_internal_d;
-#endif // _di_fake_signal_state_interrupt_iki_
-
-/**
  * Validate directories and print any relating error messages.
  *
  * This should not be called for skeleton as in that case the directories probably do not exist.
index a1af103296869076e659d09def7c1eaa36df9cc4..4a6171524f707faa1c2daf1e124b0f3a7d18b2ba 100644 (file)
@@ -19,7 +19,9 @@ extern "C" {
 
     if (F_status_is_error(*status)) return;
 
-    if (fake_signal_received(data_make->data)) {
+    if (fll_program_standard_signal_received(data_make->main)) {
+      fake_print_signal_received(data_make->data);
+
       *status = F_status_set_error(F_interrupt);
 
       return;
@@ -53,7 +55,7 @@ extern "C" {
       f_fss_comments_t comments = f_fss_comments_t_initialize;
 
       {
-        f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) data_make->data, 0);
+        f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) data_make->data, 0);
 
         *status = fll_fss_basic_list_read(data_make->buffer, state, &range, &list_objects, &list_contents, &delimits, 0, &comments);
       }
@@ -86,7 +88,7 @@ extern "C" {
 
       f_fss_set_t settings = f_fss_set_t_initialize;
 
-      f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) data_make->data, 0);
+      f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fll_program_standard_signal_state, (void *) data_make->data, 0);
 
       if (list_objects.used > data_make->fakefile.size) {
         macro_f_fss_nameds_t_resize((*status), data_make->fakefile, list_objects.used);
@@ -108,10 +110,16 @@ extern "C" {
 
         for (f_array_length_t i = 0; i < list_objects.used; ++i) {
 
-          if (!(i % fake_signal_check_short_d) && fake_signal_received(data_make->data)) {
-            *status = F_status_set_error(F_interrupt);
+          if (!(i % fake_signal_check_short_d)) {
+            if (fll_program_standard_signal_received(data_make->main)) {
+              fake_print_signal_received(data_make->data);
 
-            break;
+              *status = F_status_set_error(F_interrupt);
+
+              break;
+            }
+
+            data_make->main->signal_check = 0;
           }
 
           if (fl_string_dynamic_partial_compare_string(fake_make_section_settings_s.string, data_make->buffer, fake_make_section_settings_s.used, list_objects.array[i]) == F_equal_to) {
index 59e6de43c136cda22c4658a5dd0d581ebdbf2a50..a455f6055b6ae3ce4403aaf7fb337e9b28267924 100644 (file)
@@ -20,7 +20,9 @@ extern "C" {
 #ifndef _di_fake_make_operate_
   f_status_t fake_make_operate(fake_data_t * const data) {
 
-    if (fake_signal_received(data)) {
+    if (fll_program_standard_signal_received(data->main)) {
+      fake_print_signal_received(data);
+
       return F_status_set_error(F_interrupt);
     }
 
@@ -163,7 +165,7 @@ extern "C" {
 
     f_iki_data_t iki_data = f_iki_data_t_initialize;
 
-    f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_iki, 0, (void *) data_make->data, 0);
+    f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) data_make->data, 0);
 
     f_string_range_t range = f_string_range_t_initialize;
     f_string_map_multis_t *parameter = &data_make->setting_make.parameter;
@@ -1045,10 +1047,16 @@ extern "C" {
       state_process.operation_previous = state_process.operation;
       state_process.operation = 0;
 
-      if (!(i % fake_signal_check_short_d) && fake_signal_received(data_make->data)) {
-        *status = F_status_set_error(F_interrupt);
+      if (!(i % fake_signal_check_short_d)) {
+        if (fll_program_standard_signal_received(data_make->main)) {
+          fake_print_signal_received(data_make->data);
 
-        break;
+          *status = F_status_set_error(F_interrupt);
+
+          break;
+        }
+
+        data_make->main->signal_check = 0;
       }
 
       for (j = 0; j < fake_make_operation_total_d; ++j) {
index 3a0c7f5cd7585fb193c6dd19ae3557affdbf0224..2e2837300cb1377487ec0ae337e0dd3bcff2b09c 100644 (file)
@@ -505,7 +505,9 @@ extern "C" {
 #ifndef _di_fake_make_operate_process_execute_
   f_status_t fake_make_operate_process_execute(fake_make_data_t * const data_make, const f_string_static_t program, const f_string_statics_t arguments, const bool as_shell) {
 
-    if (fake_signal_received(data_make->data)) {
+    if (fll_program_standard_signal_received(data_make->main)) {
+      fake_print_signal_received(data_make->data);
+
       return F_status_set_error(F_interrupt);
     }
 
@@ -559,7 +561,9 @@ extern "C" {
 
     status = fll_execute_program(program, arguments, &parameter, 0, (void *) &return_code);
 
-    if (fake_signal_received(data_make->data)) {
+    if (fll_program_standard_signal_received(data_make->main)) {
+      fake_print_signal_received(data_make->data);
+
       return F_status_set_error(F_interrupt);
     }
 
index 6ceb4080971d741f22684aa5c517cabd52a52338..b895d4ef73d041e8c5a91b492865f4b17214841c 100644 (file)
@@ -471,9 +471,9 @@ extern "C" {
 #endif // _di_fake_print_message_section_operation_unknown_
 
 #ifndef _di_fake_print_signal_received_
-  void fake_print_signal_received(fake_data_t * const data, const f_status_t signal) {
+  void fake_print_signal_received(fake_data_t * const data) {
 
-    if (data->main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (data->main->warning.verbosity != f_console_verbosity_verbose_e && data->main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(data->main->warning.to.stream);
@@ -481,7 +481,7 @@ extern "C" {
     flockfile(data->main->warning.to.stream);
 
     fl_print_format("%]%r%r%[Received signal code %]", data->main->warning.to.stream, data->main->context.set.reset, f_string_eol_s, f_string_eol_s, data->main->context.set.warning, data->main->context.set.warning);
-    fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, signal, data->main->context.set.notable);
+    fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, data->main->signal_received, data->main->context.set.notable);
     fl_print_format("%[.%]%r", data->main->warning.to.stream, data->main->context.set.warning, data->main->context.set.warning, f_string_eol_s);
 
     funlockfile(data->main->warning.to.stream);
index 7c2453cf587d276161f672208345a2e74955305c..fb72e0510b0c3e24f9357eb9da8f11f6cdaa8bdf 100644 (file)
@@ -285,8 +285,6 @@ extern "C" {
  *
  * @param data
  *   The program data.
- * @param signal
- *   The signal received.
  *
  * @see flockfile()
  * @see funlockfile()
@@ -294,7 +292,7 @@ extern "C" {
  * @see fl_print_format()
  */
 #ifndef _di_fake_print_signal_received_
-  extern void fake_print_signal_received(fake_data_t * const data, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void fake_print_signal_received(fake_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fake_print_signal_received_
 
 /**
index f16180a38592956c0653e3b5a81041f129bdd23d..c6d648bdc2b677f49f41026b1d1fdde05c0b499e 100644 (file)
@@ -109,7 +109,7 @@ extern "C" {
  * The program defines.
  */
 #ifndef _di_firewall_defines_
-  #define firewall_signal_check_d 10000
+  #define firewall_signal_check_d 20000
 #endif // _di_firewall_defines_
 
 /**
index 902879bfe181ec612ea5ee49ffec3da89261cd97..dadb9e240da4ab410644e2f81186d88d1f84731f 100644 (file)
@@ -88,7 +88,7 @@ void firewall_print_error_on_unhandled_for_file(const fl_print_t output, const c
 #ifndef _di_firewall_print_signal_received_
   void firewall_print_signal_received(firewall_data_t * const data, const f_status_t signal) {
 
-    if (data->main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (data->main->warning.verbosity != f_console_verbosity_verbose_e && data->main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(data->main->warning.to.stream);
index e10a565500ef0b3770a53da3db84ee04fe1abb8f..1159184e268f29e556e89df4bb55be2c1c492a1c 100644 (file)
@@ -69,7 +69,7 @@ extern "C" {
  *   - content_start:  A code used to represent the start of Content for use in binary formats.
  */
 #ifndef _di_fss_basic_list_read_defines_
-  #define fss_basic_list_read_signal_check_d 10000
+  #define fss_basic_list_read_signal_check_d 20000
 
   #define FSS_BASIC_LIST_READ_pipe_name_s "(pipe)"
 
index a4abf28367cf0d7c4748cd1283ff288323472727..b9765433f9995fdf2470873d051e294a9780e4db 100644 (file)
@@ -344,7 +344,9 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_list_read_parameter_delimit_e].values.used; ++i) {
 
           if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
-            if (fss_basic_list_read_signal_received(main)) {
+            if (fll_program_standard_signal_received(main)) {
+              fss_basic_list_read_print_signal_received(main);
+
               status = F_status_set_error(F_interrupt);
 
               break;
@@ -537,7 +539,9 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
           if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
-            if (fss_basic_list_read_signal_received(main)) {
+            if (fll_program_standard_signal_received(main)) {
+              fss_basic_list_read_print_signal_received(main);
+
               status = F_status_set_error(F_interrupt);
 
               break;
index f706c11bc385e598e1ec4f554ba011026673c72c..7f1e7e850c0496030ebf730ac39d64372e992823 100644 (file)
@@ -57,9 +57,9 @@ extern "C" {
 #endif // _di_fss_basic_list_read_depths_resize_
 
 #ifndef _di_fss_basic_list_read_print_signal_received_
-  void fss_basic_list_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+  void fss_basic_list_read_print_signal_received(fll_program_data_t * const main) {
 
-    if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(main->warning.to.stream);
@@ -67,42 +67,13 @@ extern "C" {
     flockfile(main->warning.to.stream);
 
     fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
-    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
     fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
 
     funlockfile(main->warning.to.stream);
   }
 #endif // _di_fss_basic_list_read_print_signal_received_
 
-#ifndef _di_fss_basic_list_read_signal_received_
-  f_status_t fss_basic_list_read_signal_received(fll_program_data_t * const main) {
-
-    if (main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          fss_basic_list_read_print_signal_received(main, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_fss_basic_list_read_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 3d85cdf6498ad6c7b2d2cee924f7dd1297cb8d9b..0b07209f19ee75fd7684dff5c72f3ee61f3cfdb4 100644 (file)
@@ -257,31 +257,11 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param signal
- *   The signal received.
  */
 #ifndef _di_fss_basic_list_read_print_signal_received_
-  extern void fss_basic_list_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void fss_basic_list_read_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
 #endif // _di_fss_basic_list_read_print_signal_received_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_basic_list_read_signal_received_
-  extern f_status_t fss_basic_list_read_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_basic_list_read_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index af5c7253dce01fe07d97a93e2bf41c6e4edbd914..a847f9f4dcdcc3bff854c6a0f59ae075034892a3 100644 (file)
@@ -87,7 +87,9 @@ extern "C" {
     for (f_array_length_t i = 0; i < data->depths.used; ++i) {
 
       if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
-        if (fss_basic_list_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_basic_list_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
@@ -173,7 +175,9 @@ extern "C" {
       for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
 
         if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
-          if (fss_basic_list_read_signal_received(main)) {
+          if (fll_program_standard_signal_received(main)) {
+            fss_basic_list_read_print_signal_received(main);
+
             return F_status_set_error(F_interrupt);
           }
 
@@ -242,7 +246,7 @@ extern "C" {
 #ifndef _di_fss_basic_list_read_load_
   f_status_t fss_basic_list_read_load(fll_program_data_t * const main, fss_basic_list_read_data_t * const data) {
 
-    f_state_t state = macro_f_state_t_initialize(fss_basic_list_read_common_allocation_large_d, fss_basic_list_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+    f_state_t state = macro_f_state_t_initialize(fss_basic_list_read_common_allocation_large_d, fss_basic_list_read_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
     f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
 
     data->delimits_object.used = 0;
@@ -352,7 +356,9 @@ extern "C" {
       if (!names[i]) continue;
 
       if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
-        if (fss_basic_list_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_basic_list_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
@@ -398,7 +404,9 @@ extern "C" {
       if (!names[i]) continue;
 
       if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
-        if (fss_basic_list_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_basic_list_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
@@ -499,7 +507,9 @@ extern "C" {
       for (i = range.start; i <= range.stop; ++i) {
 
         if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
-          if (fss_basic_list_read_signal_received(main)) {
+          if (fll_program_standard_signal_received(main)) {
+            fss_basic_list_read_print_signal_received(main);
+
             return F_status_set_error(F_interrupt);
           }
 
@@ -580,7 +590,9 @@ extern "C" {
       if (!names[i]) continue;
 
       if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
-        if (fss_basic_list_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_basic_list_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
@@ -618,7 +630,9 @@ extern "C" {
       if (!names[i]) continue;
 
       if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
-        if (fss_basic_list_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_basic_list_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
@@ -733,7 +747,9 @@ extern "C" {
       if (!names[at]) continue;
 
       if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
-        if (fss_basic_list_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_basic_list_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
index e37b7ce02bd8f3332885bf7e9e4b40c323d98dff..3c56170aa01b5c0c933aef071d8399fa398dd1cd 100644 (file)
@@ -69,7 +69,7 @@ extern "C" {
  *   - content_start:  A code used to represent the start of Content for use in binary formats.
  */
 #ifndef _di_fss_basic_list_write_defines_
-  #define fss_basic_list_write_signal_check_d 10000
+  #define fss_basic_list_write_signal_check_d 20000
 
   #define FSS_BASIC_LIST_WRITE_pipe_name_s "(pipe)"
 
index eb5a090b1973e7529102347df3bd2d606ee1ec76..94107bca7ab38243d982d3881e7b0dac362cb805 100644 (file)
@@ -421,10 +421,16 @@ extern "C" {
           if (main->parameters.array[fss_basic_list_write_parameter_object_e].result == f_console_result_additional_e) {
             for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_list_write_parameter_object_e].values.used; ++i) {
 
-              if (fss_basic_list_write_signal_received(main)) {
-                status = F_status_set_error(F_interrupt);
+              if (!((++main->signal_check) % fss_basic_list_write_signal_check_d)) {
+                if (fll_program_standard_signal_received(main)) {
+                  fss_basic_list_write_print_signal_received(main);
 
-                break;
+                  status = F_status_set_error(F_interrupt);
+
+                  break;
+                }
+
+                main->signal_check = 0;
               }
 
               index = main->parameters.array[fss_basic_list_write_parameter_object_e].values.array[i];
@@ -436,10 +442,16 @@ extern "C" {
           else {
             for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_list_write_parameter_content_e].values.used; ++i) {
 
-              if (fss_basic_list_write_signal_received(main)) {
-                status = F_status_set_error(F_interrupt);
+              if (!((++main->signal_check) % fss_basic_list_write_signal_check_d)) {
+                if (fll_program_standard_signal_received(main)) {
+                  fss_basic_list_write_print_signal_received(main);
 
-                break;
+                  status = F_status_set_error(F_interrupt);
+
+                  break;
+                }
+
+                main->signal_check = 0;
               }
 
               index = main->parameters.array[fss_basic_list_write_parameter_content_e].values.array[i];
@@ -452,10 +464,16 @@ extern "C" {
         else {
           for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_list_write_parameter_object_e].values.used; ++i) {
 
-            if (fss_basic_list_write_signal_received(main)) {
-              status = F_status_set_error(F_interrupt);
+            if (!((++main->signal_check) % fss_basic_list_write_signal_check_d)) {
+              if (fll_program_standard_signal_received(main)) {
+                fss_basic_list_write_print_signal_received(main);
 
-              break;
+                status = F_status_set_error(F_interrupt);
+
+                break;
+              }
+
+              main->signal_check = 0;
             }
 
             index = main->parameters.array[fss_basic_list_write_parameter_object_e].values.array[i];
index c1b383409a3bc9b8ccc42aabb1760435968c0190..d62960d64a080c02c8f2b8b6eff98390445aaadb 100644 (file)
@@ -6,9 +6,9 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_basic_list_write_print_signal_received_
-  void fss_basic_list_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+  void fss_basic_list_write_print_signal_received(fll_program_data_t * const main) {
 
-    if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(main->warning.to.stream);
@@ -16,42 +16,13 @@ extern "C" {
     flockfile(main->warning.to.stream);
 
     fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
-    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
     fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
 
     funlockfile(main->warning.to.stream);
   }
 #endif // _di_fss_basic_list_write_print_signal_received_
 
-#ifndef _di_fss_basic_list_write_signal_received_
-  f_status_t fss_basic_list_write_signal_received(fll_program_data_t * const main) {
-
-    if (main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          fss_basic_list_write_print_signal_received(main, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_fss_basic_list_write_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 87aa39ad8b22162d911a92fc4a5a321f692d459a..33d99240b66fccf62b7c8cd558908702afbb2ecd 100644 (file)
@@ -29,31 +29,11 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param signal
- *   The signal received.
  */
 #ifndef _di_fss_basic_list_write_print_signal_received_
-  extern void fss_basic_list_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void fss_basic_list_write_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
 #endif // _di_fss_basic_list_write_print_signal_received_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_basic_list_write_signal_received_
-  extern f_status_t fss_basic_list_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_basic_list_write_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 5dfedd5a8aaa6f30b5fb16e5e57e915ee627ffb8..5c9b440226794cae0add0a8b5aed9cc236dfaaf6 100644 (file)
@@ -65,7 +65,7 @@ extern "C" {
   f_status_t fss_basic_list_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t * const buffer) {
 
     f_status_t status = F_none;
-    f_state_t state = macro_f_state_t_initialize(fss_basic_list_write_common_allocation_large_d, fss_basic_list_write_common_allocation_small_d, 0, 0, 0, 0, 0);
+    f_state_t state = macro_f_state_t_initialize(fss_basic_list_write_common_allocation_large_d, fss_basic_list_write_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
     f_string_range_t range = f_string_range_t_initialize;
 
     if (object) {
@@ -167,10 +167,16 @@ extern "C" {
 
     for (;;) {
 
-      if (fss_basic_list_write_signal_received(main)) {
-        status = F_status_set_error(F_interrupt);
+      if (!((++main->signal_check) % fss_basic_list_write_signal_check_d)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_basic_list_write_print_signal_received(main);
 
-        break;
+          status = F_status_set_error(F_interrupt);
+
+          break;
+        }
+
+        main->signal_check = 0;
       }
 
       if (range.start > range.stop) {
index 8a843bb298ea0b0d9389dc00c8e9f54a7f1bd540..53391a5e8f35d79548db30b22778f7b299219212 100644 (file)
@@ -69,7 +69,7 @@ extern "C" {
  *   - content_start:  A code used to represent the start of Content for use in binary formats.
  */
 #ifndef _di_fss_basic_read_defines_
-  #define fss_basic_read_signal_check_d 10000
+  #define fss_basic_read_signal_check_d 20000
 
   #define FSS_BASIC_READ_pipe_name_s "(pipe)"
 
index f4aac89d40df4cc2165f01b66e2b1d17e2cde49e..c86fb991d20e7b6bb6608e80e03911f9fd0eac05 100644 (file)
@@ -343,7 +343,9 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_read_parameter_delimit_e].values.used; ++i) {
 
           if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
-            if (fss_basic_read_signal_received(main)) {
+            if (fll_program_standard_signal_received(main)) {
+              fss_basic_read_print_signal_received(main);
+
               status = F_status_set_error(F_interrupt);
 
               break;
@@ -544,7 +546,9 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
           if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
-            if (fss_basic_read_signal_received(main)) {
+            if (fll_program_standard_signal_received(main)) {
+              fss_basic_read_print_signal_received(main);
+
               status = F_status_set_error(F_signal);
 
               break;
index 37a08b9a41390a7031c8f037e1f4dac26d755db7..d89a23acc8ff554218cb99330287e8972de0dd3e 100644 (file)
@@ -56,9 +56,9 @@ extern "C" {
 #endif // _di_fss_basic_read_depths_resize_
 
 #ifndef _di_fss_basic_read_print_signal_received_
-  void fss_basic_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+  void fss_basic_read_print_signal_received(fll_program_data_t * const main) {
 
-    if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(main->warning.to.stream);
@@ -66,42 +66,13 @@ extern "C" {
     flockfile(main->warning.to.stream);
 
     fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
-    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
     fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
 
     funlockfile(main->warning.to.stream);
   }
 #endif // _di_fss_basic_read_print_signal_received_
 
-#ifndef _di_fss_basic_read_signal_received_
-  f_status_t fss_basic_read_signal_received(fll_program_data_t * const main) {
-
-    if (main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          fss_basic_read_print_signal_received(main, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_fss_basic_read_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index bab1c6d56c5369f0943547a3dd90e1709cd03020..9ad79925574c823865e900f35ff8b9da1d9679a3 100644 (file)
@@ -252,31 +252,11 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param signal
- *   The signal received.
  */
 #ifndef _di_fss_basic_read_print_signal_received_
-  extern void fss_basic_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void fss_basic_read_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
 #endif // _di_fss_basic_read_print_signal_received_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_basic_read_signal_received_
-  extern f_status_t fss_basic_read_signal_received(fll_program_data_t * const main);
-#endif // _di_fss_basic_read_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 325fbe0c4e7e2167016828e14ac140eafad612fa..d4a6c67208bf4ef4223ef5c0518d668c36a718b8 100644 (file)
@@ -64,7 +64,9 @@ extern "C" {
     for (f_array_length_t i = 0; i < data->depths.used; ++i) {
 
       if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
-        if (fss_basic_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_basic_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
@@ -150,7 +152,9 @@ extern "C" {
       for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
 
         if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
-          if (fss_basic_read_signal_received(main)) {
+          if (fll_program_standard_signal_received(main)) {
+            fss_basic_read_print_signal_received(main);
+
             return F_status_set_error(F_interrupt);
           }
 
@@ -219,7 +223,7 @@ extern "C" {
 #ifndef _di_fss_basic_read_load_
   f_status_t fss_basic_read_load(fll_program_data_t * const main, fss_basic_read_data_t * const data) {
 
-    f_state_t state = macro_f_state_t_initialize(fss_basic_read_common_allocation_large_d, fss_basic_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+    f_state_t state = macro_f_state_t_initialize(fss_basic_read_common_allocation_large_d, fss_basic_read_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
     f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
 
     data->delimits.used = 0;
@@ -228,6 +232,12 @@ extern "C" {
     const f_status_t status = fll_fss_basic_read(data->buffer, state, &input, &data->objects, &data->contents, &data->quotes, &data->delimits, 0);
 
     if (F_status_is_error(status)) {
+      if (F_status_set_fine(status) == F_interrupt) {
+        fss_basic_read_print_signal_received(main);
+
+        return status;
+      }
+
       const f_string_static_t file_name = fss_basic_read_file_identify(input.start, data->files);
 
       fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_basic_read", F_true, file_name, f_file_operation_process_s, fll_error_file_type_file_e);
@@ -367,7 +377,9 @@ extern "C" {
       if (!names[i]) continue;
 
       if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
-        if (fss_basic_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_basic_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
@@ -448,7 +460,9 @@ extern "C" {
       if (!names[at]) continue;
 
       if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
-        if (fss_basic_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_basic_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
@@ -479,7 +493,9 @@ extern "C" {
       if (!names[i]) continue;
 
       if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
-        if (fss_basic_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_basic_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
@@ -628,7 +644,9 @@ extern "C" {
       if (!names[i]) continue;
 
       if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
-        if (fss_basic_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_basic_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
index a9afd719180d2ed760a8a1b67937eb477bcb4fe9..083f73a28ccb4f55ad499283ebb5804c969b6cdf 100644 (file)
@@ -69,7 +69,7 @@ extern "C" {
  *   - content_start:  A code used to represent the start of Content for use in binary formats.
  */
 #ifndef _di_fss_basic_write_defines_
-  #define fss_basic_write_signal_check_d 10000
+  #define fss_basic_write_signal_check_d 20000
 
   #define FSS_BASIC_WRITE_pipe_name_s "(pipe)"
 
index 9f35b212a827c4288d3fb2a0c76d5e66ab132444..6f132d36b6095e4cc7391de69dd9424369392acd 100644 (file)
@@ -418,10 +418,16 @@ extern "C" {
           if (main->parameters.array[fss_basic_write_parameter_object_e].result == f_console_result_additional_e) {
             for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_write_parameter_object_e].values.used; ++i) {
 
-              if (fss_basic_write_signal_received(main)) {
-                status = F_status_set_error(F_interrupt);
+              if (!((++main->signal_check) % fss_basic_write_signal_check_d)) {
+                if (fll_program_standard_signal_received(main)) {
+                  fss_basic_write_print_signal_received(main);
 
-                break;
+                  status = F_status_set_error(F_interrupt);
+
+                  break;
+                }
+
+                main->signal_check = 0;
               }
 
               status = fss_basic_write_process(main, output, quote, &argv[main->parameters.array[fss_basic_write_parameter_object_e].values.array[i]], 0, &buffer);
@@ -431,10 +437,16 @@ extern "C" {
           else {
             for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_write_parameter_content_e].values.used; ++i) {
 
-              if (fss_basic_write_signal_received(main)) {
-                status = F_status_set_error(F_interrupt);
+              if (!((++main->signal_check) % fss_basic_write_signal_check_d)) {
+                if (fll_program_standard_signal_received(main)) {
+                  fss_basic_write_print_signal_received(main);
 
-                break;
+                  status = F_status_set_error(F_interrupt);
+
+                  break;
+                }
+
+                main->signal_check = 0;
               }
 
               status = fss_basic_write_process(main, output, quote, 0, &argv[main->parameters.array[fss_basic_write_parameter_content_e].values.array[i]], &buffer);
@@ -445,10 +457,16 @@ extern "C" {
         else {
           for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_write_parameter_object_e].values.used; ++i) {
 
-            if (fss_basic_write_signal_received(main)) {
-              status = F_status_set_error(F_interrupt);
+            if (!((++main->signal_check) % fss_basic_write_signal_check_d)) {
+              if (fll_program_standard_signal_received(main)) {
+                fss_basic_write_print_signal_received(main);
 
-              break;
+                status = F_status_set_error(F_interrupt);
+
+                break;
+              }
+
+              main->signal_check = 0;
             }
 
             status = fss_basic_write_process(main, output, quote, &argv[main->parameters.array[fss_basic_write_parameter_object_e].values.array[i]], &argv[main->parameters.array[fss_basic_write_parameter_content_e].values.array[i]], &buffer);
index 63c624afad19993657eafc91abc393b85aa4a808..f3fb15e1b9977bd417297f2bd2f01c46a1d1f413 100644 (file)
@@ -6,9 +6,9 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_basic_write_print_signal_received_
-  void fss_basic_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+  void fss_basic_write_print_signal_received(fll_program_data_t * const main) {
 
-    if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(main->warning.to.stream);
@@ -16,42 +16,13 @@ extern "C" {
     flockfile(main->warning.to.stream);
 
     fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
-    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
     fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
 
     funlockfile(main->warning.to.stream);
   }
 #endif // _di_fss_basic_write_print_signal_received_
 
-#ifndef _di_fss_basic_write_signal_received_
-  f_status_t fss_basic_write_signal_received(fll_program_data_t * const main) {
-
-    if (main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          fss_basic_write_print_signal_received(main, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_fss_basic_write_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 3eeac9c1df3385dc17de2e97a1d5609cd18b7d1e..1faf1ac97463e4bbb8e0d9a6af534578ee5143cb 100644 (file)
@@ -29,31 +29,11 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param signal
- *   The signal received.
  */
 #ifndef _di_fss_basic_write_print_signal_received_
-  extern void fss_basic_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void fss_basic_write_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
 #endif // _di_fss_basic_write_print_signal_received_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_basic_write_signal_received_
-  extern f_status_t fss_basic_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_basic_write_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index bdee78f78490cb31d6553bdff0d779d2bc5c710e..a231e4a7ba5676347c58e45a425a5171e8a6d295 100644 (file)
@@ -65,7 +65,7 @@ extern "C" {
   f_status_t fss_basic_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) {
 
     f_status_t status = F_none;
-    f_state_t state = macro_f_state_t_initialize(fss_basic_write_common_allocation_large_d, fss_basic_write_common_allocation_small_d, 0, 0, 0, 0, 0);
+    f_state_t state = macro_f_state_t_initialize(fss_basic_write_common_allocation_large_d, fss_basic_write_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
     f_string_range_t range = f_string_range_t_initialize;
 
     if (object) {
@@ -171,8 +171,14 @@ extern "C" {
 
     for (;;) {
 
-      if (fss_basic_write_signal_received(main)) {
-        return F_status_set_error(F_interrupt);
+      if (!((++main->signal_check) % fss_basic_write_signal_check_d)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_basic_write_print_signal_received(main);
+
+          return F_status_set_error(F_interrupt);
+        }
+
+        main->signal_check = 0;
       }
 
       if (range.start > range.stop) {
index e8c09e4bb616f8f6aa080870b16a3453259ae92d..74f8c1ba8518dc89ad7508306a6e9e90ad4ce314 100644 (file)
@@ -94,24 +94,6 @@ extern "C" {
   extern f_status_t fss_basic_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
 #endif // _di_fss_basic_write_process_pipe_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_basic_write_signal_received_
-  extern f_status_t fss_basic_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_basic_write_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index d526eaf6709cfe17b6b9988a3e81fbd527f368e6..109ddcc27dc180149c6dc12551b34f7c3fdd7169 100644 (file)
@@ -69,7 +69,7 @@ extern "C" {
  *   - content_start:  A code used to represent the start of Content for use in binary formats.
  */
 #ifndef _di_fss_embedded_list_read_defines_
-  #define fss_embedded_list_read_signal_check_d 10000
+  #define fss_embedded_list_read_signal_check_d 20000
 
   #define FSS_EMBEDDED_LIST_READ_pipe_name_s "(pipe)"
 
index 27d91d5ba2f4b1ec749b268cec4f677b37bcaae0..6b9a3a76a56f091d76ff943d0fc6f7a9f538d622 100644 (file)
@@ -435,7 +435,9 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
           if (!((++main->signal_check) % fss_embedded_list_read_signal_check_d)) {
-            if (fss_embedded_list_read_signal_received(&data)) {
+            if (fll_program_standard_signal_received(main)) {
+              fss_embedded_list_read_print_signal_received(&data);
+
               status = F_status_set_error(F_interrupt);
 
               break;
index 2417b65b7e658b4c93d78bf52391d36249314e36..d0645223423db022cbdf4b1a123d810db94ea2d8 100644 (file)
@@ -17,9 +17,9 @@ extern "C" {
 #endif // _di_fss_embedded_list_read_data_delete_
 
 #ifndef _di_fss_embedded_list_read_print_signal_received_
-  void fss_embedded_list_read_print_signal_received(fss_embedded_list_read_data_t * const data, const f_status_t signal) {
+  void fss_embedded_list_read_print_signal_received(fss_embedded_list_read_data_t * const data) {
 
-    if (data->main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (data->main->warning.verbosity != f_console_verbosity_verbose_e && data->main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(data->main->warning.to.stream);
@@ -27,42 +27,13 @@ extern "C" {
     flockfile(data->main->warning.to.stream);
 
     fl_print_format("%]%r%r%[Received signal code %]", data->main->warning.to.stream, data->main->context.set.reset, f_string_eol_s, f_string_eol_s, data->main->context.set.warning, data->main->context.set.warning);
-    fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, signal, data->main->context.set.notable);
+    fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, data->main->signal_received, data->main->context.set.notable);
     fl_print_format("%[.%]%r", data->main->warning.to.stream, data->main->context.set.warning, data->main->context.set.warning, f_string_eol_s);
 
     funlockfile(data->main->warning.to.stream);
   }
 #endif // _di_fss_embedded_list_read_print_signal_received_
 
-#ifndef _di_fss_embedded_list_read_signal_received_
-  f_status_t fss_embedded_list_read_signal_received(fss_embedded_list_read_data_t * const data) {
-
-    if (data->main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(data->main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          fss_embedded_list_read_print_signal_received(data, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_fss_embedded_list_read_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 5b1f54a5467fc388a4cb845a43c91c47c459232e..4f9ee773afc293107743477da6af1845113a7906 100644 (file)
@@ -197,31 +197,11 @@ extern "C" {
  *
  * @param data
  *   The program data.
- * @param signal
- *   The signal received.
  */
 #ifndef _di_fss_embedded_list_read_print_signal_received_
-  extern void fss_embedded_list_read_print_signal_received(fss_embedded_list_read_data_t * const data, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void fss_embedded_list_read_print_signal_received(fss_embedded_list_read_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fss_embedded_list_read_print_signal_received_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param data
- *   The program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_embedded_list_read_signal_received_
-  extern f_status_t fss_embedded_list_read_signal_received(fss_embedded_list_read_data_t * const data) F_attribute_visibility_internal_d;
-#endif // _di_fss_embedded_list_read_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 8c531e256762a561dd5f3b9615b55eb1e5d7f0e2..a039bec8961c97ab91ab4a5aab57a5f7246eb0c5 100644 (file)
@@ -130,7 +130,9 @@ extern "C" {
       for (i = 0; i < values_total; ++i) {
 
         if (!((++data->main->signal_check) % fss_embedded_list_read_signal_check_d)) {
-          if (fss_embedded_list_read_signal_received(data)) {
+          if (fll_program_standard_signal_received(data->main)) {
+            fss_embedded_list_read_print_signal_received(data);
+
             return F_status_set_error(F_interrupt);
           }
 
@@ -243,7 +245,7 @@ extern "C" {
     f_status_t status = F_none;
 
     {
-      f_state_t state = macro_f_state_t_initialize(fss_embedded_list_read_common_allocation_large_d, fss_embedded_list_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+      f_state_t state = macro_f_state_t_initialize(fss_embedded_list_read_common_allocation_large_d, fss_embedded_list_read_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) data->main, 0);
       f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
 
       objects_delimits->used = 0;
@@ -559,7 +561,9 @@ extern "C" {
         if (skip[i]) continue;
 
         if (!((++data->main->signal_check) % fss_embedded_list_read_signal_check_d)) {
-          if (fss_embedded_list_read_signal_received(data)) {
+          if (fll_program_standard_signal_received(data->main)) {
+            fss_embedded_list_read_print_signal_received(data);
+
             return F_status_set_error(F_interrupt);
           }
 
index 7db129048b0c30e11785072aca1fab564821e0cd..3b3dad9d22b2cb9b7d40cc5784b14c874eb3dab0 100644 (file)
@@ -69,7 +69,7 @@ extern "C" {
  *   - content_start:  A code used to represent the start of Content for use in binary formats.
  */
 #ifndef _di_fss_embedded_list_write_defines_
-  #define fss_embedded_list_write_signal_check_d 10000
+  #define fss_embedded_list_write_signal_check_d 20000
 
   #define FSS_EMBEDDED_LIST_WRITE_pipe_name_s "(pipe)"
 
index 0d37154f1f4da3b8800e12376d252465789326a0..f61d36274e4d7c349346c2ca886f58c98feaf51d 100644 (file)
@@ -425,10 +425,16 @@ extern "C" {
           if (main->parameters.array[fss_embedded_list_write_parameter_object_e].result == f_console_result_additional_e) {
             for (f_array_length_t i = 0; i < main->parameters.array[fss_embedded_list_write_parameter_object_e].values.used; ++i) {
 
-              if (fss_embedded_list_write_signal_received(main)) {
-                status = F_status_set_error(F_interrupt);
+              if (!((++main->signal_check) % fss_embedded_list_write_signal_check_d)) {
+                if (fll_program_standard_signal_received(main)) {
+                  fss_embedded_list_write_print_signal_received(main);
 
-                break;
+                  status = F_status_set_error(F_interrupt);
+
+                  break;
+                }
+
+                main->signal_check = 0;
               }
 
               status = fss_embedded_list_write_process(main, output, quote, &argv[main->parameters.array[fss_embedded_list_write_parameter_object_e].values.array[i]], 0, 0, &buffer);
@@ -438,10 +444,16 @@ extern "C" {
           else {
             for (f_array_length_t i = 0; i < main->parameters.array[fss_embedded_list_write_parameter_content_e].values.used; ++i) {
 
-              if (fss_embedded_list_write_signal_received(main)) {
-                status = F_status_set_error(F_interrupt);
+              if (!((++main->signal_check) % fss_embedded_list_write_signal_check_d)) {
+                if (fll_program_standard_signal_received(main)) {
+                  fss_embedded_list_write_print_signal_received(main);
 
-                break;
+                  status = F_status_set_error(F_interrupt);
+
+                  break;
+                }
+
+                main->signal_check = 0;
               }
 
               status = fss_embedded_list_write_process_parameter_ignore(main, main->parameters.array[fss_embedded_list_write_parameter_content_e].locations, i, &ignore);
@@ -455,10 +467,16 @@ extern "C" {
         else {
           for (f_array_length_t i = 0; i < main->parameters.array[fss_embedded_list_write_parameter_object_e].values.used; ++i) {
 
-            if (fss_embedded_list_write_signal_received(main)) {
-              status = F_status_set_error(F_interrupt);
+            if (!((++main->signal_check) % fss_embedded_list_write_signal_check_d)) {
+              if (fll_program_standard_signal_received(main)) {
+                fss_embedded_list_write_print_signal_received(main);
 
-              break;
+                status = F_status_set_error(F_interrupt);
+
+                break;
+              }
+
+              main->signal_check = 0;
             }
 
             status = fss_embedded_list_write_process_parameter_ignore(main, main->parameters.array[fss_embedded_list_write_parameter_content_e].locations, i, &ignore);
index f0dc8a766eec1a5431cb4cbb5c4be14083663cb6..656ffaebc62e6f8512993c0741aafd445317b9be 100644 (file)
@@ -6,9 +6,9 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_embedded_list_write_print_signal_received_
-  void fss_embedded_list_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+  void fss_embedded_list_write_print_signal_received(fll_program_data_t * const main) {
 
-    if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(main->warning.to.stream);
@@ -16,42 +16,13 @@ extern "C" {
     flockfile(main->warning.to.stream);
 
     fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
-    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
     fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
 
     funlockfile(main->warning.to.stream);
   }
 #endif // _di_fss_embedded_list_write_print_signal_received_
 
-#ifndef _di_fss_embedded_list_write_signal_received_
-  f_status_t fss_embedded_list_write_signal_received(fll_program_data_t * const main) {
-
-    if (main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          fss_embedded_list_write_print_signal_received(main, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_fss_embedded_list_write_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index a2920f5842dd0c3b3871abc9d008bd7310c22fbe..32c8d03839d06a364828e3492e3147614bb43c42 100644 (file)
@@ -30,31 +30,11 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param signal
- *   The signal received.
  */
 #ifndef _di_fss_embedded_list_write_print_signal_received_
-  extern void fss_embedded_list_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void fss_embedded_list_write_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
 #endif // _di_fss_embedded_list_write_print_signal_received_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_embedded_list_write_signal_received_
-  extern f_status_t fss_embedded_list_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_embedded_list_write_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 9ea6f9f3ac4ec96505af79a96eb160a3a201d442..82656770ac158515f3bf152bf1db9d36b31bc74f 100644 (file)
@@ -65,7 +65,7 @@ extern "C" {
   f_status_t fss_embedded_list_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) {
 
     f_status_t status = F_none;
-    f_state_t state = macro_f_state_t_initialize(fss_embedded_list_write_common_allocation_large_d, fss_embedded_list_write_common_allocation_small_d, 0, 0, 0, 0, 0);
+    f_state_t state = macro_f_state_t_initialize(fss_embedded_list_write_common_allocation_large_d, fss_embedded_list_write_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
     f_string_range_t range = f_string_range_t_initialize;
 
     if (object) {
@@ -169,12 +169,18 @@ extern "C" {
 
     for (;;) {
 
-      if (fss_embedded_list_write_signal_received(main)) {
-        f_string_dynamic_resize(0, &block);
-        f_string_dynamic_resize(0, &object);
-        f_string_dynamic_resize(0, &content);
+      if (!((++main->signal_check) % fss_embedded_list_write_signal_check_d)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_embedded_list_write_print_signal_received(main);
 
-        return F_status_set_error(F_interrupt);
+          f_string_dynamic_resize(0, &block);
+          f_string_dynamic_resize(0, &object);
+          f_string_dynamic_resize(0, &content);
+
+          return F_status_set_error(F_interrupt);
+        }
+
+        main->signal_check = 0;
       }
 
       if (range.start > range.stop) {
@@ -379,8 +385,14 @@ extern "C" {
 
     for (; i < main->parameters.array[fss_embedded_list_write_parameter_ignore_e].locations.used; ++i) {
 
-      if (fss_embedded_list_write_signal_received(main)) {
-        return F_status_set_error(F_interrupt);
+      if (!((++main->signal_check) % fss_embedded_list_write_signal_check_d)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_embedded_list_write_print_signal_received(main);
+
+          return F_status_set_error(F_interrupt);
+        }
+
+        main->signal_check = 0;
       }
 
       l = main->parameters.array[fss_embedded_list_write_parameter_ignore_e].locations.array[i];
index c431d3549ecbb68fdd0eed9df71217adc01135e2..5f5f681b443b37998384aa513e1f688000e4c956 100644 (file)
@@ -69,7 +69,7 @@ extern "C" {
  * The program defines.
  */
 #ifndef _di_fss_extended_list_read_defines_
-  #define fss_extended_list_read_signal_check_d 10000
+  #define fss_extended_list_read_signal_check_d 20000
 
   #define FSS_EXTENDED_LIST_READ_pipe_name_s "(pipe)"
 
index 4e6bcd021cc017b22a48f4776458138a49c4fda3..404b298b7e967fbd19fa025e16d218218329ab68 100644 (file)
@@ -343,7 +343,9 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_list_read_parameter_delimit_e].values.used; ++i) {
 
           if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
-            if (fss_extended_list_read_signal_received(main)) {
+            if (fll_program_standard_signal_received(main)) {
+              fss_extended_list_read_print_signal_received(main);
+
               status = F_status_set_error(F_interrupt);
 
               break;
@@ -544,7 +546,9 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
           if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
-            if (fss_extended_list_read_signal_received(main)) {
+            if (fll_program_standard_signal_received(main)) {
+              fss_extended_list_read_print_signal_received(main);
+
               status = F_status_set_error(F_interrupt);
 
               break;
index 083e43b980f54e50dc3c7d7d92995a3d811c1d9f..688b59e0fae17c792b0fe5d5a2ab213d26fc32d1 100644 (file)
@@ -57,9 +57,9 @@ extern "C" {
 #endif // _di_fss_extended_list_read_depths_resize_
 
 #ifndef _di_fss_extended_list_read_print_signal_received_
-  void fss_extended_list_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+  void fss_extended_list_read_print_signal_received(fll_program_data_t * const main) {
 
-    if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(main->warning.to.stream);
@@ -67,42 +67,13 @@ extern "C" {
     flockfile(main->warning.to.stream);
 
     fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
-    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
     fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
 
     funlockfile(main->warning.to.stream);
   }
 #endif // _di_fss_extended_list_read_print_signal_received_
 
-#ifndef _di_fss_extended_list_read_signal_received_
-  f_status_t fss_extended_list_read_signal_received(fll_program_data_t * const main) {
-
-    if (main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          fss_extended_list_read_print_signal_received(main, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_fss_extended_list_read_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 238f36f9e63eaba429f314af0f436a30e356e994..18cde8de44c16aa856e30b9a1fe862d8e9b0cd58 100644 (file)
@@ -258,31 +258,11 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param signal
- *   The signal received.
  */
 #ifndef _di_fss_extended_list_read_print_signal_received_
-  extern void fss_extended_list_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void fss_extended_list_read_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_list_read_print_signal_received_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_extended_list_read_signal_received_
-  extern f_status_t fss_extended_list_read_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_extended_list_read_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 72e338a0c6b34ba958192f7cdca9ac158fc48858..aa477549b1808f3711b9bc7d159b71c2f1b13283 100644 (file)
@@ -87,7 +87,9 @@ extern "C" {
     for (f_array_length_t i = 0; i < data->depths.used; ++i) {
 
       if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
-        if (fss_extended_list_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_extended_list_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
@@ -173,7 +175,9 @@ extern "C" {
       for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
 
         if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
-          if (fss_extended_list_read_signal_received(main)) {
+          if (fll_program_standard_signal_received(main)) {
+            fss_extended_list_read_print_signal_received(main);
+
             return F_status_set_error(F_interrupt);
           }
 
@@ -241,7 +245,7 @@ extern "C" {
 #ifndef _di_fss_extended_list_read_load_
   f_status_t fss_extended_list_read_load(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
 
-    f_state_t state = macro_f_state_t_initialize(fss_extended_list_read_common_allocation_large_d, fss_extended_list_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+    f_state_t state = macro_f_state_t_initialize(fss_extended_list_read_common_allocation_large_d, fss_extended_list_read_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
     f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
 
     data->delimits_object.used = 0;
index 594f2fef3b65a4bdc33be5fe1f9a545aad84e448..8d5800f74ed1862ac3dadc7353928ed715bc94c3 100644 (file)
@@ -69,7 +69,7 @@ extern "C" {
  *   - content_start:  A code used to represent the start of Content for use in binary formats.
  */
 #ifndef _di_fss_extended_list_write_defines_
-  #define fss_extended_list_write_signal_check_d 10000
+  #define fss_extended_list_write_signal_check_d 20000
 
   #define FSS_EXTENDED_LIST_WRITE_pipe_name_s "(pipe)"
 
index 71621e246894bbc1e583dc4b63e7660cb7a84bb0..9fed1847a8fba629cd621aaa2d7820e268546799 100644 (file)
@@ -424,10 +424,16 @@ extern "C" {
           if (main->parameters.array[fss_extended_list_write_parameter_object_e].result == f_console_result_additional_e) {
             for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_list_write_parameter_object_e].values.used; ++i) {
 
-              if (fss_extended_list_write_signal_received(main)) {
-                status = F_status_set_error(F_interrupt);
+              if (!((++main->signal_check) % fss_extended_list_write_signal_check_d)) {
+                if (fll_program_standard_signal_received(main)) {
+                  fss_extended_list_write_print_signal_received(main);
 
-                break;
+                  status = F_status_set_error(F_interrupt);
+
+                  break;
+                }
+
+                main->signal_check = 0;
               }
 
               status = fss_extended_list_write_process(main, output, quote, &argv[main->parameters.array[fss_extended_list_write_parameter_object_e].values.array[i]], 0, 0, &buffer);
@@ -437,10 +443,16 @@ extern "C" {
           else {
             for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_list_write_parameter_content_e].values.used; ++i) {
 
-              if (fss_extended_list_write_signal_received(main)) {
-                status = F_status_set_error(F_interrupt);
+              if (!((++main->signal_check) % fss_extended_list_write_signal_check_d)) {
+                if (fll_program_standard_signal_received(main)) {
+                  fss_extended_list_write_print_signal_received(main);
 
-                break;
+                  status = F_status_set_error(F_interrupt);
+
+                  break;
+                }
+
+                main->signal_check = 0;
               }
 
               status = fss_extended_list_write_process_parameter_ignore(main, main->parameters.array[fss_extended_list_write_parameter_content_e].locations, i, &ignore);
@@ -454,10 +466,16 @@ extern "C" {
         else {
           for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_list_write_parameter_object_e].values.used; ++i) {
 
-            if (fss_extended_list_write_signal_received(main)) {
-              status = F_status_set_error(F_interrupt);
+            if (!((++main->signal_check) % fss_extended_list_write_signal_check_d)) {
+              if (fll_program_standard_signal_received(main)) {
+                fss_extended_list_write_print_signal_received(main);
 
-              break;
+                status = F_status_set_error(F_interrupt);
+
+                break;
+              }
+
+              main->signal_check = 0;
             }
 
             status = fss_extended_list_write_process_parameter_ignore(main, main->parameters.array[fss_extended_list_write_parameter_content_e].locations, i, &ignore);
index efead668866c56cfb6454471cc86ceb5ac78f177..24de2602dfab88713cf9306726d4414701667982 100644 (file)
@@ -6,9 +6,9 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_extended_list_write_print_signal_received_
-  void fss_extended_list_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+  void fss_extended_list_write_print_signal_received(fll_program_data_t * const main) {
 
-    if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(main->warning.to.stream);
@@ -23,35 +23,6 @@ extern "C" {
   }
 #endif // _di_fss_extended_list_write_print_signal_received_
 
-#ifndef _di_fss_extended_list_write_signal_received_
-  f_status_t fss_extended_list_write_signal_received(fll_program_data_t * const main) {
-
-    if (main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          fss_extended_list_write_print_signal_received(main, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_fss_extended_list_write_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index f9ffa03cdbf50713e97554b8252c56e9c0de23fe..50bc4adfd628ac6870c0ff9436bb5738d7656212 100644 (file)
@@ -29,31 +29,11 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param signal
- *   The signal received.
  */
 #ifndef _di_fss_extended_list_write_print_signal_received_
-  extern void fss_extended_list_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void fss_extended_list_write_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_list_write_print_signal_received_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_extended_list_write_signal_received_
-  extern f_status_t fss_extended_list_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_extended_list_write_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 9e70d7cde71ad5d7bcd1b825c3c03b2b88c0351a..ce587201dbf4ba834e793ca6b66058f8f7ce8400 100644 (file)
@@ -65,7 +65,7 @@ extern "C" {
   f_status_t fss_extended_list_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) {
 
     f_status_t status = F_none;
-    f_state_t state = macro_f_state_t_initialize(fss_extended_list_write_common_allocation_large_d, fss_extended_list_write_common_allocation_small_d, 0, 0, 0, 0, 0);
+    f_state_t state = macro_f_state_t_initialize(fss_extended_list_write_common_allocation_large_d, fss_extended_list_write_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
     f_string_range_t range = f_string_range_t_initialize;
 
     if (object) {
@@ -169,8 +169,14 @@ extern "C" {
 
     for (;;) {
 
-      if (fss_extended_list_write_signal_received(main)) {
-        return F_status_set_error(F_interrupt);
+      if (!((++main->signal_check) % fss_extended_list_write_signal_check_d)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_extended_list_write_print_signal_received(main);
+
+          return F_status_set_error(F_interrupt);
+        }
+
+        main->signal_check = 0;
       }
 
       if (range.start > range.stop) {
@@ -376,8 +382,14 @@ extern "C" {
 
     for (; i < main->parameters.array[fss_extended_list_write_parameter_ignore_e].locations.used; ++i) {
 
-      if (fss_extended_list_write_signal_received(main)) {
-        return F_status_set_error(F_interrupt);
+      if (!((++main->signal_check) % fss_extended_list_write_signal_check_d)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_extended_list_write_print_signal_received(main);
+
+          return F_status_set_error(F_interrupt);
+        }
+
+        main->signal_check = 0;
       }
 
       l = main->parameters.array[fss_extended_list_write_parameter_ignore_e].locations.array[i];
index 11487c0daf09d2091ee12cf15e13382d318360f7..2b78846246d1926315ccd00521500ba0efc5f9d8 100644 (file)
@@ -69,7 +69,7 @@ extern "C" {
  *   - content_start:  A code used to represent the start of Content for use in binary formats.
  */
 #ifndef _di_fss_extended_read_defines_
-  #define fss_extended_read_signal_check_d 10000
+  #define fss_extended_read_signal_check_d 20000
 
   #define FSS_EXTENDED_READ_pipe_name_s "(pipe)"
 
index edbaa45949218fa8018e4bf87098238a9a4d141b..8a00680492036fe9534c0e76822af2b03936a2d9 100644 (file)
@@ -341,7 +341,9 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_read_parameter_delimit_e].values.used; ++i) {
 
           if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
-            if (fss_extended_read_signal_received(main)) {
+            if (fll_program_standard_signal_received(main)) {
+              fss_extended_read_print_signal_received(main);
+
               status = F_status_set_error(F_signal);
 
               break;
@@ -542,7 +544,9 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
           if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
-            if (fss_extended_read_signal_received(main)) {
+            if (fll_program_standard_signal_received(main)) {
+              fss_extended_read_print_signal_received(main);
+
               status = F_status_set_error(F_signal);
 
               break;
index 7c9f9f45231e20698b08f4da00a73728951be128..9c7dcb1579c8816856de910bbe9a37f347ec945d 100644 (file)
@@ -58,9 +58,9 @@ extern "C" {
 #endif // _di_fss_extended_read_depths_resize_
 
 #ifndef _di_fss_extended_read_print_signal_received_
-  void fss_extended_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+  void fss_extended_read_print_signal_received(fll_program_data_t * const main) {
 
-    if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(main->warning.to.stream);
@@ -68,42 +68,13 @@ extern "C" {
     flockfile(main->warning.to.stream);
 
     fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
-    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
     fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
 
     funlockfile(main->warning.to.stream);
   }
 #endif // _di_fss_extended_read_print_signal_received_
 
-#ifndef _di_fss_extended_read_signal_received_
-  f_status_t fss_extended_read_signal_received(fll_program_data_t * const main) {
-
-    if (main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          fss_extended_read_print_signal_received(main, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_fss_extended_read_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index a8bbd96c9000540ba5d74985cbce61c5081d52e5..ba363e0b26631630ef09169b3342ae88c53d420e 100644 (file)
@@ -257,31 +257,11 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param signal
- *   The signal received.
  */
 #ifndef _di_fss_extended_read_print_signal_received_
-  extern void fss_extended_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void fss_extended_read_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_read_print_signal_received_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_extended_read_signal_received_
-  extern f_status_t fss_extended_read_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_extended_read_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 74f26046ce77a385a6e58ec326203aa69ded401e..2f38ac5bae1e9a891ba798de8c49cb66299c475a 100644 (file)
@@ -91,7 +91,9 @@ extern "C" {
     for (f_array_length_t i = 0; i < data->depths.used; ++i) {
 
       if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
-        if (fss_extended_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_extended_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
@@ -177,7 +179,9 @@ extern "C" {
       for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
 
         if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
-          if (fss_extended_read_signal_received(main)) {
+          if (fll_program_standard_signal_received(main)) {
+            fss_extended_read_print_signal_received(main);
+
             return F_status_set_error(F_interrupt);
           }
 
@@ -245,7 +249,7 @@ extern "C" {
 #ifndef _di_fss_extended_read_load_
   f_status_t fss_extended_read_load(fll_program_data_t * const main, fss_extended_read_data_t * const data) {
 
-    f_state_t state = macro_f_state_t_initialize(fss_extended_read_common_allocation_large_d, fss_extended_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+    f_state_t state = macro_f_state_t_initialize(fss_extended_read_common_allocation_large_d, fss_extended_read_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
     f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
 
     data->delimits_object.used = 0;
index fef815103f408d8b8e8f0c9276f7e7ac5e90ad50..e961efbde31d85200f3cfc8b94a50eedfbc7f20d 100644 (file)
@@ -69,7 +69,7 @@ extern "C" {
  *   - content_start:  A code used to represent the start of Content for use in binary formats.
  */
 #ifndef _di_fss_extended_write_defines_
-  #define fss_extended_write_signal_check_d 10000
+  #define fss_extended_write_signal_check_d 20000
 
   #define FSS_EXTENDED_WRITE_pipe_name_s "(pipe)"
 
index 73b27b4f463eeb123989de9c340e9f509a7b0ea9..4403e34a2f0f645539f0811b82b27331bc295b16 100644 (file)
@@ -437,7 +437,9 @@ extern "C" {
             for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_write_parameter_object_e].values.used; ++i) {
 
               if (!((++main->signal_check) % fss_extended_write_signal_check_d)) {
-                if (fss_extended_write_signal_received(main)) {
+                if (fll_program_standard_signal_received(main)) {
+                  fss_extended_write_print_signal_received(main);
+
                   status = F_status_set_error(F_interrupt);
 
                   break;
@@ -482,7 +484,9 @@ extern "C" {
           for (; i < main->parameters.array[fss_extended_write_parameter_object_e].values.used; ++i) {
 
             if (!((++main->signal_check) % fss_extended_write_signal_check_d)) {
-              if (fss_extended_write_signal_received(main)) {
+              if (fll_program_standard_signal_received(main)) {
+                fss_extended_write_print_signal_received(main);
+
                 status = F_status_set_error(F_interrupt);
 
                 break;
index 8cf08ea62d979abb2b0ffcf370e35c3010eb364c..2d5b189afd52fe4f018885cbf9cb5b8a60885980 100644 (file)
@@ -6,9 +6,9 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_extended_write_print_signal_received_
-  void fss_extended_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+  void fss_extended_write_print_signal_received(fll_program_data_t * const main) {
 
-    if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(main->warning.to.stream);
@@ -16,42 +16,13 @@ extern "C" {
     flockfile(main->warning.to.stream);
 
     fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
-    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
     fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
 
     funlockfile(main->warning.to.stream);
   }
 #endif // _di_fss_extended_write_print_signal_received_
 
-#ifndef _di_fss_extended_write_signal_received_
-  f_status_t fss_extended_write_signal_received(fll_program_data_t * const main) {
-
-    if (main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          fss_extended_write_print_signal_received(main, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_fss_extended_write_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 2020deddbe3d5081e02234a9356cbb313e4feb3d..36afa069f9ee808254b57d3c7d0340eb442639c1 100644 (file)
@@ -29,31 +29,11 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param signal
- *   The signal received.
  */
 #ifndef _di_fss_extended_write_print_signal_received_
-  extern void fss_extended_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void fss_extended_write_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_write_print_signal_received_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_extended_write_signal_received_
-  extern f_status_t fss_extended_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_extended_write_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 90e211b4f5fc665e08ec74742d53d20a1e5985b1..ef2ca47e12b0dbaed10e3fbcf40de8b1ef0bd606 100644 (file)
@@ -65,7 +65,7 @@ extern "C" {
   f_status_t fss_extended_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_statics_t *contents, f_string_dynamic_t *buffer) {
 
     f_status_t status = F_none;
-    f_state_t state = macro_f_state_t_initialize(fss_extended_write_common_allocation_large_d, fss_extended_write_common_allocation_small_d, 0, 0, 0, 0, 0);
+    f_state_t state = macro_f_state_t_initialize(fss_extended_write_common_allocation_large_d, fss_extended_write_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
     f_string_range_t range = f_string_range_t_initialize;
 
     if (object) {
@@ -178,8 +178,12 @@ extern "C" {
     for (;;) {
 
       if (!((++main->signal_check) % fss_extended_write_signal_check_d)) {
-        if (fss_extended_write_signal_received(main)) {
-          return F_status_set_error(F_interrupt);
+        if (fll_program_standard_signal_received(main)) {
+          fss_extended_write_print_signal_received(main);
+
+          status = F_status_set_error(F_interrupt);
+
+          break;
         }
 
         main->signal_check = 0;
index 3c98aa27e1f0eb3dfaa03662685145ae88490189..9dc67233cc0b0a833cd76633c7f5a766fc804d0d 100644 (file)
@@ -63,7 +63,7 @@ extern "C" {
  * The program defines.
  */
 #ifndef _di_fss_identify_defines_
-  #define fss_identify_signal_check_d 10000
+  #define fss_identify_signal_check_d 20000
 #endif // _di_fss_identify_defines_
 
 /**
index 51b225f007b42642261bbbf1ae7bf03c7aaced92..bb90dfb45e53972f50fcb2e17dac5545c05b4020 100644 (file)
@@ -288,7 +288,9 @@ extern "C" {
       for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
         if (!((++main->signal_check) % fss_identify_signal_check_d)) {
-          if (fss_identify_signal_received(main)) {
+          if (fll_program_standard_signal_received(main)) {
+            fss_identify_print_signal_received(main);
+
             status = F_status_set_error(F_interrupt);
 
             break;
index fc42402226b2b56cfb6e0fa5741c12a99e93559a..3d7aba08af88c8577a10cd067ae3bb67953979c5 100644 (file)
@@ -15,9 +15,9 @@ extern "C" {
 #endif // _di_fss_identify_data_delete_
 
 #ifndef _di_fss_identify_print_signal_received_
-  void fss_identify_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+  void fss_identify_print_signal_received(fll_program_data_t * const main) {
 
-    if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(main->warning.to.stream);
@@ -25,42 +25,13 @@ extern "C" {
     flockfile(main->warning.to.stream);
 
     fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
-    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
     fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
 
     funlockfile(main->warning.to.stream);
   }
 #endif // _di_fss_identify_print_signal_received_
 
-#ifndef _di_fss_identify_signal_received_
-  f_status_t fss_identify_signal_received(fll_program_data_t * const main) {
-
-    if (main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          fss_identify_print_signal_received(main, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_fss_identify_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index c578f0e6d35780168b79881b302171c9c75419e5..1f255e5afa919016f2891f6dc92f59b39d29b4dd 100644 (file)
@@ -57,31 +57,11 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param signal
- *   The signal received.
  */
 #ifndef _di_fss_identify_print_signal_received_
-  extern void fss_identify_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void fss_identify_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
 #endif // _di_fss_identify_print_signal_received_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_identify_signal_received_
-  extern f_status_t fss_identify_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_identify_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 13d039b7399973ae4f421798d1bbbce86b067305..9ed6f4b0f5e1f0874d6b6161b80251740d5fe24c 100644 (file)
@@ -19,7 +19,9 @@ extern "C" {
 
     do {
       if (!((++main->signal_check) % fss_identify_signal_check_d)) {
-        if (fss_identify_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_identify_print_signal_received(main);
+
           status = F_status_set_error(F_interrupt);
 
           break;
index b7364be621f4a134674ec102a60c2f6492284348..01cb855bd3e22abf20e3d6b635877301a546c900 100644 (file)
@@ -63,7 +63,7 @@ extern "C" {
  * The program defines.
  */
 #ifndef _di_fss_payload_read_defines_
-  #define fss_payload_read_signal_check_d 10000
+  #define fss_payload_read_signal_check_d 20000
 
   #define FSS_PAYLOAD_READ_pipe_name_s "(pipe)"
 
index dc35be7d3a11bd31dd03724aca778f9f6051e0db..826e6713adad2f0d7abb3f9acec64cf5dd188b24 100644 (file)
@@ -361,7 +361,9 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_read_parameter_delimit_e].values.used; ++i) {
 
           if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
-            if (fss_payload_read_signal_received(main)) {
+            if (fll_program_standard_signal_received(main)) {
+              fss_payload_read_print_signal_received(main);
+
               status = F_status_set_error(F_interrupt);
 
               break;
@@ -576,7 +578,9 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
           if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
-            if (fss_payload_read_signal_received(main)) {
+            if (fll_program_standard_signal_received(main)) {
+              fss_payload_read_print_signal_received(main);
+
               status = F_status_set_error(F_interrupt);
 
               break;
index b7191026de7e143847e04e9e606ebec35d6208a5..7816a6dc4e943e7ad83911825f20f7b78abb9ac2 100644 (file)
@@ -63,9 +63,9 @@ extern "C" {
 #endif // _di_fss_payload_read_depths_resize_
 
 #ifndef _di_fss_payload_read_print_signal_received_
-  void fss_payload_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+  void fss_payload_read_print_signal_received(fll_program_data_t * const main) {
 
-    if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(main->warning.to.stream);
@@ -73,42 +73,13 @@ extern "C" {
     flockfile(main->warning.to.stream);
 
     fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
-    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
     fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
 
     funlockfile(main->warning.to.stream);
   }
 #endif // _di_fss_payload_read_print_signal_received_
 
-#ifndef _di_fss_payload_read_signal_received_
-  f_status_t fss_payload_read_signal_received(fll_program_data_t * const main) {
-
-    if (main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          fss_payload_read_print_signal_received(main, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_fss_payload_read_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 4d9f3b0aef29872d4cf1655434132264c962c793..49006341f7c4b3a9ea6b909c270b3d7882857f70 100644 (file)
@@ -277,31 +277,11 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param signal
- *   The signal received.
  */
 #ifndef _di_fss_payload_read_print_signal_received_
-  extern void fss_payload_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void fss_payload_read_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_print_signal_received_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_payload_read_signal_received_
-  extern f_status_t fss_payload_read_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_payload_read_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index c862b0295aef49277bef0c52d6122e0d470a2bc6..9406920aa6d61b271ad0146298abe085324b1ed3 100644 (file)
@@ -87,7 +87,9 @@ extern "C" {
     for (f_array_length_t i = 0; i < data->depths.used; ++i) {
 
       if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
-        if (fss_payload_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_payload_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
@@ -173,7 +175,9 @@ extern "C" {
       for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
 
         if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
-          if (fss_payload_read_signal_received(main)) {
+          if (fll_program_standard_signal_received(main)) {
+            fss_payload_read_print_signal_received(main);
+
             return F_status_set_error(F_interrupt);
           }
 
@@ -241,7 +245,7 @@ extern "C" {
 #ifndef _di_fss_payload_read_load_
   f_status_t fss_payload_read_load(fll_program_data_t * const main, fss_payload_read_data_t * const data) {
 
-    f_state_t state = macro_f_state_t_initialize(fss_payload_read_common_allocation_large_d, fss_payload_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+    f_state_t state = macro_f_state_t_initialize(fss_payload_read_common_allocation_large_d, fss_payload_read_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
     f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
 
     data->delimits_object.used = 0;
@@ -449,7 +453,9 @@ extern "C" {
       if (!names[i]) continue;
 
       if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
-        if (fss_payload_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_payload_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
@@ -498,7 +504,9 @@ extern "C" {
       if (!names[i]) continue;
 
       if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
-        if (fss_payload_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_payload_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
@@ -699,7 +707,9 @@ extern "C" {
       for (i = range.start; i <= range.stop; ++i) {
 
         if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
-          if (fss_payload_read_signal_received(main)) {
+          if (fll_program_standard_signal_received(main)) {
+            fss_payload_read_print_signal_received(main);
+
             return F_status_set_error(F_interrupt);
           }
 
@@ -780,7 +790,9 @@ extern "C" {
       if (!names[at]) continue;
 
       if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
-        if (fss_payload_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_payload_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
@@ -848,7 +860,9 @@ extern "C" {
       if (!names[i]) continue;
 
       if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
-        if (fss_payload_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_payload_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
@@ -1051,7 +1065,9 @@ extern "C" {
       if (!names[at]) continue;
 
       if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
-        if (fss_payload_read_signal_received(main)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_payload_read_print_signal_received(main);
+
           return F_status_set_error(F_interrupt);
         }
 
index 68c7551ca6bf3dc5cab4d639511f7bc9c127a807..ffb14ffdac4a5e2f933fa0a1494fd5c9757d3e41 100644 (file)
@@ -63,7 +63,7 @@ extern "C" {
  * The program defines.
  */
 #ifndef _di_fss_payload_write_defines_
-  #define fss_payload_write_signal_check_d 10000
+  #define fss_payload_write_signal_check_d 20000
 
   #define FSS_PAYLOAD_WRITE_pipe_content_end_s    "\f"
   #define FSS_PAYLOAD_WRITE_pipe_content_ignore_s "\v"
index 312e4ce89baf9d3ab7bead94d40c0d0fad668c78..06f1b58d958a5aeb601a2735e228e59f93ce86e4 100644 (file)
@@ -432,10 +432,16 @@ extern "C" {
           if (main->parameters.array[fss_payload_write_parameter_object_e].result == f_console_result_additional_e) {
             for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_write_parameter_object_e].values.used; ++i) {
 
-              if (fss_payload_write_signal_received(main)) {
-                status = F_status_set_error(F_interrupt);
+              if (!((++main->signal_check) % fss_payload_write_signal_check_d)) {
+                if (fll_program_standard_signal_received(main)) {
+                  fss_payload_write_print_signal_received(main);
 
-                break;
+                  status = F_status_set_error(F_interrupt);
+
+                  break;
+                }
+
+                main->signal_check = 0;
               }
 
               status = fss_payload_write_process(main, output, quote, &argv[main->parameters.array[fss_payload_write_parameter_object_e].values.array[i]], 0, &buffer);
@@ -445,10 +451,16 @@ extern "C" {
           else {
             for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_write_parameter_content_e].values.used; ++i) {
 
-              if (fss_payload_write_signal_received(main)) {
-                status = F_status_set_error(F_interrupt);
+              if (!((++main->signal_check) % fss_payload_write_signal_check_d)) {
+                if (fll_program_standard_signal_received(main)) {
+                  fss_payload_write_print_signal_received(main);
 
-                break;
+                  status = F_status_set_error(F_interrupt);
+
+                  break;
+                }
+
+                main->signal_check = 0;
               }
 
               status = fss_payload_write_process(main, output, quote, 0, &argv[main->parameters.array[fss_payload_write_parameter_content_e].values.array[i]], &buffer);
@@ -459,10 +471,16 @@ extern "C" {
         else {
           for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_write_parameter_object_e].values.used; ++i) {
 
-            if (fss_payload_write_signal_received(main)) {
-              status = F_status_set_error(F_interrupt);
+            if (!((++main->signal_check) % fss_payload_write_signal_check_d)) {
+              if (fll_program_standard_signal_received(main)) {
+                fss_payload_write_print_signal_received(main);
 
-              break;
+                status = F_status_set_error(F_interrupt);
+
+                break;
+              }
+
+              main->signal_check = 0;
             }
 
             status = fss_payload_write_process(main, output, quote, &argv[main->parameters.array[fss_payload_write_parameter_object_e].values.array[i]], &argv[main->parameters.array[fss_payload_write_parameter_content_e].values.array[i]], &buffer);
index 5cb2006b679440a36f763d4d3e6c0577754df79f..87bff8596aa181c82ea7c020420a24cc573d9804 100644 (file)
@@ -6,9 +6,9 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_payload_write_print_signal_received_
-  void fss_payload_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+  void fss_payload_write_print_signal_received(fll_program_data_t * const main) {
 
-    if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(main->warning.to.stream);
@@ -16,42 +16,13 @@ extern "C" {
     flockfile(main->warning.to.stream);
 
     fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
-    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
     fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
 
     funlockfile(main->warning.to.stream);
   }
 #endif // _di_fss_payload_write_print_signal_received_
 
-#ifndef _di_fss_payload_write_signal_received_
-  f_status_t fss_payload_write_signal_received(fll_program_data_t * const main) {
-
-    if (main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          fss_payload_write_print_signal_received(main, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_fss_payload_write_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index b5cfa64c91cc0cfdc7b1b04815cf801679473e90..a3509bff6e6e66108d7a1f7e2fd9409def3f3a3c 100644 (file)
@@ -29,31 +29,11 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param signal
- *   The signal received.
  */
 #ifndef _di_fss_payload_write_print_signal_received_
-  extern void fss_payload_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void fss_payload_write_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_write_print_signal_received_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_payload_write_signal_received_
-  extern f_status_t fss_payload_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_payload_write_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 5494944955231b8c8138f61620399104bc26b74d..cab344755687f1f4319bdff05b0e2ce629a32ce8 100644 (file)
@@ -65,7 +65,7 @@ extern "C" {
   f_status_t fss_payload_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) {
 
     f_status_t status = F_none;
-    f_state_t state = macro_f_state_t_initialize(fss_payload_write_common_allocation_large_d, fss_payload_write_common_allocation_small_d, 0, 0, 0, 0, 0);
+    f_state_t state = macro_f_state_t_initialize(fss_payload_write_common_allocation_large_d, fss_payload_write_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
     f_string_range_t range = f_string_range_t_initialize;
 
     if (object) {
@@ -208,10 +208,16 @@ extern "C" {
 
     for (;;) {
 
-      if (fss_payload_write_signal_received(main)) {
-        status = F_status_set_error(F_interrupt);
+      if (!((++main->signal_check) % fss_payload_write_signal_check_d)) {
+        if (fll_program_standard_signal_received(main)) {
+          fss_payload_write_print_signal_received(main);
 
-        break;
+          status = F_status_set_error(F_interrupt);
+
+          break;
+        }
+
+        main->signal_check = 0;
       }
 
       if (range.start > range.stop) {
index 6e57651f806f9111af598db4be57876ae9eb95c9..d4745b03c937107c913ddabdc7dc7636aac50359 100644 (file)
@@ -73,7 +73,7 @@ extern "C" {
  * The program defines.
  */
 #ifndef _di_fss_status_code_defines_
-  #define fss_status_code_signal_check_d 10000
+  #define fss_status_code_signal_check_d 20000
 #endif // _di_fss_status_code_defines_
 
 /**
index e5007aca8880dfd789c42359825606aeb795ebfe..b130b651ce6dfd4c28f43de4dbf645a2eb9f90d7 100644 (file)
@@ -181,7 +181,9 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
           if (!((++main->signal_check) % fss_status_code_signal_check_d)) {
-            if (fss_status_code_signal_received(main)) {
+            if (fll_program_standard_signal_received(main)) {
+              fss_status_code_print_signal_received(main);
+
               status = F_status_set_error(F_interrupt);
 
               break;
@@ -211,7 +213,9 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
           if (!((++main->signal_check) % fss_status_code_signal_check_d)) {
-            if (fss_status_code_signal_received(main)) {
+            if (fll_program_standard_signal_received(main)) {
+              fss_status_code_print_signal_received(main);
+
               status = F_status_set_error(F_interrupt);
 
               break;
@@ -241,7 +245,9 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
           if (!((++main->signal_check) % fss_status_code_signal_check_d)) {
-            if (fss_status_code_signal_received(main)) {
+            if (fll_program_standard_signal_received(main)) {
+              fss_status_code_print_signal_received(main);
+
               status = F_status_set_error(F_interrupt);
 
               break;
index b0617cace45d4047ca5d086cc6d5d589d6e48c8f..ed96d23a1f90e975854d0de7a61a6aba16581f3c 100644 (file)
@@ -6,9 +6,9 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_status_code_print_signal_received_
-  void fss_status_code_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+  void fss_status_code_print_signal_received(fll_program_data_t * const main) {
 
-    if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(main->warning.to.stream);
@@ -16,42 +16,13 @@ extern "C" {
     flockfile(main->warning.to.stream);
 
     fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
-    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
     fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
 
     funlockfile(main->warning.to.stream);
   }
 #endif // _di_fss_status_code_print_signal_received_
 
-#ifndef _di_fss_status_code_signal_received_
-  f_status_t fss_status_code_signal_received(fll_program_data_t * const main) {
-
-    if (main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          fss_status_code_print_signal_received(main, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_fss_status_code_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index ecd02d2a056e662bec40fa1de4e8f4ff7ec702bf..5ba37eb4205d1f86a7c521c348d2084bc9b86c71 100644 (file)
@@ -17,31 +17,11 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param signal
- *   The signal received.
  */
 #ifndef _di_fss_status_code_print_signal_received_
-  extern void fss_status_code_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void fss_status_code_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
 #endif // _di_fss_status_code_print_signal_received_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_status_code_signal_received_
-  extern f_status_t fss_status_code_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_status_code_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 8e3edb9458af0167d577e369daf2a1b5e8d532be..4c8b2404753abadab9d85e3c9f7a552fb7593112 100644 (file)
@@ -63,7 +63,7 @@ extern "C" {
  * The program defines.
  */
 #ifndef _di_iki_read_defines_
-  #define iki_read_signal_check_d 10000
+  #define iki_read_signal_check_d 20000
 
   enum {
     iki_read_mode_content_e = 1,
index 1d28165e85b7156ebd79b8fd9a3343dfef098afe..499034b1b897cf33a87bf8a85afd478cad25b3ea 100644 (file)
@@ -433,7 +433,9 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
           if (!((++main->signal_check) % iki_read_signal_check_d)) {
-            if (iki_read_signal_received(&data)) {
+            if (fll_program_standard_signal_received(main)) {
+              iki_read_print_signal_received(&data);
+
               status = F_status_set_error(F_interrupt);
 
               break;
index d131d1cfee2b1178cd4627f8897434b1efda40b7..3173b73f497ba84b8f114aa16e2f77f286ec9285 100644 (file)
@@ -15,9 +15,9 @@ extern "C" {
 #endif // _di_iki_read_data_delete_
 
 #ifndef _di_iki_read_print_signal_received_
-  void iki_read_print_signal_received(iki_read_data_t * const data, const f_status_t signal) {
+  void iki_read_print_signal_received(iki_read_data_t * const data) {
 
-    if (data->main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (data->main->warning.verbosity != f_console_verbosity_verbose_e && data->main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(data->main->warning.to.stream);
@@ -25,42 +25,13 @@ extern "C" {
     flockfile(data->main->warning.to.stream);
 
     fl_print_format("%]%r%r%[Received signal code %]", data->main->warning.to.stream, data->main->context.set.reset, f_string_eol_s, f_string_eol_s, data->main->context.set.warning, data->main->context.set.warning);
-    fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, signal, data->main->context.set.notable);
+    fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, data->main->signal_received, data->main->context.set.notable);
     fl_print_format("%[.%]%r", data->main->warning.to.stream, data->main->context.set.warning, data->main->context.set.warning, f_string_eol_s);
 
     funlockfile(data->main->warning.to.stream);
   }
 #endif // _di_iki_read_print_signal_received_
 
-#ifndef _di_iki_read_signal_received_
-  f_status_t iki_read_signal_received(iki_read_data_t * const data) {
-
-    if (data->main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(data->main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          iki_read_print_signal_received(data, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_iki_read_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 8833f298be3bf5318ce0464f203e621e44990312..7c5536fd30f8a362934b688362da0273368e001b 100644 (file)
@@ -76,31 +76,11 @@ extern "C" {
  *
  * @param data
  *   The program data.
- * @param signal
- *   The signal received.
  */
 #ifndef _di_iki_read_print_signal_received_
-  extern void iki_read_print_signal_received(iki_read_data_t * const data, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void iki_read_print_signal_received(iki_read_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_iki_read_print_signal_received_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param data
- *   The program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_iki_read_signal_received_
-  extern f_status_t iki_read_signal_received(iki_read_data_t * const data) F_attribute_visibility_internal_d;
-#endif // _di_iki_read_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 4bc080c7cbaf669fc48cad7fe8be11e2d1b8fcf0..d41ba58699b07d65898553f2e89766273a96b55c 100644 (file)
@@ -104,7 +104,7 @@ extern "C" {
     bool unmatched = F_true;
 
     {
-      f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+      f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) data->main, 0);
 
       status = fl_iki_read(state, &data->buffer, buffer_range, iki_data);
     }
@@ -265,7 +265,7 @@ extern "C" {
     f_string_range_t range = buffer_range;
 
     {
-      f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+      f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) data->main, 0);
 
       status = fl_iki_read(state, &data->buffer, &range, iki_data);
     }
@@ -472,7 +472,7 @@ extern "C" {
     }
 
     {
-      f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+      f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) data->main, 0);
 
       status = fl_iki_read(state, &data->buffer, &range, iki_data);
     }
@@ -501,7 +501,9 @@ extern "C" {
       for (; i < data->main->parameters.array[iki_read_parameter_name_e].values.used; ++i) {
 
         if (!((++data->main->signal_check) % iki_read_signal_check_d)) {
-          if (iki_read_signal_received(data)) {
+          if (fll_program_standard_signal_received(data->main)) {
+            iki_read_print_signal_received(data);
+
             f_string_dynamic_resize(0, &name);
 
             return F_status_set_error(F_interrupt);
index eff9b948abaa2316738ca6fa89adeaaf9bae8adb..a7dbc8d9f8daee4861644cc9f321eaf0742dfcef 100644 (file)
@@ -63,7 +63,7 @@ extern "C" {
  * The program defines.
  */
 #ifndef _di_iki_write_defines_
-  #define iki_write_signal_check_d 10000
+  #define iki_write_signal_check_d 20000
 #endif // _di_iki_write_defines_
 
 /**
index d5fbd403932b5631bbf1262bf168865e4e5d4c47..b33fd270f4021e8d6dae36085008dd449700020d 100644 (file)
@@ -293,7 +293,7 @@ extern "C" {
         for (f_status_t status_pipe = F_none; ; ) {
 
           if (!((++main->signal_check) % iki_write_signal_check_d)) {
-            if (iki_write_signal_received(&data)) {
+            if (fll_program_standard_signal_received(main)) {
               status = F_status_set_error(F_interrupt);
 
               break;
@@ -420,7 +420,7 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.array[iki_write_parameter_object_e].values.used; ++i) {
 
           if (!((++main->signal_check) % iki_write_signal_check_d)) {
-            if (iki_write_signal_received(&data)) {
+            if (fll_program_standard_signal_received(main)) {
               status = F_status_set_error(F_interrupt);
 
               break;
index c169f475dda663465c824c8d75312fc8c5b74d4f..5168e724c855cd981617c109535619cd9e0a5237 100644 (file)
@@ -13,9 +13,9 @@ extern "C" {
 #endif // _di_iki_write_data_delete_
 
 #ifndef _di_iki_write_print_signal_received_
-  void iki_write_print_signal_received(iki_write_data_t * const data, const f_status_t signal) {
+  void iki_write_print_signal_received(iki_write_data_t * const data) {
 
-    if (data->main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (data->main->warning.verbosity != f_console_verbosity_verbose_e && data->main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(data->main->warning.to.stream);
@@ -23,42 +23,13 @@ extern "C" {
     flockfile(data->main->warning.to.stream);
 
     fl_print_format("%]%r%r%[Received signal code %]", data->main->warning.to.stream, data->main->context.set.reset, f_string_eol_s, f_string_eol_s, data->main->context.set.warning, data->main->context.set.warning);
-    fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, signal, data->main->context.set.notable);
+    fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, data->main->signal, data->main->context.set.notable);
     fl_print_format("%[.%]%r", data->main->warning.to.stream, data->main->context.set.warning, data->main->context.set.warning, f_string_eol_s);
 
     funlockfile(data->main->warning.to.stream);
   }
 #endif // _di_iki_write_print_signal_received_
 
-#ifndef _di_iki_write_signal_received_
-  f_status_t iki_write_signal_received(iki_write_data_t * const data) {
-
-    if (data->main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(data->main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          iki_write_print_signal_received(data, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_iki_write_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 27f1afeae20193ad90cf7625e932b59411a49ead..6dbad4c8d4ca0070425e428a019cc04bff13eb6b 100644 (file)
@@ -65,31 +65,11 @@ extern "C" {
  *
  * @param data
  *   The program data.
- * @param signal
- *   The signal received.
  */
 #ifndef _di_iki_write_print_signal_received_
-  extern void iki_write_print_signal_received(iki_write_data_t * const data, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void iki_write_print_signal_received(iki_write_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_iki_write_print_signal_received_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param data
- *   The program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_iki_write_signal_received_
-  extern f_status_t iki_write_signal_received(iki_write_data_t * const data) F_attribute_visibility_internal_d;
-#endif // _di_iki_write_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 0baba812a47a7c6d45c8db38510e828058ea2160..d2fed6e28f2555ac9803ab96da22e291790b7683 100644 (file)
@@ -73,7 +73,7 @@ extern "C" {
  * The program defines.
  */
 #ifndef _di_status_code_defines_
-  #define status_code_signal_check_d 10000
+  #define status_code_signal_check_d 20000
 #endif // _di_status_code_defines_
 
 /**
index 6ce8b7adbc7893ac4fb47791c14f0b6cf16a4f53..1ee3c476bdb57b92914522b89b7dba2e3e2bfa34 100644 (file)
@@ -6,9 +6,9 @@ extern "C" {
 #endif
 
 #ifndef _di_status_code_print_signal_received_
-  void status_code_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+  void status_code_print_signal_received(fll_program_data_t * const main) {
 
-    if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(main->warning.to.stream);
@@ -16,42 +16,13 @@ extern "C" {
     flockfile(main->warning.to.stream);
 
     fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
-    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+    fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
     fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
 
     funlockfile(main->warning.to.stream);
   }
 #endif // _di_status_code_print_signal_received_
 
-#ifndef _di_status_code_signal_received_
-  f_status_t status_code_signal_received(fll_program_data_t * const main) {
-
-    if (main->signal.id == -1) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          status_code_print_signal_received(main, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_status_code_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 4b58f326da0dcbc9601b2fd3ef302955a986237d..fb5c7a7231f77ff57cce9c31fd83fecea948b08a 100644 (file)
@@ -17,31 +17,11 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param signal
- *   The signal received.
  */
 #ifndef _di_status_code_print_signal_received_
-  extern void status_code_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+  extern void status_code_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
 #endif // _di_status_code_print_signal_received_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_status_code_signal_received_
-  extern f_status_t status_code_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_status_code_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 1caf71df1d5fe985a69821aba0a8e1571f4a0190..3c383e8c28bd9fcf7b1ee1a778653012cfd8902a 100644 (file)
@@ -181,7 +181,9 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
           if (!((++main->signal_check) % status_code_signal_check_d)) {
-            if (status_code_signal_received(main)) {
+            if (fll_program_standard_signal_received(main)) {
+              status_code_print_signal_received(main);
+
               status = F_status_set_error(F_signal);
 
               break;
@@ -211,7 +213,9 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
           if (!((++main->signal_check) % status_code_signal_check_d)) {
-            if (status_code_signal_received(main)) {
+            if (fll_program_standard_signal_received(main)) {
+              status_code_print_signal_received(main);
+
               status = F_status_set_error(F_signal);
 
               break;
@@ -241,7 +245,9 @@ extern "C" {
         for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
 
           if (!((++main->signal_check) % status_code_signal_check_d)) {
-            if (status_code_signal_received(main)) {
+            if (fll_program_standard_signal_received(main)) {
+              status_code_print_signal_received(main);
+
               status = F_status_set_error(F_signal);
 
               break;
index 092b2406d3823b059b701e1456ca403d70c7c03d..c71d95e733335fbc56a5ca0f5334028f77a93818 100644 (file)
@@ -80,7 +80,7 @@ extern "C" {
  * The program defines.
  */
 #ifndef _di_utf8_defines_
-  #define utf8_signal_check_d 10000
+  #define utf8_signal_check_d 20000
 
   #define UTF8_string_combining_is_s  "C"
   #define UTF8_string_combining_not_s "N"
index 6a7b232ce7742f60d8964c6d429704a3dc667e7b..e8bbe72a28c65161282051a6297b97384a5f4822 100644 (file)
@@ -18,35 +18,6 @@ extern "C" {
   }
 #endif // _di_utf8_data_delete_
 
-#ifndef _di_utf8_signal_received_
-  f_status_t utf8_signal_received(utf8_data_t * const data) {
-
-    if (!data->main->signal.id) {
-      return F_false;
-    }
-
-    struct signalfd_siginfo information;
-
-    memset(&information, 0, sizeof(struct signalfd_siginfo));
-
-    if (f_signal_read(data->main->signal, 0, &information) == F_signal) {
-      switch (information.ssi_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:
-          utf8_print_signal_received(data, information.ssi_signo);
-
-          return information.ssi_signo;
-      }
-    }
-
-    return F_false;
-  }
-#endif // _di_utf8_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 5cff7cf7d95c91bfe647bfd1956fdfaa38a0fa98..a291ee291bc24b6b87ffc7187a153b60d73a969a 100644 (file)
@@ -94,24 +94,6 @@ extern "C" {
   extern void utf8_data_delete(utf8_data_t *data) F_attribute_visibility_internal_d;
 #endif // _di_utf8_data_delete_
 
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param data
- *   The program data.
- *
- * @return
- *   A positive number representing a valid signal on signal received.
- *   F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_utf8_signal_received_
-  extern f_status_t utf8_signal_received(utf8_data_t * const data) F_attribute_visibility_internal_d;
-#endif // _di_utf8_signal_received_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 3b88459a2fa386864704bd97afc87fcd34aa418a..780f9b2448a5d4c73a39a898d1936e86473f7558 100644 (file)
@@ -255,7 +255,7 @@ extern "C" {
 #ifndef _di_utf8_print_signal_received_
   void utf8_print_signal_received(utf8_data_t * const data, const f_status_t signal) {
 
-    if (data->main->warning.verbosity != f_console_verbosity_verbose_e) return;
+    if (data->main->warning.verbosity != f_console_verbosity_verbose_e && data->main->warning.verbosity != f_console_verbosity_debug_e) return;
 
     // Must flush and reset color because the interrupt may have interrupted the middle of a print function.
     fflush(data->main->warning.to.stream);
index f616bc945346850d6c032b1c9742727e9133c429..255a46ec23961526260ce3e4878ec9e2c72df95d 100644 (file)
@@ -27,10 +27,10 @@ extern "C" {
     for (; text.string[0] && F_status_is_error_not(status); ) {
 
       if (!((++data->main->signal_check) % utf8_signal_check_d)) {
-        if (utf8_signal_received(data)) {
+        if (fll_program_standard_signal_received(data->main)) {
           utf8_print_signal_received(data, status);
 
-          status = F_status_set_error(F_signal);
+          status = F_status_set_error(F_interrupt);
 
           break;
         }
index 53de6b95878064a8986a7dc22e37b7952012775d..6670bda07442a521c5f501e3506275d77773cff7 100644 (file)
@@ -24,7 +24,7 @@ extern "C" {
  * @return
  *   F_true on success and is valid.
  *   F_false on success and contains invalid sequences.
- *   F_signal on (exit) signal received.
+ *   F_interrupt on (exit) signal received.
  *
  *   Errors (with error bit) from: utf8_convert_binary()
  *   Errors (with error bit) from: utf8_convert_codepoint()
index 5c1d94d6293c2d35341bcb8547044cdecccd5d96..b5f440b1a1abf192621eb340ccc3ddb64fac4234 100644 (file)
@@ -83,10 +83,10 @@ extern "C" {
       for (i = 0; F_status_is_fine(status) && i < data->buffer.used; ) {
 
         if (!((++data->main->signal_check) % utf8_signal_check_d)) {
-          if (utf8_signal_received(data)) {
+          if (fll_program_standard_signal_received(data->main)) {
             utf8_print_signal_received(data, status);
 
-            status = F_signal;
+            status = F_interrupt;
 
             break;
           }
@@ -130,10 +130,10 @@ extern "C" {
       i = 0;
       data->buffer.used = 0;
 
-    } while (F_status_is_fine(status) && status != F_signal);
+    } while (F_status_is_fine(status) && status != F_interrupt);
 
     // Handle last (incomplete) character when the buffer ended before the character is supposed to end.
-    if (F_status_is_error_not(status) && status != F_signal && next == F_false) {
+    if (F_status_is_error_not(status) && status != F_interrupt && next == F_false) {
       character.used = j;
 
       if (data->mode & utf8_mode_from_binary_d) {
@@ -154,7 +154,7 @@ extern "C" {
 
     data->buffer.used = 0;
 
-    if (F_status_is_error(status) || status == F_signal) {
+    if (F_status_is_error(status) || status == F_interrupt) {
       return status;
     }
 
index 732a4082978aefc4562916d7f00b184c318b03be..43ee5031635d1e17812238bba8d6c4be73bfeb9f 100644 (file)
@@ -47,14 +47,14 @@ extern "C" {
  * @return
  *   F_true on success and is valid.
  *   F_false on success and contains invalid sequences.
- *   F_signal on (exit) signal received.
+ *   F_interrupt on (exit) signal received.
  *
  *   Errors (with error bit) from: utf8_convert_binary()
  *   Errors (with error bit) from: utf8_detect_codepoint()
  *
+ * @see fll_program_standard_signal_received()
  * @see utf8_convert_binary()
  * @see utf8_detect_codepoint()
- * @see utf8_signal_received()
  */
 #ifndef _di_utf8_process_file_binary_
   extern f_status_t utf8_process_file_binary(utf8_data_t * const data, const f_file_t file) F_attribute_visibility_internal_d;
index 64f5201195ef6ef5ff6c73946882036d17176247..6df7b29d7eb24ce3c86398fee5b75f800c85cdb5 100644 (file)
@@ -219,10 +219,10 @@ extern "C" {
       for (i = 0; F_status_is_fine(status) && i < data->buffer.used; ) {
 
         if (!((++data->main->signal_check) % utf8_signal_check_d)) {
-          if (utf8_signal_received(data)) {
+          if (fll_program_standard_signal_received(data->main)) {
             utf8_print_signal_received(data, status);
 
-            status = F_signal;
+            status = F_interrupt;
 
             break;
           }
@@ -266,10 +266,10 @@ extern "C" {
       i = 0;
       data->buffer.used = 0;
 
-    } while (F_status_is_fine(status) && status != F_signal);
+    } while (F_status_is_fine(status) && status != F_interrupt);
 
     // Handle last (incomplete) character when the buffer ended before the character is supposed to end.
-    if (F_status_is_error_not(status) && status != F_signal && next == F_false) {
+    if (F_status_is_error_not(status) && status != F_interrupt && next == F_false) {
       character.used = j;
 
       if (data->mode & utf8_mode_from_binary_d) {
@@ -290,7 +290,7 @@ extern "C" {
 
     data->buffer.used = 0;
 
-    if (F_status_is_error(status) || status == F_signal) {
+    if (F_status_is_error(status) || status == F_interrupt) {
       return status;
     }
 
index 2b1a4f24f46cbd98f2a9b7b0cec4d3a920a8bc71..fcd935c4d1fe1d2451e484e5f55ae1f1691c5049 100644 (file)
@@ -68,14 +68,14 @@ extern "C" {
  * @return
  *   F_true on success and is valid.
  *   F_false on success and contains invalid sequences.
- *   F_signal on (exit) signal received.
+ *   F_interrupt on (exit) signal received.
  *
  *   Errors (with error bit) from: utf8_convert_binary()
  *   Errors (with error bit) from: utf8_detect_codepoint()
  *
+ * @see fll_program_standard_signal_received()
  * @see utf8_convert_binary()
  * @see utf8_detect_codepoint()
- * @see utf8_signal_received()
  */
 #ifndef _di_utf8_process_file_codepoint_
   extern f_status_t utf8_process_file_codepoint(utf8_data_t * const data, const f_file_t file) F_attribute_visibility_internal_d;
index 5e7d92ca1b4ef6c6ada8e95726ece031cb3cf4de..1730488283b94c6bfbd9ddda56fcc7c16ce4610b 100644 (file)
@@ -390,17 +390,17 @@ extern "C" {
         }
       }
 
-      if (F_status_is_error_not(status) && status != F_signal && main->parameters.array[utf8_parameter_from_file_e].result == f_console_result_additional_e) {
+      if (F_status_is_error_not(status) && status != F_interrupt && main->parameters.array[utf8_parameter_from_file_e].result == f_console_result_additional_e) {
         f_array_length_t i = 0;
         f_array_length_t index = 0;
 
         f_file_t file = macro_f_file_t_initialize(0, -1, F_file_flag_read_only_d, 32768, F_file_default_write_size_d);
 
-        for (; i < main->parameters.array[utf8_parameter_from_file_e].values.used && status != F_signal; ++i) {
+        for (; i < main->parameters.array[utf8_parameter_from_file_e].values.used && status != F_interrupt; ++i) {
 
           if (!((++main->signal_check) % utf8_signal_check_d)) {
-            if (utf8_signal_received(&data)) {
-              status = F_status_set_error(F_signal);
+            if (fll_program_standard_signal_received(main)) {
+              status = F_status_set_error(F_interrupt);
 
               break;
             }
@@ -443,12 +443,12 @@ extern "C" {
         } // for
       }
 
-      if (F_status_is_error_not(status) && status != F_signal && main->parameters.remaining.used) {
+      if (F_status_is_error_not(status) && status != F_interrupt && main->parameters.remaining.used) {
         for (f_array_length_t i = 0; F_status_is_error_not(status) && i < main->parameters.remaining.used; ++i) {
 
           if (!((++main->signal_check) % utf8_signal_check_d)) {
-            if (utf8_signal_received(&data)) {
-              status = F_status_set_error(F_signal);
+            if (fll_program_standard_signal_received(main)) {
+              status = F_status_set_error(F_interrupt);
 
               break;
             }
@@ -470,7 +470,7 @@ extern "C" {
     }
 
     if (main->output.verbosity != f_console_verbosity_quiet_e && main->parameters.array[utf8_parameter_verify_e].result == f_console_result_none_e) {
-      if (status == F_signal) {
+      if (status == F_interrupt) {
         fflush(data.file.stream);
 
         if (data.file.stream != main->output.to.stream) {
@@ -483,7 +483,7 @@ extern "C" {
 
     utf8_data_delete(&data);
 
-    if (F_status_is_error(status) || status == F_signal) {
+    if (F_status_is_error(status) || status == F_interrupt) {
       return status;
     }
 
index c8fa4177274ea72a7d6655206f64b4aabea7521b..1d65baca1d6f490104f431075021b605f96151b4 100644 (file)
@@ -96,7 +96,7 @@ extern "C" {
  *   F_none on success.
  *   F_true on success when performing verification and verify passed.
  *   F_false on success when performing verification and verify failed.
- *   F_signal on (exit) signal received.
+ *   F_interrupt on (exit) signal received.
  *
  *   Status codes (with error bit) are returned on any problem.
  */