* xmlReadFd: * @fd: an open file descriptor * @URL: base URL (optional) * @encoding: the document encoding (optional) * @options: a combination of xmlParserOption * * Parse an XML from a file descriptor and build a tree. * * See xmlCtxtReadFd for details. * * NOTE that the file descriptor will not be closed when the * context is freed or reset. * * Returns the resulting document t
| 13958 | * Returns the resulting document tree |
| 13959 | */ |
| 13960 | xmlDocPtr |
| 13961 | xmlReadFd(int fd, const char *URL, const char *encoding, int options) |
| 13962 | { |
| 13963 | xmlParserCtxtPtr ctxt; |
| 13964 | xmlParserInputPtr input; |
| 13965 | xmlDocPtr doc; |
| 13966 | |
| 13967 | ctxt = xmlNewParserCtxt(); |
| 13968 | if (ctxt == NULL) |
| 13969 | return(NULL); |
| 13970 | |
| 13971 | xmlCtxtUseOptions(ctxt, options); |
| 13972 | |
| 13973 | input = xmlNewInputFd(ctxt, URL, fd, encoding, 0); |
| 13974 | |
| 13975 | doc = xmlCtxtParseDocument(ctxt, input); |
| 13976 | |
| 13977 | xmlFreeParserCtxt(ctxt); |
| 13978 | return(doc); |
| 13979 | } |
| 13980 | |
| 13981 | /** |
| 13982 | * xmlReadIO: |
nothing calls this directly
no test coverage detected