Fix some things that C++ doesn't like so we don't lose the possibility to use the...
[satune.git] / src / AST / table.c
1 #include "table.h"
2 #include "common.h"
3 #include "structs.h"
4 #include "tableentry.h"
5
6
7 Table * allocTable(Set **domains, uint numDomain, Set * range){
8     Table* table = (Table*) ourmalloc(sizeof(Table));
9     table->domains = allocDefVectorSet();
10     for(int i=0; i<numDomain; i++){
11         pushVectorSet(table->domains, domains[i]);
12     }
13     table->range =range;
14                 return table;
15 }
16
17 void addNewTableEntry(Table* table, uint64_t* inputs, uint inputSize, uint64_t result){
18     ASSERT(getSizeVectorSet( table->domains) == inputSize);
19     pushVectorTableEntry(table->entries, allocTableEntry(inputs, inputSize, result));
20 }
21