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

Function xmlXPathCacheWrapNodeSet

ThirdParty/libxml2/vtklibxml2/xpath.c:1665–1690  ·  view source on GitHub ↗

* xmlXPathCacheWrapNodeSet: * @pctxt: the XPath context * @val: the NodePtr value * * This is the cached version of xmlXPathWrapNodeSet(). * Wrap the Nodeset @val in a new xmlXPathObjectPtr * * Returns the created or reused object. * * In case of error the node set is destroyed and NULL is returned. */

Source from the content-addressed store, hash-verified

1663 * In case of error the node set is destroyed and NULL is returned.
1664 */
1665static xmlXPathObjectPtr
1666xmlXPathCacheWrapNodeSet(xmlXPathParserContextPtr pctxt, xmlNodeSetPtr val)
1667{
1668 xmlXPathObjectPtr ret;
1669 xmlXPathContextPtr ctxt = pctxt->context;
1670
1671 if ((ctxt != NULL) && (ctxt->cache != NULL)) {
1672 xmlXPathContextCachePtr cache =
1673 (xmlXPathContextCachePtr) ctxt->cache;
1674
1675 if (cache->miscObjs != NULL) {
1676 ret = cache->miscObjs;
1677 cache->miscObjs = (void *) ret->stringval;
1678 cache->numMisc -= 1;
1679 ret->stringval = NULL;
1680 ret->type = XPATH_NODESET;
1681 ret->nodesetval = val;
1682 return(ret);
1683 }
1684 }
1685
1686 ret = xmlXPathWrapNodeSet(val);
1687 if (ret == NULL)
1688 xmlXPathPErrMemory(pctxt);
1689 return(ret);
1690}
1691
1692/**
1693 * xmlXPathCacheWrapString:

Callers 3

xmlXPathCacheObjectCopyFunction · 0.85
xmlXPathIdFunctionFunction · 0.85

Calls 2

xmlXPathWrapNodeSetFunction · 0.85
xmlXPathPErrMemoryFunction · 0.85

Tested by

no test coverage detected