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 #include <libxml/relaxng.h>
26 * Macro used to signal to GCC unused function parameters
27 * Repeated here since the definition is not available when
28 * compiled outside the libxml2 build tree.
31 #ifdef ATTRIBUTE_UNUSED
32 #undef ATTRIBUTE_UNUSED
34 #ifndef ATTRIBUTE_UNUSED
35 #define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
36 #endif /* ATTRIBUTE_UNUSED */
38 #define ATTRIBUTE_UNUSED
41 #define PyxmlNode_Get(v) (((v) == Py_None) ? NULL : \
42 (((PyxmlNode_Object *)(v))->obj))
49 #define PyxmlXPathContext_Get(v) (((v) == Py_None) ? NULL : \
50 (((PyxmlXPathContext_Object *)(v))->obj))
54 xmlXPathContextPtr obj;
55 } PyxmlXPathContext_Object;
57 #define PyxmlXPathParserContext_Get(v) (((v) == Py_None) ? NULL : \
58 (((PyxmlXPathParserContext_Object *)(v))->obj))
62 xmlXPathParserContextPtr obj;
63 } PyxmlXPathParserContext_Object;
65 #define PyparserCtxt_Get(v) (((v) == Py_None) ? NULL : \
66 (((PyparserCtxt_Object *)(v))->obj))
71 } PyparserCtxt_Object;
73 #define Pycatalog_Get(v) (((v) == Py_None) ? NULL : \
74 (((Pycatalog_Object *)(v))->obj))
81 #ifdef LIBXML_REGEXP_ENABLED
82 #define PyxmlReg_Get(v) (((v) == Py_None) ? NULL : \
83 (((PyxmlReg_Object *)(v))->obj))
89 #endif /* LIBXML_REGEXP_ENABLED */
91 #define PyxmlTextReader_Get(v) (((v) == Py_None) ? NULL : \
92 (((PyxmlTextReader_Object *)(v))->obj))
97 } PyxmlTextReader_Object;
99 #define PyxmlTextReaderLocator_Get(v) (((v) == Py_None) ? NULL : \
100 (((PyxmlTextReaderLocator_Object *)(v))->obj))
104 xmlTextReaderLocatorPtr obj;
105 } PyxmlTextReaderLocator_Object;
107 #define PyURI_Get(v) (((v) == Py_None) ? NULL : \
108 (((PyURI_Object *)(v))->obj))
112 xmlOutputBufferPtr obj;
113 } PyoutputBuffer_Object;
115 #define PyoutputBuffer_Get(v) (((v) == Py_None) ? NULL : \
116 (((PyURI_Object *)(v))->obj))
120 xmlParserInputBufferPtr obj;
121 } PyinputBuffer_Object;
123 #define PyinputBuffer_Get(v) (((v) == Py_None) ? NULL : \
124 (((PyURI_Object *)(v))->obj))
131 /* FILE * have their own internal representation */
132 #define PyFile_Get(v) (((v) == Py_None) ? NULL : \
133 (PyFile_Check(v) ? (PyFile_AsFile(v)) : stdout))
135 #ifdef LIBXML_SCHEMAS_ENABLED
139 } PyrelaxNgSchema_Object;
141 #define PyrelaxNgSchema_Get(v) (((v) == Py_None) ? NULL : \
142 (((PyrelaxNgSchema_Object *)(v))->obj))
146 xmlRelaxNGParserCtxtPtr obj;
147 } PyrelaxNgParserCtxt_Object;
149 #define PyrelaxNgParserCtxt_Get(v) (((v) == Py_None) ? NULL : \
150 (((PyrelaxNgParserCtxt_Object *)(v))->obj))
154 xmlRelaxNGValidCtxtPtr obj;
155 } PyrelaxNgValidCtxt_Object;
157 #define PyrelaxNgValidCtxt_Get(v) (((v) == Py_None) ? NULL : \
158 (((PyrelaxNgValidCtxt_Object *)(v))->obj))
160 #endif /* LIBXML_SCHEMAS_ENABLED */
162 PyObject * libxml_intWrap(int val);
163 PyObject * libxml_longWrap(long val);
164 PyObject * libxml_xmlCharPtrWrap(xmlChar *str);
165 PyObject * libxml_constxmlCharPtrWrap(const xmlChar *str);
166 PyObject * libxml_charPtrWrap(char *str);
167 PyObject * libxml_constcharPtrWrap(const char *str);
168 PyObject * libxml_charPtrConstWrap(const char *str);
169 PyObject * libxml_xmlCharPtrConstWrap(const xmlChar *str);
170 PyObject * libxml_xmlDocPtrWrap(xmlDocPtr doc);
171 PyObject * libxml_xmlNodePtrWrap(xmlNodePtr node);
172 PyObject * libxml_xmlAttrPtrWrap(xmlAttrPtr attr);
173 PyObject * libxml_xmlNsPtrWrap(xmlNsPtr ns);
174 PyObject * libxml_xmlAttributePtrWrap(xmlAttributePtr ns);
175 PyObject * libxml_xmlElementPtrWrap(xmlElementPtr ns);
176 PyObject * libxml_doubleWrap(double val);
177 PyObject * libxml_xmlXPathContextPtrWrap(xmlXPathContextPtr ctxt);
178 PyObject * libxml_xmlParserCtxtPtrWrap(xmlParserCtxtPtr ctxt);
179 PyObject * libxml_xmlXPathParserContextPtrWrap(xmlXPathParserContextPtr ctxt);
180 PyObject * libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj);
181 PyObject * libxml_xmlCatalogPtrWrap(xmlCatalogPtr obj);
182 PyObject * libxml_xmlURIPtrWrap(xmlURIPtr uri);
183 PyObject * libxml_xmlOutputBufferPtrWrap(xmlOutputBufferPtr buffer);
184 PyObject * libxml_xmlParserInputBufferPtrWrap(xmlParserInputBufferPtr buffer);
185 #ifdef LIBXML_REGEXP_ENABLED
186 PyObject * libxml_xmlRegexpPtrWrap(xmlRegexpPtr regexp);
187 #endif /* LIBXML_REGEXP_ENABLED */
188 PyObject * libxml_xmlTextReaderPtrWrap(xmlTextReaderPtr reader);
189 PyObject * libxml_xmlTextReaderLocatorPtrWrap(xmlTextReaderLocatorPtr locator);
191 xmlXPathObjectPtr libxml_xmlXPathObjectPtrConvert(PyObject * obj);
192 #ifdef LIBXML_SCHEMAS_ENABLED
193 PyObject * libxml_xmlRelaxNGPtrWrap(xmlRelaxNGPtr ctxt);
194 PyObject * libxml_xmlRelaxNGParserCtxtPtrWrap(xmlRelaxNGParserCtxtPtr ctxt);
195 PyObject * libxml_xmlRelaxNGValidCtxtPtrWrap(xmlRelaxNGValidCtxtPtr valid);
196 #endif /* LIBXML_SCHEMAS_ENABLED */