diff options
author | Federico Ceratto <federico.ceratto@gmail.com> | 2016-03-30 21:40:42 +0000 |
---|---|---|
committer | Federico Ceratto <federico.ceratto@gmail.com> | 2016-03-30 21:40:42 +0000 |
commit | 9ce153ce7167c11adba8ac225edc7a707e97c6eb (patch) | |
tree | 9f6e849cce2dcc7e5b4e9e6252c843dc2d0787a2 /src/appconfig.h | |
download | netdata-9ce153ce7167c11adba8ac225edc7a707e97c6eb.tar.xz netdata-9ce153ce7167c11adba8ac225edc7a707e97c6eb.zip |
Imported Upstream version 1.0.0upstream/1.0.0
Diffstat (limited to '')
-rwxr-xr-x | src/appconfig.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/appconfig.h b/src/appconfig.h new file mode 100755 index 000000000..41d1e19bb --- /dev/null +++ b/src/appconfig.h @@ -0,0 +1,31 @@ +#include "web_buffer.h" + +#ifndef NETDATA_CONFIG_H +#define NETDATA_CONFIG_H 1 + +#define CONFIG_FILENAME "netdata.conf" + +// these are used to limit the configuration names and values lengths +// they are not enforced by config.c functions (they will strdup() all strings, no matter of their length) +#define CONFIG_MAX_NAME 1024 +#define CONFIG_MAX_VALUE 2048 + +extern int load_config(char *filename, int overwrite_used); + +extern char *config_get(const char *section, const char *name, const char *default_value); +extern long long config_get_number(const char *section, const char *name, long long value); +extern int config_get_boolean(const char *section, const char *name, int value); + +#define CONFIG_ONDEMAND_NO 0 +#define CONFIG_ONDEMAND_YES 1 +#define CONFIG_ONDEMAND_ONDEMAND 2 +extern int config_get_boolean_ondemand(const char *section, const char *name, int value); + +extern const char *config_set(const char *section, const char *name, const char *value); +extern const char *config_set_default(const char *section, const char *name, const char *value); +extern long long config_set_number(const char *section, const char *name, long long value); +extern int config_set_boolean(const char *section, const char *name, int value); + +extern void generate_config(BUFFER *wb, int only_changed); + +#endif /* NETDATA_CONFIG_H */ |