fixing some bugs ...
[satune.git] / src / Collections / structs.c
1 #include "structs.h"
2 #include "mymemory.h"
3 #include "boolean.h"
4
5 VectorImpl(Table, Table *, 4);
6 VectorImpl(Set, Set *, 4);
7 VectorImpl(Boolean, Boolean *, 4);
8 VectorImpl(Constraint, Constraint *, 4);
9 VectorImpl(Function, Function *, 4);
10 VectorImpl(Predicate, Predicate *, 4);
11 VectorImpl(Element, Element *, 4);
12 VectorImpl(Order, Order *, 4);
13 VectorImpl(TableEntry, TableEntry *, 4);
14 VectorImpl(ASTNode, ASTNode *, 4);
15 VectorImpl(Int, uint64_t, 4);
16
17 unsigned int BooleanOrder_hash_Function(BooleanOrder* This){
18         return ((This->first+This->second)*(This->first+This->second+1))/2 + This->second;
19 }
20
21 unsigned int BooleanOrder_equals(BooleanOrder* key1, BooleanOrder* key2){
22         return key1->first== key2->first && key1->second == key2->second;
23 }
24
25 HashTableImpl(BoolConst, BooleanOrder *, Constraint *, BooleanOrder_hash_Function, BooleanOrder_equals);