summaryrefslogtreecommitdiff
path: root/src/opts.h
blob: e1ce16c54ead1255a3133736d939ba2e0aee525d (plain)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* License: BSD-style license
* Copyright: Radek Podgorny <radek@podgorny.cz>,
*            Bernd Schubert <bernd-schubert@gmx.de>
*/

#ifndef OPTS_H
#define OPTS_H


#include <fuse.h>
#include <stdbool.h>

#include "unionfs.h"


#define ROOT_SEP ":"

typedef struct {
	int nbranches;
	branch_entry_t *branches;

	bool cow_enabled;
	bool statfs_omit_ro;
	int doexit;
	int retval;
	char *chroot; 		// chroot we might go into
	bool debug;		// enable debugging
	char *dbgpath;		// debug file we write debug information into
	pthread_rwlock_t dbgpath_lock; // locks dbgpath
	bool hide_meta_files;
	bool relaxed_permissions;

} uopt_t;

enum {
	KEY_CHROOT,
	KEY_COW,
	KEY_DEBUG_FILE,
	KEY_DIRS,
	KEY_HELP,
	KEY_HIDE_META_FILES,
	KEY_HIDE_METADIR,
	KEY_MAX_FILES,
	KEY_NOINITGROUPS,
	KEY_RELAXED_PERMISSIONS,
	KEY_STATFS_OMIT_RO,
	KEY_VERSION
};


extern uopt_t uopt;

void set_debug_path(char *new_path, int len);
bool set_debug_onoff(int value);
void uopt_init();
int unionfs_opt_proc(void *data, const char *arg, int key, struct fuse_args *outargs);
void unionfs_post_opts();
void add_branch(char *branch);
int parse_branches(const char *arg);


#endif