include/qapi: add g_autoptr support for qobject types

Need wrappers for qobject_unref() calls, which is a macro.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220323155743.1585078-10-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Marc-André Lureau 2022-03-23 19:57:20 +04:00 committed by Paolo Bonzini
parent 7773e13fa7
commit d709bbf3b1
12 changed files with 54 additions and 0 deletions

View file

@ -20,6 +20,10 @@ struct QString {
const char *string;
};
void qstring_unref(QString *q);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(QString, qstring_unref)
QString *qstring_new(void);
QString *qstring_from_str(const char *str);
QString *qstring_from_substr(const char *str, size_t start, size_t end);