]> Kevux Git Server - fll/log
fll
4 days agoBugfix: Directory recursion is losing the error state. development
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.

3 weeks agoBugfix: Incorrect processing order with --at, --select, and --total for FSS Read...
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.

4 weeks agoBugfix: Use fl_directory_create() instead of f_directory_create().
Kevin Day [Fri, 9 May 2025 02:30:34 +0000 (21:30 -0500)]
Bugfix: Use fl_directory_create() instead of f_directory_create().

The `fl_directory_create()` instead of `f_directory_create()` should be used to create the directory tree.

4 weeks agoCleanup: Remove unused fake_f_fake_execute_e.
Kevin Day [Fri, 9 May 2025 02:30:08 +0000 (21:30 -0500)]
Cleanup: Remove unused fake_f_fake_execute_e.

4 weeks agoBugfix: The fl_directory_create() is failing on directory exists with path ends in...
Kevin Day [Fri, 9 May 2025 02:23:39 +0000 (21:23 -0500)]
Bugfix: The fl_directory_create() is failing on directory exists with path ends in '/'.

The final directory gets created in the loop before the final directory create is called.

Check if the directory exists before the final directory create call.

4 weeks agoUpdate: Organize error status handling and address return codes.
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.

4 weeks agoBugfix: Featueless Make array cache is being reset incorrectly in some cases.
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.

4 weeks agoWorkaround: The compiler and linker fail to understand that compiling statically...
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.

4 weeks agoUpdate: Add none enumeration for fake_build_type_*_e.
Kevin Day [Thu, 8 May 2025 03:34:07 +0000 (22:34 -0500)]
Update: Add none enumeration for fake_build_type_*_e.

5 weeks agoCleanup: Remove extra space.
Kevin Day [Fri, 2 May 2025 00:55:37 +0000 (19:55 -0500)]
Cleanup: Remove extra space.

5 weeks agoUpdate: Next micro version (0.7.2).
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*

5 weeks agoUpdate: Set month year in man pages to April 2025. 0.7.1
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.

5 weeks agoUpdate: Internal Cmocka version to 1.1.7.
Kevin Day [Mon, 28 Apr 2025 23:18:21 +0000 (18:18 -0500)]
Update: Internal Cmocka version to 1.1.7.

5 weeks agoRegression: Only append leading slash if the map values are not empty in Featureless...
Kevin Day [Mon, 28 Apr 2025 23:13:50 +0000 (18:13 -0500)]
Regression: Only append leading slash if the map values are not empty in Featureless Make.

The `source` can be an empty string for local paths, such as with the cmocka build settings file.

5 weeks agoUpdate: Improve example bootstrap script, exiting properly on error.
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 `||`.

5 weeks agoUpdate: Add after_action and before_action helper flags for f_directory_recurse_do.
Kevin Day [Sun, 27 Apr 2025 22:28:17 +0000 (17:28 -0500)]
Update: Add after_action and before_action helper flags for f_directory_recurse_do.

5 weeks agoRegression: Fix the preserve and offset calculation in Featureless Make.
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.

5 weeks agoUpdate: Add verbose printing of the install command when in debug for test.sh.
Kevin Day [Sun, 27 Apr 2025 21:03:52 +0000 (16:03 -0500)]
Update: Add verbose printing of the install command when in debug for test.sh.

5 weeks agoUpdate: Featureless Make with regard to recent fl_directory_do() changes.
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.

5 weeks agoUpdate: Change fl_directory_do() to make the action optional as well.
Kevin Day [Sun, 27 Apr 2025 02:46:04 +0000 (21:46 -0500)]
Update: Change fl_directory_do() to make the action optional as well.

The action flag for `fl_directory_do()` should also be optional.
Adjust the code so that recursion still happens even if the action flag is not set.

This better allows for cases where the before is to be used but the action itself is not needed.
This happens to be the case with Featureless Make.

Add additional helper flags.

Improve documentation comments.
Add a warning about setting the top string to a string that is changed during recursion.

5 weeks agoCleanup: Remove build files from source directory.
Kevin Day [Sat, 26 Apr 2025 21:39:02 +0000 (16:39 -0500)]
Cleanup: Remove build files from source directory.

These file should not have been included and got included by accident.

5 weeks agoCleanup: Private fl_directory_do() code structure.
Kevin Day [Sat, 26 Apr 2025 21:30:46 +0000 (16:30 -0500)]
Cleanup: Private fl_directory_do() code structure.

Reduce the duplicate code by moving the callback outside of two blocks.

5 weeks agoBugfix: Incorrect flags passed to fl_directory_do().
Kevin Day [Sat, 26 Apr 2025 21:29:11 +0000 (16:29 -0500)]
Bugfix: Incorrect flags passed to fl_directory_do().

The `recurse->flag` should not be passed to the action and other callbacks.

6 weeks agoBugfix: Correct the fl_directory_do() top-level path execution order.
Kevin Day [Sat, 26 Apr 2025 03:03:10 +0000 (22:03 -0500)]
Bugfix: Correct the fl_directory_do() top-level path execution order.

The before must happen before the directory recurse.
The action must happen after the directory recurse.
The after must happen after the action.

This is already done in the recursive paths and it is now done in the top level path.

Update the documentation comments to more accurately and better explain this.

Apply the directory path resetting following recurse at the top level as well.

6 weeks agoBugfix: The fl_directory_do() depth is not being incremented at the top.
Kevin Day [Wed, 23 Apr 2025 02:45:16 +0000 (21:45 -0500)]
Bugfix: The fl_directory_do() depth is not being incremented at the top.

The top-most level must increment the depth before the initial recursion.

6 weeks agoUpdate: Use defines over enums in f_console, add stop behavior, and add alone behavior.
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.

7 weeks agoUpdate: The fl_directory_do() documentation comments and tweak flags.
Kevin Day [Sat, 19 Apr 2025 02:54:23 +0000 (21:54 -0500)]
Update: The fl_directory_do() documentation comments and tweak flags.

The documentation comments on how `fl_directory_do()` operates is now correctly updated.

Add an additional helper flag.

Improve use of flags in the process.

7 weeks agoBugfix: The fl_directory_do() needs to always process at the top level.
Kevin Day [Sat, 19 Apr 2025 02:19:11 +0000 (21:19 -0500)]
Bugfix: The fl_directory_do() needs to always process at the top level.

The top level directory is not being processed when the depth is less than the max depth.

Make sure to add the directory flag as well.

7 weeks agoUpdate: The experimental fll.c.tags.
Kevin Day [Fri, 18 Apr 2025 20:55:25 +0000 (15:55 -0500)]
Update: The experimental fll.c.tags.

7 weeks agoCleanup: Remove private headers from installation build path.
Kevin Day [Fri, 18 Apr 2025 20:47:56 +0000 (15:47 -0500)]
Cleanup: Remove private headers from installation build path.

7 weeks agoUpdate: Add directory functions, re-design fl_directory_do().
Kevin Day [Thu, 17 Apr 2025 03:11:27 +0000 (22:11 -0500)]
Update: Add directory functions, re-design fl_directory_do().

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.

7 weeks agoRegression: Parent directory in recursion does not get processed properly.
Kevin Day [Sun, 13 Apr 2025 02:20:42 +0000 (21:20 -0500)]
Regression: Parent directory in recursion does not get processed properly.

The commit 8df0301badf6f38fcb4ddf73318e02708ad344f7 fixed a problem with the parent directory not being processed at all.
It failed to handle the situation where the child directory alters the path to append itself.

Save the parent directory path and then restore it after processing the child directory.

Many POSIX libc functions work on NULL termination where possible.
Make sure a NULL termination exists after restoring the path.

7 weeks agoUpdate: Add recurse flag masks.
Kevin Day [Sun, 13 Apr 2025 01:54:37 +0000 (20:54 -0500)]
Update: Add recurse flag masks.

This adds `f_directory_recurse_do_flag_action_mask_e` and `f_directory_recurse_do_flag_top_mask_e`.
These are helper flags for existing flag sets as a convenience.

8 weeks agoBugfix: The fl_directory_do() needs to operate on the parent directory during recursion.
Kevin Day [Thu, 10 Apr 2025 03:51:18 +0000 (22:51 -0500)]
Bugfix: The fl_directory_do() needs to operate on the parent directory during recursion.

The parent directory must be processed after recursion during the recursion steps.
These should not have the `f_directory_recurse_do_flag_top_after_e` flags because these are not top level.
These must have action because the action is expected to be performed on the directory just like other file types.

8 weeks agoCleanup: Add missing function documentation for fll_program_standard_signal_received_...
Kevin Day [Thu, 10 Apr 2025 02:29:56 +0000 (21:29 -0500)]
Cleanup: Add missing function documentation for fll_program_standard_signal_received_wait().

8 weeks agoFeature: Add fll_program_signal_check_loop() and fll_program_signal_check_simple().
Kevin Day [Wed, 9 Apr 2025 02:23:33 +0000 (21:23 -0500)]
Feature: Add fll_program_signal_check_loop() and fll_program_signal_check_simple().

These functions are already implemented in each of the level 3 programs.
The functions are pretty much identical.
Move the signal check logic into the `fll_program` project as `fll_program_signal_check_loop()` and `fll_program_signal_check_simple()`.

Update all of the programs, removing their variation and instead using one of these two.
Utilize a macro to call one or the other based on thread enabled state.

The fss_write payload is not calling the fss_write function and is instead using its own variation.
Replace that code with the macro as well.

Remove all stale and no longer needed signal check defines.

2 months agoCleanup: Remove unnecessary status checks in fl_directory_do().
Kevin Day [Fri, 4 Apr 2025 00:51:41 +0000 (19:51 -0500)]
Cleanup: Remove unnecessary status checks in fl_directory_do().

These checks are performed later on in the code at the end of the loop without additional status changes in between.

2 months agoBugfix: The fl_directory_do() needs to pass f_directory_recurse_do_flag_directory_e...
Kevin Day [Fri, 4 Apr 2025 00:46:57 +0000 (19:46 -0500)]
Bugfix: The fl_directory_do() needs to pass f_directory_recurse_do_flag_directory_e at the top.

At the top, before recursion, the path is known to be a directory.
The flag `f_directory_recurse_do_flag_directory_e` must be passed to the callbacks to let the callbacks know this is a directory.

2 months agoBugfix: Directory recursion has incorrect status check resulting in early loop breakage.
Kevin Day [Thu, 3 Apr 2025 04:59:28 +0000 (23:59 -0500)]
Bugfix: Directory recursion has incorrect status check resulting in early loop breakage.

The loop is breaking out early due to the incorrect boolean logic when checking if an interrupt signal has been received via the state status.

This bug was exposed by the (incomplete) kevux-tools program `remove`:
```shell
clear ; md a/b/c ; touch a/b/file ; remove a/b/ -r +V ; t a
```

2 months agoUpdate: Switch to the global array for print messages for fll_program.
Kevin Day [Mon, 31 Mar 2025 02:07:05 +0000 (21:07 -0500)]
Update: Switch to the global array for print messages for fll_program.

This migrates the string messages to a single array.
At this time the array as a whole is enabled/disabled via the macros.
This may result in more strings included that needed.

This provides a single location to manage the string messages.
This may help with different languages.

2 months agoUpdate: Rebuild the disable build configs.
Kevin Day [Sun, 30 Mar 2025 23:04:44 +0000 (18:04 -0500)]
Update: Rebuild the disable build configs.

I haven't done this in a while and this needs to happen before releases.
This helps catch things up.

2 months agoCleanup: The FLL FSS Status String strings.
Kevin Day [Sun, 30 Mar 2025 23:03:03 +0000 (18:03 -0500)]
Cleanup: The FLL FSS Status String strings.

Remove the granular define wrapping structure that I am not using anymore.
Make sure to use the proper `_s_` naming strategy.
Simplify some of the names.

2 months agoCleanup: Improve language for the version parameter help.
Kevin Day [Sun, 30 Mar 2025 03:11:04 +0000 (22:11 -0500)]
Cleanup: Improve language for the version parameter help.

2 months agoUpdate: Ensure the FLL print help option functions support NULL description.
Kevin Day [Sun, 30 Mar 2025 03:10:01 +0000 (22:10 -0500)]
Update: Ensure the FLL print help option functions support NULL description.

2 months agoCleanup: Print less technical messages about verbosity help.
Kevin Day [Sun, 30 Mar 2025 01:39:23 +0000 (20:39 -0500)]
Cleanup: Print less technical messages about verbosity help.

2 months agoFeature: Add fll_program function for printing unsupported parameter message.
Kevin Day [Sun, 30 Mar 2025 01:38:52 +0000 (20:38 -0500)]
Feature: Add fll_program function for printing unsupported parameter message.

2 months agoCleanup: Fix comment in f_directory_empty().
Kevin Day [Fri, 28 Mar 2025 03:30:49 +0000 (22:30 -0500)]
Cleanup: Fix comment in f_directory_empty().

2 months agoCleanup: Change verbosity variable assignments structure.
Kevin Day [Fri, 28 Mar 2025 02:03:07 +0000 (21:03 -0500)]
Cleanup: Change verbosity variable assignments structure.

2 months agoUpdate: Copyright year to 2025.
Kevin Day [Thu, 27 Mar 2025 02:01:54 +0000 (21:01 -0500)]
Update: Copyright year to 2025.

I hadn't realized that I had not done this in January.
Now the copyright is correctly updated.

2 months agoCleanup: Documentation comments, adding _s, _e, and _d.
Kevin Day [Wed, 26 Mar 2025 03:28:12 +0000 (22:28 -0500)]
Cleanup: Documentation comments, adding _s, _e, and _d.

2 months agoFeature: Add 'input' as file type error string.
Kevin Day [Wed, 26 Mar 2025 03:26:48 +0000 (22:26 -0500)]
Feature: Add 'input' as file type error string.

The error type string `input` is needed to for cases like standard input processing.

Also fix the ordering of the file type error parameter for directory.

2 months agoFeature: The standard input should be available in fll_program_data_t.
Kevin Day [Wed, 26 Mar 2025 01:16:27 +0000 (20:16 -0500)]
Feature: The standard input should be available in fll_program_data_t.

I am surprised that I hadn't ever gotten to standard input processing.
The functionality should exist but the programs haven't needed this as of yet.
This is most certainly going to be needed so add the support.

2 months agoCleanup: Use project-specific type F_file_flag_read_only_d.
Kevin Day [Wed, 26 Mar 2025 01:15:52 +0000 (20:15 -0500)]
Cleanup: Use project-specific type F_file_flag_read_only_d.

2 months agoBugfix: Trailing semi-colon added at the end of the macro for f_time_spec_t.
Kevin Day [Sun, 23 Mar 2025 00:34:20 +0000 (19:34 -0500)]
Bugfix: Trailing semi-colon added at the end of the macro for f_time_spec_t.

The semi-colons should not be auto-added like this.
When adding the define inside an array, the semi-colon will cause compile problems that are hard to debug.

2 months agoFeature: Add missing file type unknown string.
Kevin Day [Sat, 22 Mar 2025 03:10:16 +0000 (22:10 -0500)]
Feature: Add missing file type unknown string.

The string for unknown file type should be supported for consistency reasons.

2 months agoBugfix: Incorrect example in time specification regarding EpochTime.
Kevin Day [Sat, 22 Mar 2025 03:08:32 +0000 (22:08 -0500)]
Bugfix: Incorrect example in time specification regarding EpochTime.

The EpochTime uses two colons '::'.
Make sure the EpochTime examples appropriately communicates this.

2 months agoUpdate: Add more file type documentation comments and add macro_f_file_type_clear().
Kevin Day [Fri, 21 Mar 2025 01:50:51 +0000 (20:50 -0500)]
Update: Add more file type documentation comments and add macro_f_file_type_clear().

The file type documentation comments now have more details.

The `macro_f_file_type_clear()` provides a way to clear only the file type bits.

2 months agoFeature: Add support for unknown file type.
Kevin Day [Wed, 19 Mar 2025 02:52:59 +0000 (21:52 -0500)]
Feature: Add support for unknown file type.

2 months agoBugfix: The macro _f_memory_NO_zeroing_on_larger_ is being applied on smaller.
Kevin Day [Thu, 13 Mar 2025 03:06:45 +0000 (22:06 -0500)]
Bugfix: The macro _f_memory_NO_zeroing_on_larger_ is being applied on smaller.

If the new memory size is smalle, then the _f_memory_NO_zeroing_on_larger_ should not be used.

2 months agoUpdate: The top-level directory recursion actions should have more fine-tuned control.
Kevin Day [Sun, 9 Mar 2025 23:41:43 +0000 (18:41 -0500)]
Update: The top-level directory recursion actions should have more fine-tuned control.

Provide `f_directory_recurse_do_flag_top_after_e` and `f_directory_recurse_do_flag_top_before_e` flags.
This requires increasing the size of the flags from `uint16_t` to `uint32_t`.

Be sure to pass the `path` rather than `recurse->path` at the top-level.

Make sure the `action` flag is set for the top-level action.

Add additional documentation comment regarding the `top` flag and the `recurse.path`.

Even though it is a listing of the path, still pass the `recurse.path` to the error handler at the top of `private_fl_directory_do_recurse()`.

Try to make the flag usage be ordered alphabetically.

Always perform the directory listing loading.
If this is not desired, then the `fl_directory_do()` function is likely not needed and simpler functions may be better choices.

Do not include the top-level flag for the directory listing for consistency with the recursion.
The recursion doesn't know the top-level, so do not set the top flag in this case.
The directory exists check is no longer needed and might have been redundant anyway.

Update the documentation comments.
I appear to have missed updating this in some of the previous commits that introduced operational changes.
Add additional documentation about checking the recurse parameter for NULL.

The private_fl_directory_do_recurse() already checks the error status.
Remove extra error checking after the `private_fl_directory_do_recurse()` call.
This extra error checking is redundant.
The return on error and return on done must still be performed.

After every private_inline_fl_directory_do_handle() call, the F_done is not being processed.
The check for `F_done` must be done for every single error handler call.
The only exception would be the last one in the top-level function because the function will always return after the last call anyway.

Update Featureless Make to work with the latest changes.

2 months agoCleanup: Further clarify the directory recrusion action callback parameters.
Kevin Day [Sun, 9 Mar 2025 23:39:30 +0000 (18:39 -0500)]
Cleanup: Further clarify the directory recrusion action callback parameters.

2 months agoCleanup: Use uint8_t instead of bool and reduce calls to remove() in f_directory_remo...
Kevin Day [Sun, 9 Mar 2025 22:30:39 +0000 (17:30 -0500)]
Cleanup: Use uint8_t instead of bool and reduce calls to remove() in f_directory_remove().

I am now thinking that `uint8_t` is better than `bool`.
In particular, because this allows for more flags down the road without breaking API or ABI.

Simplify the logic in `f_directory_remove()` to have only a single declaration of `remove()`.

2 months agoBugfix: Ensure that fl_directory_do() depth 0 may still list directory contents.
Kevin Day [Sun, 9 Mar 2025 22:03:20 +0000 (17:03 -0500)]
Bugfix: Ensure that fl_directory_do() depth 0 may still list directory contents.

The caller may want to check if there are any files within the directory when the max depth is 0.
Load the directory listing if the list flag is passed even when max depth is 0.

2 months agoCleanup: Remove redundant resetting of directory used length.
Kevin Day [Sun, 9 Mar 2025 22:02:40 +0000 (17:02 -0500)]
Cleanup: Remove redundant resetting of directory used length.

2 months agoSecurity: Incorrect variable printed in private_fl_directory_do_recurse().
Kevin Day [Sun, 9 Mar 2025 20:57:58 +0000 (15:57 -0500)]
Security: Incorrect variable printed in private_fl_directory_do_recurse().

This bug is considered a security issue because it is printing potentially unused memory addresses.

3 months agoFeature: Add F_test status codes.
Kevin Day [Sat, 8 Mar 2025 05:30:20 +0000 (23:30 -0600)]
Feature: Add F_test status codes.

These codes are notably useful during the unit and runtime testing.

3 months agoCleanup: Remove unused variables created via a copy and paste mistake.
Kevin Day [Sat, 8 Mar 2025 05:14:43 +0000 (23:14 -0600)]
Cleanup: Remove unused variables created via a copy and paste mistake.

3 months agoCleanup: Make the object parameter array a constant pointer.
Kevin Day [Sat, 8 Mar 2025 03:41:02 +0000 (21:41 -0600)]
Cleanup: Make the object parameter array a constant pointer.

3 months agoCleanup: Fix incorrect statement in documentation.
Kevin Day [Sat, 8 Mar 2025 03:35:06 +0000 (21:35 -0600)]
Cleanup: Fix incorrect statement in documentation.

The statement of "This is different from code:"build_sources_object"" for the build_sources_object documentation makes no sense.
Remove that part of the statement.
There are no functional changes to the specification, so the version date is unchanged.

3 months agoBugfix: Incorrect counter resets and related clean ups.
Kevin Day [Fri, 7 Mar 2025 06:23:06 +0000 (00:23 -0600)]
Bugfix: Incorrect counter resets and related clean ups.

I overlooked some cases where the counter is not reset at the start of the loop.

Do some variable clean ups for code following similar logic.

3 months agoBugfix: Static build is not working, 'rcs' is not being appended.
Kevin Day [Fri, 7 Mar 2025 06:20:48 +0000 (00:20 -0600)]
Bugfix: Static build is not working, 'rcs' is not being appended.

I overlooked a case where the counter is not reset at the start of the loop.

I did some additional reviews of similar cases in the code and applied similar fixes.

3 months agoCleanup: Remove ':' from documentation line with "license".
Kevin Day [Fri, 7 Mar 2025 06:05:24 +0000 (00:05 -0600)]
Cleanup: Remove ':' from documentation line with "license".

The documentation comments should be written in a way that would be complaint with the FSS Basic or FSS Extended if they were not commented out.

3 months agoFeature: Add more fine tuned build_name options.
Kevin Day [Fri, 7 Mar 2025 06:05:05 +0000 (00:05 -0600)]
Feature: Add more fine tuned build_name options.

The build names should support shared, static, program, object, and library.
Some of these may not be directly used.
They should still be loaded.
This is done to make the project compliant with the standard while allowing extendability/hackability.

3 months agoUpdate: Bootstrap script needs iki_read and iki_write for fake_programs.
Kevin Day [Thu, 6 Mar 2025 02:26:50 +0000 (20:26 -0600)]
Update: Bootstrap script needs iki_read and iki_write for fake_programs.

3 months agoBugfix: The sources and under parameters can have invalid slashes.
Kevin Day [Thu, 6 Mar 2025 02:05:03 +0000 (20:05 -0600)]
Bugfix: The sources and under parameters can have invalid slashes.

The directory path cleanup function is not being called for these due to an incorrect boolean value.

Rename `cleanups` to `directory` to make this more clear that this is about being a directory more so than it is about cleanups.

Fix out of date parameter type documentation comment.

Remove old todo comment.

3 months agoUpdate: Add help message for fakefiles and testfiles.
Kevin Day [Tue, 4 Mar 2025 05:12:59 +0000 (23:12 -0600)]
Update: Add help message for fakefiles and testfiles.

Add a fakefile option for printing help.
I used a generic and easy to copy and paste message.

3 months agoUpdate: Implement the static string array for the fll_error program.
Kevin Day [Fri, 21 Feb 2025 03:03:57 +0000 (21:03 -0600)]
Update: Implement the static string array for the fll_error program.

This provides some centralization to the static strings to a single global array.
This uses an enumeration similar to the way the function strings in the programs are handled.
This enumeration does come with a cost.
However, adding all the strings together in a single location should have some technical benefits.

3 months agoUpdate: Add programs to bootstrap script.
Kevin Day [Fri, 21 Feb 2025 03:02:46 +0000 (21:02 -0600)]
Update: Add programs to bootstrap script.

Add several programs to the bootstrap program for the stand alone build.

Fix a comment.

3 months agoCleanup: Reduce duplicate code in the fll_error print functions.
Kevin Day [Thu, 20 Feb 2025 05:12:08 +0000 (23:12 -0600)]
Cleanup: Reduce duplicate code in the fll_error print functions.

Populate the `type_name` via a nested ternary instead of an if else if blocks.
The if else if blocks are cleaner but I want to have the `type_name` be a constant variable.
This should help the compiler optimize the variable.

Replace a lot of the repeated styles with new private functions.
This reduces quite a bit of repeated lines of code based on common patterns.

I do intend to follow this up at a later date with a commit that moves all of the static strings into a global array.

3 months agoCleanup: Use the f_string_static_t macros for the f_string_dynamic_t macros.
Kevin Day [Thu, 20 Feb 2025 03:59:53 +0000 (21:59 -0600)]
Cleanup: Use the f_string_static_t macros for the f_string_dynamic_t macros.

The `macro_f_string_dynamic_t_initialize_1` and `macro_f_string_dynamic_t_initialize_2` should be using the word `string` rather than `array` for the first argument.
call the `f_string_static_t` macros for the respective `f_string_dynamic_t` macros.

3 months agoFeature: Add F_add and F_remove status codes.
Kevin Day [Wed, 19 Feb 2025 02:38:08 +0000 (20:38 -0600)]
Feature: Add F_add and F_remove status codes.

3 months agoUpdate: IKI Write from main/data.callback to main/data.call.
Kevin Day [Wed, 19 Feb 2025 00:52:11 +0000 (18:52 -0600)]
Update: IKI Write from main/data.callback to main/data.call.

Rename `callback` to `call` to e consistent with recent naming changes.

3 months agoUpdate: IKI Read documentation comments should use main.call.
Kevin Day [Wed, 19 Feb 2025 00:49:34 +0000 (18:49 -0600)]
Update: IKI Read documentation comments should use main.call.

The `main.callback` was recently replaced with `main.call`.
These documentation comments were overlooked or otherwise missed.

3 months agoUpdate: Help printing functions and callbacks.
Kevin Day [Fri, 14 Feb 2025 04:17:50 +0000 (22:17 -0600)]
Update: Help printing functions and callbacks.

Have most of the help printing functions that might be used as `fl_print_call_t` be consistent with that prototype structure.

Fix some issues where `data.callback` is still used and should now instead be `data.call`.

3 months agoUpdate: Use f_console_parameters_t as a pointer and document fll_program_parameter_pr...
Kevin Day [Fri, 14 Feb 2025 04:01:26 +0000 (22:01 -0600)]
Update: Use f_console_parameters_t as a pointer and document fll_program_parameter_process_context_standard().

Make the use of `f_console_parameters_t` as a pointer for consistency purposes.

Some programs did this whereas other programs repeatedly called `main->program.parameters`.
This should no longer be the case.

The documentation comments should be referencing `fll_program_parameter_process_context_standard()` and now do.

3 months agoUpdate: Switch from memcpy() to memmove() just in case.
Kevin Day [Fri, 14 Feb 2025 02:46:11 +0000 (20:46 -0600)]
Update: Switch from memcpy() to memmove() just in case.

This is a library and cannot guarantee that the sources do not overlap.
Change to `memmove()` to play it safe.

3 months agoUpdate: Use *_settings_load_call_t for callbacks.
Kevin Day [Fri, 14 Feb 2025 02:29:43 +0000 (20:29 -0600)]
Update: Use *_settings_load_call_t for callbacks.

Switch these callbacks to use the typedef design.

3 months agoFeature: Allow for the group and user functions to not require a write value.
Kevin Day [Wed, 12 Feb 2025 01:56:07 +0000 (19:56 -0600)]
Feature: Allow for the group and user functions to not require a write value.

Several of these functions can be used to just check the validity of an ID or name.
Use the NULL pointer case to support this rather than writing a completely new functions for this logic.

For example, the `f_account_group_id_by_name()` function can have NULL for the `id` parameter.
In this case, nothing is written for the `id` and the function does not error out on invalid parameter (for when `id` is NULL).
The same logic is applied for the `f_account_group_name_by_id()` for the `name` parameter.

The same logic is applied for both user functions.

The account by functions are not updated as this is not needed.
Update the documentation for the account by functions, documenting that NULL is not allowed.

3 months agoUpdate: Use a constant for the argv in fss_write.
Kevin Day [Sun, 9 Feb 2025 06:27:54 +0000 (00:27 -0600)]
Update: Use a constant for the argv in fss_write.

3 months agoUpdate: Callback changes and improvements.
Kevin Day [Sun, 9 Feb 2025 06:20:23 +0000 (00:20 -0600)]
Update: Callback changes and improvements.

The `void *(*)(void *)` function structure is being used so add that as a function callback type `f_void_pointer_call_t`.

Add `fl_print_call_t` function callback type.

Rename the console parameter callback from `callback` to `on_match`.
Add `f_console_parameters_call_t` function callback type.
Fix documentation comment where `length` should instead be `used`.

The `void_main` are now replaced with literal `main` type now that the typedef structure improvements are in place.

Shorten the `callback` name to `call`.
Use more typedefs for functions.
This better takes advantage of how functions are a "first class citizen" in C.

3 months agoBugfix: Individual build problems with incorrect settings and dependencies.
Kevin Day [Sun, 9 Feb 2025 05:08:51 +0000 (23:08 -0600)]
Bugfix: Individual build problems with incorrect settings and dependencies.

The `f_abstruse` is not being included in some cases.

The `individual_thread` is not being used in some cases and instead `individual-thread` is being used.
Make sure `individual_thread` is the only form used.

Remove `f_parse` inclusion where it is not needed.

Add missing `-lf_compare`.

3 months agoBugfix: Incorrect ifndef for f_capability_user_set().
Kevin Day [Sat, 8 Feb 2025 23:55:52 +0000 (17:55 -0600)]
Bugfix: Incorrect ifndef for f_capability_user_set().

3 months agoCleanup: Fix spelling of comment.
Kevin Day [Sat, 8 Feb 2025 23:55:08 +0000 (17:55 -0600)]
Cleanup: Fix spelling of comment.

Full sentences should have the first letter upper case.

3 months agoBugfix: Incorrect clear macro on f_account_t().
Kevin Day [Sat, 8 Feb 2025 23:54:40 +0000 (17:54 -0600)]
Bugfix: Incorrect clear macro on f_account_t().

The `macro_f_account_t_clear()` is calling its own macro for the dynamic string values.
This is entirely incorrect.

Use the proper `macro_f_string_dynamic_t_clear()` macro calls.

3 months agoUpdate: Add f_id_t, f_uid_t, and f_gid_t type helpers for uid_t and gid_t.
Kevin Day [Sat, 8 Feb 2025 22:12:11 +0000 (16:12 -0600)]
Update: Add f_id_t, f_uid_t, and f_gid_t type helpers for uid_t and gid_t.

The `uid_t` and `gid_t` don't readily map to each other.

I would love to simplify the code and have a single function call in several cases when using both `uid_t` and `gid_t`.

This provides interchangeable types `f_id_t`, `f_uid_t`, and `f_gid_t`.
The standard behavior is that `f_uid_t` and `f_gid_t` are both sub-types of `f_id_t`.
The `f_id_t` is by default an unsigned 32-bit integer.

3 months agoFeature: Add f_void_call_t as a standard function callback.
Kevin Day [Sat, 8 Feb 2025 22:09:32 +0000 (16:09 -0600)]
Feature: Add f_void_call_t as a standard function callback.

This is likely to be very common.
Set this up to make the code cleaner when using this callback.

There are no plans to implement any other types of callbacks as a standard.

4 months agoUpdate: Improve directory recursion and its documentation.
Kevin Day [Fri, 31 Jan 2025 03:45:53 +0000 (21:45 -0600)]
Update: Improve directory recursion and its documentation.

Fix some problems in the `fl_directory_do()` documentation.
Extend the documentation adding more details of the process.

Remove redundant "is not error" status checks.

The checks like `if (flag_actions[j])` and `if (!flag_actions[j])` are now changed to respect the recently added `f_directory_recurse_do_flag_action_e` flag.

4 months agoUpdate: Switch to typedef struct approach for safer callbacks inside structure f_dire...
Kevin Day [Thu, 30 Jan 2025 05:45:55 +0000 (23:45 -0600)]
Update: Switch to typedef struct approach for safer callbacks inside structure f_directory_recurse_do_t.

Update all of the files and callbacks.

4 months agoCleanup: Add new line after typedef.
Kevin Day [Thu, 30 Jan 2025 05:45:09 +0000 (23:45 -0600)]
Cleanup: Add new line after typedef.

4 months agoUpdate: Add specific action flag for directory do recursion and fix integer type.
Kevin Day [Thu, 30 Jan 2025 05:12:23 +0000 (23:12 -0600)]
Update: Add specific action flag for directory do recursion and fix integer type.

Add a specific action flag to make it easier to explicitly test if this is the action pass of say `fl_directory_do()`.

Use  `uint16_t` to directly map to the flag integer type.