* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
[svn.git] / subversion / bindings / swig / ruby / libsvn_swig_ruby / swigutil_rb.h
blobec5864706d7325e88140190f0e01fb89a8d8df71
1 #ifndef SVN_SWIG_SWIGUTIL_RB_H
2 #define SVN_SWIG_SWIGUTIL_RB_H
4 #include <ruby.h>
5 #include <regex.h>
7 #if SIZEOF_VOIDP == SIZEOF_LONG
8 # define PTR2NUM(x) (ULONG2NUM((unsigned long)(x)))
9 # define NUM2PTR(x) ((void *)(NUM2ULONG(x)))
10 #else
11 # define PTR2NUM(x) (ULL2NUM((unsigned long long)(x)))
12 # define NUM2PTR(x) ((void *)(NUM2ULL(x)))
13 #endif
15 #include <apr.h>
16 #include <apr_pools.h>
17 #include <apr_hash.h>
18 #include <apr_portable.h>
19 #include <apr_file_io.h>
21 #include "svn_types.h"
22 #include "svn_string.h"
23 #include "svn_delta.h"
24 #include "svn_client.h"
25 #include "svn_repos.h"
27 /* Define DLL export magic on Windows. */
28 #ifdef WIN32
29 # ifdef SVN_SWIG_SWIGUTIL_RB_C
30 # define SVN_RB_SWIG_SWIGUTIL_EXPORT __declspec(dllexport)
31 # else
32 # define SVN_RB_SWIG_SWIGUTIL_EXPORT __declspec(dllimport)
33 # endif
34 #else
35 # define SVN_RB_SWIG_SWIGUTIL_EXPORT
36 #endif
38 #ifdef __cplusplus
39 extern "C" {
40 #endif /* __cplusplus */
42 #include <rubyio.h>
44 typedef struct apr_pool_wrapper_t
46 apr_pool_t *pool;
47 svn_boolean_t destroyed;
48 struct apr_pool_wrapper_t *parent;
49 apr_array_header_t *children;
50 } apr_pool_wrapper_t;
52 SVN_RB_SWIG_SWIGUTIL_EXPORT
53 void svn_swig_rb_initialize(void);
55 SVN_RB_SWIG_SWIGUTIL_EXPORT
56 VALUE svn_swig_rb_svn_delta_editor(void);
57 SVN_RB_SWIG_SWIGUTIL_EXPORT
58 VALUE svn_swig_rb_svn_delta_text_delta_window_handler(void);
60 SVN_RB_SWIG_SWIGUTIL_EXPORT
61 void svn_swig_rb_raise_svn_fs_already_close(void);
62 SVN_RB_SWIG_SWIGUTIL_EXPORT
63 void svn_swig_rb_raise_svn_repos_already_close(void);
65 SVN_RB_SWIG_SWIGUTIL_EXPORT
66 VALUE svn_swig_rb_svn_error_new(VALUE code, VALUE message,
67 VALUE file, VALUE line);
68 SVN_RB_SWIG_SWIGUTIL_EXPORT
69 VALUE svn_swig_rb_svn_error_to_rb_error(svn_error_t *error);
70 SVN_RB_SWIG_SWIGUTIL_EXPORT
71 void svn_swig_rb_handle_svn_error(svn_error_t *error);
73 SVN_RB_SWIG_SWIGUTIL_EXPORT
74 void *svn_swig_rb_to_swig_type(VALUE value, void *ctx, apr_pool_t *pool);
75 SVN_RB_SWIG_SWIGUTIL_EXPORT
76 VALUE svn_swig_rb_from_swig_type(void *value, void *ctx);
78 SVN_RB_SWIG_SWIGUTIL_EXPORT
79 svn_depth_t svn_swig_rb_to_depth(VALUE value);
81 SVN_RB_SWIG_SWIGUTIL_EXPORT
82 svn_mergeinfo_inheritance_t svn_swig_rb_to_mergeinfo_inheritance(VALUE value);
84 SVN_RB_SWIG_SWIGUTIL_EXPORT
85 VALUE svn_swig_rb_svn_date_string_to_time(const char *date);
87 SVN_RB_SWIG_SWIGUTIL_EXPORT
88 VALUE svn_swig_rb_apr_hash_to_hash_string(apr_hash_t *hash);
89 SVN_RB_SWIG_SWIGUTIL_EXPORT
90 VALUE svn_swig_rb_apr_hash_to_hash_svn_string(apr_hash_t *hash);
91 SVN_RB_SWIG_SWIGUTIL_EXPORT
92 VALUE svn_swig_rb_apr_hash_to_hash_swig_type(apr_hash_t *hash,
93 const char *type_name);
94 SVN_RB_SWIG_SWIGUTIL_EXPORT
95 VALUE svn_swig_rb_apr_hash_to_hash_merge_range(apr_hash_t *hash);
96 SVN_RB_SWIG_SWIGUTIL_EXPORT
97 VALUE svn_swig_rb_apr_hash_to_hash_merge_range_hash(apr_hash_t *hash);
99 SVN_RB_SWIG_SWIGUTIL_EXPORT
100 VALUE svn_swig_rb_prop_hash_to_hash(apr_hash_t *prop_hash);
101 SVN_RB_SWIG_SWIGUTIL_EXPORT
102 VALUE svn_swig_rb_apr_revnum_key_hash_to_hash_string(apr_hash_t *hash);
104 SVN_RB_SWIG_SWIGUTIL_EXPORT
105 VALUE svn_swig_rb_apr_array_to_array_string(const apr_array_header_t *ary);
106 SVN_RB_SWIG_SWIGUTIL_EXPORT
107 VALUE svn_swig_rb_apr_array_to_array_svn_string(const apr_array_header_t *ary);
108 SVN_RB_SWIG_SWIGUTIL_EXPORT
109 VALUE svn_swig_rb_apr_array_to_array_svn_rev(const apr_array_header_t *ary);
110 SVN_RB_SWIG_SWIGUTIL_EXPORT
111 VALUE svn_swig_rb_apr_array_to_array_proplist_item(const apr_array_header_t *ary);
112 SVN_RB_SWIG_SWIGUTIL_EXPORT
113 VALUE svn_swig_rb_apr_array_to_array_external_item2(const apr_array_header_t *ary);
114 SVN_RB_SWIG_SWIGUTIL_EXPORT
115 VALUE svn_swig_rb_apr_array_to_array_merge_range(const apr_array_header_t *ary);
117 SVN_RB_SWIG_SWIGUTIL_EXPORT
118 VALUE svn_swig_rb_prop_apr_array_to_hash_prop(const apr_array_header_t *ary);
120 SVN_RB_SWIG_SWIGUTIL_EXPORT
121 apr_hash_t *svn_swig_rb_hash_to_apr_hash_string(VALUE hash, apr_pool_t *pool);
122 SVN_RB_SWIG_SWIGUTIL_EXPORT
123 apr_hash_t *svn_swig_rb_hash_to_apr_hash_svn_string(VALUE hash,
124 apr_pool_t *pool);
125 SVN_RB_SWIG_SWIGUTIL_EXPORT
126 apr_hash_t *svn_swig_rb_hash_to_apr_hash_swig_type(VALUE hash,
127 const char *typename,
128 apr_pool_t *pool);
129 SVN_RB_SWIG_SWIGUTIL_EXPORT
130 apr_hash_t *svn_swig_rb_hash_to_apr_hash_revnum(VALUE hash,
131 apr_pool_t *pool);
132 SVN_RB_SWIG_SWIGUTIL_EXPORT
133 apr_hash_t *svn_swig_rb_hash_to_apr_hash_merge_range(VALUE hash,
134 apr_pool_t *pool);
136 SVN_RB_SWIG_SWIGUTIL_EXPORT
137 apr_array_header_t *svn_swig_rb_strings_to_apr_array(VALUE strings,
138 apr_pool_t *pool);
139 SVN_RB_SWIG_SWIGUTIL_EXPORT
140 apr_array_header_t *
141 svn_swig_rb_array_to_auth_provider_object_apr_array(VALUE array,
142 apr_pool_t *pool);
143 SVN_RB_SWIG_SWIGUTIL_EXPORT
144 apr_array_header_t *svn_swig_rb_array_to_apr_array_revnum(VALUE array,
145 apr_pool_t *pool);
146 SVN_RB_SWIG_SWIGUTIL_EXPORT
147 apr_array_header_t *svn_swig_rb_array_to_apr_array_merge_range(VALUE array,
148 apr_pool_t *pool);
149 SVN_RB_SWIG_SWIGUTIL_EXPORT
150 apr_array_header_t *svn_swig_rb_array_to_apr_array_copy_source(VALUE array,
151 apr_pool_t *pool);
152 SVN_RB_SWIG_SWIGUTIL_EXPORT
153 apr_array_header_t *svn_swig_rb_array_to_apr_array_revision_range(VALUE array,
154 apr_pool_t *pool);
156 SVN_RB_SWIG_SWIGUTIL_EXPORT
157 apr_array_header_t *svn_swig_rb_to_apr_array_prop(VALUE array_or_hash,
158 apr_pool_t *pool);
159 SVN_RB_SWIG_SWIGUTIL_EXPORT
160 apr_array_header_t *svn_swig_rb_to_apr_array_row_prop(VALUE array_or_hash,
161 apr_pool_t *pool);
163 SVN_RB_SWIG_SWIGUTIL_EXPORT
164 void svn_swig_rb_get_pool(int argc, VALUE *argv, VALUE self, VALUE *rb_pool, apr_pool_t **pool);
165 SVN_RB_SWIG_SWIGUTIL_EXPORT
166 svn_boolean_t svn_swig_rb_set_pool(VALUE target, VALUE pool);
167 SVN_RB_SWIG_SWIGUTIL_EXPORT
168 void svn_swig_rb_set_pool_for_no_swig_type(VALUE target, VALUE pool);
169 SVN_RB_SWIG_SWIGUTIL_EXPORT
170 void svn_swig_rb_push_pool(VALUE pool);
171 SVN_RB_SWIG_SWIGUTIL_EXPORT
172 void svn_swig_rb_pop_pool(VALUE pool);
173 SVN_RB_SWIG_SWIGUTIL_EXPORT
174 void svn_swig_rb_destroy_pool(VALUE pool);
175 SVN_RB_SWIG_SWIGUTIL_EXPORT
176 void svn_swig_rb_destroy_internal_pool(VALUE pool);
178 SVN_RB_SWIG_SWIGUTIL_EXPORT
179 void svn_swig_rb_make_delta_editor(svn_delta_editor_t **editor,
180 void **edit_baton,
181 VALUE rb_editor,
182 apr_pool_t *pool);
184 SVN_RB_SWIG_SWIGUTIL_EXPORT
185 VALUE svn_swig_rb_make_baton(VALUE proc, VALUE pool);
186 SVN_RB_SWIG_SWIGUTIL_EXPORT
187 void svn_swig_rb_set_baton(VALUE target, VALUE baton);
189 SVN_RB_SWIG_SWIGUTIL_EXPORT
190 svn_error_t *svn_swig_rb_log_receiver(void *baton,
191 apr_hash_t *changed_paths,
192 svn_revnum_t revision,
193 const char *author,
194 const char *date,
195 const char *message,
196 apr_pool_t *pool);
198 SVN_RB_SWIG_SWIGUTIL_EXPORT
199 svn_error_t *svn_swig_rb_repos_authz_func(svn_boolean_t *allowed,
200 svn_fs_root_t *root,
201 const char *path,
202 void *baton,
203 apr_pool_t *pool);
205 SVN_RB_SWIG_SWIGUTIL_EXPORT
206 svn_error_t *svn_swig_rb_repos_authz_callback(svn_repos_authz_access_t required,
207 svn_boolean_t *allowed,
208 svn_fs_root_t *root,
209 const char *path,
210 void *baton,
211 apr_pool_t *pool);
213 /* Implements the svn_client_get_commit_log3_t API. */
214 SVN_RB_SWIG_SWIGUTIL_EXPORT
215 svn_error_t *svn_swig_rb_get_commit_log_func(const char **log_msg,
216 const char **tmp_file,
217 const apr_array_header_t *
218 commit_items,
219 void *baton,
220 apr_pool_t *pool);
222 SVN_RB_SWIG_SWIGUTIL_EXPORT
223 void svn_swig_rb_notify_func2(void *baton,
224 const svn_wc_notify_t *notify,
225 apr_pool_t *pool);
226 SVN_RB_SWIG_SWIGUTIL_EXPORT
227 svn_error_t *svn_swig_rb_conflict_resolver_func
228 (svn_wc_conflict_result_t **result,
229 const svn_wc_conflict_description_t *description,
230 void *baton,
231 apr_pool_t *pool);
232 SVN_RB_SWIG_SWIGUTIL_EXPORT
233 svn_error_t *svn_swig_rb_commit_callback(svn_revnum_t new_revision,
234 const char *date,
235 const char *author,
236 void *baton);
237 SVN_RB_SWIG_SWIGUTIL_EXPORT
238 svn_error_t *svn_swig_rb_commit_callback2(const svn_commit_info_t *commit_info,
239 void *baton,
240 apr_pool_t *pool);
241 SVN_RB_SWIG_SWIGUTIL_EXPORT
242 svn_error_t *svn_swig_rb_cancel_func(void *cancel_baton);
244 SVN_RB_SWIG_SWIGUTIL_EXPORT
245 svn_error_t *svn_swig_rb_info_receiver(void *baton,
246 const char *path,
247 const svn_info_t *info,
248 apr_pool_t *pool);
250 SVN_RB_SWIG_SWIGUTIL_EXPORT
251 svn_boolean_t svn_swig_rb_config_enumerator(const char *name,
252 const char *value,
253 void *baton,
254 apr_pool_t *pool);
255 SVN_RB_SWIG_SWIGUTIL_EXPORT
256 svn_boolean_t svn_swig_rb_config_section_enumerator(const char *name,
257 void *baton,
258 apr_pool_t *pool);
260 SVN_RB_SWIG_SWIGUTIL_EXPORT
261 svn_error_t *svn_swig_rb_delta_path_driver_cb_func(void **dir_baton,
262 void *parent_baton,
263 void *callback_baton,
264 const char *path,
265 apr_pool_t *pool);
267 SVN_RB_SWIG_SWIGUTIL_EXPORT
268 svn_error_t *svn_swig_rb_txdelta_window_handler(svn_txdelta_window_t *window,
269 void *baton);
271 SVN_RB_SWIG_SWIGUTIL_EXPORT
272 void svn_swig_rb_fs_warning_callback(void *baton, svn_error_t *err);
273 SVN_RB_SWIG_SWIGUTIL_EXPORT
274 void svn_swig_rb_fs_warning_callback_baton_register(VALUE baton,
275 apr_pool_t *pool);
277 SVN_RB_SWIG_SWIGUTIL_EXPORT
278 svn_error_t *svn_swig_rb_fs_get_locks_callback(void *baton,
279 svn_lock_t *lock,
280 apr_pool_t *pool);
282 SVN_RB_SWIG_SWIGUTIL_EXPORT
283 svn_error_t *svn_swig_rb_just_call(void *baton);
285 SVN_RB_SWIG_SWIGUTIL_EXPORT
286 void svn_swig_rb_setup_ra_callbacks(svn_ra_callbacks2_t **callbacks,
287 void **baton,
288 VALUE rb_callbacks,
289 apr_pool_t *pool);
291 SVN_RB_SWIG_SWIGUTIL_EXPORT
292 svn_error_t *svn_swig_rb_ra_lock_callback(void *baton,
293 const char *path,
294 svn_boolean_t do_lock,
295 const svn_lock_t *lock,
296 svn_error_t *ra_err,
297 apr_pool_t *pool);
299 SVN_RB_SWIG_SWIGUTIL_EXPORT
300 svn_error_t *svn_swig_rb_ra_file_rev_handler(void *baton,
301 const char *path,
302 svn_revnum_t rev,
303 apr_hash_t *rev_props,
304 svn_txdelta_window_handler_t *delta_handler,
305 void **delta_baton,
306 apr_array_header_t *prop_diffs,
307 apr_pool_t *pool);
309 SVN_RB_SWIG_SWIGUTIL_EXPORT
310 svn_error_t *svn_swig_rb_repos_history_func(void *baton,
311 const char *path,
312 svn_revnum_t revision,
313 apr_pool_t *pool);
315 SVN_RB_SWIG_SWIGUTIL_EXPORT
316 svn_error_t *svn_swig_rb_repos_file_rev_handler(void *baton,
317 const char *path,
318 svn_revnum_t rev,
319 apr_hash_t *rev_props,
320 svn_txdelta_window_handler_t *delta_handler,
321 void **delta_baton,
322 apr_array_header_t *prop_diffs,
323 apr_pool_t *pool);
325 SVN_RB_SWIG_SWIGUTIL_EXPORT
326 svn_error_t *svn_swig_rb_wc_relocation_validator3(void *baton,
327 const char *uuid,
328 const char *url,
329 const char *root_url,
330 apr_pool_t *pool);
333 /* auth provider callbacks */
334 SVN_RB_SWIG_SWIGUTIL_EXPORT
335 svn_error_t *svn_swig_rb_auth_simple_prompt_func(
336 svn_auth_cred_simple_t **cred,
337 void *baton,
338 const char *realm,
339 const char *username,
340 svn_boolean_t may_save,
341 apr_pool_t *pool);
343 SVN_RB_SWIG_SWIGUTIL_EXPORT
344 svn_error_t *svn_swig_rb_auth_username_prompt_func(
345 svn_auth_cred_username_t **cred,
346 void *baton,
347 const char *realm,
348 svn_boolean_t may_save,
349 apr_pool_t *pool);
351 SVN_RB_SWIG_SWIGUTIL_EXPORT
352 svn_error_t *svn_swig_rb_auth_ssl_server_trust_prompt_func(
353 svn_auth_cred_ssl_server_trust_t **cred,
354 void *baton,
355 const char *realm,
356 apr_uint32_t failures,
357 const svn_auth_ssl_server_cert_info_t *cert_info,
358 svn_boolean_t may_save,
359 apr_pool_t *pool);
361 SVN_RB_SWIG_SWIGUTIL_EXPORT
362 svn_error_t *svn_swig_rb_auth_ssl_client_cert_prompt_func(
363 svn_auth_cred_ssl_client_cert_t **cred,
364 void *baton,
365 const char *realm,
366 svn_boolean_t may_save,
367 apr_pool_t *pool);
369 SVN_RB_SWIG_SWIGUTIL_EXPORT
370 svn_error_t *svn_swig_rb_auth_ssl_client_cert_pw_prompt_func(
371 svn_auth_cred_ssl_client_cert_pw_t **cred,
372 void *baton,
373 const char *realm,
374 svn_boolean_t may_save,
375 apr_pool_t *pool);
377 SVN_RB_SWIG_SWIGUTIL_EXPORT
378 apr_file_t *svn_swig_rb_make_file(VALUE file, apr_pool_t *pool);
379 SVN_RB_SWIG_SWIGUTIL_EXPORT
380 svn_stream_t *svn_swig_rb_make_stream(VALUE io);
382 SVN_RB_SWIG_SWIGUTIL_EXPORT
383 VALUE svn_swig_rb_filename_to_temp_file(const char *file_name);
385 SVN_RB_SWIG_SWIGUTIL_EXPORT
386 void svn_swig_rb_set_revision(svn_opt_revision_t *rev, VALUE value);
388 SVN_RB_SWIG_SWIGUTIL_EXPORT
389 void svn_swig_rb_adjust_arg_for_client_ctx_and_pool(int *argc, VALUE **argv);
392 SVN_RB_SWIG_SWIGUTIL_EXPORT
393 void svn_swig_rb_wc_status_func(void *baton,
394 const char *path,
395 svn_wc_status2_t *status);
397 SVN_RB_SWIG_SWIGUTIL_EXPORT
398 svn_error_t *svn_swig_rb_client_blame_receiver_func(void *baton,
399 apr_int64_t line_no,
400 svn_revnum_t revision,
401 const char *author,
402 const char *date,
403 const char *line,
404 apr_pool_t *pool);
407 SVN_RB_SWIG_SWIGUTIL_EXPORT
408 svn_wc_entry_callbacks2_t *svn_swig_rb_wc_entry_callbacks2(void);
409 SVN_RB_SWIG_SWIGUTIL_EXPORT
410 svn_wc_diff_callbacks2_t *svn_swig_rb_wc_diff_callbacks2(void);
413 SVN_RB_SWIG_SWIGUTIL_EXPORT
414 VALUE svn_swig_rb_make_txdelta_window_handler_wrapper(VALUE *rb_handler_pool,
415 apr_pool_t **handler_pool,
416 svn_txdelta_window_handler_t **handler,
417 void ***handler_baton);
418 SVN_RB_SWIG_SWIGUTIL_EXPORT
419 VALUE svn_swig_rb_setup_txdelta_window_handler_wrapper(VALUE obj,
420 svn_txdelta_window_handler_t handler,
421 void *handler_baton);
422 SVN_RB_SWIG_SWIGUTIL_EXPORT
423 svn_error_t *svn_swig_rb_invoke_txdelta_window_handler(VALUE window_handler,
424 svn_txdelta_window_t *window,
425 apr_pool_t *pool);
426 SVN_RB_SWIG_SWIGUTIL_EXPORT
427 svn_error_t *svn_swig_rb_invoke_txdelta_window_handler_wrapper(VALUE obj,
428 svn_txdelta_window_t *window,
429 apr_pool_t *pool);
431 SVN_RB_SWIG_SWIGUTIL_EXPORT
432 VALUE svn_swig_rb_txdelta_window_t_ops_get(svn_txdelta_window_t *window);
435 SVN_RB_SWIG_SWIGUTIL_EXPORT
436 svn_error_t *svn_swig_rb_client_diff_summarize_func(const svn_client_diff_summarize_t *diff,
437 void *baton,
438 apr_pool_t *pool);
439 SVN_RB_SWIG_SWIGUTIL_EXPORT
440 svn_error_t *svn_swig_rb_client_list_func(void *baton,
441 const char *path,
442 const svn_dirent_t *dirent,
443 const svn_lock_t *lock,
444 const char *abs_path,
445 apr_pool_t *pool);
447 SVN_RB_SWIG_SWIGUTIL_EXPORT
448 svn_error_t *svn_swig_rb_proplist_receiver(void *baton,
449 const char *path,
450 apr_hash_t *prop_hash,
451 apr_pool_t *pool);
453 SVN_RB_SWIG_SWIGUTIL_EXPORT
454 svn_error_t *svn_swig_rb_changelist_receiver(void *baton,
455 const char *path,
456 const char *changelist,
457 apr_pool_t *pool);
459 SVN_RB_SWIG_SWIGUTIL_EXPORT
460 extern svn_ra_reporter3_t *svn_swig_rb_ra_reporter3;
462 #ifdef __cplusplus
464 #endif /* __cplusplus */
466 #endif /* SVN_SWIG_SWIGUTIL_RB_H */