* xmlXPathNewString: * @val: the xmlChar * value * * Create a new xmlXPathObjectPtr of type string and of value @val * * Returns the newly created object. */
| 4348 | * Returns the newly created object. |
| 4349 | */ |
| 4350 | xmlXPathObjectPtr |
| 4351 | xmlXPathNewString(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: |
no test coverage detected