aboutsummaryrefslogtreecommitdiff
path: root/miniDB/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'miniDB/main.c')
-rw-r--r--miniDB/main.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/miniDB/main.c b/miniDB/main.c
new file mode 100644
index 0000000..f6ce5d0
--- /dev/null
+++ b/miniDB/main.c
@@ -0,0 +1,28 @@
+#include "HashMap.h"
+#include "db_commands.h"
+#include <stdio.h>
+
+
+
+
+int main() {
+
+ struct hashTable *t1 = createTable();
+ FILE *fh = NULL;
+ printf("Enter a filename for the database, otherwise press ENTER: ");
+ char *fileName = read_line();
+ if(!fileName) {
+ fileName = "db.txt";
+ printf("Default name picked up: %s\n", fileName);
+ }
+
+
+ int exitState = -1;
+ while (db_commands(t1, fh, fileName) != exitState) {
+ printf("");
+ }
+
+ t1->destructor(t1);
+
+ return 0;
+}