xref: /openbmc/qemu/include/qapi/qmp/qnull.h (revision 1be5a765c08cee3a9587c8a8d3fc2ea247b13f9c)
184be629dSMax Reitz /*
284be629dSMax Reitz  * QNull
384be629dSMax Reitz  *
484be629dSMax Reitz  * Copyright (C) 2015 Red Hat, Inc.
584be629dSMax Reitz  *
684be629dSMax Reitz  * Authors:
784be629dSMax Reitz  *  Markus Armbruster <armbru@redhat.com>
884be629dSMax Reitz  *
984be629dSMax Reitz  * This work is licensed under the terms of the GNU LGPL, version 2.1
1084be629dSMax Reitz  * or later.  See the COPYING.LIB file in the top-level directory.
1184be629dSMax Reitz  */
1284be629dSMax Reitz 
1384be629dSMax Reitz #ifndef QNULL_H
1484be629dSMax Reitz #define QNULL_H
1584be629dSMax Reitz 
1684be629dSMax Reitz #include "qapi/qmp/qobject.h"
1784be629dSMax Reitz 
1884be629dSMax Reitz struct QNull {
193d3eacaeSMarc-André Lureau     struct QObjectBase_ base;
2084be629dSMax Reitz };
2184be629dSMax Reitz 
2284be629dSMax Reitz extern QNull qnull_;
2384be629dSMax Reitz 
qnull(void)2484be629dSMax Reitz static inline QNull *qnull(void)
2584be629dSMax Reitz {
26f5a74a5aSMarc-André Lureau     return qobject_ref(&qnull_);
2784be629dSMax Reitz }
2884be629dSMax Reitz 
29*d709bbf3SMarc-André Lureau void qnull_unref(QNull *q);
30*d709bbf3SMarc-André Lureau 
31*d709bbf3SMarc-André Lureau G_DEFINE_AUTOPTR_CLEANUP_FUNC(QNull, qnull_unref)
32*d709bbf3SMarc-André Lureau 
3384be629dSMax Reitz #endif /* QNULL_H */
34