]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
AP_ function for optional hooks.
authorBen Laurie <ben@apache.org>
Sun, 20 May 2001 14:13:33 +0000 (14:13 +0000)
committerBen Laurie <ben@apache.org>
Sun, 20 May 2001 14:13:33 +0000 (14:13 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89178 13f79535-47bb-0310-9956-ffa450edef68

include/ap_config.h
modules/experimental/mod_optional_hook_export.c
modules/experimental/mod_optional_hook_export.h
modules/experimental/mod_optional_hook_import.c
modules/test/mod_optional_hook_export.c
modules/test/mod_optional_hook_export.h
modules/test/mod_optional_hook_import.c

index 3e61ca69f8b306e5afb1279756e0463040bf8d5a..e961a903e4218bdc388353e1780e4dfe0450bfe0 100644 (file)
@@ -57,6 +57,7 @@
 
 #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"
index e17660572dc376d37c003e511de06e25600bc9b3..9717a02fd1f352549a1159fd8c759ca9b76854f3 100644 (file)
 #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)
index 0510ba0d77cdf524965bc9de6b916088ba3585aa..4e7f3f389134f15abe0dc57fcf048f099bd5aa81 100644 (file)
@@ -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 */
index 16e64ca77d351e5ca81a790c61e8e2eb726e5d2b..b2c2264080e4374271e77d23e88b1978f8ad6c9f 100644 (file)
@@ -67,8 +67,8 @@ static int ImportGenericHookTestHook(const char *szStr)
 
 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=
index e17660572dc376d37c003e511de06e25600bc9b3..9717a02fd1f352549a1159fd8c759ca9b76854f3 100644 (file)
 #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)
index 0510ba0d77cdf524965bc9de6b916088ba3585aa..4e7f3f389134f15abe0dc57fcf048f099bd5aa81 100644 (file)
@@ -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 */
index 16e64ca77d351e5ca81a790c61e8e2eb726e5d2b..b2c2264080e4374271e77d23e88b1978f8ad6c9f 100644 (file)
@@ -67,8 +67,8 @@ static int ImportGenericHookTestHook(const char *szStr)
 
 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=