Kevin Day [Mon, 1 Dec 2025 01:37:23 +0000 (19:37 -0600)]
Update: Avoid the use of bool, keeping it to a bare minimum.
Use `uint8_t` to both enforce a specific byte size as well as provide the ability for it to be converted into a set of bits if need be, without breaking API or ABI.
Kevin Day [Sun, 30 Nov 2025 21:56:48 +0000 (15:56 -0600)]
Update: Make *_t_clear() functionality consistent and fix existing problems.
These were being removed at one point in time, resulting in an inconsistent declaration of these macros.
The memory clear macros were also removed, but some of the uses still (incorrectly) remained.
Ensure that these `*_t_clear()` macros are encased in a brace defined block.
Do not use semi-colons at the end of the `*_t_clear()` uses.
Do use semi-colons at the end of `*_t_clear()` direct property assignments.
Kevin Day [Sun, 30 Nov 2025 05:26:10 +0000 (23:26 -0600)]
Refactor: Relocate the order of the size and used properties for f_string_static_t and f_string_dynamic_t.
This will be performed on all types, but I started with `f_string_static_t` and `f_string_dynamic_t` given how much they are being used.
This is done to help reduce potential security problems relating to allocation and buffer overflows.
This is not expected to stop attacks or intentional mis-uses.
This is instead expected to help reduce the attack surface area by reducing the possible harm from coding or runtime mistakes.
The basic structure is:
```pseudocode
my_type {
array
used
size
}
```
If an array overflow write occurs, it is mostly likely to write in the `used` structure rather than the `size` (unless the compiler does something different).
This can cause the `used` to become corrupted rather than the `size`.
This essentially makes `used` act as a buffer to the `size` property.
While this is still a bad state, the memory allocation might still get preserved and allow for proper de-allocation without memory leaks.
Stack protection and similar security practices helps make larger overflow writes more likely to get caught and therefore more likely to be stopped before the `size` gets corrupted.
This, of course, does not protect against intentional mis-uses and abuses.
I was holding this off for some time due to the sheer size of the required changes.
However, once a code freeze happens, then I cannot make these API and ABI breaking changes.
Therefore, now is the time for me to make these changes.
Also begin using the `{ .property = value }` notation.
Kevin Day [Thu, 27 Nov 2025 14:26:15 +0000 (08:26 -0600)]
Update: Use F_file_descriptor_not instead of F_file_descriptor for invalid file descriptors.
The "_not" suffixes were added later in in the project after some of these status codes were established.
This begins the process of using the "_not" suffixes for representing invalid states, variables, etc...
The `F_file_descriptor` should instead be `F_file_descriptor_not` for invalid file descriptor errors.
Kevin Day [Wed, 26 Nov 2025 06:51:54 +0000 (00:51 -0600)]
Update: Make some socket error codes more granular and add additional status codes.
Some of the socket status codes should be more granular given the specific behavior relating to networking.
Add error printing associated with this.
I anticipate more changes like this based around networking.
Kevin Day [Sun, 23 Nov 2025 03:51:51 +0000 (21:51 -0600)]
Bugfix: The fss_write is missing the recently added debug mode.
This causes the build system to fail to compile when using the default build modes.
My standard build process did not catch this because I was using explicitly specified build modes.
Kevin Day [Wed, 12 Nov 2025 04:33:02 +0000 (22:33 -0600)]
Update: Utilize the F_status_debug_source_d for handling the errors.
This simplifies some of the logic and code.
However, there are some disadvantages of doing this.
One such disadvantage is losing the specific function that has failed.
The location in the source file should be sufficient, if not ideal.
Address issues where the `debug` mode is not being specified in some programs.
Kevin Day [Tue, 11 Nov 2025 03:18:05 +0000 (21:18 -0600)]
Update: Utilize the debug mode, changing the error printing functions.
The `function` parameter is now replaced with `debug`.
There are several changes to the error printing functions to accommodate this.
A new function `fll_error_print_debug()` is added for handling the printing of this debug parameter.
Update the programs to ensure that they compile with these changes.
A follow up commit is required to fully and properly utilize this debug parameter.
The Featureless Make had to be updated further to get it to compile.
This fixes incorrect documentation that I observed.
The debug and function conversions are only enough to get things to compile.
This will still need a follow up commit to properly change everything.
Kevin Day [Sun, 9 Nov 2025 04:25:10 +0000 (22:25 -0600)]
Feature: Support generating debug souce and line as well as debug mode.
Prrovide a new build mode called `debug`.
Apply it consistently across all build settings files.
Update the build settings file to be more consistent in regards to modes and related comments.
Provide new debug option called `F_status_debug_source_d`.
This provides a way to get the current source file, line, and possibly function.
This should help with debugging.
This was first implemented in the controller program and I liked it enough to bring it in here.
The error printing functions are currently not updated.
I will have to decide if I want to get rid of the old way of using the hard-coded and mapped function names.
The `_en_status_debug_` allows for enabling the debug printing (passing `-D_en_status_debug_` to a compiler).
The `_di_f_status_debug_d_` is also available for providing the standard define wrapper.
Kevin Day [Sun, 2 Nov 2025 22:03:15 +0000 (16:03 -0600)]
Update: Provide more granular error status codes in the thread full functions.
The LIBC pthread implementations fail to provide a way to truly verify that thread data is properly allocated or not.
The full thread types have two different thread related memory freeing functions.
If the first function fails, then the second structure is still allocated.
The previous behavior provided no way to distinguish between the two different failures.
These more granular status codes allow for such distinction now.
This allows the caller to manually try to de-allocate other parts even if the first de-allocation failed.
Note: the `f_schedule_attribute_get()` and `f_schedule_attribute_set()` have to use `syscall()` directly due to design problems with glibc.
The `struct sched_attr` is also an incomplete/broken type in glibc.
I have declared my own type based on the kernel structure.
It is unclear on how well this will work in practice.
I am also uncertain of the best way to mock a variadic function like `syscall()`.
The mocks for these are therefore incomplete.
Kevin Day [Wed, 27 Aug 2025 02:32:43 +0000 (21:32 -0500)]
Update: Add specific source design documentation.
I have described this in one manner or another since the start of the FLL project.
This explicitly states the behavior that the FLL project (and related projects) have always followed.
Kevin Day [Thu, 21 Aug 2025 02:20:24 +0000 (21:20 -0500)]
Update: The FLL tags file with the latest code.
Geany does a pretty poor job of building the tag files.
The way I managed to get this to work is to:
1. Generate the monolithic package.
2. Perform `fake clean make` on that package.
3. Create a new project that points to the package, such as: `/path/to/fll-0.7.3/build/includes`.
4. Set `file_patterns` to `*.h`.
5. Set `source_patterns` to `*.c`.
6. Set `header_patterns` to `*.h`.
7. Set `ignored_dirs_patterns` to `*;test/*`.
8. Set `ignored_file_patterns` to `*.o;*.obj;*.a;*.lib;*.so;*.dll;*.lo;*.la;*.class;*.jar;*.pyc;*.mo;*.gmo`.
9. Select the `project->generate tags` option.
10. Rename the generate tags file to end in `.c.tags`.
11. Edit that file to replace `_TAG_PROC_CWD` value with something like `/usr/local/fll/includes/` (or `/usr/include/fll` for standard UNIX FHS systems).
The `ignored_file_patterns` has a lot of defaults that geany provided that I probably do not need.
The generated tags file is unusable because geany generates it without the `.c.tags` in the name and geany requires the `.c.tags` in the name to read (which is just plain stupid).
Kevin Day [Wed, 20 Aug 2025 03:46:29 +0000 (22:46 -0500)]
Update: Adding missing thread functions and types; restructure files.
It has become clear to me that I didn't actual complete the thread types.
This adds the array of array types that are missing.
The `thread.c` and `thread.h` files are huge.
Break apart the functions based on existing `thread/*` files.
Doing this requires being more particular about the ordering of the header includes.
Update and add appropriate unit tests.
Much of this is done via mass replacements.
There very likely are some unimportant oversights.
Kevin Day [Mon, 18 Aug 2025 04:20:26 +0000 (23:20 -0500)]
Update: Settings with latest code changes and address problems.
Fix issue where `_di_f_utf_string_seek_line_back` is missing the final `_`.
Fix issue with the `_di_f_idss_destroy_callback_` being missing.
Fix issue with the `_di_f_idss_*_callback_` having a messed up structure.
Add missing defines to stand alone build settings.
- Add explicit `#define _di_fll_error_s_a_` and `#define _di_fll_error_s_e_` to stand alone build settings.
- Add missing `#define _di_f_void_pointer_call_t_` to stand alone build settings.
- Add missing `#define _di_f_thread_name_get_` and `#define _di_f_thread_name_set_` to stand alone build settings.
Add the settings for the recently added thread "full" types and their related functions.
Kevin Day [Sat, 16 Aug 2025 05:18:09 +0000 (00:18 -0500)]
Update: Provide "full" thread types and corrects other problems encountered.
There are new types like `f_thread_barrier_full_t` created that provide a structure of both the lock and its associated attribute variable.
For whatever reason the pthread design requires the attributes to be allocated.
This makes changing settings more complex.
These "full" types are provided to help reduce the burden of managing this mess.
I noticed a lot of random inconsistencies and other minor mistakes that I decided to simply address while working on this.
There are more things that could be done but I decided to limit myself to what is done here.
Of particular note are the attribute functions.
Several of the attribute functions were checking for error codes that do not exist as per the standard.
The attribute functions simply return fewer possible error codes that the locks.
I more than likely mass copied the locks into attributes and never corrects the dependencies.
Several of the tests were also testing these invalid status codes.
Kevin Day [Sun, 10 Aug 2025 23:44:02 +0000 (18:44 -0500)]
Cleanup: Several old status code locations (first pass).
The status code used to be broken up into separate groups, wrapped by conditional macros.
The conditional macros were removed but I had left the remaining work to be done later.
Now is later.
Kevin Day [Sat, 2 Aug 2025 23:07:08 +0000 (18:07 -0500)]
Update: The FLL tags file with the latest code.
Geany does a pretty poor job of building the tag files.
The way I managed to get this to work is to:
1. Generate the monolithic package.
2. Perform `fake clean make` on that package.
3. Create a new project that points to the package, such as: `/path/to/fll-0.7.3/build/includes`.
4. Set `file_patterns` to `*.h`.
5. Set `source_patterns` to `*.c`.
6. Set `header_patterns` to `*.h`.
7. Set `ignored_dirs_patterns` to `*;test/*`.
8. Set `ignored_file_patterns` to `*.o;*.obj;*.a;*.lib;*.so;*.dll;*.lo;*.la;*.class;*.jar;*.pyc;*.mo;*.gmo`.
9. Select the `project->generate tags` option.
10. Rename the generate tags file to end in `.c.tags`.
11. Edit that file to replace `_TAG_PROC_CWD` value with something like `/usr/local/fll/includes/` (or `/usr/include/fll` for standard UNIX FHS systems).
The `ignored_file_patterns` has a lot of defaults that geany provided that I probably do not need.
The generated tags file is unusable because geany generates it without the `.c.tags` in the name and geany requires the `.c.tags` in the name to read (which is just plain stupid).
Kevin Day [Sat, 2 Aug 2025 03:40:19 +0000 (22:40 -0500)]
Feature: Add f_thread_name_set() and f_thread_name_get().
These provide support for `pthread_setname_np()` and `pthread_getname_np(0)` respectively.
These pthread functions are not portable so provide the following variables to gracefully disable the calls:
- `_pthread_setname_np_unsupported_`
- `_pthread_getname_np_unsupported_`
The newly added functions return `F_implement_not` when these unsupported defines are set.
This allows for programs that call these to not really care if the thread naming support is present.
They can call the function and if it works, then it works and if it doesn't work, then it doesn't work.
Kevin Day [Sun, 6 Jul 2025 20:59:54 +0000 (15:59 -0500)]
Update: Next micro version (0.7.3).
The following are the commands that I ran to make this change:
# find build/ level_? specifications/ documents/ licenses/ -type f -exec sed -i -e 's|0\.7\.2|0.7.3|g' -e 's|^version_micro 2|version_micro 3|g' '{}' ';'
# find level_3/ -name *.h -exec sed -i -e 's|_program_version_micro_s F_string_ascii_2_s|_program_version_micro_s F_string_ascii_3_s|g' -e 's|_program_version_micro_s_length F_string_ascii_2_s_length|_program_version_micro_s_length F_string_ascii_3_s_length|g' '{}' ';'
# sed -i -e 's|version_micro 2|version_micro 3|g' build/*/settings build/stand_alone/*.settings level_*/*/data/build/*settings*
The `<<< ${p}` was placed in the wrong location.
This happened due to a very simple regex that I used to mass make the changes.
I overlooked this complicated match pattern.
Kevin Day [Sat, 28 Jun 2025 03:35:45 +0000 (22:35 -0500)]
Cleanup: Apply new script practices.
Be more consistent about wrapping all variables in brackets.
This helps make the code more consistent and also more compatible with other interpreters like ZSH.
Don't use echo pipe syntax and instead use "<<<" redirection pipe syntax for passing variables to program calls.
The grep commands should use either `-sho` or `-shoP`.
Kevin Day [Tue, 17 Jun 2025 01:43:25 +0000 (20:43 -0500)]
Bugfix: Console stop is not appending to remaining array.
Make sure `stop` variable is set to TRUE.
Add new types to differentiate between when "stop" has been reached and when "stop" has not been reached.
For example, the `f_console_parameter_state_type_wrap_up_stop_e` designates that the "stop" is reached and is performing wrap up.
When the type is `f_console_parameter_state_type_wrap_up_e`, then the wrap up is happening with the "stop" being reached.
The wrap up is now appending to the remaining array.
Kevin Day [Sun, 15 Jun 2025 00:03:50 +0000 (19:03 -0500)]
Feature: Support F_recurse_not to skip recursing directory for fl_directory_do().
The `fl_directory_do()` should support skipping directory recursion itself.
Add `F_recurse_not` checks before recursion.
The `F_recurse_not` does not prevent the action on the directory itself.
Kevin Day [Thu, 12 Jun 2025 02:13:26 +0000 (21:13 -0500)]
Update: Improve status handling of fl_directory_do().
Add `F_skip` support to allow skipping the next action for some path.
Honor the `F_break`, `F_continue`, `F_done`, and the `F_interrupt` more consistently.
Make sure to consistently clean up the directory stream when these are set.
Kevin Day [Sun, 8 Jun 2025 01:42:17 +0000 (20:42 -0500)]
Cleanup: The script styling practices.
Over time my scripting style practices have changed.
Up date these older scripts.
The variables should always have braces (makes compatibilty with other shells like ZSH easier).
Add additional lines in certain places.
Make comments proper sentences by making first letter upper case.
Kevin Day [Fri, 6 Jun 2025 02:35:34 +0000 (21:35 -0500)]
Security: Explicitly define IFS to prevent misuse.
The scripts are written with certain expectations.
This expectation may not be properly met if the `IFS` value is changed.
This can potentially be used to create some sort of exploit.
Explicitly define IFS and then do so at a local variable scope to prevent affecting the callers IFS setting.`
Kevin Day [Tue, 3 Jun 2025 03:49:25 +0000 (22:49 -0500)]
Bugfix: Directory recursion is losing the error state.
The stream is being closed at the end of the directory recursion regardless of the error state.
This ends up overwriting the status code.
Preserve the status code before closing the stream.
Process the stream close.
Then restore the original status if the original status has an error or if the stream close worked.
Kevin Day [Thu, 15 May 2025 01:52:51 +0000 (20:52 -0500)]
Bugfix: Incorrect processing order with --at, --select, and --total for FSS Read programs.
The parameters are processed in the wrong order when the `--total` is added to parameters with both `--at` and `--selet` specified at the same time.
The problem is with the correct at position needs to be properly checked and incremented.
In one case the `at` is already being used so I renamed that to `content` to help improve context readability as well as to allow me to use `at` to reference the `--at` parameter position association.
Add runtime unit tests to catch this problem.
I mostly focused on added the "order" tests.
I only manually checked the specific cases of `--at`, `--select`, and `--total`.
All others I just ignored and hope are correct.
Kevin Day [Fri, 9 May 2025 00:54:09 +0000 (19:54 -0500)]
Update: Organize error status handling and address return codes.
Improve some of the status handling that I noticed.
Several functions are return code 0 even on status errors.
Only when the execute is performed does the return code get set to something else.
Make sure this behavior is consistent.
There `fake_execute()` does not need to have the error message printed after calling.
That function already prints the error messages as needed.
Kevin Day [Thu, 8 May 2025 23:46:36 +0000 (18:46 -0500)]
Bugfix: Featueless Make array cache is being reset incorrectly in some cases.
The functions `fake_build_library_static_object()` and `fake_build_object()` are appending compiler arguments to the arguments cache.
Before this cache gets used, a for loop resets the cache and starts appending to the cache.
The initial data loaded into the cache gets lost without ever being used.
Kevin Day [Thu, 8 May 2025 04:28:59 +0000 (23:28 -0500)]
Workaround: The compiler and linker fail to understand that compiling statically should also link statically.
This is a logic or design flaw that is just plain idiotic.
When compiling statically (passing `-static`), there cannot be any shared/dynamic linked data.
Rather than recognizing this, if there is a shared library during a static build then the shared library is linked to.
The compiler and linker, at least, supports explicitly forcing the point that a static library is to be linked.
This is done via `-l:libc.a` for libc linking rather than `-lc`.
This should not be necessary, but it unfortunately is.
Kevin Day [Thu, 1 May 2025 01:37:06 +0000 (20:37 -0500)]
Update: Next micro version (0.7.2).
The following are the commands that I ran to make this change:
# find build/ level_? specifications/ documents/ licenses/ -type f -exec sed -i -e 's|0\.7\.1|0.7.2|g' '{}' ';'
# find build/ level_? specifications/ documents/ licenses/ -type f -exec sed -i -e 's|^version_micro 1|version_micro 2|g' '{}' ';'
# find level_3/ -name *.h -exec sed -i -e 's|_program_version_micro_s F_string_ascii_1_s|_program_version_micro_s F_string_ascii_2_s|g' '{}' ';'
# find level_3/ -name *.h -exec sed -i -e 's|_program_version_micro_s_length F_string_ascii_1_s_length|_program_version_micro_s_length F_string_ascii_2_s_length|g' '{}' ';'
# sed -i -e 's|version_micro 1|version_micro 2|g' build/*/settings build/stand_alone/*.settings level_*/*/data/build/*settings*
Kevin Day [Tue, 29 Apr 2025 22:46:23 +0000 (17:46 -0500)]
Update: Set month year in man pages to April 2025.
I am finding it much easier to simply mass update everything to a single year rather than only update what is known to change.
These dates need to be updated based on the year and month of the release.