From 496be212ad645999647c432a856c906b86d41487 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 6 Jun 2009 15:30:24 +0200 Subject: hashmap: introduce PA_HASHMAP_FOREACH macro --- src/pulsecore/hashmap.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/pulsecore/hashmap.h') diff --git a/src/pulsecore/hashmap.h b/src/pulsecore/hashmap.h index 08e18ead..828e2448 100644 --- a/src/pulsecore/hashmap.h +++ b/src/pulsecore/hashmap.h @@ -65,4 +65,8 @@ void *pa_hashmap_steal_first(pa_hashmap *h); /* Return the oldest entry in the hashmap */ void* pa_hashmap_first(pa_hashmap *h); +/* A macro to ease iteration through all entries */ +#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)) + #endif -- cgit