return 0;
}
-static int nw_config_parse(struct nw_config* config, FILE* f) {
+int nw_config_readf(struct nw_config* config, FILE* f) {
// XXX TODO
return 0;
}
-int nw_config_readf(struct nw_config** config, FILE* f) {
- int r;
-
- // Create a new config object
- r = nw_config_create(config);
- if (r)
- return r;
-
- // Parse the configuration
- r = nw_config_parse(*config, f);
- if (r)
- goto ERROR;
-
- return 0;
-
-ERROR:
- nw_config_free(*config);
- return r;
-}
-
-int nw_config_read(struct nw_config** config, const char* path) {
+int nw_config_read(struct nw_config* config, const char* path) {
FILE* f = NULL;
int r;
int nw_config_flush(struct nw_config* config);
-int nw_config_readf(struct nw_config** config, FILE* f);
-int nw_config_read(struct nw_config** config, const char* path);
+int nw_config_readf(struct nw_config* config, FILE* f);
+int nw_config_read(struct nw_config* config, const char* path);
int nw_config_writef(struct nw_config* config, FILE* f);
int nw_config_write(struct nw_config* config, const char* path);