]> Kevux Git Server - fll/commit
Update: Signal related updates, consistency improvements, and miscellaneous code...
authorKevin Day <thekevinday@gmail.com>
Fri, 12 Nov 2021 05:04:37 +0000 (23:04 -0600)
committerKevin Day <thekevinday@gmail.com>
Fri, 12 Nov 2021 05:16:40 +0000 (23:16 -0600)
commit89d3bc13340e604b59f542c94996e5150bfbf64a
tree88f2c31b76757de226c52cfa8ae9107ee4f87e18
parentc9016eb67977c5f5e3803164a0c1809608a5aaff
Update: Signal related updates, consistency improvements, and miscellaneous code cleanups.

Add support for setting the timeout via f_signal_read().

I am using both F_signal and F_interrupt.
The F_signal is more general and in this since is more accurate.
However, F_interrupt is more accurate to the intent in the design.
When an interrupt is received exit.
All signals being treated as an interrupt will need to exit, so just pass F_interrupt.

Provide a consistent reporting of handling the signals.

Setup all programs to catch and handle signals, allowing for a clean exit.
There are so many changes in this regard, I went for a quick approach.
In every loop that at glance look like it would be a good point to check for signal, the code now checks for signal.
There is likely a need for performance consideration in this.
There is likely a need for invetigating this further to make sure it is still responsive (as in, investigate to see if I need to add additional signal checks).
Programs like fake and controller already handle the signal.
These programs are update to be consistent with this newer design.

The "main" structure used in the programs is sometimes a constant variable and other times a pointer.
While there are performance and security reasons, I am finding that consistency is better at this point in time.
Pass all of the "main" structures as either a constant pointe or a pointer.
At some point in the future, I can see myself reviewing these and making performance improvements that might result in reverting some of this.
Having be more consistent will make the code a bit more mangeable during this highly active development and design period.

Miscellaneous syntax cleanups of any code that I happened to notice needs cleaning and can be easily cleaned on the spot.

When interrupting, flush the output and print a new line.
This is effective in properly cleaning the console (to some reasonable extent), which can be messy when exiting due to an interrupt.

I did not get a change to utilize the signal handling function callbacks in the FSS processing functions.
I will need to follow up this commit with such a change.
I need to see if the IKI processing functions also can do this and need to do this as well.

I haven't had a chance to really look at each of the programs after this change.
I will need to spend time making suring there are no regressions.
183 files changed:
level_0/f_signal/c/signal.c
level_0/f_signal/c/signal.h
level_1/fl_print/c/private-print.c
level_1/fl_signal/c/signal.c
level_3/byte_dump/c/byte_dump.c
level_3/byte_dump/c/byte_dump.h
level_3/byte_dump/c/main.c
level_3/byte_dump/c/private-byte_dump.c
level_3/byte_dump/c/private-byte_dump.h
level_3/byte_dump/c/private-common.c
level_3/byte_dump/c/private-common.h
level_3/byte_dump/data/build/dependencies
level_3/control/c/control.c
level_3/control/c/control.h
level_3/control/c/main.c
level_3/control/c/private-common.c
level_3/control/c/private-common.h
level_3/control/data/build/dependencies
level_3/controller/c/controller.c
level_3/controller/c/controller.h
level_3/controller/c/main.c
level_3/controller/c/private-common.c
level_3/controller/c/private-common.h
level_3/controller/c/private-controller.h
level_3/controller/c/private-controller_print.c
level_3/controller/c/private-controller_print.h
level_3/controller/c/private-entry.c
level_3/controller/c/private-lock.c
level_3/controller/c/private-lock.h
level_3/controller/c/private-lock_print.c
level_3/controller/c/private-lock_print.h
level_3/controller/c/private-process.c
level_3/controller/c/private-process.h
level_3/controller/c/private-rule.c
level_3/controller/c/private-rule.h
level_3/controller/c/private-thread.c
level_3/controller/c/private-thread.h
level_3/controller/c/private-thread_entry.c
level_3/fake/c/fake.c
level_3/fake/c/fake.h
level_3/fake/c/main.c
level_3/fake/c/private-build.c
level_3/fake/c/private-build.h
level_3/fake/c/private-clean.c
level_3/fake/c/private-clean.h
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.c
level_3/fake/c/private-make.h
level_3/fake/c/private-print.c
level_3/fake/c/private-print.h
level_3/fake/c/private-skeleton.c
level_3/fake/c/private-skeleton.h
level_3/firewall/c/firewall.c
level_3/firewall/c/firewall.h
level_3/firewall/c/main.c
level_3/firewall/c/private-common.c
level_3/firewall/c/private-common.h
level_3/firewall/c/private-firewall.c
level_3/firewall/c/private-firewall.h
level_3/firewall/data/build/dependencies
level_3/fss_basic_list_read/c/fss_basic_list_read.c
level_3/fss_basic_list_read/c/fss_basic_list_read.h
level_3/fss_basic_list_read/c/main.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-fss_basic_list_read.c
level_3/fss_basic_list_read/c/private-fss_basic_list_read.h
level_3/fss_basic_list_read/data/build/dependencies
level_3/fss_basic_list_write/c/fss_basic_list_write.c
level_3/fss_basic_list_write/c/fss_basic_list_write.h
level_3/fss_basic_list_write/c/main.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-fss_basic_list_write.c
level_3/fss_basic_list_write/c/private-fss_basic_list_write.h
level_3/fss_basic_list_write/data/build/dependencies
level_3/fss_basic_read/c/fss_basic_read.c
level_3/fss_basic_read/c/fss_basic_read.h
level_3/fss_basic_read/c/main.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-fss_basic_read.c
level_3/fss_basic_read/c/private-fss_basic_read.h
level_3/fss_basic_read/data/build/dependencies
level_3/fss_basic_write/c/fss_basic_write.c
level_3/fss_basic_write/c/fss_basic_write.h
level_3/fss_basic_write/c/main.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-fss_basic_write.c
level_3/fss_basic_write/c/private-fss_basic_write.h
level_3/fss_basic_write/data/build/dependencies
level_3/fss_embedded_list_read/c/fss_embedded_list_read.c
level_3/fss_embedded_list_read/c/fss_embedded_list_read.h
level_3/fss_embedded_list_read/c/main.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-fss_embedded_list_read.c
level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.h
level_3/fss_embedded_list_read/data/build/dependencies
level_3/fss_embedded_list_write/c/fss_embedded_list_write.c
level_3/fss_embedded_list_write/c/fss_embedded_list_write.h
level_3/fss_embedded_list_write/c/main.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-fss_embedded_list_write.c
level_3/fss_embedded_list_write/c/private-fss_embedded_list_write.h
level_3/fss_embedded_list_write/data/build/dependencies
level_3/fss_extended_list_read/c/fss_extended_list_read.c
level_3/fss_extended_list_read/c/fss_extended_list_read.h
level_3/fss_extended_list_read/c/main.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-fss_extended_list_read.c
level_3/fss_extended_list_read/c/private-fss_extended_list_read.h
level_3/fss_extended_list_read/data/build/dependencies
level_3/fss_extended_list_write/c/fss_extended_list_write.c
level_3/fss_extended_list_write/c/fss_extended_list_write.h
level_3/fss_extended_list_write/c/main.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-fss_extended_list_write.c
level_3/fss_extended_list_write/c/private-fss_extended_list_write.h
level_3/fss_extended_list_write/data/build/dependencies
level_3/fss_extended_read/c/fss_extended_read.c
level_3/fss_extended_read/c/fss_extended_read.h
level_3/fss_extended_read/c/main.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-fss_extended_read.c
level_3/fss_extended_read/c/private-fss_extended_read.h
level_3/fss_extended_read/data/build/dependencies
level_3/fss_extended_write/c/fss_extended_write.c
level_3/fss_extended_write/c/fss_extended_write.h
level_3/fss_extended_write/c/main.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-fss_extended_write.c
level_3/fss_extended_write/c/private-fss_extended_write.h
level_3/fss_extended_write/data/build/dependencies
level_3/fss_identify/c/fss_identify.c
level_3/fss_identify/c/fss_identify.h
level_3/fss_identify/c/main.c
level_3/fss_identify/c/private-common.c
level_3/fss_identify/c/private-common.h
level_3/fss_identify/c/private-fss_identify.c
level_3/fss_identify/c/private-fss_identify.h
level_3/fss_identify/data/build/dependencies
level_3/fss_status_code/c/fss_status_code.c
level_3/fss_status_code/c/fss_status_code.h
level_3/fss_status_code/c/main.c
level_3/fss_status_code/c/private-common.c
level_3/fss_status_code/c/private-common.h
level_3/fss_status_code/c/private-fss_status_code.c
level_3/fss_status_code/c/private-fss_status_code.h
level_3/fss_status_code/data/build/dependencies
level_3/iki_read/c/iki_read.c
level_3/iki_read/c/iki_read.h
level_3/iki_read/c/main.c
level_3/iki_read/c/private-common.c
level_3/iki_read/c/private-common.h
level_3/iki_read/c/private-iki_read.c
level_3/iki_read/c/private-iki_read.h
level_3/iki_read/data/build/dependencies
level_3/iki_write/c/iki_write.c
level_3/iki_write/c/iki_write.h
level_3/iki_write/c/main.c
level_3/iki_write/c/private-common.c
level_3/iki_write/c/private-common.h
level_3/iki_write/c/private-iki_write.c
level_3/iki_write/c/private-iki_write.h
level_3/iki_write/data/build/dependencies
level_3/status_code/c/main.c
level_3/status_code/c/private-common.c
level_3/status_code/c/private-common.h
level_3/status_code/c/private-status_code.c
level_3/status_code/c/private-status_code.h
level_3/status_code/c/status_code.c
level_3/status_code/c/status_code.h
level_3/status_code/data/build/dependencies