X-Git-Url: http://plrg.eecs.uci.edu/git/?p=satune.git;a=blobdiff_plain;f=src%2Fstructs.h;h=da5f863de13f1297b9b08dbe8f62f07151eaa38b;hp=4229f7177683ebd8100f92a212b1c707ba94494f;hb=5a24361bea3bece3f1a7c8aed2740b6ead119183;hpb=27341bc75070b0eea154159c513c7751f1532121 diff --git a/src/structs.h b/src/structs.h index 4229f71..da5f863 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,8 +1,22 @@ #ifndef STRUCTS_H #define STRUCTS_H #include "vector.h" +#include "hashtable.h" +#include "hashset.h" #include "classlist.h" VectorDef(Int, uint64_t, 4); VectorDef(Boolean, Boolean *, 4); +VectorDef(Void, void *, 4); + +inline unsigned int Ptr_hash_function(void * hash) { + return (unsigned int)((uint64_t)hash >> 4); +} + +inline bool Ptr_equals(void * key1, void * key2) { + return key1 == key2; +} + +HashTableDef(Void, void *, void *, Ptr_hash_function, Ptr_equals); +HashSetDef(Void, void *, Ptr_hash_function, Ptr_equals); #endif