Merge branch 'master' into timeheap
[ashd.git] / src / dirplex / dirplex.h
... / ...
CommitLineData
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
14struct 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;
21 char *capture, *reparse;
22 int caproot, parsecomb;
23};
24
25struct rule {
26 int type;
27 char **patterns;
28};
29
30struct headmod {
31 struct headmod *next;
32 char *name, *value;
33};
34
35struct pattern {
36 struct pattern *next;
37 int type;
38 struct headmod *headers;
39 char *childnm;
40 char **fchild;
41 struct rule **rules;
42};
43
44struct child *getchild(struct config *cf, char *name);
45struct config *readconfig(char *file);
46struct config *getconfig(char *path);
47struct config **getconfigs(char *file);
48struct child *findchild(char *file, char *name, struct config **cf);
49struct pattern *findmatch(char *file, int trydefault, int type);
50void modheaders(struct hthead *req, struct pattern *pat);
51
52extern time_t now;
53extern struct child *notfound;
54extern struct config *gconfig, *lconfig;
55
56#endif