Implement two entry types and a function to store entries in table.

This commit is contained in:
2018-02-11 22:50:08 -08:00
parent 3de3f1ec00
commit 72be209f0f
2 changed files with 22 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
#include "table.h"
#include <stdlib.h>
#include "util.h"
void table_init(libab_table* table) {
ht_init(&table->table);
@@ -13,6 +14,9 @@ libab_table_entry* table_search(libab_table* table, const char* string) {
} while(table && to_return == NULL);
return to_return;
}
libab_result libab_table_put(libab_table* table, const char* string, libab_table_entry* entry) {
return libab_convert_ds_result(ht_put(&table->table, string, entry));
}
void table_free(libab_table* table) {
ht_free(&table->table);
}