
On Tue, Jun 27, 2017 at 17:55:40 +0200, Bjoern Walk wrote:
Peter Krempa <pkrempa@redhat.com> [2017-06-27, 02:46PM +0200]:
Allows testing whether a virJSONValue is an object. --- src/libvirt_private.syms | 1 + src/util/virjson.c | 10 ++++++++++ src/util/virjson.h | 2 ++ 3 files changed, 13 insertions(+)
[...]
diff --git a/src/util/virjson.c b/src/util/virjson.c index b49b29b0f..efd6c3a0e 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -905,6 +905,16 @@ virJSONValueObjectGetValue(virJSONValuePtr object,
bool +virJSONValueIsObject(virJSONValuePtr object) +{ + if (object) + return object->type == VIR_JSON_TYPE_OBJECT; + else + return NULL;
s/NULL/false/
Thanks! It's a shame we don't have 'nullptr' like functionality in C.