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

Function xmlReaderForIO

ThirdParty/libxml2/vtklibxml2/xmlreader.c:5268–5297  ·  view source on GitHub ↗

* xmlReaderForIO: * @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 * * Create an xmltextReader for an XML document from I/O functions and source. * The parsing flags @options are a combination of xmlParserOpti

Source from the content-addressed store, hash-verified

5266 * Returns the new reader or NULL in case of error.
5267 */
5268xmlTextReaderPtr
5269xmlReaderForIO(xmlInputReadCallback ioread, xmlInputCloseCallback ioclose,
5270 void *ioctx, const char *URL, const char *encoding,
5271 int options)
5272{
5273 xmlTextReaderPtr reader;
5274 xmlParserInputBufferPtr input;
5275
5276 if (ioread == NULL)
5277 return (NULL);
5278
5279 input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx,
5280 XML_CHAR_ENCODING_NONE);
5281 if (input == NULL) {
5282 if (ioclose != NULL)
5283 ioclose(ioctx);
5284 return (NULL);
5285 }
5286 reader = xmlNewTextReader(input, URL);
5287 if (reader == NULL) {
5288 xmlFreeParserInputBuffer(input);
5289 return (NULL);
5290 }
5291 reader->allocs |= XML_TEXTREADER_INPUT;
5292 if (xmlTextReaderSetup(reader, NULL, URL, encoding, options) < 0) {
5293 xmlFreeTextReader(reader);
5294 return (NULL);
5295 }
5296 return (reader);
5297}
5298
5299/**
5300 * xmlReaderNewWalker:

Callers

nothing calls this directly

Calls 5

xmlNewTextReaderFunction · 0.85
xmlFreeParserInputBufferFunction · 0.85
xmlTextReaderSetupFunction · 0.85
xmlFreeTextReaderFunction · 0.85

Tested by

no test coverage detected