Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00032 #ifndef EUREPHIA_XML_H_
00033 # define EUREPHIA_XML_H_
00034
00038 typedef enum _exmlResultType { exmlRESULT = 1,
00039 exmlERROR
00040 } exmlResultType;
00041
00042 #include <stdarg.h>
00043
00044 #ifdef HAVE_LIBXML2
00045 #include <libxml/tree.h>
00046
00050 typedef struct _eurephiaRESULT {
00051 exmlResultType resultType;
00052 const char *message;
00053 xmlNode *details;
00055 } eurephiaRESULT;
00056
00063 #define foreach_xmlnode(start, itn) for( itn = start; itn != NULL; itn = itn->next )
00064
00065 void xmlReplaceChars(xmlChar *str, char s, char r);
00066
00067 char *xmlGetAttrValue(xmlAttr *properties, const char *key);
00068 xmlNode *xmlFindNode(xmlNode *node, const char *key);
00069
00070 int eurephiaXML_CreateDoc(eurephiaCTX *ctx, int format, const char *rootname, xmlDoc **doc, xmlNode **root_n);
00071 xmlNode *eurephiaXML_getRoot(eurephiaCTX *ctx, xmlDoc *doc, const char *nodeset, int min_format);
00072
00073 xmlDoc *eurephiaXML_ResultMsg(eurephiaCTX *ctx, exmlResultType type, xmlNode *info_n, const char *fmt, ... );
00074 unsigned int eurephiaXML_IsResultMsg(eurephiaCTX *ctx, xmlDoc *resxml);
00075 eurephiaRESULT *eurephiaXML_ParseResultMsg(eurephiaCTX *ctx, xmlDoc *resxml);
00076
00077 inline char *xmlExtractContent(xmlNode *n);
00078 inline char *xmlGetNodeContent(xmlNode *node, const char *key);
00079
00080 #endif
00081
00082 #endif