}
+/**
+ * virJSONValueObjectGetStringOrNumber:
+ * @object: JSON value object
+ * @key: name of the property in @object to get
+ *
+ * Gets a property named @key from the JSON object @object. The value may be
+ * a number or a string and is returned as a string. In cases when the property
+ * is not present or is not a string or number NULL is returned.
+ */
+const char *
+virJSONValueObjectGetStringOrNumber(virJSONValuePtr object,
+ const char *key)
+{
+ virJSONValuePtr val = virJSONValueObjectGet(object, key);
+
+ if (!val)
+ return NULL;
+
+ if (val->type == VIR_JSON_TYPE_STRING)
+ return val->data.string;
+ else if (val->type == VIR_JSON_TYPE_NUMBER)
+ return val->data.number;
+
+ return NULL;
+}
+
+
int
virJSONValueObjectGetNumberInt(virJSONValuePtr object,
const char *key,
const char *key);
const char *virJSONValueObjectGetString(virJSONValuePtr object, const char *key);
+const char *virJSONValueObjectGetStringOrNumber(virJSONValuePtr object, const char *key);
int virJSONValueObjectGetNumberInt(virJSONValuePtr object, const char *key, int *value);
int virJSONValueObjectGetNumberUint(virJSONValuePtr object, const char *key, unsigned int *value);
int virJSONValueObjectGetNumberLong(virJSONValuePtr object, const char *key, long long *value);