aboutsummaryrefslogtreecommitdiff
path: root/miniDB/main.c
blob: f6ce5d0615364a15e29914d8eef3266a21ae9bf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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;
}