diff options
Diffstat (limited to 'include/qapi')
-rw-r--r-- | include/qapi/clone-visitor.h | 1 | ||||
-rw-r--r-- | include/qapi/opts-visitor.h | 1 | ||||
-rw-r--r-- | include/qapi/qmp-event.h | 1 | ||||
-rw-r--r-- | include/qapi/qmp/dispatch.h | 3 | ||||
-rw-r--r-- | include/qapi/qmp/json-parser.h | 1 | ||||
-rw-r--r-- | include/qapi/qmp/qbool.h | 4 | ||||
-rw-r--r-- | include/qapi/qmp/qdict.h | 21 | ||||
-rw-r--r-- | include/qapi/qmp/qjson.h | 3 | ||||
-rw-r--r-- | include/qapi/qmp/qlist.h | 19 | ||||
-rw-r--r-- | include/qapi/qmp/qlit.h | 1 | ||||
-rw-r--r-- | include/qapi/qmp/qnum.h | 4 | ||||
-rw-r--r-- | include/qapi/qmp/qstring.h | 4 | ||||
-rw-r--r-- | include/qapi/qmp/types.h | 24 | ||||
-rw-r--r-- | include/qapi/qobject-input-visitor.h | 1 | ||||
-rw-r--r-- | include/qapi/qobject-output-visitor.h | 1 | ||||
-rw-r--r-- | include/qapi/visitor.h | 2 |
16 files changed, 20 insertions, 71 deletions
diff --git a/include/qapi/clone-visitor.h b/include/qapi/clone-visitor.h index a4915c7d57..b119d3daa9 100644 --- a/include/qapi/clone-visitor.h +++ b/include/qapi/clone-visitor.h @@ -11,7 +11,6 @@ #ifndef QAPI_CLONE_VISITOR_H #define QAPI_CLONE_VISITOR_H -#include "qemu/typedefs.h" #include "qapi/visitor.h" #include "qapi-visit.h" diff --git a/include/qapi/opts-visitor.h b/include/qapi/opts-visitor.h index 6462c96c29..9b989e7e08 100644 --- a/include/qapi/opts-visitor.h +++ b/include/qapi/opts-visitor.h @@ -14,7 +14,6 @@ #define OPTS_VISITOR_H #include "qapi/visitor.h" -#include "qemu/option.h" /* Inclusive upper bound on the size of any flattened range. This is a safety * (= anti-annoyance) measure; wrong ranges should not cause long startup diff --git a/include/qapi/qmp-event.h b/include/qapi/qmp-event.h index 40fe3cbc12..0c87ad833e 100644 --- a/include/qapi/qmp-event.h +++ b/include/qapi/qmp-event.h @@ -14,7 +14,6 @@ #ifndef QMP_EVENT_H #define QMP_EVENT_H -#include "qapi/qmp/qdict.h" typedef void (*QMPEventFuncEmit)(unsigned event, QDict *dict, Error **errp); diff --git a/include/qapi/qmp/dispatch.h b/include/qapi/qmp/dispatch.h index 20578dcd48..1e694b5ecf 100644 --- a/include/qapi/qmp/dispatch.h +++ b/include/qapi/qmp/dispatch.h @@ -14,8 +14,7 @@ #ifndef QAPI_QMP_DISPATCH_H #define QAPI_QMP_DISPATCH_H -#include "qapi/qmp/qobject.h" -#include "qapi/qmp/qdict.h" +#include "qemu/queue.h" typedef void (QmpCommandFunc)(QDict *, QObject **, Error **); diff --git a/include/qapi/qmp/json-parser.h b/include/qapi/qmp/json-parser.h index 9987f8ca85..102f5c0068 100644 --- a/include/qapi/qmp/json-parser.h +++ b/include/qapi/qmp/json-parser.h @@ -15,7 +15,6 @@ #define QEMU_JSON_PARSER_H #include "qemu-common.h" -#include "qapi/qmp/qlist.h" QObject *json_parser_parse(GQueue *tokens, va_list *ap); QObject *json_parser_parse_err(GQueue *tokens, va_list *ap, Error **errp); diff --git a/include/qapi/qmp/qbool.h b/include/qapi/qmp/qbool.h index f77ea86c4e..629c508d34 100644 --- a/include/qapi/qmp/qbool.h +++ b/include/qapi/qmp/qbool.h @@ -16,10 +16,10 @@ #include "qapi/qmp/qobject.h" -typedef struct QBool { +struct QBool { QObject base; bool value; -} QBool; +}; QBool *qbool_from_bool(bool value); bool qbool_get_bool(const QBool *qb); diff --git a/include/qapi/qmp/qdict.h b/include/qapi/qmp/qdict.h index fc218e7be6..ff6f7842c3 100644 --- a/include/qapi/qmp/qdict.h +++ b/include/qapi/qmp/qdict.h @@ -14,9 +14,6 @@ #define QDICT_H #include "qapi/qmp/qobject.h" -#include "qapi/qmp/qlist.h" -#include "qapi/qmp/qnull.h" -#include "qapi/qmp/qnum.h" #include "qemu/queue.h" #define QDICT_BUCKET_MAX 512 @@ -27,11 +24,11 @@ typedef struct QDictEntry { QLIST_ENTRY(QDictEntry) next; } QDictEntry; -typedef struct QDict { +struct QDict { QObject base; size_t size; QLIST_HEAD(,QDictEntry) table[QDICT_BUCKET_MAX]; -} QDict; +}; /* Object API */ QDict *qdict_new(void); @@ -55,17 +52,11 @@ void qdict_destroy_obj(QObject *obj); #define qdict_put(qdict, key, obj) \ qdict_put_obj(qdict, key, QOBJECT(obj)) -/* Helpers for int, bool, null, and string */ -#define qdict_put_int(qdict, key, value) \ - qdict_put(qdict, key, qnum_from_int(value)) -#define qdict_put_bool(qdict, key, value) \ - qdict_put(qdict, key, qbool_from_bool(value)) -#define qdict_put_str(qdict, key, value) \ - qdict_put(qdict, key, qstring_from_str(value)) -#define qdict_put_null(qdict, key) \ - qdict_put(qdict, key, qnull()) +void qdict_put_bool(QDict *qdict, const char *key, bool value); +void qdict_put_int(QDict *qdict, const char *key, int64_t value); +void qdict_put_null(QDict *qdict, const char *key); +void qdict_put_str(QDict *qdict, const char *key, const char *value); -/* High level helpers */ double qdict_get_double(const QDict *qdict, const char *key); int64_t qdict_get_int(const QDict *qdict, const char *key); bool qdict_get_bool(const QDict *qdict, const char *key); diff --git a/include/qapi/qmp/qjson.h b/include/qapi/qmp/qjson.h index 6e84082d5f..b274ac3a86 100644 --- a/include/qapi/qmp/qjson.h +++ b/include/qapi/qmp/qjson.h @@ -14,9 +14,6 @@ #ifndef QJSON_H #define QJSON_H -#include "qapi/qmp/qobject.h" -#include "qapi/qmp/qstring.h" - QObject *qobject_from_json(const char *string, Error **errp); QObject *qobject_from_jsonf(const char *string, ...) GCC_FMT_ATTR(1, 2); QObject *qobject_from_jsonv(const char *string, va_list *ap, Error **errp) diff --git a/include/qapi/qmp/qlist.h b/include/qapi/qmp/qlist.h index ec3fcc1a4c..5fd976a398 100644 --- a/include/qapi/qmp/qlist.h +++ b/include/qapi/qmp/qlist.h @@ -14,8 +14,6 @@ #define QLIST_H #include "qapi/qmp/qobject.h" -#include "qapi/qmp/qnum.h" -#include "qapi/qmp/qnull.h" #include "qemu/queue.h" typedef struct QListEntry { @@ -23,23 +21,18 @@ typedef struct QListEntry { QTAILQ_ENTRY(QListEntry) next; } QListEntry; -typedef struct QList { +struct QList { QObject base; QTAILQ_HEAD(,QListEntry) head; -} QList; +}; #define qlist_append(qlist, obj) \ qlist_append_obj(qlist, QOBJECT(obj)) -/* Helpers for int, bool, and string */ -#define qlist_append_int(qlist, value) \ - qlist_append(qlist, qnum_from_int(value)) -#define qlist_append_bool(qlist, value) \ - qlist_append(qlist, qbool_from_bool(value)) -#define qlist_append_str(qlist, value) \ - qlist_append(qlist, qstring_from_str(value)) -#define qlist_append_null(qlist) \ - qlist_append(qlist, qnull()) +void qlist_append_bool(QList *qlist, bool value); +void qlist_append_int(QList *qlist, int64_t value); +void qlist_append_null(QList *qlist); +void qlist_append_str(QList *qlist, const char *value); #define QLIST_FOREACH_ENTRY(qlist, var) \ for ((var) = ((qlist)->head.tqh_first); \ diff --git a/include/qapi/qmp/qlit.h b/include/qapi/qmp/qlit.h index b18406bce9..56f9d97bd9 100644 --- a/include/qapi/qmp/qlit.h +++ b/include/qapi/qmp/qlit.h @@ -14,7 +14,6 @@ #ifndef QLIT_H #define QLIT_H -#include "qapi-types.h" #include "qobject.h" typedef struct QLitDictEntry QLitDictEntry; diff --git a/include/qapi/qmp/qnum.h b/include/qapi/qmp/qnum.h index c3d86794bb..15e3971c7f 100644 --- a/include/qapi/qmp/qnum.h +++ b/include/qapi/qmp/qnum.h @@ -44,7 +44,7 @@ typedef enum { * in range: qnum_get_try_int() / qnum_get_try_uint() check range and * convert under the hood. */ -typedef struct QNum { +struct QNum { QObject base; QNumKind kind; union { @@ -52,7 +52,7 @@ typedef struct QNum { uint64_t u64; double dbl; } u; -} QNum; +}; QNum *qnum_from_int(int64_t value); QNum *qnum_from_uint(uint64_t value); diff --git a/include/qapi/qmp/qstring.h b/include/qapi/qmp/qstring.h index 65c05a9be5..98070ef3d6 100644 --- a/include/qapi/qmp/qstring.h +++ b/include/qapi/qmp/qstring.h @@ -15,12 +15,12 @@ #include "qapi/qmp/qobject.h" -typedef struct QString { +struct QString { QObject base; char *string; size_t length; size_t capacity; -} QString; +}; QString *qstring_new(void); QString *qstring_from_str(const char *str); diff --git a/include/qapi/qmp/types.h b/include/qapi/qmp/types.h deleted file mode 100644 index 749ac44dcb..0000000000 --- a/include/qapi/qmp/types.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Include all QEMU objects. - * - * Copyright (C) 2009 Red Hat Inc. - * - * Authors: - * Luiz Capitulino <lcapitulino@redhat.com> - * - * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. - * See the COPYING.LIB file in the top-level directory. - */ - -#ifndef QAPI_QMP_TYPES_H -#define QAPI_QMP_TYPES_H - -#include "qapi/qmp/qobject.h" -#include "qapi/qmp/qnum.h" -#include "qapi/qmp/qbool.h" -#include "qapi/qmp/qstring.h" -#include "qapi/qmp/qdict.h" -#include "qapi/qmp/qlist.h" -#include "qapi/qmp/qnull.h" - -#endif /* QAPI_QMP_TYPES_H */ diff --git a/include/qapi/qobject-input-visitor.h b/include/qapi/qobject-input-visitor.h index daee18c6ac..95985e25e5 100644 --- a/include/qapi/qobject-input-visitor.h +++ b/include/qapi/qobject-input-visitor.h @@ -16,7 +16,6 @@ #define QOBJECT_INPUT_VISITOR_H #include "qapi/visitor.h" -#include "qapi/qmp/qobject.h" typedef struct QObjectInputVisitor QObjectInputVisitor; diff --git a/include/qapi/qobject-output-visitor.h b/include/qapi/qobject-output-visitor.h index e5a3490812..2b1726baf5 100644 --- a/include/qapi/qobject-output-visitor.h +++ b/include/qapi/qobject-output-visitor.h @@ -15,7 +15,6 @@ #define QOBJECT_OUTPUT_VISITOR_H #include "qapi/visitor.h" -#include "qapi/qmp/qobject.h" typedef struct QObjectOutputVisitor QObjectOutputVisitor; diff --git a/include/qapi/visitor.h b/include/qapi/visitor.h index 62a51a54cb..ecff296c11 100644 --- a/include/qapi/visitor.h +++ b/include/qapi/visitor.h @@ -15,7 +15,7 @@ #ifndef QAPI_VISITOR_H #define QAPI_VISITOR_H -#include "qapi/qmp/qobject.h" +#include "qapi-types.h" /* * The QAPI schema defines both a set of C data types, and a QMP wire |