#include "xxhash.h" #include #include #include #define HT_IMPLEMENTATIONS #define HTGEN__TEST_CONFIG #include "htgen.h" #include "nbt.h" #if 1 int main(int argc, char **argv) { shash_t *hash = shash_create(4, 0.75f); printf("%d\n", shash_put(hash, "test1", "value1")); printf("%d\n", shash_put(hash, "testbro", "val2")); shash__debug_table(hash); char *oldval = shash_pop(hash, "test1", NULL); printf("%s:%s\n", "test1", oldval); free(oldval); shash__debug_table(hash); printf("%d\n", shash_put(hash, "testbro", "val3")); shash__debug_table(hash); shash_free(hash); return 0; } #else int main(int argc, char **argv) { ihash_t *hash = ihash_create(8, 0.75f); printf("%d\n", ihash_put(hash, 1, 10)); ihash__debug_table(hash); printf("%d\n", ihash_put(hash, 5, 20)); printf("%d\n", ihash_put(hash, 3, 19)); printf("%d\n", ihash_put(hash, 56, 101)); ihash__debug_table(hash); printf("%d\n", ihash_put(hash, 90, 6)); printf("%d\n", ihash_put(hash, 2000, 1)); ihash__debug_table(hash); printf("%d\n", ihash_put(hash, 4, 2020)); ihash__debug_table(hash); ihash_free(hash); return 0; } #endif