diff options
author | Jeff Trawick <trawick@apache.org> | 2009-09-30 22:00:37 +0200 |
---|---|---|
committer | Jeff Trawick <trawick@apache.org> | 2009-09-30 22:00:37 +0200 |
commit | e054fa7183a07f7ef3eb6e1cbc20aa3bbffda629 (patch) | |
tree | ec9993aab12e69c5f6afbe1608a8d85234093acf /modules/core | |
parent | don't override the user's choice (e.g., --enable-watchdog) (diff) | |
download | apache2-e054fa7183a07f7ef3eb6e1cbc20aa3bbffda629.tar.xz apache2-e054fa7183a07f7ef3eb6e1cbc20aa3bbffda629.zip |
change the callable functions in the mod_watchdog API
to optional hooks to avoid module ordering or other symbol
resolution issues; affected:
ap_watchdog_get_instance
ap_watchdog_register_callback
ap_watchdog_set_callback_interval
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@820427 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/core')
-rw-r--r-- | modules/core/mod_watchdog.c | 29 | ||||
-rw-r--r-- | modules/core/mod_watchdog.h | 23 |
2 files changed, 26 insertions, 26 deletions
diff --git a/modules/core/mod_watchdog.c b/modules/core/mod_watchdog.c index 838171b098..a7f9b621e9 100644 --- a/modules/core/mod_watchdog.c +++ b/modules/core/mod_watchdog.c @@ -300,11 +300,11 @@ static apr_status_t wd_startup(ap_watchdog_t *w, apr_pool_t *p) return rc; } -AP_WD_DECLARE(apr_status_t) ap_watchdog_get_instance(ap_watchdog_t **watchdog, - const char *name, - int parent, - int singleton, - apr_pool_t *p) +static apr_status_t ap_watchdog_get_instance(ap_watchdog_t **watchdog, + const char *name, + int parent, + int singleton, + apr_pool_t *p) { ap_watchdog_t *w; const char *pver = parent ? AP_WATCHODG_PVERSION : AP_WATCHODG_CVERSION; @@ -330,10 +330,10 @@ AP_WD_DECLARE(apr_status_t) ap_watchdog_get_instance(ap_watchdog_t **watchdog, pver, *watchdog); } -AP_WD_DECLARE(apr_status_t) ap_watchdog_set_callback_interval(ap_watchdog_t *w, - apr_interval_time_t interval, - const void *data, - ap_watchdog_callback_fn_t *callback) +static apr_status_t ap_watchdog_set_callback_interval(ap_watchdog_t *w, + apr_interval_time_t interval, + const void *data, + ap_watchdog_callback_fn_t *callback) { watchdog_list_t *c = w->callbacks; apr_status_t rv = APR_EOF; @@ -355,10 +355,10 @@ AP_WD_DECLARE(apr_status_t) ap_watchdog_set_callback_interval(ap_watchdog_t *w, return rv; } -AP_WD_DECLARE(apr_status_t) ap_watchdog_register_callback(ap_watchdog_t *w, - apr_interval_time_t interval, - const void *data, - ap_watchdog_callback_fn_t *callback) +static apr_status_t ap_watchdog_register_callback(ap_watchdog_t *w, + apr_interval_time_t interval, + const void *data, + ap_watchdog_callback_fn_t *callback) { watchdog_list_t *c = w->callbacks; @@ -718,6 +718,9 @@ static void wd_register_hooks(apr_pool_t *p) NULL, APR_HOOK_MIDDLE); + APR_REGISTER_OPTIONAL_FN(ap_watchdog_get_instance); + APR_REGISTER_OPTIONAL_FN(ap_watchdog_register_callback); + APR_REGISTER_OPTIONAL_FN(ap_watchdog_set_callback_interval); } /*--------------------------------------------------------------------------*/ diff --git a/modules/core/mod_watchdog.h b/modules/core/mod_watchdog.h index a86de29831..540048161e 100644 --- a/modules/core/mod_watchdog.h +++ b/modules/core/mod_watchdog.h @@ -37,6 +37,7 @@ #include "apr_shm.h" #include "apr_hash.h" #include "apr_hooks.h" +#include "apr_optional.h" #include "apr_file_io.h" #include "apr_time.h" #include "apr_thread_proc.h" @@ -131,11 +132,9 @@ typedef apr_status_t ap_watchdog_callback_fn_t(int state, void *data, * and function will create a new watchdog instance. * Note that default client process watchdog works in singleton mode. */ -AP_WD_DECLARE(apr_status_t) ap_watchdog_get_instance(ap_watchdog_t **watchdog, - const char *name, - int parent, - int singleton, - apr_pool_t *p); +APR_DECLARE_OPTIONAL_FN(apr_status_t, ap_watchdog_get_instance, + (ap_watchdog_t **watchdog, const char *name, int parent, + int singleton, apr_pool_t *p)); /** * Register watchdog callback. @@ -145,10 +144,9 @@ AP_WD_DECLARE(apr_status_t) ap_watchdog_get_instance(ap_watchdog_t **watchdog, * @param data The data to pass to the callback function. * @return APR_SUCCESS if all went well. APR_EEXIST if already registered. */ -AP_WD_DECLARE(apr_status_t) ap_watchdog_register_callback(ap_watchdog_t *watchdog, - apr_interval_time_t interval, - const void *data, - ap_watchdog_callback_fn_t *callback); +APR_DECLARE_OPTIONAL_FN(apr_status_t, ap_watchdog_register_callback, + (ap_watchdog_t *watchdog, apr_interval_time_t interval, + const void *data, ap_watchdog_callback_fn_t *callback)); /** * Update registered watchdog callback interval. @@ -158,10 +156,9 @@ AP_WD_DECLARE(apr_status_t) ap_watchdog_register_callback(ap_watchdog_t *watchdo * @param data The data to pass to the callback function. * @return APR_SUCCESS if all went well. APR_EOF if callback was not found. */ -AP_WD_DECLARE(apr_status_t) ap_watchdog_set_callback_interval(ap_watchdog_t *w, - apr_interval_time_t interval, - const void *data, - ap_watchdog_callback_fn_t *callback); +APR_DECLARE_OPTIONAL_FN(apr_status_t, ap_watchdog_set_callback_interval, + (ap_watchdog_t *w, apr_interval_time_t interval, + const void *data, ap_watchdog_callback_fn_t *callback)); /** * Watchdog require hook. |