Kevin Day [Sat, 20 Apr 2024 04:29:22 +0000 (23:29 -0500)]
Update: Add additional time types, refactor f_time_spec and similar, and rebuild stand alone build configs.
The f_time_spec_t is not the same as "struct timespec".
Avoid confusion by renaming it to f_time_simple_t.
rename f_date_spec_t to f_date_simple_t for the same reason.
Add additional types and now that f_time_spec_t is available, create f_time_spec_t as a typedef of "struct timespec".
Update the stand alone build scripts with all of these changes and some changes from previous commits.
Kevin Day [Mon, 15 Apr 2024 04:02:08 +0000 (23:02 -0500)]
Update: Add experimental ctags generation and ctags file.
This is used by projects like geany.
Unfortunately, the code is terrible and the documentation is like rotten eggs.
They seem to somehow put hard-coded paths in the ctag files which makes absolute no sense.
Then, the geany project provides completely different ctag files that do not have this path nonsense.
The geany documentation does not relate to their actual ctag files and the ones provided by their example.
The Universal-ctags documentation, while having a lot of words, is misleading, awkward, and doesn't even describe how to get rid of these paths nor how to omit the paths.
Following the parts that does seem to read as if it means removing the path does absolutely not this.
The geany does not even import this file properly, despite the command coming directly from geany's documentation.
Using geany to generate this produces better results but also includes a lot of other junk that is unwanted.
It also includes the file paths.
Having the file paths makes these generated ctag files completely useless as it requires some other person to have the exact same absolute file path structure.
For now, attempt to strip out the absolute path using a sed command.
Add use of this in the unit test.
Remove seemingly duplicate unit tests.
Maybe I was trying to do a case of "bind()" returning "false", but the code does not do that in the duplicate unit tests.
Remove the duplicate unit tests as I can always add the "false" case in the future if I so choose to.
Kevin Day [Wed, 10 Apr 2024 02:48:15 +0000 (21:48 -0500)]
Update: Have fll_program_print_copyright() use year and author as a parameter.
The year and author may be more subject to change.
Relocate this into a global static string and provide this is a parameter to fll_program_print_copyright().
The fll_program_print_copyright() is only intended for FLL projects.
Additional programs that I write, like controller, may also depend on this.
These may be operated on at a different time and thus may require the year or author to be updated.
Any more changes than this and it is probably a better idea to just implement ones own copyright print function.
Kevin Day [Wed, 10 Apr 2024 02:29:03 +0000 (21:29 -0500)]
Cleanup: The OSLv1 license usage, fixing license reference.
The license should read "open-standard-license-1.0-or-later" rather than "open-standard-license-1.0".
The license file itself is already labelled this.
These files simply were not correctly updated.
Kevin Day [Mon, 8 Apr 2024 01:53:03 +0000 (20:53 -0500)]
Update: Add support for disable pthread mutex prioceiling for systems that do not support it.
The pthread mutex prioceiling functions are not supported on PostmarketOS for Pinephone.
The PostmarketOS for Pinephone is an A64 Arm system based on the Alpine Linux distribution.
Kevin Day [Fri, 29 Mar 2024 21:44:04 +0000 (16:44 -0500)]
Cleanup: Incorrect example in IKI specification.
The example in the iki.txt specification has several errors.
Of particular note is the first code is incorrectly escaped and the terminating single quote discludes the example block.
The Objects and Contents example results is entirely incorrect.
There is no change to the specification rules itself and I do not technically need to change the version.
However, given how long it has been incorrect I have decided to up the version date to make the correct file easier to identify.
Kevin Day [Fri, 29 Mar 2024 03:50:21 +0000 (22:50 -0500)]
Bugfix: Problematic handling of object files.
The object files are not being compiled correctly when performing a static build.
There may now be multiple object sources files which are now built individually.
The build object sources must be built without source code files.
The logic is relocated into a fake_build_library_static_object() function to build the object files.
These files are then included when static linking.
A new build stage is also added to accommodate this.
Building the objects should not include libraries linked.
Remove the logic that auto-adds the library linkage when building objects.
Break out the "path_sources" Object into multiple sub-parts:
- "path_sources_headers".
- "path_sources_library".
- "path_sources_object".
- "path_sources_program".
- "path_sources_script".
Update the documentation and specification files accordingly.
Add missing version dates to the specifications.
Update the bootstrap.sh script with these changes.
Fix incidental problems discovered in the bootstrap.sh script:
- Remove already compiled warning as it is not needed and is not exhaustive.
- Improve handling of directory detection and simplify the relating code.
- The built setting files are now being properly checked (a regression caused them to not be properly checked).
The "path_sources_object" setting designates that this can handle multiple files but the implementation fails to handle this.
Rewrite the implementation to handle multiple object files by creating each object file separately.
The specification also designates that the "build_name" is used, which makes no sense for multiple object files.
Remove this such that the object files are created based on the original source file name (without the extension).
Clarify the documentation, updating the specification.
Break out the individual settings that are related that should be updated for consistency.
These are path_sources_headers, path_sources_library, path_sources_program, and path_sources_script.
Kevin Day [Sat, 16 Mar 2024 04:10:49 +0000 (23:10 -0500)]
Progress: Controller program migration from 0.6 to 0.7.
This gets most things compiling.
This should not work.
The changes made are just to reduce the compilation errors and to get the code into a near good enough state to start really migrating.
I am going to rewrite this side-by-side to this code now that I have seen what I need to do.
I may likely use this as a starting point for porting this over into its own separate project.
That project has already been created but is pretty much empty.
This will be long and rather painful migration process but it will be worth it.
Kevin Day [Thu, 14 Mar 2024 03:26:28 +0000 (22:26 -0500)]
Progress: Controller program migration from 0.6 to 0.7.
There are way too many changes needed.
Start doing some initial structure updates and directly relating code.
Move a lot of the structures to common.h, temporarily.
This will eventually be moved out.
Kevin Day [Wed, 13 Mar 2024 02:09:36 +0000 (21:09 -0500)]
Update: FSS-000E specification, adding "salt" and "time" as suggested headers.
I intend to keep the recommended and now suggested headers to a bare minimum.
I have decided that "salt" and "time" should be common enough and important enough to add to this small list.
Kevin Day [Mon, 11 Mar 2024 00:00:41 +0000 (19:00 -0500)]
Update: Wrap up unit tests for fl_fss_payload_header_map() and fix observed problems.
The unit tests for fl_fss_payload_header_map() are lacking significant combinations and permutations.
This, however, is being considered good enough for a first pass.
More complex and broader cases will hopefully be handled in some likely relatively distant future.
The null_quantity flag does not make any sense as the variable "total" can be 0 and that should not logically be considered NULL.
Make sure strings are NULL terminated for the cases where the code adds an extra space and then unassigned the used length of that space.
Handle cases where range.start > range.stop, aka NULL range.
Various other fixes.
Kevin Day [Sat, 9 Mar 2024 06:47:12 +0000 (00:47 -0600)]
Progress: Add more unit tests for fl_fss_payload_header_map() and fix observed problems.
There needs to be f_abstruse_t and f_abstruse_map_t delete and destroy methods.
Update the builld disable headers (which shows that I haven't updated that in a while).
The private_f_abstruses_delete_switch() is not correctly deallocating data.
The f_fss_payload_header_state_t and f_fss_payload_header_internal_t should instead be fl_fss_payload_header_state_t and fl_fss_payload_header_internal_t.
Kevin Day [Wed, 6 Mar 2024 03:57:35 +0000 (21:57 -0600)]
Progress: Add dynamic, dynamics, and map unit tests for fl_fss_payload_header_map() and fix several problems.
Switch character width loops with memcpy().
Add cases where trailing string should be removed.
Make sure private_fl_fss_basic_write() is only called when the cache is not empty.
Make sue the internal.range is properly set when calling private_fl_fss_basic_write().
Ensure that when any quote is used that they get quoted where appropriate.
Ensure that when key has used of 0, the start range is greater than the stop range to designate a NULL range.
Add dynamic, dynamics, and map unit tests.
Make the tests test the string first rather than the used so that when there is an error it is easier to debug.
Remove unused/stale commented out code.
Switch fss_write flag from 16-bit into 32-bit.
This is necessary because more bits than 16 are in use.
Kevin Day [Sun, 3 Mar 2024 05:13:02 +0000 (23:13 -0600)]
Bugfix: FSS Extended Write is incorrectly adding a delimit slash for the first quote character.
If the first character in the string is a quote, then a delimit slash only needs to be added when there is a space after the quote.
If there is a graph character after the quote, then the delimit slash is not needed.
Kevin Day [Sun, 3 Mar 2024 01:31:50 +0000 (19:31 -0600)]
Progress: Further simplify tests, merging the number and the string helper tests.
The number helper can also be used as-is for the string helper and so rename the file and functions to a "payload" helper.
I originally had "at" in the file names because I was passing an index.
That index parameter got removed but I forgot to remove the "at" from the name of the functions.
The "at" is now removed.
I began adding the strings tests but I ran out of time to do further work on them.
Kevin Day [Fri, 1 Mar 2024 05:01:24 +0000 (23:01 -0600)]
Bugfix: If the first character has a width greater than one then F_utf_fragment is incorrectly returned when using quotes.
A F_utf_fragment is incorrectly when writing a string that would use quotes and that first character has a width greater than one.
The code is incrementing the string by 1.
This should instead be incrementing by the character width.
The loop itself should increment by the character width as well.
Kevin Day [Fri, 1 Mar 2024 03:00:38 +0000 (21:00 -0600)]
Cleanup: Rename existing fl_fss abstruse tests to use "join" and "split" rather than "combined".
I forgot all about the function and files ending in "combined".
I am about to start writing tests for the "join" flag and noticed this discrepancy.
Rename everything to prevent any confusion.
Kevin Day [Wed, 28 Feb 2024 02:25:36 +0000 (20:25 -0600)]
Cleanup: The OSLv1 license, fixing grammar and clarifying intent.
This does not change the license other than fixing grammar and making the intent more consistent and clear.
This also adds a day to the license data that represents that last time this license has been modified.
The version number is changed only when there is a functional or substantial change to the license.
I have noticed that in some places individuals decide the "includes" is a restrictive word.
It is not, especially given that it is literally an inclusive word.
This changes the wording from "includes" or "including" to something like "including but not limited to" avoid any of that non-sense.
The proper application of the English language would result in the "but not limited to" being redundant and pointless.
This specific language is added just in case somebody does not understand the English language when it comes to the word "including".
Try to be consistent and use "lawful" instead of "legal" (except in cases where both are mentioned).
Generally, referring to "lawful" here also includes "legal".
The "lawful" is chosen to represent actual law rather than the more questionable "legal" terminology.
The wording of "access to use, implement, etc.." can be misinterpreted such that the "access to" is applied to implement (and etc..) such that it becomes "access to implement".
The actual intent and design is not simply around "access to implement".
Instead, it is around "to implement", period.
Clarify this by splitting out "access to use" into "to access", "to use", etc...
Kevin Day [Wed, 28 Feb 2024 02:11:56 +0000 (20:11 -0600)]
Refactor: The map "name" into "key".
I find myself constantly typing "key" rather than "name".
I like the idea of using "name" as it is the "name" of the "key".
However, I have decided to refactor this from "name" into "key" given my natural tendency to type "key" when thinking about a map.
Kevin Day [Tue, 27 Feb 2024 04:45:17 +0000 (22:45 -0600)]
Progress: Begin next development pass on fl_fss_payload_header_map().
Preserve the error status when exiting by checking and returning at the end of the function (before setting F_okay).
Fix the logic regarding the number macros when it comes to expanding an array of numbers into multiple destinations.
The object key must be set.
The macro needs to be accepting the destinations array rather than the specific destination string.
The case where f_fss_payload_header_map_flag_join_digits_e is set is not yet tested or reviewed.
In the 0.6, this problem happens only on printing.
In this branch, the 0.7 development branch, this is used in different parts of the code and may have unintended functional consequences.
Oddly, this problem is not observed for the same files that the problem can be seen when using the 0.6 branch built programs.
I have opted to fix the problem rather than to investigate further.
The logic is clearly flawed and the fix is identical from the 0.6 branch.
Kevin Day [Sun, 25 Feb 2024 16:29:52 +0000 (10:29 -0600)]
Update: Disable -fstrict-flex-arrays=3 flag because it doesn't work on GCC 11.
I just did tests on GCC 11, which is not too old.
The -fstrict-flex-arrays flag does not work there.
For now, just disable the flag by setting it to the non-existent gcc_13 mode.
The mode can be added to the mode list and enabled if so desired.
I may make version specific modes available in the future (or not) but that will require some planning.
The fakefile should be designed to test the GCC version, but I would rather avoid such logic by design.
Let the distributor or the system administrator handle such decisions.
Kevin Day [Sat, 24 Feb 2024 23:42:26 +0000 (17:42 -0600)]
Update: Make the Open Standard License 1.0 formal.
I don't see any opportunities to get this reviewed and finalized and so I am formalizing it as-is.
I can always improve it if the opportunity arrives and increment the version number.
There are no changes to the license other than remove the "informal" and "draft" parts.
Kevin Day [Sat, 24 Feb 2024 21:10:34 +0000 (15:10 -0600)]
Feature: Add -a/--analyze to test.sh script.
Adding the -a/--analyze parameter to the test.sh script should allow for easier testing with the analyze option.
The idea here is to make it easier to perform these checks and to improve the quality of the releases.
Kevin Day [Wed, 21 Feb 2024 02:02:38 +0000 (20:02 -0600)]
Update: Add the ability to explicitly skip a program.
The controller program is not yet migrated to compile under 0.7.x.
This adds the ability to the bootstrap example script to allow for simply skipping packages.
Kevin Day [Wed, 21 Feb 2024 02:00:10 +0000 (20:00 -0600)]
Bugfix: Remove unused files from build settings that break the build.
For some reason going through the bootstrap example script reveals this problem but directly using the packaging system does not.
This likely means that there is a difference between the system fake program and the one used during the bootstrap example script process.
Kevin Day [Tue, 20 Feb 2024 23:48:03 +0000 (17:48 -0600)]
Update: Get the Byte Dump stand alone build working.
Add missing f_compare dependency.
The f_compare dependency is ultimately not needed.
There are no f_compare functions used because the dependent projects' functions that use f_compare are disabled.
The design could be further improved by adding disable defines around specific headers the might be worth disabling when the dependent module is not needed.
Such a change is considered out of scope.
Kevin Day [Tue, 20 Feb 2024 23:45:59 +0000 (17:45 -0600)]
Bugfix: Disable defines used for private_f_memory_adjust() and private_f_memory_resize() are incomplete.
There are additional functions that call these private functions that require additional disable defines added.
The _f_memory_FORCE_secure_memory_ and _f_memory_FORCE_fast_memory_ should be paired with their appropriate _di_f_memory_resize_ and _di_f_memory_adjust_ disable macro.
Kevin Day [Tue, 20 Feb 2024 05:53:56 +0000 (23:53 -0600)]
Update: Add -Wno-missing-braces, remove unused threadless, fix test.sh parameter, and fix minor mistakes in programs.
Add the -Wno-missing-braces to all settings.
This warning is not exactly accurate and it is annoying.
Remove stale code around individual_threadless from package.sh.
The test.sh has a parameter to test_operate_build_project() that is missing.
The lack of this is causing the test_thread_individual variable from not being received.
Several of the programs have some mistakes that come to light only when using -Wall.
- Remove unused variables.
- Should be using "void_main" rather than "main" in specific situations.
- Add missing return statement.
- Add missing f_abstruse dependency in fss_read.
Kevin Day [Tue, 20 Feb 2024 04:39:13 +0000 (22:39 -0600)]
Update: Get clang working by separating out gcc specific settings, such as -fstrict-flex-arrays=3, and related changes.
The "-fstrict-flex-arrays=3" flag is not supported by clang.
Create a new mode call "gcc", make that the default, and move the "-fstrict-flex-arrays=3" into the gcc-specific setting.
Update the unit tests and mocks with these changes.
Make the unit tests and mocks more consistent by having these same settings.
Add a missing period at the end of the clang specific mode documentation comment.
The example bootstrap script handling of threads is improved.
Kevin Day [Sat, 17 Feb 2024 22:10:28 +0000 (16:10 -0600)]
Update: Finish refactoring firewall from 0.6.x to 0.7.x/0.8.x.
I have tested this out and compared the show results between the 0.6.x version and the 0.7.x version to confirm consistent results.
From this point forward problems are to be up for consideration as possible regressions.
Separate out more of the functions into separate files.
I reviewed the header includes and removed the headers that do not have apparent direct use.
Kevin Day [Fri, 16 Feb 2024 05:56:20 +0000 (23:56 -0600)]
Progress: Continue refactoring firewall from 0.6.x to 0.7.x/0.8.x.
This gets the programming compiling.
There still remains some code to change.
The runtime needs to be tested.
I expect that there are things wrong given how much I jumped around while migrating this.
Kevin Day [Thu, 15 Feb 2024 04:28:10 +0000 (22:28 -0600)]
Cleanup: Switch from _ui_ format string to _un_ format string to match the print format arguments.
The _un_ format string is provided to directly match '%un' which is intended to directly match f_number_unsigned_t.
This is intended to make things easier (and safer) to hack.
That is, changing the data size of f_number_unsigned_t.
The _ul_ format string is specifically intended to be an unsigned long, period.
Kevin Day [Thu, 15 Feb 2024 04:25:53 +0000 (22:25 -0600)]
Progress: Continue refactoring firewall from 0.6.x to 0.7.x/0.8.x.
This is very close to be ready for review and testing.
I converted most of the buffers into the new structure but I need to check for isolation.
I am pretty sure that there are currently some isolation problems with the FSS Object and Content ranges.
I also noticed some typos and such that will need to be fixed (this therefore probably does not compile just yet).
Kevin Day [Sun, 11 Feb 2024 04:14:23 +0000 (22:14 -0600)]
Progress: Refactoring firewall from 0.6.x to 0.7.x/0.8.x and other FLL project wide changes.
Add the f_console_parameter_state_type_total_d and update all programs.
Add (and use) additional f_string_format strings.
Add fll_program_print_help_operations().
Add fll_program_print_help_special_options().
Begin using more helper flags for common behavior, such as "main_flag_version_copyright_help" type of flags.
Add missing documentation comments for some functions.
Remove duplicate "#ifdef __cplusplus" blocks in several programs.
Begin to refactoring firewall to follow the 0.7.x and eventually 0.8.x project design.
The firewall program is far from ready and will not yet compile.
Kevin Day [Fri, 9 Feb 2024 05:10:34 +0000 (23:10 -0600)]
Update: Use typedef on a structure tag to avoid the need for void pointer on the callback for f_state_t.
Using a typedef on the structure tag allows for having the structure reference itself.
In this case, the callback that is part of the structure accepts its own structure as one of the callback parameters.
I previously did not know that I could do this and opted to use a void pointer to provide this.
With this approach I get more safety, integrity, and less memory usage (for not having to add a variable that is a cast of the void pointer to the f_state_t).
Kevin Day [Fri, 9 Feb 2024 04:34:55 +0000 (22:34 -0600)]
Feature: Add _f_memory_USE_reallocarray_ and _f_memory_NO_zeroing_on_larger_ macros.
The _f_memory_USE_reallocarray_ designates to use reallocarray() rather than realloc() in the f_memory project.
The _f_memory_NO_zeroing_on_larger_ designates to not perform the memset() to 0 for malloc() or realloc() calls where the new size is larger than the old size.
The programs provided by this project might expect the memory to be zeroed.
Please use _f_memory_NO_zeroing_on_larger_ carefully.
Kevin Day [Fri, 9 Feb 2024 03:55:08 +0000 (21:55 -0600)]
Update: Add restrict optimization to f_memory functions.
The design of the memory operations require that array, used, and size do not point to the same memory address.
Help prevent potential aliasing by adding restrict keyword.
The functions with only a single pointer in its parameters still has the restrict keyword added.
I opted to avoid adding the restrict keyword to some of the append and append all functions.
Those would require more attention before I am certain whether or not they should be allowed to have overlapping addresses.
I think they should not, but just in case, I put doing that on hold.
The callback could also use restrict but I have decided not to do that as well due to the number of files that I will need to change.
I will do this later.
Kevin Day [Fri, 9 Feb 2024 03:24:54 +0000 (21:24 -0600)]
Progress: Begin adding unit tests for fl_fss_payload_header_map().
I added the single digit unit tests for signed and unsigned.
I started to add uint8_t with the test files but then I realized that I actually should implement uint8s_t.
I am leaving those test files currently but I will change them at a later date.
This adds a helper file for the payload header map private functions to simplify some of the code.
Kevin Day [Sun, 4 Feb 2024 23:34:53 +0000 (17:34 -0600)]
Progress: Wrap up initial pass of fl_fss_payload_header_map().
Everything for the fl_fss_payload_header_map() function is written.
I can guarantee that there is some logic error or mistake somewhere due to the codestorming practice that I did with this (in addition to doing it across multiple weeks).
I experimented with different approaches in the different private functions.
I will eventually follow up this with a clean up pass that add functions to reduce the redundant code and also standardize the logic implementations where reasonable.
My next task in regards to this function will be to write unit tests.
This will find the problems and I will use the unit tests to kick off the rewrite of the private functions.
Kevin Day [Sat, 3 Feb 2024 23:45:31 +0000 (17:45 -0600)]
Refactor: The f_string_quantity_t into f_quantity_t.
This makes the f_string_quantity_t consistent similar to how f_string_range_t was refactored into f_range_t.
This is done because there is no actual string value in f_string_quantity_t.
There are only numeric values.
Kevin Day [Sat, 3 Feb 2024 23:43:53 +0000 (17:43 -0600)]
Bugfix: Runtime tests have incorrect space for "not a comment" line tests.
I overlooked a bug when I generated these files.
Now that the bug has recently been fixed, the unit tests are failing as they should.
Fix the incorrect tests so that they pass and fail correctly by fixing the "expect" relevant files.
Kevin Day [Fri, 2 Feb 2024 04:26:16 +0000 (22:26 -0600)]
Progress: Continue working on fl_fss_payload_header_map().
Mostly focus on private_fl_payload_header_map_maps().
There is a lot of similar code design with subtle but key differences.
This is going to be really easy to make an mistake with.
Writing unit tests is going to be the ideal way to ensure the logic here is correct.
I did a lot of back and forth jumping around while trying to remember where I was last and what I need to do.
Make the build settings files more consistent in regards to threads and coverage modes.
Kevin Day [Thu, 1 Feb 2024 05:29:57 +0000 (23:29 -0600)]
Update: Add hopefully more secure compiler flags by default.
Use the "-Wl" for specifying the linker flags.
- Make sure "now", "relro", and "nodlopen" are set.
Add FORTIFY_SOURCE set to 3.
Add stack-clash-protection and strict-flex-arrays set to 3.
This project is designed around NULL checks.
- Make sure the no-delete-null-pointer-checks flag is set to prevent the compiler from removing these security/integrity checks.
Use stack-protector-strong rather than stack-protector for test flags.
- Future versions may enable stack-protector-strong by default for regular compiling.
Kevin Day [Wed, 31 Jan 2024 05:39:26 +0000 (23:39 -0600)]
Bugfix: FSS Basic List and FSS Extended List print comment at the start of the Content.
When the Content exists at the start of the Content, the comment character ('#') is printed when it should not be printed.
This is a bug where the code initializes the newline_last at the range.start.
The code logic then always expects the newline_last to represent an actual new line.
This is not necessarily the case for when newline_last is pointing to the initial range.start position.
Add a check when processing a comment to ensure that the newline_last is in fact a new line.