Kevin Day [Mon, 22 Jun 2020 03:01:52 +0000 (22:01 -0500)]
Feature: add fl_iki project.
This provides fl_iki_read, a function for identifying all iki within a given range.
Whereas the f_iki_read function will only identify the first valid iki variable found within the given range.
Kevin Day [Mon, 22 Jun 2020 02:58:21 +0000 (21:58 -0500)]
Update: add missing dependencies, changes to iki
In a previous commit I seem to have forgotten to include the build settings changes.
Fix some minor mistakes in iki.
In particular, I forgot to increment the range->start after identifying where content would begin (which prevented it from working at all).
Add f_iki_variable to store the range for the entire variable.
This will allow for easy removal when substituting (which is one of the design intentions, so I need to cover this use case!).
Kevin Day [Sun, 21 Jun 2020 23:43:01 +0000 (18:43 -0500)]
Update: UTF-8 improvements
Move some FSS UTF-8 processing code into UTF-8 as it should be more generic.
Add more UTF-8 functions (or at least the stubs).
Begin adding emoji, which is all over the place.
Staring at so many codes, it will be easy to make a mistake.
After all of the UTF-8 functions are believed to be fully implemented an extensive review needs to happen.
Kevin Day [Sun, 21 Jun 2020 01:03:42 +0000 (20:03 -0500)]
Progress: organize headers, simplify fss structures, initial IKI support
Move more headers into the secondary structures to simplify the main header, which will now more often be just for function definitions.
The FSS structures can use a more common base to better allow integration with separate projects that utilize the same basic design.
This is important for IKI project.
Casting to/from fss objects and contents to their respective ranges should now be possible.
Begin adding the IKI support, which is a new FSS standard focused on a simpler/smaller Wiki design.
The goal is not to handle presentation but instead to provide very simple context on certain text blocks based on some vocabulary.
A very common example would be sending a plain text e-mail with a URL in it, the URL could be encapsulated in an IKI vocabulary object to tell both the human and the computer that this is a URL.
For a URL, this is very useful in that no part of the URL need be escaped, except for the closing quote and its respective delimiter.
Example iki URL: url:"http://www.example.com/this does not exist/".
As opposed to http://www.example.com/this%20does%20not%20exist/.
The first case is easier for a human while still remaining simple enough for a machine.
The IKI syntax, at least in its most basic form, is not meant to be a full WIKI formatter.
While this may be accomplished with a sufficiently large enough vocabulary, this seems unnecessary at this time.
The IKI syntax standard itself is yet to be ironed out and ill be updated overtime until I am satisfied.
Kevin Day [Sat, 20 Jun 2020 19:08:03 +0000 (14:08 -0500)]
Bugfix: revert slash improvements in FSS object read
Oops.
When relocating this I completely forgot that an object starting with something other than a double quote or single quote can never be a quoted object.
Therefore only the first slash needs to be delimited.
I need to update the FSS documentation to avoid this oops again.
This will be tacked on to the todo list for when I do my extensive review of the FSS processing code.
Kevin Day [Sat, 20 Jun 2020 16:46:24 +0000 (11:46 -0500)]
Progress: update FSS code, including zero-width updates
Update FSS to consider the recent zero-width improvements.
Making the changes reminded me on how I still need to go through and clean the FSS code up.
As noted in previous commits, the changes into supporting UTF really put the code into an unideal and not well tested state.
This needs extensive review and fixes.
To that end, I felt compelled to fix problems and perform cleanups that I observed.
At least to a small extent.
The basic and extended object reads are identical so move the code into a shared private function.
One behavioral change is to better support fail-through practice.
For FSS Extended, the contents are always terminated by a newline.
However, if there is an unterminated quote, then the entire process would previously fail.
This time, do no accept content for that line and continue on to next content.
Kevin Day [Fri, 19 Jun 2020 20:37:16 +0000 (15:37 -0500)]
Update: add additional f_fss functions and update documentation
Add line counting functions.
Remove unnecessary checks against negative values for unsigned numbers.
(They are theoretically necessary in that if the type was overwritten to a signed type, but for now just ignore that case.)
Finish adding or updating the *_together functions.
Review and update the documentation.
Kevin Day [Thu, 18 Jun 2020 05:27:01 +0000 (00:27 -0500)]
Progress: featureless make
Continue development in featureless make, implementing support for "make" operation.
This expands the f_string project to support additional structures.
This expands the fll_fss project to utilize these additional structures.
I have reviewed and redesigned some of the fll_fss project functions.
The fll_fss project function redesign is incomplete and not fully tested as of this commit.
(I plan on reviewing and updating the *_together functions.)
The current fakefile is a stub/example for testing and will be updated to a correct default fakefile once the "make" operation is complete.
The plan is to have the fakefile provide an example for building th featureless make project using the fakefile.
This would mean that the featuereless make project can be built by the featureless make project using either the "build" or the "make" operation.
Kevin Day [Mon, 15 Jun 2020 04:58:02 +0000 (23:58 -0500)]
Feature: add fss_named and fss_set structures and re-organize the fss headers
Provide fss_named and fss_set structures (and their respective array structures).
These are useful when using FSS types nested within another set (not to be confused with fss_nest which is for a single type with recursion).
There are just too many things in fss.h.
Break it out into multiple headers that are auto-included.
Kevin Day [Mon, 15 Jun 2020 04:54:58 +0000 (23:54 -0500)]
Feature: add macro initializers for static string and string ranges
Creating defines with present lengths and them using these in static strings, sometimes with ranges, has become more common.
Provide the macros to make this simpler and ever be more usable for creating constant static strings and constant string ranges.
Kevin Day [Fri, 12 Jun 2020 02:49:46 +0000 (21:49 -0500)]
Progress: UTF-8 file write should handle case where expanded character is larger than write max
When the 4-byte wide UTF-8 character is expanded into potentally 4 1-byte wide UTF-8 characters, the available bytes being expanded need to fit in the output buffer.
Kevin Day [Mon, 8 Jun 2020 23:29:15 +0000 (18:29 -0500)]
Update: fl_serialized to f_serialize, renaming f_serialized to f_serialize
There is nothing forcing the current functions in fl_serialized from being in f_serialize.
Renamed f_serialized to f_serialize to be more consistent with the function names.
To that end, I have renamed the functions like f_unserialize* to f_serialize_un.
I have been unable to come up with a better name that is also reasonably short.
Kevin Day [Mon, 8 Jun 2020 04:34:49 +0000 (23:34 -0500)]
Update: documentation cleanups, fix observed problems, retun F_data_not without error bit
Organize the return codes.
Fix any probles in the commend documentation that I happened to notice.
This is not complete, there will be follow up commits to address more cleanups.
I noticed that there were some public directory functions incorrectly have 'private_' in their name.
The conversion functions should no longer consider no data an error.
Just report that there was nothing to do.
Kevin Day [Mon, 8 Jun 2020 02:16:51 +0000 (21:16 -0500)]
Update: documentation, also use fss-0002
Fix the documentation to clarify that the --work paramter is, in fact, more different than --prefix parameter.
Update the tree examples to show both the build directory tree and work directory tree.
Switch to using the fss-0002 format for all of the documentation files and specification files.
Kevin Day [Sun, 7 Jun 2020 21:40:24 +0000 (16:40 -0500)]
Update: implement --process parameter
Looks like I forgot to implement this.
The --process parameter is a process name that is prepended to stage file names for the purpose of granting the caller additional flexibility.
Kevin Day [Sun, 7 Jun 2020 19:05:29 +0000 (14:05 -0500)]
Update: bootstrap dependency functionality, fix missing dependencies, also ensure level and monolithic
It seems I wrote a dependency generator to make my life easier and then I went and forgot about it.
Update this to work with the more recent changes to the build settings structure.
While I am at it, generate all of the dependencies and save the generated dependencies.
This exposed a typoe in the dependencies file, now fixed.
Might as well make sure the level and monolithic dependencies are generated as well.
Kevin Day [Sun, 7 Jun 2020 14:07:06 +0000 (09:07 -0500)]
Update: support copying documents, licenses, and specifications per project and do some cleanups
Individual projects, specifically programs (level_3), may have custom documentation, licenses, and specifications.
(With custom licenses being least likely because this project in its entirety is under lgpl.)
Add support to all projects just for good practice.
Cleanup ordering of function names and add spaces before function instantiation open brace.
Kevin Day [Sun, 7 Jun 2020 03:30:17 +0000 (22:30 -0500)]
Update: Featureless Make needs to handle the -d/--define parameter
Rename the parameter from defines to define, because it acts on only a single parameter at a time.
The -d must be specified multiple times to get multiple defines.
When -d/--define is specified, the defines provided by the settings file get ignored.
Continue to pass the defines from the console parameters to the process scripts.
Kevin Day [Sun, 7 Jun 2020 02:32:27 +0000 (21:32 -0500)]
Bugfix: shared library link names are incorrect
The standard link names are:
libfake.so -> libfake.so.0
libfake.so.0 -> libfake.so.0.5.0
Instead, I had:
libfake.so.0 -> libfake.so.0.5
libfake.so.0.5 -> libfake.so.0.5.0
While I am at it, make these links reflect the version_target setting.
If target is major, then standard link names above are followed.
If target is minor, then:
libfake.so -> libfake.so.0.5
libfake.so.0.5 -> libfake.so.0.5.0
If target is micro, then:
libfake.so -> libfake.so.0.5.0
Kevin Day [Sun, 7 Jun 2020 01:21:26 +0000 (20:21 -0500)]
Feature: add version_target setting to Featureless Make and FLL generate script
I noticed that I had a different linker version string between Featureless Make and the FLL generate script.
After reviewing and fixing, I decided to make this a customizable option now called version_target.
The default, traditional behavior, is to use only the major version.
A major version target would link like "-Wl,-soname,libfake.so.0".
A minor version target would link like "-Wl,-soname,libfake.so.0.5".
A micro version target would link like "-Wl,-soname,libfake.so.0.5.0".
Kevin Day [Sun, 7 Jun 2020 00:41:06 +0000 (19:41 -0500)]
Update: change settings structure to follow the Featureless Make structure
The existing design is based on the bootstrap scripts.
The bootstrap script is now updated to the new design so these scripts can now be updated to the new design.
Kevin Day [Sun, 7 Jun 2020 00:38:06 +0000 (19:38 -0500)]
Update: redesign to follow the Featureless Make design
Use the setting names specified by Featureless Make, which are a bit more generalized than the current generate.sh design.
This does not fully follow all of the Featureless Make functions.
Only what is necessary (or already implemented) to bootstrap the entire FLL project is done.
Kevin Day [Sat, 6 Jun 2020 21:46:26 +0000 (16:46 -0500)]
Bugfix: do not consider a non-existent build directory an error during clean operation
The clean only cares about deleting all of the files in the build directory.
If that directory does not exist, then there is no issue.
When in verbose mode, print a message about the directory not existing.
Kevin Day [Sat, 6 Jun 2020 19:46:02 +0000 (14:46 -0500)]
Bugfix: filename without extension not terminated and compiled objects need subdirectories
When generating the filename without the file extension, terminate the string.
When library sources are specified using subdirectory paths, object files should have the same subdirectory structure.
This only applies to object files because they are compiled using the same naming structure as the sources.
The rest of the compiled code is compiled into a new structure, which is generally a single library or program.
Kevin Day [Sat, 6 Jun 2020 16:43:39 +0000 (11:43 -0500)]
Bugfix: invalid memory access and only process if not empty
If the path_headers is not defined, an invalid memory read was triggered.
This happens because I was only assigning path_headers variable when path_heades setting was defined but I was still attempting to copy that path regardless.
Make sure to not bother attempting any copy or compile build operations if that setting has not properties (such as build_sources_program being empty).
Kevin Day [Fri, 5 Jun 2020 00:21:30 +0000 (19:21 -0500)]
Progress: featureless make
This gets the shared library and shared program compiling working.
The fake program can compile the fake binary and that fake binary can do the same.
This is great progress.
Kevin Day [Fri, 5 Jun 2020 00:18:50 +0000 (19:18 -0500)]
Bugfix: do not embed libraries into program
The generate.sh script design seems to be adding the library sources into the program.
This effectively makes the linked library.
This is a bad compiling and linking design and a waste of space.
Instead, add a link option to the project name so that the library gets linked to by the program.
Kevin Day [Tue, 2 Jun 2020 04:43:08 +0000 (23:43 -0500)]
Progress: featureless make
Handle the script sources differently than the bash sources.
The bash sources, a scrript, is for generated/processed (and the how is yet to be defined).
The more general scripts are meant for already prepared scripts not modified by this program (unless modified by some pre-process or post-process script).
The more general scripts does not care what the file is, it just gets copied over into the build scripts program path.
Add build_script yes/no setting to conditional include the general scripts when building.
Slightly rework the logic when processing the build operation functions.
Add the planned functions as stubs, to be completed in a future commit.
Kevin Day [Sun, 31 May 2020 04:41:33 +0000 (23:41 -0500)]
Progress: featureless make
Fix a mistake in the naming conflict for with the language enum and language defines.
Implement a more generic build copy function.
Improve file copying support.
Add verbose copy messages.
Copy the C and C++ header files.
Rename fake_build_settings to fake_build_setting to properly follow this projects naming convention.
Add missing dependency for fl_directory.
Language-specific support setting "build_language" is implemented and provides a way to specific which language to use.
This will default to C.
Kevin Day [Sun, 31 May 2020 04:37:30 +0000 (23:37 -0500)]
Update: ensure string parameter tests exist and add f_file_name_base() and f_file_name_directory() functions
I seem to have forgotten that f_string is a char * and should be checked to not be NULL.
I think I removed these during a cleanup process, so add them back.
The basename() and dirname() functions need to be suppoted.
They require extra effort because as per the POSIX standard, parameters are modified.
This is undesirable so protect the parameters when calling.
Kevin Day [Sat, 30 May 2020 22:42:26 +0000 (17:42 -0500)]
Cleanup: make f_string_eol and f_string_placeholder a string instead of a char
In the back of my mind I keep reading f_string_eol as a string.
It is not.
Instead, it is a character.
To prevent this potential confusion, just make it a string and require the use of f_string_eol[0].
Make the same kind of change to f_string_placeholder as well.
Kevin Day [Sat, 30 May 2020 22:36:40 +0000 (17:36 -0500)]
Progress: featureless make
Move the print functions to their own private files (private-print.c and private-print.h).
Have the build operation create the build directory skeleton.
Have the build operation copy the settings files over, if specified in the build settings.
Update the code to be in sync with recent FLL changes.
Kevin Day [Sat, 30 May 2020 22:33:09 +0000 (17:33 -0500)]
Update: pipe and fifo, replace f_directory_mode with f_mode, f_file_copy()
Stick to only using fifo terminology in file types.
Replace f_directory_mode with f_mode, a global type to be shared between f_file, f_directory, and anything else.
Update f_file_copy() to use f_mode instead of mode_t.
This allows the caller to just send the mode.
The copy function already stats the file and processes it per file type, so it can make the decision on which mode to use.
This alleviates the need for the caller to also perform a file type stat check.
Kevin Day [Sat, 30 May 2020 01:00:41 +0000 (20:00 -0500)]
Update: todo documentation, directory copy and clone functions, update comment documentation
Update the todo.txt documentation.
There needs to be directory copy and clone functions for copy the contents of a source directory and not the directory itself.
To that end, add new *_contents() copy functions.
The comment documentation for clone was never updated and is incorrect.
Kevin Day [Fri, 29 May 2020 00:23:59 +0000 (19:23 -0500)]
Progress: add more directory and file related functions, other changes
This was started with the intention of providing all of the *_at() functions.
However, the POSIX spec seems to fall short in many areas making this more difficult than this should be.
I partially rolled back some of the planned changes and this changeset is the result.
I have observed that the function return documentation needs to be updated, but this will be done at a later time.
There will need to be some intensive testing later on but for now I am committing and moving forward.
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).
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).