From dfa17b9f36f5741be05e144c15a8e89fceae9415 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 18 Aug 2006 19:43:46 +0000 Subject: cleanup hashmap.[ch] a little: use hash/compare func prototypes defined in idxset.h, add pa_hashmpa_{get,steal}_first git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1263 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/pulsecore/hashmap.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/pulsecore/hashmap.h') diff --git a/src/pulsecore/hashmap.h b/src/pulsecore/hashmap.h index 3f62adb1..b8a358ec 100644 --- a/src/pulsecore/hashmap.h +++ b/src/pulsecore/hashmap.h @@ -22,6 +22,8 @@ USA. ***/ +#include + /* Simple Implementation of a hash table. Memory management is the * user's job. It's a good idea to have the key pointer point to a * string in the value data. */ @@ -29,7 +31,7 @@ typedef struct pa_hashmap pa_hashmap; /* Create a new hashmap. Use the specified functions for hashing and comparing objects in the map */ -pa_hashmap *pa_hashmap_new(unsigned (*hash_func) (const void *p), int (*compare_func) (const void*a, const void*b)); +pa_hashmap *pa_hashmap_new(pa_hash_func_t hash_func, pa_compare_func_t compare_func); /* Free the hash table. Calls the specified function for every value in the table. The function may be NULL */ void pa_hashmap_free(pa_hashmap*, void (*free_func)(void *p, void *userdata), void *userdata); @@ -50,4 +52,8 @@ unsigned pa_hashmap_size(pa_hashmap *h); is returned. */ void *pa_hashmap_iterate(pa_hashmap *h, void **state, const void**key); +void *pa_hashmap_steal_first(pa_hashmap *h); + +void *pa_hashmap_get_first(pa_hashmap *h); + #endif -- cgit