Kevin Day [Fri, 14 Jul 2023 03:07:57 +0000 (22:07 -0500)]
Update: Conversion should return F_number_positive and F_number_negative without error bit and do some clean up.
Do not treat F_number_positive and F_number_negative as an error.
The "unsigned" concept should be internal to the function and not whether or not the user input has a sign.
If F_number_negative is returned, the value can still be of type f_number_unsigned_t.
This is because the return status designates the effective sign.
The caller can then decide whether or not this is an error.
Kevin Day [Thu, 13 Jul 2023 03:24:07 +0000 (22:24 -0500)]
Update: Use status_signal instead of status_thread.
The status_thread is being used specifically for the signal thread.
Change the standard practice to have this renamed to status_signal.
This then helps make other status names make more sense.
Rather than have status_thread, status_thread_a, and status_thread_b, instead have status_signal, status_a, and status_b.
Kevin Day [Sun, 9 Jul 2023 16:33:46 +0000 (11:33 -0500)]
Update: Network additions and improvements, minor documentation comment clean ups.
Add f_network_is_ip_address() along with appropriate unit tests.
The unit test are not as thorough as they could be.
I did not fully review the IPv6 standard, which has a rather absurd design.
There are likely things that I do not yet know about that are not supported.
Specifically do not support port number on any IPv6 address without brackets.
(The IPv6 address notation standard is horribly written.)
Kevin Day [Sat, 8 Jul 2023 03:36:17 +0000 (22:36 -0500)]
Update: Socket bind functions, socket address family enumeration, and rename max_backlog.
Change the f_socket_bind_local() bind function to not call memset() and use the new address structure.
Add f_socket_bind_inet4() and f_socket_bind_inet6() bind functions in a similar way to f_socket_bind_local().
Update the appropriate documentation.
Add the appropriate unit tests.
The name max_backlog for f_socket_listen() is better named backlog_max as per the FLL style practices.
Kevin Day [Thu, 6 Jul 2023 03:38:12 +0000 (22:38 -0500)]
Update: Socket improvements regarding structure and styling.
The f_socket_t structure has "struct sockaddr" as a pointer.
This means mass allocation becomes less practical due to needing to create the actual "struct sockaddr" as needed.
Implement an f_socket_address_t union that accepts the cost of less memory efficiency to improve the usability.
This now allows for mixed types to be stored in the array without needing complicated code to manage different arrays.
The caller will have to be responsible for properly setting the appropriate structure as needed.
Organize the code styling to be more consistent with alphabetical ordering.
I likely have some of the comments to update as well (a follow up commit will be necessary).
Kevin Day [Thu, 29 Jun 2023 04:38:30 +0000 (23:38 -0500)]
Update: Relax the requirement in the license to be less verbose.
Do not specifically use my name "Kevin Day".
Instead refer to the "original license owner" or some authorized party.
This will make the license more flexible.
This also addresses a define name design problem where I have two cases that _F_type_array_file_h would be defined.
For now, just rename the _F_type_array_file_h to _F_type_array__file_h for the top-level file.
Kevin Day [Sat, 24 Jun 2023 20:58:06 +0000 (15:58 -0500)]
Feature: Add f_file_select() for select().
This is more of a wrapper around select() (unlike f_file_poll() which is a bit more than a wrapper around poll()).
The arguments would be more difficult than worth it to simplify and normalize in the FLL typedef style.
Kevin Day [Sat, 24 Jun 2023 03:08:45 +0000 (22:08 -0500)]
Feature: Add additional network and socket related functions.
Add the following:
- f_file_poll() for poll().
- f_socket_read_stream() for recv().
- f_socket_write_stream() for send().
Add f_poll_t, f_polls_t, and f_pollss_t typedefs.
This adds the appropriate array management functions.
To be consistent with type_file.h a new type_array_file.h is created to manage these.
Update the existing f_signal_read() to use the new typdef f_poll_t.
Kevin Day [Thu, 22 Jun 2023 03:26:54 +0000 (22:26 -0500)]
Feature: Add f_network_to_ip_string() and f_network_from_ip_string() functions.
Provide support for inet_ntop() and inet_pton().
String are handling in FLL via f_string_static_t and f_string_dynamic_t.
The functions f_network_to_ip_string() and f_network_from_ip_string() are written to convert to these string types.
This implements a custom f_network_family_ip_t type to pass the digit IP address.
The idea here is to help reduce how much the FLL API is locked into the "libc" or POSIX API.
The structures are allocated using "{ 0 }" to take advantage of the supposed relatively new feature that treats this as an initialize all to NULL.
Kevin Day [Wed, 21 Jun 2023 01:54:31 +0000 (20:54 -0500)]
Feature: Add f_file_manipulate() as a wrapper for fcntl().
This also adds the unit tests.
The unit tests includes additional fixes where several of the wrapped functions are not being setup properly.
The fact that has not triggered an error in the past is concerning.
Kevin Day [Wed, 21 Jun 2023 01:51:05 +0000 (20:51 -0500)]
Feature: Add F_again and F_again_not status codes.
The fcntl() function uses two forms of privilege failures.
The EPERM is already translated to F_prohibited.
Therefore, add F_again (and F_again_not) so that EAGAIN can be used for that.
Kevin Day [Tue, 20 Jun 2023 02:52:12 +0000 (21:52 -0500)]
Feature: Add f_socket_name_host() and f_socket_name_peer().
Add missing network socket related functions for getting the "name" of the local or remote connections.
The local name is retuned as a string.
The remote name is returned on the f_socket_t structure.
I considered doing the work necessary to better generalize this but I decided not to.
I can leave that for once I am better experience in the network programming.
Kevin Day [Tue, 20 Jun 2023 02:51:00 +0000 (21:51 -0500)]
Cleanup: Rename *_total_parameters_d to *_parameter_total_d.
The naming scheme for the total parameters define is out of synchronization with the practices.
Rename this to be more in line with the current practices.
Kevin Day [Sat, 17 Jun 2023 17:41:52 +0000 (12:41 -0500)]
Update: Remove f_array_length_t and related, replacing with f_number_unsigned_t and appropriate.
This simplifies the design.
Doing this comes at a cost of some flexibility and hackability.
After some consideration, I have decided that it can introduce more complicated handling when needing to process both f_array_length_t and f_number_unsigned_t during I/O.
This should keep things simple.
I decided to maintain the custom functions for managing this.
I could use an ifdef wrapper and call the appropriate calls within, but I can do that for another time if I decide to (and remember to).
Kevin Day [Fri, 16 Jun 2023 03:13:17 +0000 (22:13 -0500)]
Cleanup: Remove no longer needed programs.
The fss_read is mostly complete for these programs.
Additional review and testing is needed but I can do that slowly over time.
The runtime unit tests suggests that these are reasonably complete.
The Embedded List Read is not deleted because it is not complete.
There are bugs in both the 0.6.x and the 0.7.x versions.
A rewrite of that mess is needed (and has been for a long time).
I will push this off for now due to it being low priority.
Kevin Day [Thu, 15 Jun 2023 03:13:00 +0000 (22:13 -0500)]
Progress: Fix issues in runtime tests for fss_read not relating to Embedded List and Payload.
More runtime tests now pass.
The Extended List tests still fail in some cases.
I noticed that the Extended List line count is not handling the closing brace.
The count is inaccurate.
This is a bug in the 0.6.x branch and needs to be fixed there.
The fix is in place for this branch but the tests currently fail because they generated expect files are incorrect in this case.
There are other similar problems in different FSS read programs regarding --total and parameters like --at or --line that need to be fixed in the 0.6.x branch as well.
The Embedded List and Payload need special handling and are not addressed here.
Other things regarding fss_read not done:
- The help printing needs to be updated for each program.
- Any remaining todo and fixme.
- The pipe input and output.
There is likely a lot of room for improvement but I am going to ignore such things for now as my priorities are elsewhere.
Kevin Day [Sat, 10 Jun 2023 04:04:33 +0000 (23:04 -0500)]
Update: Complete most of the runtime times for FSS Read program.
Note that this says "most".
I noticed a segmentation fault with FSS-0.6.x versions of fss_embedded_list_read.
This needs to be addressed but is not done so here.
This does not address the tests that fail.
A subsequent commit will follow to address these failures.
These failures are most likely due to that I have not finished migrating all of the fss_read standards.
This also adds some files with UTF-8 characters in the name.
Kevin Day [Fri, 9 Jun 2023 04:15:10 +0000 (23:15 -0500)]
Bugfix: Use arguments passed to fake when processing build with the custom build arguments.
The custom build arguments are passed when the make mode is being used to call the build mode.
The mode arguments passed to the fake program, these should be propagated into the custom build arguments for the build mode.
Kevin Day [Wed, 31 May 2023 03:07:14 +0000 (22:07 -0500)]
Bugfix: Fix runtime tests and problems exposed by runtime tests.
Add additional runtime tests to handle more cases.
The --select functionality is now completed.
This includes using --select with --name and --total.
The quotes are not being handled properly.
This has been fixed by the previous commit (e793c5a5b9f3c3c636e55e0b52df1a11590827cb).
The fss_read tests are updated to better test and expose this potential problem (adding single and double quote usage).
I used the 0.6.x fss_*_read functions to generate the expected output.
This exposed a mistake in the fss_extended_read in the 0.6.x branch where the wrong quotes are being used.
The expecations have been manually corrected and I now need to go back and fix this bug in the 0.6.x branch.
Kevin Day [Wed, 31 May 2023 03:00:02 +0000 (22:00 -0500)]
Bugfix: Quotes in FSS read functions are not being properly handled.
At some point in time the intended behavior changed from using the literal quote character to an enumeration representing the quote character on FSS read calls.
This transition is incomplete and broken.
Finish the transition, passing the enumeration representation rather than the literal character.
Remove an unnecessary initialization on the quote because the private function being called also initializes the variable.
Relocate the f_uint8s_increase() call to be after changing the error status to ensure that the quotes array is properly incremented.
Update the documentation comments to better clarify this behavior in regards to the enumeration.
Kevin Day [Tue, 30 May 2023 22:47:35 +0000 (17:47 -0500)]
Cleanup: FSS Read testfile and related.
Add some new lines to the testfile.
Remove a redundant directory create operation in the testfile.
Remove the '=' character as it does not provide anything useful when printing the test status.
I completely forgot that "location" is for the parameter location and is not the last value location.
Some part of me wanted a last value location.
Revert back to using "values.used - 1" instead of "location".
Kevin Day [Tue, 30 May 2023 01:15:55 +0000 (20:15 -0500)]
Progress: Add simple runtime testing scripts and testfile for fss_read.
This is an incredibly basic implementation.
I didn't bother to make is as flexible and portable as it could otherwise be.
Provide a way to test the runtime results of the fss_read programs.
I only got so far as to add tests for FSS Basic (FSS-0000) and FSS Extended (FSS-0001).
The tests for the FSS Extended (FSS-0001) currently has some failures.
I've noticed that I have not even implemented the --select functionality.
This is the likely cause for several of the test failures.
For now, I just cheated and used the 0.6.x version of the project to generate the expected output.
Any bugs in that output will be matched (ideally there are no bugs).
I did do a quick glance at some of these and they do look fine.
The source test files are copies of files I have used in the past but never made publicly available until now.
Kevin Day [Tue, 30 May 2023 01:06:54 +0000 (20:06 -0500)]
Bugfix: The set no EOL is misplaced on "extended" and should be on "basic_list".
The fss_read program is incorrectly settings the no EOL set function for the FSS Extended (0001) standard.
This should actually be on the FSS Basic List (0002) standard.
Kevin Day [Mon, 29 May 2023 23:26:57 +0000 (18:26 -0500)]
Bugfix: Handle f_directory_not status as an invalid directory.
The status f_directory_not is returned with the path exists but is not a directory.
The fake program can fail when doing something like this:
fake clean make -w /arbitrary_non_directory_file +V
The error message returned is not very helpful:
ERROR: (674) when calling function f_file_stat().
This is a known file-related error and so it is now handled appropraitely.
The new error message looks like:
ERROR: Invalid directory while trying to access directory '/arbitrary_non_directory_file'.
Kevin Day [Mon, 29 May 2023 23:18:28 +0000 (18:18 -0500)]
Bugfix: The testfile needs to handle the --build parameter and improve --work parameter handling.
Provide a new operation "build_path" to load the "--build" parameter properly.
The existing checks for the "--work" parameter is better suited checking against "work:value" rather than "work".
There may be an existing bug where the condition for "build" parameter is always returning true when it should not.
This requires further investigation and is not addressed within the scope of this commit.
Kevin Day [Mon, 29 May 2023 05:09:23 +0000 (00:09 -0500)]
Progress: Continue work on refactoring fss_*_read into fss_read, focusing on fixing issues.
Get the programs into better working state.
I found several problems resulting from the way in which I migrated and refactored the code.
I think the next thing to do is to instead start writing some runtime tests that can better find problems.
Of particular note, I found problems with the comments being printed properly (which generally means not printed).
Some parameter handling problems are also fixed.
The payload and embedded list need special handling and are very much not implemented.
Kevin Day [Sun, 28 May 2023 02:07:42 +0000 (21:07 -0500)]
Security: F_data_not is not being handled leading to invalid read or write.
At some point I changed the behavior to return F_data_not when the main string (usually buffer) has used set to 0.
I failed to update the FSS processing functions to handle this.
The documentation comments are also not up to date in this regard and is now updated.