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

Function xmlNewInputInternal

ThirdParty/libxml2/vtklibxml2/parserInternals.c:1592–1619  ·  view source on GitHub ↗

* xmlNewInputInternal: * @ctxt: parser context * @buf: parser input buffer * @filename: filename or URL * @encoding: character encoding (optional) * * Internal helper function. * * Returns a new parser input. */

Source from the content-addressed store, hash-verified

1590 * Returns a new parser input.
1591 */
1592static xmlParserInputPtr
1593xmlNewInputInternal(xmlParserCtxtPtr ctxt, xmlParserInputBufferPtr buf,
1594 const char *filename, const char *encoding) {
1595 xmlParserInputPtr input;
1596
1597 input = xmlNewInputStream(ctxt);
1598 if (input == NULL) {
1599 xmlFreeParserInputBuffer(buf);
1600 return(NULL);
1601 }
1602
1603 input->buf = buf;
1604 xmlBufResetInput(input->buf->buffer, input);
1605
1606 if (filename != NULL) {
1607 input->filename = xmlMemStrdup(filename);
1608 if (input->filename == NULL) {
1609 xmlCtxtErrMemory(ctxt);
1610 xmlFreeInputStream(input);
1611 return(NULL);
1612 }
1613 }
1614
1615 if (encoding != NULL)
1616 xmlSwitchInputEncodingName(ctxt, input, encoding);
1617
1618 return(input);
1619}
1620
1621/**
1622 * xmlNewInputMemory:

Callers 6

xmlNewInputMemoryFunction · 0.85
xmlNewInputStringFunction · 0.85
xmlNewInputFdFunction · 0.85
xmlNewInputIOFunction · 0.85
xmlNewInputPushFunction · 0.85
xmlNewIOInputStreamFunction · 0.85

Calls 6

xmlNewInputStreamFunction · 0.85
xmlFreeParserInputBufferFunction · 0.85
xmlBufResetInputFunction · 0.85
xmlCtxtErrMemoryFunction · 0.85
xmlFreeInputStreamFunction · 0.85

Tested by

no test coverage detected