X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=lib%2Fcf.h;h=35529c2332d1d07c2578b4aa7501d1bc0ca8b8c3;hb=349b25644067aa6754197a991c3ba00143d60a19;hp=45e769805a69218acf6591c0be9e28857de0f181;hpb=0fc6fd13c5bd44e6d595b56337a95156fd42ceea;p=ashd.git diff --git a/lib/cf.h b/lib/cf.h index 45e7698..35529c2 100644 --- a/lib/cf.h +++ b/lib/cf.h @@ -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