forked from confluentinc/kibosh
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconf.h
More file actions
99 lines (84 loc) · 2.49 KB
/
conf.h
File metadata and controls
99 lines (84 loc) · 2.49 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/**
* Copyright 2017 Confluent Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
#ifndef KIBOSH_CONF_H
#define KIBOSH_CONF_H
#include <fuse.h> // for fuse_opt
struct kibosh_conf {
/**
* The path we should write our pidfile to, or NULL if pid files are not enabled. Malloced.
*/
char *pidfile_path;
/**
* The path we should log message to, or NULL to use stdout. Note that stdout will not be
* visible unless the process is running in foreground mode. Malloced.
*/
char *log_path;
/**
* An existing path which contains files we want to mirror. This argument is required. Malloced.
*/
char *target_path;
/**
* Zero to suppress DEBUG logs, nonzero to enable them.
*/
int verbose;
/**
* Mode to use on the control file.
*/
int control_mode;
};
enum kibosh_option_ty {
KIBOSH_CLI_GENERAL_HELP_KEY,
KIBOSH_CLI_FUSE_HELP_KEY
};
/**
* The command-line options accepted by Kibosh.
*
* These are in addition to the standard FUSE command-line options.
*/
extern struct fuse_opt kibosh_command_line_options[];
/**
* Allocate a new kibosh_conf object.
*
* @return The configuration, or NULL on OOM.
*/
struct kibosh_conf *kibosh_conf_alloc(void);
/**
* Free a kibosh_conf object.
*
* @param conf The configuration to free.
*/
void kibosh_conf_free(struct kibosh_conf *conf);
/**
* Process a kibosh_conf object to make it suitable for use.
*
* Resolves relative paths into absolute paths.
* Verifies that required fields are present.
*
* @param conf The configuration. Will be modified.
*
* @return 0 on success; a negative error code on error.
*/
int kibosh_conf_reify(struct kibosh_conf *conf);
/**
* Returns a string representation of this configuration.
*
* @param conf The configuration.
*
* @return A malloced string, or NULL on OOM.
*/
char *kibosh_conf_to_str(const struct kibosh_conf *conf);
#endif
// vim: ts=4:sw=4:tw=99:et