#include "apr.h"
#include "apr_hooks.h"
+#include "apr_optional_hooks.h"
/**
* @file ap_config.h
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"
#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)
#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 */
static void ImportRegisterHooks(apr_pool_t *p)
{
- APR_OPTIONAL_HOOK(ap,optional_hook_test,ImportGenericHookTestHook,NULL,
- NULL,APR_HOOK_MIDDLE);
+ AP_OPTIONAL_HOOK(optional_hook_test,ImportGenericHookTestHook,NULL,
+ NULL,APR_HOOK_MIDDLE);
}
module optional_hook_import_module=
#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)
#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 */
static void ImportRegisterHooks(apr_pool_t *p)
{
- APR_OPTIONAL_HOOK(ap,optional_hook_test,ImportGenericHookTestHook,NULL,
- NULL,APR_HOOK_MIDDLE);
+ AP_OPTIONAL_HOOK(optional_hook_test,ImportGenericHookTestHook,NULL,
+ NULL,APR_HOOK_MIDDLE);
}
module optional_hook_import_module=