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

Function xmlXPathCacheWrapString

ThirdParty/libxml2/vtklibxml2/xpath.c:1702–1725  ·  view source on GitHub ↗

* xmlXPathCacheWrapString: * @pctxt the XPath context * @val: the xmlChar * value * * This is the cached version of xmlXPathWrapString(). * Wraps the @val string into an XPath object. * * Returns the created or reused object. */

Source from the content-addressed store, hash-verified

1700 * Returns the created or reused object.
1701 */
1702static xmlXPathObjectPtr
1703xmlXPathCacheWrapString(xmlXPathParserContextPtr pctxt, xmlChar *val)
1704{
1705 xmlXPathObjectPtr ret;
1706 xmlXPathContextPtr ctxt = pctxt->context;
1707
1708 if ((ctxt != NULL) && (ctxt->cache != NULL)) {
1709 xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
1710
1711 if (cache->miscObjs != NULL) {
1712 ret = cache->miscObjs;
1713 cache->miscObjs = (void *) ret->stringval;
1714 cache->numMisc -= 1;
1715 ret->type = XPATH_STRING;
1716 ret->stringval = val;
1717 return(ret);
1718 }
1719 }
1720
1721 ret = xmlXPathWrapString(val);
1722 if (ret == NULL)
1723 xmlXPathPErrMemory(pctxt);
1724 return(ret);
1725}
1726
1727/**
1728 * xmlXPathCacheNewNodeSet:

Callers 6

xmlXPathNameFunctionFunction · 0.85
xmlXPathStringFunctionFunction · 0.85

Calls 2

xmlXPathWrapStringFunction · 0.85
xmlXPathPErrMemoryFunction · 0.85

Tested by

no test coverage detected