It's just a Hash Table in C but with a nice Generic API.
#include<stdio.h>#defineHT_IMPLEMENTATION#include"ht.h"intmain(void)
{
Ht(constchar*, int) ht= {
.hasheq=ht_cstr_hasheq,
};
*ht_put(&ht, "foo") =69;
*ht_put(&ht, "bar") =420;
*ht_put(&ht, "baz") =1337;
ht_foreach(value, &ht) {
printf("%s => %d\n", ht_key(&ht, value), *value);
}
ht_free(&ht);
return0;
}