From bb0b105b83c0f4ee56b4c7e9a179606aee296aa9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 20 Jul 2004 01:07:06 +0000 Subject: sample cache work git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@98 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/hashmap.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'polyp/hashmap.c') diff --git a/polyp/hashmap.c b/polyp/hashmap.c index 2c7c92b5..51e3879b 100644 --- a/polyp/hashmap.c +++ b/polyp/hashmap.c @@ -168,3 +168,17 @@ int pa_hashmap_remove(struct pa_hashmap *h, const void *key) { unsigned pa_hashmap_ncontents(struct pa_hashmap *h) { return h->n_entries; } + +void *pa_hashmap_iterate(struct pa_hashmap *h, void **state) { + assert(h && state); + + if (!*state) { + *state = h->first_entry; + } else + *state = ((struct hashmap_entry*) *state)->next; + + if (!*state) + return NULL; + + return ((struct hashmap_entry*) *state)->value; +} -- cgit