X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FHash.h;h=727c04298c8c05e75d259527c72620a5d59c9713;hb=0885017a4e92fe5710d1427c214adb87b92987e5;hp=fb83fdfa9e087b4ad264f2e69b0566d2133c100e;hpb=220dec863e89103983698d253c6087d2f85c037f;p=ghc-hetmet.git diff --git a/rts/Hash.h b/rts/Hash.h index fb83fdf..727c042 100644 --- a/rts/Hash.h +++ b/rts/Hash.h @@ -9,6 +9,8 @@ #ifndef HASH_H #define HASH_H +#include "BeginPrivate.h" + 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 ); +#include "EndPrivate.h" + #endif /* HASH_H */