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

Function xmlNewInputPush

ThirdParty/libxml2/vtklibxml2/parserInternals.c:1796–1827  ·  view source on GitHub ↗

* xmlNewInputPush: * @ctxt: parser context * @url: base URL (optional) * @chunk: pointer to char array * @size: size of array * @encoding: character encoding (optional) * * Creates a new parser input for a push parser. * * Returns a new parser input. */

Source from the content-addressed store, hash-verified

1794 * Returns a new parser input.
1795 */
1796xmlParserInputPtr
1797xmlNewInputPush(xmlParserCtxtPtr ctxt, const char *url,
1798 const char *chunk, int size, const char *encoding) {
1799 xmlParserInputBufferPtr buf;
1800 xmlParserInputPtr input;
1801
1802 buf = xmlAllocParserInputBuffer(XML_CHAR_ENCODING_NONE);
1803 if (buf == NULL) {
1804 xmlCtxtErrMemory(ctxt);
1805 return(NULL);
1806 }
1807
1808 input = xmlNewInputInternal(ctxt, buf, url, encoding);
1809 if (input == NULL)
1810 return(NULL);
1811
1812 input->flags |= XML_INPUT_PROGRESSIVE;
1813
1814 if ((size > 0) && (chunk != NULL)) {
1815 int res;
1816
1817 res = xmlParserInputBufferPush(input->buf, size, chunk);
1818 xmlBufResetInput(input->buf->buffer, input);
1819 if (res < 0) {
1820 xmlCtxtErrIO(ctxt, input->buf->error, NULL);
1821 xmlFreeInputStream(input);
1822 return(NULL);
1823 }
1824 }
1825
1826 return(input);
1827}
1828
1829/**
1830 * xmlNewIOInputStream:

Callers 3

htmlCreatePushParserCtxtFunction · 0.85
xmlCreatePushParserCtxtFunction · 0.85
xmlCtxtResetPushFunction · 0.85

Calls 7

xmlCtxtErrMemoryFunction · 0.85
xmlNewInputInternalFunction · 0.85
xmlParserInputBufferPushFunction · 0.85
xmlBufResetInputFunction · 0.85
xmlCtxtErrIOFunction · 0.85
xmlFreeInputStreamFunction · 0.85

Tested by

no test coverage detected