fmt: add formula blocks
[ctxt.git] / ctxt.h
blob19f432be60d33b5ec6d9155f68b6a889a63b5d71
1 #ifndef _FMT_H
2 #define _FMT_H
4 void file_put(int fd, char *s);
6 struct fmt_ops {
7 void (*doc_beg)(int fd);
8 void (*doc_end)(int fd);
9 void (*head_beg)(int fd, int level);
10 void (*head_end)(int fd);
11 void (*par_beg)(int fd);
12 void (*par_end)(int fd);
13 void (*list_beg)(int fd);
14 void (*list_end)(int fd);
15 void (*item_beg)(int fd);
16 void (*item_end)(int fd);
17 void (*pre_beg)(int fd);
18 void (*pre_end)(int fd);
19 void (*formula_beg)(int fd);
20 void (*formula_end)(int fd);
21 void (*put)(int fd, char *s);
22 void (*put_emph)(int fd, char *s);
23 void (*put_raw)(int fd, char *s);
24 void (*put_ref)(int fd, char *s);
27 struct txt {
28 char *txt;
29 char **lines;
30 int n;
33 struct txt *txt_alloc(int fd);
34 char *txt_line(struct txt *txt, int line);
35 void txt_free(struct txt *txt);
37 void fmt(int fd, struct txt *txt, struct fmt_ops *ops);
40 #endif