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

Function htmlCreateDocParserCtxt

ThirdParty/libxml2/vtklibxml2/HTMLparser.c:5075–5097  ·  view source on GitHub ↗

* htmlCreateDocParserCtxt: * @str: a pointer to an array of xmlChar * @encoding: encoding (optional) * * Create a parser context for a null-terminated string. * * Returns the new parser context or NULL if a memory allocation failed. */

Source from the content-addressed store, hash-verified

5073 * Returns the new parser context or NULL if a memory allocation failed.
5074 */
5075static htmlParserCtxtPtr
5076htmlCreateDocParserCtxt(const xmlChar *str, const char *url,
5077 const char *encoding) {
5078 xmlParserCtxtPtr ctxt;
5079 xmlParserInputPtr input;
5080
5081 if (str == NULL)
5082 return(NULL);
5083
5084 ctxt = htmlNewParserCtxt();
5085 if (ctxt == NULL)
5086 return(NULL);
5087
5088 input = xmlNewInputString(ctxt, url, (const char *) str, encoding, 0);
5089 if (input == NULL) {
5090 xmlFreeParserCtxt(ctxt);
5091 return(NULL);
5092 }
5093
5094 inputPush(ctxt, input);
5095
5096 return(ctxt);
5097}
5098
5099#ifdef LIBXML_PUSH_ENABLED
5100/************************************************************************

Callers 1

htmlSAXParseDocFunction · 0.85

Calls 4

htmlNewParserCtxtFunction · 0.85
xmlNewInputStringFunction · 0.85
xmlFreeParserCtxtFunction · 0.85
inputPushFunction · 0.85

Tested by

no test coverage detected