You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Rall <dl...@finemaltcoding.com> on 2005/10/19 20:48:51 UTC

Re: svn commit: r16834 - in trunk/subversion/bindings/swig: . perl/native

On Wed, 19 Oct 2005, djames@tigris.org wrote:
...
> New Revision: 16834
...
> Initialize SVN_ASP_DOT_NET_HACK in the Perl and Ruby bindings.
> 
> * subversion/bindings/swig/ruby/svn/wc.rb,
>   subversion/bindings/swig/perl/native/Wc.pm
>   (Svn::Wc): Call swig_init_asp_dot_net_hack.
> 
> * subversion/bindings/swig/svn_wc.i
>   (svn_wc_swig_init_asp_dot_net_hack): Rename from
>   svn_swig_init_asp_dot_net_hack.
...
> --- trunk/subversion/bindings/swig/perl/native/Wc.pm	(original)
> +++ trunk/subversion/bindings/swig/perl/native/Wc.pm	Wed Oct 19 13:40:04 2005
...
> @@ -15,6 +16,8 @@
>  =head1 OBJECTS
>  
>  =cut 
> +
> +swig_init_asp_dot_net_hack($SVN::Core::gpool);

This doesn't use the new "svn_wc_" prefix.  Is that accurate?

...
> --- trunk/subversion/bindings/swig/ruby/svn/wc.rb	(original)
> +++ trunk/subversion/bindings/swig/ruby/svn/wc.rb	Wed Oct 19 13:40:04 2005
> @@ -9,6 +9,7 @@
>    module Wc
>      Util.set_constants(Ext::Wc, self)
>      Util.set_methods(Ext::Wc, self)
> +    self.swig_init_asp_dot_net_hack()

Ditto.

...
> --- trunk/subversion/bindings/swig/svn_wc.i	(original)
> +++ trunk/subversion/bindings/swig/svn_wc.i	Wed Oct 19 13:40:04 2005
> @@ -299,7 +299,7 @@
>  
>  %inline %{
>  static svn_error_t *
> -svn_swig_init_asp_dot_net_hack (apr_pool_t *pool)
> +svn_wc_swig_init_asp_dot_net_hack (apr_pool_t *pool)
>  {
>  #if defined(WIN32) || defined(__CYGWIN__)
>    if (getenv ("SVN_ASP_DOT_NET_HACK"))
> @@ -310,5 +310,5 @@
>  %}
>  
>  #if defined(SWIGPYTHON)
> -%pythoncode %{ svn_swig_init_asp_dot_net_hack() %}
> +%pythoncode %{ svn_wc_swig_init_asp_dot_net_hack() %}
>  #endif

Looks like it does for Python, though?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r16834 - in trunk/subversion/bindings/swig: . perl/native

Posted by David James <ja...@gmail.com>.
On 10/19/05, Daniel Rall <dl...@finemaltcoding.com> wrote:
> > +
> > +swig_init_asp_dot_net_hack($SVN::Core::gpool);
>
> This doesn't use the new "svn_wc_" prefix.  Is that accurate?
Yup. The Perl bindings automagically remove the "svn_wc_" prefix. So,
it's the same to say  "swig_init_asp_dot_net_hack", as it is to say
"svn_wc_swig_init_asp_dot_net_hack"

> ...
> > --- trunk/subversion/bindings/swig/ruby/svn/wc.rb     (original)
> > +++ trunk/subversion/bindings/swig/ruby/svn/wc.rb     Wed Oct 19 13:40:04 2005
> > @@ -9,6 +9,7 @@
> >    module Wc
> >      Util.set_constants(Ext::Wc, self)
> >      Util.set_methods(Ext::Wc, self)
> > +    self.swig_init_asp_dot_net_hack()
>
> Ditto.
Ditto for Ruby.

> ...
> > --- trunk/subversion/bindings/swig/svn_wc.i   (original)
> > +++ trunk/subversion/bindings/swig/svn_wc.i   Wed Oct 19 13:40:04 2005
> > @@ -299,7 +299,7 @@
> >
> >  %inline %{
> >  static svn_error_t *
> > -svn_swig_init_asp_dot_net_hack (apr_pool_t *pool)
> > +svn_wc_swig_init_asp_dot_net_hack (apr_pool_t *pool)
> >  {
> >  #if defined(WIN32) || defined(__CYGWIN__)
> >    if (getenv ("SVN_ASP_DOT_NET_HACK"))
> > @@ -310,5 +310,5 @@
> >  %}
> >
> >  #if defined(SWIGPYTHON)
> > -%pythoncode %{ svn_swig_init_asp_dot_net_hack() %}
> > +%pythoncode %{ svn_wc_swig_init_asp_dot_net_hack() %}
> >  #endif
>
> Looks like it does for Python, though?
The Python bindings also remove the "svn_wc_" prefix, but only for the
"svn.*" modules. So, if we moved this initialization code into
svn/wc.py, we'd be able to just say "swig_init_asp_dot_net_hack()".

IMHO, for the Python bindings, it's better to initialize the hack in
"svn_wc.i", in case the user wants to import libsvn.wc directly. So,
we need to use the "svn_wc_" prefix here.

Cheers,

David

--
David James -- http://www.cs.toronto.edu/~james