]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
First patch to re-order function parameters. This one gets the low hanging
authorRyan Bloom <rbb@apache.org>
Mon, 4 Oct 1999 16:38:16 +0000 (16:38 +0000)
committerRyan Bloom <rbb@apache.org>
Mon, 4 Oct 1999 16:38:16 +0000 (16:38 +0000)
fruit, and moves most of the result parameters to the first argument.
Future patches in this series will move the rest of the result parameters
to the beginning of the list, and will move the context's to the end of the
list

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

18 files changed:
modules/aaa/mod_auth.c
modules/generators/mod_asis.c
modules/generators/mod_autoindex.c
modules/http/http_core.c
modules/http/http_protocol.c
modules/http/http_request.c
modules/loggers/mod_log_config.c
modules/mappers/mod_negotiation.c
server/config.c
server/listen.c
server/log.c
server/main.c
server/mpm/dexter/dexter.c
server/mpm/mpmt_pthread/mpmt_pthread.c
server/mpm/prefork/prefork.c
server/rfc1413.c
server/util.c
server/util_script.c

index 749060916f431b5dc1515492df4b0a4d3562a36a..590a1e32b57f11167679f4e9a15b674b986a0b9d 100644 (file)
@@ -157,7 +157,7 @@ static ap_table_t *groups_for_user(ap_context_t *p, char *user, char *grpfile)
        return NULL;
     }
 
-    ap_create_context(p, &sp);
+    ap_create_context(&sp, p);
 
     while (!(ap_cfg_getline(l, MAX_STRING_LEN, f))) {
        if ((l[0] == '#') || (!l[0]))
index a6bf897e23db1db67c051ba131c4b53bc09fd3b0..cd6c96cb1dcd5e67f2b6511f66dbcb420e95c7fe 100644 (file)
@@ -79,8 +79,8 @@ static int asis_handler(request_rec *r)
        return NOT_FOUND;
     }
 
-    if (ap_open(r->pool, r->filename, APR_READ | APR_BUFFERED, 
-                APR_OS_DEFAULT, &f) != APR_SUCCESS) {
+    if (ap_open(&f, r->pool, r->filename, APR_READ | APR_BUFFERED, 
+                APR_OS_DEFAULT) != APR_SUCCESS) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
                    "file permissions deny server access: %s", r->filename);
        return FORBIDDEN;
index 3909bd4125fb39c5108dd64c2cb785f8f9f71978..0b4151bf28ec135525a399c498a842724839e20a 100644 (file)
@@ -986,8 +986,8 @@ static void emit_head(request_rec *r, char *header_fname, int suppress_amble,
                 * the file's contents, any HTML header it had won't end up
                 * where it belongs.
                 */
-               if (ap_open(r->pool, rr->filename, APR_READ | APR_BUFFERED,
-                            APR_OS_DEFAULT, &f) == APR_SUCCESS) {
+               if (ap_open(&f, r->pool, rr->filename, APR_READ | APR_BUFFERED,
+                            APR_OS_DEFAULT) == APR_SUCCESS) {
                    emit_preamble(r, title);
                    emit_amble = 0;
                    do_emit_plain(r, f);
@@ -1054,8 +1054,8 @@ static void emit_tail(request_rec *r, char *readme_fname, int suppress_amble)
                /*
                 * If we can open the file, suppress the signature.
                 */
-               if (ap_open(r->pool, rr->filename, APR_READ | APR_BUFFERED,
-                            APR_OS_DEFAULT, &f) == APR_SUCCESS) {
+               if (ap_open(&f, r->pool, rr->filename, APR_READ | APR_BUFFERED,
+                            APR_OS_DEFAULT) == APR_SUCCESS) {
                    do_emit_plain(r, f);
                    ap_close(f);
                    suppress_sig = 1;
@@ -1090,8 +1090,8 @@ static char *find_title(request_rec *r)
                        "text/html")
            || !strcmp(r->content_type, INCLUDES_MAGIC_TYPE))
        && !r->content_encoding) {
-        if (ap_open(r->pool, r->filename, APR_READ | APR_BUFFERED,
-                    APR_OS_DEFAULT, &thefile) != APR_SUCCESS) {
+        if (ap_open(&thefile, r->pool, r->filename, APR_READ | APR_BUFFERED,
+                    APR_OS_DEFAULT) != APR_SUCCESS) {
            return NULL;
        }
         n = sizeof(char) * (MAX_STRING_LEN - 1);
@@ -1280,7 +1280,7 @@ static void output_directories(struct ent **ar, int n,
     char *name_scratch;
     char *pad_scratch;
 
-    ap_create_context(r->pool, &scratch);
+    ap_create_context(&scratch, r->pool);
     if (name[0] == '\0') {
        name = "/";
     }
@@ -1513,7 +1513,7 @@ static int index_directory(request_rec *r,
     char keyid;
     char direction;
 
-    if (ap_opendir(r->pool, name, &d) != APR_SUCCESS) {
+    if (ap_opendir(&d, r->pool, name) != APR_SUCCESS) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
                    "Can't open directory for index: %s", r->filename);
        return HTTP_FORBIDDEN;
@@ -1578,7 +1578,7 @@ static int index_directory(request_rec *r,
     head = NULL;
     while (ap_readdir(d)) {
         char *d_name;
-        ap_get_dir_filename(d, &d_name);
+        ap_get_dir_filename(&d_name, d);
        p = make_autoindex_entry(d_name, autoindex_opts,
                                 autoindex_conf, r, keyid, direction);
        if (p != NULL) {
index d39fd71ea60f79f0ebf1d3609b3bc48f5bbe4e63..2c306e33d5b017e227e7b32a8cc735dd0053d92b 100644 (file)
@@ -399,7 +399,7 @@ void ap_core_reorder_directories(ap_context_t *p, server_rec *s)
     elts = (void **)sec->elts;
 
     /* we have to allocate tmp space to do a stable sort */
-    ap_create_context(p, &tmp);
+    ap_create_context(&tmp, p);
     sortbin = ap_palloc(tmp, sec->nelts * sizeof(*sortbin));
     for (i = 0; i < nelts; ++i) {
        sortbin[i].orig_index = i;
@@ -2515,7 +2515,7 @@ static int default_handler(request_rec *r)
         return METHOD_NOT_ALLOWED;
     }
        
-    if (ap_open (r->pool, r->filename, APR_READ | APR_BINARY, 0, &fd) != APR_SUCCESS) {
+    if (ap_open (&fd, r->pool, r->filename, APR_READ | APR_BINARY, 0) != APR_SUCCESS) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
                     "file permissions deny server access: %s", r->filename);
         return FORBIDDEN;
index 99f5d800a9ed826ccaf06ca442b4b807ab1712ac..5836f6110ed8e9c6fe20dace9f5040a50d9c91b8 100644 (file)
@@ -927,7 +927,7 @@ request_rec *ap_read_request(conn_rec *conn)
     const char *expect;
     int access_status;
 
-    ap_create_context(conn->pool, &p);
+    ap_create_context(&p, conn->pool);
     r = ap_pcalloc(p, sizeof(request_rec));
     r->pool            = p;
     r->connection      = conn;
index 684ad983e79c7dd09fb55d761d4eae4447504517..e4f4f81460ceaf65a7f4bb9058226411560701ef 100644 (file)
@@ -740,7 +740,7 @@ static request_rec *make_sub_request(const request_rec *r)
     ap_context_t *rrp;
     request_rec *rr;
     
-    ap_create_context(r->pool, &rrp);
+    ap_create_context(&rrp, r->pool);
     rr = ap_pcalloc(rrp, sizeof(request_rec));
     rr->pool = rrp;
     return rr;
index 90025db60fd7d6916d4b2bfcba59b951a434b0e6..16267a7f291121fa1f3cf69d4924b70a59f09744 100644 (file)
@@ -1001,7 +1001,7 @@ static config_log_state *open_config_log(server_rec *s, ap_context_t *p,
     }
     else {
         const char *fname = ap_server_root_relative(p, cls->fname);
-        if (ap_open(p, fname, xfer_flags, xfer_mode, &cls->log_fd) != APR_SUCCESS) {
+        if (ap_open(&cls->log_fd, p, fname, xfer_flags, xfer_mode) != APR_SUCCESS) {
             ap_log_error(APLOG_MARK, APLOG_ERR, s,
                          "could not open transfer log file %s.", fname);
             exit(1);
index 840a9d6fb01c37560299726b63dc260fd89cb831..caa76ae4ec118209dd19856a1962778eb7ea746c 100644 (file)
@@ -782,8 +782,8 @@ static int read_type_map(negotiation_state *neg, request_rec *rr)
     /* We are not using multiviews */
     neg->count_multiviews_variants = 0;
 
-    if (ap_open(neg->pool, rr->filename, APR_READ | APR_BUFFERED,
-                APR_OS_DEFAULT, &map) != APR_SUCCESS) {
+    if (ap_open(&map, neg->pool, rr->filename, APR_READ | APR_BUFFERED,
+                APR_OS_DEFAULT) != APR_SUCCESS) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
                       "cannot access type map file: %s", rr->filename);
         return HTTP_FORBIDDEN;
@@ -908,7 +908,7 @@ static int read_types_multi(negotiation_state *neg)
     ++filp;
     prefix_len = strlen(filp);
 
-    if (ap_opendir(neg->pool, neg->dir_name, &dirp) != APR_SUCCESS) {
+    if (ap_opendir(&dirp, neg->pool, neg->dir_name) != APR_SUCCESS) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
                     "cannot read directory for multi: %s", neg->dir_name);
         return HTTP_FORBIDDEN;
@@ -918,7 +918,7 @@ static int read_types_multi(negotiation_state *neg)
         request_rec *sub_req;
         char *d_name;
 
-        ap_get_dir_filename(dirp, &d_name);
+        ap_get_dir_filename(&d_name, dirp);
         /* Do we have a match? */
 
         if (strncmp(d_name, filp, prefix_len)) {
index 0a4ba4f37b0e6b8060a854441ff3bcc3b2bc494f..bb10036579cd1736c77dc41bd68c0cfd0fd51ff1 100644 (file)
@@ -1251,7 +1251,7 @@ static server_rec *init_server_config(ap_context_t *p)
     s->server_admin = DEFAULT_ADMIN;
     s->server_hostname = NULL;
     s->error_fname = DEFAULT_ERRORLOG;
-    ap_put_os_file(p, &s->error_log, &errfile);
+    ap_put_os_file(&s->error_log, &errfile, p);
     s->loglevel = DEFAULT_LOGLEVEL;
     s->srm_confname = RESOURCE_CONFIG_FILE;
     s->access_confname = ACCESS_CONFIG_FILE;
index 32f5b1d7a7ff87d27df31b501449f156233df2e0..aa24b0d2b6d674e2a4fa0c99c681a1e3ecdb2bb1 100644 (file)
@@ -176,7 +176,7 @@ static void alloc_listener(char *addr, unsigned int port)
     /* XXX - We need to deal with freeing this structure properly. */
     new = malloc(sizeof(ap_listen_rec));
     new->active = 0;
-    if (ap_create_tcp_socket(NULL, &new->sd) != APR_SUCCESS) {
+    if (ap_create_tcp_socket(&new->sd, NULL) != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_CRIT, NULL,
                  "make_sock: failed to get a socket for %s", addr);
         return;
index a2c67c0e49fa6d3632c648778a5e2f12e0b5515b..f9f7cc844c9d2a9a3149fdfe008ab40775f29771 100644 (file)
@@ -209,7 +209,7 @@ static void open_error_log(server_rec *s, ap_context_t *p)
        }
 
         dummyno = fileno(dummy);
-       ap_put_os_file(p, &s->error_log, &dummyno);
+       ap_put_os_file(&s->error_log, &dummyno, p);
     }
 
 #ifdef HAVE_SYSLOG
@@ -236,8 +236,8 @@ static void open_error_log(server_rec *s, ap_context_t *p)
     else {
        fname = ap_server_root_relative(p, s->error_fname);
        /*  Change to AP funcs. */
-        if (ap_open(p, fname, APR_BUFFERED | APR_APPEND | APR_READ | APR_WRITE, 
-                      APR_OS_DEFAULT, &s->error_log) != APR_SUCCESS) {
+        if (ap_open(&s->error_log, p, fname, APR_BUFFERED | APR_APPEND | 
+                    APR_READ | APR_WRITE, APR_OS_DEFAULT) != APR_SUCCESS) {
             perror("fopen");
             fprintf(stderr, "%s: could not open error log file %s.\n",
                    ap_server_argv0, fname);
@@ -321,7 +321,7 @@ static void log_error_core(const char *file, int line, int level,
        if (((level & APLOG_LEVELMASK) != APLOG_NOTICE) &&
            ((level & APLOG_LEVELMASK) > DEFAULT_LOGLEVEL))
            return;
-       ap_put_os_file(NULL, &logf, &errfileno);
+       ap_put_os_file(&logf, &errfileno, NULL);
     }
     else if (s->error_log) {
        /*
@@ -773,7 +773,7 @@ API_EXPORT(piped_log *) ap_open_piped_log(ap_context_t *p, const char *program)
     pl = ap_palloc(p, sizeof (*pl));
     pl->p = p;
     dummyno = fileno(dummy);
-    ap_put_os_file(p, &pl->write_f, &dummyno);
+    ap_put_os_file(&pl->write_f, &dummyno, p);
 
     return pl;
 }
index 87981a831aa905d9774eb1b9be88a837fe30de2e..5d1172650fa626148662de8d432a67b7e98a64f2 100644 (file)
@@ -267,10 +267,10 @@ int main(int argc, char **argv)
     ap_util_init();
     ap_util_uri_init();
 
-    ap_create_context(NULL, &pglobal);
+    ap_create_context(&pglobal, NULL);
     g_pHookPool=pglobal;
 
-    ap_create_context(pglobal, &pcommands);
+    ap_create_context(&pcommands, pglobal);
     ap_server_pre_read_config  = ap_make_array(pcommands, 1, sizeof(char *));
     ap_server_post_read_config = ap_make_array(pcommands, 1, sizeof(char *));
     ap_server_config_defines   = ap_make_array(pcommands, 1, sizeof(char *));
@@ -317,9 +317,9 @@ int main(int argc, char **argv)
        }
     }
 
-    ap_create_context(pglobal, &pconf);
-    ap_create_context(pglobal, &plog);
-    ap_create_context(pconf, &ptemp);
+    ap_create_context(&pconf, pglobal);
+    ap_create_context(&plog, pglobal);
+    ap_create_context(&ptemp, pconf);
 
     /* for legacy reasons, we read the configuration twice before
        we actually serve any requests */
@@ -340,7 +340,7 @@ int main(int argc, char **argv)
 
     for (;;) {
        ap_clear_pool(pconf);
-       ap_create_context(pconf, &ptemp);
+       ap_create_context(&ptemp, pconf);
        ap_server_root = def_server_root;
        ap_run_pre_config(pconf, plog, ptemp);
        server_conf = ap_read_config(pconf, ptemp, confname);
index df33c898a820890be73b023791321570b42ba5ca..9b6d32d01581bd403dba99555f75f3be1e05b1c2 100644 (file)
@@ -858,9 +858,9 @@ static void *worker_thread(void *arg)
     int native_socket;
 
     pthread_mutex_lock(&thread_pool_create_mutex);
-    ap_create_context(thread_pool_parent, &tpool);
+    ap_create_context(&tpool, thread_pool_parent);
     pthread_mutex_unlock(&thread_pool_create_mutex);
-    ap_create_context(tpool, &ptrans);
+    ap_create_context(&ptrans, tpool);
 
     while (!workers_may_exit) {
         workers_may_exit |= (max_requests_per_child != 0) && (requests_this_child <= 0);
@@ -923,7 +923,7 @@ static void *worker_thread(void *arg)
                     /* XXX: Should we check for POLLERR? */
                     if (listenfds[curr_pollfd].revents & POLLIN) {
                         last_pollfd = curr_pollfd;
-                        ap_put_os_sock(tpool, &sd, &listenfds[curr_pollfd].fd);
+                        ap_put_os_sock(&sd, &listenfds[curr_pollfd].fd, tpool);
                         goto got_fd;
                     }
                 } while (curr_pollfd != last_pollfd);
@@ -931,7 +931,7 @@ static void *worker_thread(void *arg)
         }
     got_fd:
         if (!workers_may_exit) {
-            ap_accept(sd, &csd);
+            ap_accept(&csd, sd);
             SAFE_ACCEPT(accept_mutex_off(0));
             SAFE_ACCEPT(intra_mutex_off(0));
            pthread_mutex_lock(&idle_thread_count_mutex);
@@ -981,7 +981,7 @@ static void child_main(int child_num_arg)
 
     my_pid = getpid();
     child_num = child_num_arg;
-    ap_create_context(pconf, &pchild);
+    ap_create_context(&pchild, pconf);
 
     /*stuff to do before we switch id's, so we have permissions.*/
 
@@ -1026,7 +1026,7 @@ static void child_main(int child_num_arg)
     for (i = 0; i < max_threads; i++) {
         worker_thread_free_ids[i] = i;
     }
-    ap_create_context(pchild, &thread_pool_parent);
+    ap_create_context(&thread_pool_parent, pchild);
     pthread_mutex_init(&thread_pool_create_mutex, NULL);
     pthread_mutex_init(&idle_thread_count_mutex, NULL);
     pthread_mutex_init(&worker_thread_count_mutex, NULL);
index bff711e9e3d02fc580b24203690c98abadb2fd26..1a7edfbe0b1cb1ae67588cc8ed0f32f1ab133374 100644 (file)
@@ -809,7 +809,7 @@ static void * worker_thread(void * dummy)
 
     free(ti);
 
-    ap_create_context(tpool, &ptrans);
+    ap_create_context(&ptrans, tpool);
 
     pthread_mutex_lock(&worker_thread_count_mutex);
     worker_thread_count++;
@@ -867,7 +867,7 @@ static void * worker_thread(void * dummy)
                     /* XXX: Should we check for POLLERR? */
                     if (listenfds[curr_pollfd].revents & POLLIN) {
                         last_pollfd = curr_pollfd;
-                        ap_put_os_sock(tpool, &sd, &listenfds[curr_pollfd].fd); 
+                        ap_put_os_sock(&sd, &listenfds[curr_pollfd].fd, tpool); 
                         goto got_fd;
                     }
                 } while (curr_pollfd != last_pollfd);
@@ -875,7 +875,7 @@ static void * worker_thread(void * dummy)
         }
     got_fd:
         if (!workers_may_exit) {
-            ap_accept(sd, &csd);
+            ap_accept(&csd, sd);
             SAFE_ACCEPT(accept_mutex_off(0));
             SAFE_ACCEPT(intra_mutex_off(0));
         }
@@ -918,7 +918,7 @@ static void child_main(int child_num_arg)
     ap_listen_rec *lr;
 
     my_pid = getpid();
-    ap_create_context(pconf, &pchild);
+    ap_create_context(&pchild, pconf);
 
     /*stuff to do before we switch id's, so we have permissions.*/
     reopen_scoreboard(pchild);
@@ -972,7 +972,7 @@ static void child_main(int child_num_arg)
        my_info->pid = my_child_num;
         my_info->tid = i;
        my_info->sd = 0;
-       ap_create_context(pchild, &my_info->tpool);
+       ap_create_context(&my_info->tpool, pchild);
        
        /* We are creating threads right now */
        (void) ap_update_child_status(my_child_num, i, SERVER_STARTING, 
index 043eb15f306f157b03086d142b81b3c7f964a8e3..1c2deeb2d72b12c9ca22860c89c87bb77749bf58 100644 (file)
@@ -542,8 +542,8 @@ static void accept_mutex_init(ap_context_t *p)
     unlock_it.l_pid = 0;               /* pid not actually interesting */
 
     expand_lock_fname(p);
-    ap_open(p, ap_lock_fname, APR_CREATE | APR_WRITE | APR_EXCL,
-            APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD, &tempfile);
+    ap_open(&tempfile, p, ap_lock_fname, APR_CREATE | APR_WRITE | APR_EXCL,
+            APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD);
     ap_get_os_file(tempfile, &lock_fd);
     if (lock_fd == -1) {
        perror("open");
@@ -605,7 +605,7 @@ static void accept_mutex_child_init(ap_context_t *p)
 {
     ap_file_t *tempfile;
 
-    ap_open(p, ap_lock_fname, APR_WRITE, APR_UREAD|APR_UWRITE, &tempfile);
+    ap_open(&tempfile, p, ap_lock_fname, APR_WRITE, APR_UREAD|APR_UWRITE);
     if (!tempfile) {
        ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,
                    "Child cannot open lock file: %s", ap_lock_fname);
@@ -1957,9 +1957,9 @@ static void child_main(int child_num_arg)
     /* Get a sub ap_context_t for global allocations in this child, so that
      * we can have cleanups occur when the child exits.
      */
-    ap_create_context(pconf, &pchild);
+    ap_create_context(&pchild, pconf);
 
-    ap_create_context(pchild, &ptrans);
+    ap_create_context(&ptrans, pchild);
 
     /* needs to be done before we switch UIDs so we have permissions */
     reopen_scoreboard(pchild);
@@ -2078,7 +2078,7 @@ static void child_main(int child_num_arg)
                    clean_child_exit(0);
                }
                clen = sizeof(sa_client);
-               stat = ap_accept(sd, &csd);
+               stat = ap_accept(&csd, sd);
                if (stat == APR_SUCCESS || stat != APR_EINTR)
                    break;
            }
index 0fd9ef2e54c60d90ed181396e6f8f293e64fda72..c3d8be2a19a238385899c8e881279d1f001b821c 100644 (file)
@@ -222,7 +222,7 @@ char *ap_rfc1413(conn_rec *conn, server_rec *srv)
 
     result = FROM_UNKNOWN;
 
-    if (ap_create_tcp_socket(conn->pool, &sock) != APR_SUCCESS) {
+    if (ap_create_tcp_socket(&sock, conn->pool) != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_CRIT, srv,
                    "socket: rfc1413: error creating socket");
        conn->remote_logname = result;
index ab897f06af0622825ed719be66eb1a81037fed2f..b2ca60e38bf15a0ac86d6be6be4416cdf47ccbaa 100644 (file)
@@ -885,7 +885,7 @@ API_EXPORT(configfile_t *) ap_pcfg_openfile(ap_context_t *p, const char *name)
         return NULL;
     }
  
-    stat = ap_open(p, name, APR_READ | APR_BUFFERED, APR_OS_DEFAULT, &file);
+    stat = ap_open(&file, p, name, APR_READ | APR_BUFFERED, APR_OS_DEFAULT);
 #ifdef DEBUG
     saved_errno = errno;
     ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, NULL,
index da65906826af7d258167b742569b6d9995938856..a71221fe856de568b71c3565655b1161ec6a83e6 100644 (file)
@@ -696,7 +696,7 @@ API_EXPORT(int) ap_call_exec(request_rec *r, ap_child_info_t *pinfo, char *argv0
      * since that is better than allowing errors to go unnoticed.  Don't do
      * this on Win32, though, since we haven't fork()'d.
      */
-    ap_put_os_file(r->pool, &r->server->error_log, &errfileno);
+    ap_put_os_file(&r->server->error_log, &errfileno, r->pool);
 #endif
 
     /* TODO: all that RLimit stuff should become part of the spawning API,