libabacus/src/table.c

19 lines
437 B
C
Raw Normal View History

#include "table.h"
#include <stdlib.h>
void table_init(table* table) {
ht_init(&table->table);
table->parent = NULL;
}
2018-02-10 17:57:24 -08:00
table_entry* table_search(table* table, const char* string) {
void* to_return = NULL;
do {
to_return = ht_get(&table->table, string);
table = table->parent;
} while(table && to_return == NULL);
return to_return;
}
void table_free(table* table) {
ht_free(&table->table);
}