X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FHash.h;h=1099b8f334a833c8f9f5a013bed446f0e3f04390;hb=0a5613f40b0e32cf59966e6b56b807cdbe80aa7b;hp=fb83fdfa9e087b4ad264f2e69b0566d2133c100e;hpb=220dec863e89103983698d253c6087d2f85c037f;p=ghc-hetmet.git diff --git a/rts/Hash.h b/rts/Hash.h index fb83fdf..1099b8f 100644 --- a/rts/Hash.h +++ b/rts/Hash.h @@ -9,6 +9,8 @@ #ifndef HASH_H #define HASH_H +BEGIN_RTS_PRIVATE + typedef struct hashtable HashTable; /* abstract */ /* Hash table access where the keys are StgWords */ @@ -32,11 +34,20 @@ HashTable * allocStrHashTable ( void ); #define removeStrHashTable(table, key, data) \ (removeHashTable(table, (StgWord)key, data)) +/* Hash tables for arbitrary keys */ +typedef int HashFunction(HashTable *table, StgWord key); +typedef int CompareFunction(StgWord key1, StgWord key2); +HashTable * allocHashTable_(HashFunction *hash, CompareFunction *compare); +int hashWord(HashTable *table, StgWord key); +int hashStr(HashTable *table, char *key); + /* Freeing hash tables */ void freeHashTable ( HashTable *table, void (*freeDataFun)(void *) ); void exitHashTable ( void ); +END_RTS_PRIVATE + #endif /* HASH_H */