summaryrefslogtreecommitdiff
path: root/src/escpos/parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/escpos/parser.h')
-rw-r--r--src/escpos/parser.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/escpos/parser.h b/src/escpos/parser.h
new file mode 100644
index 0000000..373a251
--- /dev/null
+++ b/src/escpos/parser.h
@@ -0,0 +1,21 @@
+#pragma once
+
+#include <escpos/memory.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+struct escpos_canvas {
+ uint8_t *data;
+ size_t w, h;
+};
+
+struct escpos_parser;
+struct escpos_parser {
+ size_t (*read)(const struct escpos_parser *parser, void *ptr, const size_t size);
+ void (*write)(const struct escpos_parser *parser, const uint8_t *ptr, const size_t w, const size_t h);
+ struct escpos_canvas canvas;
+ struct escpos_mem window;
+};
+
+bool
+escpos_parser_parse(struct escpos_parser *parser, const char *name);