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

Function valuePush

ThirdParty/libxml2/vtklibxml2/xpath.c:2076–2109  ·  view source on GitHub ↗

* valuePush: * @ctxt: an XPath evaluation context * @value: the XPath object * * Pushes a new XPath object on top of the value stack. If value is NULL, * a memory error is recorded in the parser context. * * Returns the number of items on the value stack, or -1 in case of error. * * The object is destroyed in case of error. */

Source from the content-addressed store, hash-verified

2074 * The object is destroyed in case of error.
2075 */
2076int
2077valuePush(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr value)
2078{
2079 if (ctxt == NULL) return(-1);
2080 if (value == NULL) {
2081 /*
2082 * A NULL value typically indicates that a memory allocation failed.
2083 */
2084 xmlXPathPErrMemory(ctxt);
2085 return(-1);
2086 }
2087 if (ctxt->valueNr >= ctxt->valueMax) {
2088 xmlXPathObjectPtr *tmp;
2089
2090 if (ctxt->valueMax >= XPATH_MAX_STACK_DEPTH) {
2091 xmlXPathPErrMemory(ctxt);
2092 xmlXPathFreeObject(value);
2093 return (-1);
2094 }
2095 tmp = (xmlXPathObjectPtr *) xmlRealloc(ctxt->valueTab,
2096 2 * ctxt->valueMax *
2097 sizeof(ctxt->valueTab[0]));
2098 if (tmp == NULL) {
2099 xmlXPathPErrMemory(ctxt);
2100 xmlXPathFreeObject(value);
2101 return (-1);
2102 }
2103 ctxt->valueMax *= 2;
2104 ctxt->valueTab = tmp;
2105 }
2106 ctxt->valueTab[ctxt->valueNr] = value;
2107 ctxt->value = value;
2108 return (ctxt->valueNr++);
2109}
2110
2111/**
2112 * xmlXPathPopBoolean:

Callers 15

xmlXPathCompareValuesFunction · 0.85
xmlXPathRootFunction · 0.85
xmlXPathLastFunctionFunction · 0.85
xmlXPathPositionFunctionFunction · 0.85
xmlXPathCountFunctionFunction · 0.85
xmlXPathIdFunctionFunction · 0.85

Calls 2

xmlXPathPErrMemoryFunction · 0.85
xmlXPathFreeObjectFunction · 0.85

Tested by

no test coverage detected