Fix warnings, merge, and check my code in
[satune.git] / src / Collections / structs.h
1 #ifndef STRUCTS_H
2 #define STRUCTS_H
3 #include "vector.h"
4 #include "hashtable.h"
5 #include "hashset.h"
6 #include "classlist.h"
7
8 VectorDef(Int, uint64_t, 4);
9 VectorDef(Void, void *, 4);
10 VectorDef(Boolean, Boolean *, 4);
11 VectorDef(Constraint, Constraint *, 4);
12 VectorDef(Set, Set *, 4);
13 VectorDef(Element, Element *, 4);
14 VectorDef(TableEntry, TableEntry *, 4);
15 VectorDef(Predicate, Predicate *, 4);
16 VectorDef(Table, Table *, 4);
17 VectorDef(Order, Order *, 4);
18 VectorDef(Function, Function *, 4);
19
20 inline unsigned int Ptr_hash_function(void * hash) {
21         return (unsigned int)((uint64_t)hash >> 4);
22 }
23
24 inline bool Ptr_equals(void * key1, void * key2) {
25         return key1 == key2;
26 }
27
28 HashTableDef(Void, void *, void *, Ptr_hash_function, Ptr_equals);
29 HashSetDef(Void, void *, Ptr_hash_function, Ptr_equals);
30 #endif