From f2e1750803240ec8b78ae126af0d54f7896ee11d Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Thu, 10 Dec 2009 17:15:54 -0200 Subject: QDict: Introduce qdict_get_qlist() A helper function to get a QList from a QDict. Signed-off-by: Luiz Capitulino Signed-off-by: Anthony Liguori --- qdict.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'qdict.c') diff --git a/qdict.c b/qdict.c index 45e08bec98..ef73265f49 100644 --- a/qdict.c +++ b/qdict.c @@ -203,6 +203,19 @@ int qdict_get_bool(const QDict *qdict, const char *key) return qbool_get_int(qobject_to_qbool(obj)); } +/** + * qdict_get_qlist(): Get the QList mapped by 'key' + * + * This function assumes that 'key' exists and it stores a + * QList object. + * + * Return QList mapped by 'key'. + */ +QList *qdict_get_qlist(const QDict *qdict, const char *key) +{ + return qobject_to_qlist(qdict_get_obj(qdict, key, QTYPE_QLIST)); +} + /** * qdict_get_str(): Get a pointer to the stored string mapped * by 'key' -- cgit v1.2.3