MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlReaderNewIO

Function xmlReaderNewIO

ThirdParty/libxml2/vtklibxml2/xmlreader.c:5491–5511  ·  view source on GitHub ↗

* 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

Source from the content-addressed store, hash-verified

5489 * Returns 0 in case of success and -1 in case of error
5490 */
5491int
5492xmlReaderNewIO(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 * *

Callers

nothing calls this directly

Calls 2

xmlTextReaderSetupFunction · 0.85

Tested by

no test coverage detected