httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r153984 - in httpd/apreq/branches/multi-env-unstable: glue/perl/xsbuilder/APR/Request/Cookie/Cookie.xs glue/perl/xsbuilder/APR/Request/Param/Param.xs glue/perl/xsbuilder/apreq_xs_postperl.h glue/perl/xsbuilder/maps/apreq_functions.map include/apreq.h
Date Wed, 16 Feb 2005 03:04:02 GMT
Author: joes
Date: Tue Feb 15 19:03:59 2005
New Revision: 153984

URL: http://svn.apache.org/viewcvs?view=rev&rev=153984
Log:

s/apreq_parse_request/apreq_parse/ and add it to APR::Request.  Also change
apreq_xs_find_obj to return the reference to the desired SV object, instead
of the object itself.  Since we drop the reference into the mg_obj slot often,
it's more useful to have a reference there instead of the raw object.

Modified:
    httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Cookie/Cookie.xs
    httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Param/Param.xs
    httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/apreq_xs_postperl.h
    httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/maps/apreq_functions.map
    httpd/apreq/branches/multi-env-unstable/include/apreq.h

Modified: httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Cookie/Cookie.xs
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Cookie/Cookie.xs?view=diff&r1=153983&r2=153984
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Cookie/Cookie.xs
(original)
+++ httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Cookie/Cookie.xs
Tue Feb 15 19:03:59 2005
@@ -44,7 +44,7 @@
 
     sv = ST(0);
     obj = apreq_xs_find_obj(aTHX_ sv, "r");
-    iv = SvIVX(obj);
+    iv = SvIVX(SvRV(obj));
     req = INT2PTR(apreq_handle_t *, iv);
 
 

Modified: httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Param/Param.xs
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Param/Param.xs?view=diff&r1=153983&r2=153984
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Param/Param.xs
(original)
+++ httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Param/Param.xs
Tue Feb 15 19:03:59 2005
@@ -57,7 +57,7 @@
 
     sv = ST(0);
     obj = apreq_xs_find_obj(aTHX_ sv, "r");
-    iv = SvIVX(obj);
+    iv = SvIVX(SvRV(obj));
     req = INT2PTR(apreq_handle_t *, iv);
 
 
@@ -121,7 +121,7 @@
 
     sv = ST(0);
     obj = apreq_xs_find_obj(aTHX_ sv, "r");
-    iv = SvIVX(obj);
+    iv = SvIVX(SvRV(obj));
     req = INT2PTR(apreq_handle_t *, iv);
 
 

Modified: httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/apreq_xs_postperl.h
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/apreq_xs_postperl.h?view=diff&r1=153983&r2=153984
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/apreq_xs_postperl.h (original)
+++ httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/apreq_xs_postperl.h Tue Feb
15 19:03:59 2005
@@ -48,7 +48,7 @@
  * @param in  The starting SV *.
  * @param key The first letter of key is used to search a hashref for 
  *            the desired object.
- * @return    The object, if found;  otherwise NULL.
+ * @return    Reference to the object.
  */
 APR_INLINE
 static SV *apreq_xs_find_obj(pTHX_ SV *in, const char *key)
@@ -74,13 +74,14 @@
             Perl_croak(aTHX_ "attribute hash has no '%s' key!", key);
         case SVt_PVMG:
             if (SvOBJECT(sv) && SvIOKp(sv))
-                return sv;
+                return in;
         default:
              Perl_croak(aTHX_ "panic: unsupported SV type: %d", SvTYPE(sv));
        }
     }
 
-    return in;
+    Perl_croak(aTHX_ "apreq_xs_find_obj: object `%s' not found", key);
+    return NULL;
 }
 
 /* conversion function templates based on modperl-2's sv2request_rec */
@@ -93,10 +94,8 @@
 static void *apreq_xs_perl2c(pTHX_ SV* in, const char *name)
 {
     SV *sv = apreq_xs_find_obj(aTHX_ in, name);
-    if (sv == NULL)
-        return NULL;
-    else 
-        return (void *)SvIVX(sv);
+    IV iv = SvIVX(SvRV(sv));
+    return INT2PTR(void *, iv);
 }
 
 APR_INLINE
@@ -113,8 +112,9 @@
 APR_INLINE
 static apreq_handle_t *apreq_xs_get_handle(pTHX_ SV *sv)
 {
-    MAGIC *mg = mg_find(sv, PERL_MAGIC_ext);
-    IV iv = SvIVX(mg->mg_obj);
+    MAGIC *mg = mg_find(SvRV(sv), PERL_MAGIC_ext);
+    SV *obj = apreq_xs_find_obj(aTHX_ mg->mg_obj, "r");
+    IV iv = SvIVX(SvRV(obj));
     return INT2PTR(apreq_handle_t *,iv);
 }
 

Modified: httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/maps/apreq_functions.map
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/maps/apreq_functions.map?view=diff&r1=153983&r2=153984
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/maps/apreq_functions.map (original)
+++ httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/maps/apreq_functions.map Tue
Feb 15 19:03:59 2005
@@ -106,12 +106,7 @@
 #################### APR::Request stuff ####################
 
 MODULE=APR::Request  PACKAGE=APR::Request PREFIX=apreq_
-apreq_args_get
-apreq_jar_get
-#DEFINE_jar | apreq_xs_jar |
-#DEFINE_args | apreq_xs_args |
-#DEFINE_body | apreq_xs_body |
-#DEFINE_param | apreq_xs_param |
+apreq_parse
 
 MODULE=APR::Request::Apache2 PACKAGE=APR::Request::Apache2
 apreq_handle_apache2_t *:DEFINE_new | apreq_handle_apache2 (r) | const char *:class, request_rec
*:r

Modified: httpd/apreq/branches/multi-env-unstable/include/apreq.h
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/include/apreq.h?view=diff&r1=153983&r2=153984
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/include/apreq.h (original)
+++ httpd/apreq/branches/multi-env-unstable/include/apreq.h Tue Feb 15 19:03:59 2005
@@ -314,7 +314,7 @@
  */
 
 static APR_INLINE
-apr_status_t apreq_parse_request(apreq_handle_t *req)
+apr_status_t apreq_parse(apreq_handle_t *req)
 {
     const apr_table_t *dummy;
     apr_status_t jar_status, args_status, body_status;



Mime
View raw message