mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
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:
parent
df570882cd
commit
ed03de9e46
@ -3699,7 +3699,6 @@ virXPathLongHex;
|
||||
virXPathLongLong;
|
||||
virXPathNode;
|
||||
virXPathNodeSet;
|
||||
virXPathNumber;
|
||||
virXPathString;
|
||||
virXPathUInt;
|
||||
virXPathULong;
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user