]> Kevux Git Server - fll/log
fll
4 years agoUpdate: the print functions should increment by utf-8 char width and not 1
Kevin Day [Mon, 20 Apr 2020 04:53:54 +0000 (23:53 -0500)]
Update: the print functions should increment by utf-8 char width and not 1

The UTF-8 character may be of a width greater than 1.
The loop must increment by this width and not the literal 1.

4 years agoCleanup: ensure macro_ is pefixed in string macros
Kevin Day [Mon, 20 Apr 2020 04:51:44 +0000 (23:51 -0500)]
Cleanup: ensure macro_ is pefixed in string macros

4 years agoUpdate: experimentally switch to uint8_t to UTF-8 character processing
Kevin Day [Mon, 20 Apr 2020 04:48:41 +0000 (23:48 -0500)]
Update: experimentally switch to uint8_t to UTF-8 character processing

4 years agoUpdate: memory simple delete and simple destroy loop tweaks
Kevin Day [Mon, 20 Apr 2020 04:44:28 +0000 (23:44 -0500)]
Update: memory simple delete and simple destroy loop tweaks

Move the conditional outside of the loop for theoretical performance improvements.

4 years agoFeature: allow trimmed output
Kevin Day [Sun, 8 Mar 2020 23:16:38 +0000 (18:16 -0500)]
Feature: allow trimmed output

New functions added for trimming leading and trailing whitespace from some string.

4 years agoSecurity: fix memory leaks in FSS read programs
Kevin Day [Fri, 28 Feb 2020 04:30:54 +0000 (22:30 -0600)]
Security: fix memory leaks in FSS read programs

4 years agoCleanup: minor changes in f_print
Kevin Day [Fri, 28 Feb 2020 04:27:00 +0000 (22:27 -0600)]
Cleanup: minor changes in f_print

4 years agoCleanup: FLL errors is now FLL status
Kevin Day [Fri, 28 Feb 2020 04:25:40 +0000 (22:25 -0600)]
Cleanup: FLL errors is now FLL status

4 years agoCleanup: add missing parameter documentation for f_print_string()
Kevin Day [Wed, 26 Feb 2020 03:34:11 +0000 (21:34 -0600)]
Cleanup: add missing parameter documentation for f_print_string()

4 years agoProgress: continue development of FSS Extended List
Kevin Day [Tue, 25 Feb 2020 03:28:38 +0000 (21:28 -0600)]
Progress: continue development of FSS Extended List

In particular:
- Remove excessive fl_fss_increment_buffer() uses.
  - The removed code may be a good idea long term, but for now use a simpler and more efficient approach.
- Fix some mistakes in the slash delimiter handling.
- Begin the initial work for recursively (or so..) processing the nested lists.

4 years agoUpdate: add f_unterminated* status codes and fix f_unterminated_nest status codes
Kevin Day [Wed, 19 Feb 2020 01:51:17 +0000 (19:51 -0600)]
Update: add f_unterminated* status codes and fix f_unterminated_nest status codes

Add basic f_unterminated status codes just like f_unterminated_group status codes.
Fix missing status code conversions for f_unterminated_nest.

4 years agoCleanup: enable debugging by default for level and monolithic builds, just like with...
Kevin Day [Thu, 9 Jan 2020 02:54:33 +0000 (20:54 -0600)]
Cleanup: enable debugging by default for level and monolithic builds, just like with individual builds

4 years agoProgress: continue working on fss_extended_list
Kevin Day [Wed, 8 Jan 2020 03:44:33 +0000 (21:44 -0600)]
Progress: continue working on fss_extended_list

4 years agoCleanup: add period at end of sentences
Kevin Day [Wed, 8 Jan 2020 03:44:07 +0000 (21:44 -0600)]
Cleanup: add period at end of sentences

5 years agoUpdate: build level and monolithic fixes and improvements
Kevin Day [Sat, 23 Nov 2019 04:56:20 +0000 (22:56 -0600)]
Update: build level and monolithic fixes and improvements

Add missing library: fll_file.

Make it even easier to compile against "level" and "monolithic" build processes by providing "--level" and "--monolithic" parameters to the generate.sh script and associated settings files.

Make sure package.sh clears other build modes (when --level is specified, make sur --individual and --monolithic modes are not set).

5 years agoUpdate: implement *_delete_simple() and *_destroy_simple() macros and related changes
Kevin Day [Fri, 22 Nov 2019 02:24:43 +0000 (20:24 -0600)]
Update: implement *_delete_simple() and *_destroy_simple() macros and related changes

I do not want a *_delete() and *_destroy() that doesn't provide the ability to handle a status code.
However, in practice, the *_delete() and *_destroy() macros rarely needed the status response checked.
Additional f_status variables were created only to be provided for the status parameter of the stated macros.
This is a waste.

This provides and utilizes alternative *_delete() and *_destroy() macros called *_delete_simple() and *_destroy_simple().
These simple macros do not accept or process the status code.
The resulting code is simpler and easier.

I am on the fence whether or not to throw away the *_delete() and *_destroy() macros that utilize a status parameter.
Future versions may or may not replace the *_delete() and *_destroy() with the *_delete_simple() and *_destroy_simple() macros.

Update *_delete() and *_destroy() macros as needed.

5 years agoCleanup: fix spelling of occurred.
Kevin Day [Wed, 20 Nov 2019 02:21:26 +0000 (20:21 -0600)]
Cleanup: fix spelling of occurred.

5 years agoFeature: add new project fll_file
Kevin Day [Wed, 20 Nov 2019 02:21:07 +0000 (20:21 -0600)]
Feature: add new project fll_file

This project contains the function fll_file_error_print()  for handling common error output.

5 years agoRefactor: make status codes more consistent
Kevin Day [Wed, 20 Nov 2019 01:43:54 +0000 (19:43 -0600)]
Refactor: make status codes more consistent

Better follow the naming paradigm where reasonably possible.
Use more consistent naming, which should also help with reducing the changes of enum to function name conflicts.
Alphabetically organize status codes per group.

5 years agoUpdate: rewrite status code functions and related changes
Kevin Day [Wed, 20 Nov 2019 01:00:00 +0000 (19:00 -0600)]
Update: rewrite status code functions and related changes

Fix several problems with the status code processing, namely missing or incomplete data.
Add status code max size defines.
Add missing "#ifndef _di_f_status_codes_" to status codes.
Update cases where 'error' was not renamed to 'code' in status code sources.
Add missing status codes.
Fix incorrect define, "#ifdef _di_fl_status_invalid_" should instead be "#ifndef _di_fl_status_invalid_".
Fix incorrect sizes associated with status code output strings.
Prepare pipe support (not yet implemented).

Ensure f_utf is included and linked in all appriopriate dependencies.
Treat f_utf as a core level_0 project and update documentation accodingly.

Relocate fl_console_parameter_process() into f_console_parameter_process().

5 years agoCleanup: comments in f_utf
Kevin Day [Mon, 18 Nov 2019 01:27:39 +0000 (19:27 -0600)]
Cleanup: comments in f_utf

5 years agoFeature: enable custom filter and sort in fl_directory_list()
Kevin Day [Mon, 18 Nov 2019 01:25:40 +0000 (19:25 -0600)]
Feature: enable custom filter and sort in fl_directory_list()

5 years agoUpdate: Document fl_directory_list() and finish implementing it
Kevin Day [Mon, 18 Nov 2019 01:08:32 +0000 (19:08 -0600)]
Update: Document fl_directory_list() and finish implementing it

The said function is documented as incomplete and has now been completed.

5 years agoFeature: implement pipe support in byte_dump
Kevin Day [Sun, 17 Nov 2019 07:48:34 +0000 (01:48 -0600)]
Feature: implement pipe support in byte_dump

5 years agoBugfix: incorrect operators used in comparison
Kevin Day [Sun, 17 Nov 2019 07:15:10 +0000 (01:15 -0600)]
Bugfix: incorrect operators used in comparison

Should be using '&&' and not '||' when making sure the character is in the expected range.

5 years agoBugfix: When --last is set to 0, entire file is dumped
Kevin Day [Sun, 17 Nov 2019 06:58:40 +0000 (00:58 -0600)]
Bugfix: When --last is set to 0, entire file is dumped

The --last value being set to 0 is internally used to represent entire file.
Explicitly setting --last to 0 makes no sense, so set the minimum allowed size for --last to 1.

5 years agoBugfix: only present error when --first and --last are both provided and --last is...
Kevin Day [Sun, 17 Nov 2019 06:54:28 +0000 (00:54 -0600)]
Bugfix: only present error when --first and --last are both provided and --last is less than --first

If --first is specified by itself, --last is implicitly defined as the EOF.

5 years agoUpdate: byte_dump should take into consideration the offsets when processing --first
Kevin Day [Sun, 17 Nov 2019 06:40:59 +0000 (00:40 -0600)]
Update: byte_dump should take into consideration the offsets when processing --first

This includes moving some of the variables into structures to simplify the design.

5 years agoUpdate: use fl_console_parameter_to_number_unsigned() instead of atoll()
Kevin Day [Sun, 17 Nov 2019 01:15:57 +0000 (19:15 -0600)]
Update: use fl_console_parameter_to_number_unsigned() instead of atoll()

This includes minor source code changes.

5 years agoUpdate: only print newline when --empty is used and --select is 0
Kevin Day [Sat, 16 Nov 2019 21:06:05 +0000 (15:06 -0600)]
Update: only print newline when --empty is used and --select is 0

In all other cases with --empty and --select, such as --select 1, if that selection is empty do not print any newlines.

Remove some impossible conditions.

5 years agoUpdate: --name and --at in combination should process '--at' relative to '--name'
Kevin Day [Sat, 16 Nov 2019 20:50:58 +0000 (14:50 -0600)]
Update: --name and --at in combination should process '--at' relative to '--name'

This logic is already done with --line and other parameters.
Doing this same thing with --name and --at makes the code/logic more consistent and reasonable.

5 years agoCleanup: display correct standard in help for fss_basic_list_read and fss_extended_read
Kevin Day [Sat, 16 Nov 2019 05:01:59 +0000 (23:01 -0600)]
Cleanup: display correct standard in help for fss_basic_list_read and fss_extended_read

5 years agoUpdate: status code tweaks, including setting fl_fss_status_code_first as different...
Kevin Day [Sat, 16 Nov 2019 04:58:13 +0000 (22:58 -0600)]
Update: status code tweaks, including setting fl_fss_status_code_first as different from f_status_code_last

5 years agoCleanup: minor tweaks to comments
Kevin Day [Sat, 16 Nov 2019 04:21:43 +0000 (22:21 -0600)]
Cleanup: minor tweaks to comments

5 years agoUpdate: finish implementing fss_basic_list_read
Kevin Day [Sat, 16 Nov 2019 04:20:56 +0000 (22:20 -0600)]
Update: finish implementing fss_basic_list_read

5 years agoUpdate: finish implementing fss_extended_read
Kevin Day [Fri, 15 Nov 2019 03:15:39 +0000 (21:15 -0600)]
Update: finish implementing fss_extended_read

5 years agoUpdate: print newline for empty content even when --at and --line, so long as --empty...
Kevin Day [Fri, 15 Nov 2019 03:12:34 +0000 (21:12 -0600)]
Update: print newline for empty content even when --at and --line, so long as --empty is specified

5 years agoRegression: the --at parameter should be processed even when --depth is not specified
Kevin Day [Fri, 15 Nov 2019 02:46:26 +0000 (20:46 -0600)]
Regression: the --at parameter should be processed even when --depth is not specified

The implementation of --depth resulted in --at to not be processed when the --depth parameter is not provided.

5 years agoUpdate: ensure error output has appropriate highlighting
Kevin Day [Fri, 15 Nov 2019 02:44:57 +0000 (20:44 -0600)]
Update: ensure error output has appropriate highlighting

5 years agoCleanup: minor cleanups
Kevin Day [Fri, 15 Nov 2019 02:44:17 +0000 (20:44 -0600)]
Cleanup: minor cleanups

5 years agoBugfix: f_overflow should be returned with error bit set
Kevin Day [Fri, 15 Nov 2019 02:43:58 +0000 (20:43 -0600)]
Bugfix: f_overflow should be returned with error bit set

5 years agoBugfix: string to number conversions should handle leading 0's as a valid number
Kevin Day [Thu, 14 Nov 2019 03:04:55 +0000 (21:04 -0600)]
Bugfix: string to number conversions should handle leading 0's as a valid number

5 years agoFeature: add support for including empty content in fss_basic_read
Kevin Day [Thu, 14 Nov 2019 02:54:31 +0000 (20:54 -0600)]
Feature: add support for including empty content in fss_basic_read

Empty content is an object that has no content.
When there is no content for an object, no content is printed for that line and that line is not included in content totals or line selections.

5 years agoUpdate: finish implementing fss_basic_read
Kevin Day [Thu, 14 Nov 2019 02:44:53 +0000 (20:44 -0600)]
Update: finish implementing fss_basic_read

5 years agoProgress: continue implementing fss_basic_read, also numerous other fixes/tweaks
Kevin Day [Wed, 13 Nov 2019 06:12:42 +0000 (00:12 -0600)]
Progress: continue implementing fss_basic_read, also numerous other fixes/tweaks

I decided to allow --at and --name to be used at the same time (and therefore at the same --depth).
The depth code is to be rewritten and that is only partially rewritten.
Many of the parameters are now written and the fss_basic_read needs to be tested and reviewed.
(There fss_basic_read is still incomplete, but there is enough working code to begin testing.)

5 years agoBugfix: "true" is now a reserved type, so replace variable names of "true" with ...
Kevin Day [Tue, 12 Nov 2019 04:30:12 +0000 (22:30 -0600)]
Bugfix: "true" is now a reserved type, so replace variable names of "true" with "is_true"

5 years agoCleanup: add space to --help for duodecimal parameter
Kevin Day [Sun, 10 Nov 2019 04:39:41 +0000 (22:39 -0600)]
Cleanup: add space to --help for duodecimal parameter

5 years agoFeature: add support for duodecimal (base-12)
Kevin Day [Sun, 10 Nov 2019 04:31:20 +0000 (22:31 -0600)]
Feature: add support for duodecimal (base-12)

Now that duodecimal has been added to the FLL project, make sure byte_dump can print in that format.
There is no printf() code for base-12, so implement a custom print process.

Fix some typoes in the "hexi" decimal spelling.

5 years agoUpdate: implement f_number_signed and f_number_unsigned, as either 32-bit, 64-bit...
Kevin Day [Sun, 10 Nov 2019 04:28:28 +0000 (22:28 -0600)]
Update: implement f_number_signed and f_number_unsigned, as either 32-bit, 64-bit, or 128-bit

Provide the types f_number_signed and f_number_unsigned as a way to define the default "number" type to be used for string to number conversions and array indexes.
By providing 32-bit, 64-bit (default), and 128-bit types, the type can then be adjusted to more easily work on limited hardware or expand to more capable hardware.

This will be the recommended number data type to use in FLL functions going forward.

5 years agoProgress: f_conversion and fl_console changes
Kevin Day [Sat, 9 Nov 2019 07:27:49 +0000 (01:27 -0600)]
Progress: f_conversion and fl_console changes

This includes adding support for duodecimal (base 12)

5 years agoProgress: rewriting fss_* programs and all dependencies
Kevin Day [Sat, 9 Nov 2019 01:25:07 +0000 (19:25 -0600)]
Progress: rewriting fss_* programs and all dependencies

I am changing the parameters and design of the fss_* programs, such as fss_basic_read.
There is no work done on the fss_*_write programs yet.

There were a lot of changes in the dependencies, including cleanups and improvements.

The parameters passed to the fss_* functions will now be more consistent across each of them.
This should make scripting much easier.

There is a lot of incomplete work and I am focused currently on getting fss_basic_read to work as desired.
I halted my work on f_conversion and fl_console to make sure none of these changes are lost.

I do not expect this commit to compile with everything due to the incomplete work.
I would rather post incomplete code than risk losing code as has happened in the past.

5 years agoProgress: do not include closing brace when determining stop point in extended list
Kevin Day [Sat, 2 Nov 2019 20:54:42 +0000 (15:54 -0500)]
Progress: do not include closing brace when determining stop point in extended list

5 years agoProgress: use the content_nests equivalents in place of the contents
Kevin Day [Sat, 2 Nov 2019 20:05:07 +0000 (15:05 -0500)]
Progress: use the content_nests equivalents in place of the contents

When I copied basic_list code to use a starting point for extended, I missed creating "nest" equivalents to some code.

5 years agoProgress: continue working on fss-003 Extended List
Kevin Day [Fri, 1 Nov 2019 04:07:31 +0000 (23:07 -0500)]
Progress: continue working on fss-003 Extended List

A nested type has been created.
I suspect that I will need to change the structure of the other types to improve consistency, but more review and consideration is needed before any such changes are made.

A read program was written but it is essentially a copy and paste of Basic List, with a few minor changes just to make it compile.
The program arguments of all the FLL programs will need to be changed such that adding support for "depth" selection can be used for things lile Extended List.

The memory allocation is implemented but not reviewed.
I converted the behavior to support nesting, but I need to review the logic to ensure I caught everything.

No time was spent on the write support.

5 years agoProgress: begin implementing fss-003 Extended List
Kevin Day [Fri, 11 Oct 2019 04:19:26 +0000 (23:19 -0500)]
Progress: begin implementing fss-003 Extended List

5 years agoUpdate: FSS function documentation, use "location" instead of "input", have f_incompl...
Kevin Day [Fri, 20 Sep 2019 03:28:15 +0000 (22:28 -0500)]
Update: FSS function documentation, use "location" instead of "input", have f_incomplete_utf use error bit

5 years agoUpdate: finish implementing f_utf_character_is_valid() and related UTF-8 changes
Kevin Day [Wed, 18 Sep 2019 00:09:44 +0000 (19:09 -0500)]
Update: finish implementing f_utf_character_is_valid() and related UTF-8 changes

UTF-8 BOM is actually not a thing but only a suggestion, see RFC 3629.
I consider it a very bad practice now that I have learned that it is also the zero width space.
Get rid of the UTF-8 BOM support, it is a bad idea and is not to be supported by this project.

The referenced rfc also provides an easier way to view the valid ranges that my previous resources (such as wikipedia).
This helped me finish this function.

Updated byte_dump to better utilize this and to remove no longer necessary code.
Fix an accidental incorrect "invalid detection" check use before calling f_utf_character_is_valid() in byte_dump.
Explicitly print a "." or " " for UTF-8 control characters (ASCII control characters are already handled before this point so it is safe to call f_utf_character_is_control()).

5 years agoProgress: use a smaller byte structure for comparison in UTF-8 *_is_valid() function
Kevin Day [Tue, 17 Sep 2019 04:07:55 +0000 (23:07 -0500)]
Progress: use a smaller byte structure for comparison in UTF-8 *_is_valid() function

The full 4-byte wide character is still used in some circumstances.

5 years agoProgress: finish the main parts of invalid UTF-8 detection
Kevin Day [Tue, 17 Sep 2019 00:49:00 +0000 (19:49 -0500)]
Progress: finish the main parts of invalid UTF-8 detection

This wraps up the work needed for all explicitly declared invalid sequences.
There are some sequences, such as "Overlong", that are considered invalid (according to Wikipedia at this time) but the source (namely Wikipedia) does not explicitly declare what they are.
I need to figure out what these really are and handle them.
There are also likely cases of accidental copy and paste that will be fixed as I discover them (sorry, the size of documentation I had to go through to get these invalid sequences is massive to me).

There are also some @todo situations that I would like to resolve.

5 years agoProgress: more towards completing UTF-8 valid/invalid check
Kevin Day [Mon, 16 Sep 2019 04:22:19 +0000 (23:22 -0500)]
Progress: more towards completing UTF-8 valid/invalid check

5 years agoUpdate: int8_t and uint8_t are always size 1, so avoid sizeof(int8_t) and sizeof...
Kevin Day [Sun, 15 Sep 2019 03:41:48 +0000 (22:41 -0500)]
Update: int8_t and uint8_t are always size 1, so avoid sizeof(int8_t) and sizeof(uint8_t) calculations

5 years agoUpdate: disable init until I can get around to it
Kevin Day [Sun, 15 Sep 2019 03:35:26 +0000 (22:35 -0500)]
Update: disable init until I can get around to it

I decided to start at least clean up some of the compile errors, but this was simply too much of a mess.
Instead, just comment out code and deal with it later.

5 years agoProgress: continue adding to UTF-8 valid/invalid detection
Kevin Day [Sat, 14 Sep 2019 23:19:45 +0000 (18:19 -0500)]
Progress: continue adding to UTF-8 valid/invalid detection

5 years agoProgress: begin converting byte_dump to using f_utf_character_is_valid()
Kevin Day [Sat, 14 Sep 2019 20:59:45 +0000 (15:59 -0500)]
Progress: begin converting byte_dump to using f_utf_character_is_valid()

The function, f_utf_character_is_valid(), can be a bit expensive, so only call it if the current character is not already known to be invalid.

The function, byte_dump_print_text(), will need to be updated as well, given that the invalid range now includes some sequences currently being swapped with a space.

5 years agoCleanup: fix alignment of help text fo normal, simple, and classic parameters
Kevin Day [Sat, 14 Sep 2019 20:58:51 +0000 (15:58 -0500)]
Cleanup: fix alignment of help text fo normal, simple, and classic parameters

5 years agoProgress: continue UTF-8 work
Kevin Day [Sat, 14 Sep 2019 05:54:24 +0000 (00:54 -0500)]
Progress: continue UTF-8 work

5 years agoUpdate: types where not fully converted into new structure
Kevin Day [Sat, 14 Sep 2019 05:54:12 +0000 (00:54 -0500)]
Update: types where not fully converted into new structure

5 years agoUpdate: begin improving UTF-8
Kevin Day [Sat, 14 Sep 2019 00:38:52 +0000 (19:38 -0500)]
Update: begin improving UTF-8

I am now moving to perform a more thorough implementation of UTF-8 support.
Cleaned up the functions.

Due to the sheer size of the changes needed, I am uploading this is stages to ensure nothing gets lost.
The work done is incomplete.
The funtions will need to be reviewed once everything is in place.

5 years agoUpdate: redesign size types
Kevin Day [Thu, 12 Sep 2019 22:28:40 +0000 (17:28 -0500)]
Update: redesign size types

The FLL project is now being designed around explicit type usage.
Update the size type limitation #defines to be based on this.

5 years agoUpdate: use int8_t instead of char
Kevin Day [Thu, 12 Sep 2019 22:17:19 +0000 (17:17 -0500)]
Update: use int8_t instead of char

Guarantee that we are always dealing with 1-byte values by using int8_t instead of char.
They should be identical, but this prevents a given system from doing something different.
char by default is signed.

5 years agoUpdate: document f_type, switch f_bool fom unsigned short to uint8_t
Kevin Day [Thu, 12 Sep 2019 03:43:36 +0000 (22:43 -0500)]
Update: document f_type, switch f_bool fom unsigned short to uint8_t

5 years agoCleanup: document f_status
Kevin Day [Thu, 12 Sep 2019 03:43:19 +0000 (22:43 -0500)]
Cleanup: document f_status

5 years agoCleanup: document f_socket
Kevin Day [Thu, 12 Sep 2019 03:42:55 +0000 (22:42 -0500)]
Cleanup: document f_socket

5 years agoUpdate: documentation for f_pipe and add additional pipe functions
Kevin Day [Thu, 12 Sep 2019 03:38:30 +0000 (22:38 -0500)]
Update: documentation for f_pipe and add additional pipe functions

Provide f_pipe_warning_exists(), f_pipe_error_exists(), and f_pipe_debug_exists().
In theory, the program should be able to grab data piped from any of these sources, if both the source exists and a way to pipe the source exists.

5 years agoCleanup: documentation for f_path
Kevin Day [Thu, 12 Sep 2019 03:37:45 +0000 (22:37 -0500)]
Cleanup: documentation for f_path

5 years agoCleanup: documentation for f_memory
Kevin Day [Thu, 12 Sep 2019 03:36:57 +0000 (22:36 -0500)]
Cleanup: documentation for f_memory

5 years agoUpdate: documentation and increase f_fss_max_header_length to accomodate UTF-8 BOM
Kevin Day [Thu, 12 Sep 2019 03:35:46 +0000 (22:35 -0500)]
Update: documentation and increase f_fss_max_header_length to accomodate UTF-8 BOM

5 years agoUpdate: start enum's at 1 where possible
Kevin Day [Thu, 12 Sep 2019 02:03:08 +0000 (21:03 -0500)]
Update: start enum's at 1 where possible

By always setting enums as 1, the 0 value can be reserved as not-set.
There are still a few situations where enums must not start at 1.
Some are:
1) Type defenitions, so as in f_types where the status codes need to start at 0 for f_false.
2) Any enums that map 1to1 to an array, such as with parameter options.

5 years agoUpdate: document f_file functions and add missing functions
Kevin Day [Wed, 11 Sep 2019 03:57:09 +0000 (22:57 -0500)]
Update: document f_file functions and add missing functions

After reviewing and writing some documentation, it occurred to me that a few more functions should be written.

5 years agoUpdate: f_convesion, add comments and fix problems
Kevin Day [Tue, 10 Sep 2019 02:31:18 +0000 (21:31 -0500)]
Update: f_convesion, add comments and fix problems

Add comments (including correcting some existing ones).

Rename another case where digit should now be decimal.

Make sure the *decimal parameter only gets updated on success.
Be consistent about returning f_no_data.

5 years agoUpdate: Add 3 presentation modes to byte_dump: normal, simple, and classic
Kevin Day [Tue, 10 Sep 2019 00:44:12 +0000 (19:44 -0500)]
Update: Add 3 presentation modes to byte_dump: normal, simple, and classic

Normal presentation will replace ASCII control or whitespace character with the UTF-8 characters that represent this with a picture character.
Simple presentation will use a single space to represent any given ASCII control or whitespace character.
Classic presentation will do what the "hexdump" tool traditionally does and use a single period to represent an ASCII control or whitespace character.

5 years agoUpdate: add missing help options and fix miscellaneous minor issues
Kevin Day [Tue, 10 Sep 2019 00:24:51 +0000 (19:24 -0500)]
Update: add missing help options and fix miscellaneous minor issues

5 years agoBugfix: put '} // extern C' into correct location
Kevin Day [Tue, 10 Sep 2019 00:17:20 +0000 (19:17 -0500)]
Bugfix: put '} // extern C' into correct location

5 years agoUpdate: remove common type wrappers and use typedef instead of '#define'
Kevin Day [Mon, 9 Sep 2019 04:19:10 +0000 (23:19 -0500)]
Update: remove common type wrappers and use typedef instead of '#define'

I intend to begin transitioning from the core types like 'int', 'char', etc...
As part of this, I need to remove a number of the type #define wrappers.
This is also done, in part, because I learned that there are some equivalents to f_min_s_int.

Using explicit types is safer and better designed than something like 'char'.
The goal will be to replace 'char' with uint8_t (or int8_t as needed).

Furthermore, specifying int32_t and int64_t (and similar) should improve the code quality.
The use of types like "wchar", is dangerous because some systems use different sizes.
Instead, for something like "wchar", an uint32_t, might be used.
(although this project is to be designed around UTF-8 so the use of wchar is wrong anyway but it does make good example.)

5 years agoUpdate: add a space after "combining" characters and catch a few more invalid UTF...
Kevin Day [Mon, 9 Sep 2019 03:57:47 +0000 (22:57 -0500)]
Update: add a space after "combining" characters and catch a few more invalid UTF-8 sequences

Previously, I just printed a space instead of printing the "combining" characters.
It occurred to me that I could print a space following a known "combining" character to cause it to combine into a space.
This makes things easier to view and still displays the combining character instead of hiding it behind a blank space.
The downside is that this might cause problems if someone tried to copy and paste these combined characters.

Catch a few more invalid UTF-8 sequences that I came across while making these changes.
Fix an existing invalid UTF-8 sequence detection that seems to have been incomplete and incorrect.

5 years agoBugfix: last short parameter argument is not being processed correctly
Kevin Day [Mon, 9 Sep 2019 02:21:26 +0000 (21:21 -0500)]
Bugfix: last short parameter argument is not being processed correctly

For short parameters, only compare against a single character, not two.

5 years agoUpdate: use unsigned long for argc
Kevin Day [Mon, 9 Sep 2019 02:15:07 +0000 (21:15 -0500)]
Update: use unsigned long for argc

5 years agoUpdate: Simplifiy digit/decimal and hexidecimal functions
Kevin Day [Mon, 9 Sep 2019 00:46:41 +0000 (19:46 -0500)]
Update: Simplifiy digit/decimal and hexidecimal functions

Use simpler logic for determining if character is a decimal or a hexidecimal.
Rename digit to decimal.

5 years agoCleanup: move private functions into separate files
Kevin Day [Sun, 8 Sep 2019 23:44:14 +0000 (18:44 -0500)]
Cleanup: move private functions into separate files

5 years agoRefactor: ename bit_dump to byte_dump
Kevin Day [Sun, 8 Sep 2019 23:25:31 +0000 (18:25 -0500)]
Refactor: ename bit_dump to byte_dump

This program is operating on a per byte basis.
The name 'byte_dump' makes more sense than 'bit_dump'.

5 years agoFeature: implement --decimal display in bit_dump
Kevin Day [Sun, 8 Sep 2019 23:19:39 +0000 (18:19 -0500)]
Feature: implement --decimal display in bit_dump

5 years agoCleanup: Utilize f_console_parameter_ids to simplify parameters for fll_program_proce...
Kevin Day [Sun, 8 Sep 2019 22:44:10 +0000 (17:44 -0500)]
Cleanup: Utilize f_console_parameter_ids to simplify parameters for fll_program_process_parameters()

Althought not ideal, the ids must be in an explicit order of no_color, light, and dark.
This has been added to the functional documentation.

5 years agoCleanup: provide helper structure f_console_parameters
Kevin Day [Sun, 8 Sep 2019 22:25:22 +0000 (17:25 -0500)]
Cleanup: provide helper structure f_console_parameters

This is provided to help shorten the number of parameters passed to functions.

5 years agoCleanup: make main() programs design more consistent across level 3 projects
Kevin Day [Sun, 8 Sep 2019 21:58:44 +0000 (16:58 -0500)]
Cleanup: make main() programs design more consistent across level 3 projects

5 years agoCleanup: replace argc and argv usage with a single structure of argc and argv (f_cons...
Kevin Day [Sun, 8 Sep 2019 21:46:27 +0000 (16:46 -0500)]
Cleanup: replace argc and argv usage with a single structure of argc and argv (f_console_arguments)

Simplify the parameters being passed to functions by providing a helper structure called f_console_arguments to handle the argc and argv standard arguments.
Due to being standard arguments, I am leaving the names as 'argc' and 'argv' despite it being a violation of the naming policy of this project.
('argc' should be something like 'used', and 'argv' should be 'arguments'.)

The firewall had a naming conflict, so rename the usage of "arguments" in firewall into "parameters".

5 years agoRegression: display "+" and "++" and not "-" and "--" for special parameter options
Kevin Day [Sun, 8 Sep 2019 20:39:29 +0000 (15:39 -0500)]
Regression: display "+" and "++" and not "-" and "--" for special parameter options

When I wrote fll_program_print_help_option() I completely forgot to provide a way to set eithe "-" or "+" and "--" or "++".
This resulted in the "--help" display of the options to incorrectly print using "-" and "--".

Add additional function parameters to allow setting the symbols when calling fll_program_print_help_option().

5 years agoUpdate: Simplify console priority checking by providing fl_console_parameter_prioriti...
Kevin Day [Sun, 8 Sep 2019 20:22:41 +0000 (15:22 -0500)]
Update: Simplify console priority checking by providing fl_console_parameter_prioritize() and fix name of fl_console functions

Simplify the code for determining which console parameter of some set of console parameters has priority.
Abstract this functionality into its own function so that other projects can leverage this.

The functions in fl_console should be prefixed with fl_console.

5 years agoFeature: bit_dump level 3 program
Kevin Day [Sun, 8 Sep 2019 04:25:50 +0000 (23:25 -0500)]
Feature: bit_dump level 3 program

Provide a program to help analyze files, supporting UTF-8.

This should work similar to "hexdump" but is not intended to match it feature for feature.

Provides three byte printing modes (with plans for a fourth):
1) hexidecimal (default)
2) octal
3) binary
4) digit (planned)

Provides first and last byte selection support.

A width option is available for specifying the number of bytes to be printed on screen such that each byte is essentially a data column.
With a width of 16, then there would be 16 data columns, each displaying one byte.

Although similar to "hexdump", the first column in bit_dump represents the specific row number.

A text option is provided to display the bytes as a character (similar to how "hexdump" uses "-C").

A placeholder option is available for showing a placeholder where placeholder spaces would otherwise be printed.
A placeholder is printed to ensure alignment.
For example, a printable UTF-8 character that is 3-bytes wide would only visibly take up 1 character of space.
To keep the alignment with text to bytes accurate and consistent, two additional placeholder spaces are appended following the UTF-8 characte.

If the bytes terminate before an entire column set of bytes are printed, then spaces or placeholders are printed until the full column may be printed when in "text" mode.

This will detect and report invalid UTF-8 codes.

Handling printing the characters (via the text option) can be tricky.
There is more work needed to catch all cases.
Some cases cannot be handled if the character is wider than the expected width (causing alignment printing issues).

I am still a bit inexperienced with the intricacies of UTF-8 and I expect there to be issues in this first pass.

5 years agoUpdate: restructure f_file, add f_file_exists(), add f_file_exists_at(), and other...
Kevin Day [Sat, 7 Sep 2019 21:29:09 +0000 (16:29 -0500)]
Update: restructure f_file, add f_file_exists(), add f_file_exists_at(), and other f_file related changes

Use "address" instead of "file" in f_file to help make things less confusing.
Shorten use of "file_information" with "file".

Implement f_file_exists().
Implement f_file_exists_at().

Try to avoid returning f_invalid_parameter to represent invalid parameters for standard C/POSIX functions.
Implement new exceptions, like f_invalid_name and f_invalid_desciptor, to accommodate this.

Use f_string_eol instead of "\n".

5 years agoUpdate: console code and some macros
Kevin Day [Tue, 3 Sep 2019 04:21:08 +0000 (23:21 -0500)]
Update: console code and some macros

Add explicit dark mode console option.
Add support for order of operations priority on parameters  ("+n +l +d" would result in colors for dark background because +d overrides both +n and +l due to being the right-most parameter).
Rewrite level_3 programs to utilize the new fll_program_process_parameters() helper function.
Fix some screwed up macro definitions and uses.