MCPcopy Create free account
hub / github.com/Kitware/VTK / htmlReadMemory

Function htmlReadMemory

ThirdParty/libxml2/vtklibxml2/HTMLparser.c:6440–6464  ·  view source on GitHub ↗

* htmlReadMemory: * @buffer: a pointer to a char array * @size: the size of the array * @url: only used for error reporting (optional) * @encoding: the document encoding, or NULL * @options: a combination of htmlParserOption(s) * * Convenience function to parse an HTML document from memory. * The input buffer must not contain any terminating null bytes. * * See htmlCtxtReadMemory fo

Source from the content-addressed store, hash-verified

6438 * Returns the resulting document tree
6439 */
6440htmlDocPtr
6441htmlReadMemory(const char *buffer, int size, const char *url,
6442 const char *encoding, int options)
6443{
6444 htmlParserCtxtPtr ctxt;
6445 xmlParserInputPtr input;
6446 htmlDocPtr doc;
6447
6448 if (size < 0)
6449 return(NULL);
6450
6451 ctxt = htmlNewParserCtxt();
6452 if (ctxt == NULL)
6453 return(NULL);
6454
6455 htmlCtxtUseOptions(ctxt, options);
6456
6457 input = xmlNewInputMemory(ctxt, url, buffer, size, encoding,
6458 XML_INPUT_BUF_STATIC);
6459
6460 doc = htmlCtxtParseDocument(ctxt, input);
6461
6462 htmlFreeParserCtxt(ctxt);
6463 return(doc);
6464}
6465
6466/**
6467 * htmlReadFd:

Callers 1

parseFileFunction · 0.85

Calls 5

htmlNewParserCtxtFunction · 0.85
htmlCtxtUseOptionsFunction · 0.85
xmlNewInputMemoryFunction · 0.85
htmlCtxtParseDocumentFunction · 0.85
htmlFreeParserCtxtFunction · 0.85

Tested by

no test coverage detected