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

Function xmlXPathRegisterVariableNS

ThirdParty/libxml2/vtklibxml2/xpath.c:4086–4104  ·  view source on GitHub ↗

* xmlXPathRegisterVariableNS: * @ctxt: the XPath context * @name: the variable name * @ns_uri: the variable namespace URI * @value: the variable value or NULL * * Register a new variable value. If @value is NULL it unregisters * the variable * * Returns 0 in case of success, -1 in case of error */

Source from the content-addressed store, hash-verified

4084 * Returns 0 in case of success, -1 in case of error
4085 */
4086int
4087xmlXPathRegisterVariableNS(xmlXPathContextPtr ctxt, const xmlChar *name,
4088 const xmlChar *ns_uri,
4089 xmlXPathObjectPtr value) {
4090 if (ctxt == NULL)
4091 return(-1);
4092 if (name == NULL)
4093 return(-1);
4094
4095 if (ctxt->varHash == NULL)
4096 ctxt->varHash = xmlHashCreate(0);
4097 if (ctxt->varHash == NULL)
4098 return(-1);
4099 if (value == NULL)
4100 return(xmlHashRemoveEntry2(ctxt->varHash, name, ns_uri,
4101 xmlXPathFreeObjectEntry));
4102 return(xmlHashUpdateEntry2(ctxt->varHash, name, ns_uri,
4103 (void *) value, xmlXPathFreeObjectEntry));
4104}
4105
4106/**
4107 * xmlXPathRegisterVariableLookup:

Calls 3

xmlHashCreateFunction · 0.85
xmlHashRemoveEntry2Function · 0.85
xmlHashUpdateEntry2Function · 0.85

Tested by

no test coverage detected