summaryrefslogtreecommitdiffstats
path: root/src/libnetdata/config/appconfig_api_boolean.h
blob: 2b05fce6030b027e6f9fbcbd7a72358263ea92e8 (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
// SPDX-License-Identifier: GPL-3.0-or-later

#ifndef NETDATA_APPCONFIG_API_BOOLEAN_H
#define NETDATA_APPCONFIG_API_BOOLEAN_H

#define CONFIG_BOOLEAN_INVALID 100  // an invalid value to check for validity (used as default initialization when needed)

#define CONFIG_BOOLEAN_NO   0       // disabled
#define CONFIG_BOOLEAN_YES  1       // enabled

#ifndef CONFIG_BOOLEAN_AUTO
#define CONFIG_BOOLEAN_AUTO 2       // enabled if it has useful info when enabled
#endif

int appconfig_get_boolean(struct config *root, const char *section, const char *name, int value);
#define config_get_boolean(section, name, value) appconfig_get_boolean(&netdata_config, section, name, value)

int appconfig_get_boolean_ondemand(struct config *root, const char *section, const char *name, int value);
#define config_get_boolean_ondemand(section, name, value) appconfig_get_boolean_ondemand(&netdata_config, section, name, value)

int appconfig_set_boolean(struct config *root, const char *section, const char *name, int value);
#define config_set_boolean(section, name, value) appconfig_set_boolean(&netdata_config, section, name, value)

#endif //NETDATA_APPCONFIG_API_BOOLEAN_H