a025719582049bbe024fa21fa3ee997504724c98
[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
13 struct config {
14     struct config *next, *prev;
15     char *path;
16     time_t mtime, lastck;
17     struct child *children;
18     struct pattern *patterns;
19     char **index;
20     char *capture;
21 };
22
23 struct rule {
24     int type;
25     char **patterns;
26 };
27
28 struct pattern {
29     struct pattern *next;
30     int type;
31     char *childnm;
32     char **fchild;
33     struct rule **rules;
34 };
35
36 struct child *getchild(struct config *cf, char *name);
37 struct config *readconfig(char *file);
38 struct config *getconfig(char *path);
39 struct config **getconfigs(char *file);
40 struct child *findchild(char *file, char *name, struct config **cf);
41 struct pattern *findmatch(char *file, int trydefault, int dir);
42
43 extern time_t now;
44 extern struct child *notfound;
45 extern struct config *gconfig, *lconfig;
46
47 #endif