From da7f803429e7ee209c81b484dc4b25dbde338ab0 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 4 Jul 2001 03:16:33 +0000 Subject: [PATCH] Having gone through and expnaded out the hook macro it seemed a waste to throw it away, so here it is added as comments for people who are in the same place I was trying to debug what was going on inside a hook. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89496 13f79535-47bb-0310-9956-ffa450edef68 --- server/config.c | 68 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 60 insertions(+), 8 deletions(-) diff --git a/server/config.c b/server/config.c index 73b78def95..7b7cf32f74 100644 --- a/server/config.c +++ b/server/config.c @@ -106,14 +106,14 @@ AP_DECLARE_DATA apr_array_header_t *ap_server_config_defines; AP_DECLARE_DATA ap_directive_t *ap_conftree; APR_HOOK_STRUCT( - APR_HOOK_LINK(header_parser) - APR_HOOK_LINK(pre_config) - APR_HOOK_LINK(post_config) - APR_HOOK_LINK(open_logs) - APR_HOOK_LINK(child_init) - APR_HOOK_LINK(handler) - APR_HOOK_LINK(quick_handler) - APR_HOOK_LINK(optional_fn_retrieve) + APR_HOOK_LINK(header_parser) + APR_HOOK_LINK(pre_config) + APR_HOOK_LINK(post_config) + APR_HOOK_LINK(open_logs) + APR_HOOK_LINK(child_init) + APR_HOOK_LINK(handler) + APR_HOOK_LINK(quick_handler) + APR_HOOK_LINK(optional_fn_retrieve) ) AP_IMPLEMENT_HOOK_RUN_ALL(int,header_parser, @@ -124,6 +124,58 @@ AP_IMPLEMENT_HOOK_VOID(pre_config, AP_IMPLEMENT_HOOK_VOID(post_config, (apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s),(pconf,plog,ptemp,s)) +/* During the course of debugging I expanded this macro out, so + * rather than remove all the useful information there is in the + * following lines, I'm going to leave it here in case anyone + * else finds it useful. + * + * Ben has looked at it and thinks it correct :) + * +AP_DECLARE(void) ap_hook_post_config(ap_HOOK_post_config_t *pf, + const char * const *aszPre, + const char * const *aszSucc, + int nOrder) +{ + ap_LINK_post_config_t *pHook; + + if(!_hooks.link_post_config) { + _hooks.link_post_config=apr_array_make(apr_global_hook_pool,1, + sizeof(ap_LINK_post_config_t)); + apr_hook_sort_register("post_config",&_hooks.link_post_config); + } + + pHook=apr_array_push(_hooks.link_post_config); + pHook->pFunc=pf; + pHook->aszPredecessors=aszPre; + pHook->aszSuccessors=aszSucc; + pHook->nOrder=nOrder; + pHook->szName=apr_current_hooking_module; + + if(apr_debug_module_hooks) + apr_show_hook("post_config",aszPre,aszSucc); +} + +AP_DECLARE(apr_array_header_t *) ap_hook_get_post_config(void) { + return _hooks.link_post_config; +} + +AP_DECLARE(void) ap_run_post_config (apr_pool_t *pconf, + apr_pool_t *plog, + apr_pool_t *ptemp, + server_rec *s) +{ + ap_LINK_post_config_t *pHook; + int n; + + if(!_hooks.link_post_config) + return; + + pHook=(ap_LINK_post_config_t *)_hooks.link_post_config->elts; + for(n=0 ; n < _hooks.link_post_config->nelts ; ++n) + pHook[n].pFunc (pconf, plog, ptemp, s); +} + */ + AP_IMPLEMENT_HOOK_VOID(open_logs, (apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s),(pconf,plog,ptemp,s)) -- 2.50.1