From 34e88897f13a2fe4b570f2493799e5a4b6b5c2e8 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Mon, 14 Sep 2009 12:07:02 +0200 Subject: Added a simple xmlNode iterator for future usage --- common/eurephia_xml.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/eurephia_xml.h b/common/eurephia_xml.h index cfa0e60..51ee9dd 100644 --- a/common/eurephia_xml.h +++ b/common/eurephia_xml.h @@ -44,6 +44,14 @@ typedef enum _exmlResultType { exmlRESULT = 1, /**< Operation successful. Additi #ifdef HAVE_LIBXML2 #include +/** + * Simple iterator macro for iterating xmlNode pointers + * + * @param start Pointer to an xmlNode where to start iterating + * @param itn An xmlNode pointer which will be used for the iteration. + */ +#define foreach_xmlnode(start, itn) for( itn = start; itn != NULL; itn = itn->next ) + char *xmlGetAttrValue(xmlAttr *properties, const char *key); xmlNode *xmlFindNode(xmlNode *node, const char *key); -- cgit