1#ifndef MATCHA_HTMLCONV_H
2#define MATCHA_HTMLCONV_H
3
4#include <stddef.h>
5
6enum {
7 HELEM_TEXT = 0,
8 HELEM_H1 = 1,
9 HELEM_H2 = 2,
10 HELEM_LINK = 3,
11 HELEM_IMAGE = 4,
12 HELEM_BLOCKQUOTE = 5,
13 HELEM_TABLE = 6,
14};
15
16typedef struct {
17 int type;
18 char* text;
19 char* attr1;
20 char* attr2;
21} HTMLElement;
22
23typedef struct {
24 HTMLElement* elements;
25 int count;
26 int cap;
27 int ok;
28} HTMLConvertResult;
29
30HTMLConvertResult html_to_elements(const char* html, size_t len);
31
32void free_html_result(HTMLConvertResult* r);
33
34#endif