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

Function xmlXPathCompParserContext

ThirdParty/libxml2/vtklibxml2/xpath.c:5232–5259  ·  view source on GitHub ↗

* xmlXPathCompParserContext: * @comp: the XPath compiled expression * @ctxt: the XPath context * * Create a new xmlXPathParserContext when processing a compiled expression * * Returns the xmlXPathParserContext just allocated. */

Source from the content-addressed store, hash-verified

5230 * Returns the xmlXPathParserContext just allocated.
5231 */
5232static xmlXPathParserContextPtr
5233xmlXPathCompParserContext(xmlXPathCompExprPtr comp, xmlXPathContextPtr ctxt) {
5234 xmlXPathParserContextPtr ret;
5235
5236 ret = (xmlXPathParserContextPtr) xmlMalloc(sizeof(xmlXPathParserContext));
5237 if (ret == NULL) {
5238 xmlXPathErrMemory(ctxt);
5239 return(NULL);
5240 }
5241 memset(ret, 0 , sizeof(xmlXPathParserContext));
5242
5243 /* Allocate the value stack */
5244 ret->valueTab = (xmlXPathObjectPtr *)
5245 xmlMalloc(10 * sizeof(xmlXPathObjectPtr));
5246 if (ret->valueTab == NULL) {
5247 xmlFree(ret);
5248 xmlXPathErrMemory(ctxt);
5249 return(NULL);
5250 }
5251 ret->valueNr = 0;
5252 ret->valueMax = 10;
5253 ret->value = NULL;
5254
5255 ret->context = ctxt;
5256 ret->comp = comp;
5257
5258 return(ret);
5259}
5260
5261/**
5262 * xmlXPathFreeParserContext:

Callers 1

Calls 1

xmlXPathErrMemoryFunction · 0.85

Tested by

no test coverage detected