~svn/ubuntu/raring/subversion/ppa

« back to all changes in this revision

Viewing changes to subversion/bindings/swig/core.i

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:26:14 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205012614-qom4xfypgtsqc2xq
Tags: 1.2.3dfsg1-3ubuntu1
Merge with the final Debian release of 1.2.3dfsg1-3, bringing in
fixes to the clean target, better documentation of the libdb4.3
upgrade and build fixes to work with swig1.3_1.3.27.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * core.i :  SWIG interface file for various core SVN and APR components
 
3
 *
 
4
 * ====================================================================
 
5
 * Copyright (c) 2000-2003 CollabNet.  All rights reserved.
 
6
 *
 
7
 * This software is licensed as described in the file COPYING, which
 
8
 * you should have received as part of this distribution.  The terms
 
9
 * are also available at http://subversion.tigris.org/license-1.html.
 
10
 * If newer versions of this license are posted there, you may use a
 
11
 * newer version instead, at your option.
 
12
 *
 
13
 * This software consists of voluntary contributions made by many
 
14
 * individuals.  For exact contribution history, see the revision
 
15
 * history and logs, available at http://subversion.tigris.org/.
 
16
 * ====================================================================
 
17
 */
 
18
 
 
19
#if defined(SWIGPERL)
 
20
%module "SVN::_Core"
 
21
#elif defined(SWIGRUBY)
 
22
%module "svn::ext::core"
 
23
#else
 
24
%module core
 
25
#endif
 
26
 
 
27
%include typemaps.i
 
28
 
 
29
%{
 
30
#include <apr.h>
 
31
#include <apr_general.h>
 
32
 
 
33
#include "svn_io.h"
 
34
#include "svn_pools.h"
 
35
#include "svn_version.h"
 
36
#include "svn_time.h"
 
37
#include "svn_props.h"
 
38
#include "svn_opt.h"
 
39
#include "svn_auth.h"
 
40
#include "svn_config.h"
 
41
#include "svn_version.h"
 
42
#include "svn_md5.h"
 
43
#include "svn_diff.h"
 
44
#include "svn_error_codes.h"
 
45
#include "svn_utf.h"
 
46
 
 
47
#ifdef SWIGPYTHON
 
48
#include "swigutil_py.h"
 
49
#endif
 
50
 
 
51
#ifdef SWIGPERL
 
52
#include "swigutil_pl.h"
 
53
#endif
 
54
 
 
55
#ifdef SWIGRUBY
 
56
#include "swigutil_rb.h"
 
57
#endif
 
58
%}
 
59
 
 
60
/* We don't want to hear about supposedly bad constant values */
 
61
#pragma SWIG nowarn=305
 
62
 
 
63
/* ### for now, let's ignore this thing. */
 
64
#ifndef SWIGRUBY
 
65
%ignore svn_prop_t;
 
66
#endif
 
67
 
 
68
/* -----------------------------------------------------------------------
 
69
   The following struct members have to be read-only because otherwise
 
70
   strings assigned to then would never be freed, resulting in memory
 
71
   leaks. This prevents the swig warning "Warning(451): Setting const
 
72
   char * member may leak memory."
 
73
*/
 
74
%immutable svn_log_changed_path_t::copyfrom_path;
 
75
%immutable svn_dirent_t::last_author;
 
76
%immutable svn_error_t::message;
 
77
%immutable svn_error_t::file;
 
78
 
 
79
/* ----------------------------------------------------------------------- 
 
80
   We want the error code enums wrapped so we must include svn_error_codes.h
 
81
   before anything else does. 
 
82
*/
 
83
 
 
84
%include svn_error_codes.h
 
85
 
 
86
/* ----------------------------------------------------------------------- 
 
87
   Include svn_types.i early. Other .i files will import svn_types.i which
 
88
   then includes svn_types.h, making further includes get skipped. We want
 
89
   to actually generate wrappers for svn_types.h, so do an _include_ right
 
90
   now, before any _import_ has happened.
 
91
*/
 
92
 
 
93
%include svn_types.i
 
94
 
 
95
 
 
96
/* ----------------------------------------------------------------------- 
 
97
   moving along...
 
98
*/
 
99
%import apr.i
 
100
%import svn_types.i
 
101
%import svn_string.i
 
102
 
 
103
/* ----------------------------------------------------------------------- 
 
104
   completely ignore a number of functions. the presumption is that the
 
105
   scripting language already has facilities for these things (or they
 
106
   are relatively trivial).
 
107
*/
 
108
 
 
109
/* svn_io.h: We cherry-pick certain functions from this file. To aid in this,
 
110
 * EVERY function in the file is listed in the order it appears, and is either
 
111
 * %ignore-d, or present as a comment, explicitly documenting that we wrap it.
 
112
 */
 
113
 
 
114
%ignore svn_io_check_path;
 
115
%ignore svn_io_check_special_path;
 
116
%ignore svn_io_check_resolved_path;
 
117
/* This is useful for implementing svn_ra_callbacks_t->open_tmp_file */ 
 
118
// svn_io_open_unique_file
 
119
%ignore svn_io_create_unique_link;
 
120
%ignore svn_io_read_link;
 
121
%ignore svn_io_temp_dir;
 
122
%ignore svn_io_copy_file;
 
123
%ignore svn_io_copy_link;
 
124
%ignore svn_io_copy_dir_recursively;
 
125
%ignore svn_io_make_dir_recursively;
 
126
%ignore svn_io_dir_empty;
 
127
%ignore svn_io_append_file;
 
128
%ignore svn_io_set_file_read_only;
 
129
%ignore svn_io_set_file_read_write;
 
130
%ignore svn_io_set_file_executable;
 
131
%ignore svn_io_is_file_executable;
 
132
%ignore svn_io_read_length_line;
 
133
%ignore svn_io_file_affected_time;
 
134
%ignore svn_io_set_file_affected_time;
 
135
%ignore svn_io_filesizes_different_p;
 
136
// svn_io_file_checksum
 
137
// svn_io_files_contents_same_p
 
138
%ignore svn_io_file_create;
 
139
%ignore svn_io_file_lock;
 
140
%ignore svn_io_file_lock2;
 
141
%ignore svn_io_file_flush_to_disk;
 
142
%ignore svn_io_dir_file_copy;
 
143
 
 
144
/* Not useful from scripting languages. Custom streams should be achieved
 
145
 * by passing a scripting language native stream into a svn_stream_t *
 
146
 * parameter, and letting a typemap using svn_swig_xx_make_stream() take
 
147
 * care of the details. */
 
148
%ignore svn_stream_create;
 
149
%ignore svn_stream_set_baton;
 
150
%ignore svn_stream_set_read;
 
151
%ignore svn_stream_set_write;
 
152
%ignore svn_stream_set_close;
 
153
 
 
154
/* The permitted svn_stream and svn_stringbuf functions could possibly
 
155
 * be used by a script, in conjunction with other APIs which return or
 
156
 * accept streams. This requires that the relevant language's custom
 
157
 * svn_stream_t wrapping code does not obstruct this usage. */
 
158
// svn_stream_empty
 
159
// svn_stream_from_aprfile
 
160
// svn_stream_for_stdout
 
161
// svn_stream_from_stringbuf
 
162
// svn_stream_compressed
 
163
// svn_stream_read
 
164
// svn_stream_write
 
165
// svn_stream_close
 
166
#ifdef SWIGRUBY
 
167
%ignore svn_stream_read;
 
168
%ignore svn_stream_write;
 
169
%ignore svn_stream_close;
 
170
#endif
 
171
 
 
172
/* Scripts can do the printf, then write to a stream.
 
173
 * We can't really handle the variadic, so ignore it. */
 
174
%ignore svn_stream_printf;
 
175
 
 
176
// svn_stream_readline
 
177
// svn_stream_copy
 
178
// svn_stringbuf_from_file
 
179
// svn_stringbuf_from_aprfile
 
180
 
 
181
%ignore svn_io_remove_file;
 
182
%ignore svn_io_remove_dir;
 
183
%ignore svn_io_get_dirents;
 
184
%ignore svn_io_dir_walk;
 
185
%ignore svn_io_run_cmd;
 
186
%ignore svn_io_run_diff;
 
187
%ignore svn_io_run_diff3;
 
188
// svn_io_detect_mimetype
 
189
%ignore svn_io_file_open;
 
190
%ignore svn_io_file_close;
 
191
%ignore svn_io_file_getc;
 
192
%ignore svn_io_file_info_get;
 
193
%ignore svn_io_file_read;
 
194
%ignore svn_io_file_read_full;
 
195
%ignore svn_io_file_seek;
 
196
%ignore svn_io_file_write;
 
197
%ignore svn_io_file_write_full;
 
198
%ignore svn_io_stat;
 
199
%ignore svn_io_file_rename;
 
200
%ignore svn_io_dir_make;
 
201
%ignore svn_io_dir_make_hidden;
 
202
%ignore svn_io_dir_make_sgid;
 
203
%ignore svn_io_dir_open;
 
204
%ignore svn_io_dir_remove_nonrecursive;
 
205
%ignore svn_io_dir_read;
 
206
%ignore svn_io_read_version_file;
 
207
%ignore svn_io_write_version_file;
 
208
 
 
209
/* Other files */
 
210
%ignore apr_check_dir_empty;
 
211
 
 
212
/* bad pool convention */
 
213
%ignore svn_opt_print_generic_help;
 
214
 
 
215
/* Ugliness because the constants are typedefed and SWIG ignores them
 
216
   as a result. */
 
217
%constant svn_revnum_t SWIG_SVN_INVALID_REVNUM = -1;
 
218
%constant svn_revnum_t SWIG_SVN_IGNORED_REVNUM = -1;
 
219
 
 
220
/* -----------------------------------------------------------------------
 
221
   these types (as 'type **') will always be an OUT param
 
222
*/
 
223
%apply SWIGTYPE **OUTPARAM {
 
224
  svn_auth_baton_t **, svn_diff_t **, svn_config_t **
 
225
}
 
226
 
 
227
/* -----------------------------------------------------------------------
 
228
   handle the MIME type return value of svn_io_detect_mimetype()
 
229
*/
 
230
%apply const char **OUTPUT { const char ** };
 
231
 
 
232
/* -----------------------------------------------------------------------
 
233
   fix up the svn_stream_read() ptr/len arguments
 
234
*/
 
235
%typemap(python, in) (char *buffer, apr_size_t *len) ($*2_type temp) {
 
236
    if (!PyInt_Check($input)) {
 
237
        PyErr_SetString(PyExc_TypeError,
 
238
                        "expecting an integer for the buffer size");
 
239
        return NULL;
 
240
    }
 
241
    temp = PyInt_AsLong($input);
 
242
    if (temp < 0) {
 
243
        PyErr_SetString(PyExc_ValueError,
 
244
                        "buffer size must be a positive integer");
 
245
        return NULL;
 
246
    }
 
247
    $1 = malloc(temp);
 
248
    $2 = ($2_ltype)&temp;
 
249
}
 
250
%typemap(perl5, in) (char *buffer, apr_size_t *len) ($*2_type temp) {
 
251
    temp = SvIV($input);
 
252
    $1 = malloc(temp);
 
253
    $2 = ($2_ltype)&temp;
 
254
}
 
255
%typemap(ruby, in) (char *buffer, apr_size_t *len) ($*2_type temp) {
 
256
    temp = NUM2LONG($input);
 
257
    $1 = malloc(temp);
 
258
    $2 = ($2_ltype)&temp;
 
259
}
 
260
 
 
261
/* ### need to use freearg or somesuch to ensure the string is freed.
 
262
   ### watch out for 'return' anywhere in the binding code. */
 
263
 
 
264
%typemap(python, argout, fragment="t_output_helper") (char *buffer, apr_size_t *len) {
 
265
    $result = t_output_helper($result, PyString_FromStringAndSize($1, *$2));
 
266
    free($1);
 
267
}
 
268
%typemap(perl5, argout) (char *buffer, apr_size_t *len) {
 
269
    $result = sv_newmortal();
 
270
    sv_setpvn ($result, $1, *$2);
 
271
    free($1);
 
272
    argvi++;
 
273
}
 
274
%typemap(ruby, argout, fragment="output_helper") (char *buffer, apr_size_t *len)
 
275
{
 
276
  $result = output_helper($result, *$2 == 0 ? Qnil : rb_str_new($1, *$2));
 
277
  free($1);
 
278
}
 
279
 
 
280
/* -----------------------------------------------------------------------
 
281
   fix up the svn_stream_write() ptr/len arguments
 
282
*/
 
283
%typemap(python, in) (const char *data, apr_size_t *len) ($*2_type temp) {
 
284
    if (!PyString_Check($input)) {
 
285
        PyErr_SetString(PyExc_TypeError,
 
286
                        "expecting a string for the buffer");
 
287
        return NULL;
 
288
    }
 
289
    $1 = PyString_AS_STRING($input);
 
290
    temp = PyString_GET_SIZE($input);
 
291
    $2 = ($2_ltype)&temp;
 
292
}
 
293
%typemap(perl5, in) (const char *data, apr_size_t *len) ($*2_type temp) {
 
294
    $1 = SvPV($input, temp);
 
295
    $2 = ($2_ltype)&temp;
 
296
}
 
297
%typemap(ruby, in) (const char *data, apr_size_t *len) ($*2_type temp)
 
298
{
 
299
  $1 = StringValuePtr($input);
 
300
  temp = RSTRING($input)->len;
 
301
  $2 = ($2_ltype)&temp;
 
302
}
 
303
 
 
304
%typemap(python, argout, fragment="t_output_helper") (const char *data, apr_size_t *len) {
 
305
    $result = t_output_helper($result, PyInt_FromLong(*$2));
 
306
}
 
307
 
 
308
%typemap(perl5, argout, fragment="t_output_helper") (const char *data, apr_size_t *len) {
 
309
    $result = sv_2mortal (newSViv(*$2));
 
310
}
 
311
 
 
312
%typemap(ruby, argout, fragment="output_helper") (const char *data, apr_size_t *len)
 
313
{
 
314
    $result = output_helper($result, LONG2NUM(*$2));
 
315
}
 
316
 
 
317
/* -----------------------------------------------------------------------
 
318
   auth provider convertors 
 
319
*/
 
320
%typemap(perl5, in) apr_array_header_t *providers {
 
321
    $1 = (apr_array_header_t *) svn_swig_pl_objs_to_array($input, SWIGTYPE_p_svn_auth_provider_object_t, _global_pool);
 
322
}
 
323
 
 
324
%typemap(python, in) apr_array_header_t *providers {
 
325
    svn_auth_provider_object_t *provider;
 
326
    int targlen;
 
327
    if (!PySequence_Check($input)) {
 
328
        PyErr_SetString(PyExc_TypeError, "not a sequence");
 
329
        return NULL;
 
330
    }
 
331
    targlen = PySequence_Length($input);
 
332
    $1 = apr_array_make(_global_pool, targlen, sizeof(provider));
 
333
    ($1)->nelts = targlen;
 
334
    while (targlen--) {
 
335
        SWIG_ConvertPtr(PySequence_GetItem($input, targlen),
 
336
                        (void **)&provider, 
 
337
                        $descriptor(svn_auth_provider_object_t *),
 
338
                        SWIG_POINTER_EXCEPTION | 0);
 
339
        APR_ARRAY_IDX($1, targlen, svn_auth_provider_object_t *) = provider;
 
340
    }
 
341
}
 
342
 
 
343
%typemap(ruby, in) apr_array_header_t *providers
 
344
{
 
345
  $1 = svn_swig_rb_array_to_auth_provider_object_apr_array($input, _global_pool);
 
346
}
 
347
 
 
348
/* -----------------------------------------------------------------------
 
349
   auth parameter set/get
 
350
*/
 
351
%typemap(python, in) const void *value {
 
352
    if (PyString_Check($input)) {
 
353
        $1 = (void *)PyString_AS_STRING($input);
 
354
    }
 
355
    else if (PyLong_Check($input)) {
 
356
        $1 = (void *)PyLong_AsLong($input);
 
357
    }
 
358
    else if (PyInt_Check($input)) {
 
359
        $1 = (void *)PyInt_AsLong($input);
 
360
    }
 
361
    else {
 
362
        PyErr_SetString(PyExc_TypeError, "not a known type");
 
363
        return NULL;
 
364
    }
 
365
}
 
366
 
 
367
%ignore svn_auth_get_parameter;
 
368
 
 
369
/* -----------------------------------------------------------------------
 
370
   describe how to pass a FILE* as a parameter (svn_stream_from_stdio)
 
371
*/
 
372
%typemap(python, in) FILE * {
 
373
    $1 = PyFile_AsFile($input);
 
374
    if ($1 == NULL) {
 
375
        PyErr_SetString(PyExc_ValueError, "Must pass in a valid file object");
 
376
        return NULL;
 
377
    }
 
378
}
 
379
%typemap(perl5, in) FILE * {
 
380
    $1 = PerlIO_exportFILE (IoIFP (sv_2io ($input)), NULL);
 
381
}
 
382
 
 
383
/* -----------------------------------------------------------------------
 
384
   wrap some specific APR functionality
 
385
*/
 
386
 
 
387
apr_status_t apr_initialize(void);
 
388
void apr_terminate(void);
 
389
 
 
390
apr_status_t apr_time_ansi_put(apr_time_t *result, time_t input);
 
391
 
 
392
void apr_pool_destroy(apr_pool_t *p);
 
393
void apr_pool_clear(apr_pool_t *p);
 
394
 
 
395
apr_status_t apr_file_open_stdout (apr_file_t **out, apr_pool_t *pool);
 
396
apr_status_t apr_file_open_stderr (apr_file_t **out, apr_pool_t *pool);
 
397
 
 
398
/* -----------------------------------------------------------------------
 
399
   pool functions renaming since swig doesn't take care of the #define's
 
400
*/
 
401
%rename (svn_pool_create) svn_pool_create_ex;
 
402
%ignore svn_pool_create_ex_debug;
 
403
%typemap(default) apr_allocator_t *allocator {
 
404
    $1 = NULL;
 
405
}
 
406
 
 
407
/* -----------------------------------------------------------------------
 
408
   Default pool handling for perl.
 
409
*/
 
410
#ifdef SWIGPERL
 
411
 
 
412
/* Fix for SWIG 1.3.24 */
 
413
#if SWIG_VERSION == 0x010324
 
414
%typemap(varin) apr_pool_t * {
 
415
  void *temp;
 
416
  if (SWIG_ConvertPtr($input, (void **) &temp, $1_descriptor,0) < 0) {
 
417
    croak("Type error in argument $argnum of $symname. Expected $1_mangle");
 
418
  }
 
419
  $1 = ($1_ltype) temp;
 
420
}
 
421
#endif
 
422
 
 
423
apr_pool_t *current_pool;
 
424
 
 
425
#if SWIG_VERSION <= 0x10324
 
426
%{
 
427
#define SVN_SWIGEXPORT(t) SWIGEXPORT(t)
 
428
%}
 
429
#else
 
430
%{
 
431
#define SVN_SWIGEXPORT(t) SWIGEXPORT t
 
432
%}
 
433
#endif
 
434
 
 
435
%{
 
436
 
 
437
static apr_pool_t *current_pool = 0;
 
438
 
 
439
SVN_SWIGEXPORT(apr_pool_t *)
 
440
svn_swig_pl_get_current_pool (void)
 
441
{
 
442
  return current_pool;
 
443
}
 
444
 
 
445
SVN_SWIGEXPORT(void)
 
446
svn_swig_pl_set_current_pool (apr_pool_t *pool)
 
447
{
 
448
  current_pool = pool;
 
449
}
 
450
 
 
451
%}
 
452
 
 
453
#endif
 
454
 
 
455
/* -----------------------------------------------------------------------
 
456
   wrap config functions
 
457
*/
 
458
 
 
459
%typemap(perl5,in,numinputs=0) apr_hash_t **cfg_hash = apr_hash_t **OUTPUT;
 
460
%typemap(perl5,argout) apr_hash_t **cfg_hash {
 
461
    ST(argvi++) = svn_swig_pl_convert_hash(*$1, SWIGTYPE_p_svn_config_t);
 
462
}
 
463
 
 
464
%typemap(perl5, in) (svn_config_enumerator_t callback, void *baton) {
 
465
    $1 = svn_swig_pl_thunk_config_enumerator,
 
466
    $2 = (void *)$input;
 
467
};
 
468
 
 
469
%typemap(ruby, in, numinputs=0) apr_hash_t **cfg_hash = apr_hash_t **OUTPUT;
 
470
%typemap(ruby, argout) apr_hash_t **cfg_hash {
 
471
  $result = svn_swig_rb_apr_hash_to_hash_swig_type(*$1, "svn_config_t *");
 
472
}
 
473
 
 
474
%typemap(python,in,numinputs=0) apr_hash_t **cfg_hash = apr_hash_t **OUTPUT;
 
475
%typemap(python,argout,fragment="t_output_helper") apr_hash_t **cfg_hash {
 
476
    $result = t_output_helper(
 
477
        $result,
 
478
        SWIG_NewPointerObj(*$1, SWIGTYPE_p_apr_hash_t, 0));
 
479
}
 
480
 
 
481
/* Allow None to be passed as config_dir argument */
 
482
%typemap(python,in,parse="z") const char *config_dir "";
 
483
%typemap(ruby, in) const char *config_dir {
 
484
  if (NIL_P($input)) {
 
485
    $1 = "";
 
486
  } else {
 
487
    $1 = StringValuePtr($input);
 
488
  }
 
489
}
 
490
 
 
491
#ifdef SWIGPYTHON
 
492
PyObject *svn_swig_py_exception_type(void);
 
493
#endif
 
494
 
 
495
/* svn_prop_diffs */
 
496
%typemap(ruby, in, numinputs=0)
 
497
     apr_array_header_t **propdiffs (apr_array_header_t *temp)
 
498
{
 
499
  $1 = &temp;
 
500
}
 
501
 
 
502
%typemap(ruby, argout, fragment="output_helper") apr_array_header_t **propdiffs
 
503
{
 
504
  $result = output_helper($result, svn_swig_rb_apr_array_to_array_prop(*$1));
 
505
}
 
506
 
 
507
%apply apr_hash_t *PROPHASH {
 
508
  apr_hash_t *target_props,
 
509
  apr_hash_t *source_props
 
510
};
 
511
 
 
512
%typemap(ruby, in) apr_array_header_t *proplist
 
513
{
 
514
  $1 = svn_swig_rb_array_to_apr_array_prop($input, _global_pool);
 
515
}
 
516
 
 
517
%apply apr_array_header_t **OUTPUT_OF_PROP {
 
518
  apr_array_header_t **entry_props,
 
519
  apr_array_header_t **wc_props,
 
520
  apr_array_header_t **regular_props
 
521
};
 
522
 
 
523
/* ----------------------------------------------------------------------- */
 
524
 
 
525
%include svn_types.h
 
526
%include svn_pools.h
 
527
%include svn_version.h
 
528
%include svn_time.h
 
529
#ifdef SWIGRUBY
 
530
%immutable name;
 
531
%immutable value;
 
532
#endif
 
533
%include svn_props.h
 
534
#ifdef SWIGRUBY
 
535
%mutable name;
 
536
%mutable value;
 
537
#endif
 
538
%include svn_opt.h
 
539
%include svn_auth.h
 
540
%include svn_config.h
 
541
%include svn_version.h
 
542
%include svn_utf.h
 
543
 
 
544
 
 
545
/* SWIG won't follow through to APR's defining this to be empty, so we
 
546
   need to do it manually, before SWIG sees this in svn_io.h. */
 
547
#define __attribute__(x)
 
548
 
 
549
%include svn_io.h
 
550
 
 
551
#ifdef SWIGPERL
 
552
%include svn_diff.h
 
553
%include svn_error.h
 
554
#endif
 
555
 
 
556
#ifdef SWIGPYTHON
 
557
%init %{
 
558
/* This is a hack.  I dunno if we can count on SWIG calling the module "m" */
 
559
PyModule_AddObject(m, "SubversionException", 
 
560
                   svn_swig_py_register_exception());
 
561
%}
 
562
 
 
563
%pythoncode %{
 
564
SubversionException = _core.SubversionException
 
565
%}
 
566
#endif
 
567
 
 
568
#ifdef SWIGRUBY
 
569
%include svn_diff.h
 
570
%rename(svn_stream_read) svn_stream_read_;
 
571
%rename(svn_stream_write) svn_stream_write_;
 
572
%rename(svn_stream_close) svn_stream_close_;
 
573
%inline %{
 
574
svn_error_t *
 
575
svn_stream_read_ (svn_stream_t *stream, char *buffer,
 
576
                 apr_size_t *len, apr_pool_t *pool)
 
577
{
 
578
  if (NIL_P(pool)) {
 
579
    rb_raise(rb_eArgError, "pool must be not nil");
 
580
  }
 
581
  return svn_stream_read(stream, buffer, len);
 
582
}
 
583
svn_error_t *
 
584
svn_stream_write_ (svn_stream_t *stream, const char *data,
 
585
                    apr_size_t *len, apr_pool_t *pool)
 
586
{
 
587
  if (NIL_P(pool)) {
 
588
    rb_raise(rb_eArgError, "pool must be not nil");
 
589
  }
 
590
  return svn_stream_write(stream, data, len);
 
591
}
 
592
svn_error_t *
 
593
svn_stream_close_ (svn_stream_t *stream, apr_pool_t *pool)
 
594
{
 
595
  if (NIL_P(pool)) {
 
596
    rb_raise(rb_eArgError, "pool must be not nil");
 
597
  }
 
598
  return svn_stream_close(stream);
 
599
}
 
600
%}
 
601
REMOVE_DESTRUCTOR(svn_error_t)
 
602
REMOVE_DESTRUCTOR(svn_dirent_t)
 
603
REMOVE_DESTRUCTOR(svn_prop_t)
 
604
REMOVE_DESTRUCTOR(svn_log_changed_path_t)
 
605
REMOVE_DESTRUCTOR(svn_version_checklist_t)
 
606
REMOVE_DESTRUCTOR(svn_opt_subcommand_desc_t)
 
607
REMOVE_DESTRUCTOR(svn_opt_revision_t)
 
608
REMOVE_DESTRUCTOR(svn_opt_revision_t_value)
 
609
REMOVE_DESTRUCTOR(svn_auth_provider_t)
 
610
REMOVE_DESTRUCTOR(svn_auth_provider_object_t)
 
611
REMOVE_DESTRUCTOR(svn_auth_cred_simple_t)
 
612
REMOVE_DESTRUCTOR(svn_auth_cred_username_t)
 
613
REMOVE_DESTRUCTOR(svn_auth_cred_ssl_client_cert_t)
 
614
REMOVE_DESTRUCTOR(svn_auth_cred_ssl_client_cert_pw_t)
 
615
REMOVE_DESTRUCTOR(svn_auth_ssl_server_cert_info_t)
 
616
REMOVE_DESTRUCTOR(svn_auth_cred_ssl_server_trust_t)
 
617
REMOVE_DESTRUCTOR(svn_diff_fns_t)
 
618
REMOVE_DESTRUCTOR(svn_diff_output_fns_t)
 
619
#endif