dirplex: Start children in the directory in which they were declared.
[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
9 #define PT_FILE 0
10 #define PT_DIR 1
11
12 struct config {
13     struct config *next, *prev;
14     char *path;
15     time_t mtime, lastck;
16     struct child *children;
17     struct pattern *patterns;
18     char **index;
19 };
20
21 struct rule {
22     int type;
23     char **patterns;
24 };
25
26 struct pattern {
27     struct pattern *next;
28     int type;
29     char *childnm;
30     char **fchild;
31     struct rule **rules;
32 };
33
34 struct child *getchild(struct config *cf, char *name);
35 struct config *readconfig(char *file);
36 struct config *getconfig(char *path);
37 struct config **getconfigs(char *file);
38 struct child *findchild(char *file, char *name, struct config **cf);
39 struct pattern *findmatch(char *file, int trydefault, int dir);
40
41 extern time_t now;
42 extern struct config *gconfig, *lconfig;
43
44 #endif