[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn_client_list, Perl, swig bindings

From: Nik Clayton <nik_at_ngo.org.uk>
Date: 2007-02-28 17:22:58 CET

[ This is intended as search engine fodder for those that come after me,
   rather than something that needs a response ]

Nik Clayton wrote:
> I see from the .i and .swg files in the repo that both these types have
> been wrapped by the bindings. But I can't for the life of me work out
> how I go from the arguments passed to svn_swig_pl_thunk_list_receiver()
> (*dirent and *lock), to appropriate arguments to include in the call in
> to svn_swig_pl_callback_thunk(). Looking through the other code to see
> if there are any examples of something similar haven't been fruitful.
>
> Anyone know how to do this?

For the record, if you have a Subversion data type, and want to convert it
to a wrapped type for a callback written in Perl using the Perl swig
bindings is to use convert_to_swig_type().

As a pseudo-patch to the code I posted previously.

   svn_error_t *svn_swig_pl_thunk_list_receiver(void *baton,
                                               const char *path,
                                               const svn_dirent_t *dirent,
                                               const svn_lock_t *lock,
                                               const char *abs_path,
                                               apr_pool_t *pool)
   {
       SV *receiver = baton;
+ swig_type_info *dirent_type = _SWIG_TYPE("svn_dirent_t *");
+ swig_type_info *lock_type = _SWIG_TYPE("svn_lock_t *");

       if (!SvOK(receiver))
          return SVN_NO_ERROR;

       svn_swig_pl_callback_thunk(CALL_SV, receiver, NULL, "sOOsS", path,
- &PL_sv_undef,
- &PL_sv_undef, abs_path,
- pool, POOLINFO);
+ (dirent) ?
+ convert_to_swig_type(dirent, dirent_type)
+ : &PL_sv_undef,
+ (lock) ?
+ convert_to_swig_type(lock, lock_type)
+ : &PL_sv_undef,
+ abs_path, pool, POOLINFO);

       return SVN_NO_ERROR;
   }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Feb 28 17:23:55 2007

This is an archived mail posted to the Subversion Dev mailing list.