The friendly Operating System for the Internet of Things
od.h File Reference

Detailed Description

#include <stdint.h>
+ Include dependency graph for od.h:

Go to the source code of this file.

Macros

#define OD_FLAGS_ADDRESS_MASK   (0xc000)
 Bit-mask to extract address offset format settings from flags.
 
#define OD_FLAGS_BYTES_MASK   (0x3e00)
 Bit-mask to extract byte format settings from flags.
 
#define OD_FLAGS_LENGTH_MASK   (0x00f7)
 Bit-mask to extract length information for byte format from flags.
 
#define OD_WIDTH_DEFAULT   (16)
 Default value for parameter width of od()
 
Address offset format flags

Flags to define format of the address offset

#define OD_FLAGS_ADDRESS_OCTAL   (0x0000)
 octal address offset
 
#define OD_FLAGS_ADDRESS_HEX   (0x4000)
 hexadecimal address offset
 
#define OD_FLAGS_ADDRESS_DECIMAL   (0x8000)
 decimal address offset
 
#define OD_FLAGS_ADDRESS_NONE   (0xc000)
 no address offset
 
Bytes format flags

Flags to define format of the byte output

#define OD_FLAGS_BYTES_OCTAL   (0x0000)
 Print LENGTH bytes as LENGTH-wide octal integer (LENGTH is defined in the lower significant byte of the flags)
 
#define OD_FLAGS_BYTES_CHAR   (0x2000)
 Print bytes as their represented character in ASCII.
 
#define OD_FLAGS_BYTES_INT   (0x1000)
 Print LENGTH bytes as LENGTH-wide decimal integer (LENGTH is defined in the lower significant byte of the flags)
 
#define OD_FLAGS_BYTES_DECIMAL   (OD_FLAGS_BYTES_INT)
 Alias for OD_FLAGS_BYTES_INT.
 
#define OD_FLAGS_BYTES_UINT   (0x0400)
 Print LENGTH bytes as LENGTH-wide decimal unsigned integer (LENGTH is defined in the lower significant byte of the flags)
 
#define OD_FLAGS_BYTES_HEX   (0x0200)
 Print LENGTH bytes as LENGTH-wide hexadecimal integer (LENGTH is defined in the lower significant byte of the flags)
 
Bytes format length flags

Flags to define format length of the byte output

#define OD_FLAGS_LENGTH_1   (0x0010)
 1 byte
 
#define OD_FLAGS_LENGTH_2   (0x0020)
 2 byte
 
#define OD_FLAGS_LENGTH_4   (0x0000)
 4 byte and default
 
#define OD_FLAGS_LENGTH_8   (0x0080)
 8 byte More...
 
#define OD_FLAGS_LENGTH_CHAR   (OD_FLAGS_LENGTH_1)
 alias for OD_FLAGS_LENGTH_1
 
#define OD_FLAGS_LENGTH_SHORT   (0x0002)
 sizeof(short) byte
 
#define OD_FLAGS_LENGTH_LONG   (0x0004)
 sizeof(long) byte
 

Functions

void od (const void *data, size_t data_len, uint8_t width, uint16_t flags)
 Dumps memory stored at data up to data_len in octal, decimal, or hexadecimal representation to stdout. More...
 
static void od_hex_dump (const void *data, size_t data_len, uint8_t width)
 Dumps memory stored at data up to data_len in octal, decimal, or hexadecimal representation to stdout with flags == OD_FLAGS_ADDRESS_HEX | OD_FLAGS_BYTES_HEX | OD_FLAGS_LENGTH_1. More...