X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=lib%2Fcf.h;h=862df4e5ae0ae7005969f20c2a3a538e53b556bf;hb=4350acb522111f385f74dd9c7f8b3e47443ff225;hp=09dad29932ce2f74aa06366a3d81a15294c3e01e;hpb=06c1a7183754349e29a6f4656d88d3f89e4f448a;p=ashd.git diff --git a/lib/cf.h b/lib/cf.h index 09dad29..862df4e 100644 --- a/lib/cf.h +++ b/lib/cf.h @@ -1,7 +1,7 @@ #ifndef _ASHCONF_H #define _ASHCONF_H -#include +#include "req.h" struct cfstate { struct muth *pf; @@ -15,18 +15,26 @@ struct cfstate { struct child { struct child *next; char *name; - int type; - char **argv; - int fd; + struct chandler *iface; + void *pdata; +}; + +struct chandler { + int (*handle)(struct child *ch, struct hthead *req, int fd, void (*chinit)(void *), void *idata); + void (*merge)(struct child *dst, struct child *src); + void (*destroy)(struct child *ch); }; void skipcfblock(struct cfstate *s); struct cfstate *mkcfparser(FILE *in, char *name); void freecfparser(struct cfstate *s); char **getcfline(struct cfstate *s); +char *findstdconf(char *name); +struct child *newchild(char *name, struct chandler *iface, void *pdata); void freechild(struct child *ch); +void mergechildren(struct child *dst, struct child *src); struct child *parsechild(struct cfstate *s); -int childhandle(struct child *ch, struct hthead *req, int fd); +int childhandle(struct child *ch, struct hthead *req, int fd, void (*chinit)(void *), void *idata); #endif