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