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

Function htmlDoRead

Externals/LibXML/HTMLparser.c:5949–5978  ·  view source on GitHub ↗

* htmlDoRead: * @ctxt: an HTML parser context * @URL: the base URL to use for the document * @encoding: the document encoding, or NULL * @options: a combination of htmlParserOption(s) * @reuse: keep the context for reuse * * Common front-end for the htmlRead functions * * Returns the resulting document tree or NULL */

Source from the content-addressed store, hash-verified

5947 * Returns the resulting document tree or NULL
5948 */
5949static htmlDocPtr
5950htmlDoRead(htmlParserCtxtPtr ctxt, const char *URL, const char *encoding,
5951 int options, int reuse)
5952{
5953 htmlDocPtr ret;
5954
5955 htmlCtxtUseOptions(ctxt, options);
5956 ctxt->html = 1;
5957 if (encoding != NULL) {
5958 xmlCharEncodingHandlerPtr hdlr;
5959
5960 hdlr = xmlFindCharEncodingHandler(encoding);
5961 if (hdlr != NULL)
5962 xmlSwitchToEncoding(ctxt, hdlr);
5963 }
5964 if ((URL != NULL) && (ctxt->input != NULL) &&
5965 (ctxt->input->filename == NULL))
5966 ctxt->input->filename = (char *) xmlStrdup((const xmlChar *) URL);
5967 htmlParseDocument(ctxt);
5968 ret = ctxt->myDoc;
5969 ctxt->myDoc = NULL;
5970 if (!reuse) {
5971 if ((ctxt->dictNames) &&
5972 (ret != NULL) &&
5973 (ret->dict == ctxt->dict))
5974 ctxt->dict = NULL;
5975 xmlFreeParserCtxt(ctxt);
5976 }
5977 return (ret);
5978}
5979
5980/**
5981 * htmlReadDoc:

Callers 10

htmlReadDocFunction · 0.85
htmlReadFileFunction · 0.85
htmlReadMemoryFunction · 0.85
htmlReadFdFunction · 0.85
htmlReadIOFunction · 0.85
htmlCtxtReadDocFunction · 0.85
htmlCtxtReadFileFunction · 0.85
htmlCtxtReadMemoryFunction · 0.85
htmlCtxtReadFdFunction · 0.85
htmlCtxtReadIOFunction · 0.85

Calls 6

htmlCtxtUseOptionsFunction · 0.85
xmlSwitchToEncodingFunction · 0.85
xmlStrdupFunction · 0.85
htmlParseDocumentFunction · 0.85
xmlFreeParserCtxtFunction · 0.85

Tested by

no test coverage detected