summaryrefslogtreecommitdiff
path: root/src/escpos/parser.h
blob: 373a251b94fa329db8a4056dd60f8e1a0479b43d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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);