* htmlReadIO: * @ioread: an I/O read function * @ioclose: an I/O close function (optional) * @ioctx: an I/O handler * @url: only used for error reporting (optional) * @encoding: the document encoding (optional) * @options: a combination of htmlParserOption(s) * * Convenience function to parse an HTML document from I/O functions * and context. * * See htmlCtxtReadIO for details. *
| 6518 | * Returns the resulting document tree |
| 6519 | */ |
| 6520 | htmlDocPtr |
| 6521 | htmlReadIO(xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, |
| 6522 | void *ioctx, const char *url, const char *encoding, int options) |
| 6523 | { |
| 6524 | htmlParserCtxtPtr ctxt; |
| 6525 | xmlParserInputPtr input; |
| 6526 | htmlDocPtr doc; |
| 6527 | |
| 6528 | ctxt = htmlNewParserCtxt(); |
| 6529 | if (ctxt == NULL) |
| 6530 | return (NULL); |
| 6531 | |
| 6532 | htmlCtxtUseOptions(ctxt, options); |
| 6533 | |
| 6534 | input = xmlNewInputIO(ctxt, url, ioread, ioclose, ioctx, encoding, 0); |
| 6535 | |
| 6536 | doc = htmlCtxtParseDocument(ctxt, input); |
| 6537 | |
| 6538 | htmlFreeParserCtxt(ctxt); |
| 6539 | return(doc); |
| 6540 | } |
| 6541 | |
| 6542 | /** |
| 6543 | * htmlCtxtReadDoc: |
nothing calls this directly
no test coverage detected