Desperately trying to scratch the itch here... ;-)
Below is a diff against latest CVS that, at least in my simple testcase, fixes the problem with the ordering of AxAddDynamicProcessor in the pipeline. But like I said before, I'm not a C guy (mostly hunt-peck-copy-paste on my part), and I may have overlooked something, so could someone please review this diff and make sure it's acceptable.
Thanks --Jason
Index: axconfig.c
===================================================================
RCS file: /home/cvspublic/xml-axkit/axconfig.c,v
retrieving revision 1.16
diff -c -u -r1.16 axconfig.c
cvs server: conflicting specifications of output style
--- axconfig.c 20 Sep 2002 17:00:24 -0000 1.16
+++ axconfig.c 15 Mar 2003 15:58:55 -0000
@@ -113,7 +113,6 @@
/* complex types */
new->type_map = NULL;
new->processors = NULL;
- new->dynamic_processors = NULL;
new->xsp_taglibs = NULL;
new->current_styles = NULL;
new->current_medias = NULL;
@@ -140,7 +139,6 @@
"new.debug_level: %d\n"
"new.type_map: %d\n"
"new.processors: %d\n"
- "new.dynamic_processors: %d\n"
"new.xsp_taglibs: %d\n"
"new.current_styles: %d\n"
"new.current_medias: %d\n"
@@ -164,7 +162,6 @@
new->debug_level,
new->type_map,
new->processors,
- new->dynamic_processors,
new->xsp_taglibs,
new->current_styles,
new->current_medias,
@@ -191,9 +188,6 @@
new->processors = newHV();
ap_register_cleanup(p, (void*)new->processors, ax_cleanup_hv, ap_null_cleanup);
- new->dynamic_processors = newAV();
- ap_register_cleanup(p, (void*)new->dynamic_processors, ax_cleanup_av, ap_null_cleanup);
-
new->xsp_taglibs = newHV();
ap_register_cleanup(p, (void*)new->xsp_taglibs, ax_cleanup_hv, ap_null_cleanup);
@@ -292,7 +286,6 @@
"parent_dir.debug_level: %d\n"
"parent_dir.type_map: %d\n"
"parent_dir.processors: %d\n"
- "parent_dir.dynamic_processors: %d\n"
"parent_dir.xsp_taglibs: %d\n"
"parent_dir.current_styles: %d\n"
"parent_dir.current_medias: %d\n"
@@ -316,7 +309,6 @@
parent_dir->debug_level,
parent_dir->type_map,
parent_dir->processors,
- parent_dir->dynamic_processors,
parent_dir->xsp_taglibs,
parent_dir->current_styles,
parent_dir->current_medias,
@@ -342,7 +334,6 @@
"subdir.debug_level: %d\n"
"subdir.type_map: %d\n"
"subdir.processors: %d\n"
- "subdir.dynamic_processors: %d\n"
"subdir.xsp_taglibs: %d\n"
"subdir.current_styles: %d\n"
"subdir.current_medias: %d\n"
@@ -366,7 +357,6 @@
subdir->debug_level,
subdir->type_map,
subdir->processors,
- subdir->dynamic_processors,
subdir->xsp_taglibs,
subdir->current_styles,
subdir->current_medias,
@@ -539,37 +529,6 @@
}{
- /* cfg->dynamic_processors */
- new->dynamic_processors = newAV();
- if (av_len(subdir->dynamic_processors) >= 0) {
- I32 key = 0;
- for(key = 0; key <= av_len(subdir->dynamic_processors); key++) {
- SV ** val = av_fetch(subdir->dynamic_processors, key, 0);
- if (val != NULL) {
- char * cval;
- STRLEN len;
- cval = ap_pstrdup(p, SvPV(*val, len));
- av_push(new->dynamic_processors, newSVpvn(cval, strlen(cval)));
- }
- }
- }
- else {
- I32 key = 0;
- for(key = 0; key <= av_len(parent_dir->dynamic_processors); key++) {
- SV ** val = av_fetch(parent_dir->dynamic_processors, key, 0);
- if (val != NULL) {
- char * cval;
- STRLEN len;
- cval = ap_pstrdup(p, SvPV(*val, len));
- av_push(new->dynamic_processors, newSVpvn(cval, strlen(cval)));
- }
- }
- }
-
- ap_register_cleanup(p, (void*)new->dynamic_processors, ax_cleanup_av, ap_null_cleanup);
- }
-
- {
/* cfg->xsp_taglibs */
new->xsp_taglibs = newHV();
if (HvKEYS(parent_dir->xsp_taglibs)) {
@@ -753,7 +712,6 @@
warn("merge results: %d\n"
"typemap: %d\n"
"processors: %d\n"
- "dynamic: %d\n"
"taglibs: %d\n"
"c_styles: %d\n"
"c_medias: %d\n"
@@ -762,7 +720,6 @@
new,
new->type_map,
new->processors,
- new->dynamic_processors,
new->xsp_taglibs,
new->current_styles,
new->current_medias,
@@ -809,10 +766,7 @@
ax_add_dynamic_processor (cmd_parms *cmd, axkit_dir_config *ax,
char *module)
{
- SV * mod_sv = newSVpv(module, 0);
- av_push(ax->dynamic_processors, mod_sv);
-
- return NULL;
+ return ax_add_type_processor(cmd, ax, "", "", module);
}
CHAR_P
@@ -1230,7 +1184,7 @@
"a mime type, a stylesheet, and a dtd filename" }, { "AxAddDynamicProcessor", ax_add_dynamic_processor,
- NULL, OR_ALL, TAKE1,
+ (void*)"Dynamic", OR_ALL, TAKE1,
"a package name" },{ "AxAddRootProcessor", ax_add_type_processor,
@@ -1524,8 +1478,6 @@
8, newRV_inc((SV*)cfg->type_map), 0);
hv_store(retval, "Processors",
10, newRV_inc((SV*)cfg->processors), 0);
- hv_store(retval, "DynamicProcessors",
- 17, newRV_inc((SV*)cfg->dynamic_processors), 0);
hv_store(retval, "XSPTaglibs",
10, newRV_inc((SV*)cfg->xsp_taglibs), 0);
hv_store(retval, "Plugins",
Index: lib/Apache/AxKit/ConfigReader.pm
===================================================================
RCS file: /home/cvspublic/xml-axkit/lib/Apache/AxKit/ConfigReader.pm,v
retrieving revision 1.14
diff -c -u -r1.14 ConfigReader.pm
cvs server: conflicting specifications of output style
--- lib/Apache/AxKit/ConfigReader.pm 20 Feb 2003 10:22:18 -0000 1.14
+++ lib/Apache/AxKit/ConfigReader.pm 15 Mar 2003 15:58:55 -0000
@@ -398,20 +398,18 @@
push @results, $style_hash;
}
}
+ elsif (lc($type) eq 'dynamic') {
+ my $package = $directive->[3];
+ AxKit::load_module($package);
+ no strict 'refs';
+ my($handler) = $package.'::handler';
+ push @results, $handler->($provider, $media, $style,
+ $doctype, $dtd, $root);
+ }
else {
warn "Unrecognised directive type: $type";
}
}
-
- # list any dynamically chosen stylesheets here
- $list = $self->{cfg}{DynamicProcessors} || [ $self->{apache}->dir_config->get('AxDynamicProcessors') ];
- foreach my $package (@$list) {
- AxKit::load_module($package);
- no strict 'refs';
- my($handler) = $package.'::handler';
- push @results, $handler->($provider, $media, $style,
- $doctype, $dtd, $root);
- }
return @results; }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
