Remove no-longer-used svn_*_get_mergeinfo_for_tree APIs.
[svn.git] / subversion / bindings / swig / svn_wc.i
blob0598eeae6e6cef8eb97b4649af232705d64814ba
1 /*
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)
22 %module "SVN::_Wc"
23 #elif defined(SWIGRUBY)
24 %module "svn::ext::wc"
25 #endif
27 %include svn_global.swg
28 %import core.i
29 %import svn_delta.i
30 %import svn_ra.i
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;
41 #ifdef SWIGRUBY
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;
48 %ignore svn_wc_entry;
49 %ignore svn_wc_notify;
51 %ignore svn_wc_set_changelist;
52 #endif
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,
66 apr_hash_t *new_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()
76 #ifdef SWIGPYTHON
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))
84 SWIG_fail;
87 $1 = svn_swig_py_proparray_from_dict($input, _global_pool);
88 if (PyErr_Occurred()) {
89 SWIG_fail;
92 #endif
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,
106 const char *uuid,
107 const char *repos,
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 *)
118 #ifdef SWIGPYTHON
119 %callback_typemap(svn_wc_notify_func_t notify_func, void *notify_baton,
120 svn_swig_py_notify_func,
123 #endif
125 #ifndef SWIGPERL
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)
130 #endif
132 #ifdef SWIGRUBY
133 %callback_typemap(const svn_wc_entry_callbacks2_t *walk_callbacks,
134 void *walk_baton,
137 svn_swig_rb_wc_entry_callbacks2())
138 #endif
140 #ifndef SWIGRUBY
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,
145 #endif
147 #ifndef SWIGPERL
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)
152 #endif
154 #ifdef SWIGRUBY
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)
166 #endif
169 #ifdef SWIGRUBY
170 %apply const char *NOT_NULL {
171 const char *changelist,
172 const char *matching_changelist
174 #endif
177 /* svn_wc_translated2() */
178 #ifdef SWIGRUBY
179 %apply const char **TO_TEMP_FILE {
180 const char **xlated_path
182 #endif
184 /* svn_wc_queue_committed() */
185 #ifdef SWIGRUBY
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]);
194 #endif
197 svn_wc_get_update_editor3()
198 svn_wc_get_switch_editor3()
200 #ifdef SWIGRUBY
201 %typemap(in) svn_revnum_t *target_revision
203 $1 = apr_palloc(_global_pool, sizeof(svn_revnum_t));
204 if (NIL_P($input)) {
205 *$1 = SVN_INVALID_REVNUM;
206 } else {
207 *$1 = NUM2LONG($input);
211 %typemap(argout) svn_revnum_t *target_revision
213 %append_output(LONG2NUM((long)$1));
215 #endif
217 /* svn_wc_notify_t */
218 #ifdef SWIGRUBY
219 %typemap(out) svn_error_t *err
221 $result = $1 ? svn_swig_rb_svn_error_to_rb_error($1) : Qnil;
223 #endif
226 /* ----------------------------------------------------------------------- */
229 #include "svn_md5.h"
232 %include svn_wc_h.swg
235 #ifdef SWIGRUBY
236 %header %{
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
244 svn_error_t *
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,
249 void *cancel_baton,
250 svn_wc_notify_func2_t notify_func,
251 void *notify_baton,
252 apr_pool_t *pool);
253 #endif
257 %inline %{
258 static svn_error_t *
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));
264 #endif /* WIN32 */
265 return SVN_NO_ERROR;
269 #if defined(SWIGPYTHON)
270 %pythoncode %{ svn_wc_swig_init_asp_dot_net_hack() %}
271 #endif
273 #ifdef SWIGRUBY
274 %extend svn_wc_external_item2_t
276 svn_wc_external_item2_t(apr_pool_t *pool) {
277 svn_error_t *err;
278 const svn_wc_external_item2_t *self;
279 err = svn_wc_external_item_create(&self, pool);
280 if (err)
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,
299 void *cancel_baton,
300 apr_pool_t *pool) {
301 svn_error_t *err;
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);
305 if (err)
306 svn_swig_rb_handle_svn_error(err);
307 return self;
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;
353 ~svn_wc_entry_t() {
357 %extend svn_wc_notify_t
359 svn_wc_notify_t(const char *path, svn_wc_notify_action_t action,
360 apr_pool_t *pool) {
361 return svn_wc_create_notify(path, action, pool);
364 ~svn_wc_notify_t() {
367 #endif