diff options
author | William M. Brack <wbrack@src.gnome.org> | 2004-07-16 10:39:30 +0000 |
---|---|---|
committer | William M. Brack <wbrack@src.gnome.org> | 2004-07-16 10:39:30 +0000 |
commit | c68d78d25a17e65d172ccc1ac24d609c7c1d5cde (patch) | |
tree | 80933570cc4d01ad4984fb29b5e8201f5b901c62 /python/libxml.c | |
parent | c815505f7d7a09a834d33aa6fefe10b48be2bfc9 (diff) | |
download | libxml2-c68d78d25a17e65d172ccc1ac24d609c7c1d5cde.tar.gz |
added a check on the argument for some classes (e.g. xmlDoc and xmlNode)
* python/generator.py: added a check on the argument for some
classes (e.g. xmlDoc and xmlNode) to prevent a segfault (as
reported on the list). Further enhancement should be done
to auto-create the appropriate object.
* python/libxml.c: minor fix for a warning message; added a
routine, currently not used, to report the description of a
PyCObject.
* python/libxml2class.txt: regenerated
Diffstat (limited to 'python/libxml.c')
-rw-r--r-- | python/libxml.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/python/libxml.c b/python/libxml.c index 3db0f5ff..9dda18c7 100644 --- a/python/libxml.c +++ b/python/libxml.c @@ -95,7 +95,8 @@ static void libxml_xmlErrorInitialize(void); /* forward declare */ PyObject * -libxml_xmlMemoryUsed(ATTRIBUTE_UNUSED PyObject * self, PyObject * args) +libxml_xmlMemoryUsed(PyObject * self ATTRIBUTE_UNUSED, + PyObject * args ATTRIBUTE_UNUSED) { long ret; PyObject *py_retval; @@ -107,7 +108,7 @@ libxml_xmlMemoryUsed(ATTRIBUTE_UNUSED PyObject * self, PyObject * args) } PyObject * -libxml_xmlDebugMemory(ATTRIBUTE_UNUSED PyObject * self, PyObject * args) +libxml_xmlDebugMemory(PyObject * self ATTRIBUTE_UNUSED, PyObject * args) { int activate; PyObject *py_retval; @@ -3242,7 +3243,17 @@ libxml_C14NDocSaveTo(ATTRIBUTE_UNUSED PyObject * self, #endif #endif +static PyObject * +libxml_getObjDesc(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + + PyObject *obj; + char *str; + if (!PyArg_ParseTuple(args, (char *)"O:getObjDesc", &obj)) + return NULL; + str = PyCObject_GetDesc(obj); + return Py_BuildValue((char *)"s", str); +} /************************************************************************ * * @@ -3289,6 +3300,7 @@ static PyMethodDef libxmlMethods[] = { {(char *)"xmlC14NDocSaveTo", libxml_C14NDocSaveTo, METH_VARARGS, NULL}, #endif #endif + {(char *) "getObjDesc", libxml_getObjDesc, METH_VARARGS, NULL}, {NULL, NULL, 0, NULL} }; |