On Mon, 6 May 2002, Tahiry Ramanamampanoharana wrote: > One thing I don't understand: why make ap_register_rewrite_mapfunc() > static and then export it as an optional function? Why isn'it directly a > public function provided by mod_rewrite?
Good question. The answer is that if you didn't use an optional function and some other module (or even the core) tried to extend mod_rewrite using ap_register_rewrite_mapfunc() and mod_rewrite was not loaded, there would be a link failure (possibly even at runtime if the other module is a DSO). Using an optional function allows the other module to skip over the extension gracefully. Practical example: consider mod_cgi and mod_include. mod_include exports the optional function ap_register_include_handler(), which allows other modules to extend mod_include with their own SSI tag types. mod_cgi does this for the <!--#exec ...--> tag. If ap_register_include_handler() were not an optional function, mod_cgi could not be loaded without mod_include also being loaded, which is clearly not what you'd want, since mod_cgi is quite functional without the SSI extension it happens to provide. Make sense? --Cliff -------------------------------------------------------------- Cliff Woolley [EMAIL PROTECTED] Charlottesville, VA
