common: upsdebug_ascii() - to dump a message in ascii

For debugging ASCII-based protocols with control characters (e.g. COMLI)
it is handy to dump messages not in hex, but in ascii with human
readable codes.

Add utility function to do it.
al175: updated driver, please restore it

Back in 2005 I was young and idealistic, that's why you finally marked al175 as
'broken', but now I understand your points (some) and that in NUT you need good
portability.

So this time I've checked that al175 compiles with

	CC="gcc -std=c89 -pedantic", and
	CC="gcc -std=c99 -pedantic"

Also, I've tried to clean-up the driver based on feedback from 2009, but
unfortunately I no longer have hardware to test and will not have any in
foreseable future, so the driver was reworked to meet the project code quality
criteria, without testing on real hardware. Some bugs may have crept in.

Changes since last posting in 2009:

- patch rebased on top of current master (v2.6.5-400-g214c442);
- added reference to COMLI communication protocol document;
- status decode errors go to log, instead of setting non-conformant status like
  "?T", "?OOST", etc.  For such errors new loglevel is allocated;
- "High Battery" status is back;
- converted tracing macros to direct use of upsdebugx and numbers 1,2,3,4 for
  loglevels as requested (but now lines got longer because of explicit __func__ usage);
- lowered usage of other macros (e.g. REVERSE_BITS inlined);
- alarm(3) is not used anymore - instead whole I/O transaction time budget is
  maintained manually;
- man page converted to asciidoc and supported variables list is merged into it;

- upsdebug_ascii moved to common.c and to separate patch.

~~~~

Changes since al175 was removed from NUT tree in 2008:

- alloca was eliminated through the help of automatic variables
- debugging/tracing were reworked to (almost always) use NUT builtins
- al175 now uses 3 debug levels for (1=user-level info, 2=protocol debugging,
  3=I/O tracing)

- rechecked http://eu1.networkupstools.org/doc/2.2.0/developers.html and
  applied where apporpiate

Also

> This driver does not support upsdrv_shutdown(), which makes
> it not very useful in a real world application. This alone
> warrants 'experimental' status, but for the below mentioned
> reasons (to name a few), it's flagged 'broken' instead.

Yes, at present shutdown is not supported, and unfortunately now I don't have
AL175 hardware at hand, so that I can't write it and verify the implementation.

I've marked the driver as DRV_EXPERIMENTAL, although it was tested by us as
part of our systems to work OK for more than three years in production
environment on ships (and we don't need shutdown there -- in critical
situations the system has to operate as long as possible, untill the battery is
empty)

Also, all of the previous issues listed below are now fixed in this al175
version:

- ‘return’ with a value, in function returning void (2x)
- anonymous variadic macros were introduced in C99
- C++ style comments are not allowed in ISO C90
- ISO C forbids braced-groups within expressions (5x)
- ISO C90 forbids specifying subobject to initialize (16x)
- ISO C99 requires rest arguments to be used (18x)

Yes, "All the world is not an x86 Linux box," and I've tried to make all the
world happy.

Please apply.

Thanks,
Kirill.
website: update related project links
ChangeLog: use full path to generator script
Merge branch 'al175'

Closes: networkupstools/nut#69