-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
74 lines (62 loc) · 1.44 KB
/
main.c
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
## ## #### ## ## ########
### ### ## ### ## ##
#### #### ## #### ## ##
## ### ## ## ## ## ## ##
## ## ## ## #### ##
## ## ## ## ### ##
## ## #### ## ## ##
an interpreter written in C
[+]Author : Naper
[+]Web site : www.naper.eu
[+]Web site : mpp-project.org
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include "Headers/memoire.h"
#include "Headers/erreur.h"
int ini_cmd(int argc, char **argv){
int i;
while (1) {
char c;
c = getopt (argc, argv, "xhi:");
if (c == -1) {
break;
}
switch (c) {
case 'i':
read_file(argv[2]);
break;
case 'h':
help();
break;
case '?':
default:
printf ("Usage: %s [-i] <filename.m++>.\n", argv[0]);
}
}
return -1;
}
int help(){
printf("========================== \n");
printf(" MINT \n");
printf("========================== \n");
printf("syntaxe : mint -i <file.m++> \n");
return -1;
}
int main(int argc, char **argv){
memoire * m;
if (argc < 2 ){
printf("[Error]: Mint need arguments , -h for help \n");
return -1;
}
ini_cmd(argc, argv);
//m = InitMemoire(2, 3);
//AfficheMemoire(m->tabmem, 1, 4);
EcrireNombre(m->tabmem,8,5);
//FreeMemoire(m);
return 0;
}