diff options
| author | ubq323 <ubq323@ubq323.website> | 2023-07-29 22:22:23 +0100 | 
|---|---|---|
| committer | ubq323 <ubq323@ubq323.website> | 2023-07-29 22:22:23 +0100 | 
| commit | c83618999227adb5e745f92205bd48e076e2d124 (patch) | |
| tree | ebd862d08180fb49bdec90b553b21c89c43467fb /ht.h | |
| parent | f9f7b92fdda17efe2dca455d6f641a424a97b2db (diff) | |
th
Diffstat (limited to 'ht.h')
| -rw-r--r-- | ht.h | 22 | 
1 files changed, 22 insertions, 0 deletions
@@ -0,0 +1,22 @@ +#ifndef _ht_h +#define _ht_h + +#define HT_SIZE 128 + +typedef struct { +	char *k; +	int v; +} HtEntry; + +typedef struct { +	int len; +	HtEntry b[HT_SIZE]; +} Ht; + +typedef Ht Env; + +Ht ht_new(); +void ht_put(Ht *h, char *k, int v); +int ht_get(Ht *h, char *k, int *v); + +#endif  | 
