aboutsummaryrefslogtreecommitdiffstats
path: root/python/libxml_wrap.h
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2002-02-04 00:17:01 +0000
committerDaniel Veillard <veillard@src.gnome.org>2002-02-04 00:17:01 +0000
commit36eea2d2ee84132e66552f84724e9b377d687681 (patch)
treeceac9c9beb80baacae6f7409c1dc7e559ee97945 /python/libxml_wrap.h
parent4e1b26cfeba7f5fad4f8bd12fb5ce7029f930b79 (diff)
downloadandroid_external_libxml2-36eea2d2ee84132e66552f84724e9b377d687681.tar.gz
android_external_libxml2-36eea2d2ee84132e66552f84724e9b377d687681.tar.bz2
android_external_libxml2-36eea2d2ee84132e66552f84724e9b377d687681.zip
hardened the addChild function added accessors needed for xmlNode, a bit
* tree.c: hardened the addChild function * python/generator.py python/libxml.c python/libxml2-python-api.xml python/libxml2class.txt python/libxml_wrap.h python/TODO: added accessors needed for xmlNode, a bit more testing and extension of interfaces * python/tests/Makefile.am python/tests/build.py: added a test build from scratch/save/load/check Daniel
Diffstat (limited to 'python/libxml_wrap.h')
-rw-r--r--python/libxml_wrap.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/python/libxml_wrap.h b/python/libxml_wrap.h
index 68daf019..679260a3 100644
--- a/python/libxml_wrap.h
+++ b/python/libxml_wrap.h
@@ -15,20 +15,25 @@
#include <libxml/xinclude.h>
#include <libxml/xpointer.h>
-#define PyxmlNode_Get(v) (((PyxmlNode_Object *)(v))->obj)
+#define PyxmlNode_Get(v) (((v) == Py_None) ? NULL : \
+ (((PyxmlNode_Object *)(v))->obj))
typedef struct {
PyObject_HEAD
xmlNodePtr obj;
} PyxmlNode_Object;
-#define PyxmlXPathContext_Get(v) (((PyxmlXPathContext_Object *)(v))->obj)
+#define PyxmlXPathContext_Get(v) (((v) == Py_None) ? NULL : \
+ (((PyxmlXPathContext_Object *)(v))->obj))
+
typedef struct {
PyObject_HEAD
xmlXPathContextPtr obj;
} PyxmlXPathContext_Object;
-#define PyparserCtxt_Get(v) (((PyparserCtxt_Object *)(v))->obj)
+#define PyparserCtxt_Get(v) (((v) == Py_None) ? NULL : \
+ (((PyparserCtxt_Object *)(v))->obj))
+
typedef struct {
PyObject_HEAD
xmlParserCtxtPtr obj;