* xmlCreateIOParserCtxt: * @sax: a SAX handler (optional) * @user_data: user data for SAX callbacks (optional) * @ioread: an I/O read function * @ioclose: an I/O close function (optional) * @ioctx: an I/O handler * @enc: the charset encoding if known (deprecated) * * Create a parser context for using the XML parser with an existing * I/O stream * * Returns the new parser context o
| 11776 | * Returns the new parser context or NULL |
| 11777 | */ |
| 11778 | xmlParserCtxtPtr |
| 11779 | xmlCreateIOParserCtxt(xmlSAXHandlerPtr sax, void *user_data, |
| 11780 | xmlInputReadCallback ioread, |
| 11781 | xmlInputCloseCallback ioclose, |
| 11782 | void *ioctx, xmlCharEncoding enc) { |
| 11783 | xmlParserCtxtPtr ctxt; |
| 11784 | xmlParserInputPtr input; |
| 11785 | const char *encoding; |
| 11786 | |
| 11787 | ctxt = xmlNewSAXParserCtxt(sax, user_data); |
| 11788 | if (ctxt == NULL) |
| 11789 | return(NULL); |
| 11790 | |
| 11791 | encoding = xmlGetCharEncodingName(enc); |
| 11792 | input = xmlNewInputIO(ctxt, NULL, ioread, ioclose, ioctx, encoding, 0); |
| 11793 | if (input == NULL) { |
| 11794 | xmlFreeParserCtxt(ctxt); |
| 11795 | return (NULL); |
| 11796 | } |
| 11797 | inputPush(ctxt, input); |
| 11798 | |
| 11799 | return(ctxt); |
| 11800 | } |
| 11801 | |
| 11802 | #ifdef LIBXML_VALID_ENABLED |
| 11803 | /************************************************************************ |
nothing calls this directly
no test coverage detected