summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorAdam NAILI2018-01-02 00:28:50 +0100
committerAdam NAILI2018-01-02 00:28:50 +0100
commit54dac24c8f7be833124a90bafdca78810fc0d96a (patch)
tree95384b073e18899a6e9d1ffd1715e36e46d6d592 /src/main.c
parent8a4d894e336752e37fa84fc55885a70e65db8c4a (diff)
downloadmorpher-54dac24c8f7be833124a90bafdca78810fc0d96a.tar.gz
Implementing error handling + final GUI
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index b5cd16d..a4ed06c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,4 +1,25 @@
1#include <stdlib.h>
2#include <stdio.h>
3#include <gui/gui.h>
4#include <MLV/MLV_path.h>
5
1int main(int argc, char **argv) { 6int 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}