aboutsummaryrefslogtreecommitdiff
path: root/hexdump_pretty.h
diff options
context:
space:
mode:
Diffstat (limited to 'hexdump_pretty.h')
-rw-r--r--hexdump_pretty.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/hexdump_pretty.h b/hexdump_pretty.h
new file mode 100644
index 0000000..c804f37
--- /dev/null
+++ b/hexdump_pretty.h
@@ -0,0 +1,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 */