util: xml: Remove unused virXPathNumber

'virXPathNumber' is not used currently, remove it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2022-10-04 15:53:21 +02:00
parent df570882cd
commit ed03de9e46
3 changed files with 0 additions and 38 deletions

View File

@ -3699,7 +3699,6 @@ virXPathLongHex;
virXPathLongLong;
virXPathNode;
virXPathNodeSet;
virXPathNumber;
virXPathString;
virXPathUInt;
virXPathULong;

View File

@ -90,39 +90,6 @@ virXPathString(const char *xpath,
}
/**
* virXPathNumber:
* @xpath: the XPath string to evaluate
* @ctxt: an XPath context
* @value: the returned double value
*
* Convenience function to evaluate an XPath number
*
* Returns 0 in case of success in which case @value is set,
* or -1 if the evaluation failed.
*/
int
virXPathNumber(const char *xpath,
xmlXPathContextPtr ctxt,
double *value)
{
g_autoptr(xmlXPathObject) obj = NULL;
if ((ctxt == NULL) || (xpath == NULL) || (value == NULL)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Invalid parameter to virXPathNumber()"));
return -1;
}
obj = xmlXPathEval(BAD_CAST xpath, ctxt);
if ((obj == NULL) || (obj->type != XPATH_NUMBER) ||
(isnan(obj->floatval))) {
return -1;
}
*value = obj->floatval;
return 0;
}
static int
virXPathLongBase(const char *xpath,
xmlXPathContextPtr ctxt,

View File

@ -51,10 +51,6 @@ char *
virXPathString(const char *xpath,
xmlXPathContextPtr ctxt);
int
virXPathNumber(const char *xpath,
xmlXPathContextPtr ctxt,
double *value);
int
virXPathInt(const char *xpath,
xmlXPathContextPtr ctxt,
int *value);