+bool read_host_config(meshlink_handle_t *mesh, splay_tree_t *config_tree, const char *name) {
+ char filename[PATH_MAX];
+ bool x;
+
+ snprintf(filename,PATH_MAX, "%s" SLASH "hosts" SLASH "%s", mesh->confbase, name);
+ x = read_config_file(config_tree, filename);
+
+ return x;
+}
+
+bool append_config_file(meshlink_handle_t *mesh, const char *name, const char *key, const char *value) {
+ char filename[PATH_MAX];
+ snprintf(filename,PATH_MAX, "%s" SLASH "hosts" SLASH "%s", mesh->confbase, name);
+
+ FILE *fp = fopen(filename, "a");
+
+ if(!fp) {
+ logger(DEBUG_ALWAYS, LOG_ERR, "Cannot open config file %s: %s", filename, strerror(errno));
+ } else {
+ fprintf(fp, "%s = %s\n", key, value);
+ fclose(fp);
+ }