* xmlXPathWrapNodeSet: * @val: the NodePtr value * * Wrap the Nodeset @val in a new xmlXPathObjectPtr * * Returns the newly created object. * * In case of error the node set is destroyed and NULL is returned. */
| 3468 | * In case of error the node set is destroyed and NULL is returned. |
| 3469 | */ |
| 3470 | xmlXPathObjectPtr |
| 3471 | xmlXPathWrapNodeSet(xmlNodeSetPtr val) { |
| 3472 | xmlXPathObjectPtr ret; |
| 3473 | |
| 3474 | ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject)); |
| 3475 | if (ret == NULL) { |
| 3476 | xmlXPathFreeNodeSet(val); |
| 3477 | return(NULL); |
| 3478 | } |
| 3479 | memset(ret, 0 , sizeof(xmlXPathObject)); |
| 3480 | ret->type = XPATH_NODESET; |
| 3481 | ret->nodesetval = val; |
| 3482 | return(ret); |
| 3483 | } |
| 3484 | |
| 3485 | /** |
| 3486 | * xmlXPathFreeNodeSetList: |
no test coverage detected