home *** CD-ROM | disk | FTP | other *** search
- ===========================
- 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.
-
-
- - hd.c
-
- This contains main, file open and close and the argument processor.
-
- - 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, 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.
-
-