* xmlXPathPopNumber: * @ctxt: an XPath parser context * * Pops a number from the stack, handling conversion if needed. * Check error with #xmlXPathCheckError. * * Returns the number */
| 2145 | * Returns the number |
| 2146 | */ |
| 2147 | double |
| 2148 | xmlXPathPopNumber (xmlXPathParserContextPtr ctxt) { |
| 2149 | xmlXPathObjectPtr obj; |
| 2150 | double ret; |
| 2151 | |
| 2152 | obj = valuePop(ctxt); |
| 2153 | if (obj == NULL) { |
| 2154 | xmlXPathSetError(ctxt, XPATH_INVALID_OPERAND); |
| 2155 | return(0); |
| 2156 | } |
| 2157 | if (obj->type != XPATH_NUMBER) |
| 2158 | ret = xmlXPathCastToNumberInternal(ctxt, obj); |
| 2159 | else |
| 2160 | ret = obj->floatval; |
| 2161 | xmlXPathReleaseObject(ctxt->context, obj); |
| 2162 | return(ret); |
| 2163 | } |
| 2164 | |
| 2165 | /** |
| 2166 | * xmlXPathPopString: |
nothing calls this directly
no test coverage detected