apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregory Nicholls <gnicho...@level8.com>
Subject [patch] add APR_DECLARE to function prototypes
Date Mon, 08 Jan 2001 18:34:29 GMT
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



Mime
View raw message