mirror of https://github.com/xemu-project/xemu.git
Typedef the subtypes of QObject in qemu/typedefs.h, too
This renders many inclusions of qapi/qmp/q*.h superfluous. They'll be dropped in the next few commits. Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20180201111846.21846-8-armbru@redhat.com>
This commit is contained in:
parent
abb297ed44
commit
9f5c734d59
|
@ -16,10 +16,10 @@
|
||||||
|
|
||||||
#include "qapi/qmp/qobject.h"
|
#include "qapi/qmp/qobject.h"
|
||||||
|
|
||||||
typedef struct QBool {
|
struct QBool {
|
||||||
QObject base;
|
QObject base;
|
||||||
bool value;
|
bool value;
|
||||||
} QBool;
|
};
|
||||||
|
|
||||||
QBool *qbool_from_bool(bool value);
|
QBool *qbool_from_bool(bool value);
|
||||||
bool qbool_get_bool(const QBool *qb);
|
bool qbool_get_bool(const QBool *qb);
|
||||||
|
|
|
@ -27,11 +27,11 @@ typedef struct QDictEntry {
|
||||||
QLIST_ENTRY(QDictEntry) next;
|
QLIST_ENTRY(QDictEntry) next;
|
||||||
} QDictEntry;
|
} QDictEntry;
|
||||||
|
|
||||||
typedef struct QDict {
|
struct QDict {
|
||||||
QObject base;
|
QObject base;
|
||||||
size_t size;
|
size_t size;
|
||||||
QLIST_HEAD(,QDictEntry) table[QDICT_BUCKET_MAX];
|
QLIST_HEAD(,QDictEntry) table[QDICT_BUCKET_MAX];
|
||||||
} QDict;
|
};
|
||||||
|
|
||||||
/* Object API */
|
/* Object API */
|
||||||
QDict *qdict_new(void);
|
QDict *qdict_new(void);
|
||||||
|
|
|
@ -23,10 +23,10 @@ typedef struct QListEntry {
|
||||||
QTAILQ_ENTRY(QListEntry) next;
|
QTAILQ_ENTRY(QListEntry) next;
|
||||||
} QListEntry;
|
} QListEntry;
|
||||||
|
|
||||||
typedef struct QList {
|
struct QList {
|
||||||
QObject base;
|
QObject base;
|
||||||
QTAILQ_HEAD(,QListEntry) head;
|
QTAILQ_HEAD(,QListEntry) head;
|
||||||
} QList;
|
};
|
||||||
|
|
||||||
#define qlist_append(qlist, obj) \
|
#define qlist_append(qlist, obj) \
|
||||||
qlist_append_obj(qlist, QOBJECT(obj))
|
qlist_append_obj(qlist, QOBJECT(obj))
|
||||||
|
|
|
@ -44,7 +44,7 @@ typedef enum {
|
||||||
* in range: qnum_get_try_int() / qnum_get_try_uint() check range and
|
* in range: qnum_get_try_int() / qnum_get_try_uint() check range and
|
||||||
* convert under the hood.
|
* convert under the hood.
|
||||||
*/
|
*/
|
||||||
typedef struct QNum {
|
struct QNum {
|
||||||
QObject base;
|
QObject base;
|
||||||
QNumKind kind;
|
QNumKind kind;
|
||||||
union {
|
union {
|
||||||
|
@ -52,7 +52,7 @@ typedef struct QNum {
|
||||||
uint64_t u64;
|
uint64_t u64;
|
||||||
double dbl;
|
double dbl;
|
||||||
} u;
|
} u;
|
||||||
} QNum;
|
};
|
||||||
|
|
||||||
QNum *qnum_from_int(int64_t value);
|
QNum *qnum_from_int(int64_t value);
|
||||||
QNum *qnum_from_uint(uint64_t value);
|
QNum *qnum_from_uint(uint64_t value);
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
|
|
||||||
#include "qapi/qmp/qobject.h"
|
#include "qapi/qmp/qobject.h"
|
||||||
|
|
||||||
typedef struct QString {
|
struct QString {
|
||||||
QObject base;
|
QObject base;
|
||||||
char *string;
|
char *string;
|
||||||
size_t length;
|
size_t length;
|
||||||
size_t capacity;
|
size_t capacity;
|
||||||
} QString;
|
};
|
||||||
|
|
||||||
QString *qstring_new(void);
|
QString *qstring_new(void);
|
||||||
QString *qstring_from_str(const char *str);
|
QString *qstring_from_str(const char *str);
|
||||||
|
|
|
@ -96,8 +96,13 @@ typedef struct QemuSpin QemuSpin;
|
||||||
typedef struct QEMUSGList QEMUSGList;
|
typedef struct QEMUSGList QEMUSGList;
|
||||||
typedef struct QEMUTimer QEMUTimer;
|
typedef struct QEMUTimer QEMUTimer;
|
||||||
typedef struct QEMUTimerListGroup QEMUTimerListGroup;
|
typedef struct QEMUTimerListGroup QEMUTimerListGroup;
|
||||||
typedef struct QObject QObject;
|
typedef struct QBool QBool;
|
||||||
|
typedef struct QDict QDict;
|
||||||
|
typedef struct QList QList;
|
||||||
typedef struct QNull QNull;
|
typedef struct QNull QNull;
|
||||||
|
typedef struct QNum QNum;
|
||||||
|
typedef struct QObject QObject;
|
||||||
|
typedef struct QString QString;
|
||||||
typedef struct RAMBlock RAMBlock;
|
typedef struct RAMBlock RAMBlock;
|
||||||
typedef struct Range Range;
|
typedef struct Range Range;
|
||||||
typedef struct SerialState SerialState;
|
typedef struct SerialState SerialState;
|
||||||
|
|
Loading…
Reference in New Issue