/
zkrb_wrapper.h
330 lines (293 loc) · 8.86 KB
/
zkrb_wrapper.h
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
#ifndef ZKRB_WRAPPER_H
#define ZKRB_WRAPPER_H
#if 0
AUTOGENERATED BY generate_gvl_code.rb
#endif
#include "ruby.h"
#include "c-client-src/zookeeper.h"
#include "zkrb_wrapper_compat.h"
#include "dbg.h"
#define ZKRB_FAIL -1
typedef struct {
zhandle_t *zh;
int rc;
} zkrb_zoo_recv_timeout_args_t;
typedef struct {
zhandle_t *zh;
int rc;
} zkrb_zoo_state_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
const char *value;
int valuelen;
const struct ACL_vector *acl;
int flags;
string_completion_t completion;
const void *data;
int rc;
} zkrb_zoo_acreate_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
int version;
void_completion_t completion;
const void *data;
int rc;
} zkrb_zoo_adelete_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
int watch;
stat_completion_t completion;
const void *data;
int rc;
} zkrb_zoo_aexists_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
watcher_fn watcher;
void* watcherCtx;
stat_completion_t completion;
const void *data;
int rc;
} zkrb_zoo_awexists_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
int watch;
data_completion_t completion;
const void *data;
int rc;
} zkrb_zoo_aget_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
watcher_fn watcher;
void* watcherCtx;
data_completion_t completion;
const void *data;
int rc;
} zkrb_zoo_awget_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
const char *buffer;
int buflen;
int version;
stat_completion_t completion;
const void *data;
int rc;
} zkrb_zoo_aset_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
int watch;
strings_completion_t completion;
const void *data;
int rc;
} zkrb_zoo_aget_children_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
watcher_fn watcher;
void* watcherCtx;
strings_completion_t completion;
const void *data;
int rc;
} zkrb_zoo_awget_children_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
int watch;
strings_stat_completion_t completion;
const void *data;
int rc;
} zkrb_zoo_aget_children2_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
watcher_fn watcher;
void* watcherCtx;
strings_stat_completion_t completion;
const void *data;
int rc;
} zkrb_zoo_awget_children2_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
string_completion_t completion;
const void *data;
int rc;
} zkrb_zoo_async_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
acl_completion_t completion;
const void *data;
int rc;
} zkrb_zoo_aget_acl_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
int version;
struct ACL_vector *acl;
void_completion_t completion;
const void *data;
int rc;
} zkrb_zoo_aset_acl_args_t;
typedef struct {
zhandle_t *zh;
const char* scheme;
const char* cert;
int certLen;
void_completion_t completion;
const void *data;
int rc;
} zkrb_zoo_add_auth_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
const char *value;
int valuelen;
const struct ACL_vector *acl;
int flags;
char *path_buffer;
int path_buffer_len;
int rc;
} zkrb_zoo_create_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
int version;
int rc;
} zkrb_zoo_delete_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
int watch;
struct Stat *stat;
int rc;
} zkrb_zoo_exists_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
watcher_fn watcher;
void* watcherCtx;
struct Stat *stat;
int rc;
} zkrb_zoo_wexists_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
int watch;
char *buffer;
int* buffer_len;
struct Stat *stat;
int rc;
} zkrb_zoo_get_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
watcher_fn watcher;
void* watcherCtx;
char *buffer;
int* buffer_len;
struct Stat *stat;
int rc;
} zkrb_zoo_wget_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
const char *buffer;
int buflen;
int version;
int rc;
} zkrb_zoo_set_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
const char *buffer;
int buflen;
int version;
struct Stat *stat;
int rc;
} zkrb_zoo_set2_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
int watch;
struct String_vector *strings;
int rc;
} zkrb_zoo_get_children_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
watcher_fn watcher;
void* watcherCtx;
struct String_vector *strings;
int rc;
} zkrb_zoo_wget_children_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
int watch;
struct String_vector *strings;
struct Stat *stat;
int rc;
} zkrb_zoo_get_children2_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
watcher_fn watcher;
void* watcherCtx;
struct String_vector *strings;
struct Stat *stat;
int rc;
} zkrb_zoo_wget_children2_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
struct ACL_vector *acl;
struct Stat *stat;
int rc;
} zkrb_zoo_get_acl_args_t;
typedef struct {
zhandle_t *zh;
const char *path;
int version;
const struct ACL_vector *acl;
int rc;
} zkrb_zoo_set_acl_args_t;
int zkrb_call_zoo_recv_timeout(zhandle_t *zh);
int zkrb_call_zoo_state(zhandle_t *zh);
int zkrb_call_zoo_acreate(zhandle_t *zh, const char *path, const char *value, int valuelen, const struct ACL_vector *acl, int flags, string_completion_t completion, const void *data);
int zkrb_call_zoo_adelete(zhandle_t *zh, const char *path, int version, void_completion_t completion, const void *data);
int zkrb_call_zoo_aexists(zhandle_t *zh, const char *path, int watch, stat_completion_t completion, const void *data);
int zkrb_call_zoo_awexists(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, stat_completion_t completion, const void *data);
int zkrb_call_zoo_aget(zhandle_t *zh, const char *path, int watch, data_completion_t completion, const void *data);
int zkrb_call_zoo_awget(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, data_completion_t completion, const void *data);
int zkrb_call_zoo_aset(zhandle_t *zh, const char *path, const char *buffer, int buflen, int version, stat_completion_t completion, const void *data);
int zkrb_call_zoo_aget_children(zhandle_t *zh, const char *path, int watch, strings_completion_t completion, const void *data);
int zkrb_call_zoo_awget_children(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, strings_completion_t completion, const void *data);
int zkrb_call_zoo_aget_children2(zhandle_t *zh, const char *path, int watch, strings_stat_completion_t completion, const void *data);
int zkrb_call_zoo_awget_children2(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, strings_stat_completion_t completion, const void *data);
int zkrb_call_zoo_async(zhandle_t *zh, const char *path, string_completion_t completion, const void *data);
int zkrb_call_zoo_aget_acl(zhandle_t *zh, const char *path, acl_completion_t completion, const void *data);
int zkrb_call_zoo_aset_acl(zhandle_t *zh, const char *path, int version, struct ACL_vector *acl, void_completion_t completion, const void *data);
int zkrb_call_zoo_add_auth(zhandle_t *zh, const char* scheme, const char* cert, int certLen, void_completion_t completion, const void *data);
int zkrb_call_zoo_create(zhandle_t *zh, const char *path, const char *value, int valuelen, const struct ACL_vector *acl, int flags, char *path_buffer, int path_buffer_len);
int zkrb_call_zoo_delete(zhandle_t *zh, const char *path, int version);
int zkrb_call_zoo_exists(zhandle_t *zh, const char *path, int watch, struct Stat *stat);
int zkrb_call_zoo_wexists(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, struct Stat *stat);
int zkrb_call_zoo_get(zhandle_t *zh, const char *path, int watch, char *buffer, int* buffer_len, struct Stat *stat);
int zkrb_call_zoo_wget(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, char *buffer, int* buffer_len, struct Stat *stat);
int zkrb_call_zoo_set(zhandle_t *zh, const char *path, const char *buffer, int buflen, int version);
int zkrb_call_zoo_set2(zhandle_t *zh, const char *path, const char *buffer, int buflen, int version, struct Stat *stat);
int zkrb_call_zoo_get_children(zhandle_t *zh, const char *path, int watch, struct String_vector *strings);
int zkrb_call_zoo_wget_children(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, struct String_vector *strings);
int zkrb_call_zoo_get_children2(zhandle_t *zh, const char *path, int watch, struct String_vector *strings, struct Stat *stat);
int zkrb_call_zoo_wget_children2(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, struct String_vector *strings, struct Stat *stat);
int zkrb_call_zoo_get_acl(zhandle_t *zh, const char *path, struct ACL_vector *acl, struct Stat *stat);
int zkrb_call_zoo_set_acl(zhandle_t *zh, const char *path, int version, const struct ACL_vector *acl);
#endif /* ZKRB_WRAPPER_H */