MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCOLLADA / htmlCtxtReadMemory

Function htmlCtxtReadMemory

Externals/LibXML/HTMLparser.c:6220–6247  ·  view source on GitHub ↗

* htmlCtxtReadMemory: * @ctxt: an HTML parser context * @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. * This reuses the existing @ctxt parser context * * Returns the resu

Source from the content-addressed store, hash-verified

6218 * Returns the resulting document tree
6219 */
6220htmlDocPtr
6221htmlCtxtReadMemory(htmlParserCtxtPtr ctxt, const char *buffer, int size,
6222 const char *URL, const char *encoding, int options)
6223{
6224 xmlParserInputBufferPtr input;
6225 xmlParserInputPtr stream;
6226
6227 if (ctxt == NULL)
6228 return (NULL);
6229 if (buffer == NULL)
6230 return (NULL);
6231
6232 htmlCtxtReset(ctxt);
6233
6234 input = xmlParserInputBufferCreateMem(buffer, size, XML_CHAR_ENCODING_NONE);
6235 if (input == NULL) {
6236 return(NULL);
6237 }
6238
6239 stream = xmlNewIOInputStream(ctxt, input, XML_CHAR_ENCODING_NONE);
6240 if (stream == NULL) {
6241 xmlFreeParserInputBuffer(input);
6242 return(NULL);
6243 }
6244
6245 inputPush(ctxt, stream);
6246 return (htmlDoRead(ctxt, URL, encoding, options, 1));
6247}
6248
6249/**
6250 * htmlCtxtReadFd:

Callers 1

test_htmlCtxtReadMemoryFunction · 0.85

Calls 6

htmlCtxtResetFunction · 0.85
xmlNewIOInputStreamFunction · 0.85
xmlFreeParserInputBufferFunction · 0.85
inputPushFunction · 0.85
htmlDoReadFunction · 0.85

Tested by 1

test_htmlCtxtReadMemoryFunction · 0.68