etc: Add environment option to run init.d/ashd silently.
[ashd.git] / src / dirplex / dirplex.h
1 #ifndef _ASH_DIRPLEX_H
2 #define _ASH_DIRPLEX_H
3
4 #define PAT_BASENAME 0
5 #define PAT_PATHNAME 1
6 #define PAT_ALL 2
7 #define PAT_DEFAULT 3
8 #define PAT_LOCAL 4
9
10 #define PT_FILE 0
11 #define PT_DIR 1
12 #define PT_NOTFOUND 2
13
14 struct config {
15     struct config *next, *prev;
16     char *path;
17     time_t mtime, lastck;
18     struct child *children;
19     struct pattern *patterns;
20     char **index, **dotallow;
21     char *capture, *reparse;
22     int caproot, parsecomb;
23 };
24
25 struct rule {
26     int type;
27     char **patterns;
28 };
29
30 struct headmod {
31     struct headmod *next;
32     char *name, *value;
33 };
34
35 struct pattern {
36     struct pattern *next;
37     int type;
38     struct headmod *headers;
39     char *childnm;
40     char **fchild;
41     struct rule **rules;
42 };
43
44 struct child *getchild(struct config *cf, char *name);
45 struct config *readconfig(char *file);
46 struct config *getconfig(char *path);
47 struct config **getconfigs(char *file);
48 struct child *findchild(char *file, char *name, struct config **cf);
49 struct pattern *findmatch(char *file, int trydefault, int type);
50 void modheaders(struct hthead *req, struct pattern *pat);
51
52 extern time_t now;
53 extern struct child *notfound;
54 extern struct config *gconfig, *lconfig;
55
56 #endif