diff options
| author | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-20 00:25:56 +0100 |
|---|---|---|
| committer | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-20 00:25:56 +0100 |
| commit | 47dcc0dd75a00a8cc8eaceb02814562b01c2941a (patch) | |
| tree | 71b9808315a510008aa5a4cdeb572d897d516bd5 /common | |
| parent | abb106e3f10b4d7ab8e4ac4f22b118a5db3aac86 (diff) | |
| download | eurephia-47dcc0dd75a00a8cc8eaceb02814562b01c2941a.tar.gz eurephia-47dcc0dd75a00a8cc8eaceb02814562b01c2941a.tar.xz eurephia-47dcc0dd75a00a8cc8eaceb02814562b01c2941a.zip | |
Corrected wrong declaration of xmlExtractContent(...) and xmlGetNodeContent(...)
Diffstat (limited to 'common')
| -rw-r--r-- | common/eurephia_xml.c | 12 | ||||
| -rw-r--r-- | common/eurephia_xml.h | 8 |
2 files changed, 12 insertions, 8 deletions
diff --git a/common/eurephia_xml.c b/common/eurephia_xml.c index cbf7ec4..e2a1de5 100644 --- a/common/eurephia_xml.c +++ b/common/eurephia_xml.c @@ -67,8 +67,7 @@ int eurephiaXML_CreateDoc(eurephiaCTX *ctx, int format, const char *eurephiaRoot assert(*root_n != NULL); // Add eurephia XML document format version id - snprintf(tmp, 33, "%i%c", format, '\0'); - xmlNewProp(*root_n, (xmlChar *)"format", (xmlChar *)tmp); + snprintf(tmp, 33, "%i%c", format, '\0'); xmlNewProp(*root_n, (xmlChar *)"format", (xmlChar *)tmp); xmlDocSetRootElement(*doc, *root_n); // Add the eurephia XML root (always inside the <eurephia/> tags) @@ -102,4 +101,13 @@ xmlNode *eurephiaXML_getRoot(eurephiaCTX *ctx, xmlDoc *doc, const char *nodeset, return xmlFindNode(root, nodeset); } + +inline char *xmlExtractContent(xmlNode *n) { + return (char *) (((n != NULL) && (n->children != NULL)) ? n->children->content : NULL); +} + + +inline char *xmlGetNodeContent(xmlNode *node, const char *key) { + return xmlExtractContent(xmlFindNode(node, key)); +} #endif diff --git a/common/eurephia_xml.h b/common/eurephia_xml.h index f03be27..e55f4e3 100644 --- a/common/eurephia_xml.h +++ b/common/eurephia_xml.h @@ -30,12 +30,8 @@ xmlNode *xmlFindNode(xmlNode *node, const char *key); int eurephiaXML_CreateDoc(eurephiaCTX *ctx, int format, const char *rootname, xmlDoc **doc, xmlNode **root_n); xmlNode *eurephiaXML_getRoot(eurephiaCTX *ctx, xmlDoc *doc, const char *nodeset, int min_format); -inline char *xmlExtractContent(xmlNode *n) { - return (char *) (((n != NULL) && (n->children != NULL)) ? n->children->content : NULL); -} -inline char *xmlGetNodeContent(xmlNode *node, const char *key) { - return xmlExtractContent(xmlFindNode(node, key)); -} +inline char *xmlExtractContent(xmlNode *n); +inline char *xmlGetNodeContent(xmlNode *node, const char *key); #endif /* HAVE_LIBXML2 */ |
