apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@locus.apache.org
Subject cvs commit: apr-util/include ap_hooks.h
Date Wed, 06 Dec 2000 05:59:51 GMT
wrowe       00/12/05 21:59:51

  Modified:    include  ap_config.h
               include  ap_hooks.h
  Log:
    This solves two issues, one is a backref from apr-util into the
    apache namespace, and the second is the proper linkage declarations
    and their explanations.  Documented the distinction between
    AP_IMPLEMENT_HOOK_ and AP_IMPLEMENT_EXPORT_HOOK_
  
    This doesn't resolve any export issues within apr-util, however.
  
  Revision  Changes    Path
  1.48      +46 -0     httpd-2.0/include/ap_config.h
  
  Index: ap_config.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/ap_config.h,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- ap_config.h	2000/10/19 00:04:55	1.47
  +++ ap_config.h	2000/12/06 05:59:50	1.48
  @@ -57,6 +57,7 @@
   
   #include "ap_mmn.h"		/* MODULE_MAGIC_NUMBER_ */
   #include "apr_lib.h"		/* apr_isfoo() macros */
  +#include "ap_hooks.h"
   
   /**
    * AP_DECLARE_EXPORT is defined when building the Apache Core dynamic
  @@ -135,6 +136,51 @@
   /* XXX: Must go away, perhaps into compat, maybe not even there.
    */
   #define MODULE_VAR_EXPORT    AP_MODULE_DECLARE_DATA
  +
  +#define AP_DECLARE_HOOK(ret,name,args) \
  +AP_DECLARE_EXTERNAL_HOOK(AP,ret,name,args)
  +
  +#define AP_IMPLEMENT_HOOK_BASE(name) \
  +AP_IMPLEMENT_EXTERNAL_HOOK_BASE(AP,name)
  +
  +/**
  + * Implement an Apache core hook that has no return code, and therefore 
  + * runs all of the registered functions
  + * @param name The name of the hook
  + * @param args_decl The declaration of the arguments for the hook
  + * @param args_used The names for the arguments for the hook
  + * @deffunc void AP_IMPLEMENT_HOOK_VOID(name, args_decl, args_use)
  + * @tip If IMPLEMENTing a hook that is not linked into the Apache core,
  + * (e.g. within a dso) see AP_IMPLEMENT_EXTERNAL_HOOK_HOOK_VOID.
  + */
  +#define AP_IMPLEMENT_HOOK_VOID(name,args_decl,args_use) \
  +AP_IMPLEMENT_EXTERNAL_HOOK_VOID(AP,name,args_decl,args_use)
  +
  +/**
  + * Implement an Apache core hook that runs until one of the functions 
  + * returns something other than OK or DECLINE
  + * @param name The name of the hook
  + * @param args_decl The declaration of the arguments for the hook
  + * @param args_used The names for the arguments for the hook
  + * @deffunc int AP_IMPLEMENT_HOOK_RUN_ALL(name, args_decl, args_use)
  + * @tip If IMPLEMENTing a hook that is not linked into the Apache core,
  + * (e.g. within a dso) see AP_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL.
  + */
  +#define AP_IMPLEMENT_HOOK_RUN_ALL(ret,name,args_decl,args_use,ok,decline) \
  +AP_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(AP,ret,name,args_decl,args_use,ok,decline)
  +
  +/**
  + * Implement a hook that runs until the first function returns something
  + * other than DECLINE
  + * @param name The name of the hook
  + * @param args_decl The declaration of the arguments for the hook
  + * @param args_used The names for the arguments for the hook
  + * @deffunc int AP_IMPLEMENT_HOOK_RUN_FIRST(name, args_decl, args_use)
  + * @tip If IMPLEMENTing a hook that is not linked into the Apache core
  + * (e.g. within a dso) see AP_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST.
  + */
  +#define AP_IMPLEMENT_HOOK_RUN_FIRST(ret,name,args_decl,args_use,decline) \
  +AP_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(AP,ret,name,args_decl,args_use,decline)
   
   #ifdef WIN32
   #include "os.h"
  
  
  
  1.28      +22 -29    apr-util/include/ap_hooks.h
  
  Index: ap_hooks.h
  ===================================================================
  RCS file: /home/cvs/apr-util/include/ap_hooks.h,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- ap_hooks.h	2000/12/05 14:27:05	1.27
  +++ ap_hooks.h	2000/12/06 05:59:51	1.28
  @@ -76,9 +76,6 @@
       int nOrder; \
       } LINK_##name;
   
  -#define AP_DECLARE_HOOK(ret,name,args) \
  -AP_DECLARE_EXTERNAL_HOOK(AP,ret,name,args)
  -
   #define AP_HOOK_STRUCT(members) \
   static struct { members } _hooks;
   
  @@ -104,15 +101,19 @@
       if(ap_debug_module_hooks) \
   	ap_show_hook(#name,aszPre,aszSucc); \
       }
  -
  -#define AP_IMPLEMENT_HOOK_BASE(name) \
  -AP_IMPLEMENT_EXTERNAL_HOOK_BASE(AP,name)
   
  -/* RUN_ALL runs to the first one to return other than ok or decline
  -   RUN_FIRST runs to the first one to return other than decline
  -   VOID runs all
  -*/
  -
  +/**
  + * Implement a hook that has no return code, and therefore runs all of the
  + * registered functions
  + * @param link The linkage declaration prefix of the hook
  + * @param name The name of the hook
  + * @param args_decl The declaration of the arguments for the hook
  + * @param args_used The names for the arguments for the hook
  + * @deffunc void AP_IMPLEMENT_EXTERNAL_HOOK_VOID(link, name, args_decl, args_use)
  + * @tip The link prefix FOO corresponds to FOO_DECLARE() macros, which
  + * provide export linkage from the module that IMPLEMENTs the hook, and
  + * import linkage from external modules that link to the hook's module.
  + */
   #define AP_IMPLEMENT_EXTERNAL_HOOK_VOID(link,name,args_decl,args_use) \
   AP_IMPLEMENT_EXTERNAL_HOOK_BASE(link,name) \
   link##_DECLARE(void) ap_run_##name args_decl \
  @@ -128,27 +129,20 @@
   	pHook[n].pFunc args_use; \
       }
   
  -/**
  - * Implement a hook that has no return code, and therefore runs all of the
  - * registered functions
  - * @param name The name of the hook
  - * @param args_decl The declaration of the arguments for the hook
  - * @param args_used The names for the arguments for the hook
  - * @deffunc void AP_IMPLEMENT_VOID(name, args_decl, args_use)
  - */
  -#define AP_IMPLEMENT_HOOK_VOID(name,args_decl,args_use) \
  -AP_IMPLEMENT_EXTERNAL_HOOK_VOID(AP,name,args_decl,args_use)
  -
   /* FIXME: note that this returns ok when nothing is run. I suspect it should
      really return decline, but that breaks Apache currently - Ben
   */
   /**
    * Implement a hook that runs until one of the functions returns something
    * other than OK or DECLINE
  + * @param link The linkage declaration prefix of the hook
    * @param name The name of the hook
    * @param args_decl The declaration of the arguments for the hook
    * @param args_used The names for the arguments for the hook
  - * @deffunc int AP_IMPLEMENT_ALL(name, args_decl, args_use)
  + * @deffunc int AP_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(link, name, args_decl, args_use)
  + * @tip The link prefix FOO corresponds to FOO_DECLARE() macros, which
  + * provide export linkage from the module that IMPLEMENTs the hook, and
  + * import linkage from external modules that link to the hook's module.
    */
   #define AP_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(link,ret,name,args_decl,args_use,ok,decline)
\
   AP_IMPLEMENT_EXTERNAL_HOOK_BASE(link,name) \
  @@ -172,16 +166,18 @@
       return ok; \
       }
   
  -#define AP_IMPLEMENT_HOOK_RUN_ALL(ret,name,args_decl,args_use,ok,decline) \
  -AP_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(AP,ret,name,args_decl,args_use,ok,decline)
   
   /**
    * Implement a hook that runs until the first function returns something
    * other than DECLINE
  + * @param link The linkage declaration prefix of the hook
    * @param name The name of the hook
    * @param args_decl The declaration of the arguments for the hook
    * @param args_used The names for the arguments for the hook
  - * @deffunc int AP_IMPLEMENT_FIRST(name, args_decl, args_use)
  + * @deffunc int AP_IMPLEMENT_HOOK_RUN_FIRST(link, name, args_decl, args_use)
  + * @tip The link prefix FOO corresponds to FOO_DECLARE() macros, which
  + * provide export linkage from the module that IMPLEMENTs the hook, and
  + * import linkage from external modules that link to the hook's module.
    */
   #define AP_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(link,ret,name,args_decl,args_use,decline)
\
   AP_IMPLEMENT_EXTERNAL_HOOK_BASE(link,name) \
  @@ -204,9 +200,6 @@
   	} \
       return decline; \
       }
  -
  -#define AP_IMPLEMENT_HOOK_RUN_FIRST(ret,name,args_decl,args_use,decline) \
  -AP_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(AP,ret,name,args_decl,args_use,decline)
   
        /* Hook orderings */
   #define AP_HOOK_REALLY_FIRST	(-10)
  
  
  

Mime
View raw message