You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Srebrenko Sehic <ss...@gmail.com> on 2006/09/14 11:58:25 UTC

[mp2] accessing mod_perl configuration from another C module

I need to tap into PerlSetVar table from another C module. In mp1, you
can do something like the following:

#include "mod_perl.h"
....
perl_dir_config *c = (perl_dir_config *)
ap_get_module_config(r->per_dir_config, &perl_module);
table *perl_vars = c->vars;

char *value = ap_table_get(perl_vars, "MyPerlVar");

Does anyone know the equivalent code for mp2?

Thanks,
Srebrenko

Re: [mp2] accessing mod_perl configuration from another C module

Posted by Srebrenko Sehic <ss...@gmail.com>.
On 9/14/06, Srebrenko Sehic <ss...@gmail.com> wrote:

> I need to tap into PerlSetVar table from another C module. In mp1, you
> can do something like the following:
>
> #include "mod_perl.h"
> ....
> perl_dir_config *c = (perl_dir_config *)
> ap_get_module_config(r->per_dir_config, &perl_module);
> table *perl_vars = c->vars;
>
> char *value = ap_table_get(perl_vars, "MyPerlVar");
>
> Does anyone know the equivalent code for mp2?

Replying to my own post. MP2 version of the above code should be:

modperl_config_dir_t *c = (modperl_config_dir_t *)
	    ap_get_module_config(r->per_dir_config, &perl_module);
apr_table_t *perl_vars = c->setvars;

char *value = ap_table_get(perl_vars, "MyPerlVar");