Kevin Day [Thu, 1 Aug 2024 02:33:32 +0000 (21:33 -0500)]
Bugfix: Add stage setting to standards to prevent build state file conflicts.
The build state stage files are conflicting in some cases.
The old solution to this problem has been observed as insufficient.
The different build settings might have the same exact file name.
I have tossed around the idea of a settings Object such as "stage" in the past but I had previously opted against it.
I now believe that skipping over this was a mistake.
Add a new feature to the standards to fix this bug.
The "stage" value may now be specified.
The fakefile files accept the "stage" setting and passes the result along to any build settings.
The settings files accept the "stage" setting and uses the value by appending it to the stage files.
Only a single value is supported.
The forward and backward slashes are explicitly prohibited.
Other special characters are recommended to be avoided given the possibility of local file system problems.
Rather than erroring out, this slashes are stripped out.
The bootstrap.sh script is updated to support this.
The support for "stage" in the boostrap.sh script is very limited.
Kevin Day [Wed, 31 Jul 2024 02:45:20 +0000 (21:45 -0500)]
Refactor: Change bit-wise enumerations into defines.
I did some reviewing of how the enumerations used for flags are used.
These generally are not being used as a type.
An enumeration slightly increases the resulting binary size.
Enumeration values might be limited to just type of int.
This seems like an easy (small) optimization to just use defines rather than enumerations for flags and other bit-wise numbers.
Kevin Day [Sun, 28 Jul 2024 22:18:07 +0000 (17:18 -0500)]
Update: The format sentence end strings, making their usage more clear.
The sentence ends, unlike the other similar global static strings, does not have the "_single" in the name.
Add the "_single" in the name and then for consistency addthe case where there should be no "_single".
These cases are as a result now handled:
- ".%r".
- "'.%r".
- "%[.%]%r"
- "%['.%]%r"
- "%[%[.%]%]%r"
- "%[%['.%]%]%r"
Kevin Day [Sun, 7 Jul 2024 03:05:54 +0000 (22:05 -0500)]
Bugfix: The f_memory array append and append all need to allow for sources to be NULL.
A valid array that is not allocated will have a size of 0.
Passing these to the function should not result in an error.
If the size is 0, then there is nothing to copy even though array is NULL
This is all fine.
Update the documentation comments to be more explicit on NULL in the parameters.
Kevin Day [Fri, 14 Jun 2024 02:52:11 +0000 (21:52 -0500)]
Security: Console parameter single short values array is too small.
The short parameters "needs" variable now increases the array size before assignment.
The following command line calls are used to expose the problem and its resolution:
# fss_basic_list_read specifications/fss.txt +Q -cn "Featureless Settings Specifications" | iki_read +Q -w -rrrrrrrr anti-KISS 'anti-<abbr title="Keep It Simple Stupid">KISS</abbr>' ASCII '<abbr title="American Standard Code for Information Interchange">ASCII</abbr>' BOM '<abbr title="Byte Order Mark">BOM</abbr>' FSS '<abbr title="Featureless Settings Specifications">FSS</abbr>' KISS '<abbr title="Keep It Simple Stupid">KISS</abbr>' UTF-8 '<abbr title="Unicode Transformation Format 8-bit">UTF-8</abbr>' URL '<abbr title="Byte Order Mark">URL</abbr>' XML '<abbr title="Extensible Markup Language">XML</abbr>' -WWW character '<code class="code">' "</code>" code '<code class="code">' '</code>' italic '<em class="em">' '</em>'
Kevin Day [Tue, 11 Jun 2024 00:12:18 +0000 (19:12 -0500)]
Bugfix: The fl_directory_create() needs to also handle F_file_found_not.
Creating an entire directory tree is not working as expected when creating non-existent directories that are two levels or greater deep.
For example take "a/b/c", if "a" exists but neither "a/b" nor "a/b/c" then the create fails.
For example take "a/b", if "a exists but not "a/b" then the create succeeds (or appears to because I never noticed the bug before).
The ENOENT (aka: F_file_found_not) is sometimes returned rather than ENOTDIR (aka: F_false) from f_directory_exists().
Process the ENOENT F_file_found_not.
I noticed some problems in the logic of the fl_directory_create() function as well.
The memcpy() needs to start from the same offset as the source copy offset.
Otherwise, the copy is overwriting the string.
Make sure to place the NULL at the "at_path" rather at "at_path - at_tree".
The initial assignment of "tree.used" is not necessary.
Kevin Day [Mon, 10 Jun 2024 00:00:24 +0000 (19:00 -0500)]
Update: Add all of the fl_print_format() replacement sequences as a static string.
I probably should create a single and double context for every sequence as well.
That is rather time consuming so I will do this some time in the future.
Kevin Day [Thu, 6 Jun 2024 01:11:37 +0000 (20:11 -0500)]
Feature: Add "Magic Bit" to the FSS-000F (Simple Packet) format.
Make the FSS-000F (Simple Packet) format more generalized and flexible by allowing other payload formats than only formally supporting FSS-000E (Payload).
This adds a new optional "Magic Block" that is designated via the "Magic Bit", which is the third bit from the left.
This should make it easy to store the Simple Packet as a local file.
This should make it easier for routing to optimize processing of the packet by quickly identifying the packet.
The "Control Block" and the "Size Block" have static sizes and positions, which should make it easy to identify the "Magic Block".
The third bit should be checked and then the "Magic Block" should be checked when trying to quickly identify the packet type via the "Magic Block".
Kevin Day [Sun, 2 Jun 2024 15:44:32 +0000 (10:44 -0500)]
Cleanup: Add newline before NULL comment and add dash to de-allocate.
The "Must not be NULL." documentation comments are not consistently structured.
I don't remember which decision I made and so now I am just forcibly setting the same structure with a new line before it.
Kevin Day [Thu, 23 May 2024 03:23:23 +0000 (22:23 -0500)]
Update: Remove the ++first and ++last parameters and relating logic.
I have used this for a while and have decided these are not worth the effort.
The addition is very nice but the additional code and logic is just extra maintenance and complexity for very little gain.
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.