From ba5422d8ac64ca864dca168780a957a92f22a5d0 Mon Sep 17 00:00:00 2001 From: bpc2003 Date: Tue, 22 Apr 2025 16:45:36 -0400 Subject: Add utils.h and moved batch operations into their own files --- src/lib/utils.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/lib/utils.h (limited to 'src/lib/utils.h') diff --git a/src/lib/utils.h b/src/lib/utils.h new file mode 100644 index 0000000..64e2787 --- /dev/null +++ b/src/lib/utils.h @@ -0,0 +1,19 @@ +#ifndef UTILS_H +#define UTILS_H + +#include "mdb.h" + +// dellist: deletes the provided table +void dellist(tablist_t *list); + +/* hash: calculates the DJB2 hash of a string, + * and returns that mod TABLEN */ +int hash(char *str); + +// clone: clones and returns a pointer to int +int *clone(int n); + +// copytab: copys table src into table dst +tablist_t *copytab(tablist_t *dst, tablist_t *src); + +#endif -- cgit v1.2.3