]> arthur.barton.de Git - netdata.git/blobdiff - src/appconfig.h
Merge branch 'master' into ab-debian
[netdata.git] / src / appconfig.h
index 051736dd8f98a5f4ccf966044cdd9b395a95fb6f..45cc8cfd5215d18303abbb407091a58998db3379 100644 (file)
@@ -3,6 +3,14 @@
 
 #define CONFIG_FILENAME "netdata.conf"
 
+#define CONFIG_SECTION_GLOBAL   "global"
+#define CONFIG_SECTION_WEB      "web"
+#define CONFIG_SECTION_PLUGINS  "plugins"
+#define CONFIG_SECTION_REGISTRY "registry"
+#define CONFIG_SECTION_HEALTH   "health"
+#define CONFIG_SECTION_BACKEND  "backend"
+#define CONFIG_SECTION_STREAM   "stream"
+
 // 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
@@ -10,7 +18,7 @@
 
 struct config {
     struct section *sections;
-    pthread_mutex_t mutex;
+    netdata_mutex_t mutex;
     avl_tree_lock index;
 };
 
@@ -35,7 +43,7 @@ extern long long appconfig_set_number(struct config *root, const char *section,
 extern int appconfig_set_boolean(struct config *root, const char *section, const char *name, int value);
 
 extern int appconfig_exists(struct config *root, const char *section, const char *name);
-extern int appconfig_rename(struct config *root, const char *section, const char *old, const char *new);
+extern int appconfig_move(struct config *root, const char *section_old, const char *name_old, const char *section_new, const char *name_new);
 
 extern void appconfig_generate(struct config *root, BUFFER *wb, int only_changed);
 
@@ -54,7 +62,7 @@ extern void appconfig_generate(struct config *root, BUFFER *wb, int only_changed
 #define config_set_boolean(section, name, value) appconfig_set_boolean(&netdata_config, section, name, value)
 
 #define config_exists(section, name) appconfig_exists(&netdata_config, section, name)
-#define config_rename(section, old, new) appconfig_rename(&netdata_config, section, old, new)
+#define config_move(section_old, name_old, section_new, name_new) appconfig_move(&netdata_config, section_old, name_old, section_new, name_new)
 
 #define config_generate(buffer, only_changed) appconfig_generate(&netdata_config, buffer, only_changed)