* xmlReaderNewIO: * @reader: an XML reader * @ioread: an I/O read function * @ioclose: an I/O close function * @ioctx: an I/O handler * @URL: the base URL to use for the document * @encoding: the document encoding, or NULL * @options: a combination of xmlParserOption * * Setup an xmltextReader to parse an XML document from I/O functions * and source. * The parsing flags @options
| 5489 | * Returns 0 in case of success and -1 in case of error |
| 5490 | */ |
| 5491 | int |
| 5492 | xmlReaderNewIO(xmlTextReaderPtr reader, xmlInputReadCallback ioread, |
| 5493 | xmlInputCloseCallback ioclose, void *ioctx, |
| 5494 | const char *URL, const char *encoding, int options) |
| 5495 | { |
| 5496 | xmlParserInputBufferPtr input; |
| 5497 | |
| 5498 | if (ioread == NULL) |
| 5499 | return (-1); |
| 5500 | if (reader == NULL) |
| 5501 | return (-1); |
| 5502 | |
| 5503 | input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx, |
| 5504 | XML_CHAR_ENCODING_NONE); |
| 5505 | if (input == NULL) { |
| 5506 | if (ioclose != NULL) |
| 5507 | ioclose(ioctx); |
| 5508 | return (-1); |
| 5509 | } |
| 5510 | return (xmlTextReaderSetup(reader, input, URL, encoding, options)); |
| 5511 | } |
| 5512 | |
| 5513 | /************************************************************************ |
| 5514 | * * |
nothing calls this directly
no test coverage detected