util: xml: Remove virXPathLong
The function is now unused and we no longer want to promote use of the 'long' type. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
a65dd31438
commit
5ff3e29d44
@ -3693,7 +3693,6 @@ virXMLValidatorValidate;
|
|||||||
virXPathBoolean;
|
virXPathBoolean;
|
||||||
virXPathContextNodeRestore;
|
virXPathContextNodeRestore;
|
||||||
virXPathInt;
|
virXPathInt;
|
||||||
virXPathLong;
|
|
||||||
virXPathLongLong;
|
virXPathLongLong;
|
||||||
virXPathNode;
|
virXPathNode;
|
||||||
virXPathNodeSet;
|
virXPathNodeSet;
|
||||||
|
@ -111,38 +111,6 @@ virXPathString(const char *xpath,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
virXPathLongBase(const char *xpath,
|
|
||||||
xmlXPathContextPtr ctxt,
|
|
||||||
int base,
|
|
||||||
long *value)
|
|
||||||
{
|
|
||||||
g_autoptr(xmlXPathObject) obj = NULL;
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
if ((ctxt == NULL) || (xpath == NULL) || (value == NULL)) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
"%s", _("Invalid parameter to virXPathLong()"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
obj = xmlXPathEval(BAD_CAST xpath, ctxt);
|
|
||||||
if ((obj != NULL) && (obj->type == XPATH_STRING) &&
|
|
||||||
(obj->stringval != NULL) && (obj->stringval[0] != 0)) {
|
|
||||||
if (virStrToLong_l((char *) obj->stringval, NULL, base, value) < 0)
|
|
||||||
ret = -2;
|
|
||||||
} else if ((obj != NULL) && (obj->type == XPATH_NUMBER) &&
|
|
||||||
(!(isnan(obj->floatval)))) {
|
|
||||||
*value = (long) obj->floatval;
|
|
||||||
if (*value != obj->floatval)
|
|
||||||
ret = -2;
|
|
||||||
} else {
|
|
||||||
ret = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virXPathInt:
|
* virXPathInt:
|
||||||
* @xpath: the XPath string to evaluate
|
* @xpath: the XPath string to evaluate
|
||||||
@ -174,27 +142,6 @@ virXPathInt(const char *xpath,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* virXPathLong:
|
|
||||||
* @xpath: the XPath string to evaluate
|
|
||||||
* @ctxt: an XPath context
|
|
||||||
* @value: the returned long value
|
|
||||||
*
|
|
||||||
* Convenience function to evaluate an XPath number
|
|
||||||
*
|
|
||||||
* Returns 0 in case of success in which case @value is set,
|
|
||||||
* or -1 if the XPath evaluation failed or -2 if the
|
|
||||||
* value doesn't have a long format.
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
virXPathLong(const char *xpath,
|
|
||||||
xmlXPathContextPtr ctxt,
|
|
||||||
long *value)
|
|
||||||
{
|
|
||||||
return virXPathLongBase(xpath, ctxt, 10, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
virXPathULongBase(const char *xpath,
|
virXPathULongBase(const char *xpath,
|
||||||
xmlXPathContextPtr ctxt,
|
xmlXPathContextPtr ctxt,
|
||||||
|
@ -60,10 +60,6 @@ virXPathUInt(const char *xpath,
|
|||||||
xmlXPathContextPtr ctxt,
|
xmlXPathContextPtr ctxt,
|
||||||
unsigned int *value);
|
unsigned int *value);
|
||||||
int
|
int
|
||||||
virXPathLong(const char *xpath,
|
|
||||||
xmlXPathContextPtr ctxt,
|
|
||||||
long *value);
|
|
||||||
int
|
|
||||||
virXPathULong(const char *xpath,
|
virXPathULong(const char *xpath,
|
||||||
xmlXPathContextPtr ctxt,
|
xmlXPathContextPtr ctxt,
|
||||||
unsigned long *value);
|
unsigned long *value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user