apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stri...@apache.org
Subject cvs commit: apr/include apr_pools.h apr_thread_mutex.h
Date Wed, 20 Mar 2002 09:01:24 GMT
striker     02/03/20 01:01:24

  Modified:    include  apr_pools.h apr_thread_mutex.h
  Log:
  Move the pool accessor macros to before we do any includes that
  depend on pools.  This allows us to use APR_POOL_DECLARE_ACCESSOR
  in apr_thread_mutex.h again.
  
  Revision  Changes    Path
  1.85      +37 -35    apr/include/apr_pools.h
  
  Index: apr_pools.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_pools.h,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -r1.84 -r1.85
  --- apr_pools.h	18 Mar 2002 16:46:41 -0000	1.84
  +++ apr_pools.h	20 Mar 2002 09:01:24 -0000	1.85
  @@ -89,6 +89,43 @@
   /** The fundamental pool type */
   typedef struct apr_pool_t apr_pool_t;
   
  +
  +/**
  + * Pool accessor functions.
  + *
  + * These standardized function are used by opaque (APR) data types to return
  + * the apr_pool_t that is associated with the data type.
  + *
  + * APR_POOL_DECLARE_ACCESSOR() is used in a header file to declare the
  + * accessor function. A typical usage and result would be:
  + *
  + *    APR_POOL_DECLARE_ACCESSOR(file);
  + * becomes:
  + *    APR_DECLARE(apr_pool_t *) apr_file_pool_get(apr_file_t *ob);
  + *
  + * In the implementation, the APR_POOL_IMPLEMENT_ACCESSOR() is used to
  + * actually define the function. It assumes the field is named "pool". For
  + * data types with a different field name (e.g. "cont" or "cntxt") the
  + * APR_POOL_IMPLEMENT_ACCESSOR_X() macro should be used.
  + *
  + * Note: the linkage is specified for APR. It would be possible to expand
  + *       the macros to support other linkages.
  + */
  +
  +#define APR_POOL_DECLARE_ACCESSOR(typename) \
  +    APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \
  +        (const apr_##typename##_t *ob)
  +
  +/** used to implement the pool accessor */
  +#define APR_POOL_IMPLEMENT_ACCESSOR(typename) \
  +    APR_POOL_IMPLEMENT_ACCESSOR_X(typename, pool)
  +
  +/** used to implement the pool accessor */
  +#define APR_POOL_IMPLEMENT_ACCESSOR_X(typename, fieldname) \
  +    APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \
  +        (const apr_##typename##_t *ob) { return ob->fieldname; }
  +
  +
   #include "apr_allocator.h"
   
   /**
  @@ -636,41 +673,6 @@
   
   #endif /* APR_POOL_DEBUG or DOXYGEN */
   
  -
  -/**
  - * Pool accessor functions.
  - *
  - * These standardized function are used by opaque (APR) data types to return
  - * the apr_pool_t that is associated with the data type.
  - *
  - * APR_POOL_DECLARE_ACCESSOR() is used in a header file to declare the
  - * accessor function. A typical usage and result would be:
  - *
  - *    APR_POOL_DECLARE_ACCESSOR(file);
  - * becomes:
  - *    APR_DECLARE(apr_pool_t *) apr_file_pool_get(apr_file_t *ob);
  - *
  - * In the implementation, the APR_POOL_IMPLEMENT_ACCESSOR() is used to
  - * actually define the function. It assumes the field is named "pool". For
  - * data types with a different field name (e.g. "cont" or "cntxt") the
  - * APR_POOL_IMPLEMENT_ACCESSOR_X() macro should be used.
  - *
  - * Note: the linkage is specified for APR. It would be possible to expand
  - *       the macros to support other linkages.
  - */
  -
  -#define APR_POOL_DECLARE_ACCESSOR(typename) \
  -    APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \
  -        (const apr_##typename##_t *ob)
  -
  -/** used to implement the pool accessor */
  -#define APR_POOL_IMPLEMENT_ACCESSOR(typename) \
  -    APR_POOL_IMPLEMENT_ACCESSOR_X(typename, pool)
  -
  -/** used to implement the pool accessor */
  -#define APR_POOL_IMPLEMENT_ACCESSOR_X(typename, fieldname) \
  -    APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \
  -        (const apr_##typename##_t *ob) { return ob->fieldname; }
   
   /** @} */
   #ifdef __cplusplus
  
  
  
  1.9       +1 -10     apr/include/apr_thread_mutex.h
  
  Index: apr_thread_mutex.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_thread_mutex.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- apr_thread_mutex.h	15 Mar 2002 00:48:24 -0000	1.8
  +++ apr_thread_mutex.h	20 Mar 2002 09:01:24 -0000	1.9
  @@ -127,16 +127,7 @@
    * Get the pool used by this thread_mutex.
    * @return apr_pool_t the pool
    */
  -/*
  - * XXX: We should do:
  - *
  - * APR_POOL_DECLARE_ACCESSOR(thread_mutex);
  - *
  - * But since there is a dependency between apr_thread_mutex.h, apr_pools.h
  - * and apr_allocator.h, this won't work without lots of warnings.  Spelling
  - * it out resolves the problem.
  - */
  -APR_DECLARE(apr_pool_t *) apr_thread_mutex_pool_get (const apr_thread_mutex_t *ob);
  +APR_POOL_DECLARE_ACCESSOR(thread_mutex);
   
   
   #endif /* APR_HAS_THREADS */
  
  
  

Mime
View raw message