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

Function xmlNewInputStream

ThirdParty/libxml2/vtklibxml2/parserInternals.c:1521–1548  ·  view source on GitHub ↗

* xmlNewInputStream: * @ctxt: an XML parser context * * Create a new input stream structure. * * Returns the new input stream or NULL */

Source from the content-addressed store, hash-verified

1519 * Returns the new input stream or NULL
1520 */
1521xmlParserInputPtr
1522xmlNewInputStream(xmlParserCtxtPtr ctxt) {
1523 xmlParserInputPtr input;
1524
1525 input = (xmlParserInputPtr) xmlMalloc(sizeof(xmlParserInput));
1526 if (input == NULL) {
1527 xmlCtxtErrMemory(ctxt);
1528 return(NULL);
1529 }
1530 memset(input, 0, sizeof(xmlParserInput));
1531 input->line = 1;
1532 input->col = 1;
1533
1534 /*
1535 * If the context is NULL the id cannot be initialized, but that
1536 * should not happen while parsing which is the situation where
1537 * the id is actually needed.
1538 */
1539 if (ctxt != NULL) {
1540 if (input->id >= INT_MAX) {
1541 xmlCtxtErrMemory(ctxt);
1542 return(NULL);
1543 }
1544 input->id = ctxt->input_id++;
1545 }
1546
1547 return(input);
1548}
1549
1550/**
1551 * xmlNewInputURL:

Callers 4

xmlParseCatalogFileFunction · 0.85
xmlTextReaderSetupFunction · 0.85
xmlNewInputInternalFunction · 0.85
xmlNewInputFromFileFunction · 0.85

Calls 1

xmlCtxtErrMemoryFunction · 0.85

Tested by

no test coverage detected