Fixed uninitialised FunBind fun_tick field
[ghc-hetmet.git] / rts / Hash.h
1 /*-----------------------------------------------------------------------------
2  *
3  * (c) The GHC Team, 1999
4  *
5  * Prototypes for Hash.c
6  *
7  * -------------------------------------------------------------------------- */
8
9 #ifndef HASH_H
10 #define HASH_H
11
12 typedef struct hashtable HashTable; /* abstract */
13
14 /* Hash table access where the keys are StgWords */
15 HashTable * allocHashTable    ( void );
16 void *      lookupHashTable ( HashTable *table, StgWord key );
17 void        insertHashTable ( HashTable *table, StgWord key, void *data );
18 void *      removeHashTable ( HashTable *table, StgWord key, void *data );
19
20 /* Hash table access where the keys are C strings (the strings are
21  * assumed to be allocated by the caller, and mustn't be deallocated
22  * until the corresponding hash table entry has been removed).
23  */
24 HashTable * allocStrHashTable ( void );
25
26 #define lookupStrHashTable(table, key)  \
27    (lookupHashTable(table, (StgWord)key))
28
29 #define insertStrHashTable(table, key, data)  \
30    (insertHashTable(table, (StgWord)key, data))
31
32 #define removeStrHashTable(table, key, data) \
33    (removeHashTable(table, (StgWord)key, data))
34
35 /* Freeing hash tables 
36  */
37 void freeHashTable ( HashTable *table, void (*freeDataFun)(void *) );
38
39 void exitHashTable ( void );
40
41 #endif /* HASH_H */
42