2 #include <libxml/tree.h>
3 #include <libxml/parser.h>
4 #include <libxml/parserInternals.h>
5 #include <libxml/catalog.h>
6 #include <libxml/threads.h>
7 #include <libxml/nanoftp.h>
8 #include <libxml/nanohttp.h>
9 #include <libxml/uri.h>
10 #include <libxml/xpath.h>
11 #include <libxml/xpathInternals.h>
12 #include <libxml/debugXML.h>
13 #include <libxml/HTMLparser.h>
14 #include <libxml/HTMLtree.h>
15 #include <libxml/xinclude.h>
16 #include <libxml/xpointer.h>
17 #include <libxml/xmlunicode.h>
18 #include <libxml/xmlregexp.h>
19 #include <libxml/xmlautomata.h>
20 #include <libxml/xmlreader.h>
21 #ifdef LIBXML_SCHEMAS_ENABLED
22 #include <libxml/relaxng.h>
23 #include <libxml/xmlschemas.h>
29 * Macro used to signal to GCC unused function parameters
30 * Repeated here since the definition is not available when
31 * compiled outside the libxml2 build tree.
34 #ifdef ATTRIBUTE_UNUSED
35 #undef ATTRIBUTE_UNUSED
37 #ifndef ATTRIBUTE_UNUSED
38 #define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
39 #endif /* ATTRIBUTE_UNUSED */
41 #define ATTRIBUTE_UNUSED
44 #define PyxmlNode_Get(v) (((v) == Py_None) ? NULL : \
45 (((PyxmlNode_Object *)(v))->obj))
52 #define PyxmlXPathContext_Get(v) (((v) == Py_None) ? NULL : \
53 (((PyxmlXPathContext_Object *)(v))->obj))
57 xmlXPathContextPtr obj;
58 } PyxmlXPathContext_Object;
60 #define PyxmlXPathParserContext_Get(v) (((v) == Py_None) ? NULL : \
61 (((PyxmlXPathParserContext_Object *)(v))->obj))
65 xmlXPathParserContextPtr obj;
66 } PyxmlXPathParserContext_Object;
68 #define PyparserCtxt_Get(v) (((v) == Py_None) ? NULL : \
69 (((PyparserCtxt_Object *)(v))->obj))
74 } PyparserCtxt_Object;
76 #define PyValidCtxt_Get(v) (((v) == Py_None) ? NULL : \
77 (((PyValidCtxt_Object *)(v))->obj))
84 #define Pycatalog_Get(v) (((v) == Py_None) ? NULL : \
85 (((Pycatalog_Object *)(v))->obj))
92 #ifdef LIBXML_REGEXP_ENABLED
93 #define PyxmlReg_Get(v) (((v) == Py_None) ? NULL : \
94 (((PyxmlReg_Object *)(v))->obj))
100 #endif /* LIBXML_REGEXP_ENABLED */
102 #ifdef LIBXML_READER_ENABLED
103 #define PyxmlTextReader_Get(v) (((v) == Py_None) ? NULL : \
104 (((PyxmlTextReader_Object *)(v))->obj))
108 xmlTextReaderPtr obj;
109 } PyxmlTextReader_Object;
111 #define PyxmlTextReaderLocator_Get(v) (((v) == Py_None) ? NULL : \
112 (((PyxmlTextReaderLocator_Object *)(v))->obj))
116 xmlTextReaderLocatorPtr obj;
117 } PyxmlTextReaderLocator_Object;
120 #define PyURI_Get(v) (((v) == Py_None) ? NULL : \
121 (((PyURI_Object *)(v))->obj))
128 #define PyError_Get(v) (((v) == Py_None) ? NULL : \
129 (((PyError_Object *)(v))->obj))
133 xmlOutputBufferPtr obj;
134 } PyoutputBuffer_Object;
136 #define PyoutputBuffer_Get(v) (((v) == Py_None) ? NULL : \
137 (((PyoutputBuffer_Object *)(v))->obj))
141 xmlParserInputBufferPtr obj;
142 } PyinputBuffer_Object;
144 #define PyinputBuffer_Get(v) (((v) == Py_None) ? NULL : \
145 (((PyinputBuffer_Object *)(v))->obj))
152 /* FILE * have their own internal representation */
153 #define PyFile_Get(v) (((v) == Py_None) ? NULL : \
154 (PyFile_Check(v) ? (PyFile_AsFile(v)) : stdout))
156 #ifdef LIBXML_SCHEMAS_ENABLED
160 } PyrelaxNgSchema_Object;
162 #define PyrelaxNgSchema_Get(v) (((v) == Py_None) ? NULL : \
163 (((PyrelaxNgSchema_Object *)(v))->obj))
167 xmlRelaxNGParserCtxtPtr obj;
168 } PyrelaxNgParserCtxt_Object;
170 #define PyrelaxNgParserCtxt_Get(v) (((v) == Py_None) ? NULL : \
171 (((PyrelaxNgParserCtxt_Object *)(v))->obj))
175 xmlRelaxNGValidCtxtPtr obj;
176 } PyrelaxNgValidCtxt_Object;
178 #define PyrelaxNgValidCtxt_Get(v) (((v) == Py_None) ? NULL : \
179 (((PyrelaxNgValidCtxt_Object *)(v))->obj))
186 #define PySchema_Get(v) (((v) == Py_None) ? NULL : \
187 (((PySchema_Object *)(v))->obj))
191 xmlSchemaParserCtxtPtr obj;
192 } PySchemaParserCtxt_Object;
194 #define PySchemaParserCtxt_Get(v) (((v) == Py_None) ? NULL : \
195 (((PySchemaParserCtxt_Object *)(v))->obj))
199 xmlSchemaValidCtxtPtr obj;
200 } PySchemaValidCtxt_Object;
202 #define PySchemaValidCtxt_Get(v) (((v) == Py_None) ? NULL : \
203 (((PySchemaValidCtxt_Object *)(v))->obj))
205 #endif /* LIBXML_SCHEMAS_ENABLED */
207 PyObject * libxml_intWrap(int val);
208 PyObject * libxml_longWrap(long val);
209 PyObject * libxml_xmlCharPtrWrap(xmlChar *str);
210 PyObject * libxml_constxmlCharPtrWrap(const xmlChar *str);
211 PyObject * libxml_charPtrWrap(char *str);
212 PyObject * libxml_constcharPtrWrap(const char *str);
213 PyObject * libxml_charPtrConstWrap(const char *str);
214 PyObject * libxml_xmlCharPtrConstWrap(const xmlChar *str);
215 PyObject * libxml_xmlDocPtrWrap(xmlDocPtr doc);
216 PyObject * libxml_xmlNodePtrWrap(xmlNodePtr node);
217 PyObject * libxml_xmlAttrPtrWrap(xmlAttrPtr attr);
218 PyObject * libxml_xmlNsPtrWrap(xmlNsPtr ns);
219 PyObject * libxml_xmlAttributePtrWrap(xmlAttributePtr ns);
220 PyObject * libxml_xmlElementPtrWrap(xmlElementPtr ns);
221 PyObject * libxml_doubleWrap(double val);
222 PyObject * libxml_xmlXPathContextPtrWrap(xmlXPathContextPtr ctxt);
223 PyObject * libxml_xmlParserCtxtPtrWrap(xmlParserCtxtPtr ctxt);
224 PyObject * libxml_xmlXPathParserContextPtrWrap(xmlXPathParserContextPtr ctxt);
225 PyObject * libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj);
226 PyObject * libxml_xmlValidCtxtPtrWrap(xmlValidCtxtPtr valid);
227 PyObject * libxml_xmlCatalogPtrWrap(xmlCatalogPtr obj);
228 PyObject * libxml_xmlURIPtrWrap(xmlURIPtr uri);
229 PyObject * libxml_xmlOutputBufferPtrWrap(xmlOutputBufferPtr buffer);
230 PyObject * libxml_xmlParserInputBufferPtrWrap(xmlParserInputBufferPtr buffer);
231 #ifdef LIBXML_REGEXP_ENABLED
232 PyObject * libxml_xmlRegexpPtrWrap(xmlRegexpPtr regexp);
233 #endif /* LIBXML_REGEXP_ENABLED */
234 #ifdef LIBXML_READER_ENABLED
235 PyObject * libxml_xmlTextReaderPtrWrap(xmlTextReaderPtr reader);
236 PyObject * libxml_xmlTextReaderLocatorPtrWrap(xmlTextReaderLocatorPtr locator);
239 xmlXPathObjectPtr libxml_xmlXPathObjectPtrConvert(PyObject * obj);
240 #ifdef LIBXML_SCHEMAS_ENABLED
241 PyObject * libxml_xmlRelaxNGPtrWrap(xmlRelaxNGPtr ctxt);
242 PyObject * libxml_xmlRelaxNGParserCtxtPtrWrap(xmlRelaxNGParserCtxtPtr ctxt);
243 PyObject * libxml_xmlRelaxNGValidCtxtPtrWrap(xmlRelaxNGValidCtxtPtr valid);
244 PyObject * libxml_xmlSchemaPtrWrap(xmlSchemaPtr ctxt);
245 PyObject * libxml_xmlSchemaParserCtxtPtrWrap(xmlSchemaParserCtxtPtr ctxt);
246 PyObject * libxml_xmlSchemaValidCtxtPtrWrap(xmlSchemaValidCtxtPtr valid);
247 #endif /* LIBXML_SCHEMAS_ENABLED */
248 PyObject * libxml_xmlErrorPtrWrap(xmlErrorPtr error);
249 PyObject * libxml_xmlSchemaSetValidErrors(PyObject * self, PyObject * args);