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

Function xmlXPathNewString

ThirdParty/libxml2/vtklibxml2/xpath.c:4350–4367  ·  view source on GitHub ↗

* xmlXPathNewString: * @val: the xmlChar * value * * Create a new xmlXPathObjectPtr of type string and of value @val * * Returns the newly created object. */

Source from the content-addressed store, hash-verified

4348 * Returns the newly created object.
4349 */
4350xmlXPathObjectPtr
4351xmlXPathNewString(const xmlChar *val) {
4352 xmlXPathObjectPtr ret;
4353
4354 ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
4355 if (ret == NULL)
4356 return(NULL);
4357 memset(ret, 0 , sizeof(xmlXPathObject));
4358 ret->type = XPATH_STRING;
4359 if (val == NULL)
4360 val = BAD_CAST "";
4361 ret->stringval = xmlStrdup(val);
4362 if (ret->stringval == NULL) {
4363 xmlFree(ret);
4364 return(NULL);
4365 }
4366 return(ret);
4367}
4368
4369/**
4370 * xmlXPathWrapString:

Callers 2

xmlXPathCacheNewStringFunction · 0.85
xmlXPtrEvalChildSeqFunction · 0.85

Calls 1

xmlStrdupFunction · 0.85

Tested by

no test coverage detected