version 1.1.1.1, 2012/02/21 23:38:00
|
version 1.1.1.2, 2014/06/15 19:53:33
|
Line 9
|
Line 9
|
#include "libxml_wrap.h" |
#include "libxml_wrap.h" |
#include <libxml/xpathInternals.h> |
#include <libxml/xpathInternals.h> |
|
|
|
#if PY_MAJOR_VERSION >= 3 |
|
#define PY_IMPORT_STRING_SIZE PyUnicode_FromStringAndSize |
|
#define PY_IMPORT_STRING PyUnicode_FromString |
|
#define PY_IMPORT_INT PyLong_FromLong |
|
#else |
|
#define PY_IMPORT_STRING_SIZE PyString_FromStringAndSize |
|
#define PY_IMPORT_STRING PyString_FromString |
|
#define PY_IMPORT_INT PyInt_FromLong |
|
#endif |
|
|
|
#if PY_MAJOR_VERSION >= 3 |
|
#include <stdio.h> |
|
#include <unistd.h> |
|
#include <fcntl.h> |
|
|
|
FILE * |
|
libxml_PyFileGet(PyObject *f) { |
|
int fd, flags; |
|
FILE *res; |
|
const char *mode; |
|
|
|
fd = PyObject_AsFileDescriptor(f); |
|
if (!_PyVerify_fd(fd)) |
|
return(NULL); |
|
/* |
|
* Get the flags on the fd to understand how it was opened |
|
*/ |
|
flags = fcntl(fd, F_GETFL, 0); |
|
switch (flags & O_ACCMODE) { |
|
case O_RDWR: |
|
if (flags & O_APPEND) |
|
mode = "a+"; |
|
else |
|
mode = "rw"; |
|
break; |
|
case O_RDONLY: |
|
if (flags & O_APPEND) |
|
mode = "r+"; |
|
else |
|
mode = "r"; |
|
break; |
|
case O_WRONLY: |
|
if (flags & O_APPEND) |
|
mode = "a"; |
|
else |
|
mode = "w"; |
|
break; |
|
default: |
|
return(NULL); |
|
} |
|
|
|
/* |
|
* the FILE struct gets a new fd, so that it can be closed |
|
* independently of the file descriptor given. The risk though is |
|
* lack of sync. So at the python level sync must be implemented |
|
* before and after a conversion took place. No way around it |
|
* in the Python3 infrastructure ! |
|
* The duplicated fd and FILE * will be released in the subsequent |
|
* call to libxml_PyFileRelease() which must be genrated accodingly |
|
*/ |
|
fd = dup(fd); |
|
if (fd == -1) |
|
return(NULL); |
|
res = fdopen(fd, mode); |
|
if (res == NULL) { |
|
close(fd); |
|
return(NULL); |
|
} |
|
return(res); |
|
} |
|
|
|
void libxml_PyFileRelease(FILE *f) { |
|
if (f != NULL) |
|
fclose(f); |
|
} |
|
#endif |
|
|
PyObject * |
PyObject * |
libxml_intWrap(int val) |
libxml_intWrap(int val) |
{ |
{ |
Line 17 libxml_intWrap(int val)
|
Line 94 libxml_intWrap(int val)
|
#ifdef DEBUG |
#ifdef DEBUG |
printf("libxml_intWrap: val = %d\n", val); |
printf("libxml_intWrap: val = %d\n", val); |
#endif |
#endif |
ret = PyInt_FromLong((long) val); | ret = PY_IMPORT_INT((long) val); |
return (ret); |
return (ret); |
} |
} |
|
|
Line 29 libxml_longWrap(long val)
|
Line 106 libxml_longWrap(long val)
|
#ifdef DEBUG |
#ifdef DEBUG |
printf("libxml_longWrap: val = %ld\n", val); |
printf("libxml_longWrap: val = %ld\n", val); |
#endif |
#endif |
ret = PyInt_FromLong(val); | ret = PyLong_FromLong(val); |
return (ret); |
return (ret); |
} |
} |
|
|
Line 57 libxml_charPtrWrap(char *str)
|
Line 134 libxml_charPtrWrap(char *str)
|
Py_INCREF(Py_None); |
Py_INCREF(Py_None); |
return (Py_None); |
return (Py_None); |
} |
} |
/* TODO: look at deallocation */ | ret = PY_IMPORT_STRING(str); |
ret = PyString_FromString(str); | |
xmlFree(str); |
xmlFree(str); |
return (ret); |
return (ret); |
} |
} |
Line 75 libxml_charPtrConstWrap(const char *str)
|
Line 151 libxml_charPtrConstWrap(const char *str)
|
Py_INCREF(Py_None); |
Py_INCREF(Py_None); |
return (Py_None); |
return (Py_None); |
} |
} |
/* TODO: look at deallocation */ | ret = PY_IMPORT_STRING(str); |
ret = PyString_FromString(str); | |
return (ret); |
return (ret); |
} |
} |
|
|
Line 92 libxml_xmlCharPtrWrap(xmlChar * str)
|
Line 167 libxml_xmlCharPtrWrap(xmlChar * str)
|
Py_INCREF(Py_None); |
Py_INCREF(Py_None); |
return (Py_None); |
return (Py_None); |
} |
} |
/* TODO: look at deallocation */ | ret = PY_IMPORT_STRING((char *) str); |
ret = PyString_FromString((char *) str); | |
xmlFree(str); |
xmlFree(str); |
return (ret); |
return (ret); |
} |
} |
Line 110 libxml_xmlCharPtrConstWrap(const xmlChar * str)
|
Line 184 libxml_xmlCharPtrConstWrap(const xmlChar * str)
|
Py_INCREF(Py_None); |
Py_INCREF(Py_None); |
return (Py_None); |
return (Py_None); |
} |
} |
/* TODO: look at deallocation */ | ret = PY_IMPORT_STRING((char *) str); |
ret = PyString_FromString((char *) str); | |
return (ret); |
return (ret); |
} |
} |
|
|
Line 127 libxml_constcharPtrWrap(const char *str)
|
Line 200 libxml_constcharPtrWrap(const char *str)
|
Py_INCREF(Py_None); |
Py_INCREF(Py_None); |
return (Py_None); |
return (Py_None); |
} |
} |
/* TODO: look at deallocation */ | ret = PY_IMPORT_STRING(str); |
ret = PyString_FromString(str); | |
return (ret); |
return (ret); |
} |
} |
|
|
Line 144 libxml_constxmlCharPtrWrap(const xmlChar * str)
|
Line 216 libxml_constxmlCharPtrWrap(const xmlChar * str)
|
Py_INCREF(Py_None); |
Py_INCREF(Py_None); |
return (Py_None); |
return (Py_None); |
} |
} |
/* TODO: look at deallocation */ | ret = PY_IMPORT_STRING((char *) str); |
ret = PyString_FromString((char *) str); | |
return (ret); |
return (ret); |
} |
} |
|
|
Line 162 libxml_xmlDocPtrWrap(xmlDocPtr doc)
|
Line 233 libxml_xmlDocPtrWrap(xmlDocPtr doc)
|
return (Py_None); |
return (Py_None); |
} |
} |
/* TODO: look at deallocation */ |
/* TODO: look at deallocation */ |
ret = | ret = PyCapsule_New((void *) doc, (char *) "xmlDocPtr", NULL); |
PyCObject_FromVoidPtrAndDesc((void *) doc, (char *) "xmlDocPtr", | |
NULL); | |
return (ret); |
return (ret); |
} |
} |
|
|
Line 180 libxml_xmlNodePtrWrap(xmlNodePtr node)
|
Line 249 libxml_xmlNodePtrWrap(xmlNodePtr node)
|
Py_INCREF(Py_None); |
Py_INCREF(Py_None); |
return (Py_None); |
return (Py_None); |
} |
} |
ret = | ret = PyCapsule_New((void *) node, (char *) "xmlNodePtr", NULL); |
PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "xmlNodePtr", | |
NULL); | |
return (ret); |
return (ret); |
} |
} |
|
|
Line 198 libxml_xmlURIPtrWrap(xmlURIPtr uri)
|
Line 265 libxml_xmlURIPtrWrap(xmlURIPtr uri)
|
Py_INCREF(Py_None); |
Py_INCREF(Py_None); |
return (Py_None); |
return (Py_None); |
} |
} |
ret = | ret = PyCapsule_New((void *) uri, (char *) "xmlURIPtr", NULL); |
PyCObject_FromVoidPtrAndDesc((void *) uri, (char *) "xmlURIPtr", | |
NULL); | |
return (ret); |
return (ret); |
} |
} |
|
|
Line 216 libxml_xmlNsPtrWrap(xmlNsPtr ns)
|
Line 281 libxml_xmlNsPtrWrap(xmlNsPtr ns)
|
Py_INCREF(Py_None); |
Py_INCREF(Py_None); |
return (Py_None); |
return (Py_None); |
} |
} |
ret = | ret = PyCapsule_New((void *) ns, (char *) "xmlNsPtr", NULL); |
PyCObject_FromVoidPtrAndDesc((void *) ns, (char *) "xmlNsPtr", | |
NULL); | |
return (ret); |
return (ret); |
} |
} |
|
|
Line 234 libxml_xmlAttrPtrWrap(xmlAttrPtr attr)
|
Line 297 libxml_xmlAttrPtrWrap(xmlAttrPtr attr)
|
Py_INCREF(Py_None); |
Py_INCREF(Py_None); |
return (Py_None); |
return (Py_None); |
} |
} |
ret = | ret = PyCapsule_New((void *) attr, (char *) "xmlAttrPtr", NULL); |
PyCObject_FromVoidPtrAndDesc((void *) attr, (char *) "xmlAttrPtr", | |
NULL); | |
return (ret); |
return (ret); |
} |
} |
|
|
Line 252 libxml_xmlAttributePtrWrap(xmlAttributePtr attr)
|
Line 313 libxml_xmlAttributePtrWrap(xmlAttributePtr attr)
|
Py_INCREF(Py_None); |
Py_INCREF(Py_None); |
return (Py_None); |
return (Py_None); |
} |
} |
ret = | ret = PyCapsule_New((void *) attr, (char *) "xmlAttributePtr", NULL); |
PyCObject_FromVoidPtrAndDesc((void *) attr, | |
(char *) "xmlAttributePtr", NULL); | |
return (ret); |
return (ret); |
} |
} |
|
|
Line 270 libxml_xmlElementPtrWrap(xmlElementPtr elem)
|
Line 329 libxml_xmlElementPtrWrap(xmlElementPtr elem)
|
Py_INCREF(Py_None); |
Py_INCREF(Py_None); |
return (Py_None); |
return (Py_None); |
} |
} |
ret = | ret = PyCapsule_New((void *) elem, (char *) "xmlElementPtr", NULL); |
PyCObject_FromVoidPtrAndDesc((void *) elem, | |
(char *) "xmlElementPtr", NULL); | |
return (ret); |
return (ret); |
} |
} |
|
|
Line 288 libxml_xmlXPathContextPtrWrap(xmlXPathContextPtr ctxt)
|
Line 345 libxml_xmlXPathContextPtrWrap(xmlXPathContextPtr ctxt)
|
Py_INCREF(Py_None); |
Py_INCREF(Py_None); |
return (Py_None); |
return (Py_None); |
} |
} |
ret = | ret = PyCapsule_New((void *) ctxt, (char *) "xmlXPathContextPtr", NULL); |
PyCObject_FromVoidPtrAndDesc((void *) ctxt, | |
(char *) "xmlXPathContextPtr", NULL); | |
return (ret); |
return (ret); |
} |
} |
|
|
Line 306 libxml_xmlXPathParserContextPtrWrap(xmlXPathParserCont
|
Line 361 libxml_xmlXPathParserContextPtrWrap(xmlXPathParserCont
|
Py_INCREF(Py_None); |
Py_INCREF(Py_None); |
return (Py_None); |
return (Py_None); |
} |
} |
ret = PyCObject_FromVoidPtrAndDesc((void *) ctxt, | ret = PyCapsule_New((void *)ctxt, (char *)"xmlXPathParserContextPtr", NULL); |
(char *) "xmlXPathParserContextPtr", | |
NULL); | |
return (ret); |
return (ret); |
} |
} |
|
|
Line 325 libxml_xmlParserCtxtPtrWrap(xmlParserCtxtPtr ctxt)
|
Line 378 libxml_xmlParserCtxtPtrWrap(xmlParserCtxtPtr ctxt)
|
return (Py_None); |
return (Py_None); |
} |
} |
|
|
ret = | ret = PyCapsule_New((void *) ctxt, (char *) "xmlParserCtxtPtr", NULL); |
PyCObject_FromVoidPtrAndDesc((void *) ctxt, | |
(char *) "xmlParserCtxtPtr", NULL); | |
return (ret); |
return (ret); |
} |
} |
|
|
/** |
/** |
* libxml_xmlXPathDestructNsNode: |
* libxml_xmlXPathDestructNsNode: |
* cobj: xmlNsPtr namespace node | * cap: xmlNsPtr namespace node capsule object |
* desc: ignored string | |
* |
* |
* This function is called if and when a namespace node returned in |
* This function is called if and when a namespace node returned in |
* an XPath node set is to be destroyed. That's the only kind of |
* an XPath node set is to be destroyed. That's the only kind of |
* object returned in node set not directly linked to the original |
* object returned in node set not directly linked to the original |
* xmlDoc document, see xmlXPathNodeSetDupNs. |
* xmlDoc document, see xmlXPathNodeSetDupNs. |
*/ |
*/ |
|
#if PY_VERSION_HEX < 0x02070000 |
static void |
static void |
libxml_xmlXPathDestructNsNode(void *cobj, void *desc ATTRIBUTE_UNUSED) { | libxml_xmlXPathDestructNsNode(void *cap, void *desc ATTRIBUTE_UNUSED) |
| #else |
| static void |
| libxml_xmlXPathDestructNsNode(PyObject *cap) |
| #endif |
| { |
#ifdef DEBUG |
#ifdef DEBUG |
fprintf(stderr, "libxml_xmlXPathDestructNsNode called %p\n", cobj); | fprintf(stderr, "libxml_xmlXPathDestructNsNode called %p\n", cap); |
#endif |
#endif |
xmlXPathNodeSetFreeNs((xmlNsPtr) cobj); | #if PY_VERSION_HEX < 0x02070000 |
| xmlXPathNodeSetFreeNs((xmlNsPtr) cap); |
| #else |
| xmlXPathNodeSetFreeNs((xmlNsPtr) PyCapsule_GetPointer(cap, "xmlNsPtr")); |
| #endif |
} |
} |
|
|
PyObject * |
PyObject * |
Line 400 libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj)
|
Line 460 libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj)
|
for (i = 0; i < obj->nodesetval->nodeNr; i++) { |
for (i = 0; i < obj->nodesetval->nodeNr; i++) { |
node = obj->nodesetval->nodeTab[i]; |
node = obj->nodesetval->nodeTab[i]; |
if (node->type == XML_NAMESPACE_DECL) { |
if (node->type == XML_NAMESPACE_DECL) { |
PyObject *ns = | PyObject *ns = PyCapsule_New((void *) node, |
PyCObject_FromVoidPtrAndDesc((void *) node, | |
(char *) "xmlNsPtr", |
(char *) "xmlNsPtr", |
libxml_xmlXPathDestructNsNode); |
libxml_xmlXPathDestructNsNode); |
PyList_SetItem(ret, i, ns); |
PyList_SetItem(ret, i, ns); |
Line 414 libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj)
|
Line 473 libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj)
|
} |
} |
break; |
break; |
case XPATH_BOOLEAN: |
case XPATH_BOOLEAN: |
ret = PyInt_FromLong((long) obj->boolval); | ret = PY_IMPORT_INT((long) obj->boolval); |
break; |
break; |
case XPATH_NUMBER: |
case XPATH_NUMBER: |
ret = PyFloat_FromDouble(obj->floatval); |
ret = PyFloat_FromDouble(obj->floatval); |
break; |
break; |
case XPATH_STRING: |
case XPATH_STRING: |
ret = PyString_FromString((char *) obj->stringval); | ret = PY_IMPORT_STRING((char *) obj->stringval); |
break; |
break; |
case XPATH_POINT: |
case XPATH_POINT: |
{ |
{ |
Line 429 libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj)
|
Line 488 libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj)
|
PyObject *tuple; |
PyObject *tuple; |
|
|
node = libxml_xmlNodePtrWrap(obj->user); |
node = libxml_xmlNodePtrWrap(obj->user); |
indexIntoNode = PyInt_FromLong((long) obj->index); | indexIntoNode = PY_IMPORT_INT((long) obj->index); |
|
|
tuple = PyTuple_New(2); |
tuple = PyTuple_New(2); |
PyTuple_SetItem(tuple, 0, node); |
PyTuple_SetItem(tuple, 0, node); |
Line 453 libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj)
|
Line 512 libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj)
|
list = PyList_New(1); |
list = PyList_New(1); |
|
|
node = libxml_xmlNodePtrWrap(obj->user); |
node = libxml_xmlNodePtrWrap(obj->user); |
indexIntoNode = PyInt_FromLong((long) obj->index); | indexIntoNode = PY_IMPORT_INT((long) obj->index); |
|
|
tuple = PyTuple_New(2); |
tuple = PyTuple_New(2); |
PyTuple_SetItem(tuple, 0, node); |
PyTuple_SetItem(tuple, 0, node); |
Line 471 libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj)
|
Line 530 libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj)
|
list = PyList_New(2); |
list = PyList_New(2); |
|
|
node = libxml_xmlNodePtrWrap(obj->user); |
node = libxml_xmlNodePtrWrap(obj->user); |
indexIntoNode = PyInt_FromLong((long) obj->index); | indexIntoNode = PY_IMPORT_INT((long) obj->index); |
|
|
tuple = PyTuple_New(2); |
tuple = PyTuple_New(2); |
PyTuple_SetItem(tuple, 0, node); |
PyTuple_SetItem(tuple, 0, node); |
Line 480 libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj)
|
Line 539 libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj)
|
PyList_SetItem(list, 0, tuple); |
PyList_SetItem(list, 0, tuple); |
|
|
node = libxml_xmlNodePtrWrap(obj->user2); |
node = libxml_xmlNodePtrWrap(obj->user2); |
indexIntoNode = PyInt_FromLong((long) obj->index2); | indexIntoNode = PY_IMPORT_INT((long) obj->index2); |
|
|
tuple = PyTuple_New(2); |
tuple = PyTuple_New(2); |
PyTuple_SetItem(tuple, 0, node); |
PyTuple_SetItem(tuple, 0, node); |
Line 545 libxml_xmlXPathObjectPtrConvert(PyObject * obj)
|
Line 604 libxml_xmlXPathObjectPtrConvert(PyObject * obj)
|
if (obj == NULL) { |
if (obj == NULL) { |
return (NULL); |
return (NULL); |
} |
} |
if PyFloat_Check | if PyFloat_Check (obj) { |
(obj) { | |
ret = xmlXPathNewFloat((double) PyFloat_AS_DOUBLE(obj)); |
ret = xmlXPathNewFloat((double) PyFloat_AS_DOUBLE(obj)); |
| } else if PyLong_Check(obj) { |
} else if PyInt_Check(obj) { | #ifdef PyLong_AS_LONG |
| ret = xmlXPathNewFloat((double) PyLong_AS_LONG(obj)); |
| #else |
ret = xmlXPathNewFloat((double) PyInt_AS_LONG(obj)); |
ret = xmlXPathNewFloat((double) PyInt_AS_LONG(obj)); |
| #endif |
#ifdef PyBool_Check |
#ifdef PyBool_Check |
} else if PyBool_Check (obj) { |
} else if PyBool_Check (obj) { |
|
|
Line 563 libxml_xmlXPathObjectPtrConvert(PyObject * obj)
|
Line 622 libxml_xmlXPathObjectPtrConvert(PyObject * obj)
|
ret = xmlXPathNewBoolean(0); |
ret = xmlXPathNewBoolean(0); |
} |
} |
#endif |
#endif |
} else if PyString_Check | } else if PyBytes_Check (obj) { |
(obj) { | |
xmlChar *str; |
xmlChar *str; |
|
|
str = xmlStrndup((const xmlChar *) PyString_AS_STRING(obj), | str = xmlStrndup((const xmlChar *) PyBytes_AS_STRING(obj), |
PyString_GET_SIZE(obj)); | PyBytes_GET_SIZE(obj)); |
ret = xmlXPathWrapString(str); |
ret = xmlXPathWrapString(str); |
} else if PyList_Check | #ifdef PyUnicode_Check |
(obj) { | } else if PyUnicode_Check (obj) { |
| #if PY_VERSION_HEX >= 0x03030000 |
| xmlChar *str; |
| const char *tmp; |
| size_t size; |
| |
| /* tmp doesn't need to be deallocated */ |
| tmp = PyUnicode_AsUTF8AndSize(obj, &size); |
| str = xmlStrndup(tmp, (int) size); |
| ret = xmlXPathWrapString(str); |
| #else |
| xmlChar *str = NULL; |
| PyObject *b; |
| |
| b = PyUnicode_AsUTF8String(obj); |
| if (b != NULL) { |
| str = xmlStrndup((const xmlChar *) PyBytes_AS_STRING(b), |
| PyBytes_GET_SIZE(b)); |
| Py_DECREF(b); |
| } |
| ret = xmlXPathWrapString(str); |
| #endif |
| #endif |
| } else if PyList_Check (obj) { |
int i; |
int i; |
PyObject *node; |
PyObject *node; |
xmlNodePtr cur; |
xmlNodePtr cur; |
Line 585 libxml_xmlXPathObjectPtrConvert(PyObject * obj)
|
Line 666 libxml_xmlXPathObjectPtrConvert(PyObject * obj)
|
continue; |
continue; |
|
|
cur = NULL; |
cur = NULL; |
if (PyCObject_Check(node)) { | if (PyCapsule_CheckExact(node)) { |
#ifdef DEBUG |
#ifdef DEBUG |
printf("Got a CObject\n"); | printf("Got a Capsule\n"); |
#endif |
#endif |
cur = PyxmlNode_Get(node); |
cur = PyxmlNode_Get(node); |
} else if (PyInstance_Check(node)) { | } else if ((PyObject_HasAttrString(node, (char *) "_o")) && |
PyInstanceObject *inst = (PyInstanceObject *) node; | (PyObject_HasAttrString(node, (char *) "get_doc"))) { |
PyObject *name = inst->in_class->cl_name; | PyObject *wrapper; |
|
|
if PyString_Check | wrapper = PyObject_GetAttrString(node, (char *) "_o"); |
(name) { | if (wrapper != NULL) |
char *type = PyString_AS_STRING(name); | cur = PyxmlNode_Get(wrapper); |
PyObject *wrapper; | |
| |
if (!strcmp(type, "xmlNode")) { | |
wrapper = | |
PyObject_GetAttrString(node, (char *) "_o"); | |
if (wrapper != NULL) { | |
cur = PyxmlNode_Get(wrapper); | |
} | |
} | |
} | |
} else { |
} else { |
#ifdef DEBUG |
#ifdef DEBUG |
printf("Unknown object in Python return list\n"); |
printf("Unknown object in Python return list\n"); |
Line 622 libxml_xmlXPathObjectPtrConvert(PyObject * obj)
|
Line 693 libxml_xmlXPathObjectPtrConvert(PyObject * obj)
|
printf("Unable to convert Python Object to XPath"); |
printf("Unable to convert Python Object to XPath"); |
#endif |
#endif |
} |
} |
Py_DECREF(obj); |
|
return (ret); |
return (ret); |
} |
} |
|
|
Line 630 PyObject *
|
Line 700 PyObject *
|
libxml_xmlValidCtxtPtrWrap(xmlValidCtxtPtr valid) |
libxml_xmlValidCtxtPtrWrap(xmlValidCtxtPtr valid) |
{ |
{ |
PyObject *ret; |
PyObject *ret; |
| |
#ifdef DEBUG |
#ifdef DEBUG |
printf("libxml_xmlValidCtxtPtrWrap: valid = %p\n", valid); |
printf("libxml_xmlValidCtxtPtrWrap: valid = %p\n", valid); |
#endif |
#endif |
Line 640 libxml_xmlValidCtxtPtrWrap(xmlValidCtxtPtr valid)
|
Line 710 libxml_xmlValidCtxtPtrWrap(xmlValidCtxtPtr valid)
|
} |
} |
|
|
ret = |
ret = |
PyCObject_FromVoidPtrAndDesc((void *) valid, | PyCapsule_New((void *) valid, |
(char *) "xmlValidCtxtPtr", NULL); |
(char *) "xmlValidCtxtPtr", NULL); |
|
|
return (ret); |
return (ret); |
Line 659 libxml_xmlCatalogPtrWrap(xmlCatalogPtr catal)
|
Line 729 libxml_xmlCatalogPtrWrap(xmlCatalogPtr catal)
|
return (Py_None); |
return (Py_None); |
} |
} |
ret = |
ret = |
PyCObject_FromVoidPtrAndDesc((void *) catal, | PyCapsule_New((void *) catal, |
(char *) "xmlCatalogPtr", NULL); |
(char *) "xmlCatalogPtr", NULL); |
return (ret); |
return (ret); |
} |
} |
Line 677 libxml_xmlOutputBufferPtrWrap(xmlOutputBufferPtr buffe
|
Line 747 libxml_xmlOutputBufferPtrWrap(xmlOutputBufferPtr buffe
|
return (Py_None); |
return (Py_None); |
} |
} |
ret = |
ret = |
PyCObject_FromVoidPtrAndDesc((void *) buffer, | PyCapsule_New((void *) buffer, |
(char *) "xmlOutputBufferPtr", NULL); |
(char *) "xmlOutputBufferPtr", NULL); |
return (ret); |
return (ret); |
} |
} |
Line 695 libxml_xmlParserInputBufferPtrWrap(xmlParserInputBuffe
|
Line 765 libxml_xmlParserInputBufferPtrWrap(xmlParserInputBuffe
|
return (Py_None); |
return (Py_None); |
} |
} |
ret = |
ret = |
PyCObject_FromVoidPtrAndDesc((void *) buffer, | PyCapsule_New((void *) buffer, |
(char *) "xmlParserInputBufferPtr", NULL); |
(char *) "xmlParserInputBufferPtr", NULL); |
return (ret); |
return (ret); |
} |
} |
Line 714 libxml_xmlRegexpPtrWrap(xmlRegexpPtr regexp)
|
Line 784 libxml_xmlRegexpPtrWrap(xmlRegexpPtr regexp)
|
return (Py_None); |
return (Py_None); |
} |
} |
ret = |
ret = |
PyCObject_FromVoidPtrAndDesc((void *) regexp, | PyCapsule_New((void *) regexp, |
(char *) "xmlRegexpPtr", NULL); |
(char *) "xmlRegexpPtr", NULL); |
return (ret); |
return (ret); |
} |
} |
Line 734 libxml_xmlTextReaderPtrWrap(xmlTextReaderPtr reader)
|
Line 804 libxml_xmlTextReaderPtrWrap(xmlTextReaderPtr reader)
|
return (Py_None); |
return (Py_None); |
} |
} |
ret = |
ret = |
PyCObject_FromVoidPtrAndDesc((void *) reader, | PyCapsule_New((void *) reader, |
(char *) "xmlTextReaderPtr", NULL); |
(char *) "xmlTextReaderPtr", NULL); |
return (ret); |
return (ret); |
} |
} |
Line 752 libxml_xmlTextReaderLocatorPtrWrap(xmlTextReaderLocato
|
Line 822 libxml_xmlTextReaderLocatorPtrWrap(xmlTextReaderLocato
|
return (Py_None); |
return (Py_None); |
} |
} |
ret = |
ret = |
PyCObject_FromVoidPtrAndDesc((void *) locator, | PyCapsule_New((void *) locator, |
(char *) "xmlTextReaderLocatorPtr", NULL); |
(char *) "xmlTextReaderLocatorPtr", NULL); |
return (ret); |
return (ret); |
} |
} |
Line 772 libxml_xmlRelaxNGPtrWrap(xmlRelaxNGPtr ctxt)
|
Line 842 libxml_xmlRelaxNGPtrWrap(xmlRelaxNGPtr ctxt)
|
return (Py_None); |
return (Py_None); |
} |
} |
ret = |
ret = |
PyCObject_FromVoidPtrAndDesc((void *) ctxt, | PyCapsule_New((void *) ctxt, |
(char *) "xmlRelaxNGPtr", NULL); |
(char *) "xmlRelaxNGPtr", NULL); |
return (ret); |
return (ret); |
} |
} |
Line 790 libxml_xmlRelaxNGParserCtxtPtrWrap(xmlRelaxNGParserCtx
|
Line 860 libxml_xmlRelaxNGParserCtxtPtrWrap(xmlRelaxNGParserCtx
|
return (Py_None); |
return (Py_None); |
} |
} |
ret = |
ret = |
PyCObject_FromVoidPtrAndDesc((void *) ctxt, | PyCapsule_New((void *) ctxt, |
(char *) "xmlRelaxNGParserCtxtPtr", NULL); |
(char *) "xmlRelaxNGParserCtxtPtr", NULL); |
return (ret); |
return (ret); |
} |
} |
Line 807 libxml_xmlRelaxNGValidCtxtPtrWrap(xmlRelaxNGValidCtxtP
|
Line 877 libxml_xmlRelaxNGValidCtxtPtrWrap(xmlRelaxNGValidCtxtP
|
return (Py_None); |
return (Py_None); |
} |
} |
ret = |
ret = |
PyCObject_FromVoidPtrAndDesc((void *) valid, | PyCapsule_New((void *) valid, |
(char *) "xmlRelaxNGValidCtxtPtr", NULL); |
(char *) "xmlRelaxNGValidCtxtPtr", NULL); |
return (ret); |
return (ret); |
} |
} |
Line 825 libxml_xmlSchemaPtrWrap(xmlSchemaPtr ctxt)
|
Line 895 libxml_xmlSchemaPtrWrap(xmlSchemaPtr ctxt)
|
return (Py_None); |
return (Py_None); |
} |
} |
ret = |
ret = |
PyCObject_FromVoidPtrAndDesc((void *) ctxt, | PyCapsule_New((void *) ctxt, |
(char *) "xmlSchemaPtr", NULL); |
(char *) "xmlSchemaPtr", NULL); |
return (ret); |
return (ret); |
} |
} |
Line 843 libxml_xmlSchemaParserCtxtPtrWrap(xmlSchemaParserCtxtP
|
Line 913 libxml_xmlSchemaParserCtxtPtrWrap(xmlSchemaParserCtxtP
|
return (Py_None); |
return (Py_None); |
} |
} |
ret = |
ret = |
PyCObject_FromVoidPtrAndDesc((void *) ctxt, | PyCapsule_New((void *) ctxt, |
(char *) "xmlSchemaParserCtxtPtr", NULL); |
(char *) "xmlSchemaParserCtxtPtr", NULL); |
|
|
return (ret); |
return (ret); |
Line 863 libxml_xmlSchemaValidCtxtPtrWrap(xmlSchemaValidCtxtPtr
|
Line 933 libxml_xmlSchemaValidCtxtPtrWrap(xmlSchemaValidCtxtPtr
|
} |
} |
|
|
ret = |
ret = |
PyCObject_FromVoidPtrAndDesc((void *) valid, | PyCapsule_New((void *) valid, |
(char *) "xmlSchemaValidCtxtPtr", NULL); |
(char *) "xmlSchemaValidCtxtPtr", NULL); |
|
|
return (ret); |
return (ret); |
Line 882 libxml_xmlErrorPtrWrap(xmlErrorPtr error)
|
Line 952 libxml_xmlErrorPtrWrap(xmlErrorPtr error)
|
Py_INCREF(Py_None); |
Py_INCREF(Py_None); |
return (Py_None); |
return (Py_None); |
} |
} |
ret = | ret = PyCapsule_New((void *) error, (char *) "xmlErrorPtr", NULL); |
PyCObject_FromVoidPtrAndDesc((void *) error, | |
(char *) "xmlErrorPtr", NULL); | |
return (ret); |
return (ret); |
} |
} |