aboutsummaryrefslogtreecommitdiff
path: root/hash.h
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-07-27 12:41:50 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-07-27 12:41:50 -0400
commite0e828e2c2f2032d1c9616950d0208f2aab6fcb8 (patch)
tree8be0532e66d6e2f03d7eaa0efca9700b1bf71386 /hash.h
parent596bc33348e2daa5af8a0168f015e850aeccf0fc (diff)
Add basic scopes
Diffstat (limited to 'hash.h')
-rw-r--r--hash.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/hash.h b/hash.h
new file mode 100644
index 0000000..8a8cdb1
--- /dev/null
+++ b/hash.h
@@ -0,0 +1,27 @@
+#ifndef SCOPE_H
+#define SCOPE_H
+
+#define HASH_SIZE 211
+
+typedef struct hash {
+ node* table[HASH_SIZE];
+ struct hash *prev, *next;
+ char function_boundry;
+} scope;
+
+scope* mkscope(scope*);
+void free_scope(scope*);
+
+/*stack routines*/
+scope* pop_scope(scope*);
+scope* push_scope(scope*);
+
+/*helpers*/
+node* scope_insert(scope*, char*);
+node* scope_search_all(scope*, char*);
+node* scope_search(scope*, char*);
+node* scope_safe_search_all(scope*, char*);
+
+/*hash function*/
+int hash_pwj(char*);
+#endif