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

Function xmlCreateIOParserCtxt

ThirdParty/libxml2/vtklibxml2/parser.c:11778–11800  ·  view source on GitHub ↗

* 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

Source from the content-addressed store, hash-verified

11776 * Returns the new parser context or NULL
11777 */
11778xmlParserCtxtPtr
11779xmlCreateIOParserCtxt(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/************************************************************************

Callers

nothing calls this directly

Calls 5

xmlNewSAXParserCtxtFunction · 0.85
xmlGetCharEncodingNameFunction · 0.85
xmlNewInputIOFunction · 0.85
xmlFreeParserCtxtFunction · 0.85
inputPushFunction · 0.85

Tested by

no test coverage detected