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

Function htmlCtxtUseOptions

Externals/LibXML/HTMLparser.c:5892–5935  ·  view source on GitHub ↗

* htmlCtxtUseOptions: * @ctxt: an HTML parser context * @options: a combination of htmlParserOption(s) * * Applies the options to the parser context * * Returns 0 in case of success, the set of unknown or unimplemented options * in case of error. */

Source from the content-addressed store, hash-verified

5890 * in case of error.
5891 */
5892int
5893htmlCtxtUseOptions(htmlParserCtxtPtr ctxt, int options)
5894{
5895 if (ctxt == NULL)
5896 return(-1);
5897
5898 if (options & HTML_PARSE_NOWARNING) {
5899 ctxt->sax->warning = NULL;
5900 ctxt->vctxt.warning = NULL;
5901 options -= XML_PARSE_NOWARNING;
5902 ctxt->options |= XML_PARSE_NOWARNING;
5903 }
5904 if (options & HTML_PARSE_NOERROR) {
5905 ctxt->sax->error = NULL;
5906 ctxt->vctxt.error = NULL;
5907 ctxt->sax->fatalError = NULL;
5908 options -= XML_PARSE_NOERROR;
5909 ctxt->options |= XML_PARSE_NOERROR;
5910 }
5911 if (options & HTML_PARSE_PEDANTIC) {
5912 ctxt->pedantic = 1;
5913 options -= XML_PARSE_PEDANTIC;
5914 ctxt->options |= XML_PARSE_PEDANTIC;
5915 } else
5916 ctxt->pedantic = 0;
5917 if (options & XML_PARSE_NOBLANKS) {
5918 ctxt->keepBlanks = 0;
5919 ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
5920 options -= XML_PARSE_NOBLANKS;
5921 ctxt->options |= XML_PARSE_NOBLANKS;
5922 } else
5923 ctxt->keepBlanks = 1;
5924 if (options & HTML_PARSE_RECOVER) {
5925 ctxt->recovery = 1;
5926 options -= HTML_PARSE_RECOVER;
5927 } else
5928 ctxt->recovery = 0;
5929 if (options & HTML_PARSE_COMPACT) {
5930 ctxt->options |= HTML_PARSE_COMPACT;
5931 options -= HTML_PARSE_COMPACT;
5932 }
5933 ctxt->dictNames = 0;
5934 return (options);
5935}
5936
5937/**
5938 * htmlDoRead:

Callers 2

test_htmlCtxtUseOptionsFunction · 0.85
htmlDoReadFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_htmlCtxtUseOptionsFunction · 0.68