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

Reply via email to