-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
59 lines (51 loc) · 960 Bytes
/
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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef UI
#define UI
#include "ui.h"
#endif
#ifndef DATAMNG
#define DATAMNG
#include "datamng.h"
#endif
#ifndef TSTAT
#define TSTAT
#include "tstat.h"
#endif
#ifndef TOPT
#include "topts.h"
#define TOPT
#endif
int main(int argc, char *argv[]){
if(argc==1){
printf("Missing command!\n");
exit(1);
}
//init
tlist *list;
if((list=floads("save1.list"))==NULL)
list = listinit();
argc--;
argv++;
if(strcmp("start",*argv)==0){
start(list,argc,argv);
}else if(strcmp("end",*argv)==0){
end(list,argc,argv);
}else if(strcmp("list",*argv)==0){
listall(list,argc,argv);
}else if(strcmp("statistic",*argv)==0){
statistic(list,argc,argv);
}else if(strcmp("help",*argv)==0||
strcmp("--help",*argv)==0||
strcmp("-h",*argv)==0){
help();
}else{
fprintf(stderr,"Unknown argument %s.\n",*argv);
help();
exit(1);
}
//end
fsave(list,"save1.list");
return 0;
}