No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

220 líneas
17 KiB

  1. /* Generated by Cython 0.29.25 */
  2. #ifndef __PYX_HAVE_API__lxml__etree
  3. #define __PYX_HAVE_API__lxml__etree
  4. #ifdef __MINGW64__
  5. #define MS_WIN64
  6. #endif
  7. #include "Python.h"
  8. #include "lxml.etree.h"
  9. static struct LxmlElement *(*__pyx_api_f_4lxml_5etree_deepcopyNodeToDocument)(struct LxmlDocument *, xmlNode *) = 0;
  10. #define deepcopyNodeToDocument __pyx_api_f_4lxml_5etree_deepcopyNodeToDocument
  11. static struct LxmlElementTree *(*__pyx_api_f_4lxml_5etree_elementTreeFactory)(struct LxmlElement *) = 0;
  12. #define elementTreeFactory __pyx_api_f_4lxml_5etree_elementTreeFactory
  13. static struct LxmlElementTree *(*__pyx_api_f_4lxml_5etree_newElementTree)(struct LxmlElement *, PyObject *) = 0;
  14. #define newElementTree __pyx_api_f_4lxml_5etree_newElementTree
  15. static struct LxmlElementTree *(*__pyx_api_f_4lxml_5etree_adoptExternalDocument)(xmlDoc *, PyObject *, int) = 0;
  16. #define adoptExternalDocument __pyx_api_f_4lxml_5etree_adoptExternalDocument
  17. static struct LxmlElement *(*__pyx_api_f_4lxml_5etree_elementFactory)(struct LxmlDocument *, xmlNode *) = 0;
  18. #define elementFactory __pyx_api_f_4lxml_5etree_elementFactory
  19. static struct LxmlElement *(*__pyx_api_f_4lxml_5etree_makeElement)(PyObject *, struct LxmlDocument *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *) = 0;
  20. #define makeElement __pyx_api_f_4lxml_5etree_makeElement
  21. static struct LxmlElement *(*__pyx_api_f_4lxml_5etree_makeSubElement)(struct LxmlElement *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *) = 0;
  22. #define makeSubElement __pyx_api_f_4lxml_5etree_makeSubElement
  23. static void (*__pyx_api_f_4lxml_5etree_setElementClassLookupFunction)(_element_class_lookup_function, PyObject *) = 0;
  24. #define setElementClassLookupFunction __pyx_api_f_4lxml_5etree_setElementClassLookupFunction
  25. static PyObject *(*__pyx_api_f_4lxml_5etree_lookupDefaultElementClass)(PyObject *, PyObject *, xmlNode *) = 0;
  26. #define lookupDefaultElementClass __pyx_api_f_4lxml_5etree_lookupDefaultElementClass
  27. static PyObject *(*__pyx_api_f_4lxml_5etree_lookupNamespaceElementClass)(PyObject *, PyObject *, xmlNode *) = 0;
  28. #define lookupNamespaceElementClass __pyx_api_f_4lxml_5etree_lookupNamespaceElementClass
  29. static PyObject *(*__pyx_api_f_4lxml_5etree_callLookupFallback)(struct LxmlFallbackElementClassLookup *, struct LxmlDocument *, xmlNode *) = 0;
  30. #define callLookupFallback __pyx_api_f_4lxml_5etree_callLookupFallback
  31. static int (*__pyx_api_f_4lxml_5etree_tagMatches)(xmlNode *, const xmlChar *, const xmlChar *) = 0;
  32. #define tagMatches __pyx_api_f_4lxml_5etree_tagMatches
  33. static struct LxmlDocument *(*__pyx_api_f_4lxml_5etree_documentOrRaise)(PyObject *) = 0;
  34. #define documentOrRaise __pyx_api_f_4lxml_5etree_documentOrRaise
  35. static struct LxmlElement *(*__pyx_api_f_4lxml_5etree_rootNodeOrRaise)(PyObject *) = 0;
  36. #define rootNodeOrRaise __pyx_api_f_4lxml_5etree_rootNodeOrRaise
  37. static int (*__pyx_api_f_4lxml_5etree_hasText)(xmlNode *) = 0;
  38. #define hasText __pyx_api_f_4lxml_5etree_hasText
  39. static int (*__pyx_api_f_4lxml_5etree_hasTail)(xmlNode *) = 0;
  40. #define hasTail __pyx_api_f_4lxml_5etree_hasTail
  41. static PyObject *(*__pyx_api_f_4lxml_5etree_textOf)(xmlNode *) = 0;
  42. #define textOf __pyx_api_f_4lxml_5etree_textOf
  43. static PyObject *(*__pyx_api_f_4lxml_5etree_tailOf)(xmlNode *) = 0;
  44. #define tailOf __pyx_api_f_4lxml_5etree_tailOf
  45. static int (*__pyx_api_f_4lxml_5etree_setNodeText)(xmlNode *, PyObject *) = 0;
  46. #define setNodeText __pyx_api_f_4lxml_5etree_setNodeText
  47. static int (*__pyx_api_f_4lxml_5etree_setTailText)(xmlNode *, PyObject *) = 0;
  48. #define setTailText __pyx_api_f_4lxml_5etree_setTailText
  49. static PyObject *(*__pyx_api_f_4lxml_5etree_attributeValue)(xmlNode *, xmlAttr *) = 0;
  50. #define attributeValue __pyx_api_f_4lxml_5etree_attributeValue
  51. static PyObject *(*__pyx_api_f_4lxml_5etree_attributeValueFromNsName)(xmlNode *, const xmlChar *, const xmlChar *) = 0;
  52. #define attributeValueFromNsName __pyx_api_f_4lxml_5etree_attributeValueFromNsName
  53. static PyObject *(*__pyx_api_f_4lxml_5etree_getAttributeValue)(struct LxmlElement *, PyObject *, PyObject *) = 0;
  54. #define getAttributeValue __pyx_api_f_4lxml_5etree_getAttributeValue
  55. static PyObject *(*__pyx_api_f_4lxml_5etree_iterattributes)(struct LxmlElement *, int) = 0;
  56. #define iterattributes __pyx_api_f_4lxml_5etree_iterattributes
  57. static PyObject *(*__pyx_api_f_4lxml_5etree_collectAttributes)(xmlNode *, int) = 0;
  58. #define collectAttributes __pyx_api_f_4lxml_5etree_collectAttributes
  59. static int (*__pyx_api_f_4lxml_5etree_setAttributeValue)(struct LxmlElement *, PyObject *, PyObject *) = 0;
  60. #define setAttributeValue __pyx_api_f_4lxml_5etree_setAttributeValue
  61. static int (*__pyx_api_f_4lxml_5etree_delAttribute)(struct LxmlElement *, PyObject *) = 0;
  62. #define delAttribute __pyx_api_f_4lxml_5etree_delAttribute
  63. static int (*__pyx_api_f_4lxml_5etree_delAttributeFromNsName)(xmlNode *, const xmlChar *, const xmlChar *) = 0;
  64. #define delAttributeFromNsName __pyx_api_f_4lxml_5etree_delAttributeFromNsName
  65. static int (*__pyx_api_f_4lxml_5etree_hasChild)(xmlNode *) = 0;
  66. #define hasChild __pyx_api_f_4lxml_5etree_hasChild
  67. static xmlNode *(*__pyx_api_f_4lxml_5etree_findChild)(xmlNode *, Py_ssize_t) = 0;
  68. #define findChild __pyx_api_f_4lxml_5etree_findChild
  69. static xmlNode *(*__pyx_api_f_4lxml_5etree_findChildForwards)(xmlNode *, Py_ssize_t) = 0;
  70. #define findChildForwards __pyx_api_f_4lxml_5etree_findChildForwards
  71. static xmlNode *(*__pyx_api_f_4lxml_5etree_findChildBackwards)(xmlNode *, Py_ssize_t) = 0;
  72. #define findChildBackwards __pyx_api_f_4lxml_5etree_findChildBackwards
  73. static xmlNode *(*__pyx_api_f_4lxml_5etree_nextElement)(xmlNode *) = 0;
  74. #define nextElement __pyx_api_f_4lxml_5etree_nextElement
  75. static xmlNode *(*__pyx_api_f_4lxml_5etree_previousElement)(xmlNode *) = 0;
  76. #define previousElement __pyx_api_f_4lxml_5etree_previousElement
  77. static void (*__pyx_api_f_4lxml_5etree_appendChild)(struct LxmlElement *, struct LxmlElement *) = 0;
  78. #define appendChild __pyx_api_f_4lxml_5etree_appendChild
  79. static int (*__pyx_api_f_4lxml_5etree_appendChildToElement)(struct LxmlElement *, struct LxmlElement *) = 0;
  80. #define appendChildToElement __pyx_api_f_4lxml_5etree_appendChildToElement
  81. static PyObject *(*__pyx_api_f_4lxml_5etree_pyunicode)(const xmlChar *) = 0;
  82. #define pyunicode __pyx_api_f_4lxml_5etree_pyunicode
  83. static PyObject *(*__pyx_api_f_4lxml_5etree_utf8)(PyObject *) = 0;
  84. #define utf8 __pyx_api_f_4lxml_5etree_utf8
  85. static PyObject *(*__pyx_api_f_4lxml_5etree_getNsTag)(PyObject *) = 0;
  86. #define getNsTag __pyx_api_f_4lxml_5etree_getNsTag
  87. static PyObject *(*__pyx_api_f_4lxml_5etree_getNsTagWithEmptyNs)(PyObject *) = 0;
  88. #define getNsTagWithEmptyNs __pyx_api_f_4lxml_5etree_getNsTagWithEmptyNs
  89. static PyObject *(*__pyx_api_f_4lxml_5etree_namespacedName)(xmlNode *) = 0;
  90. #define namespacedName __pyx_api_f_4lxml_5etree_namespacedName
  91. static PyObject *(*__pyx_api_f_4lxml_5etree_namespacedNameFromNsName)(const xmlChar *, const xmlChar *) = 0;
  92. #define namespacedNameFromNsName __pyx_api_f_4lxml_5etree_namespacedNameFromNsName
  93. static void (*__pyx_api_f_4lxml_5etree_iteratorStoreNext)(struct LxmlElementIterator *, struct LxmlElement *) = 0;
  94. #define iteratorStoreNext __pyx_api_f_4lxml_5etree_iteratorStoreNext
  95. static void (*__pyx_api_f_4lxml_5etree_initTagMatch)(struct LxmlElementTagMatcher *, PyObject *) = 0;
  96. #define initTagMatch __pyx_api_f_4lxml_5etree_initTagMatch
  97. static xmlNs *(*__pyx_api_f_4lxml_5etree_findOrBuildNodeNsPrefix)(struct LxmlDocument *, xmlNode *, const xmlChar *, const xmlChar *) = 0;
  98. #define findOrBuildNodeNsPrefix __pyx_api_f_4lxml_5etree_findOrBuildNodeNsPrefix
  99. #if !defined(__Pyx_PyIdentifier_FromString)
  100. #if PY_MAJOR_VERSION < 3
  101. #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
  102. #else
  103. #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
  104. #endif
  105. #endif
  106. #ifndef __PYX_HAVE_RT_ImportFunction
  107. #define __PYX_HAVE_RT_ImportFunction
  108. static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
  109. PyObject *d = 0;
  110. PyObject *cobj = 0;
  111. union {
  112. void (*fp)(void);
  113. void *p;
  114. } tmp;
  115. d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
  116. if (!d)
  117. goto bad;
  118. cobj = PyDict_GetItemString(d, funcname);
  119. if (!cobj) {
  120. PyErr_Format(PyExc_ImportError,
  121. "%.200s does not export expected C function %.200s",
  122. PyModule_GetName(module), funcname);
  123. goto bad;
  124. }
  125. #if PY_VERSION_HEX >= 0x02070000
  126. if (!PyCapsule_IsValid(cobj, sig)) {
  127. PyErr_Format(PyExc_TypeError,
  128. "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
  129. PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
  130. goto bad;
  131. }
  132. tmp.p = PyCapsule_GetPointer(cobj, sig);
  133. #else
  134. {const char *desc, *s1, *s2;
  135. desc = (const char *)PyCObject_GetDesc(cobj);
  136. if (!desc)
  137. goto bad;
  138. s1 = desc; s2 = sig;
  139. while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
  140. if (*s1 != *s2) {
  141. PyErr_Format(PyExc_TypeError,
  142. "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
  143. PyModule_GetName(module), funcname, sig, desc);
  144. goto bad;
  145. }
  146. tmp.p = PyCObject_AsVoidPtr(cobj);}
  147. #endif
  148. *f = tmp.fp;
  149. if (!(*f))
  150. goto bad;
  151. Py_DECREF(d);
  152. return 0;
  153. bad:
  154. Py_XDECREF(d);
  155. return -1;
  156. }
  157. #endif
  158. static int import_lxml__etree(void) {
  159. PyObject *module = 0;
  160. module = PyImport_ImportModule("lxml.etree");
  161. if (!module) goto bad;
  162. if (__Pyx_ImportFunction(module, "deepcopyNodeToDocument", (void (**)(void))&__pyx_api_f_4lxml_5etree_deepcopyNodeToDocument, "struct LxmlElement *(struct LxmlDocument *, xmlNode *)") < 0) goto bad;
  163. if (__Pyx_ImportFunction(module, "elementTreeFactory", (void (**)(void))&__pyx_api_f_4lxml_5etree_elementTreeFactory, "struct LxmlElementTree *(struct LxmlElement *)") < 0) goto bad;
  164. if (__Pyx_ImportFunction(module, "newElementTree", (void (**)(void))&__pyx_api_f_4lxml_5etree_newElementTree, "struct LxmlElementTree *(struct LxmlElement *, PyObject *)") < 0) goto bad;
  165. if (__Pyx_ImportFunction(module, "adoptExternalDocument", (void (**)(void))&__pyx_api_f_4lxml_5etree_adoptExternalDocument, "struct LxmlElementTree *(xmlDoc *, PyObject *, int)") < 0) goto bad;
  166. if (__Pyx_ImportFunction(module, "elementFactory", (void (**)(void))&__pyx_api_f_4lxml_5etree_elementFactory, "struct LxmlElement *(struct LxmlDocument *, xmlNode *)") < 0) goto bad;
  167. if (__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;
  168. if (__Pyx_ImportFunction(module, "makeSubElement", (void (**)(void))&__pyx_api_f_4lxml_5etree_makeSubElement, "struct LxmlElement *(struct LxmlElement *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *)") < 0) goto bad;
  169. if (__Pyx_ImportFunction(module, "setElementClassLookupFunction", (void (**)(void))&__pyx_api_f_4lxml_5etree_setElementClassLookupFunction, "void (_element_class_lookup_function, PyObject *)") < 0) goto bad;
  170. if (__Pyx_ImportFunction(module, "lookupDefaultElementClass", (void (**)(void))&__pyx_api_f_4lxml_5etree_lookupDefaultElementClass, "PyObject *(PyObject *, PyObject *, xmlNode *)") < 0) goto bad;
  171. if (__Pyx_ImportFunction(module, "lookupNamespaceElementClass", (void (**)(void))&__pyx_api_f_4lxml_5etree_lookupNamespaceElementClass, "PyObject *(PyObject *, PyObject *, xmlNode *)") < 0) goto bad;
  172. if (__Pyx_ImportFunction(module, "callLookupFallback", (void (**)(void))&__pyx_api_f_4lxml_5etree_callLookupFallback, "PyObject *(struct LxmlFallbackElementClassLookup *, struct LxmlDocument *, xmlNode *)") < 0) goto bad;
  173. if (__Pyx_ImportFunction(module, "tagMatches", (void (**)(void))&__pyx_api_f_4lxml_5etree_tagMatches, "int (xmlNode *, const xmlChar *, const xmlChar *)") < 0) goto bad;
  174. if (__Pyx_ImportFunction(module, "documentOrRaise", (void (**)(void))&__pyx_api_f_4lxml_5etree_documentOrRaise, "struct LxmlDocument *(PyObject *)") < 0) goto bad;
  175. if (__Pyx_ImportFunction(module, "rootNodeOrRaise", (void (**)(void))&__pyx_api_f_4lxml_5etree_rootNodeOrRaise, "struct LxmlElement *(PyObject *)") < 0) goto bad;
  176. if (__Pyx_ImportFunction(module, "hasText", (void (**)(void))&__pyx_api_f_4lxml_5etree_hasText, "int (xmlNode *)") < 0) goto bad;
  177. if (__Pyx_ImportFunction(module, "hasTail", (void (**)(void))&__pyx_api_f_4lxml_5etree_hasTail, "int (xmlNode *)") < 0) goto bad;
  178. if (__Pyx_ImportFunction(module, "textOf", (void (**)(void))&__pyx_api_f_4lxml_5etree_textOf, "PyObject *(xmlNode *)") < 0) goto bad;
  179. if (__Pyx_ImportFunction(module, "tailOf", (void (**)(void))&__pyx_api_f_4lxml_5etree_tailOf, "PyObject *(xmlNode *)") < 0) goto bad;
  180. if (__Pyx_ImportFunction(module, "setNodeText", (void (**)(void))&__pyx_api_f_4lxml_5etree_setNodeText, "int (xmlNode *, PyObject *)") < 0) goto bad;
  181. if (__Pyx_ImportFunction(module, "setTailText", (void (**)(void))&__pyx_api_f_4lxml_5etree_setTailText, "int (xmlNode *, PyObject *)") < 0) goto bad;
  182. if (__Pyx_ImportFunction(module, "attributeValue", (void (**)(void))&__pyx_api_f_4lxml_5etree_attributeValue, "PyObject *(xmlNode *, xmlAttr *)") < 0) goto bad;
  183. if (__Pyx_ImportFunction(module, "attributeValueFromNsName", (void (**)(void))&__pyx_api_f_4lxml_5etree_attributeValueFromNsName, "PyObject *(xmlNode *, const xmlChar *, const xmlChar *)") < 0) goto bad;
  184. if (__Pyx_ImportFunction(module, "getAttributeValue", (void (**)(void))&__pyx_api_f_4lxml_5etree_getAttributeValue, "PyObject *(struct LxmlElement *, PyObject *, PyObject *)") < 0) goto bad;
  185. if (__Pyx_ImportFunction(module, "iterattributes", (void (**)(void))&__pyx_api_f_4lxml_5etree_iterattributes, "PyObject *(struct LxmlElement *, int)") < 0) goto bad;
  186. if (__Pyx_ImportFunction(module, "collectAttributes", (void (**)(void))&__pyx_api_f_4lxml_5etree_collectAttributes, "PyObject *(xmlNode *, int)") < 0) goto bad;
  187. if (__Pyx_ImportFunction(module, "setAttributeValue", (void (**)(void))&__pyx_api_f_4lxml_5etree_setAttributeValue, "int (struct LxmlElement *, PyObject *, PyObject *)") < 0) goto bad;
  188. if (__Pyx_ImportFunction(module, "delAttribute", (void (**)(void))&__pyx_api_f_4lxml_5etree_delAttribute, "int (struct LxmlElement *, PyObject *)") < 0) goto bad;
  189. if (__Pyx_ImportFunction(module, "delAttributeFromNsName", (void (**)(void))&__pyx_api_f_4lxml_5etree_delAttributeFromNsName, "int (xmlNode *, const xmlChar *, const xmlChar *)") < 0) goto bad;
  190. if (__Pyx_ImportFunction(module, "hasChild", (void (**)(void))&__pyx_api_f_4lxml_5etree_hasChild, "int (xmlNode *)") < 0) goto bad;
  191. if (__Pyx_ImportFunction(module, "findChild", (void (**)(void))&__pyx_api_f_4lxml_5etree_findChild, "xmlNode *(xmlNode *, Py_ssize_t)") < 0) goto bad;
  192. if (__Pyx_ImportFunction(module, "findChildForwards", (void (**)(void))&__pyx_api_f_4lxml_5etree_findChildForwards, "xmlNode *(xmlNode *, Py_ssize_t)") < 0) goto bad;
  193. if (__Pyx_ImportFunction(module, "findChildBackwards", (void (**)(void))&__pyx_api_f_4lxml_5etree_findChildBackwards, "xmlNode *(xmlNode *, Py_ssize_t)") < 0) goto bad;
  194. if (__Pyx_ImportFunction(module, "nextElement", (void (**)(void))&__pyx_api_f_4lxml_5etree_nextElement, "xmlNode *(xmlNode *)") < 0) goto bad;
  195. if (__Pyx_ImportFunction(module, "previousElement", (void (**)(void))&__pyx_api_f_4lxml_5etree_previousElement, "xmlNode *(xmlNode *)") < 0) goto bad;
  196. if (__Pyx_ImportFunction(module, "appendChild", (void (**)(void))&__pyx_api_f_4lxml_5etree_appendChild, "void (struct LxmlElement *, struct LxmlElement *)") < 0) goto bad;
  197. if (__Pyx_ImportFunction(module, "appendChildToElement", (void (**)(void))&__pyx_api_f_4lxml_5etree_appendChildToElement, "int (struct LxmlElement *, struct LxmlElement *)") < 0) goto bad;
  198. if (__Pyx_ImportFunction(module, "pyunicode", (void (**)(void))&__pyx_api_f_4lxml_5etree_pyunicode, "PyObject *(const xmlChar *)") < 0) goto bad;
  199. if (__Pyx_ImportFunction(module, "utf8", (void (**)(void))&__pyx_api_f_4lxml_5etree_utf8, "PyObject *(PyObject *)") < 0) goto bad;
  200. if (__Pyx_ImportFunction(module, "getNsTag", (void (**)(void))&__pyx_api_f_4lxml_5etree_getNsTag, "PyObject *(PyObject *)") < 0) goto bad;
  201. if (__Pyx_ImportFunction(module, "getNsTagWithEmptyNs", (void (**)(void))&__pyx_api_f_4lxml_5etree_getNsTagWithEmptyNs, "PyObject *(PyObject *)") < 0) goto bad;
  202. if (__Pyx_ImportFunction(module, "namespacedName", (void (**)(void))&__pyx_api_f_4lxml_5etree_namespacedName, "PyObject *(xmlNode *)") < 0) goto bad;
  203. if (__Pyx_ImportFunction(module, "namespacedNameFromNsName", (void (**)(void))&__pyx_api_f_4lxml_5etree_namespacedNameFromNsName, "PyObject *(const xmlChar *, const xmlChar *)") < 0) goto bad;
  204. if (__Pyx_ImportFunction(module, "iteratorStoreNext", (void (**)(void))&__pyx_api_f_4lxml_5etree_iteratorStoreNext, "void (struct LxmlElementIterator *, struct LxmlElement *)") < 0) goto bad;
  205. if (__Pyx_ImportFunction(module, "initTagMatch", (void (**)(void))&__pyx_api_f_4lxml_5etree_initTagMatch, "void (struct LxmlElementTagMatcher *, PyObject *)") < 0) goto bad;
  206. if (__Pyx_ImportFunction(module, "findOrBuildNodeNsPrefix", (void (**)(void))&__pyx_api_f_4lxml_5etree_findOrBuildNodeNsPrefix, "xmlNs *(struct LxmlDocument *, xmlNode *, const xmlChar *, const xmlChar *)") < 0) goto bad;
  207. Py_DECREF(module); module = 0;
  208. return 0;
  209. bad:
  210. Py_XDECREF(module);
  211. return -1;
  212. }
  213. #endif /* !__PYX_HAVE_API__lxml__etree */