-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.C
53 lines (38 loc) · 752 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
#include <stdio.h>
#include "Logger.H"
#include "Kernel.H"
#include "App.H"
void PrintUsage(int argc, char** argv)
{
printf("\nFREC %s: a little Face RECognition program\n", FREC_VERSION);
printf("\nusage: %s Mode [logfile]\n", argv[0]);
PrintRunModes();
}
int main(int argc, char** argv)
{
if (argc != 2 && argc != 3)
{
PrintUsage(argc, argv);
return 0;
}
Kernel oKernel;
if (argc == 2)
LOGGER()->Init(stdout);
else
LOGGER()->Init(argv[2]);
App oApp;
oKernel.Init(&oApp);
int iMode = atoi(argv[1]);
if (oKernel.Run(iMode))
{
printf("Normal exit. mode=%d\n", iMode);
}
else
{
printf("Abnormal exit. mode=%d", iMode);
PrintRunModes();
}
oKernel.Cleanup();
Logger::CleanupLogger(LOGGER());
return 1;
}