From 60b3369ab24f9bd2a4a6d638ab1b3013ebc29814 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Thu, 20 Jun 2024 16:00:34 +0100 Subject: pass State *S everywhere contains changes from a million years ago that i don't remember much about --- ht.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ht.h') diff --git a/ht.h b/ht.h index 65e9012..e0e6560 100644 --- a/ht.h +++ b/ht.h @@ -1,6 +1,9 @@ #ifndef _ht_h #define _ht_h +typedef struct _ht Ht; +typedef struct _state State; + #include "val.h" typedef struct { @@ -8,16 +11,16 @@ typedef struct { Val v; } HtEntry; -typedef struct { +typedef struct _ht { size_t len; size_t cap; - HtEntry *b; + HtEntry *d; } Ht; uint32_t hash(char *s, size_t len); Ht ht_new(); -void ht_put(Ht *h, ObjString *k, Val v); -Val ht_get(Ht *h, ObjString *k); +void ht_put(State *S, Ht *h, ObjString *k, Val v); +Val ht_get(State *S, Ht *h, ObjString *k); #endif -- cgit v1.2.3