summaryrefslogtreecommitdiff
path: root/src/ht.h
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2022-01-31 09:23:20 +0800
committerJSDurand <mmemmew@gmail.com>2022-01-31 09:23:20 +0800
commita8bd5e9d85ac9928bd29add82e887f82642af893 (patch)
tree74e377f9fccffc2779ff97fa0bd8ad180b9c865c /src/ht.h
parente555c88b8107caf886da229444c2bed1aaef6c2c (diff)
test/check_cnp: working algorithm
I now have a working algorithm in test/check_cnp. It can correctly parse the grammar for an esoteric language called "Brainfuck". This language does not matter. What matters is that it contains parentheses. So this shows that at least for grammars as complex as parentheses, this parser works well. Haha.
Diffstat (limited to 'src/ht.h')
-rw-r--r--src/ht.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ht.h b/src/ht.h
index 4ac0c5d..65ae747 100644
--- a/src/ht.h
+++ b/src/ht.h
@@ -27,6 +27,11 @@ typedef BOOL (*compare_func_t)
(CCR_MOD(void *)keya, CCR_MOD(void *)keyb);
/* FIXME: Hide this struct from the header file. */
+/* WARNING: Don't use these fields directly. These fields are exposed
+ in this header file simply because I want to use pointers to ht and
+ do arithmetic on those pointers. But these fields might change
+ anytime in the future, if I think of some new ideas, or something
+ like that. */
struct ht_s {
void **keys;
void **values;
@@ -106,6 +111,8 @@ typedef enum HT_DELETE_FLAG_e HT_DELETE_FLAG;
BOOL ht_delete(ht * const restrict htp, void *key,
HT_DELETE_FLAG flag);
+void ht_reset(ht * const restrict htp, HT_DELETE_FLAG flag);
+
P_ATTR void *ht_find(CCR_MOD(ht *) htp, void *key);
/* Pairing hash tables */