PebbleOS
Loading...
Searching...
No Matches
Typedefs | Functions
Hex dump

xxd-style hex dumps through a line callback. More...

Typedefs

typedef void(* HexdumpLineCallback) (int level, const char *src_filename, int src_line_number, const char *line_buffer)
 Output callback of hexdump(), called once per line.
 

Functions

void hexdump (const char *src_filename, int src_line_number, int level, const uint8_t *data, size_t length, HexdumpLineCallback write_line_cb)
 Hex dump data in xxd-style lines of 16 bytes.
 

Detailed Description

xxd-style hex dumps through a line callback.

Typedef Documentation

◆ HexdumpLineCallback

typedef void(* HexdumpLineCallback) (int level, const char *src_filename, int src_line_number, const char *line_buffer)

Output callback of hexdump(), called once per line.

Parameters
levelLevel passed to hexdump().
src_filenameSource file name passed to hexdump().
src_line_numberSource line number passed to hexdump().
line_bufferLine, without line terminator.

Function Documentation

◆ hexdump()

void hexdump ( const char *  src_filename,
int  src_line_number,
int  level,
const uint8_t *  data,
size_t  length,
HexdumpLineCallback  write_line_cb 
)

Hex dump data in xxd-style lines of 16 bytes.

Each line has the offset, the bytes in hex and their printable ASCII characters.

Parameters
src_filenameSource file name, passed through to write_line_cb.
src_line_numberSource line number, passed through to write_line_cb.
levelLog level, passed through to write_line_cb.
dataData to dump.
lengthLength of data in bytes.
write_line_cbOutput callback.