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

Function xmlXPathCacheNewBoolean

ThirdParty/libxml2/vtklibxml2/xpath.c:1868–1892  ·  view source on GitHub ↗

* xmlXPathCacheNewBoolean: * @pctxt the XPath context * @val: the boolean value * * This is the cached version of xmlXPathNewBoolean(). * Acquires an xmlXPathObjectPtr of type boolean and of value @val * * Returns the created or reused object. */

Source from the content-addressed store, hash-verified

1866 * Returns the created or reused object.
1867 */
1868static xmlXPathObjectPtr
1869xmlXPathCacheNewBoolean(xmlXPathParserContextPtr pctxt, int val)
1870{
1871 xmlXPathObjectPtr ret;
1872 xmlXPathContextPtr ctxt = pctxt->context;
1873
1874 if ((ctxt != NULL) && (ctxt->cache != NULL)) {
1875 xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
1876
1877 if (cache->miscObjs != NULL) {
1878 ret = cache->miscObjs;
1879 cache->miscObjs = (void *) ret->stringval;
1880 cache->numMisc -= 1;
1881 ret->stringval = NULL;
1882 ret->type = XPATH_BOOLEAN;
1883 ret->boolval = (val != 0);
1884 return(ret);
1885 }
1886 }
1887
1888 ret = xmlXPathNewBoolean(val);
1889 if (ret == NULL)
1890 xmlXPathPErrMemory(pctxt);
1891 return(ret);
1892}
1893
1894/**
1895 * xmlXPathCacheNewFloat:

Callers 8

xmlXPathCacheObjectCopyFunction · 0.85
xmlXPathContainsFunctionFunction · 0.85
xmlXPathBooleanFunctionFunction · 0.85
xmlXPathTrueFunctionFunction · 0.85
xmlXPathFalseFunctionFunction · 0.85
xmlXPathLangFunctionFunction · 0.85
xmlXPathCompOpEvalFunction · 0.85

Calls 2

xmlXPathNewBooleanFunction · 0.85
xmlXPathPErrMemoryFunction · 0.85

Tested by

no test coverage detected