httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fua...@apache.org
Subject svn commit: r1004962 - in /httpd/httpd/trunk/support: ab.c httxt2dbm.c rotatelogs.c utilitiesnw.def
Date Wed, 06 Oct 2010 10:05:22 GMT
Author: fuankg
Date: Wed Oct  6 10:05:22 2010
New Revision: 1004962

URL: http://svn.apache.org/viewvc?rev=1004962&view=rev
Log:
Renamed optarg -> opt_arg to avoid name clashes with system-own optarg;
removed leftover from IDE build times.

Removed:
    httpd/httpd/trunk/support/utilitiesnw.def
Modified:
    httpd/httpd/trunk/support/ab.c
    httpd/httpd/trunk/support/httxt2dbm.c
    httpd/httpd/trunk/support/rotatelogs.c

Modified: httpd/httpd/trunk/support/ab.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/ab.c?rev=1004962&r1=1004961&r2=1004962&view=diff
==============================================================================
--- httpd/httpd/trunk/support/ab.c (original)
+++ httpd/httpd/trunk/support/ab.c Wed Oct  6 10:05:22 2010
@@ -2014,7 +2014,7 @@ int main(int argc, const char * const ar
     char tmp[1024];
     apr_status_t status;
     apr_getopt_t *opt;
-    const char *optarg;
+    const char *opt_arg;
     char c;
 #ifdef USE_SSL
     AB_SSL_METHOD_CONST SSL_METHOD *meth = SSLv23_client_method();
@@ -2056,10 +2056,10 @@ int main(int argc, const char * const ar
 #ifdef USE_SSL
             "Z:f:"
 #endif
-            ,&c, &optarg)) == APR_SUCCESS) {
+            ,&c, &opt_arg)) == APR_SUCCESS) {
         switch (c) {
             case 'n':
-                requests = atoi(optarg);
+                requests = atoi(opt_arg);
                 if (requests <= 0) {
                     err("Invalid number of requests\n");
                 }
@@ -2071,10 +2071,10 @@ int main(int argc, const char * const ar
                 heartbeatres = 0;
                 break;
             case 'c':
-                concurrency = atoi(optarg);
+                concurrency = atoi(opt_arg);
                 break;
             case 'b':
-                windowsize = atoi(optarg);
+                windowsize = atoi(opt_arg);
                 break;
             case 'i':
                 if (method != NO_METH)
@@ -2082,13 +2082,13 @@ int main(int argc, const char * const ar
                 method = HEAD;
                 break;
             case 'g':
-                gnuplot = strdup(optarg);
+                gnuplot = strdup(opt_arg);
                 break;
             case 'd':
                 percentile = 0;
                 break;
             case 'e':
-                csvperc = strdup(optarg);
+                csvperc = strdup(opt_arg);
                 break;
             case 'S':
                 confidence = 0;
@@ -2096,7 +2096,7 @@ int main(int argc, const char * const ar
             case 'p':
                 if (method != NO_METH)
                     err("Cannot mix POST with other methods\n");
-                if ((status = open_postfile(optarg)) != APR_SUCCESS) {
+                if ((status = open_postfile(opt_arg)) != APR_SUCCESS) {
                     exit(1);
                 }
                 method = POST;
@@ -2105,7 +2105,7 @@ int main(int argc, const char * const ar
             case 'u':
                 if (method != NO_METH)
                     err("Cannot mix PUT with other methods\n");
-                if ((status = open_postfile(optarg)) != APR_SUCCESS) {
+                if ((status = open_postfile(opt_arg)) != APR_SUCCESS) {
                     exit(1);
                 }
                 method = PUT;
@@ -2115,30 +2115,30 @@ int main(int argc, const char * const ar
                 recverrok = 1;
                 break;
             case 'v':
-                verbosity = atoi(optarg);
+                verbosity = atoi(opt_arg);
                 break;
             case 't':
-                tlimit = atoi(optarg);
+                tlimit = atoi(opt_arg);
                 requests = MAX_REQUESTS;    /* need to size data array on
                                              * something */
                 break;
             case 'T':
-                strcpy(content_type, optarg);
+                strcpy(content_type, opt_arg);
                 break;
             case 'C':
-                cookie = apr_pstrcat(cntxt, "Cookie: ", optarg, "\r\n", NULL);
+                cookie = apr_pstrcat(cntxt, "Cookie: ", opt_arg, "\r\n", NULL);
                 break;
             case 'A':
                 /*
                  * assume username passwd already to be in colon separated form.
                  * Ready to be uu-encoded.
                  */
-                while (apr_isspace(*optarg))
-                    optarg++;
-                if (apr_base64_encode_len(strlen(optarg)) > sizeof(tmp)) {
+                while (apr_isspace(*opt_arg))
+                    opt_arg++;
+                if (apr_base64_encode_len(strlen(opt_arg)) > sizeof(tmp)) {
                     err("Authentication credentials too long\n");
                 }
-                l = apr_base64_encode(tmp, optarg, strlen(optarg));
+                l = apr_base64_encode(tmp, opt_arg, strlen(opt_arg));
                 tmp[l] = '\0';
 
                 auth = apr_pstrcat(cntxt, auth, "Authorization: Basic ", tmp,
@@ -2148,27 +2148,27 @@ int main(int argc, const char * const ar
                 /*
                  * assume username passwd already to be in colon separated form.
                  */
-                while (apr_isspace(*optarg))
-                optarg++;
-                if (apr_base64_encode_len(strlen(optarg)) > sizeof(tmp)) {
+                while (apr_isspace(*opt_arg))
+                opt_arg++;
+                if (apr_base64_encode_len(strlen(opt_arg)) > sizeof(tmp)) {
                     err("Proxy credentials too long\n");
                 }
-                l = apr_base64_encode(tmp, optarg, strlen(optarg));
+                l = apr_base64_encode(tmp, opt_arg, strlen(opt_arg));
                 tmp[l] = '\0';
 
                 auth = apr_pstrcat(cntxt, auth, "Proxy-Authorization: Basic ",
                                        tmp, "\r\n", NULL);
                 break;
             case 'H':
-                hdrs = apr_pstrcat(cntxt, hdrs, optarg, "\r\n", NULL);
+                hdrs = apr_pstrcat(cntxt, hdrs, opt_arg, "\r\n", NULL);
                 /*
                  * allow override of some of the common headers that ab adds
                  */
-                if (strncasecmp(optarg, "Host:", 5) == 0) {
+                if (strncasecmp(opt_arg, "Host:", 5) == 0) {
                     opt_host = 1;
-                } else if (strncasecmp(optarg, "Accept:", 7) == 0) {
+                } else if (strncasecmp(opt_arg, "Accept:", 7) == 0) {
                     opt_accept = 1;
-                } else if (strncasecmp(optarg, "User-Agent:", 11) == 0) {
+                } else if (strncasecmp(opt_arg, "User-Agent:", 11) == 0) {
                     opt_useragent = 1;
                 }
                 break;
@@ -2181,7 +2181,7 @@ int main(int argc, const char * const ar
                  */
             case 'x':
                 use_html = 1;
-                tablestring = optarg;
+                tablestring = opt_arg;
                 break;
             case 'X':
                 {
@@ -2189,22 +2189,22 @@ int main(int argc, const char * const ar
                     /*
                      * assume proxy-name[:port]
                      */
-                    if ((p = strchr(optarg, ':'))) {
+                    if ((p = strchr(opt_arg, ':'))) {
                         *p = '\0';
                         p++;
                         proxyport = atoi(p);
                     }
-                    strcpy(proxyhost, optarg);
+                    strcpy(proxyhost, opt_arg);
                     isproxy = 1;
                 }
                 break;
             case 'y':
                 use_html = 1;
-                trstring = optarg;
+                trstring = opt_arg;
                 break;
             case 'z':
                 use_html = 1;
-                tdstring = optarg;
+                tdstring = opt_arg;
                 break;
             case 'h':
                 usage(argv[0]);
@@ -2214,16 +2214,16 @@ int main(int argc, const char * const ar
                 return 0;
 #ifdef USE_SSL
             case 'Z':
-                ssl_cipher = strdup(optarg);
+                ssl_cipher = strdup(opt_arg);
                 break;
             case 'f':
-                if (strncasecmp(optarg, "ALL", 3) == 0) {
+                if (strncasecmp(opt_arg, "ALL", 3) == 0) {
                     meth = SSLv23_client_method();
-                } else if (strncasecmp(optarg, "SSL2", 4) == 0) {
+                } else if (strncasecmp(opt_arg, "SSL2", 4) == 0) {
                     meth = SSLv2_client_method();
-                } else if (strncasecmp(optarg, "SSL3", 4) == 0) {
+                } else if (strncasecmp(opt_arg, "SSL3", 4) == 0) {
                     meth = SSLv3_client_method();
-                } else if (strncasecmp(optarg, "TLS1", 4) == 0) {
+                } else if (strncasecmp(opt_arg, "TLS1", 4) == 0) {
                     meth = TLSv1_client_method();
                 }
                 break;

Modified: httpd/httpd/trunk/support/httxt2dbm.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/httxt2dbm.c?rev=1004962&r1=1004961&r2=1004962&view=diff
==============================================================================
--- httpd/httpd/trunk/support/httxt2dbm.c (original)
+++ httpd/httpd/trunk/support/httxt2dbm.c Wed Oct  6 10:05:22 2010
@@ -178,7 +178,7 @@ int main(int argc, const char *const arg
     apr_pool_t *pool;
     apr_status_t rv = APR_SUCCESS;
     apr_getopt_t *opt;
-    const char *optarg;
+    const char *opt_arg;
     char ch;
     apr_file_t *infile;
     apr_dbm_t *outdbm;
@@ -213,7 +213,7 @@ int main(int argc, const char *const arg
         return 1;
     }
 
-    while ((rv = apr_getopt(opt, "vf::i::o::", &ch, &optarg)) == APR_SUCCESS) {
+    while ((rv = apr_getopt(opt, "vf::i::o::", &ch, &opt_arg)) == APR_SUCCESS) {
         switch (ch) {
         case 'v':
             if (verbose) {
@@ -229,7 +229,7 @@ int main(int argc, const char *const arg
                 usage();
                 return 1;
             }
-            format = apr_pstrdup(pool, optarg);
+            format = apr_pstrdup(pool, opt_arg);
             break;
         case 'i':
             if (input) {
@@ -237,7 +237,7 @@ int main(int argc, const char *const arg
                 usage();
                 return 1;
             }
-            input = apr_pstrdup(pool, optarg);
+            input = apr_pstrdup(pool, opt_arg);
             break;
         case 'o':
             if (output) {
@@ -245,7 +245,7 @@ int main(int argc, const char *const arg
                 usage();
                 return 1;
             }
-            output = apr_pstrdup(pool, optarg);
+            output = apr_pstrdup(pool, opt_arg);
             break;
         }
     }

Modified: httpd/httpd/trunk/support/rotatelogs.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/rotatelogs.c?rev=1004962&r1=1004961&r2=1004962&view=diff
==============================================================================
--- httpd/httpd/trunk/support/rotatelogs.c (original)
+++ httpd/httpd/trunk/support/rotatelogs.c Wed Oct  6 10:05:22 2010
@@ -433,7 +433,7 @@ int main (int argc, const char * const a
     apr_getopt_t *opt;
     apr_status_t rv;
     char c;
-    const char *optarg;
+    const char *opt_arg;
     const char *err = NULL;
 
     apr_app_initialize(&argc, &argv, NULL);
@@ -457,13 +457,13 @@ int main (int argc, const char * const a
 
     apr_pool_create(&status.pool, NULL);
     apr_getopt_init(&opt, status.pool, argc, argv);
-    while ((rv = apr_getopt(opt, "lL:ftv", &c, &optarg)) == APR_SUCCESS) {
+    while ((rv = apr_getopt(opt, "lL:ftv", &c, &opt_arg)) == APR_SUCCESS) {
         switch (c) {
         case 'l':
             config.use_localtime = 1;
             break;
         case 'L':
-            config.linkfile = optarg;
+            config.linkfile = opt_arg;
             break;
         case 'f':
             config.force_open = 1;



Mime
View raw message