Problemas com os relocs
[pspdecompiler.git] / hash.h
blobed86e6f63c275546481e931ead9bc945c7aa60af
1 #ifndef __HASH_H
2 #define __HASH_H
4 #include <stddef.h>
6 struct hashtable;
8 typedef unsigned int (*hashfunction) (void *key);
9 typedef int (*equalsfunction) (void *key1, void *key2, unsigned int hash);
10 typedef void (*traversefunction) (void *key, void *value, unsigned int hash, void *arg);
12 struct hashtable *hashtable_create (unsigned int size, hashfunction hashfn, equalsfunction eqfn);
13 void hashtable_free (struct hashtable *ht, traversefunction destroyfn, void *arg);
14 void hashtable_free_all (struct hashtable *ht);
16 unsigned int hashtable_count (struct hashtable *ht);
18 void hashtable_insert (struct hashtable *ht, void *key, void *value);
19 void hashtable_inserth (struct hashtable *ht, void *key, void *value, unsigned int hash);
20 void *hashtable_search (struct hashtable *ht, void *key, void **key_found);
21 void *hashtable_searchh (struct hashtable *ht, void *key, void **key_found, unsigned int hash);
22 int hashtable_haskey (struct hashtable *ht, void *key, void **key_found);
23 int hashtable_haskeyh (struct hashtable *ht, void *key, void **key_found, unsigned int hash);
24 void *hashtable_remove (struct hashtable *ht, void *key, void **key_found);
25 void *hashtable_removeh (struct hashtable *ht, void *key, void **key_found, unsigned int hash);
27 void hashtable_traverse (struct hashtable *ht, traversefunction traversefn, void *arg);
29 int hashtable_string_compare (void *key1, void *key2, unsigned int hash);
30 int hashtable_pointer_compare (void *key1, void *key2, unsigned int hash);
32 unsigned int hashtable_hash_bytes (unsigned char *key, size_t len);
33 unsigned int hashtable_hash_string (void *key);
35 #endif /* __HASH_H */