Return-Path: Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Delivered-To: mailing list dev@apr.apache.org Received: (qmail 80784 invoked from network); 8 Jan 2001 18:26:27 -0000 Received: from unknown (HELO corpmail.level8.com) (206.138.37.235) by h31.sny.collab.net with SMTP; 8 Jan 2001 18:26:27 -0000 Received: from level8.com (slip-166-72-126-139.fl.us.prserv.net [166.72.126.139]) by corpmail.level8.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id CK1VYHQH; Mon, 8 Jan 2001 13:26:06 -0500 Message-ID: <3A5A0835.4D2C6570@level8.com> Date: Mon, 08 Jan 2001 13:34:29 -0500 From: Gregory Nicholls X-Mailer: Mozilla 4.7 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: dev@apr.apache.org Subject: [patch] add APR_DECLARE to function prototypes References: <978892581.4218.ezmlm@apr.apache.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Hiya, This is part 1 of a multi-part patch to include APR_DECLARE(foo_t) statements for all external APR functions. To aid verification (and reduce the risk of a massive screw-up) I'm sending a seperate patch for each functional group starting with apr_pools. I'll wait for approval on this one before submitting the others in turn. Gregory Nicholls. ------------------------- cut here ------------------------------------ Index: apr_pools.c =================================================================== RCS file: /home/cvspublic/apr/lib/apr_pools.c,v retrieving revision 1.79 diff -u -d -b -r1.79 apr_pools.c --- apr_pools.c 2001/01/03 04:21:35 1.79 +++ apr_pools.c 2001/01/08 18:24:19 @@ -533,7 +533,7 @@ #endif /* ### why do we have this, in addition to apr_make_sub_pool? */ -apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) { apr_pool_t *newpool; @@ -663,7 +663,7 @@ return APR_SUCCESS; } -apr_status_t apr_init_alloc(apr_pool_t *globalp) +APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp) { #if APR_HAS_THREADS apr_status_t status; @@ -697,13 +697,13 @@ return APR_SUCCESS; } -void apr_term_alloc(apr_pool_t *globalp) +APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp) { + apr_destroy_pool(globalp); #if APR_HAS_THREADS apr_destroy_lock(alloc_mutex); apr_destroy_lock(spawn_mutex); #endif - apr_destroy_pool(globalp); } /* We only want to lock the mutex if we are being called from apr_clear_pool. @@ -993,7 +993,7 @@ * User data management functions */ -apr_status_t apr_set_userdata(const void *data, const char *key, +APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, apr_status_t (*cleanup) (void *), apr_pool_t *cont) { @@ -1014,7 +1014,7 @@ return APR_SUCCESS; } -apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key, apr_pool_t *cont) { if (cont->prog_data == NULL) *data = NULL; Index: apr_pools.h =================================================================== RCS file: /home/cvspublic/apr/include/apr_pools.h,v retrieving revision 1.37 diff -u -d -b -r1.37 apr_pools.h --- apr_pools.h 2000/12/31 18:04:59 1.37 +++ apr_pools.h 2001/01/08 18:24:29 @@ -215,7 +215,7 @@ * @tip Programs do NOT need to call this directly. APR will call this * automatically from apr_initialize. */ -apr_status_t apr_init_alloc(apr_pool_t *globalp); /* Set up everything */ +APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp); /* Set up everything */ /** * Tear down all of the internal structures required to use pools @@ -225,7 +225,7 @@ * @tip Programs do NOT need to call this directly. APR will call this * automatically from apr_terminate. */ -void apr_term_alloc(apr_pool_t *globalp); /* Tear down everything */ +APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp); /* Tear down everything */ /* pool functions */ @@ -237,7 +237,7 @@ * of it's parent pool's attributes, except the apr_pool_t will * be a sub-pool. */ -apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont); /** * Set the data associated with the current pool @@ -254,7 +254,7 @@ * It is advised that steps are taken to ensure that a unique * key is used at all times. */ -apr_status_t apr_set_userdata(const void *data, const char *key, +APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, apr_status_t (*cleanup) (void *), apr_pool_t *cont); @@ -264,7 +264,7 @@ * @param key The user data associated with the pool. * @param cont The current pool. */ -apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key, apr_pool_t *cont); /** * make a sub pool from the current pool