MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCOLLADA / htmlReadIO

Function htmlReadIO

Externals/LibXML/HTMLparser.c:6108–6137  ·  view source on GitHub ↗

* htmlReadIO: * @ioread: an I/O read function * @ioclose: an I/O close function * @ioctx: an I/O handler * @URL: the base URL to use for the document * @encoding: the document encoding, or NULL * @options: a combination of htmlParserOption(s) * * parse an HTML document from I/O functions and source and build a tree. * * Returns the resulting document tree */

Source from the content-addressed store, hash-verified

6106 * Returns the resulting document tree
6107 */
6108htmlDocPtr
6109htmlReadIO(xmlInputReadCallback ioread, xmlInputCloseCallback ioclose,
6110 void *ioctx, const char *URL, const char *encoding, int options)
6111{
6112 htmlParserCtxtPtr ctxt;
6113 xmlParserInputBufferPtr input;
6114 xmlParserInputPtr stream;
6115
6116 if (ioread == NULL)
6117 return (NULL);
6118 xmlInitParser();
6119
6120 input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx,
6121 XML_CHAR_ENCODING_NONE);
6122 if (input == NULL)
6123 return (NULL);
6124 ctxt = htmlNewParserCtxt();
6125 if (ctxt == NULL) {
6126 xmlFreeParserInputBuffer(input);
6127 return (NULL);
6128 }
6129 stream = xmlNewIOInputStream(ctxt, input, XML_CHAR_ENCODING_NONE);
6130 if (stream == NULL) {
6131 xmlFreeParserInputBuffer(input);
6132 xmlFreeParserCtxt(ctxt);
6133 return (NULL);
6134 }
6135 inputPush(ctxt, stream);
6136 return (htmlDoRead(ctxt, URL, encoding, options, 0));
6137}
6138
6139/**
6140 * htmlCtxtReadDoc:

Callers

nothing calls this directly

Calls 7

htmlNewParserCtxtFunction · 0.85
xmlFreeParserInputBufferFunction · 0.85
xmlNewIOInputStreamFunction · 0.85
xmlFreeParserCtxtFunction · 0.85
inputPushFunction · 0.85
htmlDoReadFunction · 0.85

Tested by

no test coverage detected