mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
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
This commit is contained in:
parent
8be0cf6007
commit
dfa17b9f36
2 changed files with 46 additions and 11 deletions
|
|
@ -22,6 +22,8 @@
|
|||
USA.
|
||||
***/
|
||||
|
||||
#include <pulsecore/idxset.h>
|
||||
|
||||
/* 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue