Mercurial > repos > guerler > springsuite
comparison planemo/lib/python3.7/site-packages/lxml/includes/xmlparser.pxd @ 1:56ad4e20f292 draft
"planemo upload commit 6eee67778febed82ddd413c3ca40b3183a3898f1"
| author | guerler |
|---|---|
| date | Fri, 31 Jul 2020 00:32:28 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 0:d30785e31577 | 1:56ad4e20f292 |
|---|---|
| 1 from libc.string cimport const_char | |
| 2 | |
| 3 from lxml.includes.tree cimport ( | |
| 4 xmlDoc, xmlNode, xmlDict, xmlDtd, xmlChar, const_xmlChar) | |
| 5 from lxml.includes.tree cimport xmlInputReadCallback, xmlInputCloseCallback | |
| 6 from lxml.includes.xmlerror cimport xmlError, xmlStructuredErrorFunc | |
| 7 | |
| 8 | |
| 9 cdef extern from "libxml/parser.h": | |
| 10 ctypedef void (*startElementNsSAX2Func)(void* ctx, | |
| 11 const_xmlChar* localname, | |
| 12 const_xmlChar* prefix, | |
| 13 const_xmlChar* URI, | |
| 14 int nb_namespaces, | |
| 15 const_xmlChar** namespaces, | |
| 16 int nb_attributes, | |
| 17 int nb_defaulted, | |
| 18 const_xmlChar** attributes) | |
| 19 | |
| 20 ctypedef void (*endElementNsSAX2Func)(void* ctx, | |
| 21 const_xmlChar* localname, | |
| 22 const_xmlChar* prefix, | |
| 23 const_xmlChar* URI) | |
| 24 | |
| 25 ctypedef void (*startElementSAXFunc)(void* ctx, const_xmlChar* name, const_xmlChar** atts) | |
| 26 | |
| 27 ctypedef void (*endElementSAXFunc)(void* ctx, const_xmlChar* name) | |
| 28 | |
| 29 ctypedef void (*charactersSAXFunc)(void* ctx, const_xmlChar* ch, int len) | |
| 30 | |
| 31 ctypedef void (*cdataBlockSAXFunc)(void* ctx, const_xmlChar* value, int len) | |
| 32 | |
| 33 ctypedef void (*commentSAXFunc)(void* ctx, const_xmlChar* value) | |
| 34 | |
| 35 ctypedef void (*processingInstructionSAXFunc)(void* ctx, | |
| 36 const_xmlChar* target, | |
| 37 const_xmlChar* data) | |
| 38 | |
| 39 ctypedef void (*internalSubsetSAXFunc)(void* ctx, | |
| 40 const_xmlChar* name, | |
| 41 const_xmlChar* externalID, | |
| 42 const_xmlChar* systemID) | |
| 43 | |
| 44 ctypedef void (*endDocumentSAXFunc)(void* ctx) | |
| 45 | |
| 46 ctypedef void (*startDocumentSAXFunc)(void* ctx) | |
| 47 | |
| 48 ctypedef void (*referenceSAXFunc)(void * ctx, const_xmlChar* name) | |
| 49 | |
| 50 cdef int XML_SAX2_MAGIC | |
| 51 | |
| 52 cdef extern from "libxml/tree.h": | |
| 53 ctypedef struct xmlParserInput: | |
| 54 int line | |
| 55 int length | |
| 56 const_xmlChar* base | |
| 57 const_xmlChar* cur | |
| 58 const_xmlChar* end | |
| 59 const_char *filename | |
| 60 | |
| 61 ctypedef struct xmlParserInputBuffer: | |
| 62 void* context | |
| 63 xmlInputReadCallback readcallback | |
| 64 xmlInputCloseCallback closecallback | |
| 65 | |
| 66 ctypedef struct xmlSAXHandlerV1: | |
| 67 # same as xmlSAXHandler, but without namespaces | |
| 68 pass | |
| 69 | |
| 70 ctypedef struct xmlSAXHandler: | |
| 71 internalSubsetSAXFunc internalSubset | |
| 72 startElementNsSAX2Func startElementNs | |
| 73 endElementNsSAX2Func endElementNs | |
| 74 startElementSAXFunc startElement | |
| 75 endElementSAXFunc endElement | |
| 76 charactersSAXFunc characters | |
| 77 cdataBlockSAXFunc cdataBlock | |
| 78 referenceSAXFunc reference | |
| 79 commentSAXFunc comment | |
| 80 processingInstructionSAXFunc processingInstruction | |
| 81 startDocumentSAXFunc startDocument | |
| 82 endDocumentSAXFunc endDocument | |
| 83 int initialized | |
| 84 xmlStructuredErrorFunc serror | |
| 85 void* _private | |
| 86 | |
| 87 | |
| 88 cdef extern from "libxml/SAX2.h" nogil: | |
| 89 cdef void xmlSAX2StartDocument(void* ctxt) | |
| 90 | |
| 91 | |
| 92 cdef extern from "libxml/xmlIO.h" nogil: | |
| 93 cdef xmlParserInputBuffer* xmlAllocParserInputBuffer(int enc) | |
| 94 | |
| 95 | |
| 96 cdef extern from "libxml/parser.h": | |
| 97 | |
| 98 cdef xmlDict* xmlDictCreate() nogil | |
| 99 cdef xmlDict* xmlDictCreateSub(xmlDict* subdict) nogil | |
| 100 cdef void xmlDictFree(xmlDict* sub) nogil | |
| 101 cdef int xmlDictReference(xmlDict* dict) nogil | |
| 102 | |
| 103 cdef int XML_COMPLETE_ATTRS # SAX option for adding DTD default attributes | |
| 104 cdef int XML_SKIP_IDS # SAX option for not building an XML ID dict | |
| 105 | |
| 106 ctypedef enum xmlParserInputState: | |
| 107 XML_PARSER_EOF = -1 # nothing is to be parsed | |
| 108 XML_PARSER_START = 0 # nothing has been parsed | |
| 109 XML_PARSER_MISC = 1 # Misc* before int subset | |
| 110 XML_PARSER_PI = 2 # Within a processing instruction | |
| 111 XML_PARSER_DTD = 3 # within some DTD content | |
| 112 XML_PARSER_PROLOG = 4 # Misc* after internal subset | |
| 113 XML_PARSER_COMMENT = 5 # within a comment | |
| 114 XML_PARSER_START_TAG = 6 # within a start tag | |
| 115 XML_PARSER_CONTENT = 7 # within the content | |
| 116 XML_PARSER_CDATA_SECTION = 8 # within a CDATA section | |
| 117 XML_PARSER_END_TAG = 9 # within a closing tag | |
| 118 XML_PARSER_ENTITY_DECL = 10 # within an entity declaration | |
| 119 XML_PARSER_ENTITY_VALUE = 11 # within an entity value in a decl | |
| 120 XML_PARSER_ATTRIBUTE_VALUE = 12 # within an attribute value | |
| 121 XML_PARSER_SYSTEM_LITERAL = 13 # within a SYSTEM value | |
| 122 XML_PARSER_EPILOG = 14 # the Misc* after the last end tag | |
| 123 XML_PARSER_IGNORE = 15 # within an IGNORED section | |
| 124 XML_PARSER_PUBLIC_LITERAL = 16 # within a PUBLIC value | |
| 125 | |
| 126 | |
| 127 ctypedef struct xmlParserCtxt: | |
| 128 xmlDoc* myDoc | |
| 129 xmlDict* dict | |
| 130 int dictNames | |
| 131 void* _private | |
| 132 bint wellFormed | |
| 133 bint recovery | |
| 134 int options | |
| 135 bint disableSAX | |
| 136 int errNo | |
| 137 xmlParserInputState instate | |
| 138 bint replaceEntities | |
| 139 int loadsubset # != 0 if enabled, int value == why | |
| 140 bint validate | |
| 141 xmlError lastError | |
| 142 xmlNode* node | |
| 143 xmlSAXHandler* sax | |
| 144 void* userData | |
| 145 int* spaceTab | |
| 146 int spaceMax | |
| 147 bint html | |
| 148 bint progressive | |
| 149 int inSubset | |
| 150 int charset | |
| 151 xmlParserInput* input | |
| 152 | |
| 153 ctypedef enum xmlParserOption: | |
| 154 XML_PARSE_RECOVER = 1 # recover on errors | |
| 155 XML_PARSE_NOENT = 2 # substitute entities | |
| 156 XML_PARSE_DTDLOAD = 4 # load the external subset | |
| 157 XML_PARSE_DTDATTR = 8 # default DTD attributes | |
| 158 XML_PARSE_DTDVALID = 16 # validate with the DTD | |
| 159 XML_PARSE_NOERROR = 32 # suppress error reports | |
| 160 XML_PARSE_NOWARNING = 64 # suppress warning reports | |
| 161 XML_PARSE_PEDANTIC = 128 # pedantic error reporting | |
| 162 XML_PARSE_NOBLANKS = 256 # remove blank nodes | |
| 163 XML_PARSE_SAX1 = 512 # use the SAX1 interface internally | |
| 164 XML_PARSE_XINCLUDE = 1024 # Implement XInclude substitution | |
| 165 XML_PARSE_NONET = 2048 # Forbid network access | |
| 166 XML_PARSE_NODICT = 4096 # Do not reuse the context dictionary | |
| 167 XML_PARSE_NSCLEAN = 8192 # remove redundant namespaces declarations | |
| 168 XML_PARSE_NOCDATA = 16384 # merge CDATA as text nodes | |
| 169 XML_PARSE_NOXINCNODE = 32768 # do not generate XINCLUDE START/END nodes | |
| 170 # libxml2 2.6.21+ only: | |
| 171 XML_PARSE_COMPACT = 65536 # compact small text nodes | |
| 172 # libxml2 2.7.0+ only: | |
| 173 XML_PARSE_OLD10 = 131072 # parse using XML-1.0 before update 5 | |
| 174 XML_PARSE_NOBASEFIX = 262144 # do not fixup XINCLUDE xml:base uris | |
| 175 XML_PARSE_HUGE = 524288 # relax any hardcoded limit from the parser | |
| 176 # libxml2 2.7.3+ only: | |
| 177 XML_PARSE_OLDSAX = 1048576 # parse using SAX2 interface before 2.7.0 | |
| 178 # libxml2 2.8.0+ only: | |
| 179 XML_PARSE_IGNORE_ENC = 2097152 # ignore internal document encoding hint | |
| 180 # libxml2 2.9.0+ only: | |
| 181 XML_PARSE_BIG_LINES = 4194304 # Store big lines numbers in text PSVI field | |
| 182 | |
| 183 cdef void xmlInitParser() nogil | |
| 184 cdef void xmlCleanupParser() nogil | |
| 185 | |
| 186 cdef int xmlLineNumbersDefault(int onoff) nogil | |
| 187 cdef xmlParserCtxt* xmlNewParserCtxt() nogil | |
| 188 cdef xmlParserInput* xmlNewIOInputStream(xmlParserCtxt* ctxt, | |
| 189 xmlParserInputBuffer* input, | |
| 190 int enc) nogil | |
| 191 cdef int xmlCtxtUseOptions(xmlParserCtxt* ctxt, int options) nogil | |
| 192 cdef void xmlFreeParserCtxt(xmlParserCtxt* ctxt) nogil | |
| 193 cdef void xmlCtxtReset(xmlParserCtxt* ctxt) nogil | |
| 194 cdef void xmlClearParserCtxt(xmlParserCtxt* ctxt) nogil | |
| 195 cdef int xmlParseChunk(xmlParserCtxt* ctxt, | |
| 196 char* chunk, int size, int terminate) nogil | |
| 197 cdef xmlDoc* xmlCtxtReadDoc(xmlParserCtxt* ctxt, | |
| 198 char* cur, char* URL, char* encoding, | |
| 199 int options) nogil | |
| 200 cdef xmlDoc* xmlCtxtReadFile(xmlParserCtxt* ctxt, | |
| 201 char* filename, char* encoding, | |
| 202 int options) nogil | |
| 203 cdef xmlDoc* xmlCtxtReadIO(xmlParserCtxt* ctxt, | |
| 204 xmlInputReadCallback ioread, | |
| 205 xmlInputCloseCallback ioclose, | |
| 206 void* ioctx, | |
| 207 char* URL, char* encoding, | |
| 208 int options) nogil | |
| 209 cdef xmlDoc* xmlCtxtReadMemory(xmlParserCtxt* ctxt, | |
| 210 char* buffer, int size, | |
| 211 char* filename, const_char* encoding, | |
| 212 int options) nogil | |
| 213 | |
| 214 # iterparse: | |
| 215 | |
| 216 cdef xmlParserCtxt* xmlCreatePushParserCtxt(xmlSAXHandler* sax, | |
| 217 void* user_data, | |
| 218 char* chunk, | |
| 219 int size, | |
| 220 char* filename) nogil | |
| 221 | |
| 222 cdef int xmlCtxtResetPush(xmlParserCtxt* ctxt, | |
| 223 char* chunk, | |
| 224 int size, | |
| 225 char* filename, | |
| 226 char* encoding) nogil | |
| 227 | |
| 228 # entity loaders: | |
| 229 | |
| 230 ctypedef xmlParserInput* (*xmlExternalEntityLoader)( | |
| 231 const_char * URL, const_char * ID, xmlParserCtxt* context) nogil | |
| 232 cdef xmlExternalEntityLoader xmlGetExternalEntityLoader() nogil | |
| 233 cdef void xmlSetExternalEntityLoader(xmlExternalEntityLoader f) nogil | |
| 234 | |
| 235 # DTDs: | |
| 236 | |
| 237 cdef xmlDtd* xmlParseDTD(const_xmlChar* ExternalID, const_xmlChar* SystemID) nogil | |
| 238 cdef xmlDtd* xmlIOParseDTD(xmlSAXHandler* sax, | |
| 239 xmlParserInputBuffer* input, | |
| 240 int enc) nogil | |
| 241 | |
| 242 cdef extern from "libxml/parserInternals.h": | |
| 243 cdef xmlParserInput* xmlNewInputStream(xmlParserCtxt* ctxt) | |
| 244 cdef xmlParserInput* xmlNewStringInputStream(xmlParserCtxt* ctxt, | |
| 245 char* buffer) nogil | |
| 246 cdef xmlParserInput* xmlNewInputFromFile(xmlParserCtxt* ctxt, | |
| 247 char* filename) nogil | |
| 248 cdef void xmlFreeInputStream(xmlParserInput* input) nogil | |
| 249 cdef int xmlSwitchEncoding(xmlParserCtxt* ctxt, int enc) nogil |
