aboutsummaryrefslogtreecommitdiff
path: root/qdict.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2010-06-07 16:53:51 -0300
committerLuiz Capitulino <lcapitulino@redhat.com>2010-07-01 14:27:13 -0300
commit0d078b2adec72fd74b00defb260724b33e87e184 (patch)
tree6a3378fa0aa66c9a5b40526897584eb9dbd175b3 /qdict.c
parentc8bc3cd72b4c530721d5be1bf9f599edb5d72160 (diff)
QDict: Introduce functions to retrieve QDictEntry values
Next commit will introduce a new QDict iteration API which returns QDictEntry entries, but we don't want users to directly access its members since QDictEntry should be private to QDict. In the near future this kind of data type will be turned into a forward reference. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'qdict.c')
-rw-r--r--qdict.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/qdict.c b/qdict.c
index 71be2ebcd8..c4677636e3 100644
--- a/qdict.c
+++ b/qdict.c
@@ -83,6 +83,27 @@ static QDictEntry *alloc_entry(const char *key, QObject *value)
}
/**
+ * qdict_entry_value(): Return qdict entry value
+ *
+ * Return weak reference.
+ */
+QObject *qdict_entry_value(const QDictEntry *entry)
+{
+ return entry->value;
+}
+
+/**
+ * qdict_entry_key(): Return qdict entry key
+ *
+ * Return a *pointer* to the string, it has to be duplicated before being
+ * stored.
+ */
+const char *qdict_entry_key(const QDictEntry *entry)
+{
+ return entry->key;
+}
+
+/**
* qdict_find(): List lookup function
*/
static QDictEntry *qdict_find(const QDict *qdict,