dav/scfg.c

changeset 367
4a6a59f89f9f
parent 364
3769ba002fd1
child 368
11797f33bc24
equal deleted inserted replaced
366:5228b912c925 367:4a6a59f89f9f
153 static TagConfig* parse_tagconfig(xmlNode *node) { 153 static TagConfig* parse_tagconfig(xmlNode *node) {
154 TagConfig conf; 154 TagConfig conf;
155 conf.store = TAG_STORE_XATTR; 155 conf.store = TAG_STORE_XATTR;
156 conf.local_format = TAG_FORMAT_TEXT; 156 conf.local_format = TAG_FORMAT_TEXT;
157 conf.server_format = TAG_FORMAT_XML; 157 conf.server_format = TAG_FORMAT_XML;
158 conf.scan = false;
158 xmlNode *c = node->children; 159 xmlNode *c = node->children;
159 160
160 // TODO: error handling 161 // TODO: error handling
161 while(c) { 162 while(c) {
162 if(node->type == XML_ELEMENT_NODE) { 163 if(c->type == XML_ELEMENT_NODE) {
163 char *value = util_xml_get_text(c); 164 char *value = util_xml_get_text(c);
164 if(xstreq(c->name, "local-store")) { 165 if(xstreq(c->name, "local-store")) {
165 if(!value) { 166 if(!value) {
166 return NULL; 167 return NULL;
167 } else if(xstreq(value, "xattr")) { 168 } else if(xstreq(value, "xattr")) {
181 conf.local_format = str2tagformat(value); 182 conf.local_format = str2tagformat(value);
182 } 183 }
183 } 184 }
184 attr = attr->next; 185 attr = attr->next;
185 } 186 }
187 } else if(xstreq(c->name, "scan")) {
188 if(!value) {
189 return NULL;
190 }
191 conf.scan = util_getboolean(value);
186 } 192 }
187 } 193 }
188 c = c->next; 194 c = c->next;
189 } 195 }
190 196

mercurial