You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@hyperreal.org on 1998/09/17 17:55:20 UTC

cvs commit: modperl/src/modules/perl URI.xs mod_perl_xs.h

dougm       98/09/17 08:55:18

  Modified:    .        Changes ToDo
               src/modules/perl URI.xs mod_perl_xs.h
  Log:
  fix Apache::URI so components can be properly undef-d, thanks to
  Charles C. Fu for the spot
  
  Revision  Changes    Path
  1.137     +3 -0      modperl/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /export/home/cvs/modperl/Changes,v
  retrieving revision 1.136
  retrieving revision 1.137
  diff -u -r1.136 -r1.137
  --- Changes	1998/09/17 15:39:50	1.136
  +++ Changes	1998/09/17 15:55:07	1.137
  @@ -8,6 +8,9 @@
   
   =item 1.15_01-dev
   
  +fix Apache::URI so components can be properly undef-d, thanks to
  +Charles C. Fu for the spot
  +
   </Perl> match is now case insensitive, thanks to Randal Schwartz for
   the spot 
   
  
  
  
  1.81      +0 -2      modperl/ToDo
  
  Index: ToDo
  ===================================================================
  RCS file: /export/home/cvs/modperl/ToDo,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -u -r1.80 -r1.81
  --- ToDo	1998/09/17 15:39:50	1.80
  +++ ToDo	1998/09/17 15:55:09	1.81
  @@ -3,8 +3,6 @@
                    (well, close to it anyhow)
   ---------------------------------------------------------------------------
   
  -- Apache::URI methods should check SvOK
  -
   - <Perl> should report failed config
   
   - PERL_TIE_TABLES -> PERL_TABLE_API
  
  
  
  1.3       +22 -60    modperl/src/modules/perl/URI.xs
  
  Index: URI.xs
  ===================================================================
  RCS file: /export/home/cvs/modperl/src/modules/perl/URI.xs,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- URI.xs	1998/07/18 14:44:16	1.2
  +++ URI.xs	1998/09/17 15:55:13	1.3
  @@ -1,7 +1,9 @@
   #ifdef MOD_PERL
   #include "mod_perl.h"
  +#include "mod_perl_xs.h"
   #else
   #include "modules/perl/mod_perl.h"
  +#include "modules/perl/mod_perl_xs.h"
   #endif  
   
   typedef struct {
  @@ -93,141 +95,101 @@
       RETVAL 
   
   char *
  -scheme(uri, set=Nullsv)
  +scheme(uri, ...)
       Apache::URI uri
  -    SV *set
   
       CODE:
  -    RETVAL = uri->uri.scheme;
  +    get_set_PVp(uri->uri.scheme,uri->pool);
   
  -    if(set) 
  -        uri->uri.scheme = SvPV(set,na);
  -
       OUTPUT:
       RETVAL 
   
   char *
  -hostinfo(uri, set=Nullsv)
  +hostinfo(uri, ...)
       Apache::URI uri
  -    SV *set
   
       CODE:
  -    RETVAL = uri->uri.hostinfo;
  -
  -    if(set) 
  -        uri->uri.hostinfo = SvPV(set,na);
  +    get_set_PVp(uri->uri.hostinfo,uri->pool);
   
       OUTPUT:
       RETVAL 
   
   char *
  -user(uri, set=Nullsv)
  +user(uri, ...)
       Apache::URI uri
  -    SV *set
   
       CODE:
  -    RETVAL = uri->uri.user;
  -
  -    if(set) 
  -        uri->uri.user = SvPV(set,na);
  +    get_set_PVp(uri->uri.user,uri->pool);
   
       OUTPUT:
       RETVAL 
   
   char *
  -password(uri, set=Nullsv)
  +password(uri, ...)
       Apache::URI uri
  -    SV *set
   
       CODE:
  -    RETVAL = uri->uri.password;
  +    get_set_PVp(uri->uri.password,uri->pool);
   
  -    if(set) 
  -        uri->uri.password = SvPV(set,na);
  -
       OUTPUT:
       RETVAL 
   
   char *
  -hostname(uri, set=Nullsv)
  +hostname(uri, ...)
       Apache::URI uri
  -    SV *set
   
       CODE:
  -    RETVAL = uri->uri.hostname;
  -
  -    if(set) 
  -        uri->uri.hostname = SvPV(set,na);
  +    get_set_PVp(uri->uri.hostname,uri->pool);
   
       OUTPUT:
       RETVAL 
   
   char *
  -path(uri, set=Nullsv)
  +path(uri, ...)
       Apache::URI uri
  -    SV *set
   
       CODE:
  -    RETVAL = uri->uri.path;
  +    get_set_PVp(uri->uri.path,uri->pool);
   
  -    if(set) 
  -        uri->uri.path = SvPV(set,na);
  -
       OUTPUT:
       RETVAL 
   
   char *
  -query(uri, set=Nullsv)
  +query(uri, ...)
       Apache::URI uri
  -    SV *set
   
       CODE:
  -    RETVAL = uri->uri.query;
  -
  -    if(set) 
  -        uri->uri.query = SvPV(set,na);
  +    get_set_PVp(uri->uri.query,uri->pool);
   
       OUTPUT:
       RETVAL 
   
   char *
  -fragment(uri, set=Nullsv)
  +fragment(uri, ...)
       Apache::URI uri
  -    SV *set
   
       CODE:
  -    RETVAL = uri->uri.fragment;
  -
  -    if(set) 
  -        uri->uri.fragment = SvPV(set,na);
  +    get_set_PVp(uri->uri.fragment,uri->pool);
   
       OUTPUT:
       RETVAL 
   
   char *
  -port(uri, set=Nullsv)
  +port(uri, ...)
       Apache::URI uri
  -    SV *set
   
       CODE:
  -    RETVAL = uri->uri.port_str;
  +    get_set_PVp(uri->uri.port_str,uri->pool);
   
  -    if(set) 
  -        uri->uri.port_str = SvPV(set,na);
  -
       OUTPUT:
       RETVAL 
   
   char *
  -path_info(uri, set=Nullsv)
  +path_info(uri, ...)
       Apache::URI uri
  -    SV *set
   
       CODE:
  -    RETVAL = uri->path_info;
  -
  -    if(set) 
  -        uri->path_info = SvPV(set,na);
  +    get_set_PVp(uri->path_info,uri->pool);
   
       OUTPUT:
       RETVAL 
  
  
  
  1.3       +5 -2      modperl/src/modules/perl/mod_perl_xs.h
  
  Index: mod_perl_xs.h
  ===================================================================
  RCS file: /export/home/cvs/modperl/src/modules/perl/mod_perl_xs.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- mod_perl_xs.h	1998/09/16 16:27:02	1.2
  +++ mod_perl_xs.h	1998/09/17 15:55:14	1.3
  @@ -1,9 +1,12 @@
   /* handy macros for RETVAL */
   
  -#define get_set_PV(thing) \
  +#define get_set_PVp(thing,p) \
       RETVAL = (char*)thing; \
       if(items > 1) \
  -        (char*)thing = (ST(1) == &sv_undef) ? NULL : pstrdup(r->pool, SvPV(ST(1),na))
  +        (char*)thing = (ST(1) == &sv_undef) ? NULL : pstrdup(p, SvPV(ST(1),na))
  +
  +#define get_set_PV(thing) \
  +    get_set_PVp(thing,r->pool)
   
   #define get_set_IV(thing) \
       RETVAL = thing; \