dav/scfg.c

changeset 202
faa41a5e817d
parent 200
cc474cf2c2f5
child 203
9a93ebd71984
equal deleted inserted replaced
201:8e5856182668 202:faa41a5e817d
60 60
61 return 0; 61 return 0;
62 } 62 }
63 63
64 int load_sync_config() { 64 int load_sync_config() {
65 directories = ucx_map_new(8);
66
65 char *file = util_concat_path(ENV_HOME, ".dav/sync.xml"); 67 char *file = util_concat_path(ENV_HOME, ".dav/sync.xml");
66 68
67 struct stat s; 69 struct stat s;
68 if(stat(file, &s)) { 70 if(stat(file, &s)) {
69 switch(errno) { 71 switch(errno) {
83 xmlDoc *doc = xmlReadFile(file, NULL, 0); 85 xmlDoc *doc = xmlReadFile(file, NULL, 0);
84 if(!doc) { 86 if(!doc) {
85 fprintf(stderr, "Broken configuration file\n"); 87 fprintf(stderr, "Broken configuration file\n");
86 return -1; 88 return -1;
87 } 89 }
88
89 directories = ucx_map_new(8);
90 90
91 int ret = 0; 91 int ret = 0;
92 xmlNode *node = xmlDocGetRootElement(doc)->children; 92 xmlNode *node = xmlDocGetRootElement(doc)->children;
93 while(node) { 93 while(node) {
94 if(node->type == XML_ELEMENT_NODE) { 94 if(node->type == XML_ELEMENT_NODE) {

mercurial