* htmlReadFd: * @fd: an open file descriptor * @url: only used for error reporting (optional) * @encoding: the document encoding, or NULL * @options: a combination of htmlParserOptions * * Convenience function to parse an HTML document from a * file descriptor. * * NOTE that the file descriptor will not be closed when the * context is freed or reset. * * See htmlCtxtReadFd for deta
| 6481 | * Returns the resulting document tree |
| 6482 | */ |
| 6483 | htmlDocPtr |
| 6484 | htmlReadFd(int fd, const char *url, const char *encoding, int options) |
| 6485 | { |
| 6486 | htmlParserCtxtPtr ctxt; |
| 6487 | xmlParserInputPtr input; |
| 6488 | htmlDocPtr doc; |
| 6489 | |
| 6490 | ctxt = htmlNewParserCtxt(); |
| 6491 | if (ctxt == NULL) |
| 6492 | return(NULL); |
| 6493 | |
| 6494 | htmlCtxtUseOptions(ctxt, options); |
| 6495 | |
| 6496 | input = xmlNewInputFd(ctxt, url, fd, encoding, 0); |
| 6497 | |
| 6498 | doc = htmlCtxtParseDocument(ctxt, input); |
| 6499 | |
| 6500 | htmlFreeParserCtxt(ctxt); |
| 6501 | return(doc); |
| 6502 | } |
| 6503 | |
| 6504 | /** |
| 6505 | * htmlReadIO: |
no test coverage detected