Update: Fix print function bugs and add missing functions.
There are some cases where the logic is flawed and fails to print correctly.
Given a bash binary, passing it through the print functions and back to the disk in raw format resulted in a different binary.
The binary should be identical to the original and is not.
It seems that when I attempted to reduce the number of variables in the print function I failed to account for certain details.
This essentially reverts some of the previous logic and puts back the variables.
Many off these functions are almost identical but their differences result in requiring slightly different code.
This makes the code less manageable and easy to get lost in.
The code has been tweaked somewhat to be more consistent across the board, where possible.
This might come at a cost of some slight performance.
To make the code easier to read, separate the print functions into two groups:
1) The print functions that use file streams.
2) The print functions that use file descriptors.
This code is slightly different and while I could use macros to make this simpler, I opted to avoid macros at the cost of duplication.
Move these two groups into separate files, significantly improving code readability.
There is a mistake in the previous code where errno is being processed for file stream errors.
The libc file stream functions do not utilize errno.
Change the affected code to just return F_output with the error bit set.
I am unable to find a discrete list of error codes returned by ferror().
I will need to additional work to get these codes so I can properly map them to more verbose error codes.
The documentation is no longer out of sync.
There should be a file descriptor function equivalent for nearly every file stream function.
In this regard, several missing functions are now added.
This is an unplanned change that is rather large.
I am concerned with oversights and regressions.
Just keep an eye out for regressions and hope that there are none.