htmlconv.h

 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};
14
15typedef struct {
16    int type;
17    char* text;
18    char* attr1;
19    char* attr2;
20} HTMLElement;
21
22typedef struct {
23    HTMLElement* elements;
24    int count;
25    int cap;
26    int ok;
27} HTMLConvertResult;
28
29HTMLConvertResult html_to_elements(const char* html, size_t len);
30
31void free_html_result(HTMLConvertResult* r);
32
33#endif