[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/8] qlit: qlit_type() function
From: |
Eduardo Habkost |
Subject: |
[PATCH 6/8] qlit: qlit_type() function |
Date: |
Mon, 9 Nov 2020 16:25:54 -0500 |
Useful function where we need to check for the qlit type before
converting it to an actual QObject.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
include/qapi/qmp/qlit.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/qapi/qmp/qlit.h b/include/qapi/qmp/qlit.h
index f9e356d31e..acddb80831 100644
--- a/include/qapi/qmp/qlit.h
+++ b/include/qapi/qmp/qlit.h
@@ -59,4 +59,9 @@ bool qlit_equal_qobject(const QLitObject *lhs, const QObject
*rhs);
QObject *qobject_from_qlit(const QLitObject *qlit);
+static inline QType qlit_type(const QLitObject *qlit)
+{
+ return qlit->type;
+}
+
#endif /* QLIT_H */
--
2.28.0
- [PATCH 0/8] qom: Use qlit to represent property defaults, Eduardo Habkost, 2020/11/09
- [PATCH 2/8] qnum: Make qnum_get_double() get const pointer, Eduardo Habkost, 2020/11/09
- [PATCH 1/8] qobject: Include API docs in docs/devel/qobject.html, Eduardo Habkost, 2020/11/09
- [PATCH 4/8] qnum: qnum_value_is_equal() function, Eduardo Habkost, 2020/11/09
- [PATCH 5/8] qlit: Support all types of QNums, Eduardo Habkost, 2020/11/09
- [PATCH 6/8] qlit: qlit_type() function,
Eduardo Habkost <=
- [PATCH 8/8] qom: Use qlit to represent property defaults, Eduardo Habkost, 2020/11/09
- [PATCH 3/8] qnum: QNumValue type for QNum value literals, Eduardo Habkost, 2020/11/09
- [PATCH 7/8] qom: Make object_property_set_default() public, Eduardo Habkost, 2020/11/09
- Re: [PATCH 0/8] qom: Use qlit to represent property defaults, no-reply, 2020/11/09
- Re: [PATCH 0/8] qom: Use qlit to represent property defaults, Paolo Bonzini, 2020/11/10