diff options
author | Adam NAILI | 2018-01-02 00:28:50 +0100 |
---|---|---|
committer | Adam NAILI | 2018-01-02 00:28:50 +0100 |
commit | 54dac24c8f7be833124a90bafdca78810fc0d96a (patch) | |
tree | 95384b073e18899a6e9d1ffd1715e36e46d6d592 /src/main.c | |
parent | 8a4d894e336752e37fa84fc55885a70e65db8c4a (diff) | |
download | morpher-54dac24c8f7be833124a90bafdca78810fc0d96a.tar.gz |
Implementing error handling + final GUI
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -1,4 +1,25 @@ | |||
1 | #include <stdlib.h> | ||
2 | #include <stdio.h> | ||
3 | #include <gui/gui.h> | ||
4 | #include <MLV/MLV_path.h> | ||
5 | |||
1 | int main(int argc, char **argv) { | 6 | int main(int argc, char **argv) { |
2 | // TODO! | 7 | if (argc < 3) { |
8 | fprintf(stderr, "Not enough argument (2 correct pathfiles required)\n"); | ||
9 | exit(-1); | ||
10 | } | ||
11 | if (argc > 3) { | ||
12 | fprintf(stderr, "Too much arguments (2 correct pathfiles required)\n"); | ||
13 | exit(-2); | ||
14 | } | ||
15 | if (!(MLV_path_is_a_file(argv[1])) || !(MLV_path_is_a_file(argv[2]))) { | ||
16 | fprintf(stderr, "One path is incorrect\n"); | ||
17 | exit(-3); | ||
18 | }; | ||
19 | GUI *gui = gui_init(argv[1], argv[2]); | ||
20 | while (mode != EXITING) { | ||
21 | gui_handle_event(gui); | ||
22 | } | ||
23 | gui_free(gui); | ||
3 | return 0; | 24 | return 0; |
4 | } | 25 | } |