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

Function xmlXPathNewParserContext

ThirdParty/libxml2/vtklibxml2/xpath.c:5195–5221  ·  view source on GitHub ↗

* xmlXPathNewParserContext: * @str: the XPath expression * @ctxt: the XPath context * * Create a new xmlXPathParserContext * * Returns the xmlXPathParserContext just allocated. */

Source from the content-addressed store, hash-verified

5193 * Returns the xmlXPathParserContext just allocated.
5194 */
5195xmlXPathParserContextPtr
5196xmlXPathNewParserContext(const xmlChar *str, xmlXPathContextPtr ctxt) {
5197 xmlXPathParserContextPtr ret;
5198
5199 ret = (xmlXPathParserContextPtr) xmlMalloc(sizeof(xmlXPathParserContext));
5200 if (ret == NULL) {
5201 xmlXPathErrMemory(ctxt);
5202 return(NULL);
5203 }
5204 memset(ret, 0 , sizeof(xmlXPathParserContext));
5205 ret->cur = ret->base = str;
5206 ret->context = ctxt;
5207
5208 ret->comp = xmlXPathNewCompExpr();
5209 if (ret->comp == NULL) {
5210 xmlXPathErrMemory(ctxt);
5211 xmlFree(ret->valueTab);
5212 xmlFree(ret);
5213 return(NULL);
5214 }
5215 if ((ctxt != NULL) && (ctxt->dict != NULL)) {
5216 ret->comp->dict = ctxt->dict;
5217 xmlDictReference(ret->comp->dict);
5218 }
5219
5220 return(ret);
5221}
5222
5223/**
5224 * xmlXPathCompParserContext:

Callers 3

xmlXPathCtxtCompileFunction · 0.85
xmlXPathEvalFunction · 0.85
xmlXPtrEvalFunction · 0.85

Calls 3

xmlXPathErrMemoryFunction · 0.85
xmlXPathNewCompExprFunction · 0.85
xmlDictReferenceFunction · 0.85

Tested by

no test coverage detected