httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@hyperreal.org
Subject cvs commit: apache-2.0/mpm/src/include ap_hooks.h
Date Sat, 10 Jul 1999 18:58:18 GMT
ben         99/07/10 11:58:17

  Modified:    mpm/src/include ap_hooks.h
  Log:
  Use arrays for hooks.
  
  Revision  Changes    Path
  1.4       +12 -7     apache-2.0/mpm/src/include/ap_hooks.h
  
  Index: ap_hooks.h
  ===================================================================
  RCS file: /export/home/cvs/apache-2.0/mpm/src/include/ap_hooks.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ap_hooks.h	1999/07/10 13:32:46	1.3
  +++ ap_hooks.h	1999/07/10 18:58:17	1.4
  @@ -10,33 +10,38 @@
   typedef struct _LINK_##name \
       { \
       HOOK_##name *pFunc; \
  -    struct _LINK_##name *pNext; \
       } LINK_##name;
   
   #define HOOK_STRUCT(members) \
   static struct { members } _hooks;
   
   #define HOOK_LINK(name) \
  -    LINK_##name *link_##name;
  +    array_header *link_##name;
   
   #define IMPLEMENT_HOOK_BASE(ret,rv_decl,sv,rv,name,args,args2,run_all,term1,term2,rv_final)
\
   void ap_hook_##name(HOOK_##name *pf) \
       { \
  -    LINK_##name *pHook=ap_palloc(g_pHookPool,sizeof(LINK_##name)); \
  -    pHook->pNext=_hooks.link_##name; \
  +    LINK_##name *pHook; \
  +    if(!_hooks.link_##name) \
  +	_hooks.link_##name=ap_make_array(g_pHookPool,1,sizeof(LINK_##name)); \
  +    pHook=ap_push_array(_hooks.link_##name); \
       pHook->pFunc=pf; \
  -    _hooks.link_##name=pHook; \
       if(g_bDebugHooks) \
   	puts("  Hooked " #name); \
       } \
   ret ap_run_##name args \
       { \
       LINK_##name *pHook; \
  +    int n; \
       rv_decl \
  +\
  +    if(!_hooks.link_##name) \
  +	return rv_final; \
   \
  -    for(pHook=_hooks.link_##name ; pHook ; pHook=pHook->pNext) \
  +    pHook=(LINK_##name *)_hooks.link_##name->elts; \
  +    for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \
   	{ \
  -	sv pHook->pFunc args2; \
  +	sv pHook[n].pFunc args2; \
   \
   	if(term1 && (!run_all || term2)) \
   	    return rv; \
  
  
  

Mime
View raw message