Updated ChangeLog.
[ashd.git] / lib / cf.h
1 #ifndef _ASHCONF_H
2 #define _ASHCONF_H
3
4 #include "req.h"
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;
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);
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);
32 char *findstdconf(char *name);
33
34 struct child *newchild(char *name, struct chandler *iface, void *pdata);
35 void freechild(struct child *ch);
36 void mergechildren(struct child *dst, struct child *src);
37 struct child *parsechild(struct cfstate *s);
38 int childhandle(struct child *ch, struct hthead *req, int fd, void (*chinit)(void *), void *idata);
39
40 #endif