]> Kevux Git Server - fll/commit
Update: consistency issues in code design, better utilize global constants, and other...
authorKevin Day <thekevinday@gmail.com>
Wed, 6 Jan 2021 04:58:51 +0000 (22:58 -0600)
committerKevin Day <thekevinday@gmail.com>
Wed, 6 Jan 2021 04:58:51 +0000 (22:58 -0600)
commit9e07a813c69418db1d7f935bf129b4d3038e7e7b
tree744937bac5ccc97964c3ba9e234e4662b77d81f6
parentde104f0b35fb6f97e82c81623422f6fc377ea5bb
Update: consistency issues in code design, better utilize global constants, and other related changes or cleanups.

Over time the code gets out of sync and less consistent.
Update the source code structure to be a bit more consisten.
There are more commits like this to come.

Some of the consistency improvements involve:
- Utilizing the XXX-common.h (and now XXX-common.c) sources.
- Utilize the private-XXX.h and private-XXX.c sources.
- More consistent declaration of allocation-related macros.
  - This updates mostly the array related structures.
  - This does not include the matrix related structures (an array of an array) to keep this commit from being too massive.
  - Re-order how I declae the allocation macros.
  - Add more of the increase(..), decrease(..) and similar macros (there will be further work on this in the future).
  - Use keyword "register" for the resize, delete, and similar macros.
- If there are any sources, the main source for a project will exist even if it is empty.
- Start a practice of using "_s", even in the define declarations for the "_di_XXX_" blocks.
- Add semicolons at the end of macro functions.
  - In the past, I decided to not have these but now I have decided the semicolons probably should be there as a practice (even if their presence could be redundant).
  - Any exception cases where a macro function is meant to be used inline will not have semicolon.
  - I only spent so much time on this an there are likely several more macros to cleanup in this regard.

I have been using "const static" for global strings.
I seem to have forgotten that the C keyword "static" does not operate like "static" would natural do so in the global scope.
The solution is to remove the static and make these "extern".
Then those "extern" must be added to a source file and compiled in.
Use these newly defined global constants strings more consistently.

This adds a source file to f_string project.
I tried avoiding this in the past but now that I am, I should move much of the fl_string code into f_string.
This will simplify the project in many ways, but the changeset will be huge.
To avoid mixing too much more in this commit, I will address this aspect at a later date.

Simplify the allocation error, reducing memory related statuc codes to just F_memory and F_memory_not.

The recent changes where thread (pthread) support being added caused problems (and revealed problems) in my package helper script.
Fix the revealed problems in the package helper script.
Update the package helper script to better handle the special situations in regards to thread support.

Update all of these settings files based on the dependency changes and the packager helper script changes.

Fix a bug in the memory resize/adjust logic where I failed to consistenty memset newly allocated space.
This is the result of checking to see if the pointe has changed.
I no longer no why I was doing that and it seems plainly wrong.
I also never consistently performed memset() after calloc() (Inside the adjust/resize, memset() is not being called).
Newly allocated memory should be guaranteed zeroed according to the designs of this project and this should now be true.

Minor cleanup in the filesystem paths.
I renamed "filesystem" to "tree" in this regard and relocated that code to the path-common.h, dropping the path_filesystem.h file.

Add ascii characters.
If I am going to use hardcoded strings, use the global constant strings to reduce the code size (even if only by small margins).
More work is needed here, I only did what I needed to do.
I would note that this is intended for ASCII only and is not intended to be locale/language aware.

Any error message during testing lead me to noticing a problem in the private_fll_error_print() in regards to the text being printed.
Add the access denied error message while I am at it.
237 files changed:
build/level_0/settings
build/level_1/settings
build/level_2/settings
build/monolithic/settings
build/scripts/package.sh
level_0/f_account/c/account-common.h
level_0/f_account/data/build/settings
level_0/f_capability/data/build/settings
level_0/f_color/c/color-common.c [new file with mode: 0644]
level_0/f_color/c/color-common.h [new file with mode: 0644]
level_0/f_color/c/color.c [new file with mode: 0644]
level_0/f_color/c/color.h
level_0/f_color/data/build/dependencies
level_0/f_color/data/build/settings
level_0/f_console/c/console-common.c [new file with mode: 0644]
level_0/f_console/c/console-common.h
level_0/f_console/c/console.c
level_0/f_console/c/console.h
level_0/f_console/data/build/settings
level_0/f_control_group/c/control_group-common.c [new file with mode: 0644]
level_0/f_control_group/c/control_group-common.h
level_0/f_control_group/c/control_group.c [new file with mode: 0644]
level_0/f_control_group/data/build/settings
level_0/f_conversion/c/conversion.c
level_0/f_conversion/data/build/settings
level_0/f_directory/c/directory.c
level_0/f_directory/c/directory.h
level_0/f_directory/c/directory_type.h
level_0/f_directory/data/build/settings
level_0/f_environment/c/environment.h
level_0/f_environment/c/private-environment.h
level_0/f_environment/data/build/settings
level_0/f_execute/data/build/settings
level_0/f_file/c/file-common.c [new file with mode: 0644]
level_0/f_file/c/file-common.h
level_0/f_file/c/file.c
level_0/f_file/c/file.h
level_0/f_file/c/private-file.c
level_0/f_file/data/build/settings
level_0/f_fss/c/fss-common.h
level_0/f_fss/c/fss_comment.h
level_0/f_fss/c/fss_delimit.h
level_0/f_fss/c/fss_named.h
level_0/f_fss/c/fss_nest.h
level_0/f_fss/c/fss_quote.h
level_0/f_fss/c/fss_set.h
level_0/f_fss/data/build/settings
level_0/f_iki/c/iki-common.c [new file with mode: 0644]
level_0/f_iki/c/iki-common.h
level_0/f_iki/c/iki.h
level_0/f_iki/data/build/settings
level_0/f_limit/c/limit-common.h
level_0/f_memory/c/memory-common.h
level_0/f_memory/c/memory.c
level_0/f_memory/c/memory.h
level_0/f_memory/c/memory_structure.h
level_0/f_memory/c/private-memory.c
level_0/f_path/c/path-common.c [new file with mode: 0644]
level_0/f_path/c/path-common.h
level_0/f_path/c/path.c
level_0/f_path/c/path.h
level_0/f_path/c/path_filesystem.h [deleted file]
level_0/f_path/c/path_fll.h [deleted file]
level_0/f_path/c/private-path.c
level_0/f_path/c/private-path.h
level_0/f_path/data/build/settings
level_0/f_print/data/build/settings
level_0/f_serialize/c/private-serialize.c
level_0/f_serialize/c/serialize-common.c [new file with mode: 0644]
level_0/f_serialize/c/serialize-common.h
level_0/f_serialize/c/serialize.c
level_0/f_serialize/c/serialize.h
level_0/f_serialize/data/build/settings
level_0/f_socket/data/build/settings
level_0/f_status/c/status.h
level_0/f_status/c/status_array.h
level_0/f_string/c/string-common.c [new file with mode: 0644]
level_0/f_string/c/string-common.h
level_0/f_string/c/string.c [new file with mode: 0644]
level_0/f_string/c/string.h
level_0/f_string/c/string_dynamic.h
level_0/f_string/c/string_map.h
level_0/f_string/c/string_quantity.h
level_0/f_string/c/string_range.h
level_0/f_string/c/string_triple.h
level_0/f_string/data/build/settings
level_0/f_thread/c/thread-common.h
level_0/f_type/c/type_array.h
level_0/f_utf/c/utf-common.h
level_0/f_utf/c/utf.h
level_0/f_utf/data/build/settings
level_1/fl_color/c/color.h
level_1/fl_color/data/build/settings
level_1/fl_console/c/console.c
level_1/fl_console/c/console.h
level_1/fl_console/data/build/dependencies
level_1/fl_console/data/build/settings
level_1/fl_control_group/data/build/settings
level_1/fl_conversion/data/build/settings
level_1/fl_directory/c/directory.h
level_1/fl_directory/c/private-directory.c
level_1/fl_directory/c/private-directory.h
level_1/fl_directory/data/build/settings
level_1/fl_environment/c/environment.c
level_1/fl_environment/c/environment.h
level_1/fl_environment/data/build/settings
level_1/fl_execute/data/build/settings
level_1/fl_fss/c/fss_basic.h
level_1/fl_fss/c/fss_basic_list.h
level_1/fl_fss/c/fss_embedded_list.h
level_1/fl_fss/c/fss_extended.h
level_1/fl_fss/c/fss_extended_list.h
level_1/fl_fss/c/private-fss.h
level_1/fl_fss/data/build/settings
level_1/fl_iki/c/iki.h
level_1/fl_iki/data/build/settings
level_1/fl_print/data/build/settings
level_1/fl_status/c/status.c
level_1/fl_status/c/status.h
level_1/fl_status/data/build/settings
level_1/fl_string/c/private-string.h
level_1/fl_string/c/string.h
level_1/fl_string/data/build/settings
level_1/fl_type/c/type.h
level_1/fl_utf/c/private-utf.h
level_1/fl_utf/c/utf.h
level_1/fl_utf/data/build/settings
level_1/fl_utf_file/data/build/settings
level_2/fll_control_group/data/build/settings
level_2/fll_environment/data/build/settings
level_2/fll_error/c/error-common.c [new file with mode: 0644]
level_2/fll_error/c/error-common.h
level_2/fll_error/c/private-error.c
level_2/fll_error/data/build/settings
level_2/fll_execute/c/execute.c
level_2/fll_execute/data/build/settings
level_2/fll_file/c/private-file.c
level_2/fll_file/data/build/settings
level_2/fll_fss/c/fss.h
level_2/fll_fss/c/fss_basic.h
level_2/fll_fss/c/fss_basic_list.h
level_2/fll_fss/c/fss_embedded_list.h
level_2/fll_fss/c/fss_extended.h
level_2/fll_fss/c/fss_extended_list.h
level_2/fll_fss/data/build/settings
level_2/fll_iki/data/build/settings
level_2/fll_path/c/path.c
level_2/fll_path/data/build/settings
level_2/fll_program/c/program.c
level_2/fll_program/c/program.h
level_2/fll_program/data/build/settings
level_2/fll_status/c/status.c
level_2/fll_status/data/build/settings
level_3/byte_dump/c/byte_dump.c
level_3/byte_dump/c/byte_dump.h
level_3/byte_dump/c/private-byte_dump.c
level_3/byte_dump/data/build/settings
level_3/control/c/control.c
level_3/control/c/control.h
level_3/control/data/build/settings
level_3/controller/c/controller.c
level_3/controller/c/controller.h
level_3/controller/c/private-controller.c
level_3/controller/c/private-entry.c
level_3/controller/c/private-rule.c
level_3/controller/data/build/settings
level_3/fake/c/fake.c
level_3/fake/c/fake.h
level_3/fake/c/private-build.c
level_3/fake/c/private-fake.c
level_3/fake/c/private-make.c
level_3/fake/c/private-print.c
level_3/fake/data/build/settings
level_3/firewall/c/firewall.c
level_3/firewall/c/firewall.h
level_3/firewall/c/private-firewall.c
level_3/firewall/data/build/settings
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/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/settings
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/private-fss_basic_list_write.c
level_3/fss_basic_list_write/data/build/settings
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/private-fss_basic_read.c
level_3/fss_basic_read/c/private-fss_basic_read.h
level_3/fss_basic_read/data/build/settings
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/private-fss_basic_write.c
level_3/fss_basic_write/data/build/settings
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/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/settings
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/private-fss_embedded_list_write.c
level_3/fss_embedded_list_write/data/build/settings
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/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/settings
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/private-fss_extended_list_write.c
level_3/fss_extended_list_write/data/build/settings
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/private-fss_extended_read.c
level_3/fss_extended_read/c/private-fss_extended_read.h
level_3/fss_extended_read/data/build/settings
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/private-fss_extended_write.c
level_3/fss_extended_write/data/build/settings
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/data/build/settings
level_3/iki_read/c/iki_read.c
level_3/iki_read/c/iki_read.h
level_3/iki_read/data/build/settings
level_3/iki_write/c/iki_write.c
level_3/iki_write/c/iki_write.h
level_3/iki_write/data/build/settings
level_3/init/c/init.c
level_3/init/c/init.h
level_3/init/data/build/settings
level_3/status_code/c/status_code.c
level_3/status_code/c/status_code.h
level_3/status_code/data/build/settings