aboutsummaryrefslogtreecommitdiff
path: root/qobject
diff options
context:
space:
mode:
Diffstat (limited to 'qobject')
-rw-r--r--qobject/json-parser.c2
-rw-r--r--qobject/qdict.c21
-rw-r--r--qobject/qjson.c1
-rw-r--r--qobject/qlist.c24
-rw-r--r--qobject/qlit.c1
-rw-r--r--qobject/qobject.c2
6 files changed, 51 insertions, 0 deletions
diff --git a/qobject/json-parser.c b/qobject/json-parser.c
index 30dfb9dc41..8f4badc6d9 100644
--- a/qobject/json-parser.c
+++ b/qobject/json-parser.c
@@ -16,6 +16,8 @@
#include "qapi/error.h"
#include "qemu-common.h"
#include "qapi/qmp/qbool.h"
+#include "qapi/qmp/qnull.h"
+#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qstring.h"
#include "qapi/qmp/json-parser.h"
#include "qapi/qmp/json-lexer.h"
diff --git a/qobject/qdict.c b/qobject/qdict.c
index e8f15f1132..7e7ac24cf7 100644
--- a/qobject/qdict.c
+++ b/qobject/qdict.c
@@ -14,6 +14,7 @@
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qbool.h"
+#include "qapi/qmp/qnull.h"
#include "qapi/qmp/qstring.h"
#include "qapi/qmp/qobject.h"
#include "qapi/error.h"
@@ -143,6 +144,26 @@ void qdict_put_obj(QDict *qdict, const char *key, QObject *value)
}
}
+void qdict_put_int(QDict *qdict, const char *key, int64_t value)
+{
+ qdict_put(qdict, key, qnum_from_int(value));
+}
+
+void qdict_put_bool(QDict *qdict, const char *key, bool value)
+{
+ qdict_put(qdict, key, qbool_from_bool(value));
+}
+
+void qdict_put_str(QDict *qdict, const char *key, const char *value)
+{
+ qdict_put(qdict, key, qstring_from_str(value));
+}
+
+void qdict_put_null(QDict *qdict, const char *key)
+{
+ qdict_put(qdict, key, qnull());
+}
+
/**
* qdict_get(): Lookup for a given 'key'
*
diff --git a/qobject/qjson.c b/qobject/qjson.c
index fe89213247..7fbb68b6ba 100644
--- a/qobject/qjson.c
+++ b/qobject/qjson.c
@@ -18,6 +18,7 @@
#include "qapi/qmp/json-streamer.h"
#include "qapi/qmp/qjson.h"
#include "qapi/qmp/qbool.h"
+#include "qapi/qmp/qnum.h"
#include "qemu/unicode.h"
typedef struct JSONParsingState
diff --git a/qobject/qlist.c b/qobject/qlist.c
index 3ef57d31d1..268e46c8f0 100644
--- a/qobject/qlist.c
+++ b/qobject/qlist.c
@@ -11,8 +11,12 @@
*/
#include "qemu/osdep.h"
+#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qlist.h"
+#include "qapi/qmp/qnull.h"
+#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qobject.h"
+#include "qapi/qmp/qstring.h"
#include "qemu/queue.h"
#include "qemu-common.h"
@@ -64,6 +68,26 @@ void qlist_append_obj(QList *qlist, QObject *value)
QTAILQ_INSERT_TAIL(&qlist->head, entry, next);
}
+void qlist_append_int(QList *qlist, int64_t value)
+{
+ qlist_append(qlist, qnum_from_int(value));
+}
+
+void qlist_append_bool(QList *qlist, bool value)
+{
+ qlist_append(qlist, qbool_from_bool(value));
+}
+
+void qlist_append_str(QList *qlist, const char *value)
+{
+ qlist_append(qlist, qstring_from_str(value));
+}
+
+void qlist_append_null(QList *qlist)
+{
+ qlist_append(qlist, qnull());
+}
+
/**
* qlist_iter(): Iterate over all the list's stored values.
*
diff --git a/qobject/qlit.c b/qobject/qlit.c
index dbf19225c8..c2d0303425 100644
--- a/qobject/qlit.c
+++ b/qobject/qlit.c
@@ -17,6 +17,7 @@
#include "qapi/qmp/qlit.h"
#include "qapi/qmp/qbool.h"
+#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
diff --git a/qobject/qobject.c b/qobject/qobject.c
index 9b61ece06b..5bbcd04812 100644
--- a/qobject/qobject.c
+++ b/qobject/qobject.c
@@ -10,6 +10,8 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qapi/qmp/qbool.h"
+#include "qapi/qmp/qnull.h"
+#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"