diff options
Diffstat (limited to 'src/lxml/includes/htmlparser.pxd')
| -rw-r--r-- | src/lxml/includes/htmlparser.pxd | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/lxml/includes/htmlparser.pxd b/src/lxml/includes/htmlparser.pxd new file mode 100644 index 00000000..ff0e54c1 --- /dev/null +++ b/src/lxml/includes/htmlparser.pxd @@ -0,0 +1,49 @@ +from tree cimport xmlDoc, xmlDict +from tree cimport xmlInputReadCallback, xmlInputCloseCallback +from xmlparser cimport xmlParserCtxt, xmlSAXHandler +from xmlerror cimport xmlError + +cdef extern from "libxml/HTMLparser.h": + ctypedef enum htmlParserOption: + HTML_PARSE_NOERROR # suppress error reports + HTML_PARSE_NOWARNING # suppress warning reports + HTML_PARSE_PEDANTIC # pedantic error reporting + HTML_PARSE_NOBLANKS # remove blank nodes + HTML_PARSE_NONET # Forbid network access + # libxml2 2.6.21+ only: + HTML_PARSE_RECOVER # Relaxed parsing + HTML_PARSE_COMPACT # compact small text nodes + + xmlSAXHandler htmlDefaultSAXHandler + + cdef xmlParserCtxt* htmlCreateMemoryParserCtxt( + char* buffer, int size) nogil + cdef xmlParserCtxt* htmlCreateFileParserCtxt( + char* filename, char* encoding) nogil + cdef xmlParserCtxt* htmlCreatePushParserCtxt(xmlSAXHandler* sax, + void* user_data, + char* chunk, int size, + char* filename, int enc) nogil + cdef void htmlFreeParserCtxt(xmlParserCtxt* ctxt) nogil + cdef void htmlCtxtReset(xmlParserCtxt* ctxt) nogil + cdef int htmlCtxtUseOptions(xmlParserCtxt* ctxt, int options) nogil + cdef int htmlParseDocument(xmlParserCtxt* ctxt) nogil + cdef int htmlParseChunk(xmlParserCtxt* ctxt, + char* chunk, int size, int terminate) nogil + + cdef xmlDoc* htmlCtxtReadFile(xmlParserCtxt* ctxt, + char* filename, char* encoding, + int options) nogil + cdef xmlDoc* htmlCtxtReadDoc(xmlParserCtxt* ctxt, + char* buffer, char* URL, char* encoding, + int options) nogil + cdef xmlDoc* htmlCtxtReadIO(xmlParserCtxt* ctxt, + xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void* ioctx, + char* URL, char* encoding, + int options) nogil + cdef xmlDoc* htmlCtxtReadMemory(xmlParserCtxt* ctxt, + char* buffer, int size, + char* filename, char* encoding, + int options) nogil |
