]> git.proxmox.com Git - mirror_qemu.git/commit - qobject/qnull.c
qobject: Add a special null QObject
authorMarkus Armbruster <armbru@redhat.com>
Wed, 29 Apr 2015 21:35:05 +0000 (15:35 -0600)
committerLuiz Capitulino <lcapitulino@redhat.com>
Mon, 11 May 2015 12:59:07 +0000 (08:59 -0400)
commit481b002cc81ed7fc7b06e32e9d4d495d81739d14
tree20dbf5ec82cf594cdfeefe5db655d411fb55b78d
parenta7c31816288a8f20fc387d69d441413e7a8c9ff1
qobject: Add a special null QObject

I'm going to fix the JSON parser to recognize null.  The obvious
representation of JSON null as (QObject *)NULL doesn't work, because
the parser already uses it as an error value.  Perhaps we should
change it to free NULL for null, but that's more than I can do right
now.  Create a special null QObject instead.

The existing QDict, QList, and QString all represent something that
is a pointer in C and could therefore be associated with NULL.  But
right now, all three of these sub-types are always non-null once
created, so the new null sentinel object is intentionally unrelated
to them.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
include/qapi/qmp/qobject.h
qobject/Makefile.objs
qobject/qjson.c
qobject/qnull.c [new file with mode: 0644]