diff options
| author | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-17 09:43:13 +0100 |
|---|---|---|
| committer | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-17 09:43:13 +0100 |
| commit | 4f5bcdbd99fe9bfb3af5bdfa2a8bd973aa9a5bad (patch) | |
| tree | effcb477ccbd429ec12951dda70b6ed03fe08242 /database/sqlite | |
| parent | 58619e09c5d554e66cad768a9abd6b2fff7f5a62 (diff) | |
| download | eurephia-4f5bcdbd99fe9bfb3af5bdfa2a8bd973aa9a5bad.tar.gz eurephia-4f5bcdbd99fe9bfb3af5bdfa2a8bd973aa9a5bad.tar.xz eurephia-4f5bcdbd99fe9bfb3af5bdfa2a8bd973aa9a5bad.zip | |
Using the new eurephiaXML_* functions for creating and parsing XML
Also rebased the XML file to always have a document root which
is <eurephia/>. This tag must contain a "format" attribute, which
should be 1 for the moment.
When parsing the XML, the eurephiaXML_getRoot(...) function will
return a pointer to the requested XML node inside the <eurephia/>
document root. The format version in the root element will also
be checked automatically.
Diffstat (limited to 'database/sqlite')
| -rw-r--r-- | database/sqlite/administration.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/database/sqlite/administration.c b/database/sqlite/administration.c index a538adf..7e1855f 100644 --- a/database/sqlite/administration.c +++ b/database/sqlite/administration.c @@ -382,11 +382,9 @@ xmlDoc *eDBadminGetUserList(eurephiaCTX *ctx, const char *sortkeys) { // Prepare a list with all users memset(&tmp, 0, 34); - userlist = xmlNewDoc((xmlChar *)"1.0"); - root_n = xmlNewNode(NULL, (xmlChar *)"userlist"); + eurephiaXML_CreateDoc(ctx, 1, "userlist", &userlist, &root_n); snprintf(tmp, 32, "%i", sqlite_get_numtuples(res)); xmlNewProp(root_n, (xmlChar *)"usercount", (xmlChar *)tmp); - xmlDocSetRootElement(userlist, root_n); // Register all records for( i = 0; i < sqlite_get_numtuples(res); i++ ) { @@ -457,11 +455,9 @@ xmlDoc *eDBadminGetUserInfo(eurephiaCTX *ctx, int getInfo, xmlDoc *srch) { case 1: uid = atoi_nullsafe(sqlite_get_value(uinf, 0, 4)); - doc = xmlNewDoc((xmlChar *) "1.0"); - root_n = xmlNewNode(NULL, (xmlChar *) "user"); + eurephiaXML_CreateDoc(ctx, 1, "user", &doc, &root_n); sqlite_xml_value(root_n, XML_ATTR, "uid", uinf, 0, 4); sqlite_xml_value(root_n, XML_NODE, "username", uinf, 0, 0); - xmlDocSetRootElement(doc, root_n); info_n = xmlNewChild(root_n, NULL, (xmlChar *) "flags", NULL); |
