Commit | Line | Data |
---|---|---|
06c1a718 FT |
1 | #ifndef _ASHCONF_H |
2 | #define _ASHCONF_H | |
3 | ||
b008ba9e | 4 | #include "req.h" |
06c1a718 FT |
5 | |
6 | struct cfstate { | |
7 | struct muth *pf; | |
8 | int expstart; | |
9 | char **res, **argv; | |
10 | int argc; | |
11 | int lno; | |
12 | char *file; | |
13 | }; | |
14 | ||
15 | struct child { | |
16 | struct child *next; | |
17 | char *name; | |
1924fe8c FT |
18 | struct chandler *iface; |
19 | void *pdata; | |
20 | }; | |
21 | ||
22 | struct chandler { | |
23 | int (*handle)(struct child *ch, struct hthead *req, int fd, void (*chinit)(void *), void *idata); | |
24 | void (*merge)(struct child *dst, struct child *src); | |
25 | void (*destroy)(struct child *ch); | |
06c1a718 FT |
26 | }; |
27 | ||
28 | void skipcfblock(struct cfstate *s); | |
29 | struct cfstate *mkcfparser(FILE *in, char *name); | |
30 | void freecfparser(struct cfstate *s); | |
31 | char **getcfline(struct cfstate *s); | |
0fc6fd13 | 32 | char *findstdconf(char *name); |
06c1a718 | 33 | |
1924fe8c | 34 | struct child *newchild(char *name, struct chandler *iface, void *pdata); |
06c1a718 | 35 | void freechild(struct child *ch); |
1924fe8c | 36 | void mergechildren(struct child *dst, struct child *src); |
06c1a718 | 37 | struct child *parsechild(struct cfstate *s); |
6a7a868e | 38 | int childhandle(struct child *ch, struct hthead *req, int fd, void (*chinit)(void *), void *idata); |
06c1a718 FT |
39 | |
40 | #endif |