httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: APR_DECLARE_OPTIONAL_FN and APR_RETRIEVE_OPTIONAL_FN
Date Thu, 09 Oct 2008 23:30:47 GMT
Andrej van der Zee wrote:
> 
> I was wondering what the purpose is of the macros
> APR_DECLARE_OPTIONAL_FN and APR_RETRIEVE_OPTIONAL_FN. For example, in
> mod_authn_dbd APR_RETRIEVE_OPTIONAL_FN is used to get a hold on the
> functions ap_dbd_acquire and ap_dbd_prepare declared in in mod_dbd
> with APR_DECLARE_OPTIONAL_FN. I could also directly invoke these
> functions as they are declared in the header file mod_dbd.h and let
> the loading of the module fail with an unresolved symbol if mod_dbd is
> not loaded. What is the benefit for using those macros?

Without them, it became impossible to build plugable frameworks without
linking one module to another.  Using this feature, it's possible to
determine if mod_log_config is loaded and there is a function for
publishing your config log extensions.  And if mod_log_config is not
present, your module can either hum along happily or decide to object
violently.  Your choice.


Mime
View raw message