-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcustache.h
76 lines (63 loc) · 1.2 KB
/
custache.h
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef CUSTACHE_H
#define CUSTACHE_H
typedef enum {
CUSTACHE_TEMPLATE_STATIC,
CUSTACHE_TEMPLATE_BASIC,
CUSTACHE_TEMPLATE_SECTION,
CUSTACHE_TEMPLATE_INVERT,
CUSTACHE_TEMPLATE_CLOSING
} custache_template_type_t;
typedef struct custache_template {
custache_template_type_t type;
struct custache_template *next, *child;
char *content, *otag, *ctag;
} custache_template_t;
typedef struct custache_view {
unsigned char type;
struct custache_view *next, *child;
void *content;
} custache_view_t;
custache_template_t *
custache_load_template(
const char *,
const char *,
const char *
);
custache_template_t *
custache_load_template_stream(
FILE *,
const char *,
const char *
);
custache_template_t *
custache_load_template_file(
const char *,
const char *,
const char *
);
void
custache_free_template(
custache_template_t *
);
custache_view_t *
custache_load_view(
const char *
);
custache_view_t *
custache_load_view_stream(
FILE *
);
custache_view_t *
custache_load_view_file(
const char *
);
void
custache_free_view(
custache_view_t *
);
const char *
custache_render(
const custache_template_t *,
const custache_view_t *
);
#endif