projects
/
platform
/
upstream
/
pulseaudio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8753b8c
)
hashmap: Add a key+value iterator
author
Arun Raghavan
<arun.raghavan@collabora.co.uk>
Fri, 20 Sep 2013 11:57:32 +0000
(17:27 +0530)
committer
Tanu Kaskinen
<tanu.kaskinen@linux.intel.com>
Sun, 29 Sep 2013 16:15:39 +0000
(19:15 +0300)
src/pulsecore/hashmap.h
patch
|
blob
|
history
diff --git
a/src/pulsecore/hashmap.h
b/src/pulsecore/hashmap.h
index
ae030ed
..
e42732a
100644
(file)
--- 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))
#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))
/* 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))