* 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. */
| 6244 | * in case of error. |
| 6245 | */ |
| 6246 | int |
| 6247 | htmlCtxtUseOptions(htmlParserCtxtPtr ctxt, int options) |
| 6248 | { |
| 6249 | if (ctxt == NULL) |
| 6250 | return(-1); |
| 6251 | |
| 6252 | if (options & HTML_PARSE_NOWARNING) { |
| 6253 | ctxt->sax->warning = NULL; |
| 6254 | ctxt->vctxt.warning = NULL; |
| 6255 | options -= XML_PARSE_NOWARNING; |
| 6256 | ctxt->options |= XML_PARSE_NOWARNING; |
| 6257 | } |
| 6258 | if (options & HTML_PARSE_NOERROR) { |
| 6259 | ctxt->sax->error = NULL; |
| 6260 | ctxt->vctxt.error = NULL; |
| 6261 | ctxt->sax->fatalError = NULL; |
| 6262 | options -= XML_PARSE_NOERROR; |
| 6263 | ctxt->options |= XML_PARSE_NOERROR; |
| 6264 | } |
| 6265 | if (options & HTML_PARSE_PEDANTIC) { |
| 6266 | ctxt->pedantic = 1; |
| 6267 | options -= XML_PARSE_PEDANTIC; |
| 6268 | ctxt->options |= XML_PARSE_PEDANTIC; |
| 6269 | } else |
| 6270 | ctxt->pedantic = 0; |
| 6271 | if (options & XML_PARSE_NOBLANKS) { |
| 6272 | ctxt->keepBlanks = 0; |
| 6273 | ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace; |
| 6274 | options -= XML_PARSE_NOBLANKS; |
| 6275 | ctxt->options |= XML_PARSE_NOBLANKS; |
| 6276 | } else |
| 6277 | ctxt->keepBlanks = 1; |
| 6278 | if (options & HTML_PARSE_RECOVER) { |
| 6279 | ctxt->recovery = 1; |
| 6280 | options -= HTML_PARSE_RECOVER; |
| 6281 | } else |
| 6282 | ctxt->recovery = 0; |
| 6283 | if (options & HTML_PARSE_COMPACT) { |
| 6284 | ctxt->options |= HTML_PARSE_COMPACT; |
| 6285 | options -= HTML_PARSE_COMPACT; |
| 6286 | } |
| 6287 | if (options & XML_PARSE_HUGE) { |
| 6288 | ctxt->options |= XML_PARSE_HUGE; |
| 6289 | options -= XML_PARSE_HUGE; |
| 6290 | } |
| 6291 | if (options & HTML_PARSE_NODEFDTD) { |
| 6292 | ctxt->options |= HTML_PARSE_NODEFDTD; |
| 6293 | options -= HTML_PARSE_NODEFDTD; |
| 6294 | } |
| 6295 | if (options & HTML_PARSE_IGNORE_ENC) { |
| 6296 | ctxt->options |= HTML_PARSE_IGNORE_ENC; |
| 6297 | options -= HTML_PARSE_IGNORE_ENC; |
| 6298 | } |
| 6299 | if (options & HTML_PARSE_NOIMPLIED) { |
| 6300 | ctxt->options |= HTML_PARSE_NOIMPLIED; |
| 6301 | options -= HTML_PARSE_NOIMPLIED; |
| 6302 | } |
| 6303 | ctxt->dictNames = 0; |
no outgoing calls
no test coverage detected