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