From b8d0ee2e105727021f9466790ec07ecbfee8dff6 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Thu, 20 Jun 2024 17:23:01 +0100 Subject: string interning and print statement --- ht.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ht.h') diff --git a/ht.h b/ht.h index e0e6560..36a1d2a 100644 --- a/ht.h +++ b/ht.h @@ -17,10 +17,11 @@ typedef struct _ht { HtEntry *d; } Ht; -uint32_t hash(char *s, size_t len); +uint32_t hash_string(char *s, size_t len); Ht ht_new(); void ht_put(State *S, Ht *h, ObjString *k, Val v); Val ht_get(State *S, Ht *h, ObjString *k); +ObjString *ht_findstring(State *S, Ht *h, char *s, size_t len, uint32_t hash); #endif -- cgit v1.2.3