Progress: Interrupt and memory allocation related changes.
I've noticed that when processing large files, the FSS programs cannot be interrupted using controlled interrupts rather than the standard interrupt signals.
The POSIX standard structure of interrupts, particularly in threads, is very poorly defined.
When a threaded program wishes to be triggered for an exit, the pthread_cancel() function works by immediately exiting the program rather than aborting.
This prevents proper deallocated and shutting down of programs, particularly those that handle interrupts.
This introduces a new f_state_t structure that allows passing a generalized state around that accepts (void *) arguments so that it is not tied to any particular implementation beyond the basic structure.
The FLL/FSS and IKI processing functions then take advantage of this and utilize the state.
There are performance concerns with this, but the need to have controlled interrupts is deemed far more important.
Furthermore, the generic function is open ended so that the caller can potentially implement some sort of optimization.
Now that an f_state_t structure exists I am finally compelled to move the allocation step functionality into this structure.
This will allow for more performance improvements (such as determining allocation step according to file size).
For large files (megabytes, gigabytes, etc..) the allocation step can be set to something large, such as 16384.
Doing so should reduce the amount of memory I/O needed for resize operations.
I have opted to use uint16_t, so there is a max step of 64k at this time.
This entire process needs additional reviewing before releasing.
I designed this with the intent to move the function parameters into the (void *) data property on the f_state_t structure.
This will allow for reducing the parameters passed.
This design will also allow for me to later on add additional state information that can be passed to the caller.
This also allows for better or more granular error handling and reporting.
More work is needed in this regard because many of the functions currently written need to utilize this (such as the recursive directory functions).
This focuses on the most basic utilization in the programs but I would like to perform file size tests so that I can at least have a very basic heuristic for determining the default allocation size for large (or small) files.
A new project fl_signal is provided with a basic interrupt callback for f_state_t as I believe a dirt simple callback will be commonly used.
The default allocation step is now broken up into large and small allocation steps.