-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
67 lines (57 loc) · 1.11 KB
/
Copy pathmain.cpp
File metadata and controls
67 lines (57 loc) · 1.11 KB
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
#include <iostream>
#include <cstdlib>
#include <cassert>
#ifdef __cplusplus
extern "C" {
#endif
#include <getopt.h>
#ifdef __cplusplus
}
#endif
#include "rfc.h"
#include "config.h"
using namespace std;
/*
* Usage: main qualcomm_file_name generated_file_name
* */
static void usage(void)
{
cerr<<"Usage: main qualcomm_file_name generated_file_name"<<endl;
cerr<<"Please report any bugs to "<<PACKAGE_BUGREPORT<<endl;
exit(-1);
}
struct option long_options[] = {
{"version", 0, NULL, 'v'},
{"input", 1, NULL, 'i'},
{"output", 1, NULL, 'o'},
{0, 0, 0, 0},
};
int main(int argc, char *argv[])
{
string infile;
string outfile;
int c;
while((c = getopt_long(argc, argv, "vi:o:", long_options, NULL)) != -1) {
switch(c) {
case 'v':
cout<<VERSION<<endl;
exit(0);
case 'i':
infile = optarg;
break;
case 'o':
outfile = optarg;
break;
default:
usage();
}
}
if(infile.length() == 0 || outfile.length() == 0)
usage();
Rfc rfc;
rfc.parseConfigFile("config.txt");
//rfc.dumpConfig();
if(rfc.checkQualcommCode(infile) != -1)
rfc.codeGenerate(infile, outfile);
return 0;
}