aboutsummaryrefslogtreecommitdiff
path: root/example/MacOS/ndpiExample
diff options
context:
space:
mode:
Diffstat (limited to 'example/MacOS/ndpiExample')
-rw-r--r--example/MacOS/ndpiExample/ndpiExample/ViewController.m7
1 files changed, 6 insertions, 1 deletions
diff --git a/example/MacOS/ndpiExample/ndpiExample/ViewController.m b/example/MacOS/ndpiExample/ndpiExample/ViewController.m
index 2681e3f00..b18e21e19 100644
--- a/example/MacOS/ndpiExample/ndpiExample/ViewController.m
+++ b/example/MacOS/ndpiExample/ndpiExample/ViewController.m
@@ -46,6 +46,9 @@ extern int orginal_main(int argc, char **argv);
{
char* args[10];
+ extern int optind;
+ optind = 1; // reset the parse of getopt_long
+
// Check the "nDPI_QuickStartGuide.pdf" for comand option explanation.
/* Following code it to execute below command (remember to change args[2] to
@@ -74,7 +77,9 @@ extern int orginal_main(int argc, char **argv);
args[3] = (char*)"-s";
args[4] = (char*)"10";
args[5] = (char*)"-p";
- args[6] = (char*)"/Users/zengyingpei/Documents/code/nDPI/example/protos.txt";
+ NSString* proto_file = [[NSBundle mainBundle]pathForResource:@"protos" ofType:@"txt"];
+ args[6] = (char*)[proto_file cStringUsingEncoding:NSUTF8StringEncoding];
+ //args[6] = (char*)"/Users/zengyingpei/Documents/code/nDPI/example/protos.txt";
orginal_main(7, args);
*/
}