Implement two entry types and a function to store entries in table.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user