blob: 7feb7c7d830d9e39022530f78775a5df2b27a8ff [file] [log] [blame]
Max Reitz84be6292017-11-14 19:01:23 +01001/*
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
18struct QNull {
Marc-André Lureau3d3eaca2018-04-19 17:01:42 +020019 struct QObjectBase_ base;
Max Reitz84be6292017-11-14 19:01:23 +010020};
21
22extern QNull qnull_;
23
24static inline QNull *qnull(void)
25{
Marc-André Lureauf5a74a52018-04-19 17:01:44 +020026 return qobject_ref(&qnull_);
Max Reitz84be6292017-11-14 19:01:23 +010027}
28
Marc-André Lureaud709bbf2022-03-23 19:57:20 +040029void qnull_unref(QNull *q);
30
31G_DEFINE_AUTOPTR_CLEANUP_FUNC(QNull, qnull_unref)
32
Max Reitz84be6292017-11-14 19:01:23 +010033#endif /* QNULL_H */