You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by sv...@apache.org on 2013/05/30 06:00:09 UTC

svn commit: r1487715 - in /subversion/branches/1.8.x: ./ STATUS subversion/bindings/swig/include/svn_containers.swg subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h

Author: svn-role
Date: Thu May 30 04:00:09 2013
New Revision: 1487715

URL: http://svn.apache.org/r1487715
Log:
Merge r1479540 from trunk:

 * r1479540
   Add an in typemap for PROPHASH to the Perl bindings.
   Justification:
     Make it easier to use APIs that take hashes of properties as input.
   Votes:
     +1: breser, rschupp

Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/bindings/swig/include/svn_containers.swg
    subversion/branches/1.8.x/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c
    subversion/branches/1.8.x/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1479540

Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1487715&r1=1487714&r2=1487715&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Thu May 30 04:00:09 2013
@@ -64,13 +64,6 @@ Approved changes:
 # blocking issues.  If in doubt see this link for details:
 # http://subversion.apache.org/docs/community-guide/releasing.html#release-stabilization
 
- * r1479540
-   Add an in typemap for PROPHASH to the Perl bindings.
-   Justification:
-     Make it easier to use APIs that take hashes of properties as input.
-   Votes:
-     +1: breser, rschupp
-
  * r1479563, r1480119, r1487083
    Make svn_client_log5() callable from the Perl bindings.
    Justification:

Modified: subversion/branches/1.8.x/subversion/bindings/swig/include/svn_containers.swg
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/bindings/swig/include/svn_containers.swg?rev=1487715&r1=1487714&r2=1487715&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/bindings/swig/include/svn_containers.swg (original)
+++ subversion/branches/1.8.x/subversion/bindings/swig/include/svn_containers.swg Thu May 30 04:00:09 2013
@@ -266,6 +266,13 @@
 #endif
 
 #ifdef SWIGPERL
+%typemap(in) apr_hash_t *PROPHASH
+  (apr_pool_t *_global_pool = NULL)
+{
+  if (_global_pool == NULL)
+    _global_pool = svn_swig_pl_make_pool((SV *)NULL);
+  $1 = svn_swig_pl_hash_to_prophash($input, _global_pool);  
+}
 %typemap(out) apr_hash_t *PROPHASH
 {
   %append_output(svn_swig_pl_prophash_to_hash($1));

Modified: subversion/branches/1.8.x/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c?rev=1487715&r1=1487714&r2=1487715&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c (original)
+++ subversion/branches/1.8.x/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c Thu May 30 04:00:09 2013
@@ -98,6 +98,14 @@ static void *convert_pl_revnum_t(SV *val
   return (void *)result;
 }
 
+static void *convert_pl_svn_string_t(SV *value, void *dummy, apr_pool_t *pool)
+{
+    svn_string_t *result = apr_palloc(pool, sizeof(svn_string_t));
+    /* just the in typemap for svn_string_t */
+    result->data = SvPV(value, result->len);
+    return (void *)result;
+}
+
 /* perl -> c hash convertors */
 static apr_hash_t *svn_swig_pl_to_hash(SV *source,
                                        pl_element_converter_t cv,
@@ -156,6 +164,11 @@ apr_hash_t *svn_swig_pl_objs_to_hash_of_
                              NULL, pool);
 }
 
+apr_hash_t *svn_swig_pl_hash_to_prophash(SV *source, apr_pool_t *pool)
+{
+  return svn_swig_pl_to_hash(source, convert_pl_svn_string_t, NULL, pool);
+}
+
 /* perl -> c array convertors */
 static const
 apr_array_header_t *svn_swig_pl_to_array(SV *source,

Modified: subversion/branches/1.8.x/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h?rev=1487715&r1=1487714&r2=1487715&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h (original)
+++ subversion/branches/1.8.x/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h Thu May 30 04:00:09 2013
@@ -93,6 +93,7 @@ apr_hash_t *svn_swig_pl_objs_to_hash_by_
                                              apr_pool_t *pool);
 apr_hash_t *svn_swig_pl_objs_to_hash_of_revnum_t(SV *source,
                                                  apr_pool_t *pool);
+apr_hash_t *svn_swig_pl_hash_to_prophash(SV *source, apr_pool_t *pool);
 const apr_array_header_t *svn_swig_pl_objs_to_array(SV *source,
                                                     swig_type_info *tinfo,
                                                     apr_pool_t *pool);