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

Function xmlReaderNewFd

ThirdParty/libxml2/vtklibxml2/xmlreader.c:5456–5472  ·  view source on GitHub ↗

* xmlReaderNewFd: * @reader: an XML reader * @fd: an open file descriptor * @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 from a file descriptor. * NOTE that the file descriptor will not be closed when the * reader is closed or reset. * The parsing fl

Source from the content-addressed store, hash-verified

5454 * Returns 0 in case of success and -1 in case of error
5455 */
5456int
5457xmlReaderNewFd(xmlTextReaderPtr reader, int fd,
5458 const char *URL, const char *encoding, int options)
5459{
5460 xmlParserInputBufferPtr input;
5461
5462 if (fd < 0)
5463 return (-1);
5464 if (reader == NULL)
5465 return (-1);
5466
5467 input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE);
5468 if (input == NULL)
5469 return (-1);
5470 input->closecallback = NULL;
5471 return (xmlTextReaderSetup(reader, input, URL, encoding, options));
5472}
5473
5474/**
5475 * xmlReaderNewIO:

Callers

nothing calls this directly

Calls 2

xmlTextReaderSetupFunction · 0.85

Tested by

no test coverage detected