Path: blob/master/venv/Lib/site-packages/lxml/lxml.etree_api.h
811 views
/* Generated by Cython 0.29.21 */12#ifndef __PYX_HAVE_API__lxml__etree3#define __PYX_HAVE_API__lxml__etree4#ifdef __MINGW64__5#define MS_WIN646#endif7#include "Python.h"8#include "lxml.etree.h"910static struct LxmlElement *(*__pyx_api_f_4lxml_5etree_deepcopyNodeToDocument)(struct LxmlDocument *, xmlNode *) = 0;11#define deepcopyNodeToDocument __pyx_api_f_4lxml_5etree_deepcopyNodeToDocument12static struct LxmlElementTree *(*__pyx_api_f_4lxml_5etree_elementTreeFactory)(struct LxmlElement *) = 0;13#define elementTreeFactory __pyx_api_f_4lxml_5etree_elementTreeFactory14static struct LxmlElementTree *(*__pyx_api_f_4lxml_5etree_newElementTree)(struct LxmlElement *, PyObject *) = 0;15#define newElementTree __pyx_api_f_4lxml_5etree_newElementTree16static struct LxmlElementTree *(*__pyx_api_f_4lxml_5etree_adoptExternalDocument)(xmlDoc *, PyObject *, int) = 0;17#define adoptExternalDocument __pyx_api_f_4lxml_5etree_adoptExternalDocument18static struct LxmlElement *(*__pyx_api_f_4lxml_5etree_elementFactory)(struct LxmlDocument *, xmlNode *) = 0;19#define elementFactory __pyx_api_f_4lxml_5etree_elementFactory20static struct LxmlElement *(*__pyx_api_f_4lxml_5etree_makeElement)(PyObject *, struct LxmlDocument *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *) = 0;21#define makeElement __pyx_api_f_4lxml_5etree_makeElement22static struct LxmlElement *(*__pyx_api_f_4lxml_5etree_makeSubElement)(struct LxmlElement *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *) = 0;23#define makeSubElement __pyx_api_f_4lxml_5etree_makeSubElement24static void (*__pyx_api_f_4lxml_5etree_setElementClassLookupFunction)(_element_class_lookup_function, PyObject *) = 0;25#define setElementClassLookupFunction __pyx_api_f_4lxml_5etree_setElementClassLookupFunction26static PyObject *(*__pyx_api_f_4lxml_5etree_lookupDefaultElementClass)(PyObject *, PyObject *, xmlNode *) = 0;27#define lookupDefaultElementClass __pyx_api_f_4lxml_5etree_lookupDefaultElementClass28static PyObject *(*__pyx_api_f_4lxml_5etree_lookupNamespaceElementClass)(PyObject *, PyObject *, xmlNode *) = 0;29#define lookupNamespaceElementClass __pyx_api_f_4lxml_5etree_lookupNamespaceElementClass30static PyObject *(*__pyx_api_f_4lxml_5etree_callLookupFallback)(struct LxmlFallbackElementClassLookup *, struct LxmlDocument *, xmlNode *) = 0;31#define callLookupFallback __pyx_api_f_4lxml_5etree_callLookupFallback32static int (*__pyx_api_f_4lxml_5etree_tagMatches)(xmlNode *, const xmlChar *, const xmlChar *) = 0;33#define tagMatches __pyx_api_f_4lxml_5etree_tagMatches34static struct LxmlDocument *(*__pyx_api_f_4lxml_5etree_documentOrRaise)(PyObject *) = 0;35#define documentOrRaise __pyx_api_f_4lxml_5etree_documentOrRaise36static struct LxmlElement *(*__pyx_api_f_4lxml_5etree_rootNodeOrRaise)(PyObject *) = 0;37#define rootNodeOrRaise __pyx_api_f_4lxml_5etree_rootNodeOrRaise38static int (*__pyx_api_f_4lxml_5etree_hasText)(xmlNode *) = 0;39#define hasText __pyx_api_f_4lxml_5etree_hasText40static int (*__pyx_api_f_4lxml_5etree_hasTail)(xmlNode *) = 0;41#define hasTail __pyx_api_f_4lxml_5etree_hasTail42static PyObject *(*__pyx_api_f_4lxml_5etree_textOf)(xmlNode *) = 0;43#define textOf __pyx_api_f_4lxml_5etree_textOf44static PyObject *(*__pyx_api_f_4lxml_5etree_tailOf)(xmlNode *) = 0;45#define tailOf __pyx_api_f_4lxml_5etree_tailOf46static int (*__pyx_api_f_4lxml_5etree_setNodeText)(xmlNode *, PyObject *) = 0;47#define setNodeText __pyx_api_f_4lxml_5etree_setNodeText48static int (*__pyx_api_f_4lxml_5etree_setTailText)(xmlNode *, PyObject *) = 0;49#define setTailText __pyx_api_f_4lxml_5etree_setTailText50static PyObject *(*__pyx_api_f_4lxml_5etree_attributeValue)(xmlNode *, xmlAttr *) = 0;51#define attributeValue __pyx_api_f_4lxml_5etree_attributeValue52static PyObject *(*__pyx_api_f_4lxml_5etree_attributeValueFromNsName)(xmlNode *, const xmlChar *, const xmlChar *) = 0;53#define attributeValueFromNsName __pyx_api_f_4lxml_5etree_attributeValueFromNsName54static PyObject *(*__pyx_api_f_4lxml_5etree_getAttributeValue)(struct LxmlElement *, PyObject *, PyObject *) = 0;55#define getAttributeValue __pyx_api_f_4lxml_5etree_getAttributeValue56static PyObject *(*__pyx_api_f_4lxml_5etree_iterattributes)(struct LxmlElement *, int) = 0;57#define iterattributes __pyx_api_f_4lxml_5etree_iterattributes58static PyObject *(*__pyx_api_f_4lxml_5etree_collectAttributes)(xmlNode *, int) = 0;59#define collectAttributes __pyx_api_f_4lxml_5etree_collectAttributes60static int (*__pyx_api_f_4lxml_5etree_setAttributeValue)(struct LxmlElement *, PyObject *, PyObject *) = 0;61#define setAttributeValue __pyx_api_f_4lxml_5etree_setAttributeValue62static int (*__pyx_api_f_4lxml_5etree_delAttribute)(struct LxmlElement *, PyObject *) = 0;63#define delAttribute __pyx_api_f_4lxml_5etree_delAttribute64static int (*__pyx_api_f_4lxml_5etree_delAttributeFromNsName)(xmlNode *, const xmlChar *, const xmlChar *) = 0;65#define delAttributeFromNsName __pyx_api_f_4lxml_5etree_delAttributeFromNsName66static int (*__pyx_api_f_4lxml_5etree_hasChild)(xmlNode *) = 0;67#define hasChild __pyx_api_f_4lxml_5etree_hasChild68static xmlNode *(*__pyx_api_f_4lxml_5etree_findChild)(xmlNode *, Py_ssize_t) = 0;69#define findChild __pyx_api_f_4lxml_5etree_findChild70static xmlNode *(*__pyx_api_f_4lxml_5etree_findChildForwards)(xmlNode *, Py_ssize_t) = 0;71#define findChildForwards __pyx_api_f_4lxml_5etree_findChildForwards72static xmlNode *(*__pyx_api_f_4lxml_5etree_findChildBackwards)(xmlNode *, Py_ssize_t) = 0;73#define findChildBackwards __pyx_api_f_4lxml_5etree_findChildBackwards74static xmlNode *(*__pyx_api_f_4lxml_5etree_nextElement)(xmlNode *) = 0;75#define nextElement __pyx_api_f_4lxml_5etree_nextElement76static xmlNode *(*__pyx_api_f_4lxml_5etree_previousElement)(xmlNode *) = 0;77#define previousElement __pyx_api_f_4lxml_5etree_previousElement78static void (*__pyx_api_f_4lxml_5etree_appendChild)(struct LxmlElement *, struct LxmlElement *) = 0;79#define appendChild __pyx_api_f_4lxml_5etree_appendChild80static int (*__pyx_api_f_4lxml_5etree_appendChildToElement)(struct LxmlElement *, struct LxmlElement *) = 0;81#define appendChildToElement __pyx_api_f_4lxml_5etree_appendChildToElement82static PyObject *(*__pyx_api_f_4lxml_5etree_pyunicode)(const xmlChar *) = 0;83#define pyunicode __pyx_api_f_4lxml_5etree_pyunicode84static PyObject *(*__pyx_api_f_4lxml_5etree_utf8)(PyObject *) = 0;85#define utf8 __pyx_api_f_4lxml_5etree_utf886static PyObject *(*__pyx_api_f_4lxml_5etree_getNsTag)(PyObject *) = 0;87#define getNsTag __pyx_api_f_4lxml_5etree_getNsTag88static PyObject *(*__pyx_api_f_4lxml_5etree_getNsTagWithEmptyNs)(PyObject *) = 0;89#define getNsTagWithEmptyNs __pyx_api_f_4lxml_5etree_getNsTagWithEmptyNs90static PyObject *(*__pyx_api_f_4lxml_5etree_namespacedName)(xmlNode *) = 0;91#define namespacedName __pyx_api_f_4lxml_5etree_namespacedName92static PyObject *(*__pyx_api_f_4lxml_5etree_namespacedNameFromNsName)(const xmlChar *, const xmlChar *) = 0;93#define namespacedNameFromNsName __pyx_api_f_4lxml_5etree_namespacedNameFromNsName94static void (*__pyx_api_f_4lxml_5etree_iteratorStoreNext)(struct LxmlElementIterator *, struct LxmlElement *) = 0;95#define iteratorStoreNext __pyx_api_f_4lxml_5etree_iteratorStoreNext96static void (*__pyx_api_f_4lxml_5etree_initTagMatch)(struct LxmlElementTagMatcher *, PyObject *) = 0;97#define initTagMatch __pyx_api_f_4lxml_5etree_initTagMatch98static xmlNs *(*__pyx_api_f_4lxml_5etree_findOrBuildNodeNsPrefix)(struct LxmlDocument *, xmlNode *, const xmlChar *, const xmlChar *) = 0;99#define findOrBuildNodeNsPrefix __pyx_api_f_4lxml_5etree_findOrBuildNodeNsPrefix100#if !defined(__Pyx_PyIdentifier_FromString)101#if PY_MAJOR_VERSION < 3102#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)103#else104#define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)105#endif106#endif107108#ifndef __PYX_HAVE_RT_ImportFunction109#define __PYX_HAVE_RT_ImportFunction110static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {111PyObject *d = 0;112PyObject *cobj = 0;113union {114void (*fp)(void);115void *p;116} tmp;117d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");118if (!d)119goto bad;120cobj = PyDict_GetItemString(d, funcname);121if (!cobj) {122PyErr_Format(PyExc_ImportError,123"%.200s does not export expected C function %.200s",124PyModule_GetName(module), funcname);125goto bad;126}127#if PY_VERSION_HEX >= 0x02070000128if (!PyCapsule_IsValid(cobj, sig)) {129PyErr_Format(PyExc_TypeError,130"C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",131PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));132goto bad;133}134tmp.p = PyCapsule_GetPointer(cobj, sig);135#else136{const char *desc, *s1, *s2;137desc = (const char *)PyCObject_GetDesc(cobj);138if (!desc)139goto bad;140s1 = desc; s2 = sig;141while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }142if (*s1 != *s2) {143PyErr_Format(PyExc_TypeError,144"C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",145PyModule_GetName(module), funcname, sig, desc);146goto bad;147}148tmp.p = PyCObject_AsVoidPtr(cobj);}149#endif150*f = tmp.fp;151if (!(*f))152goto bad;153Py_DECREF(d);154return 0;155bad:156Py_XDECREF(d);157return -1;158}159#endif160161162static int import_lxml__etree(void) {163PyObject *module = 0;164module = PyImport_ImportModule("lxml.etree");165if (!module) goto bad;166if (__Pyx_ImportFunction(module, "deepcopyNodeToDocument", (void (**)(void))&__pyx_api_f_4lxml_5etree_deepcopyNodeToDocument, "struct LxmlElement *(struct LxmlDocument *, xmlNode *)") < 0) goto bad;167if (__Pyx_ImportFunction(module, "elementTreeFactory", (void (**)(void))&__pyx_api_f_4lxml_5etree_elementTreeFactory, "struct LxmlElementTree *(struct LxmlElement *)") < 0) goto bad;168if (__Pyx_ImportFunction(module, "newElementTree", (void (**)(void))&__pyx_api_f_4lxml_5etree_newElementTree, "struct LxmlElementTree *(struct LxmlElement *, PyObject *)") < 0) goto bad;169if (__Pyx_ImportFunction(module, "adoptExternalDocument", (void (**)(void))&__pyx_api_f_4lxml_5etree_adoptExternalDocument, "struct LxmlElementTree *(xmlDoc *, PyObject *, int)") < 0) goto bad;170if (__Pyx_ImportFunction(module, "elementFactory", (void (**)(void))&__pyx_api_f_4lxml_5etree_elementFactory, "struct LxmlElement *(struct LxmlDocument *, xmlNode *)") < 0) goto bad;171if (__Pyx_ImportFunction(module, "makeElement", (void (**)(void))&__pyx_api_f_4lxml_5etree_makeElement, "struct LxmlElement *(PyObject *, struct LxmlDocument *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *)") < 0) goto bad;172if (__Pyx_ImportFunction(module, "makeSubElement", (void (**)(void))&__pyx_api_f_4lxml_5etree_makeSubElement, "struct LxmlElement *(struct LxmlElement *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *)") < 0) goto bad;173if (__Pyx_ImportFunction(module, "setElementClassLookupFunction", (void (**)(void))&__pyx_api_f_4lxml_5etree_setElementClassLookupFunction, "void (_element_class_lookup_function, PyObject *)") < 0) goto bad;174if (__Pyx_ImportFunction(module, "lookupDefaultElementClass", (void (**)(void))&__pyx_api_f_4lxml_5etree_lookupDefaultElementClass, "PyObject *(PyObject *, PyObject *, xmlNode *)") < 0) goto bad;175if (__Pyx_ImportFunction(module, "lookupNamespaceElementClass", (void (**)(void))&__pyx_api_f_4lxml_5etree_lookupNamespaceElementClass, "PyObject *(PyObject *, PyObject *, xmlNode *)") < 0) goto bad;176if (__Pyx_ImportFunction(module, "callLookupFallback", (void (**)(void))&__pyx_api_f_4lxml_5etree_callLookupFallback, "PyObject *(struct LxmlFallbackElementClassLookup *, struct LxmlDocument *, xmlNode *)") < 0) goto bad;177if (__Pyx_ImportFunction(module, "tagMatches", (void (**)(void))&__pyx_api_f_4lxml_5etree_tagMatches, "int (xmlNode *, const xmlChar *, const xmlChar *)") < 0) goto bad;178if (__Pyx_ImportFunction(module, "documentOrRaise", (void (**)(void))&__pyx_api_f_4lxml_5etree_documentOrRaise, "struct LxmlDocument *(PyObject *)") < 0) goto bad;179if (__Pyx_ImportFunction(module, "rootNodeOrRaise", (void (**)(void))&__pyx_api_f_4lxml_5etree_rootNodeOrRaise, "struct LxmlElement *(PyObject *)") < 0) goto bad;180if (__Pyx_ImportFunction(module, "hasText", (void (**)(void))&__pyx_api_f_4lxml_5etree_hasText, "int (xmlNode *)") < 0) goto bad;181if (__Pyx_ImportFunction(module, "hasTail", (void (**)(void))&__pyx_api_f_4lxml_5etree_hasTail, "int (xmlNode *)") < 0) goto bad;182if (__Pyx_ImportFunction(module, "textOf", (void (**)(void))&__pyx_api_f_4lxml_5etree_textOf, "PyObject *(xmlNode *)") < 0) goto bad;183if (__Pyx_ImportFunction(module, "tailOf", (void (**)(void))&__pyx_api_f_4lxml_5etree_tailOf, "PyObject *(xmlNode *)") < 0) goto bad;184if (__Pyx_ImportFunction(module, "setNodeText", (void (**)(void))&__pyx_api_f_4lxml_5etree_setNodeText, "int (xmlNode *, PyObject *)") < 0) goto bad;185if (__Pyx_ImportFunction(module, "setTailText", (void (**)(void))&__pyx_api_f_4lxml_5etree_setTailText, "int (xmlNode *, PyObject *)") < 0) goto bad;186if (__Pyx_ImportFunction(module, "attributeValue", (void (**)(void))&__pyx_api_f_4lxml_5etree_attributeValue, "PyObject *(xmlNode *, xmlAttr *)") < 0) goto bad;187if (__Pyx_ImportFunction(module, "attributeValueFromNsName", (void (**)(void))&__pyx_api_f_4lxml_5etree_attributeValueFromNsName, "PyObject *(xmlNode *, const xmlChar *, const xmlChar *)") < 0) goto bad;188if (__Pyx_ImportFunction(module, "getAttributeValue", (void (**)(void))&__pyx_api_f_4lxml_5etree_getAttributeValue, "PyObject *(struct LxmlElement *, PyObject *, PyObject *)") < 0) goto bad;189if (__Pyx_ImportFunction(module, "iterattributes", (void (**)(void))&__pyx_api_f_4lxml_5etree_iterattributes, "PyObject *(struct LxmlElement *, int)") < 0) goto bad;190if (__Pyx_ImportFunction(module, "collectAttributes", (void (**)(void))&__pyx_api_f_4lxml_5etree_collectAttributes, "PyObject *(xmlNode *, int)") < 0) goto bad;191if (__Pyx_ImportFunction(module, "setAttributeValue", (void (**)(void))&__pyx_api_f_4lxml_5etree_setAttributeValue, "int (struct LxmlElement *, PyObject *, PyObject *)") < 0) goto bad;192if (__Pyx_ImportFunction(module, "delAttribute", (void (**)(void))&__pyx_api_f_4lxml_5etree_delAttribute, "int (struct LxmlElement *, PyObject *)") < 0) goto bad;193if (__Pyx_ImportFunction(module, "delAttributeFromNsName", (void (**)(void))&__pyx_api_f_4lxml_5etree_delAttributeFromNsName, "int (xmlNode *, const xmlChar *, const xmlChar *)") < 0) goto bad;194if (__Pyx_ImportFunction(module, "hasChild", (void (**)(void))&__pyx_api_f_4lxml_5etree_hasChild, "int (xmlNode *)") < 0) goto bad;195if (__Pyx_ImportFunction(module, "findChild", (void (**)(void))&__pyx_api_f_4lxml_5etree_findChild, "xmlNode *(xmlNode *, Py_ssize_t)") < 0) goto bad;196if (__Pyx_ImportFunction(module, "findChildForwards", (void (**)(void))&__pyx_api_f_4lxml_5etree_findChildForwards, "xmlNode *(xmlNode *, Py_ssize_t)") < 0) goto bad;197if (__Pyx_ImportFunction(module, "findChildBackwards", (void (**)(void))&__pyx_api_f_4lxml_5etree_findChildBackwards, "xmlNode *(xmlNode *, Py_ssize_t)") < 0) goto bad;198if (__Pyx_ImportFunction(module, "nextElement", (void (**)(void))&__pyx_api_f_4lxml_5etree_nextElement, "xmlNode *(xmlNode *)") < 0) goto bad;199if (__Pyx_ImportFunction(module, "previousElement", (void (**)(void))&__pyx_api_f_4lxml_5etree_previousElement, "xmlNode *(xmlNode *)") < 0) goto bad;200if (__Pyx_ImportFunction(module, "appendChild", (void (**)(void))&__pyx_api_f_4lxml_5etree_appendChild, "void (struct LxmlElement *, struct LxmlElement *)") < 0) goto bad;201if (__Pyx_ImportFunction(module, "appendChildToElement", (void (**)(void))&__pyx_api_f_4lxml_5etree_appendChildToElement, "int (struct LxmlElement *, struct LxmlElement *)") < 0) goto bad;202if (__Pyx_ImportFunction(module, "pyunicode", (void (**)(void))&__pyx_api_f_4lxml_5etree_pyunicode, "PyObject *(const xmlChar *)") < 0) goto bad;203if (__Pyx_ImportFunction(module, "utf8", (void (**)(void))&__pyx_api_f_4lxml_5etree_utf8, "PyObject *(PyObject *)") < 0) goto bad;204if (__Pyx_ImportFunction(module, "getNsTag", (void (**)(void))&__pyx_api_f_4lxml_5etree_getNsTag, "PyObject *(PyObject *)") < 0) goto bad;205if (__Pyx_ImportFunction(module, "getNsTagWithEmptyNs", (void (**)(void))&__pyx_api_f_4lxml_5etree_getNsTagWithEmptyNs, "PyObject *(PyObject *)") < 0) goto bad;206if (__Pyx_ImportFunction(module, "namespacedName", (void (**)(void))&__pyx_api_f_4lxml_5etree_namespacedName, "PyObject *(xmlNode *)") < 0) goto bad;207if (__Pyx_ImportFunction(module, "namespacedNameFromNsName", (void (**)(void))&__pyx_api_f_4lxml_5etree_namespacedNameFromNsName, "PyObject *(const xmlChar *, const xmlChar *)") < 0) goto bad;208if (__Pyx_ImportFunction(module, "iteratorStoreNext", (void (**)(void))&__pyx_api_f_4lxml_5etree_iteratorStoreNext, "void (struct LxmlElementIterator *, struct LxmlElement *)") < 0) goto bad;209if (__Pyx_ImportFunction(module, "initTagMatch", (void (**)(void))&__pyx_api_f_4lxml_5etree_initTagMatch, "void (struct LxmlElementTagMatcher *, PyObject *)") < 0) goto bad;210if (__Pyx_ImportFunction(module, "findOrBuildNodeNsPrefix", (void (**)(void))&__pyx_api_f_4lxml_5etree_findOrBuildNodeNsPrefix, "xmlNs *(struct LxmlDocument *, xmlNode *, const xmlChar *, const xmlChar *)") < 0) goto bad;211Py_DECREF(module); module = 0;212return 0;213bad:214Py_XDECREF(module);215return -1;216}217218#endif /* !__PYX_HAVE_API__lxml__etree */219220221