]> Kevux Git Server - fll/log
fll
4 years agoUpdate: file and directory improvements, finish writing directory copy
Kevin Day [Wed, 27 May 2020 04:45:31 +0000 (23:45 -0500)]
Update: file and directory improvements, finish writing directory copy

Organize directory header structure, adding directory_type.h.
Add additional directory structures.
Directory copy needs to report what fails, so provide a structure for reporting each failure.
(There needs to be a verbose function for printing success/failure.)

Remove de-reference from numerous file functions.
POSIX denies certain operations of symlinks.
During copy operations, do not apply mode to symlink as it would now apply mode changes to the de-referenced link.
Allow block size to use default block size if set to 0 (convenience).
Add missing return statement to file copy (without it socket file types would incorrectly report F_unsupported).
Add link read functions so that symlink information may be obtained so that it can then be copied.
Add comments about poorly written umask() as per POSIX standard (at least according to manpages).

Other minor fixes and cleanups.

4 years agoFeature: add push and pop directory functions
Kevin Day [Mon, 25 May 2020 04:02:22 +0000 (23:02 -0500)]
Feature: add push and pop directory functions

These functions should help make appending interactive or user-data for directory path building easier.

4 years agoCleanup: remove unused header
Kevin Day [Mon, 25 May 2020 04:01:53 +0000 (23:01 -0500)]
Cleanup: remove unused header

4 years agoUpdate: minor improvements, finish f_file_copy(), add fifo file type
Kevin Day [Sun, 24 May 2020 03:54:53 +0000 (22:54 -0500)]
Update: minor improvements, finish f_file_copy(), add fifo file type

Finish implementing the f_file_copy(), adding support for all file types (except unknown).

The documentation for block, character, and FIFO is unclear to me at this time and my attempts to copy using mknod(2) is an educated guess.
Attempt to prevent file type from being passed via the mode_t when doing a copy (currently untested).

Add the appropriate file create functions to implement the copy operations.
Have the copy file copy only the directory itself and not the contents (to copy contents, the fl_directory_copy() function should be used).

The added fifo type is pretty much the same as pipe.
Mixing fifo with pipe terminology ended up being confusing so I opted to create redundant FIFO types to simplify the readability.

Use the word "regular" for a regular file instead of "file".
Using "regular" is a less confusing than using "file" (i.e. Regular File Type vs File File Type).

4 years agoCleanup: Replace F_file_open_not with F_file_closed, add additional status codes...
Kevin Day [Sat, 23 May 2020 20:46:19 +0000 (15:46 -0500)]
Cleanup: Replace F_file_open_not with F_file_closed, add additional status codes for consistencies

Socket was not fully converted into basic status codes (not having connect).
I can see future work in sockets whee I may actually add connect codes back, but I won't know until I spend dedicate time on it.

Add additional status codes that should probably exist for consistency purposes.

With F_file_open_not removed, split behavior into two checks:
- F_file for file descriptor errors.
- F_file_closed for file not open errors.

4 years agoCleanup: update all status codes in line with recent refactor and fix issues
Kevin Day [Sat, 23 May 2020 20:13:59 +0000 (15:13 -0500)]
Cleanup: update all status codes in line with recent refactor and fix issues

This primarily puts all of the status code handling in alphabetic order.
The length sizes are updated accordingly.
Be consistent with S at the end of things, whereas S is not the traditional grammatical use but instead implies a set of.
Use the base F_* disable defines instead of using new ones for each level when they are specific to the F_* status codes.
Add additional comment documentation.

Any issues observed resulting from the refactor were also fixed during this change.

4 years agoRefactor: use capital F, FL, and FLL for status codes to avoid potential conflicts
Kevin Day [Sat, 23 May 2020 15:36:05 +0000 (10:36 -0500)]
Refactor: use capital F, FL, and FLL for status codes to avoid potential conflicts

By only using the first part, the annoyance of all uppercase can be avoided.
This then allows shortening the names and removing words like "_error".
Also restructure where the "_not" are placed (placing them immediately after what they apply to).

This will be followed up by a restructuring commit.

4 years agoUpdate: get the level_3 / programs working after major file / directory changes
Kevin Day [Sat, 23 May 2020 05:35:03 +0000 (00:35 -0500)]
Update: get the level_3 / programs working after major file / directory changes

This required making some fixes in the files related code.
This puts the UTF-8 file (utf_file) project notably behind an additional work is necessary to get that working correctly as well as having it be consistent with f_file.

I've decided that when written pointer is 0, then the caller is requesting to not get back the written size.
I am very likely going to do similar behavior with null pointers in other uses, which will help further simplify the design.

Other minor changes.
Of particular note is moving flags into the f_file structure.
This was effectively how the pre-file redesign worked, but it uses flags now instead of the "r", "rw", "a", etc.. string modes used by fopen.
Make sure an append flag is available.

4 years agoProgress: continue redesign of file and directoy structure
Kevin Day [Fri, 22 May 2020 02:42:18 +0000 (21:42 -0500)]
Progress: continue redesign of file and directoy structure

This gets the code in a state where I can focus on updating all of the programs (level_3 files).
The UTF-8 related types have @todo and @fixme as I intend to come back later and finish them.

4 years agoProgress: major redesigns with file and directory handling, this changeset is incomplete
Kevin Day [Thu, 21 May 2020 05:08:09 +0000 (00:08 -0500)]
Progress: major redesigns with file and directory handling, this changeset is incomplete

In the process of writing the directory copy, I realized I needed to improve the file and directory management.
This triggered me to rethink how I was handling files and directories to some extend.

If memory serves me correctly, the POSIX 2008 was either too new or non-existent when I first wrote some of this.
Updating to use the newer POSIX functionality and changes seems worth this major change.

Add additional file functionality.
Lots of re-organization and redesign.

I still haven't finished this and would rather commit now, with incomplete code randomly throughout, than risk losing any changes.
In particular, the fl_utf_file is where I need to resume.
I need to then update all of the level 3 programs to use the new file/directory handling code.
After that I need to finish writing the directory copy, which should include investigating and implementing file copy operations for more than regular files and symbolic links.
I also need to remember to investigate copying hard links as a hard link instead of as a duplicate file.

4 years agoUpdate: add additional file functions, fix bug with file stat in f_directory
Kevin Day [Mon, 18 May 2020 02:49:01 +0000 (21:49 -0500)]
Update: add additional file functions, fix bug with file stat in f_directory

Add additional f_file functions, move commonly shared code into private f_file files.

The f_directory functions were incorrectly using sizeof().

4 years agoProgress: featureless make
Kevin Day [Sun, 17 May 2020 23:05:50 +0000 (18:05 -0500)]
Progress: featureless make

Add and validate modes from the build settings files.
This provides some data integrity support.
If a mode is not defined in the modes property of the build settings, then that mode is not valid and the build process is stopped.

4 years agoBugfix: incorrect return status resulted in mistaken status handling
Kevin Day [Sun, 17 May 2020 23:04:52 +0000 (18:04 -0500)]
Bugfix: incorrect return status resulted in mistaken status handling

4 years agoProgress: featureless make
Kevin Day [Sun, 17 May 2020 17:05:59 +0000 (12:05 -0500)]
Progress: featureless make

Snatch apart the settings strings instead of mashing them together.
Process the environment build setting to enable selecting additional environment variable to expose to the process scripts.

4 years agoCleanup: fix build issues relating to build settings
Kevin Day [Sun, 17 May 2020 07:57:24 +0000 (02:57 -0500)]
Cleanup: fix build issues relating to build settings

Get the individual builds back in working order in regards to build configuration.

4 years agoUpdate: add path expode using normal order
Kevin Day [Sun, 17 May 2020 03:42:49 +0000 (22:42 -0500)]
Update: add path expode using normal order

Oops.

For reasons unknown to me, I seem to have written the path explode in reverse order.
The path is intended to be processed from left to right.

Rename the old functions appending _reverse to their name.

4 years agoProgress: featureless make
Kevin Day [Sun, 17 May 2020 03:06:16 +0000 (22:06 -0500)]
Progress: featureless make

4 years agoUpdate: numerous changes, most notably path and vfork to fork changes
Kevin Day [Sun, 17 May 2020 02:56:52 +0000 (21:56 -0500)]
Update: numerous changes, most notably path and vfork to fork changes

Replace vfork() calls with fork().
- I have determined that vfork() is not safe.
- When calling clearenv() inside a vfork() child process, the parent process' environment ends up getting cleared as well!
- The child can alter the parents memory according to manpages, so stop using vfork() entirely.

Add path processing functions and related defines.

Enable path processing to allow for execvpe()-like behavior can be implemented.
- The execvpe() function is not used because it is not POSIX.
- Manually process the PATH environment to determine what to execute, even when PATH enviornment gets cleared.

Some consistency improvements in defines, such as f_console_max_size to f_console_length_size.

Fix mistake in memcpy usage, dynamic strings use char * for their string so passing & is incorrect.

The f_file_exists() is using access().
- This is misleading and incorect.
- Use stat() to determine if file exists because it doesn't require access to the file (aside from directory access) to check existence.
- Add a new function f_file_access() as the old implementation of f_file_exists().

The fll_execute programs now support additional functions for clearing environment variables.
- This effectively sandboxes the environment variables before calling the program.

4 years agoProgress: featureless make
Kevin Day [Fri, 15 May 2020 02:54:59 +0000 (21:54 -0500)]
Progress: featureless make

In particular, defines file to skeleton build.

4 years agoCleanup: remove f_string_eos, use 0 instead
Kevin Day [Fri, 15 May 2020 02:52:28 +0000 (21:52 -0500)]
Cleanup: remove f_string_eos, use 0 instead

I originally created f_string_eos, so that it could be potentially changed.
In the case of basic strings, using 0 is simpler, more consistent, and safer.

4 years agoUpdate: add environment functions, add static strings, and other changes
Kevin Day [Fri, 15 May 2020 02:42:01 +0000 (21:42 -0500)]
Update: add environment functions, add static strings, and other changes

Add environment project and associated functions for managing environment variables.
Add execute functions for setting environment variables.
- More work is needed to search the PATH to perform fll_execute_program_environment when PATH is not to be defined.

Provide stub define build settings files for each project.

Miscellaneous minor fixes/tweaks.

4 years agoProgress: Featureless Make
Kevin Day [Thu, 14 May 2020 04:24:19 +0000 (23:24 -0500)]
Progress: Featureless Make

Implement skeleton operation.
Simplify parameters and enforce a more standard structure on 'build'.
The "make" operation with its "fakefile"s can be used for more flexible project structures (at least once it is written).

4 years agoUpdate: additional file functions, relocate function locations, add path separator...
Kevin Day [Thu, 14 May 2020 01:30:37 +0000 (20:30 -0500)]
Update: additional file functions, relocate function locations, add path separator length define

4 years agoProgress: Featureless Make
Kevin Day [Tue, 12 May 2020 03:16:44 +0000 (22:16 -0500)]
Progress: Featureless Make

4 years agoUpdate: add directory functions, file functions, and status codes
Kevin Day [Tue, 12 May 2020 03:15:02 +0000 (22:15 -0500)]
Update: add directory functions, file functions, and status codes

4 years agoUpdate: add path.h headerr
Kevin Day [Tue, 12 May 2020 03:14:20 +0000 (22:14 -0500)]
Update: add path.h headerr

4 years agoUpdate: finish the @todo in errno handling of recent directory additions
Kevin Day [Mon, 11 May 2020 01:58:19 +0000 (20:58 -0500)]
Update: finish the @todo in errno handling of recent directory additions

4 years agoProgress: further work in Featureless Make, implement cleanup operation
Kevin Day [Mon, 11 May 2020 01:16:59 +0000 (20:16 -0500)]
Progress: further work in Featureless Make, implement cleanup operation

4 years agoUpdate: new directory related functions, file function updates, status code updates...
Kevin Day [Mon, 11 May 2020 01:08:36 +0000 (20:08 -0500)]
Update: new directory related functions, file function updates, status code updates, directory level restructuring

Numerous updates to get the directory functionality better hashed out.
Some of the directory functionality is experimentally added.

4 years agoProgress: continue work on fake (Featureless Make)
Kevin Day [Sun, 10 May 2020 05:50:56 +0000 (00:50 -0500)]
Progress: continue work on fake (Featureless Make)

4 years agoUpdate: add boostrap.sh stub and add readme.txt document
Kevin Day [Sun, 10 May 2020 05:48:49 +0000 (00:48 -0500)]
Update: add boostrap.sh stub and add readme.txt document

4 years agoFeature: add f_utf_string_static as a non-allocated alternative to f_utf_string_dynamic
Kevin Day [Sun, 10 May 2020 05:47:04 +0000 (00:47 -0500)]
Feature: add f_utf_string_static as a non-allocated alternative to f_utf_string_dynamic

The is the UTF-8 string equivalent of the f_string_static type.

4 years agoFeature: Add string assure functions to assure a given string exists at the beginning...
Kevin Day [Sun, 10 May 2020 05:45:03 +0000 (00:45 -0500)]
Feature: Add string assure functions to assure a given string exists at the beginning or the end

This is particularly useful for assuring that a "/" exists and the end of generated path strings.

4 years agoRevert "Refactor: f_print_string_dynamic to f_print_string_static"
Kevin Day [Sun, 10 May 2020 03:12:10 +0000 (22:12 -0500)]
Revert "Refactor: f_print_string_dynamic to f_print_string_static"

This reverts commit f225f4059d0e082a7bfae29e042a2120ac4bda33.

It occurred to me that this would make the function names more inconsistent.
This could get very confusing so just stick with "dynamic" in all the names.
"dynamic" is the original term and "static" in isolation is a reserved word.

The type names will remain as both f_string_static and f_string_dynamic.
That inconsistency is desirable due to the explicit meaning communicated by their names.

4 years agoRefactor: f_print_string_dynamic to f_print_string_static
Kevin Day [Sat, 9 May 2020 23:17:54 +0000 (18:17 -0500)]
Refactor: f_print_string_dynamic to f_print_string_static

4 years agoRefactor: all constant dynamic strings can be safely changed to static string
Kevin Day [Sat, 9 May 2020 23:12:11 +0000 (18:12 -0500)]
Refactor: all constant dynamic strings can be safely changed to static string

This is just a mass regex change.
There may need to be function renaming and re-ordering at a later time.

4 years agoFeature: add f_string_static as a non-allocated alternative to f_string_dynamic
Kevin Day [Sat, 9 May 2020 22:26:41 +0000 (17:26 -0500)]
Feature: add f_string_static as a non-allocated alternative to f_string_dynamic

That is not to say that a dynamically allocated buffer cannot be placed in its string part.
Instead, it communicates that this is not never be allocated or deallocated directly.

This is implemented in such a way that f_string_dynamic is a sub-type of f_string_static.
This should allow for easy type conversions.

4 years agoProgress: pass coloor modes and verbosity to build pre-process and build post-process...
Kevin Day [Sat, 9 May 2020 21:47:40 +0000 (16:47 -0500)]
Progress: pass coloor modes and verbosity to build pre-process and build post-process scripts

4 years agoUpdate: improve color mode handling
Kevin Day [Sat, 9 May 2020 21:47:12 +0000 (16:47 -0500)]
Update: improve color mode handling

Improve handling of color mode so that applications can consistently react to the established color code.
In the fake program, this is useful for passing the color mode to the build pre-process and build post-process scripts.

4 years agoUpdate: explode parameter priotization into left & right, add quiet and verbose optio...
Kevin Day [Sat, 9 May 2020 19:22:04 +0000 (14:22 -0500)]
Update: explode parameter priotization into left & right, add quiet and verbose options, and minor code cleanup

The (right) parameter prioritization function should be expanded into a left-prioritization and a right-prioritaztion.

Make +q/++quiet and +V/++verbose standard options for verbose.

Add length defines for console standard defines.

Make sure the status return is handled.
There were a few cases where it was not being handled.

Minor code structure cleanups for structural issues I happened to observe.

4 years agoProgress: continue work on fake
Kevin Day [Sat, 9 May 2020 04:31:22 +0000 (23:31 -0500)]
Progress: continue work on fake

4 years agoUpdate: add snatch apart functions and improve logic of fss snatch functions
Kevin Day [Sat, 9 May 2020 04:28:31 +0000 (23:28 -0500)]
Update: add snatch apart functions and improve logic of fss snatch functions

The snatch apart is to create separate sets of strings instead of merging them.
The snatch mash apart will mash all dynamic strings for all content for a single object but use separate strings for each separate object.

I accidentally, or perhaps habitually, used break when return is better when handling errors.
Make sure to document f_string_max_size as a possible return result.

4 years agoRevert: f_array_too_large already existed, its just called f_buffer_too_large
Kevin Day [Sat, 9 May 2020 03:42:35 +0000 (22:42 -0500)]
Revert: f_array_too_large already existed, its just called f_buffer_too_large

4 years agoRefactor: f_string_location to f_string_range (and related)
Kevin Day [Sat, 9 May 2020 03:17:03 +0000 (22:17 -0500)]
Refactor: f_string_location to f_string_range (and related)

I am now favoring the term "range" over "location".

4 years agoCleanup: reword location to range
Kevin Day [Sat, 9 May 2020 01:26:45 +0000 (20:26 -0500)]
Cleanup: reword location to range

The word 'range' seems more appropriate than 'location'.

4 years agoUpdate: switch back to lengths from inclusive ranges
Kevin Day [Sat, 9 May 2020 01:23:46 +0000 (20:23 -0500)]
Update: switch back to lengths from inclusive ranges

Using start and stop ranges ended up being cumbersome.
Using length is simpler and a start range can be used by just adding to the source string before calling.

4 years agoUpdate: add missing error handling
Kevin Day [Sat, 9 May 2020 00:42:35 +0000 (19:42 -0500)]
Update: add missing error handling

4 years agoProgress: continue fake development
Kevin Day [Fri, 8 May 2020 04:38:59 +0000 (23:38 -0500)]
Progress: continue fake development

Utilize the recently added functions for appending console parameters for execution.

4 years agoUpdate: numerous fixes and additions, mostly string related
Kevin Day [Fri, 8 May 2020 02:47:18 +0000 (21:47 -0500)]
Update: numerous fixes and additions, mostly string related

Not sure how I let this one get through, but add missing return statement in a couple of private string functions where it is missing.

In retrospect, it seems that I was overzealous with some of the parameter checks.
Redo the parameter checks to not be as sting on string length and buffer size ranges.
Instead, just return that there is nothing to do instead of erroring out.

Add string terminate functions.
These functions are designed to guarantee that an end of string exists at the end of some dynamic string.

Add functions for appending one or more arguments to the arguments array for the execute functions.
This functionality is common enough (used extensively by firewall and soon to be used by fake).
Support providing an array of arguments to append.
This greatly simplifies long-winded code.

Minor fixes and cleanups in the execute functions:
- Add missing parameter checks.
- Rename results to result to be more accurate.

Add length defines for console symbols.

4 years agoProgress: begin re-implementing fake program (Featureless Make)
Kevin Day [Wed, 6 May 2020 04:14:13 +0000 (23:14 -0500)]
Progress: begin re-implementing fake program (Featureless Make)

The goal here will be to mimic the current FSS build scripts fist.
Then update the FSS build scripts to the more generalized design.
Then implement the traditional fakefile process (a makefile alternative).

Currently has "skeleton" mode, which may or may not be implemented.
This was added as a stub just in case I decide to implement it.

4 years agoUpdate: add together snatch functions, update comments
Kevin Day [Wed, 6 May 2020 04:12:25 +0000 (23:12 -0500)]
Update: add together snatch functions, update comments

4 years agoFeature: add fss snatch functions for "snatching" content for a set of object names
Kevin Day [Tue, 5 May 2020 05:00:50 +0000 (00:00 -0500)]
Feature: add fss snatch functions for "snatching" content for a set of object names

These are intended to be used for simple purposes.
Directly implementing these in individual projects are recommended for more advanced usage.
I intend to expand on these "snatch" functions in the near future.

4 years agoBugfix: start position not being calculated fo fl_string functions
Kevin Day [Tue, 5 May 2020 04:48:08 +0000 (23:48 -0500)]
Bugfix: start position not being calculated fo fl_string functions

I missed adding the start position.

4 years agoCleanup: remove useless macros for f_string_location and update comments
Kevin Day [Tue, 5 May 2020 03:41:25 +0000 (22:41 -0500)]
Cleanup: remove useless macros for f_string_location and update comments

4 years agoCleanup: replace variable name 'input' with 'location', add location parameter check
Kevin Day [Tue, 5 May 2020 03:25:47 +0000 (22:25 -0500)]
Cleanup: replace variable name 'input' with 'location', add location parameter check

Using the word 'location' makes more semantic sense than 'input', especially given that the variable type is called a location.

4 years agoUpdate: add back the dynamic_partial functions, add missing functions
Kevin Day [Tue, 5 May 2020 03:01:27 +0000 (22:01 -0500)]
Update: add back the dynamic_partial functions, add missing functions

After further review I realized that the dynamic partial behavior is going to be more common.
The rip functions are also not the same because it removes leading/trailing whitespace, which may be undesirable.

Some of the append_nulless function implementations were missing.

Update comments.

4 years agoFeature: add fl_utf_file project
Kevin Day [Mon, 4 May 2020 11:47:38 +0000 (06:47 -0500)]
Feature: add fl_utf_file project

This is intended to be an f_utf_character handling version of fl_file project.
This f_utf_character is a 4-byte wide storage for a single UTF-8 character.

I accidentally committed the utf_file build settings in a previous commit: f69e57a.

4 years agoUpdate: Redesign f_file and fl_file functions, simplifying f_file_position
Kevin Day [Mon, 4 May 2020 11:11:59 +0000 (06:11 -0500)]
Update: Redesign f_file and fl_file functions, simplifying f_file_position

Redesign the logic behind the f_file and fl_file functions to favor the buffer->used append strategy.

Remove f_file_read_range(), something similar can be added later if need be.

Povide f_file_reat_until(), that functions similar to f_file_read_at(), except the file position is not automatically set.
Using f_file_reat_until() is more efficient in array loops because it does not check the file position every execution.

Add f_macro_file_seek_data() and f_macro_file_seek_hole() to support the newer seek modes: SEEK_DATA and SEEK_HOLE.

The f_file_position structure is simplified.
The file position should only be for file related code and having buffer in there is just plain wrong.
The structure is further simplified in its property names.

Remove unnecessary invalid parameter checks.

Add f_file_default_write_size define.

4 years agoUpdate: make fl_file functions more consistent and update documentation
Kevin Day [Mon, 4 May 2020 02:43:46 +0000 (21:43 -0500)]
Update: make fl_file functions more consistent and update documentation

Refactor the fl_file functions.
Rewrite memory management in f_file and fl_file functions.

Fix bug with size of bytes, renaming it to byte_chunk to avoid confusion.
Add block size property to f_file structure to allow custom block size handling (as opposed to the previous behavior of using a hard-coded default).

Make sure f_none_on_eof is actually returned.

4 years agoUpdate: ensure f_no_data is returned when applicable for fl_string and fl_utf functions
Kevin Day [Mon, 4 May 2020 02:43:05 +0000 (21:43 -0500)]
Update: ensure f_no_data is returned when applicable for fl_string and fl_utf functions

4 years agoUpdate: simplify and rework string functions
Kevin Day [Sat, 2 May 2020 23:42:44 +0000 (18:42 -0500)]
Update: simplify and rework string functions

The rip and append functions are functionally identical.
Remove the rip function.

With the rip functions gone, the rip_trim functions are renamed to rip.
This way "rip" functions operate like a theoretical append_trim function, but with fewer words.

Make the string functions use start and stop ranges instead of lengths.
This eliminates the needs for the partial functions.

Add new nulless functions that check for and remove nulls from source strings while transferring them to the destination string.
This allows for converting the strings that may have nulls to nulless strings such that they can be used in null-sensitive functions such as those found in the standard C libraries.

Make sure the utf_string functions match correspond to the string functions.

4 years agoUpdate: set default allocation step to 4
Kevin Day [Sat, 2 May 2020 16:30:11 +0000 (11:30 -0500)]
Update: set default allocation step to 4

This will better coincide with UTF-9 4-byte wide characters.

4 years agoUpdate: at f_array_too_large status and don't include terminating NULL in string...
Kevin Day [Sat, 2 May 2020 16:07:19 +0000 (11:07 -0500)]
Update: at f_array_too_large status and don't include terminating NULL in string lengths

Just like f_string_too_large, there needs to be a generic f_array_too_large to report that the array is larger than can be supported.
Also provide an f_array_max_size #define just like f_string_max_size.

The #define string lengths shouldn't include the terminating NULL.
This will prevent having to remove the NULL when converting to/from null-agnostic to null-aware designs.

4 years agoFeature: add word, dash, and plus UTF-8 character checker
Kevin Day [Sat, 2 May 2020 05:10:23 +0000 (00:10 -0500)]
Feature: add word, dash, and plus UTF-8 character checker

The use of the '+' operator is more common than in the past.
Add support for detecting if a character is a word character, a dash character, or a plus character.

4 years agoUpdate: Fix string length calculation and report when no changes for fll_program...
Kevin Day [Sat, 2 May 2020 04:51:35 +0000 (23:51 -0500)]
Update: Fix string length calculation and report when no changes for fll_program functions

Both fl_string_rip and fl_string_rip_trim use include ranges and not lengths.
Record the start length to identify if there were changes and return f_no_data when there are not changes.

4 years agoBugfix: is_word tests were using the wrong function and there is no ASCII zero-width...
Kevin Day [Sat, 2 May 2020 04:32:42 +0000 (23:32 -0500)]
Bugfix: is_word tests were using the wrong function and there is no ASCII zero-width space

4 years agoCleanup: fic typo in the word "skip"
Kevin Day [Sat, 2 May 2020 04:24:16 +0000 (23:24 -0500)]
Cleanup: fic typo in the word "skip"

4 years agoCleanup: call clear macros in _new macros
Kevin Day [Sat, 2 May 2020 04:23:24 +0000 (23:23 -0500)]
Cleanup: call clear macros in _new macros

4 years agoCleanup: remove spurious name in typedef struct declaration
Kevin Day [Sat, 2 May 2020 04:22:48 +0000 (23:22 -0500)]
Cleanup: remove spurious name in typedef struct declaration

4 years agoUpdate: use f_string_length instead of uint8_t for width_max in UTF-8 functions
Kevin Day [Sat, 2 May 2020 04:22:06 +0000 (23:22 -0500)]
Update: use f_string_length instead of uint8_t for width_max in UTF-8 functions

4 years agoCleanup: restructure bash script cleanup process
Kevin Day [Fri, 1 May 2020 04:56:26 +0000 (23:56 -0500)]
Cleanup: restructure bash script cleanup process

Explicitly return 0 in main.

The cleanup function can be called within the functions being removed.
This is handy in that the cleanup no longer has to be called after the main function.
The error code can then be properly returned without being lost due to the cleanup function.
Once this is done, return can be used instead of exit (which is generally safer).

4 years agoCleanup: whitespace tweaks and use define for printing long symbol
Kevin Day [Fri, 1 May 2020 03:40:01 +0000 (22:40 -0500)]
Cleanup: whitespace tweaks and use define for printing long symbol

4 years agoUpdate: implement missing serialized functions and fix bugs
Kevin Day [Fri, 1 May 2020 03:36:45 +0000 (22:36 -0500)]
Update: implement missing serialized functions and fix bugs

Implement fl_unserialize_simple() and fl_unserialize_simple_get().

The last character in the last string in the unserialized array gets cut off.
- This happened because the stopping point was incorrectly compensating for the splitter character for the last character in the string.

The width (UTF-8 character width) is not part of the locations size.

4 years agoFeature: implement UTF-8 special character check types (partial-stubs)
Kevin Day [Thu, 30 Apr 2020 05:21:07 +0000 (00:21 -0500)]
Feature: implement UTF-8 special character check types (partial-stubs)

Types are:
- alpha
- alpha-numeric
- numeric
- word (alpha-numeric and underscore '_')
- word-dash (alpha-numeric, underscore '_', and dash '-')

The ASCII portion of this implemented and should work.
The UTF-8/Unicode portion is completely unimplemented (aka: a stub).

4 years agoFeature: add parameter rip functions for ripping console parameters into an array...
Kevin Day [Thu, 30 Apr 2020 02:56:00 +0000 (21:56 -0500)]
Feature: add parameter rip functions for ripping console parameters into an array of strings

4 years agoCleanup: add missing parameter documentation and swap mash with trim in names
Kevin Day [Thu, 30 Apr 2020 02:53:04 +0000 (21:53 -0500)]
Cleanup: add missing parameter documentation and swap mash with trim in names

The additional parameter documentation is missing.

Be consistent with other functions in how the string '_trim' is appended to function names.

4 years agoBugfix: The address has to exist to use, all references with address of 0 are invalid...
Kevin Day [Thu, 30 Apr 2020 02:50:56 +0000 (21:50 -0500)]
Bugfix: The address has to exist to use, all references with address of 0 are invalid parameters

Oops.

4 years agoFeature: add functions for combining the additional console parameter together
Kevin Day [Wed, 29 Apr 2020 04:04:15 +0000 (23:04 -0500)]
Feature: add functions for combining the additional console parameter together

4 years agoRefactor: fll_program_process_parameters to fll_program_parameter_process
Kevin Day [Wed, 29 Apr 2020 03:22:54 +0000 (22:22 -0500)]
Refactor: fll_program_process_parameters to fll_program_parameter_process

Pave the way for additional fll_program_parameter_* functions.

4 years agoUpdate: add missing dependency to f_color
Kevin Day [Wed, 29 Apr 2020 03:22:32 +0000 (22:22 -0500)]
Update: add missing dependency to f_color

4 years agoCleanup: move comment into correct position
Kevin Day [Wed, 29 Apr 2020 03:01:50 +0000 (22:01 -0500)]
Cleanup: move comment into correct position

4 years agoFeature: implement append and prepend string functions
Kevin Day [Wed, 29 Apr 2020 02:57:19 +0000 (21:57 -0500)]
Feature: implement append and prepend string functions

4 years agoFeature: implement string mash support
Kevin Day [Tue, 28 Apr 2020 05:46:11 +0000 (00:46 -0500)]
Feature: implement string mash support

String mashing is a way to append a string to another with a glue string in between.
The idea is that a space could be placed between the two strings.
A string is primarily used as the mash character so that UTF-8 can be natively supported as the glue character.

4 years agoUpdate: only resize if necessary when processing string
Kevin Day [Tue, 28 Apr 2020 04:15:56 +0000 (23:15 -0500)]
Update: only resize if necessary when processing string

Avoid unnecessary work.

4 years agoUpdate: short variable name, reorganize function, fix types
Kevin Day [Mon, 27 Apr 2020 02:13:28 +0000 (21:13 -0500)]
Update: short variable name, reorganize function, fix types

The use of parameter_counter ended up being very wordy with "parameters.parameter[parameter_counter]".
- Change this to 'i', since that is unused and traditional.

Reorganize the additional parameter processing loop.

Use uint8_t instead of "unsigned short" for more consistency.
The width_max should be f_number_unsigned and not "unsigned short".

Add additional documentation for console ids in regards to what "empty" means.

4 years agoFeature: add fl_console_parameter_to_string_dynamic_directory to fl_console
Kevin Day [Sun, 26 Apr 2020 22:12:27 +0000 (17:12 -0500)]
Feature: add fl_console_parameter_to_string_dynamic_directory to fl_console

Provide a console argument handler for parsing out a directory path and returning it in a dynamic string.

4 years agoCleanup: fix include ordering
Kevin Day [Sun, 26 Apr 2020 22:11:26 +0000 (17:11 -0500)]
Cleanup: fix include ordering

4 years agoBugfix: f_file_not_found should be considered an error
Kevin Day [Sun, 26 Apr 2020 22:11:07 +0000 (17:11 -0500)]
Bugfix: f_file_not_found should be considered an error

4 years agoBugfix: remove null pointer check from file stat
Kevin Day [Sun, 26 Apr 2020 07:14:39 +0000 (02:14 -0500)]
Bugfix: remove null pointer check from file stat

Do not assume that stat was passed as an uninitialized pointer.
In the case of passing a class by reference, the stat pointer would be non-zero.
This pointer is not dynamically allocated and therefore not an error.
The null pointer check is therefore invalid for these cases.

4 years agoUpdate: Ensure internal visibility is used in private functions and fix header incons...
Kevin Day [Sun, 26 Apr 2020 05:26:57 +0000 (00:26 -0500)]
Update: Ensure internal visibility is used in private functions and fix header inconsistency in status code

4 years agoCleanup: fix wording in help in regards to special options
Kevin Day [Sun, 26 Apr 2020 04:23:34 +0000 (23:23 -0500)]
Cleanup: fix wording in help in regards to special options

4 years agoCleanup: ensure help sentences end in period and use "build" instead of "built"
Kevin Day [Sun, 26 Apr 2020 04:19:32 +0000 (23:19 -0500)]
Cleanup: ensure help sentences end in period and use "build" instead of "built"

4 years agoCleanup: the standard print help functions only need color context
Kevin Day [Sun, 26 Apr 2020 04:00:43 +0000 (23:00 -0500)]
Cleanup: the standard print help functions only need color context

Passing the entire program data structure is not necessary.
Just pass the color context, this simplifies the code.

4 years agoCleanup: use correct wording in invalid parameter message
Kevin Day [Sun, 26 Apr 2020 03:37:09 +0000 (22:37 -0500)]
Cleanup: use correct wording in invalid parameter message

4 years agoFeature: add "other" parameter support in program print
Kevin Day [Sun, 26 Apr 2020 03:30:19 +0000 (22:30 -0500)]
Feature: add "other" parameter support in program print

Printing support for short and long options exist but I never created one for other option.

4 years agoUpdate: implement private f_utf functions, add missing function, and impove is_graph
Kevin Day [Sat, 25 Apr 2020 20:35:06 +0000 (15:35 -0500)]
Update: implement private f_utf functions, add missing function, and impove is_graph

The public functions should exist in isolation of each other, so the private functions are necessary.

f_utf_is_valid() is missing.

The is_graph functions should handle zero-width as well.

4 years agoFeature: enable support default, protected, and hidden GCC visibility macros
Kevin Day [Sat, 25 Apr 2020 19:04:41 +0000 (14:04 -0500)]
Feature: enable support default, protected, and hidden GCC visibility macros

4 years agoUpdate: redesign byte_dump --last to be inclusive
Kevin Day [Sat, 25 Apr 2020 17:46:36 +0000 (12:46 -0500)]
Update: redesign byte_dump --last to be inclusive

The --last parameter should be inclusive for consistency with the rest of the project, namely FSS.

By redesigning the --last to internally be represented as a relative offset, the behavior can be simplified.
Doing this also adds support for potential future designs where a --length parameter may be provided that is a relative size parameter instead of an absolute one like --last.

4 years agoBugfix: --last does not count correctly when 2-byte or more characters exist
Kevin Day [Sat, 25 Apr 2020 17:23:20 +0000 (12:23 -0500)]
Bugfix: --last does not count correctly when 2-byte or more characters exist

The last parameter does not take into consideration UTF-8 widths.
Redesign counting to accommodate the 2-byte, 3-byte, and 4-byte character widths.

4 years agoCleanup: refactor max_width to width_max
Kevin Day [Sat, 25 Apr 2020 17:15:04 +0000 (12:15 -0500)]
Cleanup: refactor max_width to width_max

Use the newer naming practices.
These kinds of changes will be performed as I notice them.