* htmlCtxtReadMemory: * @ctxt: an HTML parser context * @buffer: a pointer to a char array * @size: the size of the array * @URL: only used for error reporting (optional) * @encoding: the document encoding (optinal) * @options: a combination of htmlParserOptions * * Parse an HTML in-memory document and build a tree. The input buffer must * not contain any terminating null bytes. *
| 6618 | * Returns the resulting document tree |
| 6619 | */ |
| 6620 | htmlDocPtr |
| 6621 | htmlCtxtReadMemory(htmlParserCtxtPtr ctxt, const char *buffer, int size, |
| 6622 | const char *URL, const char *encoding, int options) |
| 6623 | { |
| 6624 | xmlParserInputPtr input; |
| 6625 | |
| 6626 | if ((ctxt == NULL) || (size < 0)) |
| 6627 | return (NULL); |
| 6628 | |
| 6629 | htmlCtxtReset(ctxt); |
| 6630 | htmlCtxtUseOptions(ctxt, options); |
| 6631 | |
| 6632 | input = xmlNewInputMemory(ctxt, URL, buffer, size, encoding, |
| 6633 | XML_INPUT_BUF_STATIC); |
| 6634 | |
| 6635 | return(htmlCtxtParseDocument(ctxt, input)); |
| 6636 | } |
| 6637 | |
| 6638 | /** |
| 6639 | * htmlCtxtReadFd: |
nothing calls this directly
no test coverage detected