Index: /pjproject/trunk/pjsip-apps/src/pjsip-perf/main.c
===================================================================
--- /pjproject/trunk/pjsip-apps/src/pjsip-perf/main.c	(revision 308)
+++ /pjproject/trunk/pjsip-apps/src/pjsip-perf/main.c	(revision 309)
@@ -397,5 +397,5 @@
 	OPT_DURATION
     };
-    struct option long_opts[] = {
+    struct pj_getopt_option long_opts[] = {
 	{ "help",	    0, 0, OPT_HELP},
 	{ "version",	    0, 0, OPT_VERSION},
@@ -413,6 +413,6 @@
     int c, option_index;
 
-    optind = 0;
-    while ((c=getopt_long(argc, argv, "", long_opts, &option_index)) != -1) {
+    pj_optind = 0;
+    while ((c=pj_getopt_long(argc, argv, "", long_opts, &option_index)) != -1) {
 	switch (c) {
 
@@ -426,19 +426,19 @@
 
 	case OPT_LOG_LEVEL:
-	    settings.log_level = atoi(optarg);
+	    settings.log_level = atoi(pj_optarg);
 	    break;
 
 	case OPT_APP_LOG_LEVEL:
-	    settings.app_log_level = atoi(optarg);
+	    settings.app_log_level = atoi(pj_optarg);
 	    break;
 
 	case OPT_LOG_FILE:
-	    settings.log_file = optarg;
+	    settings.log_file = pj_optarg;
 	    break;
 
 	case OPT_LOCAL_PORT:
-	    settings.local_port = atoi(optarg);
+	    settings.local_port = atoi(pj_optarg);
 	    if (settings.local_port < 1 || settings.local_port > 65535) {
-		PJ_LOG(1,(THIS_FILE,"Invalid --local-port %s", optarg));
+		PJ_LOG(1,(THIS_FILE,"Invalid --local-port %s", pj_optarg));
 		return PJ_EINVAL;
 	    }
@@ -450,9 +450,9 @@
 
 	case OPT_THREAD_CNT:
-	    settings.thread_cnt = atoi(optarg);
+	    settings.thread_cnt = atoi(pj_optarg);
 	    if (settings.thread_cnt < 1 || 
 		settings.thread_cnt > PJ_ARRAY_SIZE(settings.thread)) 
 	    {
-		PJ_LOG(1,(THIS_FILE,"Invalid --thread-cnt %s", optarg));
+		PJ_LOG(1,(THIS_FILE,"Invalid --thread-cnt %s", pj_optarg));
 		return PJ_EINVAL;
 	    }
@@ -460,7 +460,7 @@
 
 	case OPT_START_RATE:
-	    settings.start_rate = atoi(optarg);
+	    settings.start_rate = atoi(pj_optarg);
 	    if (settings.start_rate < 1 || settings.start_rate > 1000000) {
-		PJ_LOG(1,(THIS_FILE,"Invalid --start-rate %s", optarg));
+		PJ_LOG(1,(THIS_FILE,"Invalid --start-rate %s", pj_optarg));
 		return PJ_EINVAL;
 	    }
@@ -468,9 +468,9 @@
 
 	case OPT_MAX_CAPACITY:
-	    settings.max_capacity = atoi(optarg);
+	    settings.max_capacity = atoi(pj_optarg);
 	    if (settings.max_capacity < 1 || settings.max_capacity > 65000) {
 		PJ_LOG(1,(THIS_FILE,
 			  "Invalid --max-capacity %s (range=1-65000)", 
-			  optarg));
+			  pj_optarg));
 		return PJ_EINVAL;
 	    }
@@ -478,7 +478,7 @@
 
 	case OPT_DURATION:
-	    settings.duration = atoi(optarg);
+	    settings.duration = atoi(pj_optarg);
 	    if (settings.duration < 0 || settings.duration > 1000000) {
-		PJ_LOG(1,(THIS_FILE,"Invalid --duration %s", optarg));
+		PJ_LOG(1,(THIS_FILE,"Invalid --duration %s", pj_optarg));
 		return PJ_EINVAL;
 	    }
@@ -488,16 +488,16 @@
     }
 
-    if (optind != argc) {
-	if (verify_sip_url(argv[optind]) != PJ_SUCCESS) {
-	    PJ_LOG(3,(THIS_FILE, "Invalid SIP URL %s", argv[optind]));
+    if (pj_optind != argc) {
+	if (verify_sip_url(argv[pj_optind]) != PJ_SUCCESS) {
+	    PJ_LOG(3,(THIS_FILE, "Invalid SIP URL %s", argv[pj_optind]));
 	    return PJ_EINVAL;
 	}
 	
-	settings.target = pj_str(argv[optind]);
-	++optind;
-    }
-
-    if (optind != argc) {
-	printf("Error: unknown options %s\n", argv[optind]);
+	settings.target = pj_str(argv[pj_optind]);
+	++pj_optind;
+    }
+
+    if (pj_optind != argc) {
+	printf("Error: unknown options %s\n", argv[pj_optind]);
 	return PJ_EINVAL;
     }
@@ -725,5 +725,5 @@
     puts  ("|   m  Change mode                     |                                     |");
     puts  ("| + -  Increment/decrement rate by 10  |   d   Dump status                   |");
-    puts  ("| * /  Increment/decrement rate by 100 |   d1  Dump detailed (e.g. tables)   |");
+    puts  ("| * /  Increment/decrement rate by 100 |   dd  Dump detailed (e.g. tables)   |");
     puts  ("+--------------------------------------+-------------------------------------+");
     puts  ("|                              Test Commands                                 |");
@@ -816,5 +816,5 @@
 
 	case 'd':
-	    dump(menuin[1]=='1');
+	    dump(menuin[1]=='d');
 	    break;
 
