perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@hyperreal.org
Subject cvs commit: modperl/t/net/perl api.pl
Date Sat, 28 Nov 1998 00:25:46 GMT
dougm       98/11/27 16:25:46

  Modified:    .        Changes
               src/modules/perl perl_util.c
               t/net/perl api.pl
  Log:
  sv2request_rec (Apache typemap) will look for '~' so xs modules can
  subclass without using a HASH ref (e.g. Apache::Request NG)
  
  Revision  Changes    Path
  1.213     +3 -0      modperl/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /export/home/cvs/modperl/Changes,v
  retrieving revision 1.212
  retrieving revision 1.213
  diff -u -r1.212 -r1.213
  --- Changes	1998/11/25 03:31:40	1.212
  +++ Changes	1998/11/28 00:25:43	1.213
  @@ -8,6 +8,9 @@
   
   =item 1.16_02-dev
   
  +sv2request_rec (Apache typemap) will look for '~' so xs modules can
  +subclass without using a HASH ref (e.g. Apache::Request NG)
  +
   <Perl> sections will always make sure Apache.pm is loaded
   
   =item 1.16_01 - November 24, 1998
  
  
  
  1.22      +16 -3     modperl/src/modules/perl/perl_util.c
  
  Index: perl_util.c
  ===================================================================
  RCS file: /export/home/cvs/modperl/src/modules/perl/perl_util.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- perl_util.c	1998/11/06 20:18:44	1.21
  +++ perl_util.c	1998/11/28 00:25:44	1.22
  @@ -105,6 +105,12 @@
   
   static char *r_keys[] = { "_r", "r", NULL };
   
  +static request_rec *r_magic_get(SV *sv)
  +{
  +    MAGIC *mg  = mg_find(sv, '~');
  +    return mg ? (request_rec *)mg->mg_ptr : NULL;
  +}
  +
   request_rec *sv2request_rec(SV *in, char *class, CV *cv)
   {
       request_rec *r = NULL;
  @@ -128,10 +134,17 @@
   
       if(!sv) sv = in;
       if(SvROK(sv) && (SvTYPE(SvRV(sv)) == SVt_PVMG)) {
  -	if(sv_derived_from(sv, class))
  -	    r = (request_rec *) SvIV((SV*)SvRV(sv));
  -	else
  +	if(sv_derived_from(sv, class)) {
  +	    if((r = r_magic_get(SvRV(sv)))) {
  +		/* ~ magic */
  +	    }
  +	    else {
  +		r = (request_rec *) SvIV((SV*)SvRV(sv));
  +	    }
  +	}
  +	else {
   	    return NULL;
  +	}
       }
       else if((r = perl_request_rec(NULL))) {
   	/*ok*/
  
  
  
  1.34      +1 -1      modperl/t/net/perl/api.pl
  
  Index: api.pl
  ===================================================================
  RCS file: /export/home/cvs/modperl/t/net/perl/api.pl,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- api.pl	1998/11/20 04:16:12	1.33
  +++ api.pl	1998/11/28 00:25:45	1.34
  @@ -7,7 +7,7 @@
   my $r;
   
   if(Apache->module("Apache::Request")) {
  -    $r = Apache::Request->new;
  +    $r = Apache::Request->new(shift);
   }
   else {
       $r = Apache->request;
  
  
  

Mime
View raw message