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_wc.i
: SWIG interface file for svn_wc.h
19 #if defined
(SWIGPYTHON
)
20 %module
(package
="libsvn") wc
21 #elif defined
(SWIGPERL
)
23 #elif defined
(SWIGRUBY
)
24 %module
"svn::ext::wc"
27 %include svn_global.swg
32 /* -----------------------------------------------------------------------
33 ### these functions require a pool
, which we don't have immediately
34 ### handy. just eliminate these funcs for now.
36 %ignore svn_wc_set_auth_file
;
38 /* ### ignore this structure because the accessors will need a pool
*/
39 %ignore svn_wc_keywords_t
;
42 %ignore svn_wc_external_item_create
;
43 %ignore svn_wc_external_item_dup
;
44 %ignore svn_wc_external_item2_dup
;
45 %ignore svn_wc_revision_status
;
46 %ignore svn_wc_committed_queue_create
;
47 %ignore svn_wc_init_traversal_info
;
49 %ignore svn_wc_notify
;
51 %ignore svn_wc_set_changelist
;
54 /* -----------------------------------------------------------------------
55 %apply-ing of typemaps defined elsewhere
58 /* svn_wc_get_prop_diffs
() */
59 %apply apr_array_header_t
**OUTPUT_OF_PROP
{
60 apr_array_header_t
**propchanges
63 %apply apr_hash_t
*PROPHASH
{
64 apr_hash_t
*baseprops
,
65 apr_hash_t
*new_base_props
,
70 svn_wc_queue_committed
()
71 svn_wc_process_committed4
()
72 svn_wc_process_committed3
()
73 svn_wc_process_committed2
()
74 svn_wc_process_committed
()
77 %typemap
(in
) apr_array_header_t
*wcprop_changes
78 (apr_pool_t
*_global_pool
= NULL, PyObject
*_global_py_pool
= NULL)
80 if
(_global_pool
== NULL)
82 if
(svn_swig_py_get_parent_pool
(args
, $descriptor
(apr_pool_t
*),
83 &_global_py_pool, &_global_pool))
87 $
1 = svn_swig_py_proparray_from_dict
($input
, _global_pool
);
88 if
(PyErr_Occurred
()) {
94 /* svn_wc_match_ignore_list
() */
95 %apply const apr_array_header_t
*STRINGLIST
{
96 apr_array_header_t
*list
99 %apply const apr_array_header_t
*STRINGLIST_MAY_BE_NULL
{
100 apr_array_header_t
*changelists
103 /* svn_wc_cleanup2
() */
104 %apply const char
*MAY_BE_NULL
{
105 const char
*diff3_cmd
,
108 const char
*new_text_path
,
109 const char
*copyfrom_url
,
110 const char
*rev_date
,
111 const char
*rev_author
,
112 const char
*trail_url
115 %hash_argout_typemap
(entries
, svn_wc_entry_t
*)
116 %hash_argout_typemap
(externals_p
, svn_wc_external_item_t
*)
119 %callback_typemap
(svn_wc_notify_func_t notify_func
, void
*notify_baton
,
120 svn_swig_py_notify_func
,
126 %callback_typemap
(svn_wc_notify_func2_t notify_func
, void
*notify_baton
,
127 svn_swig_py_notify_func2
,
129 svn_swig_rb_notify_func2
)
133 %callback_typemap
(const svn_wc_entry_callbacks2_t
*walk_callbacks
,
137 svn_swig_rb_wc_entry_callbacks2
())
141 %callback_typemap
(svn_wc_status_func_t status_func
, void
*status_baton
,
142 svn_swig_py_status_func
,
143 svn_swig_pl_status_func
,
148 %callback_typemap
(svn_wc_status_func2_t status_func
, void
*status_baton
,
149 svn_swig_py_status_func2
,
151 svn_swig_rb_wc_status_func
)
155 %callback_typemap
(const svn_wc_diff_callbacks2_t
*callbacks
,
156 void
*callback_baton
,
159 svn_swig_rb_wc_diff_callbacks2
())
161 %callback_typemap
(svn_wc_relocation_validator3_t validator
,
162 void
*validator_baton
,
165 svn_swig_rb_wc_relocation_validator3
)
170 %apply const char
*NOT_NULL
{
171 const char
*changelist
,
172 const char
*matching_changelist
177 /* svn_wc_translated2
() */
179 %apply const char
**TO_TEMP_FILE
{
180 const char
**xlated_path
184 /* svn_wc_queue_committed
() */
186 %typemap
(in
) svn_wc_committed_queue_t
**queue
(void
*tempp
=NULL) {
187 SWIG_ConvertPtr
($input
, &tempp, $*1_descriptor, 0);
188 $
1 = ($
1_ltype
)&tempp;
191 %typemap
(argout
) svn_wc_committed_queue_t
**queue
{
192 %append_output
(argv
[0]);
197 svn_wc_get_update_editor3
()
198 svn_wc_get_switch_editor3
()
201 %typemap
(in
) svn_revnum_t
*target_revision
203 $
1 = apr_palloc
(_global_pool
, sizeof
(svn_revnum_t
));
205 *$
1 = SVN_INVALID_REVNUM
;
207 *$
1 = NUM2LONG
($input
);
211 %typemap
(argout
) svn_revnum_t
*target_revision
213 %append_output
(LONG2NUM
((long
)$
1));
217 /* svn_wc_notify_t
*/
219 %typemap
(out
) svn_error_t
*err
221 $result
= $
1 ? svn_swig_rb_svn_error_to_rb_error
($
1) : Qnil
;
226 /* ----------------------------------------------------------------------- */
232 %include svn_wc_h.swg
237 #define _svn_wc_set_changelist svn_wc_set_changelist
239 %rename
(svn_wc_set_changelist
) _svn_wc_set_changelist
;
240 %apply const char
*MAY_BE_NULL
{
241 const char
*changelist_may_be_null
,
242 const char
*matching_changelist_may_be_null
245 _svn_wc_set_changelist
(const apr_array_header_t
*paths
,
246 const char
*changelist_may_be_null
,
247 const char
*matching_changelist_may_be_null
,
248 svn_cancel_func_t cancel_func
,
250 svn_wc_notify_func2_t notify_func
,
259 svn_wc_swig_init_asp_dot_net_hack
(apr_pool_t
*pool
)
261 #if defined
(WIN32
) || defined
(__CYGWIN__
)
262 if
(getenv
("SVN_ASP_DOT_NET_HACK"))
263 SVN_ERR
(svn_wc_set_adm_dir
("_svn", pool
));
269 #if defined
(SWIGPYTHON
)
270 %pythoncode
%{ svn_wc_swig_init_asp_dot_net_hack
() %}
274 %extend svn_wc_external_item2_t
276 svn_wc_external_item2_t
(apr_pool_t
*pool
) {
278 const svn_wc_external_item2_t
*self
;
279 err
= svn_wc_external_item_create
(&self, pool);
281 svn_swig_rb_handle_svn_error
(err
);
282 return
(svn_wc_external_item2_t
*)self
;
285 ~svn_wc_external_item2_t
() {
288 svn_wc_external_item2_t
*dup
(apr_pool_t
*pool
) {
289 return svn_wc_external_item2_dup
(self
, pool
);
293 %extend svn_wc_revision_status_t
295 svn_wc_revision_status_t
(const char
*wc_path
,
296 const char
*trail_url
,
297 svn_boolean_t committed
,
298 svn_cancel_func_t cancel_func
,
302 svn_wc_revision_status_t
*self
;
303 err
= svn_wc_revision_status
(&self, wc_path, trail_url, committed,
304 cancel_func
, cancel_baton
, pool
);
306 svn_swig_rb_handle_svn_error
(err
);
310 ~svn_wc_revision_status_t
() {
314 /* Dummy declaration
*/
315 struct svn_wc_committed_queue_t
319 %extend svn_wc_committed_queue_t
321 svn_wc_committed_queue_t
(apr_pool_t
*pool
) {
322 return svn_wc_committed_queue_create
(pool
);
325 ~svn_wc_committed_queue_t
() {
329 /* Dummy declaration
*/
330 struct svn_wc_traversal_info_t
334 %extend svn_wc_traversal_info_t
336 svn_wc_traversal_info_t
(apr_pool_t
*pool
) {
337 return svn_wc_init_traversal_info
(pool
);
340 ~svn_wc_traversal_info_t
() {
344 %extend svn_wc_entry_t
346 svn_wc_entry_t
(const char
*path
, svn_wc_adm_access_t
*adm_access
,
347 svn_boolean_t show_hidden
, apr_pool_t
*pool
) {
348 const svn_wc_entry_t
*self
;
349 svn_wc_entry
(&self, path, adm_access, show_hidden, pool);
350 return
(svn_wc_entry_t
*)self
;
357 %extend svn_wc_notify_t
359 svn_wc_notify_t
(const char
*path
, svn_wc_notify_action_t action
,
361 return svn_wc_create_notify
(path
, action
, pool
);