thermferm/rdconfig.c

changeset 286
674efa17be1d
parent 284
9e6fb5aed618
child 289
d810df0df36a
equal deleted inserted replaced
285:bbe73c2ecacf 286:674efa17be1d
195 /* 195 /*
196 * Add an attribute with name "VERSION" and value "1" to THERMFERM. 196 * Add an attribute with name "VERSION" and value "1" to THERMFERM.
197 */ 197 */
198 if ((rc = xmlTextWriterWriteElement(writer, BAD_CAST "VERSION", BAD_CAST "1")) < 0) { 198 if ((rc = xmlTextWriterWriteElement(writer, BAD_CAST "VERSION", BAD_CAST "1")) < 0) {
199 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement"); 199 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement");
200 return 1;
201 }
202 if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "NAME", "%s", Config.name)) < 0) {
203 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
200 return 1; 204 return 1;
201 } 205 }
202 if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "LISTEN_PORT", "%d", Config.my_port)) < 0) { 206 if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "LISTEN_PORT", "%d", Config.my_port)) < 0) {
203 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); 207 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
204 return 1; 208 return 1;
1593 syslog(LOG_NOTICE, "XML file %s is not a valid version", mypath); 1597 syslog(LOG_NOTICE, "XML file %s is not a valid version", mypath);
1594 return 1; 1598 return 1;
1595 } 1599 }
1596 xmlFree(key); 1600 xmlFree(key);
1597 } 1601 }
1602 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME"))) {
1603 Config.name = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
1604 }
1598 if ((!xmlStrcmp(cur->name, (const xmlChar *)"LISTEN_PORT"))) { 1605 if ((!xmlStrcmp(cur->name, (const xmlChar *)"LISTEN_PORT"))) {
1599 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); 1606 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
1600 if (sscanf((const char *)key, "%d", &ival) == 1) 1607 if (sscanf((const char *)key, "%d", &ival) == 1)
1601 Config.my_port = ival; 1608 Config.my_port = ival;
1602 xmlFree(key); 1609 xmlFree(key);

mercurial