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