Max Reitz | 84be629 | 2017-11-14 19:01:23 +0100 | [diff] [blame] | 1 | /* |
| 2 | * QNull |
| 3 | * |
| 4 | * Copyright (C) 2015 Red Hat, Inc. |
| 5 | * |
| 6 | * Authors: |
| 7 | * Markus Armbruster <armbru@redhat.com> |
| 8 | * |
| 9 | * This work is licensed under the terms of the GNU LGPL, version 2.1 |
| 10 | * or later. See the COPYING.LIB file in the top-level directory. |
| 11 | */ |
| 12 | |
| 13 | #ifndef QNULL_H |
| 14 | #define QNULL_H |
| 15 | |
| 16 | #include "qapi/qmp/qobject.h" |
| 17 | |
| 18 | struct QNull { |
Marc-André Lureau | 3d3eaca | 2018-04-19 17:01:42 +0200 | [diff] [blame] | 19 | struct QObjectBase_ base; |
Max Reitz | 84be629 | 2017-11-14 19:01:23 +0100 | [diff] [blame] | 20 | }; |
| 21 | |
| 22 | extern QNull qnull_; |
| 23 | |
| 24 | static inline QNull *qnull(void) |
| 25 | { |
Marc-André Lureau | f5a74a5 | 2018-04-19 17:01:44 +0200 | [diff] [blame] | 26 | return qobject_ref(&qnull_); |
Max Reitz | 84be629 | 2017-11-14 19:01:23 +0100 | [diff] [blame] | 27 | } |
| 28 | |
Marc-André Lureau | d709bbf | 2022-03-23 19:57:20 +0400 | [diff] [blame] | 29 | void qnull_unref(QNull *q); |
| 30 | |
| 31 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(QNull, qnull_unref) |
| 32 | |
Max Reitz | 84be629 | 2017-11-14 19:01:23 +0100 | [diff] [blame] | 33 | #endif /* QNULL_H */ |