X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=lib%2Fcf.h;h=862df4e5ae0ae7005969f20c2a3a538e53b556bf;hb=0b6f220fc8ac58b6404e2d45eed52629d549860f;hp=a1eadb0113b15dc7f0dab46c429dd755a3b564d1;hpb=6a7a868e28e79f5502cc4b37578c263f640439c8;p=ashd.git diff --git a/lib/cf.h b/lib/cf.h index a1eadb0..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,7 +31,9 @@ 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, void (*chinit)(void *), void *idata);