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

Function htmlCreateFileParserCtxt

ThirdParty/libxml2/vtklibxml2/HTMLparser.c:5906–5928  ·  view source on GitHub ↗

* htmlCreateFileParserCtxt: * @filename: the filename * @encoding: optional encoding * * DEPRECATED: Use htmlNewParserCtxt and htmlCtxtReadFile. * * Create a parser context to read from a file. * * A non-NULL encoding overrides encoding declarations in the document. * * Automatic support for ZLIB/Compress compressed document is provided * by default if found at compile-time. * * Ret

Source from the content-addressed store, hash-verified

5904 * Returns the new parser context or NULL if a memory allocation failed.
5905 */
5906htmlParserCtxtPtr
5907htmlCreateFileParserCtxt(const char *filename, const char *encoding)
5908{
5909 htmlParserCtxtPtr ctxt;
5910 htmlParserInputPtr input;
5911
5912 if (filename == NULL)
5913 return(NULL);
5914
5915 ctxt = htmlNewParserCtxt();
5916 if (ctxt == NULL) {
5917 return(NULL);
5918 }
5919
5920 input = xmlNewInputURL(ctxt, filename, NULL, encoding, 0);
5921 if (input == NULL) {
5922 xmlFreeParserCtxt(ctxt);
5923 return(NULL);
5924 }
5925 inputPush(ctxt, input);
5926
5927 return(ctxt);
5928}
5929
5930/**
5931 * htmlSAXParseFile:

Callers 1

htmlSAXParseFileFunction · 0.85

Calls 4

htmlNewParserCtxtFunction · 0.85
xmlNewInputURLFunction · 0.85
xmlFreeParserCtxtFunction · 0.85
inputPushFunction · 0.85

Tested by

no test coverage detected