two nodeset access macros from Thomas Broyer Daniel
* xpath.h: two nodeset access macros from Thomas Broyer
Daniel
diff --git a/include/libxml/xpath.h b/include/libxml/xpath.h
index ae97aea..50f909d 100644
--- a/include/libxml/xpath.h
+++ b/include/libxml/xpath.h
@@ -266,6 +266,16 @@
/**
* Objects and Nodesets handling
*/
+
+/* These macros may later turn into functions */
+#define xmlXPathNodeSetGetLength(ns) ((ns) ? (ns)->nodeNr : 0)
+#define xmlXPathNodeSetItem(ns, index) \
+ ((((ns) != NULL) && \
+ ((index) > 0) && ((index) <= (ns)->nodeNr)) ? \
+ (ns)->nodeTab[(index)] \
+ : NULL)
+
+
void xmlXPathFreeObject (xmlXPathObjectPtr obj);
xmlNodeSetPtr xmlXPathNodeSetCreate (xmlNodePtr val);
void xmlXPathFreeNodeSetList (xmlXPathObjectPtr obj);