aboutsummaryrefslogtreecommitdiff
path: root/hexdump_pretty.h
blob: c804f379779bd6ca40c879e14fba55ad3b7089dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef HEXDUMP_PRETTY_H
#define HEXDUMP_PRETTY_H

#include <stddef.h>
#include <stdint.h>

enum color {
	BLACK = 0,
	RED,
	GREEN,
	YELLOW,
	BLUE,
	PURPLE,
	CYAN,
	WHITE,
};



struct segment {
	enum color c;
	size_t len;
	uint8_t *data;
};


enum color next_color(void);
void color_put(enum color c);
void color_reset(void);
void cleanup_line(void);
void put_byte(uint8_t byte);
void flush_line();
void add_segment(struct segment segment);
void write_chunk(uint8_t *buf, size_t len);
void write_chunk_s(uint8_t *buf, size_t len);

#endif /* HEXDUMP_PRETTY_H */