owntone-server/src/config-driver.c

31 lines
585 B
C
Raw Normal View History

2006-02-04 19:22:46 -05:00
/*
* $Id$
*/
#include <stdio.h>
2006-02-08 18:02:43 -05:00
#include "conf.h"
#include "err.h"
2006-02-04 19:22:46 -05:00
int main(int argc, char *argv[]) {
2006-02-08 18:02:43 -05:00
int err;
err_debuglevel = 9;
printf("Reading %s\n",argv[1]);
2006-02-20 22:08:14 -05:00
if((err=conf_read(argv[1])) != CONF_E_SUCCESS) {
2006-02-08 18:02:43 -05:00
printf("Error reading config: %d\n",err);
conf_close();
2006-02-04 19:22:46 -05:00
} else {
2006-02-08 18:02:43 -05:00
printf("Read config!\n");
conf_set_string("general","stupid","lalala");
conf_set_int("potato","yummy",0);
if(conf_iswritable()) {
printf("writing config\n");
conf_write();
}
2006-02-04 19:22:46 -05:00
}
2006-02-20 22:08:14 -05:00
conf_close();
2006-02-04 19:22:46 -05:00
}