diff options
author | ubq323 <ubq323@ubq323.website> | 2024-06-20 16:00:34 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-06-20 16:00:34 +0100 |
commit | 60b3369ab24f9bd2a4a6d638ab1b3013ebc29814 (patch) | |
tree | 3ff8ec7e95ef314266673b1b3d7bedb880a4a5b0 /ht.h | |
parent | 9ee73a8459eb2bb58adc29da02de312b7e4e7dca (diff) |
pass State *S everywhere
contains changes from a million years ago that i don't remember much about
Diffstat (limited to 'ht.h')
-rw-r--r-- | ht.h | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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 |