* xmlXPathCompParserContext: * @comp: the XPath compiled expression * @ctxt: the XPath context * * Create a new xmlXPathParserContext when processing a compiled expression * * Returns the xmlXPathParserContext just allocated. */
| 5230 | * Returns the xmlXPathParserContext just allocated. |
| 5231 | */ |
| 5232 | static xmlXPathParserContextPtr |
| 5233 | xmlXPathCompParserContext(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: |
no test coverage detected