The fread()/fwrite() "stream" familiy of functions were doing unexpected
things. This could be limited to GNU libC. At any rate that is the most
common libC on the Linux platform used by most SBCs and this caused errors
while having conversations with I2C devices.
I creates a set of macros to handle the reads and writes for BINARY mode
I/O, thinking that the bare UNIX I/O may not be implemented on some
platforms. This has yet to be tested. Those other platforms would likely
not have a problem with the random seek because you can't open I/O devices
with ordinary file commands.
Macros:
- BREAD(F, V): read()s binary data from file descriptor in FILE *F into V.
- BWRITE(F, V): write()s binary data V to file descriptor in FILE *F.
- BREADS(F, V): read()s binary data from file descriptor in FILE *F into
V->Buffer.
- BWRITES(F, V): write()s binary data V-Buffer to file descriptor in FILE *F.
The BREADS/BWRITES handle writing the "Buffer" from a bwBASIC Variant. This
is used for reading and writing strings, hence the trailing S.
A test macro CMDEBUG was added to produce more diagnostic info. This will
likely go away.