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.
Kevin Day [Mon, 28 Apr 2025 22:14:33 +0000 (17:14 -0500)]
Update: Improve example bootstrap script, exiting properly on error.
The `bootstrap-example.sh` has been used as a demonstratable example that can be used to build this project.
This script has become incredibly convenient but I had not made it as resilient as it could be.
This changes the script to properly exit with a non-zero return code on error.
This should allow for adding this script to a series of bash commands along with the conditional operators like `&&` and `||`.
Kevin Day [Sun, 27 Apr 2025 22:18:00 +0000 (17:18 -0500)]
Regression: Fix the preserve and offset calculation in Featureless Make.
This addresses the problems observed in commit 3befe37125e426d452a1b9b9a1fab97ab221c7f1.
I never got the time to investigate this before I made my end of day commit.
This now addresses the observed problems.
The offset application logic is accidentally reversed.
This is now corrected.
The new logic does not require the buffer because the directory is being created later on in the process.
Using the `f_string_append_nulless()` to easily copy the source path with the offset onto the destination path.
Update the documentation comments to better communicate this behavior.
Kevin Day [Sun, 27 Apr 2025 03:09:42 +0000 (22:09 -0500)]
Update: Featureless Make with regard to recent fl_directory_do() changes.
The changes to `fl_directory_do()` requires that the Featureless Make be updated.
I noticed that the `fake_build_copy()` has the `perserve_offset` parameter (also a typo in the name).
This was added in a hackish way in the past as sort of a quick and lazy solution.
Break this out into two parameters `preserve` and `offset` to allow for preserving the path with no offset at all.
I believe the current function structure is still not ideal but that is a problem for another time.
The `fake_do_copy_action()` callback for `fl_directory_do()` is now rewritten.
I distantly remember not being happy with the situation of the code and I would have needed to fix the `cache_map` to have a more logical use.
There were too many changes going on at the time and I did not want to deal with changing that as well.
Well, the problem of that approach finally caught up with me and I have fixed it now.
The `cache_map` now has the `key` as the source directory and the path as the `destination` directory.
I impulsively decided to use a `uint8_t` to designate the functions.
Then I wrapped the code in `F_status_is_error_not()` to allow for calling the error handling later on.
This has a downside of a rather ugly ternary blob.
Aside from the ternary blob, the rest of the code is rather simpler due to the avoidance of always handling the error and returning.
This is not well tested and I need to review the changes made as it should affect how the Featureless Make builds the tree structure.
The unit tests do seem to be failing to build.
I suspect there is some sort of problem in these changes that need to be further investigated.
Kevin Day [Mon, 21 Apr 2025 00:49:56 +0000 (19:49 -0500)]
Update: Use defines over enums in f_console, add stop behavior, and add alone behavior.
The enumerations take up more space in the binary.
Several of the enumerations are being used as flags instead of enumerations.
I was not certain how I should do handle this in the past but now I am certain that using defines for flags is the way to go.
The ability to trigger stopping of the processing of parameters and storing the remaining parameters in the remaining array for f_console is now added via a stop flag.
The "alone" behavior is not complete and is a good to have for the desired stop behavior.
Many classic programs us `--` to trigger the end of the parameters.
The "stop" and "alone" behaviors allow for `--` to be used in the same way as classic programs.
Add several directory functions.
I still may need to add more, such as a rewind to handle rewinddir().
Change the directory recurse do flags from an enumeration to defines.
Add a type fo handling `DIR *` called `f_directory_stream_t`.
Get rid of the directory listing structure to reduce memory usage.
This is only possible by replacing the `scandir()` with custom direct processing.
This change reduces the number of looping and removes the sorting behavior.
The directory recurse do flags are now redesigned.
The `top` is now entirely removed because a depth of 0 can be used to test for top without needing a flag.
The `opendir()` still has a notable cost, especially during recursion.
I need to do more research into how to more efficiently call `opendir()` without consuming too much memory.
The documentation comments still needs to be reviewed following these changes.
Make sure the directory functions only update the id values if there is no error.
Explicitly check for `-1` as return error rather than `< 0` to be more consistent with the standards.
Use typedefs to define callbacks.
Tweak the `fl_directory_list()` design.
Tweak the `fl_directory_path_pop()` design.