1 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-only */
10 /*--------------------------------------------------------------------------
13 * This specifies how the output of the 'hexdump' function should look.
16 * bytes_per_line: the number of data bytes to display per line of
18 * addrprint_width: Each line of output begins with the address of the
19 * first data byte displayed on that line. This
20 * specifies the number of bytes wide the address
21 * should be displayed as. This value must be from 1
23 * indent: This is a string to display at the start of each
24 * output line. Its purpose is to indent the output.
25 * sep1: This is a string to display between the address and
26 * the bytes of data displayed in hex. It serves as a
28 * sep2: This is a string to display between individual hex
29 * values. It serves as a separator.
30 * sep3: This is a string to display between the bytes of
31 * data in hex and the bytes of data displayed as
32 * characters. It serves as a separator.
33 * nonprintable: This is a substitute character to display in place
34 * of nonprintable characters.
35 *--------------------------------------------------------------------------*/
43 unsigned char nonprintable
;
46 /*--------------------------------------------------------------------------
49 * Write a hex dump of 'mem' to 'outfile'.
52 * mem: a pointer to the memory to display
53 * bytes: the number of bytes of data to display
54 * addrprint_start: The address to associate with the first byte of
55 * data. For instance, a value of 0 indicates that the
56 * first byte displayed should be labeled as byte 0.
57 * outfile: The place where the hex dump should be written.
58 * For instance, stdout or stderr may be passed here.
59 * format: A structure specifying how the hex dump should be
61 *--------------------------------------------------------------------------*/
62 void hexdump(const void *mem
, int bytes
, uint64_t addrprint_start
,
63 FILE * outfile
, const hexdump_format_t
* format
);
65 #endif /* _HEXDUMP_H */