You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axkit-dev@xml.apache.org by jw...@apache.org on 2002/09/20 19:00:25 UTC
cvs commit: xml-axkit/lib AxKit.pm
jwalt 2002/09/20 10:00:24
Modified: . axconfig.c
lib AxKit.pm
Log:
- style ordering patch as discussed some time ago in conjunction with barries' article
- tiny debug improvement
Revision Changes Path
1.16 +36 -36 xml-axkit/axconfig.c
Index: axconfig.c
===================================================================
RCS file: /home/cvs/xml-axkit/axconfig.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- axconfig.c 28 Jun 2002 10:18:28 -0000 1.15
+++ axconfig.c 20 Sep 2002 17:00:24 -0000 1.16
@@ -602,6 +602,41 @@
new->processors = newHV();
+ hv_iterinit(subdir->processors);
+ while (val = hv_iternextsv(subdir->processors, &key, &len)) {
+ SV * subval;
+ I32 sublen;
+ char * subkey;
+ HV * subhash = (HV*)SvRV(val);
+
+ hv_iterinit(subhash);
+ while (subval = hv_iternextsv(subhash, &subkey, &sublen)) {
+ SV * one;
+ SV * two;
+ AV * ary;
+ I32 ary_len;
+ I32 i;
+
+ one = newSVpvn(ap_pstrdup(p, key), len);
+ two = newSVpvn(ap_pstrdup(p, subkey), sublen);
+
+ ary = (AV*)SvRV(subval);
+ ary_len = av_len(ary);
+
+ if (ary_len >= 0) {
+ for (i = 0; i <= ary_len; i++) {
+ SV ** elem = av_fetch(ary, i, 0);
+ if (elem) {
+ store_in_hv2(new->processors, one, two, newSVsv(*elem));
+ }
+ }
+ }
+
+ SvREFCNT_dec(one);
+ SvREFCNT_dec(two);
+ }
+ }
+
if (!subdir->reset_processors) {
hv_iterinit(parent_dir->processors);
while (val = hv_iternextsv(parent_dir->processors, &key, &len)) {
@@ -636,41 +671,6 @@
SvREFCNT_dec(one);
SvREFCNT_dec(two);
}
- }
- }
-
- hv_iterinit(subdir->processors);
- while (val = hv_iternextsv(subdir->processors, &key, &len)) {
- SV * subval;
- I32 sublen;
- char * subkey;
- HV * subhash = (HV*)SvRV(val);
-
- hv_iterinit(subhash);
- while (subval = hv_iternextsv(subhash, &subkey, &sublen)) {
- SV * one;
- SV * two;
- AV * ary;
- I32 ary_len;
- I32 i;
-
- one = newSVpvn(ap_pstrdup(p, key), len);
- two = newSVpvn(ap_pstrdup(p, subkey), sublen);
-
- ary = (AV*)SvRV(subval);
- ary_len = av_len(ary);
-
- if (ary_len >= 0) {
- for (i = 0; i <= ary_len; i++) {
- SV ** elem = av_fetch(ary, i, 0);
- if (elem) {
- store_in_hv2(new->processors, one, two, newSVsv(*elem));
- }
- }
- }
-
- SvREFCNT_dec(one);
- SvREFCNT_dec(two);
}
}
1.29 +6 -7 xml-axkit/lib/AxKit.pm
Index: AxKit.pm
===================================================================
RCS file: /home/cvs/xml-axkit/lib/AxKit.pm,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- AxKit.pm 12 Aug 2002 10:34:05 -0000 1.28
+++ AxKit.pm 20 Sep 2002 17:00:24 -0000 1.29
@@ -212,7 +212,7 @@
local $SIG{__DIE__} = sub { AxKit::prep_exception(@_)->throw };
# use Carp ();
- # local $SIG{'USR2'} = sub {
+ # local $SIG{'USR2'} = sub {
# Carp::confess("caught SIGUSR2!");
# };
@@ -270,7 +270,7 @@
}
return OK;
}
-
+
local $AxKit::Cache;
my $retcode = eval {
@@ -621,9 +621,8 @@
$mapto = $mapping->{$style->{type}};
}
- AxKit::load_module($mapto);
-
AxKit::Debug(3, "about to execute: $mapto\::handler");
+ AxKit::load_module($mapto);
my $method = "handler";
if (defined &{"$mapto\::$method"}) {
@@ -725,12 +724,12 @@
else {
AxKit::Debug(3, "styles not cached - calling \$provider->get_styles()");
my $styles = $provider->get_styles($media, $style);
-
+
$AxKit::Stash{$key} = {
styles => $styles,
mtime => $provider->mtime(),
};
-
+
return $styles;
}
}