dougm       01/04/19 20:07:55

  Modified:    Apache-Test/lib/Apache Test.pm
               lib/Apache compat.pm
               lib/ModPerl FunctionMap.pm WrapXS.pm
               xs/Apache/RequestIO Apache__RequestIO.h
               xs/maps  modperl_functions.map
  Log:
  better implementation of Apache::RequestRec::TIEHANDLE
  add Apache::RequestRec::PRINT alias
  expand DEFINE_* prefixes in ModPerl::FunctionTable to avoid name clashes
  
  Revision  Changes    Path
  1.4       +2 -6      modperl-2.0/Apache-Test/lib/Apache/Test.pm
  
  Index: Test.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/Test.pm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Test.pm   2001/04/18 04:36:56     1.3
  +++ Test.pm   2001/04/20 03:07:52     1.4
  @@ -20,12 +20,8 @@
   sub init_test_pm {
       my $r = shift;
   
  -    if (defined &Apache::RequestRec::puts) {
  -        package Apache::RequestRec;
  -        unless (defined &PRINT) {
  -            *PRINT = \&puts;
  -        }
  -        tie *STDOUT, __PACKAGE__, $r;
  +    if (defined &Apache::RequestRec::TIEHANDLE) {
  +        tie *STDOUT, $r;
       }
       else {
           $r->send_http_header; #1.xx
  
  
  
  1.2       +0 -4      modperl-2.0/lib/Apache/compat.pm
  
  Index: compat.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- compat.pm 2001/04/12 03:56:49     1.1
  +++ compat.pm 2001/04/20 03:07:53     1.2
  @@ -64,10 +64,6 @@
       untie *STDOUT;
       tie *STDOUT, 'Apache::RequestRec', $r;
   
  -    unless (defined &PRINT) {
  -        *PRINT = \&puts;
  -    }
  -
       $Request;
   }
   
  
  
  
  1.6       +14 -8     modperl-2.0/lib/ModPerl/FunctionMap.pm
  
  Index: FunctionMap.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/FunctionMap.pm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FunctionMap.pm    2001/04/04 17:12:07     1.5
  +++ FunctionMap.pm    2001/04/20 03:07:53     1.6
  @@ -122,14 +122,6 @@
               next;
           }
   
  -        my $entry = $map->{$name} = {
  -           name        => $alias || $name,
  -           dispatch    => $dispatch,
  -           argspec     => $argspec ? [split /\s*,\s*/, $argspec] : "",
  -           return_type => $return_type,
  -           alias       => $alias,
  -        };
  -
           if (my $package = $cur{PACKAGE}) {
               unless ($package eq 'guess') {
                   $cur{CLASS} = $package;
  @@ -141,6 +133,20 @@
           else {
               $cur{CLASS} = $cur{MODULE};
           }
  +
  +        #XXX: make_prefix() stuff should be here, not ModPerl::WrapXS
  +        if ($name =~ /^DEFINE_/ and $cur{CLASS}) {
  +            $name =~ s{^(DEFINE_)(.*)}
  +              {$1 . ModPerl::WrapXS::make_prefix($2, $cur{CLASS})}e;
  +        }
  +
  +        my $entry = $map->{$name} = {
  +           name        => $alias || $name,
  +           dispatch    => $dispatch,
  +           argspec     => $argspec ? [split /\s*,\s*/, $argspec] : "",
  +           return_type => $return_type,
  +           alias       => $alias,
  +        };
   
           for (keys %cur) {
               $entry->{lc $_} = $cur{$_};
  
  
  
  1.7       +1 -0      modperl-2.0/lib/ModPerl/WrapXS.pm
  
  Index: WrapXS.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/WrapXS.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- WrapXS.pm 2001/04/19 17:24:43     1.6
  +++ WrapXS.pm 2001/04/20 03:07:53     1.7
  @@ -348,6 +348,7 @@
   sub make_prefix {
       my($name, $class) = @_;
       my $class_prefix = class_mpxs_prefix($class);
  +    return $name if $name =~ /^$class_prefix/;
       $class_prefix . $name;
   }
   
  
  
  
  1.5       +5 -7      modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h
  
  Index: Apache__RequestIO.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Apache__RequestIO.h       2001/03/27 04:40:36     1.4
  +++ Apache__RequestIO.h       2001/04/20 03:07:54     1.5
  @@ -1,3 +1,8 @@
  +#define mpxs_Apache__RequestRec_TIEHANDLE(stashsv, sv) \
  +modperl_newSVsv_obj(aTHX_ stashsv, sv)
  +
  +#define mpxs_Apache__RequestRec_PRINT mpxs_ap_rvputs
  +
   #if 0
   #define MP_USE_AP_RWRITE
   #endif
  @@ -66,11 +71,4 @@
       }
   
       return nrd;
  -}
  -
  -static MP_INLINE
  -request_rec *mpxs_Apache__RequestRec_TIEHANDLE(SV *classname,
  -                                               request_rec *r)
  -{
  -    return r;
   }
  
  
  
  1.6       +3 -2      modperl-2.0/xs/maps/modperl_functions.map
  
  Index: modperl_functions.map
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- modperl_functions.map     2001/04/20 01:57:26     1.5
  +++ modperl_functions.map     2001/04/20 03:07:55     1.6
  @@ -12,7 +12,8 @@
    mpxs_Apache__RequestRec_new
   
   MODULE=Apache::RequestIO   PACKAGE=Apache::RequestRec
  - mpxs_Apache__RequestRec_TIEHANDLE
  + SV *:DEFINE_TIEHANDLE   | | SV *:stashsv, SV *:sv=Nullsv
  + apr_size_t:DEFINE_PRINT | | ...
   
   MODULE=Apache::ServerUtil   PACKAGE=guess
    mpxs_Apache__Server_push_handlers
  @@ -26,4 +27,4 @@
    mpxs_Apache__Filter_read  | | ...
   
    SV *:DEFINE_TIEHANDLE | | SV *:stashsv, SV *:sv=Nullsv
  - int:DEFINE_PRINT | | ...
  + int:DEFINE_PRINT      | | ...
  
  
  

Reply via email to