| 1 | #ifndef CONF_H__ |
| 2 | #define CONF_H__ |
| 3 | |
| 4 | /* Where the global config resides. */ |
| 5 | #ifndef GLOBAL_CONF |
| 6 | #define GLOBAL_CONF "/etc/ondirrc" |
| 7 | #endif |
| 8 | /* If your code blocks exceed this, something weird is going on. */ |
| 9 | #define MAX_SECTION_SIZE 16384 |
| 10 | /* Use .onenter or .onleave? */ |
| 11 | /* #define USE_ONENTERLEAVE */ |
| 12 | |
| 13 | typedef enum { |
| 14 | PT_ENTER, |
| 15 | PT_LEAVE, |
| 16 | } pathtype_t; |
| 17 | |
| 18 | struct odpath_t { |
| 19 | const char **paths, *content; |
| 20 | int npaths, final; |
| 21 | pathtype_t type; |
| 22 | struct odpath_t *next; |
| 23 | }; |
| 24 | |
| 25 | /* load ondir configuration file */ |
| 26 | struct odpath_t *load_conf(const char *file, struct odpath_t *root); |
| 27 | |
| 28 | /* Expand all environment variables in 'in' */ |
| 29 | char *expand_envars(const char *in); |
| 30 | |
| 31 | void fatal(const char *fmt, ...); |
| 32 | void error(const char *fmt, ...); |
| 33 | void warning(const char *fmt, ...); |
| 34 | void info(const char *fmt, ...); |
| 35 | |
| 36 | #endif |