Kevin Day [Thu, 5 Nov 2020 02:22:19 +0000 (20:22 -0600)]
Update: Re-create Init program with barebones source structure.
The Init program will instead be developed as an init-only program.
The goal will be to not implement any service management.
This means that another progrram will be written for that purpose (which will be called something like "control" and/or "controller").
Kevin Day [Thu, 5 Nov 2020 02:05:07 +0000 (20:05 -0600)]
Bugfix: color print is bleeding into GCC messages.
When GCC has an error or warning, the print messages end up discolored.
This seems to be an artifact of how streams work and the newline.
Move all final newlines out of the color context printing and print the newlines in a separate command.
This appears to avoid the mentioned problem.
Kevin Day [Wed, 4 Nov 2020 06:32:04 +0000 (00:32 -0600)]
Bugfix: Fake building monolithic FLL is not compiling due to header directory structure problems.
The header directory structure is being preserved by the bootstrap.sh but not by Fake.
Introduce a new setting, 'path_headers_preserve' as a yes/no boolean.
This designates that the path for headers should be preserved or not.
In the case of the monolithic build, path_headers_preserve must be 'yes'.
Provide a new function fl_directory_create() to make it easy to create an entire directory tree.
Fake is now aware of this new 'path_headers_preserve', setting.
When supplied, it will make sure to preserve the directory tree, such as 'level_0/' in the monolithic build header file 'level_0/color.h'.
Both Fake and the bootstrap script should now behave the same in this respect.
The changes in this commit have been quickly thrown together.
This will need additional reviewing.
The NULL terminating character is not appended after each new header name.
This resulted in garbled header names due to existing content in the buffer.
Kevin Day [Wed, 4 Nov 2020 02:17:28 +0000 (20:17 -0600)]
Cleanup: default to monolithic build.
For simplicity purposes, I am just building and releasing the monolothic build of FLL.
It makes more sense to me then to change the default to use this monolithic build.
Kevin Day [Tue, 3 Nov 2020 05:40:16 +0000 (23:40 -0600)]
Bugfix: contents_delimits is supposed to be optional.
I probably accidentally "fixed" this thinking the parameter was not being checked by accident.
In reality, the parameter shouldn't be checked if the pointer is NULL because it is supposed to be optional.
This resulted in the fake program from not working as of release 0.5.1.
Kevin Day [Sat, 31 Oct 2020 02:32:19 +0000 (21:32 -0500)]
Bugfix: dependency generation is incorrect.
The recent rewrite of the dependencies resulted in the higher level files being after the lower level files.
Normally this is not a problem, but when it comes to compiling static programs depending on this, the linking fails.
This becomes more confusing in that, in my case the GNU Linker, says that functions do not exist when you can see that they, in fact, do exist.
By changing the order, with the higher levels before the lower levels, static compilation works without any such issues.
Kevin Day [Sat, 31 Oct 2020 01:01:49 +0000 (20:01 -0500)]
Update: FSS Extended List should now support multiple depth parameters.
Recursively parses the parameters determining what data should or should not be processed.
For example, take the following file "example.fss":
a {
a.0 {
a.0.0 {
a's final content.
}
}
}
b {
b.0 {
b's first final content.
}
b.1 {
b's second final content.
}
}
TO only display "b's first final content.", the following is done:
fss_extended_list_read example.fss -n 'b ' -d 1 -a 0
Which works by at depth 0, looks for the list name 'b ', then at depth 1, looks at position 0.
The --at and --name parameters are using the wrong variable in their logic (using 'j' when it should be 'i').
This resulted in an incorrect parsing of the parameters.
Kevin Day [Wed, 28 Oct 2020 23:16:50 +0000 (18:16 -0500)]
Update: redesign Extended List Read --at, --depth, and --name parameter handling.
Make the program aware of the order in which these are applied.
Such that, for example:
--at 0 --name 'my_list' would first select list index 0 and then try to match the list name against 'my_list'.
Whereas, for example:
--name 'my_list' --at 0 would try to match the list name against 'my_list', and then from that matching result set, select index 0.
This supports the ability to also do the following:
--depth 0 --at 0 --depth 1 --at 2
Such that this will traverse, at depth 0, the list at index 0 then within that result, at depth 1, get the list at index 2.
This however, while supported, is not currently implemented with this commit.
A commit will follow to ideally focus exclusively on this behavior.
These changes in design also conveniently resulted in smaller (and hopefully simpler) code.
Kevin Day [Wed, 28 Oct 2020 23:14:18 +0000 (18:14 -0500)]
Bugfix: trinned string compare functions incorrectly match different strings.
This is happening due to an accidental treatment of the 'last' positions as exclusive stops instead of as inclusive stops.
When they are setup, they are set as the last valid character before whitespace at the end.
Change the logic to make last1 and last2 inclusive stop positions.
Kevin Day [Mon, 26 Oct 2020 00:18:41 +0000 (19:18 -0500)]
Update: Better handle comments in FSS and fix problems.
Comments may exist inside of an FSS Basic List and FSS Extended List.
Handle the comments.
The FSS Basic List Read and FSS Extended List read both need to print the ignore character around content in pipe mode.
The FSS Extended List needs to specifically not do this for individual nested objects.
Fix problems in the FSS Basic List read content handling when an object is found such that content is empty.
Clean up some of the code, doing some basic code simplification.
The FSS Basic List Read should always return a range and should not exclusively end always at an EOL.
Fix a case where not enough memory is allocated for delimits in FSS Basic List.
Kevin Day [Sun, 25 Oct 2020 00:26:53 +0000 (19:26 -0500)]
Update: todo.txt.
I noticed that I haven't looked at this in a while.
These changes are just at glance, this todo needs to be cleaned out and refreshed more.
But that is for another time.
Kevin Day [Sat, 24 Oct 2020 16:55:14 +0000 (11:55 -0500)]
Feature: add suppot for specifying delimits via -D/--delimit to FSS read programs.
The -D/--delimit parameter accepts multiple types of values:
- "all": apply all delimits.
- "none": do not apply delimits.
- 1: apply limits at depth 1 (this can be any supported whole number and not just 1).
- 1-: apply limits at depth 1 or lesser (this can be any supported whole number and not just 1).
- 1+: apply limits at depth 1 or greater (this can be any supported whole number and not just 1).
The appropriate FSS functions need to be updated to not auto-apply delimits.
Instead, these now pass the delimits array back to the caller.
The FSS Extended List Read program delimits support is currently incomplete.
- A considerable amount of changes are needed to adequately support this.
- A follow up commit will address this issue.
Kevin Day [Sat, 24 Oct 2020 13:36:54 +0000 (08:36 -0500)]
Feature: provide string "except" functions.
The FSS Read functions utilize matching and printing on potentially delimited data.
If the delimits are not applied, then the matches and prints will be incorrect.
To avoid this, it seems that I need some way to not print the delimited data.
Provide "except" functions that accept and "except" array of strings representing locations within some string that are to be ignored.
The printing functions and comparison functions now have "except" equivalents.
The level_1 fl_print project appears outdated and needed updating anyway.
Restructure this project to use the private function practice, hopefully reducing the code size (and ideally binary size).
The "_string" part can be removed from the fl_print function names.
The parameter checks are loosened and now more closely match the approaches used in level_0 f_print.
Kevin Day [Fri, 23 Oct 2020 03:05:17 +0000 (22:05 -0500)]
Update: level_0 print functions.
Relax the parameter checks and have them return F_data_not when length is 0 or string is unavailable.
- Based on existing documentation, it seems this behavior was intended at some point anyway.
- The range is capped to buffer.used now.
The f_print_to* functions are rewritten to print as much of the string in as few calls to write() as possible.
- It is likely possible to utilize more complicated logic to further reduce the calls to write() but this is good enough for now.
- Reducing the calls to write(), in theory, should improve performance.
Add checks to f_print_to* functions to do nothing if the id is -1 (aka: an invalid/closed file descriptor).
Add *_except* print functions to print all characters except those specified in the "except" variable as well as not printing NULLs.
Kevin Day [Fri, 23 Oct 2020 01:28:41 +0000 (20:28 -0500)]
Bugfix: consistently use the data.output file for standard output printing.
There are still places that need to be converted from f_type_output and printf() to use this data.output file.
With this change, the data.output will be used and can more readily be updated to point to some file other than standard output.
The fss_*_read programs are not updated with this commit due to having additional changes.
These changes will also be applied to those programs in another commit.
It seems that I forgot to check the other programs and update them to work with the new delimit handling behavior in the appropriate FSS processing functions.
Kevin Day [Tue, 20 Oct 2020 04:55:53 +0000 (23:55 -0500)]
Update: FSS should allow caller to determine when to apply delimits.
Instead of automatically applying the delimits, pass the delimits to the caller.
Let the caller decide when or when not to apply the delimits.
Provide functions to help in this regard.
The FSS read programs will need a new parameter to allow for designating to or not to apply delimits.
This is particularly complex when it comes to FSS-0003 (Extended List) due to the nesting.
This change gave me the opportunity to review the FSS read functions, to a certain extent.
Code cleanup changes are included in this commit.
Also add status codes: F_rrange, F_range_not, and F_utf_not.
Kevin Day [Fri, 16 Oct 2020 01:58:13 +0000 (20:58 -0500)]
Update: provide f_string_lengthss_t and f_string_quantityss_t.
Ensure that array of an array typedefs exist for:
- f_string_length_t
- f_string_quantity_t
The following already exist:
- f_string_range_t
There are some additional structures that this should also have an array of an array for:
- f_string_static_t
- f_string_dynamic_t
- f_string_map_t
- f_string_map_multi_t
But they are more complicated so I will get to them later.
Kevin Day [Thu, 15 Oct 2020 04:29:21 +0000 (23:29 -0500)]
Bugfix: trimming in FSS extended write does not always work.
A boolean is used to designate when the Object has no space at the end.
If this boolean is FALSE, then a space is added before the '{'.
The problem is that the addition of this space happens after trimming.
If trimming is performed, just lie and set the boolean to TRUE to prevent the addition of an (unwanted) space.
Kevin Day [Thu, 15 Oct 2020 02:44:20 +0000 (21:44 -0500)]
Progress: FSS read and write programs.
Use \b (backspace character) instead of \0 (NULL character).
- The bash programs and functions like "echo" automatically strip NULL characters.
- This defeats the purpose of providing these functions for manipulating FSS files using these programs.
Add an ignore range list.
- The pipes represent the start and stop of an ignore range using the \v (vertical tab character).
- Only the FSS-0003 (Extended List) utilize the ignore range.
- This ignore range list provides a simple way to manage nested lists without having to write complex recursive parsers.
- For consistency, all FSS write programs utilize the -I/--ignore parameter, but for the standards that do not support ignore range lists then that parameter is essentially ignored.
- The ignore lists only applies to Content.
Fix bug in the fll_error where the wrong variable is being used (should be printing a newline).
Kevin Day [Wed, 14 Oct 2020 03:53:47 +0000 (22:53 -0500)]
Progress: FSS basic list and extended list.
Move some common and repeated code into private functions.
Be sure to allow and handle whitespace after a valid object close that is being delimited within content.
Begin adding support for nested in the extended list content write.
- The idea here is to have a whitelist of ranges to ignore.
- This offloads the possible complex logic to a higher level.
The basic and extended list level 2 write functions should both accept a single content instead of an array of content.
Rename the fss write functions, appending _string.
- These functions accept a string instead of an appropriate object/content structure.
- I will need to write the functions that accept the appropriate object/content structures to perform the same tasks.
Make the prepend a constant pointer to make it easier to not specify it (no variable needs to be defined, just pass 0).
Kevin Day [Tue, 13 Oct 2020 22:55:04 +0000 (17:55 -0500)]
Feature: add support for trimming FSS Object names for FSS write operations.
I believe it is important for the command line tools to easily cleanup object names in case spaces aren't desired.
This provides the functionality to ensure trimming of spaces before and after the object name.
This further allows for preventing the cleanup behavior done in object writes, such as in FSS-0003 (Extended List) where it is cleaner to have a space between the object name and the brace '{'.
If this is undesired, the function can then be configured to not do this.
This further makes the FSS write functions more consistent with the FSS read functions where object name trimming is already supported.
Kevin Day [Tue, 13 Oct 2020 01:07:50 +0000 (20:07 -0500)]
Progress: FSS write programs.
Add prepend functionality to all write programs.
- for FSS-0000 (Basic) and FSS-0001 (Extended), this does nothing.
- for FSS-0002 (Basic List) and FSS-0003 (Extended List), this prepends the start of multi-line content with some whitespace.
Begin working on the FSS-0003 (Extended List) write functions and programs.
- At this time, the extended list write is only implemented partially.
- I will focus on the recursive aspects later.
Add the "complete" processing to the basic list content (and now extended list content) write functions.
- Includes updates to the newline handling as appropriate.
Kevin Day [Mon, 12 Oct 2020 03:46:06 +0000 (22:46 -0500)]
Update: basic list fixes and cleanups, including some other cleanups.
The EOL handling in FSS Basic List is incorrect/incomplete.
Slashes at the end of an Object must be delimited to avoid escaping the object close character.
Be sure to return an error when a newline is provided in an Object name on basic list object write.
The standard states that controlling character, such as a basic list open, must use ASCII character codes for simplicity and safety.
Therefore, a UTF-8 buffer increment is not necessary.
Use the simpler, more performant C math operator increment.
Cleanup coding strategy in basic list content write to be more consistent with more recent approaches.
Cleanup some comments.
Also cleanup incorrect loop comment in fss_basic.c.
Kevin Day [Fri, 9 Oct 2020 02:59:36 +0000 (21:59 -0500)]
Progress: basic list write, with minor basic list read and extended list read changes.
The basic list object write should only handle escaping slashes when it would be escaped.
Make sure to return an error when a newline is found.
Note that the stop point designates the end of the object so if the end of the object ends in slashes, then these must be escaped.
Perform some cleanups that I felt like doing while working on this.
Kevin Day [Fri, 9 Oct 2020 00:28:11 +0000 (19:28 -0500)]
Cleanup: fix help parameter spacing and add additional information.
The basic list standard does not support quotes.
Leave the quote parameters for consistency between the write programs, but add a note to the help explaining this.
Kevin Day [Thu, 8 Oct 2020 05:05:58 +0000 (00:05 -0500)]
Bugfix: FSS basic list read newline handling needs improvement.
The last newline is not being preserved in the content read.
The *_print_set_* functions end up printing an extra newline.
This behavior is inconsistent and invalid.
Instead, preserve the newlines, which are valid parts of the content.
Then, do not print newlines via *_print_set_*.
The empty list needs to have at least one newline when -e/--empty is passed.
Kevin Day [Wed, 7 Oct 2020 04:11:16 +0000 (23:11 -0500)]
Progress: continue working on FSS read/write programs and related.
Get comment delimitation working in FSS read/write functions.
- Comments are now escaped on read/write as appropriate.
- Rename appropriate private fl_fss functions.
- Add object_as boolean to designate whether or not this function is meant to read an object or content.
- This ends up fixing a bug in the fl_fss_extended read function where a comment character before a content is incorrectly treated as an actual comment (this behavior is not allowed).
- Add similar behavior to the write functions.
- The basic list and especially the extended list may not be complete in this regard.
Do some cleanup in the fss read programs that is related to the changes in this commit.
- There is still room for cleanups but that is not my focus at this time.
Add a -p/--pipe parameter to the FSS read functions to provide a way of returning data in the pipe-friendly format used by the FSS write programs.
Kevin Day [Tue, 6 Oct 2020 04:22:11 +0000 (23:22 -0500)]
Progress: fss write functions and programs.
I reviewed, fixed, and cleaned up the write functions.
I have only partially gotten to the basic list and have not so much as glanced at the extended list.
These two I will start working on later.
Several bugs and problems have been identified and resolved.
Add back the UTF-8 processing.
- This time check the width and add each 8-byte sequence until width is reached to correctly process the UTF-8 character.
Kevin Day [Mon, 5 Oct 2020 02:13:20 +0000 (21:13 -0500)]
Progress: fss write programs and related, including console changes.
Finish updating the fss write programs.
I will sleep on this and then review them later to look for mistakes, oversights, bugs, inconsistencies, and possible cleanups.
Improve the console parameter handling functionality.
The sub-locations need to also have their locations stored.
Cleanup the struct stat file_stat name, renaming it to stat_file for more consistency.
Remove some memsets(), these might be better left to higher level operations.
Assuming I do not change my mind on this later.
Use the word "amount" instead of "length" when the increase/decrease is not the whole length but a fraction.
Reorganize some string functions parameters to be more consistent with the current design practices.
Kevin Day [Sat, 3 Oct 2020 21:43:32 +0000 (16:43 -0500)]
Feature: add -c/--content parameter to FSS read programs.
The default behavior is already a -c/--content.
This provides a literal parameter for good practice and better hackability.
This introduces a new possibility where both -o/--object and -c/--content are specified at the same time.
In this case, print both the object and the content.
It must be noted, however, that this only prints the escaped object and content, just like when -o/--object or -c/--content do already.
The objects in the basic read and extended read are printed with a space between them and their respective content.
The objects in the basic list read and extended list read are printed with an EOL ('\n') between them and their respective content.
Kevin Day [Sat, 3 Oct 2020 03:32:10 +0000 (22:32 -0500)]
Progress: FSS related changes and improvements to console related.
Finish/Fix the basic object write private function.
It seems that I was so hasty to get this wrapped up last night that I missed quite a lot of conditions/cases and logic.
I discovered a case where the FSS basic read function might b incorrect: '"\\"\\\"'.
If the parts inside the single quotes are used as an object, then it should detect that there is no closing quote.
The basic read is not yet fixed, but the basic write should not produce this invalid object.
Minor tweaks to f_console and related console functions.
The f_true and f_false are still being used in the console initialization and should no longer be.
There are some has_additional settings that are set incorrectly.
The console parameter locations and similar should be array locations and not string locations.
Kevin Day [Fri, 2 Oct 2020 04:40:23 +0000 (23:40 -0500)]
Progress: FSS development and other changes.
Work on the FSS Basic and FSS Extended write functions, changing the design strategy.
The FSS Extended Write program needs additional consideration for how to handle multiple content (which may entail changing the logic of FSS Basic Write accordingly as well).
The Basic List and Extended List are currently not worked on but will be.
Use "quote" instead of "quoted".
After review, this makes more sense to me overall.
Fixes of other observed issues, such as missing "_t" in some macros.
Update the FSS documentation, focusing on the FSS Basic and possibly FSS Extended.
Kevin Day [Tue, 29 Sep 2020 02:42:02 +0000 (21:42 -0500)]
Progress: fss write programs synchronize.
Work on making the fss write programs function more similar to how the iki_write program functions.
There needs to be more work done in the fss_basic_list write at level_1, but that is being left to be worked on for another commit.
Looking at the code once again reminds me that the FSS read and write code needs to be reviewed in more depth, but I am going to put that off for now.
The stream read and write functions should also be implemented.
This is just an off the top of my mind implementation and may need to be reviewed at a later date.
Change the existing f_file functions to re-use the existing string structure to avoid the more wasteful memset and memcopy from the static array.
This design now, instead, has a cost of potentially allocating more memory than needed at the size specified by file.size_read.
Continue the print changes.
There is going to need to be work done in regards to how I am reading opening and reading streams.
I started to do this in private-fake.c but then noticed some things that needed review, such as the path.current and path.top.
Kevin Day [Sat, 26 Sep 2020 21:14:52 +0000 (16:14 -0500)]
Security: Incorrect size increase in private_fll_iki_content_partial_escape().
The size increase test is "escaped->used + delimits + 2", but actual arguments passed to the increase function is "delimits".
The "+2" is missing.
This gets caught by the parameter checker when delimits is 0.
When delimits is, say 1, then an insufficient amount of memory is increased.
This will likely result in a segfault.
Kevin Day [Sat, 26 Sep 2020 05:24:14 +0000 (00:24 -0500)]
Progress: wrap up most of the print changes.
This appears to get most of the changes in regards to printing.
There will need to be some testing and reviewing to double check for any mistakes.
(With such a massive set of changes, minor/subtle mistakes are likely.)
I will resume my work on updating and getting the fss write functions to be more like the iki_write in some of the design practices (in terms of program operations, parameter usages, etc..) where applicable.
Kevin Day [Sat, 26 Sep 2020 02:41:52 +0000 (21:41 -0500)]
Update: bzip2 fakefile.
Make sure the bzdiff and bzgrep scripts are copied into the build/ directory.
Redesign the fakefile to be an example of how to use the "operate" section operation.
Kevin Day [Thu, 24 Sep 2020 04:30:16 +0000 (23:30 -0500)]
Progress: print function changes.
After getting byte_dump switched to file descriptors and testing it, I discovered that the unbuffered write has massive performance issues over the buffer writer that is a file stream.
Do some back pedalling and then go down a different route.
Add functions for managing file streams.
Make it possible to have both the descriptor and the stream to give more control at the higher level on when to decide which to use.
There is still much more cleanup, back-pedalling, as well as redesigning the code to (now) use fprintf() over printf() and similar.
Kevin Day [Wed, 23 Sep 2020 04:53:50 +0000 (23:53 -0500)]
Progress: begin overhauling the printing infrastructure.
As part of making the level_3 projects (aka programs) more consistent, I started centralizing the print functions.
This started with status/error handling.
Then one thing led to the next and I ended up deciding to change the behavior to use file descriptors more consistently everywhere in the FLL project.
I also decided to go with the error print structure I original created in the fake program.
Verbosity has been moved into this structure.
The new level_2 project "fll_error" will store the error messages that are shared between the level_3 projects.
Given the size of these changes, I didn't complete the work.
This commit is guaranteed to not compile.
Kevin Day [Mon, 21 Sep 2020 05:19:07 +0000 (00:19 -0500)]
Progress: start getting FSS, as well as other programs, more consistent.
I ended up liking how I made iki_write better than how I made the fss write functions.
Work began to make these more similar and consistent and I stumbled on some other things that need to be centralized.
This would be the verbosity options and parameter decision making.
This includes related changes.
I also noticed that I started working on the "++status" parameter idea but left it very incomplete.
This formalizes the basic plan where I will instead have a "++status_in" and a "++status_out".
This should be very useful for having programs return status codes as well as read those via environment variables given than the status code the Linux code uses reserves the higher order bits for process signals.
It would be too risky and likely buggy to mix my internal status code system with the standard Linux signal/error status code design.
A sting can be read very easily in an environment variable and converted to the appropriate uint16_t digit.
The work in regards to making FSS and other programs more consistent is incompletely and will likely result in uncompilable code with this commit.
Kevin Day [Mon, 21 Sep 2020 02:45:32 +0000 (21:45 -0500)]
Update: move the, now standard, verbosity modes into the f_console project.
The f_console project already provides the parameters matching these modes.
This makes me think that this is the best place to relocate the verbosity modes.
Kevin Day [Mon, 21 Sep 2020 00:55:01 +0000 (19:55 -0500)]
Cleanup: used !x instead of x == 0.
This is a better practice.
While a compiler nowadays might optimize x == 0, it is better practice to use !x to represent the logic and reasoning.
One should always be aware of simple performance optimizations and practices, even if it might just be compiled away, if the readability is not too difficult.
Kevin Day [Sun, 20 Sep 2020 23:40:05 +0000 (18:40 -0500)]
Cleanup: header files structure, *-common.h, and use underscores.
Start using the *-common.h practice to move macro definitions out of header files with function declarations.
The *-common.h files are akin to private-* files in that they are special use or special purpose.
Therefore, the "-" is used.
In all other cases, underscores "_" should be used.
Fix files where dashes "-" were incorrectly used, replacing them with underscores "_".
Kevin Day [Sat, 19 Sep 2020 22:22:49 +0000 (17:22 -0500)]
Bugfix: incorrect macro implementations.
There are some cases where the wrong macro is being used.
The init program needs to be updated to use the "_macro__i" instead of "i" for safety reasons.
Kevin Day [Sat, 19 Sep 2020 22:06:43 +0000 (17:06 -0500)]
Refactor: color management system.
Change the behavior so that fewer arguments are needed for color printing.
This introduces a structure where the color codes are now in sets of "before" and "after".
This set of two color codes are now passed to the color print functions, thereby reducing the number of arguments needed.
Kevin Day [Sat, 19 Sep 2020 04:28:20 +0000 (23:28 -0500)]
Cleanup: add -fdiagnostics-color=always to GCC flags in build settings files.
This forces colors to be enabled.
GCC thinks colors should be disabled when Featureless Make runs it in a shell.
By setting this, the color is forced enabled and error messages become more readable.
Kevin Day [Sat, 19 Sep 2020 03:20:27 +0000 (22:20 -0500)]
Cleanup: add -c/--content for consistency to iki_read.
The -c/--content is the default behavior.
This adds a literal parameter to reflect this.
No new functionality is added other than validation on the -c/--content parameter.
Kevin Day [Sat, 19 Sep 2020 00:37:12 +0000 (19:37 -0500)]
Update: f_file, f_fss, fl_fss, fl_utf, level_3.
f_file:
- Fix some function ordering.
- Do not use "0" to represent closed files, instead use "-1".
- "0" is used for standard input, which treating this as file closed prevents piped data from being read.
f_fss:
- The f_string_range_t should have _t in its macros.
- Updating all related code.
fl_string:
- Fix some function ordering.
- Add fl_string_dynamic_sink_line().
- Rewrite function parameter ordering to have constants on the left and editable pointers on the right.
- While I also like the logical flow of the previous behavior, during my development the practice of separating first by constants and then editable pointers won out.
- Updating all related code.
fl_utf:
- Rewrite function parameter ordering to have constants on the left and editable pointers on the right.
- While I also like the logical flow of the previous behavior, during my development the practice of separating first by constants and then editable pointers won out.
- Updating all related code.
level_3:
- Make f_console_parameter_ids_t and f_console_parameters_t constants, where possible.
More of the project will need reviewing of function parameter ordering.
Kevin Day [Tue, 15 Sep 2020 01:05:03 +0000 (20:05 -0500)]
Update: use *_size_increase() functions, improve logic, and return F_string_too_large.
Use the *_size_increase() functions more.
Anything declared inside of a loop is destroyed at the end of the loop and created at the beginning.
This is an easily avoidable performance concern.
When the max size is reached but allocation is still possible (but at a smaller than requested length) return F_string_too_large without the error bit set.
This is useful for when only 1 unit is needed but the resize is say 4.
In the cases where the resize must exactly match the given length, then treat F_string_too_large without the error bit as if it does have an error bit.