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

Function inputPush

ThirdParty/libxml2/vtklibxml2/parser.c:1940–1979  ·  view source on GitHub ↗

* inputPush: * @ctxt: an XML parser context * @value: the parser input * * Pushes a new parser input on top of the input stack * * Returns -1 in case of error, the index in the stack otherwise */

Source from the content-addressed store, hash-verified

1938 * Returns -1 in case of error, the index in the stack otherwise
1939 */
1940int
1941inputPush(xmlParserCtxtPtr ctxt, xmlParserInputPtr value)
1942{
1943 char *directory = NULL;
1944
1945 if ((ctxt == NULL) || (value == NULL))
1946 return(-1);
1947
1948 if (ctxt->inputNr >= ctxt->inputMax) {
1949 size_t newSize = ctxt->inputMax * 2;
1950 xmlParserInputPtr *tmp;
1951
1952 tmp = (xmlParserInputPtr *) xmlRealloc(ctxt->inputTab,
1953 newSize * sizeof(*tmp));
1954 if (tmp == NULL) {
1955 xmlErrMemory(ctxt);
1956 return (-1);
1957 }
1958 ctxt->inputTab = tmp;
1959 ctxt->inputMax = newSize;
1960 }
1961
1962 if ((ctxt->inputNr == 0) && (value->filename != NULL)) {
1963 directory = xmlParserGetDirectory(value->filename);
1964 if (directory == NULL) {
1965 xmlErrMemory(ctxt);
1966 return(-1);
1967 }
1968 }
1969
1970 ctxt->inputTab[ctxt->inputNr] = value;
1971 ctxt->input = value;
1972
1973 if (ctxt->inputNr == 0) {
1974 xmlFree(ctxt->directory);
1975 ctxt->directory = directory;
1976 }
1977
1978 return(ctxt->inputNr++);
1979}
1980/**
1981 * inputPop:
1982 * @ctxt: an XML parser context

Callers 15

xmlParseCatalogFileFunction · 0.85
htmlCreateDocParserCtxtFunction · 0.85
htmlCreatePushParserCtxtFunction · 0.85
htmlCreateFileParserCtxtFunction · 0.85
htmlCtxtParseDocumentFunction · 0.85
xmlTextReaderSetupFunction · 0.85
xmlSchemaValidateStreamFunction · 0.85
xmlPushInputFunction · 0.85
xmlLoadEntityContentFunction · 0.85
xmlCreatePushParserCtxtFunction · 0.85
xmlCreateIOParserCtxtFunction · 0.85

Calls 2

xmlErrMemoryFunction · 0.85
xmlParserGetDirectoryFunction · 0.85

Tested by

no test coverage detected