			===========================
			HD Hexadecimal Dump Program
			===========================

This program came about because I was not satisfied with the output from
the standard UNIX od utility. It is basically a case of personal preference
but I hope that some people will find this useful and perhaps preferable
to od. It is not quite as flexible as od in that it can only output in hex
and ascii but it is more flexible than od in format and control of output.

One of the the main considerations when writing the hexprint routine was speed,
hence the offset printing and compression can be compiled out if the
appropriate flags are not defined, giving a faster but simpler dump routine.
Unfortunately as a result the code is not pretty!

Porting of the code to a MS_DOS environment took about 15 minutes (most of
which was spent looking for the correct compiler flags and include files) and
so can easily be used on considerably inferior systems without any problems.
See the changes section below for more details.


 - hd.c

This contains main, file open and close, argument processor and main block
formatting routine.

 - hexprint.c

The file hexprint.c contains a routine which can be used independantly
from the main hd program in the debugging of your own programs for outputing
areas of memory in a hexadecimal form.

It uses bcopy and bcmp or memcpy and memcmp routines depending on
whether the ATT compilation flag is set or not. Specifying ATT causes bcopy
and bcmp to be used. Hence if compilation is being done on a machine running
an AT&T version of unix use the ATT flag.

The H_OFFSETS and H_COMPRESS compilation flags switch on offset
printing and compression respectively, these need to be used in
conjunction with the hex_compression and offset_print flags which must
be set to true in the main program or enclosing scope of the called
hexprint routine. The offset variable must be set each time the
hexprint routine is entered otherwise the offset numbering will always
start at 0, so if you want to print out a number of buffers in
succession with continuous offset numbering you need to update the
offset after each call of hexprint, with the size of the buffer last
passed to hexprint.

Omission of H_OFFSETS and H_COMPRESS means you can forget everything I just
said and just call the hexprint routine straight.

 - Changes since version 1.4 for version 1.6:

A "-r" flag has been added which will print out a "ruler" line just
above each block that is printed.  Note that blocking (-b n) must
be enabled for this to happen, otherwise a single ruler will be printed
out at the start of the output.

Output may now be formatted in octal, decimal or hexadecimal for both
the offset and the actual dump.  This is done by using the format
flag.  The flag takes the format of -f[f] where "ff" may be any
combination of 't' (number zero),  'd', 'x' and '-'.

The single letter versions of the flag imply that offset and dump come
out in the same format.  The "-d" flag specifies dump output in
decimal, "-t" flag specifies output in octal.  The default is of course
hexadecimal, this can be forced by "-x".

Placing a trailing '-' eg: "-d-" means that you wish the offsets to be
printed in decimal and the dump in default format.  And "--d" says that
you wish the offsets in default format and dump in decimal.

Combining letters eg: "-td" means that you want the offset in octal and the
dump in decimal.

So, to be pedantic, "---" means use all defaults, which will be
equivalent to -x.

The flags may also be in upper case, this then means that each output
field will have leading zeros printed.

The above formatting is controlled by the "fmt_" variables defined in
hexprint.c, the default values of which may be found in hexprint.h.
They are simply printf format strings for the offset, field and padding
strings which were hard coded before.  You can of course tweak these if
you want different output formats from the ones given.  The ruler also uses
the field format to get its spacing correct.

There is also a way to override the fixed number of fields that are printed
on the screen (16 for hex, 10 for dec, 8 for oct). This is via the -l flag
and a suitable numeric value.  There is no checking for screen size so the
formatting is pretty much up to you.  The change is achieved by changing the
h_slen varaiable defined in hexprint.c

There is an extra makefile "Makefile.ztc" in this release.  This is a
makefile for the MS DOS zortech c++ 2.0 compiler (I would imagine that
it will work with other versions of zortech c also).  There are NO
changes which need to be made to any of the source files for hd to
compile on dos under the zortech compiler.  Hence you can now have a
uniform dump program between dos and unix.

Added the -V flag to explicitly envoke verbose mode.  This has to be
enabled first (ie first on the cmd line) to get all the info about all
the size type options selected.

Also added the r_len variable, this tells the print_rule routine which base
it is working in so that it can get the best format output for itself.

