]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Correct const'ness of argv in all support apps, and use the new
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 13 Apr 2002 19:35:18 +0000 (19:35 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 13 Apr 2002 19:35:18 +0000 (19:35 +0000)
  apr_app_initialize over apr_initialize for win32, and other platforms
  that may wish to tweak 'apr-ized' application support (e.g. Netware?)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94633 13f79535-47bb-0310-9956-ffa450edef68

server/main.c
support/ab.c
support/htdbm.c
support/htdigest.c
support/htpasswd.c
support/rotatelogs.c

index 010aa52d451f8c6efa0209ae2a90b1b8b30048b9..811af8202992cea10104f239fc6818c6f5a43bcb 100644 (file)
@@ -404,7 +404,7 @@ int main(int argc, const char * const argv[])
 
     AP_MONCONTROL(0); /* turn of profiling of startup */
 
-    apr_initialize();
+    apr_app_initialize(&argc, &argv, NULL);
 
     process = create_process(argc, argv);
     pglobal = process->pool;
index 76ce0630e7e5400bb46181995b29077120d5f5ef..c7010a52e4617db4fc0d2c8b1f00d99ad1f68780 100644 (file)
@@ -1302,14 +1302,14 @@ static void test(void)
 static void copyright(void)
 {
     if (!use_html) {
-       printf("This is ApacheBench, Version %s\n", AP_SERVER_BASEREVISION " <$Revision: 1.93 $> apache-2.0");
+       printf("This is ApacheBench, Version %s\n", AP_SERVER_BASEREVISION " <$Revision: 1.94 $> apache-2.0");
        printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
        printf("Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/\n");
        printf("\n");
     }
     else {
        printf("<p>\n");
-       printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AP_SERVER_BASEREVISION, "$Revision: 1.93 $");
+       printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AP_SERVER_BASEREVISION, "$Revision: 1.94 $");
        printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
        printf(" Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/<br>\n");
        printf("</p>\n<p>\n");
@@ -1467,7 +1467,7 @@ static int open_postfile(const char *pfile)
 /* ------------------------------------------------------- */
 
 /* sort out command-line args and call test */
-int main(int argc, const char *const argv[])
+int main(int argc, const char * const argv[])
 {
     int r, l;
     char tmp[1024];
@@ -1485,7 +1485,7 @@ int main(int argc, const char *const argv[])
     proxyhost[0] = '\0';
     hdrs[0] = '\0';
 
-    apr_initialize();
+    apr_app_initialize(&argc, &argv, NULL);
     atexit(apr_terminate);
     apr_pool_create(&cntxt, NULL);
 
index 1a16b1d8ef345dc0b2d8aa1aa60be0be74a52c37..89a461675047f9b18c3e283cdfc22aafd2e3cc0e 100644 (file)
@@ -172,8 +172,6 @@ static apr_status_t htdbm_init(apr_pool_t **pool, htdbm_t **hdbm)
     apr_status_t rv;
 #endif
 
-    apr_initialize();
-    atexit(apr_terminate);
     apr_pool_create( pool, NULL);
     apr_signal(SIGINT, (void (*)(int)) htdbm_interrupted);
 
@@ -412,7 +410,7 @@ static void htdbm_usage(void)
 }
 
 
-int main(int argc, const char *argv[])
+int main(int argc, const char * const argv[])
 {
     apr_pool_t *pool;
     apr_status_t rv;
@@ -431,6 +429,9 @@ int main(int argc, const char *argv[])
     int  i;
     int args_left = 2;
 
+    apr_app_initialize(&argc, &argv, NULL);
+    atexit(apr_terminate);
+
     if ((rv = htdbm_init(&pool, &h)) != APR_SUCCESS) {
         fprintf(stderr, "Unable to initialize htdbm terminating!\n");
         apr_strerror(rv, errbuf, sizeof(errbuf));
index eff88e45e197089467303dc903c2cd7aa984f9fa..c65a243a3bd092d759ca9a84b9d8cca8f9032d56 100644 (file)
@@ -147,7 +147,7 @@ static void putline(apr_file_t *f, char *l)
 }
 
 
-static void add_password(char *user, char *realm, apr_file_t *f)
+static void add_password(const char *user, const char *realm, apr_file_t *f)
 {
     char *pw;
     apr_md5_ctx_t context;
@@ -214,7 +214,7 @@ static void terminate(void)
     apr_terminate();
 }
 
-int main(int argc, char *argv[])
+int main(int argc, const char * const argv[])
 {
     apr_file_t *f;
     apr_status_t rv;
@@ -228,12 +228,7 @@ int main(int argc, char *argv[])
     char command[MAX_STRING_LEN];
     int found;
    
-    rv = apr_initialize();
-    if (rv) {
-        fprintf(stderr, "apr_initialize(): %s (%d)\n",
-                apr_strerror(rv, line, sizeof(line)), rv);
-        exit(1);
-    }
+    apr_app_initialize(&argc, &argv, NULL);
     atexit(terminate); 
     apr_pool_create(&cntxt, NULL);
 
index d42ecf9ac9e0b6fd06187eb425ae3cf79e0f6fe3..93f8400e4822e37ad4aeb1b7bb8101f2072bc1db 100644 (file)
@@ -376,7 +376,6 @@ static void copy_file(FILE *target, FILE *source)
 void nwTerminate()
 {
     pressanykey();
-    apr_terminate();
 }
 #endif
 
@@ -384,7 +383,7 @@ void nwTerminate()
  * Let's do it.  We end up doing a lot of file opening and closing,
  * but what do we care?  This application isn't run constantly.
  */
-int main(int argc, char *argv[])
+int main(int argc, const char * const argv[])
 {
     FILE *ftemp = NULL;
     FILE *fpw = NULL;
@@ -393,7 +392,7 @@ int main(int argc, char *argv[])
     char record[MAX_STRING_LEN];
     char line[MAX_STRING_LEN];
     char pwfilename[MAX_STRING_LEN];
-    char *arg;
+    const char *arg;
     int found = 0;
     int alg = ALG_CRYPT;
     int newfile = 0;
@@ -407,11 +406,10 @@ int main(int argc, char *argv[])
     apr_xlate_t *to_ascii;
 #endif
 
-    apr_initialize();
+    apr_app_initialize(&argc, &argv, NULL);
+    atexit(apr_terminate);
 #ifdef NETWARE
     atexit(nwTerminate);
-#else
-    atexit(apr_terminate);
 #endif
     apr_pool_create(&pool, NULL);
 
index 834a522976c4445ed3c6f29378c7730008a1db44..559406caa36f04db86a8c88a94a18e4e99a96e24 100644 (file)
@@ -91,7 +91,7 @@
 #define MAX_PATH        1024
 #endif
 
-int main (int argc, char *argv[])
+int main (int argc, const char * const argv[])
 {
     char buf[BUFSIZE], buf2[MAX_PATH], errbuf[ERRMSGSZ];
     int tLogEnd = 0, tRotation, utc_offset = 0;
@@ -99,11 +99,11 @@ int main (int argc, char *argv[])
     apr_size_t nRead, nWrite;
     int use_strftime = 0;
     int now;
-    char *szLogRoot;
+    const char *szLogRoot;
     apr_file_t *f_stdin, *nLogFD = NULL, *nLogFDprev = NULL;
     apr_pool_t *pool;
 
-    apr_initialize();
+    apr_app_initialize(&argc, &argv, NULL);
     atexit(apr_terminate);
 
     apr_pool_create(&pool, NULL);