1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-05 19:01:18 +03:00

more work on the python bindings. Daniel

* python/generator.py python/libxml.c python/libxml_wrap.h:
  more work on the python bindings.
Daniel
This commit is contained in:
Daniel Veillard
2002-01-30 20:52:23 +00:00
parent d2897fde00
commit 96fe095d4b
4 changed files with 131 additions and 21 deletions

View File

@ -3,6 +3,7 @@
#include <libxml/parser.h>
#include <libxml/tree.h>
#include "libxml_wrap.h"
#include "libxml2-py.h"
/* #define DEBUG */
@ -22,6 +23,17 @@ libxml_intWrap(int val) {
return(ret);
}
PyObject *
libxml_doubleWrap(double val) {
PyObject *ret;
#ifdef DEBUG
printf("libxml_doubleWrap: val = %f\n", val);
#endif
ret = PyFloat_FromDouble((double) val);
return(ret);
}
PyObject *
libxml_charPtrWrap(const char *str) {
PyObject *ret;
@ -100,13 +112,6 @@ libxml_xmlAttrPtrWrap(xmlAttrPtr attr) {
return(ret);
}
#define PyxmlNode_Get(v) (((PyxmlNode_Object *)(v))->obj)
typedef struct {
PyObject_HEAD
xmlNodePtr obj;
} PyxmlNode_Object;
static void
PyxmlNode_dealloc(PyxmlNode_Object * self)
{
@ -597,6 +602,7 @@ libxml_freeDoc(PyObject *self, PyObject *args)
* *
************************************************************************/
static PyMethodDef libxmlMethods[] = {
#include "libxml2-export.c"
{ "parseFile", libxml_parseFile, METH_VARARGS },
{ "freeDoc", libxml_freeDoc, METH_VARARGS },
{ "name", libxml_name, METH_VARARGS },