Commit a5393295 authored by Ben Laurie's avatar Ben Laurie
Browse files

AP_ function for optional hooks.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89178 13f79535-47bb-0310-9956-ffa450edef68
parent 6598b336
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@

#include "apr.h"
#include "apr_hooks.h"
#include "apr_optional_hooks.h"

/**
 * @file ap_config.h
@@ -229,6 +230,27 @@
	APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ap,AP,ret,name,args_decl, \
                                              args_use,decline)

/* Note that the other optional hook implementations are straightforward but
 * have not yet been needed
 */

/**
 * Implement an optional hook. This is exactly the same as a standard hook
 * implementation, except the hook is optional.
 * @see AP_IMPLEMENT_HOOK_RUN_ALL
 */
#define AP_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ret,name,args_decl,args_use,ok, \
					   decline) \
	APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ap,AP,ret,name,args_decl, \
                                            args_use,ok,decline)

/**
 * Hook an optional hook. Unlike static hooks, this uses a macro instead of a
 * function
 */
#define AP_OPTIONAL_HOOK(name,fn,pre,succ,order) \
        APR_OPTIONAL_HOOK(ap,name,fn,pre,succ,order)

#include "os.h"
#ifndef WIN32
#include "ap_config_auto.h"
+3 −1
Original line number Diff line number Diff line
@@ -57,8 +57,10 @@
#include "mod_optional_hook_export.h"
#include "http_protocol.h"

APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ap,AP_MODULE,int,optional_hook_test,
/*APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ap,AP_MODULE,int,optional_hook_test,
				    (const char *szStr),
				    (szStr),OK,DECLINED)*/
AP_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(int,optional_hook_test,(const char *szStr),
				    (szStr),OK,DECLINED)

static int ExportLogTransaction(request_rec *r)
+1 −1
Original line number Diff line number Diff line
@@ -57,6 +57,6 @@

#include "apr_optional_hooks.h"

APR_DECLARE_EXTERNAL_HOOK(ap,AP_MODULE,int,optional_hook_test,(const char *))
AP_DECLARE_HOOK(int,optional_hook_test,(const char *))

#endif /* def MOD_OPTIONAL_HOOK_EXPORT_H */
+2 −2
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ static int ImportGenericHookTestHook(const char *szStr)

static void ImportRegisterHooks(apr_pool_t *p)
{
    APR_OPTIONAL_HOOK(ap,optional_hook_test,ImportGenericHookTestHook,NULL,
    AP_OPTIONAL_HOOK(optional_hook_test,ImportGenericHookTestHook,NULL,
		     NULL,APR_HOOK_MIDDLE);
}

+3 −1
Original line number Diff line number Diff line
@@ -57,8 +57,10 @@
#include "mod_optional_hook_export.h"
#include "http_protocol.h"

APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ap,AP_MODULE,int,optional_hook_test,
/*APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ap,AP_MODULE,int,optional_hook_test,
				    (const char *szStr),
				    (szStr),OK,DECLINED)*/
AP_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(int,optional_hook_test,(const char *szStr),
				    (szStr),OK,DECLINED)

static int ExportLogTransaction(request_rec *r)
Loading