From 062bd8269c6b1ce9ba3279f36fe37d0a570c9e73 Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Tue, 30 Jan 2024 23:27:28 -0600 Subject: initial commit --- src/libmain.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/libmain.c (limited to 'src/libmain.c') diff --git a/src/libmain.c b/src/libmain.c new file mode 100644 index 0000000..eca383a --- /dev/null +++ b/src/libmain.c @@ -0,0 +1,28 @@ +#include "xxhash.h" +#include + +#include +#include + +#define HT_IMPLEMENTATIONS +#include "htgen.h" + +int main(int argc, char **argv) { + shash_t *hash = shash_create(8, 0.75f); + printf("%d\n", shash_put(hash, "test1", "test2")); + printf("%d\n", shash_put(hash, "abc", "def")); + printf("%d\n", shash_put(hash, "amingus", "val")); + printf("%d\n", shash_put(hash, "afungus", "val2")); + printf("%d\n", shash_put(hash, "abungus", "val3")); + printf("%d\n", shash_put(hash, "lethalbumpany", "crewmate_sus")); + printf("%d\n", shash_put(hash, "uuuu", "something")); + printf("%d\n", shash_put(hash, "99asdas", "please collide >:O")); + + bool found = false; + char *val = shash_getn(hash, "99asdas", 0, &found); + printf("%s %d\n", val ? val : "(null)", found); + + shash__debug_table(hash); + + return 0; +} -- cgit v1.2.3-70-g09d2