}
logger(NULL, MESHLINK_ERROR, "\"yes\" or \"no\" expected for configuration variable %s in %s line %d",
- cfg->variable, cfg->file, cfg->line);
+ cfg->variable, cfg->file, cfg->line);
return false;
}
return true;
logger(NULL, MESHLINK_ERROR, "Integer expected for configuration variable %s in %s line %d",
- cfg->variable, cfg->file, cfg->line);
+ cfg->variable, cfg->file, cfg->line);
return false;
}
-bool set_config_int(config_t *cfg, int val)
-{
+bool set_config_int(config_t *cfg, int val) {
if(!cfg)
return false;
return true;
}
-bool set_config_string(config_t *cfg, const char* val)
-{
+bool set_config_string(config_t *cfg, const char* val) {
if(!cfg)
return false;
}
logger(NULL, MESHLINK_ERROR, "Hostname or IP address expected for configuration variable %s in %s line %d",
- cfg->variable, cfg->file, cfg->line);
+ cfg->variable, cfg->file, cfg->line);
return false;
}
if(!*value) {
const char err[] = "No value for variable";
logger(NULL, MESHLINK_ERROR, "%s `%s' on line %d while reading config file %s",
- err, variable, lineno, fname);
+ err, variable, lineno, fname);
return NULL;
}
}
cfg = parse_config_line(line, fname, lineno);
- if (!cfg)
+ if(!cfg)
break;
config_add(config_tree, cfg);
}
return result;
}
-bool write_config_file(const struct splay_tree_t *config_tree, const char *fname)
-{
+bool write_config_file(const struct splay_tree_t *config_tree, const char *fname) {
FILE *fp;
fp = fopen(fname, "w+");
return false;
}
- for splay_each(config_t, cnf, config_tree)
- {
+ for splay_each(config_t, cnf, config_tree) {
if(fwrite(cnf->variable, sizeof(char), strlen(cnf->variable), fp) < strlen(cnf->variable))
goto error;
return x;
}
-bool write_host_config(struct meshlink_handle *mesh, const struct splay_tree_t *config_tree, const char *name)
-{
+bool write_host_config(struct meshlink_handle *mesh, const struct splay_tree_t *config_tree, const char *name) {
char filename[PATH_MAX];
snprintf(filename,PATH_MAX, "%s" SLASH "hosts" SLASH "%s", mesh->confbase, name);