zookeeper-ng 1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/.ctags_paths +1 -0
  3. data/.dotfiles/ruby-gemset +1 -0
  4. data/.dotfiles/ruby-version +1 -0
  5. data/.dotfiles/rvmrc +2 -0
  6. data/.gitignore +19 -0
  7. data/.gitmodules +3 -0
  8. data/.travis.yml +25 -0
  9. data/CHANGELOG +395 -0
  10. data/Gemfile +30 -0
  11. data/Guardfile +8 -0
  12. data/LICENSE +23 -0
  13. data/Manifest +29 -0
  14. data/README.markdown +85 -0
  15. data/Rakefile +121 -0
  16. data/cause-abort.rb +117 -0
  17. data/ext/.gitignore +6 -0
  18. data/ext/Rakefile +41 -0
  19. data/ext/c_zookeeper.rb +398 -0
  20. data/ext/common.h +17 -0
  21. data/ext/dbg.h +53 -0
  22. data/ext/depend +5 -0
  23. data/ext/event_lib.c +740 -0
  24. data/ext/event_lib.h +175 -0
  25. data/ext/extconf.rb +103 -0
  26. data/ext/generate_gvl_code.rb +321 -0
  27. data/ext/patches/zkc-3.3.5-network.patch +24 -0
  28. data/ext/patches/zkc-3.4.5-fetch-and-add.patch +16 -0
  29. data/ext/patches/zkc-3.4.5-logging.patch +41 -0
  30. data/ext/patches/zkc-3.4.5-out-of-order-ping.patch +163 -0
  31. data/ext/patches/zkc-3.4.5-overflow.patch +11 -0
  32. data/ext/patches/zkc-3.4.5-yosemite-htonl-fix.patch +102 -0
  33. data/ext/zkc-3.4.5.tar.gz +0 -0
  34. data/ext/zkrb.c +1075 -0
  35. data/ext/zkrb_wrapper.c +775 -0
  36. data/ext/zkrb_wrapper.h +350 -0
  37. data/ext/zkrb_wrapper_compat.c +15 -0
  38. data/ext/zkrb_wrapper_compat.h +11 -0
  39. data/ext/zookeeper_base.rb +256 -0
  40. data/java/java_base.rb +503 -0
  41. data/lib/zookeeper.rb +115 -0
  42. data/lib/zookeeper/acls.rb +44 -0
  43. data/lib/zookeeper/callbacks.rb +108 -0
  44. data/lib/zookeeper/client.rb +30 -0
  45. data/lib/zookeeper/client_methods.rb +282 -0
  46. data/lib/zookeeper/common.rb +122 -0
  47. data/lib/zookeeper/common/queue_with_pipe.rb +110 -0
  48. data/lib/zookeeper/compatibility.rb +138 -0
  49. data/lib/zookeeper/constants.rb +97 -0
  50. data/lib/zookeeper/continuation.rb +223 -0
  51. data/lib/zookeeper/core_ext.rb +58 -0
  52. data/lib/zookeeper/em_client.rb +55 -0
  53. data/lib/zookeeper/exceptions.rb +135 -0
  54. data/lib/zookeeper/forked.rb +19 -0
  55. data/lib/zookeeper/latch.rb +34 -0
  56. data/lib/zookeeper/logger.rb +39 -0
  57. data/lib/zookeeper/logger/forwarding_logger.rb +84 -0
  58. data/lib/zookeeper/monitor.rb +19 -0
  59. data/lib/zookeeper/rake_tasks.rb +165 -0
  60. data/lib/zookeeper/request_registry.rb +153 -0
  61. data/lib/zookeeper/stat.rb +21 -0
  62. data/lib/zookeeper/version.rb +4 -0
  63. data/notes.txt +14 -0
  64. data/scripts/upgrade-1.0-sed-alike.rb +46 -0
  65. data/spec/c_zookeeper_spec.rb +51 -0
  66. data/spec/chrooted_connection_spec.rb +83 -0
  67. data/spec/compatibilty_spec.rb +8 -0
  68. data/spec/default_watcher_spec.rb +41 -0
  69. data/spec/em_spec.rb +51 -0
  70. data/spec/ext/zookeeper_base_spec.rb +19 -0
  71. data/spec/forked_connection_spec.rb +124 -0
  72. data/spec/latch_spec.rb +24 -0
  73. data/spec/log4j.properties +17 -0
  74. data/spec/shared/all_success_return_values.rb +10 -0
  75. data/spec/shared/connection_examples.rb +1077 -0
  76. data/spec/spec_helper.rb +61 -0
  77. data/spec/support/00_logging.rb +38 -0
  78. data/spec/support/10_spawn_zookeeper.rb +24 -0
  79. data/spec/support/progress_formatter.rb +15 -0
  80. data/spec/support/zookeeper_spec_helpers.rb +96 -0
  81. data/spec/zookeeper_spec.rb +24 -0
  82. data/zookeeper.gemspec +38 -0
  83. data/zoomonkey/duplicates +3 -0
  84. data/zoomonkey/zoomonkey.rb +194 -0
  85. metadata +157 -0
@@ -0,0 +1,775 @@
1
+ /*
2
+
3
+ Autogenerated boilerplate wrappers around zoo_* function calls necessary for using
4
+ rb_thread_blocking_region to release the GIL when calling native code.
5
+
6
+ generated by ext/generate_gvl_code.rb
7
+
8
+ */
9
+
10
+ #include "ruby.h"
11
+ #include "zkrb_wrapper.h"
12
+ #include <errno.h>
13
+ #include <stdio.h>
14
+ #include <stdlib.h>
15
+
16
+ static VALUE zkrb_gvl_zoo_recv_timeout(void *data) {
17
+ zkrb_zoo_recv_timeout_args_t *a = (zkrb_zoo_recv_timeout_args_t *)data;
18
+ a->rc = zoo_recv_timeout(a->zh);
19
+ return Qnil;
20
+ }
21
+
22
+ // wrapper that calls zoo_recv_timeout via zkrb_gvl_zoo_recv_timeout inside rb_thread_blocking_region
23
+ int zkrb_call_zoo_recv_timeout(zhandle_t *zh) {
24
+ zkrb_zoo_recv_timeout_args_t args = {
25
+ .rc = ZKRB_FAIL,
26
+ .zh = zh
27
+ };
28
+
29
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_recv_timeout, (void *)&args);
30
+
31
+ return args.rc;
32
+ }
33
+
34
+
35
+ static VALUE zkrb_gvl_zoo_state(void *data) {
36
+ zkrb_zoo_state_args_t *a = (zkrb_zoo_state_args_t *)data;
37
+ a->rc = zoo_state(a->zh);
38
+ return Qnil;
39
+ }
40
+
41
+ // wrapper that calls zoo_state via zkrb_gvl_zoo_state inside rb_thread_blocking_region
42
+ int zkrb_call_zoo_state(zhandle_t *zh) {
43
+ zkrb_zoo_state_args_t args = {
44
+ .rc = ZKRB_FAIL,
45
+ .zh = zh
46
+ };
47
+
48
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_state, (void *)&args);
49
+
50
+ return args.rc;
51
+ }
52
+
53
+
54
+ static VALUE zkrb_gvl_zoo_acreate(void *data) {
55
+ zkrb_zoo_acreate_args_t *a = (zkrb_zoo_acreate_args_t *)data;
56
+ a->rc = zoo_acreate(a->zh, a->path, a->value, a->valuelen, a->acl, a->flags, a->completion, a->data);
57
+ return Qnil;
58
+ }
59
+
60
+ // wrapper that calls zoo_acreate via zkrb_gvl_zoo_acreate inside rb_thread_blocking_region
61
+ 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) {
62
+ zkrb_zoo_acreate_args_t args = {
63
+ .rc = ZKRB_FAIL,
64
+ .zh = zh,
65
+ .path = path,
66
+ .value = value,
67
+ .valuelen = valuelen,
68
+ .acl = acl,
69
+ .flags = flags,
70
+ .completion = completion,
71
+ .data = data
72
+ };
73
+
74
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_acreate, (void *)&args);
75
+
76
+ return args.rc;
77
+ }
78
+
79
+
80
+ static VALUE zkrb_gvl_zoo_adelete(void *data) {
81
+ zkrb_zoo_adelete_args_t *a = (zkrb_zoo_adelete_args_t *)data;
82
+ a->rc = zoo_adelete(a->zh, a->path, a->version, a->completion, a->data);
83
+ return Qnil;
84
+ }
85
+
86
+ // wrapper that calls zoo_adelete via zkrb_gvl_zoo_adelete inside rb_thread_blocking_region
87
+ int zkrb_call_zoo_adelete(zhandle_t *zh, const char *path, int version, void_completion_t completion, const void *data) {
88
+ zkrb_zoo_adelete_args_t args = {
89
+ .rc = ZKRB_FAIL,
90
+ .zh = zh,
91
+ .path = path,
92
+ .version = version,
93
+ .completion = completion,
94
+ .data = data
95
+ };
96
+
97
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_adelete, (void *)&args);
98
+
99
+ return args.rc;
100
+ }
101
+
102
+
103
+ static VALUE zkrb_gvl_zoo_aexists(void *data) {
104
+ zkrb_zoo_aexists_args_t *a = (zkrb_zoo_aexists_args_t *)data;
105
+ a->rc = zoo_aexists(a->zh, a->path, a->watch, a->completion, a->data);
106
+ return Qnil;
107
+ }
108
+
109
+ // wrapper that calls zoo_aexists via zkrb_gvl_zoo_aexists inside rb_thread_blocking_region
110
+ int zkrb_call_zoo_aexists(zhandle_t *zh, const char *path, int watch, stat_completion_t completion, const void *data) {
111
+ zkrb_zoo_aexists_args_t args = {
112
+ .rc = ZKRB_FAIL,
113
+ .zh = zh,
114
+ .path = path,
115
+ .watch = watch,
116
+ .completion = completion,
117
+ .data = data
118
+ };
119
+
120
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_aexists, (void *)&args);
121
+
122
+ return args.rc;
123
+ }
124
+
125
+
126
+ static VALUE zkrb_gvl_zoo_awexists(void *data) {
127
+ zkrb_zoo_awexists_args_t *a = (zkrb_zoo_awexists_args_t *)data;
128
+ a->rc = zoo_awexists(a->zh, a->path, a->watcher, a->watcherCtx, a->completion, a->data);
129
+ return Qnil;
130
+ }
131
+
132
+ // wrapper that calls zoo_awexists via zkrb_gvl_zoo_awexists inside rb_thread_blocking_region
133
+ int zkrb_call_zoo_awexists(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, stat_completion_t completion, const void *data) {
134
+ zkrb_zoo_awexists_args_t args = {
135
+ .rc = ZKRB_FAIL,
136
+ .zh = zh,
137
+ .path = path,
138
+ .watcher = watcher,
139
+ .watcherCtx = watcherCtx,
140
+ .completion = completion,
141
+ .data = data
142
+ };
143
+
144
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_awexists, (void *)&args);
145
+
146
+ return args.rc;
147
+ }
148
+
149
+
150
+ static VALUE zkrb_gvl_zoo_aget(void *data) {
151
+ zkrb_zoo_aget_args_t *a = (zkrb_zoo_aget_args_t *)data;
152
+ a->rc = zoo_aget(a->zh, a->path, a->watch, a->completion, a->data);
153
+ return Qnil;
154
+ }
155
+
156
+ // wrapper that calls zoo_aget via zkrb_gvl_zoo_aget inside rb_thread_blocking_region
157
+ int zkrb_call_zoo_aget(zhandle_t *zh, const char *path, int watch, data_completion_t completion, const void *data) {
158
+ zkrb_zoo_aget_args_t args = {
159
+ .rc = ZKRB_FAIL,
160
+ .zh = zh,
161
+ .path = path,
162
+ .watch = watch,
163
+ .completion = completion,
164
+ .data = data
165
+ };
166
+
167
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_aget, (void *)&args);
168
+
169
+ return args.rc;
170
+ }
171
+
172
+
173
+ static VALUE zkrb_gvl_zoo_awget(void *data) {
174
+ zkrb_zoo_awget_args_t *a = (zkrb_zoo_awget_args_t *)data;
175
+ a->rc = zoo_awget(a->zh, a->path, a->watcher, a->watcherCtx, a->completion, a->data);
176
+ return Qnil;
177
+ }
178
+
179
+ // wrapper that calls zoo_awget via zkrb_gvl_zoo_awget inside rb_thread_blocking_region
180
+ int zkrb_call_zoo_awget(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, data_completion_t completion, const void *data) {
181
+ zkrb_zoo_awget_args_t args = {
182
+ .rc = ZKRB_FAIL,
183
+ .zh = zh,
184
+ .path = path,
185
+ .watcher = watcher,
186
+ .watcherCtx = watcherCtx,
187
+ .completion = completion,
188
+ .data = data
189
+ };
190
+
191
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_awget, (void *)&args);
192
+
193
+ return args.rc;
194
+ }
195
+
196
+
197
+ static VALUE zkrb_gvl_zoo_aset(void *data) {
198
+ zkrb_zoo_aset_args_t *a = (zkrb_zoo_aset_args_t *)data;
199
+ a->rc = zoo_aset(a->zh, a->path, a->buffer, a->buflen, a->version, a->completion, a->data);
200
+ return Qnil;
201
+ }
202
+
203
+ // wrapper that calls zoo_aset via zkrb_gvl_zoo_aset inside rb_thread_blocking_region
204
+ 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) {
205
+ zkrb_zoo_aset_args_t args = {
206
+ .rc = ZKRB_FAIL,
207
+ .zh = zh,
208
+ .path = path,
209
+ .buffer = buffer,
210
+ .buflen = buflen,
211
+ .version = version,
212
+ .completion = completion,
213
+ .data = data
214
+ };
215
+
216
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_aset, (void *)&args);
217
+
218
+ return args.rc;
219
+ }
220
+
221
+
222
+ static VALUE zkrb_gvl_zoo_aget_children(void *data) {
223
+ zkrb_zoo_aget_children_args_t *a = (zkrb_zoo_aget_children_args_t *)data;
224
+ a->rc = zoo_aget_children(a->zh, a->path, a->watch, a->completion, a->data);
225
+ return Qnil;
226
+ }
227
+
228
+ // wrapper that calls zoo_aget_children via zkrb_gvl_zoo_aget_children inside rb_thread_blocking_region
229
+ int zkrb_call_zoo_aget_children(zhandle_t *zh, const char *path, int watch, strings_completion_t completion, const void *data) {
230
+ zkrb_zoo_aget_children_args_t args = {
231
+ .rc = ZKRB_FAIL,
232
+ .zh = zh,
233
+ .path = path,
234
+ .watch = watch,
235
+ .completion = completion,
236
+ .data = data
237
+ };
238
+
239
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_aget_children, (void *)&args);
240
+
241
+ return args.rc;
242
+ }
243
+
244
+
245
+ static VALUE zkrb_gvl_zoo_awget_children(void *data) {
246
+ zkrb_zoo_awget_children_args_t *a = (zkrb_zoo_awget_children_args_t *)data;
247
+ a->rc = zoo_awget_children(a->zh, a->path, a->watcher, a->watcherCtx, a->completion, a->data);
248
+ return Qnil;
249
+ }
250
+
251
+ // wrapper that calls zoo_awget_children via zkrb_gvl_zoo_awget_children inside rb_thread_blocking_region
252
+ int zkrb_call_zoo_awget_children(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, strings_completion_t completion, const void *data) {
253
+ zkrb_zoo_awget_children_args_t args = {
254
+ .rc = ZKRB_FAIL,
255
+ .zh = zh,
256
+ .path = path,
257
+ .watcher = watcher,
258
+ .watcherCtx = watcherCtx,
259
+ .completion = completion,
260
+ .data = data
261
+ };
262
+
263
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_awget_children, (void *)&args);
264
+
265
+ return args.rc;
266
+ }
267
+
268
+
269
+ static VALUE zkrb_gvl_zoo_aget_children2(void *data) {
270
+ zkrb_zoo_aget_children2_args_t *a = (zkrb_zoo_aget_children2_args_t *)data;
271
+ a->rc = zoo_aget_children2(a->zh, a->path, a->watch, a->completion, a->data);
272
+ return Qnil;
273
+ }
274
+
275
+ // wrapper that calls zoo_aget_children2 via zkrb_gvl_zoo_aget_children2 inside rb_thread_blocking_region
276
+ int zkrb_call_zoo_aget_children2(zhandle_t *zh, const char *path, int watch, strings_stat_completion_t completion, const void *data) {
277
+ zkrb_zoo_aget_children2_args_t args = {
278
+ .rc = ZKRB_FAIL,
279
+ .zh = zh,
280
+ .path = path,
281
+ .watch = watch,
282
+ .completion = completion,
283
+ .data = data
284
+ };
285
+
286
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_aget_children2, (void *)&args);
287
+
288
+ return args.rc;
289
+ }
290
+
291
+
292
+ static VALUE zkrb_gvl_zoo_awget_children2(void *data) {
293
+ zkrb_zoo_awget_children2_args_t *a = (zkrb_zoo_awget_children2_args_t *)data;
294
+ a->rc = zoo_awget_children2(a->zh, a->path, a->watcher, a->watcherCtx, a->completion, a->data);
295
+ return Qnil;
296
+ }
297
+
298
+ // wrapper that calls zoo_awget_children2 via zkrb_gvl_zoo_awget_children2 inside rb_thread_blocking_region
299
+ 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) {
300
+ zkrb_zoo_awget_children2_args_t args = {
301
+ .rc = ZKRB_FAIL,
302
+ .zh = zh,
303
+ .path = path,
304
+ .watcher = watcher,
305
+ .watcherCtx = watcherCtx,
306
+ .completion = completion,
307
+ .data = data
308
+ };
309
+
310
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_awget_children2, (void *)&args);
311
+
312
+ return args.rc;
313
+ }
314
+
315
+
316
+ static VALUE zkrb_gvl_zoo_async(void *data) {
317
+ zkrb_zoo_async_args_t *a = (zkrb_zoo_async_args_t *)data;
318
+ a->rc = zoo_async(a->zh, a->path, a->completion, a->data);
319
+ return Qnil;
320
+ }
321
+
322
+ // wrapper that calls zoo_async via zkrb_gvl_zoo_async inside rb_thread_blocking_region
323
+ int zkrb_call_zoo_async(zhandle_t *zh, const char *path, string_completion_t completion, const void *data) {
324
+ zkrb_zoo_async_args_t args = {
325
+ .rc = ZKRB_FAIL,
326
+ .zh = zh,
327
+ .path = path,
328
+ .completion = completion,
329
+ .data = data
330
+ };
331
+
332
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_async, (void *)&args);
333
+
334
+ return args.rc;
335
+ }
336
+
337
+
338
+ static VALUE zkrb_gvl_zoo_aget_acl(void *data) {
339
+ zkrb_zoo_aget_acl_args_t *a = (zkrb_zoo_aget_acl_args_t *)data;
340
+ a->rc = zoo_aget_acl(a->zh, a->path, a->completion, a->data);
341
+ return Qnil;
342
+ }
343
+
344
+ // wrapper that calls zoo_aget_acl via zkrb_gvl_zoo_aget_acl inside rb_thread_blocking_region
345
+ int zkrb_call_zoo_aget_acl(zhandle_t *zh, const char *path, acl_completion_t completion, const void *data) {
346
+ zkrb_zoo_aget_acl_args_t args = {
347
+ .rc = ZKRB_FAIL,
348
+ .zh = zh,
349
+ .path = path,
350
+ .completion = completion,
351
+ .data = data
352
+ };
353
+
354
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_aget_acl, (void *)&args);
355
+
356
+ return args.rc;
357
+ }
358
+
359
+
360
+ static VALUE zkrb_gvl_zoo_aset_acl(void *data) {
361
+ zkrb_zoo_aset_acl_args_t *a = (zkrb_zoo_aset_acl_args_t *)data;
362
+ a->rc = zoo_aset_acl(a->zh, a->path, a->version, a->acl, a->completion, a->data);
363
+ return Qnil;
364
+ }
365
+
366
+ // wrapper that calls zoo_aset_acl via zkrb_gvl_zoo_aset_acl inside rb_thread_blocking_region
367
+ 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) {
368
+ zkrb_zoo_aset_acl_args_t args = {
369
+ .rc = ZKRB_FAIL,
370
+ .zh = zh,
371
+ .path = path,
372
+ .version = version,
373
+ .acl = acl,
374
+ .completion = completion,
375
+ .data = data
376
+ };
377
+
378
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_aset_acl, (void *)&args);
379
+
380
+ return args.rc;
381
+ }
382
+
383
+
384
+ static VALUE zkrb_gvl_zoo_amulti(void *data) {
385
+ zkrb_zoo_amulti_args_t *a = (zkrb_zoo_amulti_args_t *)data;
386
+ a->rc = zoo_amulti(a->zh, a->count, a->ops, a->results, a->completion, a->data);
387
+ return Qnil;
388
+ }
389
+
390
+ // wrapper that calls zoo_amulti via zkrb_gvl_zoo_amulti inside rb_thread_blocking_region
391
+ int zkrb_call_zoo_amulti(zhandle_t *zh, int count, const zoo_op_t *ops, zoo_op_result_t *results, void_completion_t completion, const void *data) {
392
+ zkrb_zoo_amulti_args_t args = {
393
+ .rc = ZKRB_FAIL,
394
+ .zh = zh,
395
+ .count = count,
396
+ .ops = ops,
397
+ .results = results,
398
+ .completion = completion,
399
+ .data = data
400
+ };
401
+
402
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_amulti, (void *)&args);
403
+
404
+ return args.rc;
405
+ }
406
+
407
+
408
+ static VALUE zkrb_gvl_zoo_add_auth(void *data) {
409
+ zkrb_zoo_add_auth_args_t *a = (zkrb_zoo_add_auth_args_t *)data;
410
+ a->rc = zoo_add_auth(a->zh, a->scheme, a->cert, a->certLen, a->completion, a->data);
411
+ return Qnil;
412
+ }
413
+
414
+ // wrapper that calls zoo_add_auth via zkrb_gvl_zoo_add_auth inside rb_thread_blocking_region
415
+ int zkrb_call_zoo_add_auth(zhandle_t *zh, const char* scheme, const char* cert, int certLen, void_completion_t completion, const void *data) {
416
+ zkrb_zoo_add_auth_args_t args = {
417
+ .rc = ZKRB_FAIL,
418
+ .zh = zh,
419
+ .scheme = scheme,
420
+ .cert = cert,
421
+ .certLen = certLen,
422
+ .completion = completion,
423
+ .data = data
424
+ };
425
+
426
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_add_auth, (void *)&args);
427
+
428
+ return args.rc;
429
+ }
430
+
431
+
432
+ static VALUE zkrb_gvl_zoo_create(void *data) {
433
+ zkrb_zoo_create_args_t *a = (zkrb_zoo_create_args_t *)data;
434
+ a->rc = zoo_create(a->zh, a->path, a->value, a->valuelen, a->acl, a->flags, a->path_buffer, a->path_buffer_len);
435
+ return Qnil;
436
+ }
437
+
438
+ // wrapper that calls zoo_create via zkrb_gvl_zoo_create inside rb_thread_blocking_region
439
+ 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) {
440
+ zkrb_zoo_create_args_t args = {
441
+ .rc = ZKRB_FAIL,
442
+ .zh = zh,
443
+ .path = path,
444
+ .value = value,
445
+ .valuelen = valuelen,
446
+ .acl = acl,
447
+ .flags = flags,
448
+ .path_buffer = path_buffer,
449
+ .path_buffer_len = path_buffer_len
450
+ };
451
+
452
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_create, (void *)&args);
453
+
454
+ return args.rc;
455
+ }
456
+
457
+
458
+ static VALUE zkrb_gvl_zoo_delete(void *data) {
459
+ zkrb_zoo_delete_args_t *a = (zkrb_zoo_delete_args_t *)data;
460
+ a->rc = zoo_delete(a->zh, a->path, a->version);
461
+ return Qnil;
462
+ }
463
+
464
+ // wrapper that calls zoo_delete via zkrb_gvl_zoo_delete inside rb_thread_blocking_region
465
+ int zkrb_call_zoo_delete(zhandle_t *zh, const char *path, int version) {
466
+ zkrb_zoo_delete_args_t args = {
467
+ .rc = ZKRB_FAIL,
468
+ .zh = zh,
469
+ .path = path,
470
+ .version = version
471
+ };
472
+
473
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_delete, (void *)&args);
474
+
475
+ return args.rc;
476
+ }
477
+
478
+
479
+ static VALUE zkrb_gvl_zoo_exists(void *data) {
480
+ zkrb_zoo_exists_args_t *a = (zkrb_zoo_exists_args_t *)data;
481
+ a->rc = zoo_exists(a->zh, a->path, a->watch, a->stat);
482
+ return Qnil;
483
+ }
484
+
485
+ // wrapper that calls zoo_exists via zkrb_gvl_zoo_exists inside rb_thread_blocking_region
486
+ int zkrb_call_zoo_exists(zhandle_t *zh, const char *path, int watch, struct Stat *stat) {
487
+ zkrb_zoo_exists_args_t args = {
488
+ .rc = ZKRB_FAIL,
489
+ .zh = zh,
490
+ .path = path,
491
+ .watch = watch,
492
+ .stat = stat
493
+ };
494
+
495
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_exists, (void *)&args);
496
+
497
+ return args.rc;
498
+ }
499
+
500
+
501
+ static VALUE zkrb_gvl_zoo_wexists(void *data) {
502
+ zkrb_zoo_wexists_args_t *a = (zkrb_zoo_wexists_args_t *)data;
503
+ a->rc = zoo_wexists(a->zh, a->path, a->watcher, a->watcherCtx, a->stat);
504
+ return Qnil;
505
+ }
506
+
507
+ // wrapper that calls zoo_wexists via zkrb_gvl_zoo_wexists inside rb_thread_blocking_region
508
+ int zkrb_call_zoo_wexists(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, struct Stat *stat) {
509
+ zkrb_zoo_wexists_args_t args = {
510
+ .rc = ZKRB_FAIL,
511
+ .zh = zh,
512
+ .path = path,
513
+ .watcher = watcher,
514
+ .watcherCtx = watcherCtx,
515
+ .stat = stat
516
+ };
517
+
518
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_wexists, (void *)&args);
519
+
520
+ return args.rc;
521
+ }
522
+
523
+
524
+ static VALUE zkrb_gvl_zoo_get(void *data) {
525
+ zkrb_zoo_get_args_t *a = (zkrb_zoo_get_args_t *)data;
526
+ a->rc = zoo_get(a->zh, a->path, a->watch, a->buffer, a->buffer_len, a->stat);
527
+ return Qnil;
528
+ }
529
+
530
+ // wrapper that calls zoo_get via zkrb_gvl_zoo_get inside rb_thread_blocking_region
531
+ int zkrb_call_zoo_get(zhandle_t *zh, const char *path, int watch, char *buffer, int* buffer_len, struct Stat *stat) {
532
+ zkrb_zoo_get_args_t args = {
533
+ .rc = ZKRB_FAIL,
534
+ .zh = zh,
535
+ .path = path,
536
+ .watch = watch,
537
+ .buffer = buffer,
538
+ .buffer_len = buffer_len,
539
+ .stat = stat
540
+ };
541
+
542
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_get, (void *)&args);
543
+
544
+ return args.rc;
545
+ }
546
+
547
+
548
+ static VALUE zkrb_gvl_zoo_wget(void *data) {
549
+ zkrb_zoo_wget_args_t *a = (zkrb_zoo_wget_args_t *)data;
550
+ a->rc = zoo_wget(a->zh, a->path, a->watcher, a->watcherCtx, a->buffer, a->buffer_len, a->stat);
551
+ return Qnil;
552
+ }
553
+
554
+ // wrapper that calls zoo_wget via zkrb_gvl_zoo_wget inside rb_thread_blocking_region
555
+ int zkrb_call_zoo_wget(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, char *buffer, int* buffer_len, struct Stat *stat) {
556
+ zkrb_zoo_wget_args_t args = {
557
+ .rc = ZKRB_FAIL,
558
+ .zh = zh,
559
+ .path = path,
560
+ .watcher = watcher,
561
+ .watcherCtx = watcherCtx,
562
+ .buffer = buffer,
563
+ .buffer_len = buffer_len,
564
+ .stat = stat
565
+ };
566
+
567
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_wget, (void *)&args);
568
+
569
+ return args.rc;
570
+ }
571
+
572
+
573
+ static VALUE zkrb_gvl_zoo_set(void *data) {
574
+ zkrb_zoo_set_args_t *a = (zkrb_zoo_set_args_t *)data;
575
+ a->rc = zoo_set(a->zh, a->path, a->buffer, a->buflen, a->version);
576
+ return Qnil;
577
+ }
578
+
579
+ // wrapper that calls zoo_set via zkrb_gvl_zoo_set inside rb_thread_blocking_region
580
+ int zkrb_call_zoo_set(zhandle_t *zh, const char *path, const char *buffer, int buflen, int version) {
581
+ zkrb_zoo_set_args_t args = {
582
+ .rc = ZKRB_FAIL,
583
+ .zh = zh,
584
+ .path = path,
585
+ .buffer = buffer,
586
+ .buflen = buflen,
587
+ .version = version
588
+ };
589
+
590
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_set, (void *)&args);
591
+
592
+ return args.rc;
593
+ }
594
+
595
+
596
+ static VALUE zkrb_gvl_zoo_set2(void *data) {
597
+ zkrb_zoo_set2_args_t *a = (zkrb_zoo_set2_args_t *)data;
598
+ a->rc = zoo_set2(a->zh, a->path, a->buffer, a->buflen, a->version, a->stat);
599
+ return Qnil;
600
+ }
601
+
602
+ // wrapper that calls zoo_set2 via zkrb_gvl_zoo_set2 inside rb_thread_blocking_region
603
+ int zkrb_call_zoo_set2(zhandle_t *zh, const char *path, const char *buffer, int buflen, int version, struct Stat *stat) {
604
+ zkrb_zoo_set2_args_t args = {
605
+ .rc = ZKRB_FAIL,
606
+ .zh = zh,
607
+ .path = path,
608
+ .buffer = buffer,
609
+ .buflen = buflen,
610
+ .version = version,
611
+ .stat = stat
612
+ };
613
+
614
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_set2, (void *)&args);
615
+
616
+ return args.rc;
617
+ }
618
+
619
+
620
+ static VALUE zkrb_gvl_zoo_get_children(void *data) {
621
+ zkrb_zoo_get_children_args_t *a = (zkrb_zoo_get_children_args_t *)data;
622
+ a->rc = zoo_get_children(a->zh, a->path, a->watch, a->strings);
623
+ return Qnil;
624
+ }
625
+
626
+ // wrapper that calls zoo_get_children via zkrb_gvl_zoo_get_children inside rb_thread_blocking_region
627
+ int zkrb_call_zoo_get_children(zhandle_t *zh, const char *path, int watch, struct String_vector *strings) {
628
+ zkrb_zoo_get_children_args_t args = {
629
+ .rc = ZKRB_FAIL,
630
+ .zh = zh,
631
+ .path = path,
632
+ .watch = watch,
633
+ .strings = strings
634
+ };
635
+
636
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_get_children, (void *)&args);
637
+
638
+ return args.rc;
639
+ }
640
+
641
+
642
+ static VALUE zkrb_gvl_zoo_wget_children(void *data) {
643
+ zkrb_zoo_wget_children_args_t *a = (zkrb_zoo_wget_children_args_t *)data;
644
+ a->rc = zoo_wget_children(a->zh, a->path, a->watcher, a->watcherCtx, a->strings);
645
+ return Qnil;
646
+ }
647
+
648
+ // wrapper that calls zoo_wget_children via zkrb_gvl_zoo_wget_children inside rb_thread_blocking_region
649
+ int zkrb_call_zoo_wget_children(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, struct String_vector *strings) {
650
+ zkrb_zoo_wget_children_args_t args = {
651
+ .rc = ZKRB_FAIL,
652
+ .zh = zh,
653
+ .path = path,
654
+ .watcher = watcher,
655
+ .watcherCtx = watcherCtx,
656
+ .strings = strings
657
+ };
658
+
659
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_wget_children, (void *)&args);
660
+
661
+ return args.rc;
662
+ }
663
+
664
+
665
+ static VALUE zkrb_gvl_zoo_get_children2(void *data) {
666
+ zkrb_zoo_get_children2_args_t *a = (zkrb_zoo_get_children2_args_t *)data;
667
+ a->rc = zoo_get_children2(a->zh, a->path, a->watch, a->strings, a->stat);
668
+ return Qnil;
669
+ }
670
+
671
+ // wrapper that calls zoo_get_children2 via zkrb_gvl_zoo_get_children2 inside rb_thread_blocking_region
672
+ int zkrb_call_zoo_get_children2(zhandle_t *zh, const char *path, int watch, struct String_vector *strings, struct Stat *stat) {
673
+ zkrb_zoo_get_children2_args_t args = {
674
+ .rc = ZKRB_FAIL,
675
+ .zh = zh,
676
+ .path = path,
677
+ .watch = watch,
678
+ .strings = strings,
679
+ .stat = stat
680
+ };
681
+
682
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_get_children2, (void *)&args);
683
+
684
+ return args.rc;
685
+ }
686
+
687
+
688
+ static VALUE zkrb_gvl_zoo_wget_children2(void *data) {
689
+ zkrb_zoo_wget_children2_args_t *a = (zkrb_zoo_wget_children2_args_t *)data;
690
+ a->rc = zoo_wget_children2(a->zh, a->path, a->watcher, a->watcherCtx, a->strings, a->stat);
691
+ return Qnil;
692
+ }
693
+
694
+ // wrapper that calls zoo_wget_children2 via zkrb_gvl_zoo_wget_children2 inside rb_thread_blocking_region
695
+ int zkrb_call_zoo_wget_children2(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, struct String_vector *strings, struct Stat *stat) {
696
+ zkrb_zoo_wget_children2_args_t args = {
697
+ .rc = ZKRB_FAIL,
698
+ .zh = zh,
699
+ .path = path,
700
+ .watcher = watcher,
701
+ .watcherCtx = watcherCtx,
702
+ .strings = strings,
703
+ .stat = stat
704
+ };
705
+
706
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_wget_children2, (void *)&args);
707
+
708
+ return args.rc;
709
+ }
710
+
711
+
712
+ static VALUE zkrb_gvl_zoo_get_acl(void *data) {
713
+ zkrb_zoo_get_acl_args_t *a = (zkrb_zoo_get_acl_args_t *)data;
714
+ a->rc = zoo_get_acl(a->zh, a->path, a->acl, a->stat);
715
+ return Qnil;
716
+ }
717
+
718
+ // wrapper that calls zoo_get_acl via zkrb_gvl_zoo_get_acl inside rb_thread_blocking_region
719
+ int zkrb_call_zoo_get_acl(zhandle_t *zh, const char *path, struct ACL_vector *acl, struct Stat *stat) {
720
+ zkrb_zoo_get_acl_args_t args = {
721
+ .rc = ZKRB_FAIL,
722
+ .zh = zh,
723
+ .path = path,
724
+ .acl = acl,
725
+ .stat = stat
726
+ };
727
+
728
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_get_acl, (void *)&args);
729
+
730
+ return args.rc;
731
+ }
732
+
733
+
734
+ static VALUE zkrb_gvl_zoo_set_acl(void *data) {
735
+ zkrb_zoo_set_acl_args_t *a = (zkrb_zoo_set_acl_args_t *)data;
736
+ a->rc = zoo_set_acl(a->zh, a->path, a->version, a->acl);
737
+ return Qnil;
738
+ }
739
+
740
+ // wrapper that calls zoo_set_acl via zkrb_gvl_zoo_set_acl inside rb_thread_blocking_region
741
+ int zkrb_call_zoo_set_acl(zhandle_t *zh, const char *path, int version, const struct ACL_vector *acl) {
742
+ zkrb_zoo_set_acl_args_t args = {
743
+ .rc = ZKRB_FAIL,
744
+ .zh = zh,
745
+ .path = path,
746
+ .version = version,
747
+ .acl = acl
748
+ };
749
+
750
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_set_acl, (void *)&args);
751
+
752
+ return args.rc;
753
+ }
754
+
755
+
756
+ static VALUE zkrb_gvl_zoo_multi(void *data) {
757
+ zkrb_zoo_multi_args_t *a = (zkrb_zoo_multi_args_t *)data;
758
+ a->rc = zoo_multi(a->zh, a->count, a->ops, a->results);
759
+ return Qnil;
760
+ }
761
+
762
+ // wrapper that calls zoo_multi via zkrb_gvl_zoo_multi inside rb_thread_blocking_region
763
+ int zkrb_call_zoo_multi(zhandle_t *zh, int count, const zoo_op_t *ops, zoo_op_result_t *results) {
764
+ zkrb_zoo_multi_args_t args = {
765
+ .rc = ZKRB_FAIL,
766
+ .zh = zh,
767
+ .count = count,
768
+ .ops = ops,
769
+ .results = results
770
+ };
771
+
772
+ zkrb_thread_blocking_region(zkrb_gvl_zoo_multi, (void *)&args);
773
+
774
+ return args.rc;
775
+ }