* xmlXPathPopBoolean: * @ctxt: an XPath parser context * * Pops a boolean from the stack, handling conversion if needed. * Check error with #xmlXPathCheckError. * * Returns the boolean */
| 2118 | * Returns the boolean |
| 2119 | */ |
| 2120 | int |
| 2121 | xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt) { |
| 2122 | xmlXPathObjectPtr obj; |
| 2123 | int ret; |
| 2124 | |
| 2125 | obj = valuePop(ctxt); |
| 2126 | if (obj == NULL) { |
| 2127 | xmlXPathSetError(ctxt, XPATH_INVALID_OPERAND); |
| 2128 | return(0); |
| 2129 | } |
| 2130 | if (obj->type != XPATH_BOOLEAN) |
| 2131 | ret = xmlXPathCastToBoolean(obj); |
| 2132 | else |
| 2133 | ret = obj->boolval; |
| 2134 | xmlXPathReleaseObject(ctxt->context, obj); |
| 2135 | return(ret); |
| 2136 | } |
| 2137 | |
| 2138 | /** |
| 2139 | * xmlXPathPopNumber: |
no test coverage detected