-/*--------------------------------------------------------------------------
- * hexprint
- *
- * Display a byte as a two digit hex value.
- *
- * parameters:
- * outfile: the place where the output should be written
- * byte: the byte to display
- *--------------------------------------------------------------------------*/
-static void hexprint (FILE *outfile, unsigned char byte)
- { static const char tbl[] =
- { '0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
- };
-
- fprintf(outfile, "%c%c", tbl[byte >> 4], tbl[byte & 0x0f]);
- }
-
-/*--------------------------------------------------------------------------
- * charprint
- *
- * Display a byte as its character representation.
- *
- * parameters:
- * outfile: the place where the output should be written
- * byte: the byte to display
- * nonprintable: a substitute character to display if the byte
- * represents a nonprintable character
- * is_printable_fn: a function that returns a boolean value indicating
- * whether a given character is printable
- *--------------------------------------------------------------------------*/
-static void charprint (FILE *outfile, unsigned char byte,
- unsigned char nonprintable,
- is_printable_fn_t is_printable_fn)
- { fprintf(outfile, "%c", is_printable_fn(byte) ? byte : nonprintable); }