lib: Added bufio replacement for stdio.
[ashd.git] / src / dirplex / dirplex.h
CommitLineData
600a1ce7
FT
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
7711283c 8#define PAT_LOCAL 4
600a1ce7
FT
9
10#define PT_FILE 0
11#define PT_DIR 1
a0b6c27c 12#define PT_NOTFOUND 2
600a1ce7
FT
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;
539c7b9f
FT
21 char *capture, *reparse;
22 int caproot, parsecomb;
600a1ce7
FT
23};
24
25struct rule {
26 int type;
27 char **patterns;
28};
29
acc2d159
FT
30struct headmod {
31 struct headmod *next;
32 char *name, *value;
33};
34
600a1ce7
FT
35struct pattern {
36 struct pattern *next;
37 int type;
acc2d159 38 struct headmod *headers;
600a1ce7
FT
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);
da75c835 48struct child *findchild(char *file, char *name, struct config **cf);
a0b6c27c 49struct pattern *findmatch(char *file, int trydefault, int type);
acc2d159 50void modheaders(struct hthead *req, struct pattern *pat);
600a1ce7
FT
51
52extern time_t now;
b70b2d4f 53extern struct child *notfound;
600a1ce7
FT
54extern struct config *gconfig, *lconfig;
55
56#endif