qapi/qnull: Add own header

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 20171114180128.17076-2-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
Max Reitz 2017-11-14 19:01:23 +01:00
parent 4096974e18
commit 84be629d55
8 changed files with 36 additions and 14 deletions

View File

@ -15,6 +15,7 @@
#include "qapi/qmp/qobject.h" #include "qapi/qmp/qobject.h"
#include "qapi/qmp/qlist.h" #include "qapi/qmp/qlist.h"
#include "qapi/qmp/qnull.h"
#include "qapi/qmp/qnum.h" #include "qapi/qmp/qnum.h"
#include "qemu/queue.h" #include "qemu/queue.h"

30
include/qapi/qmp/qnull.h Normal file
View File

@ -0,0 +1,30 @@
/*
* QNull
*
* Copyright (C) 2015 Red Hat, Inc.
*
* Authors:
* Markus Armbruster <armbru@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 QNULL_H
#define QNULL_H
#include "qapi/qmp/qobject.h"
struct QNull {
QObject base;
};
extern QNull qnull_;
static inline QNull *qnull(void)
{
QINCREF(&qnull_);
return &qnull_;
}
#endif /* QNULL_H */

View File

@ -93,16 +93,4 @@ static inline QType qobject_type(const QObject *obj)
return obj->type; return obj->type;
} }
struct QNull {
QObject base;
};
extern QNull qnull_;
static inline QNull *qnull(void)
{
QINCREF(&qnull_);
return &qnull_;
}
#endif /* QOBJECT_H */ #endif /* QOBJECT_H */

View File

@ -19,5 +19,6 @@
#include "qapi/qmp/qstring.h" #include "qapi/qmp/qstring.h"
#include "qapi/qmp/qdict.h" #include "qapi/qmp/qdict.h"
#include "qapi/qmp/qlist.h" #include "qapi/qmp/qlist.h"
#include "qapi/qmp/qnull.h"
#endif /* QAPI_QMP_TYPES_H */ #endif /* QAPI_QMP_TYPES_H */

View File

@ -12,6 +12,7 @@
#include "qapi/clone-visitor.h" #include "qapi/clone-visitor.h"
#include "qapi/visitor-impl.h" #include "qapi/visitor-impl.h"
#include "qapi/error.h" #include "qapi/error.h"
#include "qapi/qmp/qnull.h"
struct QapiCloneVisitor { struct QapiCloneVisitor {
Visitor visitor; Visitor visitor;

View File

@ -16,6 +16,7 @@
#include "qapi/string-input-visitor.h" #include "qapi/string-input-visitor.h"
#include "qapi/visitor-impl.h" #include "qapi/visitor-impl.h"
#include "qapi/qmp/qerror.h" #include "qapi/qmp/qerror.h"
#include "qapi/qmp/qnull.h"
#include "qemu/option.h" #include "qemu/option.h"
#include "qemu/queue.h" #include "qemu/queue.h"
#include "qemu/range.h" #include "qemu/range.h"

View File

@ -12,7 +12,7 @@
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qemu-common.h" #include "qemu-common.h"
#include "qapi/qmp/qobject.h" #include "qapi/qmp/qnull.h"
QNull qnull_ = { QNull qnull_ = {
.base = { .base = {

View File

@ -8,7 +8,7 @@
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qapi/qmp/qobject.h" #include "qapi/qmp/qnull.h"
#include "qemu-common.h" #include "qemu-common.h"
#include "qapi/qobject-input-visitor.h" #include "qapi/qobject-input-visitor.h"
#include "qapi/qobject-output-visitor.h" #include "qapi/qobject-output-visitor.h"