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

Function xmlXPathContextSetCache

ThirdParty/libxml2/vtklibxml2/xpath.c:1621–1651  ·  view source on GitHub ↗

* xmlXPathContextSetCache: * * @ctxt: the XPath context * @active: enables/disables (creates/frees) the cache * @value: a value with semantics dependent on @options * @options: options (currently only the value 0 is used) * * Creates/frees an object cache on the XPath context. * If activates XPath objects (xmlXPathObject) will be cached internally * to be reused. * @options: * 0: Thi

Source from the content-addressed store, hash-verified

1619 * Returns 0 if the setting succeeded, and -1 on API or internal errors.
1620 */
1621int
1622xmlXPathContextSetCache(xmlXPathContextPtr ctxt,
1623 int active,
1624 int value,
1625 int options)
1626{
1627 if (ctxt == NULL)
1628 return(-1);
1629 if (active) {
1630 xmlXPathContextCachePtr cache;
1631
1632 if (ctxt->cache == NULL) {
1633 ctxt->cache = xmlXPathNewCache();
1634 if (ctxt->cache == NULL) {
1635 xmlXPathErrMemory(ctxt);
1636 return(-1);
1637 }
1638 }
1639 cache = (xmlXPathContextCachePtr) ctxt->cache;
1640 if (options == 0) {
1641 if (value < 0)
1642 value = 100;
1643 cache->maxNodeset = value;
1644 cache->maxMisc = value;
1645 }
1646 } else if (ctxt->cache != NULL) {
1647 xmlXPathFreeCache((xmlXPathContextCachePtr) ctxt->cache);
1648 ctxt->cache = NULL;
1649 }
1650 return(0);
1651}
1652
1653/**
1654 * xmlXPathCacheWrapNodeSet:

Callers 3

initializeLibxml2Function · 0.85
xmlXPathNewContextFunction · 0.85
initializeLibxml2Function · 0.85

Calls 3

xmlXPathNewCacheFunction · 0.85
xmlXPathErrMemoryFunction · 0.85
xmlXPathFreeCacheFunction · 0.85

Tested by

no test coverage detected