File: conf.h

package info (click to toggle)
ondir 0.2.3%2Bgit0.55279f03-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, stretch
  • size: 188 kB
  • ctags: 53
  • sloc: ansic: 450; makefile: 70; sh: 13; csh: 2
file content (36 lines) | stat: -rw-r--r-- 804 bytes parent folder | download
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