You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@apache.org on 2002/08/27 06:28:38 UTC
cvs commit: modperl-2.0/xs/maps apache_functions.map
dougm 2002/08/26 21:28:38
Modified: xs/Apache/Module Apache__Module.h
xs/maps apache_functions.map
Log:
add Apache::Module->get_config method
Revision Changes Path
1.5 +44 -0 modperl-2.0/xs/Apache/Module/Apache__Module.h
Index: Apache__Module.h
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/Apache/Module/Apache__Module.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Apache__Module.h 7 Nov 2001 03:39:08 -0000 1.4
+++ Apache__Module.h 27 Aug 2002 04:28:38 -0000 1.5
@@ -37,3 +37,47 @@
return modperl_perl_module_loaded(aTHX_ name);
}
}
+
+static MP_INLINE SV *mpxs_Apache__Module_get_config(pTHX_
+ SV *self,
+ SV *pmodule,
+ server_rec *s,
+ ap_conf_vector_t *v)
+{
+ MP_dSCFG(s);
+ module *modp;
+ const char *name;
+ void *ptr;
+ PTR_TBL_t *table;
+ SV *obj;
+
+ if (!v) {
+ v = s->module_config;
+ }
+
+ if (SvROK(pmodule)) {
+ name = SvCLASS(pmodule);
+ }
+ else {
+ STRLEN n_a;
+ name = SvPV(pmodule, n_a);
+ }
+
+ if (!(modp = apr_hash_get(scfg->modules, name, APR_HASH_KEY_STRING))) {
+ return Nullsv;
+ }
+
+ if (!(ptr = ap_get_module_config(v, modp))) {
+ return Nullsv;
+ }
+
+ if (!(table = modperl_module_config_table_get(aTHX_ FALSE))) {
+ return Nullsv;
+ }
+
+ if (!(obj = ptr_table_fetch(table, ptr))) {
+ return Nullsv;
+ }
+
+ return SvREFCNT_inc(obj);
+}
1.58 +2 -0 modperl-2.0/xs/maps/apache_functions.map
Index: apache_functions.map
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/maps/apache_functions.map,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- apache_functions.map 24 Aug 2002 16:15:11 -0000 1.57
+++ apache_functions.map 27 Aug 2002 04:28:38 -0000 1.58
@@ -200,6 +200,8 @@
>ap_show_modules
>ap_register_hooks
mpxs_Apache__Module_loaded
+ #ap_get_module_config
+ mpxs_Apache__Module_get_config | | self, pmodule, s, v=NULL
MODULE=Apache::Directive
ap_directive_t *:DEFINE_conftree | | SV *:CLASS