aboutsummaryrefslogtreecommitdiff
path: root/miniDB/HashMap.h
diff options
context:
space:
mode:
authorHyder Hadi <hyder@hyderhadi.xyz>2026-06-09 16:33:38 +0300
committerHyder Hadi <hyder@hyderhadi.xyz>2026-06-09 16:33:38 +0300
commitd6b915a043f868611d49e814730ffc2f7c82a048 (patch)
treee7d6e687de0b40b30a5cadfc1bd35aa1b0c70a1f /miniDB/HashMap.h
parent5a6a3dd7c8f535721467248cf5f93f8e0ef1e633 (diff)
Made a simple miniDB during the governmental job XD
simple miniDB that has couple of commands, that uses my hashMap implementation to store (key,value) pairs.
Diffstat (limited to 'miniDB/HashMap.h')
-rw-r--r--miniDB/HashMap.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/miniDB/HashMap.h b/miniDB/HashMap.h
new file mode 100644
index 0000000..0698d3b
--- /dev/null
+++ b/miniDB/HashMap.h
@@ -0,0 +1,30 @@
+#ifndef HASHM_H
+#define HASHM_H
+
+struct hashTable {
+ int __count;
+ int __buckets;
+ struct Entry *__items;
+ int __tombs;
+
+ // public methods
+
+ void (*insert)(struct hashTable *self, const char *key, int value);
+ void (*dump)(struct hashTable *self);
+ struct Entry *(*find)(struct hashTable *self, const char *key);
+ void (*destructor)(struct hashTable *self);
+ void (*pop)(struct hashTable *self, const char *key);
+ float (*factor)(struct hashTable *self);
+};
+
+struct Entry {
+ int __value;
+ char *__key;
+ int __state;
+};
+
+char *read_line();
+int intger_input();
+struct hashTable *createTable();
+
+#endif \ No newline at end of file