X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FHash.h;h=727c04298c8c05e75d259527c72620a5d59c9713;hb=fff1f6194c3c39de53cd645bda9865fb131b1c68;hp=ad55953da4c56198eb57cbe395f558371e355601;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/rts/Hash.h b/rts/Hash.h index ad55953..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,9 +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 */