dougm 01/03/15 16:26:31 Modified: lib/ModPerl TypeMap.pm Log: more better guessing Revision Changes Path 1.5 +11 -2 modperl-2.0/lib/ModPerl/TypeMap.pm Index: TypeMap.pm =================================================================== RCS file: /home/cvs/modperl-2.0/lib/ModPerl/TypeMap.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- TypeMap.pm 2001/03/15 23:59:46 1.4 +++ TypeMap.pm 2001/03/16 00:26:29 1.5 @@ -214,7 +214,10 @@ $mf->{$_} = $map->{$_}; } - $mf->{class} = $map->{class} || $self->first_class($mf); + unless ($mf->{class}) { + $mf->{class} = $map->{class} || $self->first_class($mf); + #print "GUESS class=$mf->{class} for $mf->{name}\n"; + } $mf->{prefix} ||= ModPerl::FunctionMap::guess_prefix($mf); @@ -263,8 +266,14 @@ sub first_class { my($self, $func) = @_; + return $func->{return_type} if $func->{return_type} =~ /::/; + for my $e (@{ $func->{args} }) { - return $e->{type} if $e->{type} =~ /::/; + next unless $e->{type} =~ /::/; + #there are alot of util functions that take an APR::Pool + #that do not belong in the APR::Pool class + next if $e->{type} eq 'APR::Pool' and $func->{name} !~ /^apr_pool/; + return $e->{type}; } return $func->{name} =~ /^apr_/ ? 'APR' : 'Apache';