]> arthur.barton.de Git - netdata.git/blob - src/appconfig.h
Merge pull request #724 from paulfantom/master
[netdata.git] / src / appconfig.h
1 #include "web_buffer.h"
2
3 #ifndef NETDATA_CONFIG_H
4 #define NETDATA_CONFIG_H 1
5
6 #define CONFIG_FILENAME "netdata.conf"
7
8 // these are used to limit the configuration names and values lengths
9 // they are not enforced by config.c functions (they will strdup() all strings, no matter of their length)
10 #define CONFIG_MAX_NAME 1024
11 #define CONFIG_MAX_VALUE 2048
12
13 extern int load_config(char *filename, int overwrite_used);
14
15 extern char *config_get(const char *section, const char *name, const char *default_value);
16 extern long long config_get_number(const char *section, const char *name, long long value);
17 extern int config_get_boolean(const char *section, const char *name, int value);
18
19 #define CONFIG_ONDEMAND_NO 0
20 #define CONFIG_ONDEMAND_YES 1
21 #define CONFIG_ONDEMAND_ONDEMAND 2
22 extern int config_get_boolean_ondemand(const char *section, const char *name, int value);
23
24 extern const char *config_set(const char *section, const char *name, const char *value);
25 extern const char *config_set_default(const char *section, const char *name, const char *value);
26 extern long long config_set_number(const char *section, const char *name, long long value);
27 extern int config_set_boolean(const char *section, const char *name, int value);
28
29 extern int config_exists(const char *section, const char *name);
30 extern int config_rename(const char *section, const char *old, const char *new);
31
32 extern void generate_config(BUFFER *wb, int only_changed);
33
34 #endif /* NETDATA_CONFIG_H */