X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FHash.h;h=d16f9ae9c1ba0b2de18bdb1161a3ad9ac2a7e41a;hb=f5edc6b0871a0debbc9a64f4cdb95c0dc35e5b16;hp=fb83fdfa9e087b4ad264f2e69b0566d2133c100e;hpb=220dec863e89103983698d253c6087d2f85c037f;p=ghc-hetmet.git diff --git a/rts/Hash.h b/rts/Hash.h index fb83fdf..d16f9ae 100644 --- a/rts/Hash.h +++ b/rts/Hash.h @@ -32,6 +32,13 @@ 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 *) );