* htmlReadMemory: * @buffer: a pointer to a char array * @size: the size of the array * @URL: the base URL to use for the document * @encoding: the document encoding, or NULL * @options: a combination of htmlParserOption(s) * * parse an XML in-memory document and build a tree. * * Returns the resulting document tree */
| 6038 | * Returns the resulting document tree |
| 6039 | */ |
| 6040 | htmlDocPtr |
| 6041 | htmlReadMemory(const char *buffer, int size, const char *URL, const char *encoding, int options) |
| 6042 | { |
| 6043 | htmlParserCtxtPtr ctxt; |
| 6044 | |
| 6045 | xmlInitParser(); |
| 6046 | ctxt = xmlCreateMemoryParserCtxt(buffer, size); |
| 6047 | if (ctxt == NULL) |
| 6048 | return (NULL); |
| 6049 | htmlDefaultSAXHandlerInit(); |
| 6050 | if (ctxt->sax != NULL) |
| 6051 | memcpy(ctxt->sax, &htmlDefaultSAXHandler, sizeof(xmlSAXHandlerV1)); |
| 6052 | return (htmlDoRead(ctxt, URL, encoding, options, 0)); |
| 6053 | } |
| 6054 | |
| 6055 | /** |
| 6056 | * htmlReadFd: |