* xmlXPathConvertBoolean: * @val: an XPath object * * Converts an existing object to its boolean() equivalent * * Returns the new object, the old one is freed (or the operation * is done directly on @val) */
| 5067 | * is done directly on @val) |
| 5068 | */ |
| 5069 | xmlXPathObjectPtr |
| 5070 | xmlXPathConvertBoolean(xmlXPathObjectPtr val) { |
| 5071 | xmlXPathObjectPtr ret; |
| 5072 | |
| 5073 | if (val == NULL) |
| 5074 | return(xmlXPathNewBoolean(0)); |
| 5075 | if (val->type == XPATH_BOOLEAN) |
| 5076 | return(val); |
| 5077 | ret = xmlXPathNewBoolean(xmlXPathCastToBoolean(val)); |
| 5078 | xmlXPathFreeObject(val); |
| 5079 | return(ret); |
| 5080 | } |
| 5081 | |
| 5082 | /************************************************************************ |
| 5083 | * * |
nothing calls this directly
no test coverage detected