sgiomodule.c; Overhaul for self-edification.
sgiomodule.c; Overhaul for self-edification.

  * Added a whole pile of comments.
  * Reformatted to personal preferences (I don't expect anyone else to appreciate this; use astyle or indent).
  * Improved error messages.
  * Minor logic fiddlements.

In order to study the workings of this module (to improve my own understanding) I reformatted the file to my own preferred coding style, which is base on Whitesmith style.  This is my own copy of the module, so I do not expect that the change will negatively impact anyone else.

I commented the heck out of the thing, providing basic explanations on what the code is trying to accomplish and references to further documentation.  There is more that could be done here.  Note that I did try (initially) to use Doxygen formatting, but I had trouble getting that to work correctly so I gave up.  Someone more familiar with Doxygen might want to give it a whirl.

The most important change is in the error reporting.  I added more detail to the returned error strings including, where appropriate, appending the system error strings (via strerror(3)).

Finally, changed some of the logic to be simpler and/or clearer (to me) where possible.

AHelper/python-scsi,AHelper/python-scsi,rosjat/python-scsi