summaryrefslogtreecommitdiff
path: root/subversion/bindings/swig/proxy/svn_io_h.swg
blob: d220ec8dc96216db7607f6c56a2e1a35ba48a606 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* Proxy classes for svn_io.h
 * DO NOT EDIT -- AUTOMATICALLY GENERATED */

/* No default constructors for opaque structs */
#ifdef SWIGPYTHON
%nodefault svn_stream_t;
%nodefault svn_stream_mark_t;
#endif

/* Callback typemaps */
#ifdef SWIGPYTHON
%apply CALLABLE_CALLBACK {
  svn_read_fn_t,
  svn_stream_skip_fn_t,
  svn_write_fn_t,
  svn_close_fn_t,
  svn_stream_mark_fn_t,
  svn_stream_seek_fn_t,
  svn_io_walk_func_t
};
%apply CALLABLE_CALLBACK * {
  svn_read_fn_t *,
  svn_stream_skip_fn_t *,
  svn_write_fn_t *,
  svn_close_fn_t *,
  svn_stream_mark_fn_t *,
  svn_stream_seek_fn_t *,
  svn_io_walk_func_t *
};
#endif

/* Baton typemaps */
#ifdef SWIGPYTHON
%apply void *PY_AS_VOID {
  void *cancel_baton,
  void *baton,
  void *walk_baton
};
#endif

/* Includes */
%{
#include "svn_io.h"
%}
%include svn_io.h

/* Structure definitions */
#ifdef SWIGPYTHON
%proxy(svn_io_dirent2_t);
%proxy(svn_io_dirent_t);
%opaque_proxy(svn_stream_t);
%opaque_proxy(svn_stream_mark_t);
#endif

/* Callbacks */

%inline %{
static svn_error_t * svn_read_invoke_fn(
  svn_read_fn_t _obj, void *baton, char *buffer, apr_size_t *len) {
  return _obj(baton, buffer, len);
}

static svn_error_t * svn_stream_invoke_skip_fn(
  svn_stream_skip_fn_t _obj, void *baton, apr_size_t len) {
  return _obj(baton, len);
}

static svn_error_t * svn_write_invoke_fn(
  svn_write_fn_t _obj, void *baton, const char *data, apr_size_t *len) {
  return _obj(baton, data, len);
}

static svn_error_t * svn_close_invoke_fn(
  svn_close_fn_t _obj, void *baton) {
  return _obj(baton);
}

static svn_error_t * svn_stream_invoke_mark_fn(
  svn_stream_mark_fn_t _obj, void *baton, svn_stream_mark_t **mark, apr_pool_t *pool) {
  return _obj(baton, mark, pool);
}

static svn_error_t * svn_stream_invoke_seek_fn(
  svn_stream_seek_fn_t _obj, void *baton, const svn_stream_mark_t *mark) {
  return _obj(baton, mark);
}

static svn_error_t * svn_io_invoke_walk_func(
  svn_io_walk_func_t _obj, void *baton, const char *path, const apr_finfo_t *finfo, apr_pool_t *pool) {
  return _obj(baton, path, finfo, pool);
}

%}

#ifdef SWIGPYTHON
%funcptr_proxy(svn_read_fn_t, svn_read_invoke_fn);
%funcptr_proxy(svn_stream_skip_fn_t, svn_stream_invoke_skip_fn);
%funcptr_proxy(svn_write_fn_t, svn_write_invoke_fn);
%funcptr_proxy(svn_close_fn_t, svn_close_invoke_fn);
%funcptr_proxy(svn_stream_mark_fn_t, svn_stream_invoke_mark_fn);
%funcptr_proxy(svn_stream_seek_fn_t, svn_stream_invoke_seek_fn);
%funcptr_proxy(svn_io_walk_func_t, svn_io_invoke_walk_func);

#endif