-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchtml.h
More file actions
executable file
·50 lines (38 loc) · 1.08 KB
/
chtml.h
File metadata and controls
executable file
·50 lines (38 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef _CHTML_H_
#define _CHTML_H_
#ifdef __cplusplus
extern "C" {
#endif
/* print log */
#define chtml_log(...) printf(__VA_ARGS__)
/* chtml type */
#define chtml_object 1
#define chtml_tag 2
#define chtml_meta 3
#define chtml_note 4
typedef struct chtml {
struct chtml *prev, *next;
struct chtml *child;
/* chtml type */
int type;
char *slabel;
char *elabel;
char *text;
char *attr;
} chtml_t;
extern chtml_t *chtml_create(void);
extern chtml_t *chtml_create_head(void);
extern chtml_t *chtml_create_body(void);
extern chtml_t *chtml_create_meta(char *attr);
extern chtml_t *chtml_create_tag(char *slabel, char *elabel, char *text, char *attr);
extern chtml_t *chtml_create_note(char *text);
extern void chtml_delete(chtml_t *chtml);
extern void chtml_append(chtml_t *chtml, chtml_t *node);
extern void chtml_insert(chtml_t *chtml, chtml_t *node);
extern char *chtml_print(chtml_t *chtml);
extern chtml_t *chtml_parse(const char *data);
extern chtml_t *chtml_get_tag(chtml_t *chtml, char *label);
#ifdef __cplusplus
}
#endif
#endif // _CHTML_H_