Files
kvtable/src/main.c
T
2026-07-22 11:36:53 -07:00

28 lines
614 B
C

#include <stdio.h>
#include <kv.h>
int main(void)
{
kv_t *table = kv_init(1024);
printf("%p\n", table);
printf("%ld\n", table->capacity);
kv_put(table, "hello", "world");
kv_put(table, "hello", "people");
kv_put(table, "goodbye", "world");
// for (int i = 0; i < table->capacity; ++i)
// {
// if (table->entries[i].key)
// {
// printf("[%d] %s: %s\n", i, table->entries[i].key, table->entries[i].val);
// }
// }
char *val = kv_get(table, "hello");
char *val2 = kv_get(table, "goodbye");
char *val3 = kv_get(table, "fake");
printf("%s %s %s\n", val, val2, val3);
}