Added a generic config parser/child handler and used it for dirplex and patplex.
[ashd.git] / lib / cf.h
diff --git a/lib/cf.h b/lib/cf.h
new file mode 100644 (file)
index 0000000..09dad29
--- /dev/null
+++ b/lib/cf.h
@@ -0,0 +1,32 @@
+#ifndef _ASHCONF_H
+#define _ASHCONF_H
+
+#include <req.h>
+
+struct cfstate {
+    struct muth *pf;
+    int expstart;
+    char **res, **argv;
+    int argc;
+    int lno;
+    char *file;
+};
+
+struct child {
+    struct child *next;
+    char *name;
+    int type;
+    char **argv;
+    int fd;
+};
+
+void skipcfblock(struct cfstate *s);
+struct cfstate *mkcfparser(FILE *in, char *name);
+void freecfparser(struct cfstate *s);
+char **getcfline(struct cfstate *s);
+
+void freechild(struct child *ch);
+struct child *parsechild(struct cfstate *s);
+int childhandle(struct child *ch, struct hthead *req, int fd);
+
+#endif