X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FHash.h;h=c5eec3755299949dbb3cfd650def6b11875f52d5;hb=a5288c551349a0adab0d931a429b10a096d9444d;hp=ad55953da4c56198eb57cbe395f558371e355601;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/rts/Hash.h b/rts/Hash.h index ad55953..c5eec37 100644 --- a/rts/Hash.h +++ b/rts/Hash.h @@ -9,6 +9,8 @@ #ifndef HASH_H #define HASH_H +#pragma GCC visibility push(hidden) + 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 ); + +#pragma GCC visibility pop + #endif /* HASH_H */