9b45ba1ac01dc313cb8fc44478be4b26bdc8b576
[platform/upstream/python-lxml.git] / src / lxml / lxml.etree.h
1 /* Generated by Cython 0.28.3 */
2
3 #ifndef __PYX_HAVE__lxml__etree
4 #define __PYX_HAVE__lxml__etree
5
6 struct LxmlDocument;
7 struct LxmlElement;
8 struct LxmlElementTree;
9 struct LxmlElementTagMatcher;
10 struct LxmlElementIterator;
11 struct LxmlElementBase;
12 struct LxmlElementClassLookup;
13 struct LxmlFallbackElementClassLookup;
14
15 /* "lxml/etree.pyx":320
16  * 
17  * # type of a function that steps from node to node
18  * ctypedef public xmlNode* (*_node_to_node_function)(xmlNode*)             # <<<<<<<<<<<<<<
19  * 
20  * 
21  */
22 typedef xmlNode *(*_node_to_node_function)(xmlNode *);
23
24 /* "lxml/etree.pyx":336
25  * @cython.final
26  * @cython.freelist(8)
27  * cdef public class _Document [ type LxmlDocumentType, object LxmlDocument ]:             # <<<<<<<<<<<<<<
28  *     u"""Internal base class to reference a libxml document.
29  * 
30  */
31 struct LxmlDocument {
32   PyObject_HEAD
33   struct __pyx_vtabstruct_4lxml_5etree__Document *__pyx_vtab;
34   int _ns_counter;
35   PyObject *_prefix_tail;
36   xmlDoc *_c_doc;
37   struct __pyx_obj_4lxml_5etree__BaseParser *_parser;
38 };
39
40 /* "lxml/etree.pyx":685
41  * 
42  * @cython.no_gc_clear
43  * cdef public class _Element [ type LxmlElementType, object LxmlElement ]:             # <<<<<<<<<<<<<<
44  *     u"""Element class.
45  * 
46  */
47 struct LxmlElement {
48   PyObject_HEAD
49   struct LxmlDocument *_doc;
50   xmlNode *_c_node;
51   PyObject *_tag;
52 };
53
54 /* "lxml/etree.pyx":1849
55  * 
56  * 
57  * cdef public class _ElementTree [ type LxmlElementTreeType,             # <<<<<<<<<<<<<<
58  *                                  object LxmlElementTree ]:
59  *     cdef _Document _doc
60  */
61 struct LxmlElementTree {
62   PyObject_HEAD
63   struct __pyx_vtabstruct_4lxml_5etree__ElementTree *__pyx_vtab;
64   struct LxmlDocument *_doc;
65   struct LxmlElement *_context_node;
66 };
67
68 /* "lxml/etree.pyx":2576
69  * 
70  * 
71  * cdef public class _ElementTagMatcher [ object LxmlElementTagMatcher,             # <<<<<<<<<<<<<<
72  *                                        type LxmlElementTagMatcherType ]:
73  *     """
74  */
75 struct LxmlElementTagMatcher {
76   PyObject_HEAD
77   struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher *__pyx_vtab;
78   PyObject *_pystrings;
79   int _node_type;
80   char *_href;
81   char *_name;
82 };
83
84 /* "lxml/etree.pyx":2607
85  *                 self._name = NULL
86  * 
87  * cdef public class _ElementIterator(_ElementTagMatcher) [             # <<<<<<<<<<<<<<
88  *     object LxmlElementIterator, type LxmlElementIteratorType ]:
89  *     """
90  */
91 struct LxmlElementIterator {
92   struct LxmlElementTagMatcher __pyx_base;
93   struct LxmlElement *_node;
94   _node_to_node_function _next_element;
95 };
96
97 /* "src/lxml/classlookup.pxi":6
98  * # Custom Element classes
99  * 
100  * cdef public class ElementBase(_Element) [ type LxmlElementBaseType,             # <<<<<<<<<<<<<<
101  *                                           object LxmlElementBase ]:
102  *     u"""ElementBase(*children, attrib=None, nsmap=None, **_extra)
103  */
104 struct LxmlElementBase {
105   struct LxmlElement __pyx_base;
106 };
107
108 /* "src/lxml/classlookup.pxi":210
109  * # Element class lookup
110  * 
111  * ctypedef public object (*_element_class_lookup_function)(object, _Document, xmlNode*)             # <<<<<<<<<<<<<<
112  * 
113  * # class to store element class lookup functions
114  */
115 typedef PyObject *(*_element_class_lookup_function)(PyObject *, struct LxmlDocument *, xmlNode *);
116
117 /* "src/lxml/classlookup.pxi":213
118  * 
119  * # class to store element class lookup functions
120  * cdef public class ElementClassLookup [ type LxmlElementClassLookupType,             # <<<<<<<<<<<<<<
121  *                                        object LxmlElementClassLookup ]:
122  *     u"""ElementClassLookup(self)
123  */
124 struct LxmlElementClassLookup {
125   PyObject_HEAD
126   _element_class_lookup_function _lookup_function;
127 };
128
129 /* "src/lxml/classlookup.pxi":221
130  * 
131  * 
132  * cdef public class FallbackElementClassLookup(ElementClassLookup) \             # <<<<<<<<<<<<<<
133  *          [ type LxmlFallbackElementClassLookupType,
134  *            object LxmlFallbackElementClassLookup ]:
135  */
136 struct LxmlFallbackElementClassLookup {
137   struct LxmlElementClassLookup __pyx_base;
138   struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup *__pyx_vtab;
139   struct LxmlElementClassLookup *fallback;
140   _element_class_lookup_function _fallback_function;
141 };
142
143 #ifndef __PYX_HAVE_API__lxml__etree
144
145 #ifndef __PYX_EXTERN_C
146   #ifdef __cplusplus
147     #define __PYX_EXTERN_C extern "C"
148   #else
149     #define __PYX_EXTERN_C extern
150   #endif
151 #endif
152
153 #ifndef DL_IMPORT
154   #define DL_IMPORT(_T) _T
155 #endif
156
157 __PYX_EXTERN_C DL_IMPORT(PyTypeObject) LxmlDocumentType;
158 __PYX_EXTERN_C DL_IMPORT(PyTypeObject) LxmlElementType;
159 __PYX_EXTERN_C DL_IMPORT(PyTypeObject) LxmlElementTreeType;
160 __PYX_EXTERN_C DL_IMPORT(PyTypeObject) LxmlElementTagMatcherType;
161 __PYX_EXTERN_C DL_IMPORT(PyTypeObject) LxmlElementIteratorType;
162 __PYX_EXTERN_C DL_IMPORT(PyTypeObject) LxmlElementBaseType;
163 __PYX_EXTERN_C DL_IMPORT(PyTypeObject) LxmlElementClassLookupType;
164 __PYX_EXTERN_C DL_IMPORT(PyTypeObject) LxmlFallbackElementClassLookupType;
165
166 __PYX_EXTERN_C struct LxmlElement *deepcopyNodeToDocument(struct LxmlDocument *, xmlNode *);
167 __PYX_EXTERN_C struct LxmlElementTree *elementTreeFactory(struct LxmlElement *);
168 __PYX_EXTERN_C struct LxmlElementTree *newElementTree(struct LxmlElement *, PyObject *);
169 __PYX_EXTERN_C struct LxmlElementTree *adoptExternalDocument(xmlDoc *, PyObject *, int);
170 __PYX_EXTERN_C struct LxmlElement *elementFactory(struct LxmlDocument *, xmlNode *);
171 __PYX_EXTERN_C struct LxmlElement *makeElement(PyObject *, struct LxmlDocument *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *);
172 __PYX_EXTERN_C struct LxmlElement *makeSubElement(struct LxmlElement *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *);
173 __PYX_EXTERN_C void setElementClassLookupFunction(_element_class_lookup_function, PyObject *);
174 __PYX_EXTERN_C PyObject *lookupDefaultElementClass(PyObject *, PyObject *, xmlNode *);
175 __PYX_EXTERN_C PyObject *lookupNamespaceElementClass(PyObject *, PyObject *, xmlNode *);
176 __PYX_EXTERN_C PyObject *callLookupFallback(struct LxmlFallbackElementClassLookup *, struct LxmlDocument *, xmlNode *);
177 __PYX_EXTERN_C int tagMatches(xmlNode *, const xmlChar *, const xmlChar *);
178 __PYX_EXTERN_C struct LxmlDocument *documentOrRaise(PyObject *);
179 __PYX_EXTERN_C struct LxmlElement *rootNodeOrRaise(PyObject *);
180 __PYX_EXTERN_C int hasText(xmlNode *);
181 __PYX_EXTERN_C int hasTail(xmlNode *);
182 __PYX_EXTERN_C PyObject *textOf(xmlNode *);
183 __PYX_EXTERN_C PyObject *tailOf(xmlNode *);
184 __PYX_EXTERN_C int setNodeText(xmlNode *, PyObject *);
185 __PYX_EXTERN_C int setTailText(xmlNode *, PyObject *);
186 __PYX_EXTERN_C PyObject *attributeValue(xmlNode *, xmlAttr *);
187 __PYX_EXTERN_C PyObject *attributeValueFromNsName(xmlNode *, const xmlChar *, const xmlChar *);
188 __PYX_EXTERN_C PyObject *getAttributeValue(struct LxmlElement *, PyObject *, PyObject *);
189 __PYX_EXTERN_C PyObject *iterattributes(struct LxmlElement *, int);
190 __PYX_EXTERN_C PyObject *collectAttributes(xmlNode *, int);
191 __PYX_EXTERN_C int setAttributeValue(struct LxmlElement *, PyObject *, PyObject *);
192 __PYX_EXTERN_C int delAttribute(struct LxmlElement *, PyObject *);
193 __PYX_EXTERN_C int delAttributeFromNsName(xmlNode *, const xmlChar *, const xmlChar *);
194 __PYX_EXTERN_C int hasChild(xmlNode *);
195 __PYX_EXTERN_C xmlNode *findChild(xmlNode *, Py_ssize_t);
196 __PYX_EXTERN_C xmlNode *findChildForwards(xmlNode *, Py_ssize_t);
197 __PYX_EXTERN_C xmlNode *findChildBackwards(xmlNode *, Py_ssize_t);
198 __PYX_EXTERN_C xmlNode *nextElement(xmlNode *);
199 __PYX_EXTERN_C xmlNode *previousElement(xmlNode *);
200 __PYX_EXTERN_C void appendChild(struct LxmlElement *, struct LxmlElement *);
201 __PYX_EXTERN_C int appendChildToElement(struct LxmlElement *, struct LxmlElement *);
202 __PYX_EXTERN_C PyObject *pyunicode(const xmlChar *);
203 __PYX_EXTERN_C PyObject *utf8(PyObject *);
204 __PYX_EXTERN_C PyObject *getNsTag(PyObject *);
205 __PYX_EXTERN_C PyObject *getNsTagWithEmptyNs(PyObject *);
206 __PYX_EXTERN_C PyObject *namespacedName(xmlNode *);
207 __PYX_EXTERN_C PyObject *namespacedNameFromNsName(const xmlChar *, const xmlChar *);
208 __PYX_EXTERN_C void iteratorStoreNext(struct LxmlElementIterator *, struct LxmlElement *);
209 __PYX_EXTERN_C void initTagMatch(struct LxmlElementTagMatcher *, PyObject *);
210 __PYX_EXTERN_C xmlNs *findOrBuildNodeNsPrefix(struct LxmlDocument *, xmlNode *, const xmlChar *, const xmlChar *);
211
212 #endif /* !__PYX_HAVE_API__lxml__etree */
213
214 /* WARNING: the interface of the module init function changed in CPython 3.5. */
215 /* It now returns a PyModuleDef instance instead of a PyModule instance. */
216
217 #if PY_MAJOR_VERSION < 3
218 PyMODINIT_FUNC initetree(void);
219 #else
220 PyMODINIT_FUNC PyInit_etree(void);
221 #endif
222
223 #endif /* !__PYX_HAVE__lxml__etree */