diff options
Diffstat (limited to 'common/eurephia_xml.h')
-rw-r--r-- | common/eurephia_xml.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/common/eurephia_xml.h b/common/eurephia_xml.h index 51ee9dd..614394a 100644 --- a/common/eurephia_xml.h +++ b/common/eurephia_xml.h @@ -45,6 +45,16 @@ typedef enum _exmlResultType { exmlRESULT = 1, /**< Operation successful. Additi #include <libxml/tree.h> /** + * Structure which is used when parsing eurephia Result XML documents + */ +typedef struct _eurephiaRESULT { + exmlResultType resultType; /**< Indicates what kind of result we received */ + const char *message; /**< String containing the result message */ + xmlNode *details; /**< A result message can attach an XML node with even more + detailed information */ +} eurephiaRESULT; + +/** * Simple iterator macro for iterating xmlNode pointers * * @param start Pointer to an xmlNode where to start iterating @@ -58,7 +68,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); -xmlDoc *eurephiaXML_ResultMsg(eurephiaCTX *ctx, exmlResultType type, const char *fmt, ... ); +xmlDoc *eurephiaXML_ResultMsg(eurephiaCTX *ctx, exmlResultType type, xmlNode *info_n, const char *fmt, ... ); +eurephiaRESULT *eurephiaXML_ParseResultMsg(eurephiaCTX *ctx, xmlDoc *resxml); inline char *xmlExtractContent(xmlNode *n); inline char *xmlGetNodeContent(xmlNode *node, const char *key); |