X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=lib%2Fcf.h;h=862df4e5ae0ae7005969f20c2a3a538e53b556bf;hb=44f924bc6ccfe9f0d8b78ffbcc19975ba1a230e0;hp=45e769805a69218acf6591c0be9e28857de0f181;hpb=0fc6fd13c5bd44e6d595b56337a95156fd42ceea;p=ashd.git diff --git a/lib/cf.h b/lib/cf.h index 45e7698..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,9 +15,14 @@ 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); @@ -26,8 +31,10 @@ 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