-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathstrMain.cpp
66 lines (55 loc) · 1.25 KB
/
strMain.cpp
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
#include "strTheory.h"
std::string inputFile;
int main(int argc, char ** argv)
{
logFile = NULL;
std::string primStr;
inputFile = std::string("");
int c;
#ifdef DEBUGLOG
logFile = fopen("log", "w");
#endif
static struct option long_options[] =
{
{ "input", required_argument, 0, 'f' },
{ "help", no_argument, 0, 'h' },
{ "allowloopcut", no_argument, 0, 'p' },
{ 0, 0, 0, 0 }
};
while (1)
{
int option_index = 0;
c = getopt_long(argc, argv, "hpf:l:", long_options, &option_index);
if (c == -1)
break;
switch (c)
{
case 'f':
{
inputFile = std::string(optarg);
break;
}
case 'p':
{
// Allow loop cut
// May not terminate on some input
avoidLoopCut = false;
break;
}
case 'h':
{
break;
}
default:
exit(0);
}
}
#ifdef DEBUGLOG
__debugPrint(logFile, "Input file: %s\n\n", inputFile.c_str());
#endif
pa_theory_example();
#ifdef DEBUGLOG
fclose(logFile);
#endif
return 0;
}