Kevin Day [Mon, 1 May 2023 03:02:04 +0000 (22:02 -0500)]
Progress: Continue work on fss_read, making relevant changes in other projects.
Start using "static" where it is safe to do so and easy for me to identify such cases.
I would note that a static array of const f_string_static_t does not work.
Kevin Day [Sat, 29 Apr 2023 01:25:14 +0000 (20:25 -0500)]
Bugfix: Incorrect return code in tests causes false failures in CI.
Recent changes of the code change the "failure" variable from being an empty string for no error to being the explicit digit of "0".
The change is incomplete and this caused the false failure by incorrectly returning "1" when instead "0" should be returned.
The Gitlab CI detected this but the Github CI failed to.
Kevin Day [Fri, 28 Apr 2023 03:00:47 +0000 (22:00 -0500)]
Progress: Make some progress towards getting fss_read up and running.
This mostly focuses on the print help functions.
Fix the incorrectly spelled "aplied".
Fix the help messages in the read man pages.
Add *_format_code_name_* for an upper-case human friendly name.
Add this to the fss_write as well given that the programs follow the "programs as a library" design.
Kevin Day [Thu, 27 Apr 2023 03:36:48 +0000 (22:36 -0500)]
Progress: Initial setup of fss_read for merging all fss_*_read programs.
This is just a copy and paste of fss_write with some very basic initial changes and refactoring.
This is not expected to work anytime soon and will be slowly converted.
Expect major changes.
I suspect that I will be working outward in to slowly add the needed functionality and to match the behavior with the fss_*_read programs.
All of the fss_*_read programs will be removed and replaced with this once this project is complete just like was done with the fss_*_write programs and fss_write.
Also fix an incorrect comment in fss_write that references "payload" when it should not.
Kevin Day [Thu, 27 Apr 2023 02:36:41 +0000 (21:36 -0500)]
Update: Slightly reduce recursion cost for private_fl_directory_do_recurse().
Make some constant structures static with the goal of reducing the cost of recursion.
Using static should help avoid redeclaring these variables per execution.
This should reduce memory for each recurse into the function.
Kevin Day [Tue, 25 Apr 2023 02:39:45 +0000 (21:39 -0500)]
Refactor: Mass change the macro initializer functions to always have an underscore and some identity.
The macro initializer functions can be a little confusing when there is macro_f_do_something() and macro_f_do_something2().
Change the behavior to something more like macro_f_do_something_1() and macro_f_do_something_2().
Kevin Day [Wed, 19 Apr 2023 03:21:32 +0000 (22:21 -0500)]
Progress: Unit tests and other minor changes.
Get more of the unit tests up to date.
I did not finish working on the f_file unit tests.
I specifically stopped on the stream functions, namely the f_stream_write().
Fix the file defaults, such as _di_f_type_file_defaults_ that should be _di_f_type_file_defaults_d_.
The file flags (wrapped by _di_f_file_flag_d_) must be located with the f_type type_file.h file.
Kevin Day [Tue, 18 Apr 2023 03:57:54 +0000 (22:57 -0500)]
Bugfix: Fix bugs in console parameter processing exposed by unit tests.
The f_console_identify() function is incorrectly assigning the bits for short alone values.
The mistake is a missing pipe character and as a result the flags are being assigned rather than being bitwise-or appended.
The short.used and long.used string checks should skip when the string is empty.
This is not happening due to an AND comparitor in the string.
This then causes a false positive and the unit tests identify invalid data.
The process found check outside of the loop that depends on the iterator "i" should also check that i is less than the total array length.
Kevin Day [Tue, 18 Apr 2023 00:29:59 +0000 (19:29 -0500)]
Progress: Address incomplete updates to several programs.
A previous progress commit (or series of commits) left these programs incompletely updated when they should otherwise compile.
Add "machine" name type to the fss_write matching logic.
Add missing macro function string fo f_thread_create.
Fix out of date initializes that now need different arguments or sets of arguments.
The changes to fss_write accidentally mass replaced the special fss_write_setting_load() uses that have a callback parameter.
The embedded list write has the wrong format code string ("basic" should be "embedded list").
The iki_write has an out of place declaration of iki_write_main_delete().
Kevin Day [Mon, 17 Apr 2023 02:36:04 +0000 (21:36 -0500)]
Progress: Wrap up most of the directory do related changes in Featureless Make.
I am hoping this is the last progress on Featureless Make to get it fully up to date with all of the changes.
While I won't be surprised if I missed something this feels like its ready.
Remove the directory recurse copy flags.
Use more caches in Featureless Make.
Move the directory do as a cache to better allow for reusing the path and path_custom strings.
Update the documentation comments regarding the caching.
The regression mentioned in commit 61a348ba714e41467da803f8220a31c126581a01 is resolved.
The regression is that I appended the path separator out of scope (outside of a relevant condition check).
I noticed another regression where when source.used is 0 the action is not performed.
This is incorrect because the source may be 0 and the paths being used are just relative paths.
Fix a mistake where the f_file_copy() and f_file_clone() are passed invalid flags.
Make sure to pass the appropriate flags to the f_file_clone() calls in the directory do handle callback.
Kevin Day [Sun, 16 Apr 2023 03:19:04 +0000 (22:19 -0500)]
Progress: Additional file copy, clone, and move changes.
Remove code relating to the recursive copy functions.
Remove the fll_file_move() function.
The fll_file_move() has some additional logic for handling a case where the return status is F_mount.
If this is still a problem then I will have to address this.
The fll_file_move() doesn't make as much sense now that thee is an fl_directory_do().
Most of the logic needed is now outside of the FLL project and inside of the projects utilizing the library.
The fl_directory_copy() function is now fully replaced by the fl_directory_do() function.
This has an upside of being more flexible but a downside of putting more of the design burden onto the caller.
This overall appears to be resulting in a cleaner and simpler design.
Move the fl_directory_do() related callbacks into a new source and header file in Featureless Make.
I have noticed a regression, of which I would wildly guess be related to the recent cache design changes, where testing Featureless Make against bzip is not working anymore.
There is a path separator at the start of the files when there should not be.
This regression is not fixed here.
I only wanted to record it.
Kevin Day [Fri, 14 Apr 2023 00:42:44 +0000 (19:42 -0500)]
Progress: Focus on directory recursion related changes and Featureless Make.
This should wrap up most of the initial work creating the copy recursion.
There are other areas to update but this is the start.
I forgot and accidentally added "custom" to the fl_directory_do_t.
I should be using the custom from the state variable.
Now that I have had a chance to experiment with the new fl_directory_do() design I have managed to come to some more decisions.
The parameter checking will not have the f_directory_recurse_do_flag_path_e bit set for the error handler.
The before and after should be called not on just the directory recursion but also before and after each non-recursion file action.
This better allows for setting things up in a sane way as is appropriate when performing a copy operation.
I decided to provide some convenience variables.
This is not a great idea for a recursive function but it is a start.
I should investigate moving this array into a static array that is global to the private file but not shared beyond that.
This would prevent the cost of allocating the array for each recursion.
It would be a good idea to bind some of the strings to the cache and update them to better avoid additional allocations.
I think I need a cache_3 to achieve this.
I added todo comments in areas where I think this is relevant.
Do some minor clean ups on the printing in certain areas.
Kevin Day [Sun, 9 Apr 2023 23:21:10 +0000 (18:21 -0500)]
Progress: Focus on directory recursion related changes and Featureless Make.
I decided to offload some of the design in fl_directory_do().
The caller provides a callback and handles the combining of the path and the base file name.
This should allow for more optimization in string allocation and reduce some of the overhead of recursion.
The recursion now only records the used string rather than allocate an array of the path each time.
This should ideally reduce the amount of memory in the recursion.
The caller can now provide a custom variable to pass local data to the callbacks.
Rename 'first' and 'last' into 'before' and 'after', respectively, to be more semantically accurate.
Initial implementation of callbacks for action and handle.
I may have more work to do in the error handling, but I decided now is a good place to stop and save the progress.
Add code property to f_state_t to provide custom flags for the caller to control.
Create fake_local_t to pass custom information to the recursion functions.
Begin setting up and populating the failures structure.
Take care more cases where the interrupt needs to be handled.
This now sets the interrupt function globally and so the interrupt should be checked more often (such as in FSS Basic List read functions).
Make sure the interrupt is not checked twice once a signal is received.
This can happen after a program returns due to an interrupt.
Kevin Day [Thu, 6 Apr 2023 01:33:33 +0000 (20:33 -0500)]
Bugfix: The stage files should not begin with "-".
I haven't looked at the stage files in a while because it just works.
I happened to notice that they are beginning with "-".
This is incorrect.
Turns out that at some point in time the separator got pulled outside the process.used condition.
This results in the "-" always being added when it should not be.
The problem is introduced in this completely erroneous commit 8cb1d765b75403e242e307590842628aad7ad91b.
Add the same logic check to the name because it also append a "-".
Also reset the used length at the start of population of the stage file strings.
Improve the thread configuration to make it easier to enable or disable thread support.
Add documentation regarding the build modes supported in each of the build settings files.
Update the build scripts to better handle the now additional build modes.
The build scripts now use braces everywhere.
Doing this should make it easier to be compatible with other scripting engines such as ZSH.
Kevin Day [Mon, 3 Apr 2023 00:17:48 +0000 (19:17 -0500)]
Update: Implement threaded signal handler in Featureless Make.
Bring in the threaded signal handler design that I experimented with in the Kevux Tools project.
This works by creating a thread that waits for the signal and nothing else.
The threaded design avoids the signal check and therefore avoids period calls to kernel space.
When thread support is diabled, this falls back to the traditional approach.
Kevin Day [Sun, 2 Apr 2023 20:34:44 +0000 (15:34 -0500)]
Progress: Continue program related work, focusing on Featureless Make.
The Featureless Make is not handling the return status correctly on error.
This is due to a regression from switching to having status on state.
There are a couple of separate reasons:
1) One function is not doing the pre-check for error and then overrides the status.
2) Other functions that handle the error printing are calling f_fss_count_lines() which overrides the state.
The first situation is easily solved with a condition check.
The second case requires saving the status and then restoring it for error handling functions calling f_fss_count_lines().
Change the code were reasonably possible to use const on the return code.
Don't bother with return_code != 0, as removing the != 0 should be effectively the same check.
Make sure path separator is only added if it is not already present.
The migration of status into main.setting.state.status incorrectly changed fake_make_operate_validate_define_name().
This function does not set the status on main.setting.state.status.
Make sure a single white space is after simple variable print messages (before the quoted variable).
Reduce the number of pointer accesses (such data->main->... into main->...) by using a variable.
This costs some memory but should reduce having to navigate two pointers constantly.
Doing it this way also avoids having to add a parameter to each function.
Kevin Day [Sun, 2 Apr 2023 00:06:32 +0000 (19:06 -0500)]
Progress: Centralize Featureless Make cache and update directory code.
The Featureless Make program now uses a more centralized cache.
This requires some delicate handling in certain areas and testing is needed to assure that there are no regressions.
Continue some work regarding the recursive directory functions.
This program correctly errors when there is no "main" section.
When specifically asking to run a named section rather than the default "main", who cares if there is no "main"?
Based on that logic the lack of a "main" section should not be an error.
Kevin Day [Thu, 30 Mar 2023 04:54:50 +0000 (23:54 -0500)]
Update: Add unit tests for f_compare utf string functions.
I completely forgot about these and later noticed that they are not implemented.
This exposed problems where I neither had up to date utf stings nor did I have all of the expected functions implemented.
I took the lazy route to avoid spending time manually converting everything.
The files are direct copies from the non utf string compare functions.
I then provided functions that convert the regular strings into utf strings.
The comparisons are then against the generated utf strings.
Kevin Day [Wed, 29 Mar 2023 23:30:15 +0000 (18:30 -0500)]
Regression: Build test.sh script is not properly running.
Two mistakes are introduced by the commit 8f5854676725879488eaa1b378dc5d02e8169ae5.
1) The error handling return status checks are against empty string and not "0".
2) Accidental copy and paste mistake where print variable is being used as if it were a function.
Remove the failure=0 assignment.
The default of failure="" is what is needed.
The variable print_line_first is supposed to be test_print_first.
Kevin Day [Wed, 29 Mar 2023 03:37:05 +0000 (22:37 -0500)]
Security: Invalid read in trim comparison functions.
Writing unit tests exposed this problem.
The last1 and last2 positions could be the exclusive stop points.
The comparison checks fail to handle this situation and expect the last1 and last2 variables to not be positioned at an exclusive stop point.
This results in an invalid read.
Kevin Day [Mon, 27 Mar 2023 12:35:06 +0000 (07:35 -0500)]
Bugfix: The f_parse parsing functions do not check buffer.used.
The range length is being performed but not the buffer used length.
Add the appropriate return codes to represent end of string (buffer used length is reached).
This is applicable for the dynamic strings but is not applicable for the regular strings.
Kevin Day [Mon, 27 Mar 2023 02:11:20 +0000 (21:11 -0500)]
Refactor: Redesign fl_string and fl_utf_string, relocating into f_compare, f_parse, and f_rip.
The fl_string and fl_utf_string projects only depend on the core projects.
They could easily be moved into the level_0 project directory.
The problem is that they cannot be part of the f_string project due to depending on f_utf.
The f_string project is before the f_utf.
The solution is to break the fl_string into three projects:
- f_compare
- f_parse
- f_rip
It just so happens that the fl_utf_string is in the same situation as fl_string.
Move fl_utf_string into these three projects as appropriate.
This adds some initial unit tests to f_compare.
I didn't have enough to to finish f_compare, let alone get to f_parse and f_rip.
Kevin Day [Sun, 26 Mar 2023 00:40:51 +0000 (19:40 -0500)]
Update: Add fl_directory_do(), add new status codes, update fl_directory_copy(), and other changes.
An alternative to the ftw() is desired.
The function, fl_directory_do() is provided to perform generic recursive tasks.
This is based off of the fl_directory_copy() function.
This is not yet tested and there may be changes in the future once this is tested.
I noticed some things that could be improved in fl_directory_copy().
The recursion structure is actually specific to fl_directory_copy(), so rename it with "copy" in the name.
Kevin Day [Thu, 23 Mar 2023 02:58:27 +0000 (21:58 -0500)]
Progress: Continue program related work, focusing on print and main structures for already migrated projects.
I did a lot of mass replacements with absolutely no consideration to the non-migrated projects.
The files were probably process and likely have a mess of some of the changes while not having any of the other migration changes.
I've updated and did minimal runtime tests to confirm that the following projects work:
- fake
- fss_write
- iki_read
- iki_write
- status_code
- utf8
Kevin Day [Wed, 22 Mar 2023 05:15:41 +0000 (00:15 -0500)]
Progress: Continue program related work, focusing on printing.
Lots of printing related changes and clean ups.
Begin preparing things for switching to the *_main_t structures.
The fake, status_code, and utf8 projects are already converted to this.
There is a lot of stubbing in this commit.
I am probably going to just start a clean slate when building fss_read.
The fss_read will be based off of fss_write's design.
For this reason, I am being lax and negligent on the fss_*_read projects as they are going to get replaced and merged into fss_read.
Kevin Day [Tue, 21 Mar 2023 03:50:55 +0000 (22:50 -0500)]
Bugfix: Out of date repository build scripts.
The repository build scripts are very much out of date.
A recent bugfix, commit 831e5d8b0dce5279964987baa43201b63c12c203, attempted to partially address this.
It turns out that there is a lot more that needs to be done.
All of the repository build scripts are now updated.
Make sure the copyright parameter is available.
Make sure the "+Q/++quiet" and "+E/++error" parameters are correct and working.
Make sue the "+F/++line_first_no" and "+L/++line_last_no" parameters are working.
Utilize "+F" and "+L" where reasonably possible in the example bootstrap and test scripts.
Improve return status handling.
The goal here is to avoid calling "exit".
The use of "exit" is not safe as under certain conditions it can close terminals that the script is running in.
Kevin Day [Mon, 20 Mar 2023 03:17:45 +0000 (22:17 -0500)]
Progress: Continue program relating work, focusing on Featureless Make and printing.
I am finally getting close to wrapping up the printing changes in Featureless Make.
There are some improvements in the design that need to be reflected in the other already migrated programs (such as fss_write).
Having the extra flags and object on fl_print_t is already showing its worth.
I am able to drastically simplify the print functions.
I am also now using fake_main_t structure.
I like that pattern that is forming from this and will need to also update the already migrated programs.
Featureless Make is nearly fully migrated.
There are still some fixme and todo situations to resolve.
Kevin Day [Mon, 20 Mar 2023 03:16:30 +0000 (22:16 -0500)]
Bugfix: Out of date install.sh and Featureless Make helper scripts.
It seems that I never looked at these in a while and they are rather out of date.
Fix the parameters.
There are other scripts that need to be looked at as well and are not solved by this commit.
Kevin Day [Sun, 19 Mar 2023 22:03:55 +0000 (17:03 -0500)]
Security: Fix memory leak in private_fl_directory_copy_recurse().
The cause is not as clear to me.
The memory address is being copied and so it should be being freed.
There could be some compiler optimization making a bad decision here.
Simplify the logic and remove extra checks.
Operate on the variable before replacing the pointer.
Memory leak seems to be gone now.
Kevin Day [Sun, 19 Mar 2023 17:28:34 +0000 (12:28 -0500)]
Progress: Continue program related work, focusing on Featureless Make and printing.
Make the fl_print structure more extensible by adding a flag and a custom object.
The first/last printing is to complex.
Simplify the design to a simpler one.
Fix other problems as observed.
I have observed a memory leak in the recent f_directory_listing_t processing code.
Specifically, the f_directory_recurse_t as called in fake_build_copy().
The appropriate memory deletes appear to be being called.
More investigation is needed.
This is a recursive function, so there is probably a bad pointer assignment somewhere.
Kevin Day [Sat, 18 Mar 2023 05:10:21 +0000 (00:10 -0500)]
Progress: Get stand alone Featureless Make compiling and fix discovered problems.
Fix any discovered bugs while getting the stand alone Featureless Make compiling.
This should allow for the unit tests to be run again.
Unit tests will be needing numerous updates for that matter.
Kevin Day [Sat, 18 Mar 2023 02:36:55 +0000 (21:36 -0500)]
Bugfix: Add missing includes, add missing fanalyzer mode, and fix problems with stand alone fake.
The stand alone Featureless Make is not building properly.
Investigation reveals that there are missing sources and missing header includes.
For some reason the missing includes do not cause a problem in 0.6 or in non-stand_alone 0.7 builds.
However, it does cause a problem in the stand alone build.
Add the missing header includes.
Kevin Day [Sat, 18 Mar 2023 01:22:10 +0000 (20:22 -0500)]
Update: Relocate fll_path to fl_path.
I recently noticed that the fll_path has no level 1 dependencies.
I try to keep all projects as low as possible (level_0 being the lowest).
Move fll_paath to fl_path and update everything affected by this.
Kevin Day [Sat, 18 Mar 2023 00:48:45 +0000 (19:48 -0500)]
Progress: Continue program related work, focusing on Featureless Make.
THis mostly addresses comments.
This is a rather annoying and time-consuming process but it is worth it for long term maintenance.
I may have missed something but this should be acceptable.
Kevin Day [Thu, 16 Mar 2023 23:17:26 +0000 (18:17 -0500)]
Update: Add unit tests for fll_path.
I noticed that the '~' path is not expanded.
I checked to see if this is intentional or not.
It is intentionally not supported yet.
I need another function.
This check encouraged me to write some unit tests for the current behavior.
It seems that I had forgotten just how few unit tests I have.
Now there are at least more.
Kevin Day [Mon, 13 Mar 2023 03:12:28 +0000 (22:12 -0500)]
Progress: Continue program related work, focusing on Featureless Make.
This gets Featureless Make compiling again.
The program also appears to work.
I need to now start reviewing the code, fixing non-compile time catching mistakes, resolving any todd or fixme cases, and optimization.
There may also be some directory and file structure manipulation.
Kevin Day [Sat, 11 Mar 2023 02:42:49 +0000 (20:42 -0600)]
Update: Add example contrroller script for running under systemd using cgroups.
This provides an example cgroups setup.
I found that on systems with cgroups2, this is harder to figure out.
This turned out to be because of the existing setup used by many systemd systems.
This provides an example that I managed to get to work under some systems in some circumstances.
The biggest problems is that the subtree needs to be passed along and that tends to not be done by default.
The current user, if not root, usually lacks the privileges to do so.
The best case would be to use the cgroups generation when running as root to setup the appropriate user.
Then, use the program startup examples as the normal user.
This should show the cgroup situation.
I would not be surprised if the cgroup setup scripts has to be altered (not just the user and group name).
Kevin Day [Thu, 9 Mar 2023 05:07:50 +0000 (23:07 -0600)]
Feature: Add support for 'helper' mode to compliment the 'program' mode.
This is a bug fix disguised as a new feature.
When controller runs in program mode and is cancelled, all background (asynchronous) processes are cancelled.
My original thoughts were that background processes should stay open in program mode.
This is the bug being fixed.
I believe that there are use cases to operate in "program" mode and to always terminate the background processes in this manner.
Rather than fixing one case and breaking the other, this is a new feature that helps solve both cases.
The "program" mode operates in the same manner unchanged.
The new "helper" mode operates by detaching background (asynchronous) processes on exit.
The foreground process still runs and blocks normally.
A terminate signal might still terminate background processes.
More work is likely needed in this regard.
This stretches the original design to its limits.
The 0.7.x versions and later will need re-design to better handle these cases.
The original design I used was a learn as I go for thread design.
This resulted in rather messy code.
Now that I made it to this point, the controller program (0.6.x and earlier) can be used as a stepping stone for a better design.
Some of the problems are worked-around.
The program starts and exits too fast in controller mode.
The child processes end up getting terminated before a complete process is started and then backgrounded.
The work-around is to add a short sleep.
This is not reliable but for most cases it should be fine.
Additional work-arounds may be needed by the user such as executig their own sleep foreground process.
Kevin Day [Thu, 9 Mar 2023 02:31:39 +0000 (20:31 -0600)]
Bugfix: Multiple cancellations may occur, use mutex lock to prevent.
There is an existing check that prevents the cancellation from being called more than once.
What is not being considered is that if the main thread calls cancellation while another cancellation is active then the controller_thread_process_exit() gets called.
The controller_thread_process_exit() function will begin more forcibly shutting things down.
Avoid this by providing a mutex lock to lock the cancellation.
Only once the first cancellation is complete will the second (or more) then return without doing anything.
This clarification paved the way for a solution to the bug where lines with unterminated quotes are not getting anything at all.
By "favoring the typo", the rest of the line is preserved and is able to be printed.
Kevin Day [Mon, 6 Mar 2023 03:48:22 +0000 (21:48 -0600)]
Update: Further clarify quoting in FSS specifications.
I looked at the code and realized I should instead favor the "typo" behavior.
Process until the end of the line rather than break up the Object due to the quotes.
This means if the quote is unterminated then the rest of the line is considerd the Object.
Also document where Content utilizes the same rules.
Example Object and Content pair following FSS-0001:
Object "Content".
The Content would be "Content".
This behavior effectively preserves the period and also retains the quotes.
Another example (FSS-0001):
"Object 1" "Content 1" Content2 and_3
"Object 2": Content.
This second row shows the "typo" is favored concept.
The second row has no Content and instead has the following as the "Object: Object 2": Content.
Note how the quotes are kept when this situation happens.
I also updated the word "newline", replacing it with the words "new" and "line".
I noticed and fixed a mistake in the logic due to this refactor and a similar previous refactor.
Kevin Day [Mon, 6 Mar 2023 01:44:35 +0000 (19:44 -0600)]
Update: Clarify FSS specifications in regards to quote behavior.
I noticed a problem where something that is quoted with an immediate character after it does not get processed.
Example Object and Content pair following FSS-0001:
Object "Content".
In the above example, notice how there is a period after the quotes.
Also notice how the content has no spaces.
The current behavior would treat the "Content". as invalid.
I reviewed the specifications and found them lacking in regards to this dilemma.
I updated the specification to clarify the behavior.
With this change the FSS read functions will need to be updated.
Another example (FSS-0001):
"Object 1" "Content 1" Content2 and_3
"Object 2": Content.
In the above example for an FSS-001, the first row is straight-forward.
The second row is a problem.
Because there is non-white space after the quote, this cannot be treated as a quoted Object.
The behavior would then be to treat this as not quoted.
This means for row two, the object name is: "Object
The first Content is 2":
The second Content is Content.
Kevin Day [Mon, 6 Mar 2023 01:18:01 +0000 (19:18 -0600)]
Feature: Implement wrap support for IKI standard to be compliant with recent changes.
The wrap support for IKI (using open and close brackets '[' (U+005B) ']' (U+005D)) has been recently added to the specification.
This updates the project to be in compliance.
Kevin Day [Sun, 5 Mar 2023 03:52:34 +0000 (21:52 -0600)]
Progress: Continue program work, wrapping up side-track work and diving back into fake.
Update projects to have a print directory in a similar manner as a common directory.
The previously completed and working programs should now be working again.
The side-track changes that I set out to complete in regards to them is now complete.
There is a huge amount of work ahead in regards to Featureless Make.
Continue forward step by step.
Kevin Day [Sat, 4 Mar 2023 06:12:11 +0000 (00:12 -0600)]
Progress: Continue program related work, focusing on
The interrupt function behavior changed and the ampersand should not be passed now.
This is causing a double reference bug.
Explicitly allocate a small amount of memory for console parameters for the default allocation step.
Rename fll_program_standard_signal_state() to fll_program_standard_signal_handle().
Update fll_program_standard_signal_handle() to follow the new handle structure.
Reduce the first and last line functions and function calls.
I've decided to make some more initial assumptions to simplify the code.
Always print the first and last line to message.
This is a behavioral change.
I do not think the first and last line should be printed to error anymore.
This change simplifies the logic significantly.
Add the first printed check flag.
Update print functions.
Update file structure.
Update file documentation comments.
The iki_read and fss_write have more work to do.
Once that is done I need to resume working on Featureless Make.
Kevin Day [Thu, 2 Mar 2023 04:08:50 +0000 (22:08 -0600)]
Feature: The IKI standard now supports bracket wrapping.
I wanted to avoid this and keep IKI as simple as possible.
My recent uses have shown that I must have some sort of word-separator support.
This is the simplest implementation that I can think of at this time.
The brackets do not get escaped, instead the IKI gets escaped.
If there is no closing brracket in the correct spot, then the first bracket is not part of the variable.
The brackets other than the opening at the front and the closing bracket at the end are allowed.
The vocabulary name never includes the open and close bracket.
The following shows the heart of the problem this feature solves:
Consider:
- helloworld:"earth".
What if "world" is the variable name and hello is not supposed to be space separated?
With this featre, now the following is possible:
- hello[world]:"earth"
Note that the following are not valid (that is to say these are not IKI variables):
- hello[world:"earth"
- heloworld]:"earth"
- hello[[world]]:"earth"
Kevin Day [Wed, 1 Mar 2023 06:11:18 +0000 (00:11 -0600)]
Progress: Massive, but incomplete, refactor while originally focusing on Featureless Make.
Working on Featureless Make led to a need to refactor the directory recursion logic.
This led to me finally getting around to what I knew that I would eventually do.
Move the status returns into the state variable and use void returns.
I have had and continue to have mixed feelings about this.
This should, overall, be better long term for allowing more flexibility and fine-tuned control outside the project.
The switch to void returns when having a state variable is done to reduce complexity and confusion over which "status" variable is the correct one.
I would not that I also decided to move the "status" variable onto the state.
I was originally very undecided whether I should do this and had previously opted to keep the "status" and "state" separate.
Making more complicated projects has proven to me that it will be more maintainable just putting the status in the state.
These changes have a cascading effect on most of the project and its programs.
I got most of the projects done but I did not get around to fixing/updating the programs.
As always, with changes this big, look out for regressions and stupid simple mistakes.
The unit tests, once updated, will help find these problems.
The FSS and IKI processing code, however, need more unit tests to better catch problems.
These changes result in having the interrupt handler made more readily available.
Follow up changes will be needed to add more interrupt checks where long running or variable length loops are used.
The passing of "state" also reduces the number of times "f_state_t status" is needed and should reduce memory footprint to some degree.
This has a runtime costs where now in all of these cases a pointer must be resolved to get to the status.
This is to be treated as the cost of the newly provided flexibility.
There are some related file structure changes.
The recursion code has had a lot of redundancy removed.
I did not have a chance to properly review the code.
Manual testing on directory recursion operations like clone and copy will need to be performed.
Kevin Day [Wed, 22 Feb 2023 23:59:01 +0000 (17:59 -0600)]
Bugfix: Control group function is partially outdated and uses incorrect integer.
The F_control_group_path_system_default_s_length should not be used here when progressing the path string.
Use control_group.groups.array[i].used instead.