2 * ====================================================================
3 * Copyright
(c
) 2000-2006 CollabNet. All rights reserved.
5 * This software is licensed as described in the file COPYING
, which
6 * you should have received as part of this distribution. The terms
7 * are also available at http
://subversion.tigris.org
/license-1.html.
8 * If newer versions of this license are posted there
, you may use a
9 * newer version instead
, at your option.
11 * This software consists of voluntary contributions made by many
12 * individuals. For exact contribution history
, see the revision
13 * history and logs
, available at http
://subversion.tigris.org
/.
14 * ====================================================================
16 * svn_fs.i
: SWIG interface file for svn_fs.h
19 #if defined
(SWIGPYTHON
)
20 %module
(package
="libsvn") fs
21 #elif defined
(SWIGPERL
)
23 #elif defined
(SWIGRUBY
)
24 %module
"svn::ext::fs"
27 %include svn_global.swg
31 /* -----------------------------------------------------------------------
32 do not generate any constructors or destructors
(of structures
) -- all
33 structures are going to come
/out
/ of the FS
(so we don't need to
34 construct the things
) and will live in a pool
(so we don't need to
39 /* Redundant from
1.1 onwards
, so not worth manually wrapping the callback.
*/
40 %ignore svn_fs_set_berkeley_errcall
;
42 /* ### need to deal with
IN params which have
"const" and OUT params which
43 ### return non-const type. SWIG's type checking may see these as
46 %apply const char
*MAY_BE_NULL
{
47 const char
*base_checksum
,
48 const char
*result_checksum
,
55 %apply svn_stream_t
*WRAPPED_STREAM
{ svn_stream_t
* };
58 %hash_argout_typemap
(entries_p
, svn_fs_dirent_t
*)
59 %hash_argout_typemap
(changed_paths_p
, svn_fs_path_change_t
*)
62 %callback_typemap
(svn_fs_get_locks_callback_t get_locks_func
,
63 void
*get_locks_baton
,
64 svn_swig_py_fs_get_locks_func
,
66 svn_swig_rb_fs_get_locks_callback
)
68 /* -----------------------------------------------------------------------
73 %typemap
(argout
) apr_hash_t
**minfohash
75 %append_output
(svn_swig_py_stringhash_to_dict
(*$
1));
79 %apply apr_hash_t
*MERGEINFO
{ apr_hash_t
*mergeinhash
};
81 /* -----------------------------------------------------------------------
82 Fix the return value for svn_fs_commit_txn
(). If the conflict result is
83 NULL, then
%append_output
() is passed Py_None
, but that goofs up
84 because that is
*also
* the marker for
"I haven't started assembling a
85 multi-valued return yet" which means the second return value
(new_rev
)
86 will not cause a
2-tuple to be manufactured.
88 The answer is to explicitly create a
2-tuple return value.
90 FIXME
: Do the Perl and Ruby bindings need to do something similar?
93 %typemap
(argout
) (const char
**conflict_p
, svn_revnum_t
*new_rev
) {
94 /* this is always Py_None
*/
96 /* build the result tuple
*/
97 $result
= Py_BuildValue
("zi", *$
1, (long
)*$
2);
101 /* Ruby fixups for functions not following the pool convention.
*/
103 %ignore svn_fs_set_warning_func
;
104 %ignore svn_fs_root_fs
;
108 svn_fs_set_warning_func_wrapper
(svn_fs_t
*fs
,
109 svn_fs_warning_callback_t warning
,
113 svn_fs_set_warning_func
(fs
, warning
, warning_baton
);
117 svn_fs_root_fs_wrapper
(svn_fs_root_t
*root
, apr_pool_t
*pool
)
119 return svn_fs_root_fs
(root
);
124 /* ----------------------------------------------------------------------- */
130 %include svn_fs_h.swg
133 %define_close_related_methods
(fs
);