httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Akins <bak...@web.turner.com>
Subject Re: mod_status idea
Date Fri, 08 Oct 2004 19:10:59 GMT
Cliff Woolley wrote:
>  "optional" part is that the module
> that /defines/ the hook (and calls it) might not actually be present
> itself, so modules that wish to participate in that hook should not be
> broken by that other module's absense.


Okay.

So, I would something like this in a "caller":


static APR_OPTIONAL_FN_TYPE(ap_register_status_state) *register_state = 
NULL;
static APR_OPTIONAL_FN_TYPE(ap_status_state_set) *set_state = NULL;

static int foo_state;


in post_config:

register_state = APR_RETRIEVE_OPTIONAL_FN(ap_register_status_state);
set_state = APR_RETRIEVE_OPTIONAL_FN(ap_status_state_set);

if(register_state ) {
	foo_state = register_state("Doing foo");
}


then in my handler or filter:

if(set_state) {
	set_state(foo_state);
}


Or something similar?

-- 
Brian Akins
Lead Systems Engineer
CNN Internet Technologies

Mime
View raw message