httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject cvs commit: httpd-apreq-2/glue/perl/xsbuilder/maps apreq_functions.map
Date Tue, 20 Jul 2004 16:20:44 GMT
joes        2004/07/20 09:20:44

  Modified:    glue/perl/xsbuilder apreq_xs_tables.h
               glue/perl/xsbuilder/Apache/Cookie Cookie_pm
               glue/perl/xsbuilder/maps apreq_functions.map
  Log:
  Rename $jar->cookie $jar->cookies to match apreq_jar_t. Also allow $table->set
and $table->add to accept a sole $value argument whenever $value is an Apache::Cookie or
Apache::Upload object.
  
  Revision  Changes    Path
  1.26      +24 -22    httpd-apreq-2/glue/perl/xsbuilder/apreq_xs_tables.h
  
  Index: apreq_xs_tables.h
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/apreq_xs_tables.h,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- apreq_xs_tables.h	18 Jul 2004 23:24:51 -0000	1.25
  +++ apreq_xs_tables.h	20 Jul 2004 16:20:44 -0000	1.26
  @@ -137,31 +137,33 @@
       STRLEN klen, vlen;                                                  \
       apreq_##attr##_t *RETVAL;                                           \
                                                                           \
  -    if (items != 3 || !SvROK(ST(0)) || !SvPOK(ST(1)))                   \
  -        Perl_croak(aTHX_ "Usage: $table->" #method "($key, $val)");     \
  +    switch (items) {                                                    \
  +    case 2:                                                             \
  +    case 3:                                                             \
  +        if (!SvROK(ST(0)))                                              \
  +           break;                                                       \
  +        sv  = ST(0);                                                    \
  +        obj = apreq_xs_find_obj(aTHX_ sv, #attr);                       \
  +        env = apreq_xs_sv2env(obj);                                     \
  +         t   = (apr_table_t *)SvIVX(obj);                               \
                                                                           \
  -    sv  = ST(0);                                                        \
  -    obj = apreq_xs_find_obj(aTHX_ sv, #attr);                           \
  -    if (obj == NULL)                                                    \
  -         Perl_croak(aTHX_ "$table->" #method ": cannot find object");   \
  -    env = apreq_xs_sv2env(obj);                                         \
  -    t   = (apr_table_t *)SvIVX(obj);                                    \
  -    key = SvPV(ST(1), klen);                                            \
  -                                                                        \
  -    if (SvROK(ST(2))) {                                                 \
  -        RETVAL = (apreq_##attr##_t *) SvIVX(SvRV(ST(2)));               \
  -    }                                                                   \
  -    else if (SvOK(ST(2))) {                                             \
  -        val = SvPV(ST(2), vlen);                                        \
  -        RETVAL = apreq_make_##attr(apreq_env_pool(env), key, klen,      \
  -                                                     val, vlen);        \
  +        if (SvROK(ST(items-1))) {                                       \
  +            RETVAL = (apreq_##attr##_t *)SvIVX(SvRV(ST(items-1)));      \
  +        }                                                               \
  +        else if (items == 3) {                                          \
  +            key = SvPV(ST(1),klen);                                     \
  +            val = SvPV(ST(2),vlen);                                     \
  +            RETVAL = apreq_make_##attr(apreq_env_pool(env), key, klen,  \
  +                                       val, vlen);                      \
  +        }                                                               \
  +        apr_table_##method##n(t, RETVAL->v.name, RETVAL->v.data);       \
  +        XSRETURN_EMPTY;                                                 \
  +    default:                                                            \
  +        ; /* usage */                                                   \
       }                                                                   \
  -    else                                                                \
  -        Perl_croak(aTHX_ "Usage: $table->" #method "($key, $val): "     \
  -                   "cannot store an undefined $val in the table");      \
                                                                           \
  -    apr_table_##method##n(t, RETVAL->v.name, RETVAL->v.data);           \
  -    XSRETURN_EMPTY;                                                     \
  +    Perl_croak(aTHX_ "Usage: $table->" #method                          \
  +           "([$key,] $val))");                                          \
   }
   
   
  
  
  
  1.20      +1 -1      httpd-apreq-2/glue/perl/xsbuilder/Apache/Cookie/Cookie_pm
  
  Index: Cookie_pm
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/Apache/Cookie/Cookie_pm,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- Cookie_pm	8 Jul 2004 19:55:57 -0000	1.19
  +++ Cookie_pm	20 Jul 2004 16:20:44 -0000	1.20
  @@ -58,7 +58,7 @@
           }
       }
       my $jar = $class->jar($env, @_);
  -    return wantarray ? %{(scalar $jar->cookie) || {}} : $jar->cookie;
  +    return wantarray ? %{(scalar $jar->cookies) || {}} : $jar->cookies;
   }
   
   sub freeze {
  
  
  
  1.33      +1 -1      httpd-apreq-2/glue/perl/xsbuilder/maps/apreq_functions.map
  
  Index: apreq_functions.map
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/maps/apreq_functions.map,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- apreq_functions.map	18 Jul 2004 23:24:51 -0000	1.32
  +++ apreq_functions.map	20 Jul 2004 16:20:44 -0000	1.33
  @@ -78,7 +78,7 @@
   MODULE=Apache::Cookie PACKAGE=Apache::Cookie::Jar PREFIX=Apache__Cookie__Jar_
    DEFINE_new        | apreq_xs_jar     |
    DEFINE_env        | apreq_xs_jar_env |
  - DEFINE_cookie     | apreq_xs_jar_get |
  + DEFINE_cookies    | apreq_xs_jar_get |
    DEFINE_get        | apreq_xs_jar_get |
    DEFINE_pool       | apreq_xs_jar_pool |
   
  
  
  

Mime
View raw message