lib: Fixed mblock bug for epoll.
[ashd.git] / lib / cf.h
... / ...
CommitLineData
1#ifndef _ASHCONF_H
2#define _ASHCONF_H
3
4#include "req.h"
5
6struct cfstate {
7 struct muth *pf;
8 int expstart;
9 char **res, **argv;
10 int argc;
11 int lno;
12 char *file;
13};
14
15struct child {
16 struct child *next;
17 char *name;
18 struct chandler *iface;
19 void *pdata;
20};
21
22struct 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
28void skipcfblock(struct cfstate *s);
29struct cfstate *mkcfparser(FILE *in, char *name);
30void freecfparser(struct cfstate *s);
31char **getcfline(struct cfstate *s);
32char *findstdconf(char *name);
33
34struct child *newchild(char *name, struct chandler *iface, void *pdata);
35void freechild(struct child *ch);
36void mergechildren(struct child *dst, struct child *src);
37struct child *parsechild(struct cfstate *s);
38int childhandle(struct child *ch, struct hthead *req, int fd, void (*chinit)(void *), void *idata);
39
40#endif