* xmlXPathFunctionLookupNS: * @ctxt: the XPath context * @name: the function name * @ns_uri: the function namespace URI * * Search in the Function array of the context for the given * function. * * Returns the xmlXPathFunction or NULL if not found */
| 4006 | * Returns the xmlXPathFunction or NULL if not found |
| 4007 | */ |
| 4008 | xmlXPathFunction |
| 4009 | xmlXPathFunctionLookupNS(xmlXPathContextPtr ctxt, const xmlChar *name, |
| 4010 | const xmlChar *ns_uri) { |
| 4011 | xmlXPathFunction ret; |
| 4012 | |
| 4013 | if (ctxt == NULL) |
| 4014 | return(NULL); |
| 4015 | if (name == NULL) |
| 4016 | return(NULL); |
| 4017 | |
| 4018 | if (ctxt->funcLookupFunc != NULL) { |
| 4019 | xmlXPathFuncLookupFunc f; |
| 4020 | |
| 4021 | f = ctxt->funcLookupFunc; |
| 4022 | ret = f(ctxt->funcLookupData, name, ns_uri); |
| 4023 | if (ret != NULL) |
| 4024 | return(ret); |
| 4025 | } |
| 4026 | |
| 4027 | if (ctxt->funcHash == NULL) |
| 4028 | return(NULL); |
| 4029 | |
| 4030 | XML_IGNORE_FPTR_CAST_WARNINGS |
| 4031 | ret = (xmlXPathFunction) xmlHashLookup2(ctxt->funcHash, name, ns_uri); |
| 4032 | XML_POP_WARNINGS |
| 4033 | return(ret); |
| 4034 | } |
| 4035 | |
| 4036 | /** |
| 4037 | * xmlXPathRegisteredFuncsCleanup: |
no test coverage detected