* xmlReaderNewFile: * @reader: an XML reader * @filename: a file or URL * @encoding: the document encoding, or NULL * @options: a combination of xmlParserOption * * parse an XML file from the filesystem or the network. * The parsing flags @options are a combination of xmlParserOption. * This reuses the existing @reader xmlTextReader. * * Returns 0 in case of success and -1 in case of
| 5385 | * Returns 0 in case of success and -1 in case of error |
| 5386 | */ |
| 5387 | int |
| 5388 | xmlReaderNewFile(xmlTextReaderPtr reader, const char *filename, |
| 5389 | const char *encoding, int options) |
| 5390 | { |
| 5391 | xmlParserInputBufferPtr input; |
| 5392 | |
| 5393 | if (filename == NULL) |
| 5394 | return (-1); |
| 5395 | if (reader == NULL) |
| 5396 | return (-1); |
| 5397 | |
| 5398 | input = |
| 5399 | xmlParserInputBufferCreateFilename(filename, |
| 5400 | XML_CHAR_ENCODING_NONE); |
| 5401 | if (input == NULL) |
| 5402 | return (-1); |
| 5403 | return (xmlTextReaderSetup(reader, input, filename, encoding, options)); |
| 5404 | } |
| 5405 | |
| 5406 | /** |
| 5407 | * xmlReaderNewMemory: |
nothing calls this directly
no test coverage detected