* 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
| 5454 | * Returns 0 in case of success and -1 in case of error |
| 5455 | */ |
| 5456 | int |
| 5457 | xmlReaderNewFd(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: |
nothing calls this directly
no test coverage detected