[pulseaudio-commits] src/pulsecore
Tanu Kaskinen
tanuk at kemper.freedesktop.org
Sun Sep 29 09:17:05 PDT 2013
src/pulsecore/hashmap.h | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit 0a5f3bfaf090e59dd0c3247eeff84f279782a3c8
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date: Fri Sep 20 17:27:32 2013 +0530
hashmap: Add a key+value iterator
diff --git a/src/pulsecore/hashmap.h b/src/pulsecore/hashmap.h
index ae030ed..e42732a 100644
--- a/src/pulsecore/hashmap.h
+++ b/src/pulsecore/hashmap.h
@@ -85,6 +85,10 @@ void* pa_hashmap_last(pa_hashmap *h);
#define PA_HASHMAP_FOREACH(e, h, state) \
for ((state) = NULL, (e) = pa_hashmap_iterate((h), &(state), NULL); (e); (e) = pa_hashmap_iterate((h), &(state), NULL))
+/* A macro to ease itration through all key, value pairs */
+#define PA_HASHMAP_FOREACH_KV(k, e, h, state) \
+ for ((state) = NULL, (e) = pa_hashmap_iterate((h), &(state), (const void **) &(k)); (e); (e) = pa_hashmap_iterate((h), &(state), (const void **) &(k)))
+
/* A macro to ease iteration through all entries, backwards */
#define PA_HASHMAP_FOREACH_BACKWARDS(e, h, state) \
for ((state) = NULL, (e) = pa_hashmap_iterate_backwards((h), &(state), NULL); (e); (e) = pa_hashmap_iterate_backwards((h), &(state), NULL))
More information about the pulseaudio-commits
mailing list