* htmlCtxtReadFd: * @ctxt: an HTML parser context * @fd: an open file descriptor * @URL: only used for error reporting (optional) * @encoding: the document encoding (optinal) * @options: a combination of htmlParserOptions * * Parse an HTML from a file descriptor and build a tree. * * See htmlCtxtUseOptions for details. * * NOTE that the file descriptor will not be closed when the
| 6653 | * Returns the resulting document tree |
| 6654 | */ |
| 6655 | htmlDocPtr |
| 6656 | htmlCtxtReadFd(htmlParserCtxtPtr ctxt, int fd, |
| 6657 | const char *URL, const char *encoding, int options) |
| 6658 | { |
| 6659 | xmlParserInputPtr input; |
| 6660 | |
| 6661 | if (ctxt == NULL) |
| 6662 | return(NULL); |
| 6663 | |
| 6664 | htmlCtxtReset(ctxt); |
| 6665 | htmlCtxtUseOptions(ctxt, options); |
| 6666 | |
| 6667 | input = xmlNewInputFd(ctxt, URL, fd, encoding, 0); |
| 6668 | |
| 6669 | return(htmlCtxtParseDocument(ctxt, input)); |
| 6670 | } |
| 6671 | |
| 6672 | /** |
| 6673 | * htmlCtxtReadIO: |