--=-CnJwt4JdJ5AWevcc2o+M
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hi!

I'm trying to port some Apache2 modules written in C to mod_perl, to
reduce the time and effort required to maintain them. The modules do
various small things, such as providing custom hooks for suExec and URL
translation. They hook extensively into Apache2 using ap_hook_*
functions.

The mod_perl 2.0 design document says:
"Access to all hooks will be provided by mod_perl in both the
traditional Perl*Handler configuration fashion and via dynamic
registration methods (the ap_hook_* functions)."
http://perl.apache.org/docs/2.0/user/design/design.html

However, I can't seem to find which ones are available as Perl*Handler
directives and how to access those that aren't.

Let's take a small example. I have C code that looks something like this
(trimmed down to show only what is needed here):

static void register_hooks(apr_pool_t * p)
{
ap_hook_get_suexec_identity(my_suxec_id_doer, NULL, NULL,
APR_HOOK_FIRST + 1);
}

AP_DECLARE_DATA module my_nice_module =3D {
STANDARD20_MODULE_STUFF,
NULL, /* create per-directory config structure */
NULL, /* merge per-directory config structures */
NULL, /* create per-server config structure */
NULL, /* merge per-server config structures */
NULL, /* command apr_table_t */
register_hooks /* register hooks */
};

Obviously, get_suexec_id_doer is a function that returns a pointer to a
ap_unix_identity_t structure. How it works is irrelevant here.

The question is, how do I implement the above in mod_perl? More
generally, how do I implement an arbitrary ap_hook_* function in Perl
and register it with Apache2?

TIA,
--=20
Fabian Fagerholm

--=-CnJwt4JdJ5AWevcc2o+M
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFF+iT76VUNpZBmeIRAiuRAJ9XZCbqaRK2hG+Fyq0LWY Zfirc1LACdFT+e
yaGmZD+0s5wPEbPCuxQJE0g=
=Inkb
-----END PGP SIGNATURE-----

--=-CnJwt4JdJ5AWevcc2o+M--