ruby-libgearman 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ext/gearman.c ADDED
@@ -0,0 +1,4756 @@
1
+ /* ----------------------------------------------------------------------------
2
+ * This file was automatically generated by SWIG (http://www.swig.org).
3
+ * Version 1.3.41
4
+ *
5
+ * This file is not intended to be easily readable and contains a number of
6
+ * coding conventions designed to improve portability and efficiency. Do not make
7
+ * changes to this file unless you know what you are doing--modify the SWIG
8
+ * interface file instead.
9
+ * ----------------------------------------------------------------------------- */
10
+
11
+ #define SWIGRUBY
12
+
13
+ /* -----------------------------------------------------------------------------
14
+ * This section contains generic SWIG labels for method/variable
15
+ * declarations/attributes, and other compiler dependent labels.
16
+ * ----------------------------------------------------------------------------- */
17
+
18
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
19
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
20
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
21
+ # define SWIGTEMPLATEDISAMBIGUATOR template
22
+ # elif defined(__HP_aCC)
23
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
24
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
25
+ # define SWIGTEMPLATEDISAMBIGUATOR template
26
+ # else
27
+ # define SWIGTEMPLATEDISAMBIGUATOR
28
+ # endif
29
+ #endif
30
+
31
+ /* inline attribute */
32
+ #ifndef SWIGINLINE
33
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
34
+ # define SWIGINLINE inline
35
+ # else
36
+ # define SWIGINLINE
37
+ # endif
38
+ #endif
39
+
40
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
41
+ #ifndef SWIGUNUSED
42
+ # if defined(__GNUC__)
43
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
44
+ # define SWIGUNUSED __attribute__ ((__unused__))
45
+ # else
46
+ # define SWIGUNUSED
47
+ # endif
48
+ # elif defined(__ICC)
49
+ # define SWIGUNUSED __attribute__ ((__unused__))
50
+ # else
51
+ # define SWIGUNUSED
52
+ # endif
53
+ #endif
54
+
55
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
56
+ # if defined(_MSC_VER)
57
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
58
+ # endif
59
+ #endif
60
+
61
+ #ifndef SWIGUNUSEDPARM
62
+ # ifdef __cplusplus
63
+ # define SWIGUNUSEDPARM(p)
64
+ # else
65
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
66
+ # endif
67
+ #endif
68
+
69
+ /* internal SWIG method */
70
+ #ifndef SWIGINTERN
71
+ # define SWIGINTERN static SWIGUNUSED
72
+ #endif
73
+
74
+ /* internal inline SWIG method */
75
+ #ifndef SWIGINTERNINLINE
76
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
77
+ #endif
78
+
79
+ /* exporting methods */
80
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
81
+ # ifndef GCC_HASCLASSVISIBILITY
82
+ # define GCC_HASCLASSVISIBILITY
83
+ # endif
84
+ #endif
85
+
86
+ #ifndef SWIGEXPORT
87
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
88
+ # if defined(STATIC_LINKED)
89
+ # define SWIGEXPORT
90
+ # else
91
+ # define SWIGEXPORT __declspec(dllexport)
92
+ # endif
93
+ # else
94
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
95
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
96
+ # else
97
+ # define SWIGEXPORT
98
+ # endif
99
+ # endif
100
+ #endif
101
+
102
+ /* calling conventions for Windows */
103
+ #ifndef SWIGSTDCALL
104
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
105
+ # define SWIGSTDCALL __stdcall
106
+ # else
107
+ # define SWIGSTDCALL
108
+ # endif
109
+ #endif
110
+
111
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
112
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
113
+ # define _CRT_SECURE_NO_DEPRECATE
114
+ #endif
115
+
116
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
117
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
118
+ # define _SCL_SECURE_NO_DEPRECATE
119
+ #endif
120
+
121
+
122
+ /* -----------------------------------------------------------------------------
123
+ * This section contains generic SWIG labels for method/variable
124
+ * declarations/attributes, and other compiler dependent labels.
125
+ * ----------------------------------------------------------------------------- */
126
+
127
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
128
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
129
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
130
+ # define SWIGTEMPLATEDISAMBIGUATOR template
131
+ # elif defined(__HP_aCC)
132
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
133
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
134
+ # define SWIGTEMPLATEDISAMBIGUATOR template
135
+ # else
136
+ # define SWIGTEMPLATEDISAMBIGUATOR
137
+ # endif
138
+ #endif
139
+
140
+ /* inline attribute */
141
+ #ifndef SWIGINLINE
142
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
143
+ # define SWIGINLINE inline
144
+ # else
145
+ # define SWIGINLINE
146
+ # endif
147
+ #endif
148
+
149
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
150
+ #ifndef SWIGUNUSED
151
+ # if defined(__GNUC__)
152
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
153
+ # define SWIGUNUSED __attribute__ ((__unused__))
154
+ # else
155
+ # define SWIGUNUSED
156
+ # endif
157
+ # elif defined(__ICC)
158
+ # define SWIGUNUSED __attribute__ ((__unused__))
159
+ # else
160
+ # define SWIGUNUSED
161
+ # endif
162
+ #endif
163
+
164
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
165
+ # if defined(_MSC_VER)
166
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
167
+ # endif
168
+ #endif
169
+
170
+ #ifndef SWIGUNUSEDPARM
171
+ # ifdef __cplusplus
172
+ # define SWIGUNUSEDPARM(p)
173
+ # else
174
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
175
+ # endif
176
+ #endif
177
+
178
+ /* internal SWIG method */
179
+ #ifndef SWIGINTERN
180
+ # define SWIGINTERN static SWIGUNUSED
181
+ #endif
182
+
183
+ /* internal inline SWIG method */
184
+ #ifndef SWIGINTERNINLINE
185
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
186
+ #endif
187
+
188
+ /* exporting methods */
189
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
190
+ # ifndef GCC_HASCLASSVISIBILITY
191
+ # define GCC_HASCLASSVISIBILITY
192
+ # endif
193
+ #endif
194
+
195
+ #ifndef SWIGEXPORT
196
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
197
+ # if defined(STATIC_LINKED)
198
+ # define SWIGEXPORT
199
+ # else
200
+ # define SWIGEXPORT __declspec(dllexport)
201
+ # endif
202
+ # else
203
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
204
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
205
+ # else
206
+ # define SWIGEXPORT
207
+ # endif
208
+ # endif
209
+ #endif
210
+
211
+ /* calling conventions for Windows */
212
+ #ifndef SWIGSTDCALL
213
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
214
+ # define SWIGSTDCALL __stdcall
215
+ # else
216
+ # define SWIGSTDCALL
217
+ # endif
218
+ #endif
219
+
220
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
221
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
222
+ # define _CRT_SECURE_NO_DEPRECATE
223
+ #endif
224
+
225
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
226
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
227
+ # define _SCL_SECURE_NO_DEPRECATE
228
+ #endif
229
+
230
+
231
+ /* -----------------------------------------------------------------------------
232
+ * swigrun.swg
233
+ *
234
+ * This file contains generic C API SWIG runtime support for pointer
235
+ * type checking.
236
+ * ----------------------------------------------------------------------------- */
237
+
238
+ /* This should only be incremented when either the layout of swig_type_info changes,
239
+ or for whatever reason, the runtime changes incompatibly */
240
+ #define SWIG_RUNTIME_VERSION "4"
241
+
242
+ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
243
+ #ifdef SWIG_TYPE_TABLE
244
+ # define SWIG_QUOTE_STRING(x) #x
245
+ # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
246
+ # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
247
+ #else
248
+ # define SWIG_TYPE_TABLE_NAME
249
+ #endif
250
+
251
+ /*
252
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
253
+ creating a static or dynamic library from the SWIG runtime code.
254
+ In 99.9% of the cases, SWIG just needs to declare them as 'static'.
255
+
256
+ But only do this if strictly necessary, ie, if you have problems
257
+ with your compiler or suchlike.
258
+ */
259
+
260
+ #ifndef SWIGRUNTIME
261
+ # define SWIGRUNTIME SWIGINTERN
262
+ #endif
263
+
264
+ #ifndef SWIGRUNTIMEINLINE
265
+ # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
266
+ #endif
267
+
268
+ /* Generic buffer size */
269
+ #ifndef SWIG_BUFFER_SIZE
270
+ # define SWIG_BUFFER_SIZE 1024
271
+ #endif
272
+
273
+ /* Flags for pointer conversions */
274
+ #define SWIG_POINTER_DISOWN 0x1
275
+ #define SWIG_CAST_NEW_MEMORY 0x2
276
+
277
+ /* Flags for new pointer objects */
278
+ #define SWIG_POINTER_OWN 0x1
279
+
280
+
281
+ /*
282
+ Flags/methods for returning states.
283
+
284
+ The SWIG conversion methods, as ConvertPtr, return and integer
285
+ that tells if the conversion was successful or not. And if not,
286
+ an error code can be returned (see swigerrors.swg for the codes).
287
+
288
+ Use the following macros/flags to set or process the returning
289
+ states.
290
+
291
+ In old versions of SWIG, code such as the following was usually written:
292
+
293
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
294
+ // success code
295
+ } else {
296
+ //fail code
297
+ }
298
+
299
+ Now you can be more explicit:
300
+
301
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
302
+ if (SWIG_IsOK(res)) {
303
+ // success code
304
+ } else {
305
+ // fail code
306
+ }
307
+
308
+ which is the same really, but now you can also do
309
+
310
+ Type *ptr;
311
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
312
+ if (SWIG_IsOK(res)) {
313
+ // success code
314
+ if (SWIG_IsNewObj(res) {
315
+ ...
316
+ delete *ptr;
317
+ } else {
318
+ ...
319
+ }
320
+ } else {
321
+ // fail code
322
+ }
323
+
324
+ I.e., now SWIG_ConvertPtr can return new objects and you can
325
+ identify the case and take care of the deallocation. Of course that
326
+ also requires SWIG_ConvertPtr to return new result values, such as
327
+
328
+ int SWIG_ConvertPtr(obj, ptr,...) {
329
+ if (<obj is ok>) {
330
+ if (<need new object>) {
331
+ *ptr = <ptr to new allocated object>;
332
+ return SWIG_NEWOBJ;
333
+ } else {
334
+ *ptr = <ptr to old object>;
335
+ return SWIG_OLDOBJ;
336
+ }
337
+ } else {
338
+ return SWIG_BADOBJ;
339
+ }
340
+ }
341
+
342
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
343
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
344
+ SWIG errors code.
345
+
346
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
347
+ allows to return the 'cast rank', for example, if you have this
348
+
349
+ int food(double)
350
+ int fooi(int);
351
+
352
+ and you call
353
+
354
+ food(1) // cast rank '1' (1 -> 1.0)
355
+ fooi(1) // cast rank '0'
356
+
357
+ just use the SWIG_AddCast()/SWIG_CheckState()
358
+ */
359
+
360
+ #define SWIG_OK (0)
361
+ #define SWIG_ERROR (-1)
362
+ #define SWIG_IsOK(r) (r >= 0)
363
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
364
+
365
+ /* The CastRankLimit says how many bits are used for the cast rank */
366
+ #define SWIG_CASTRANKLIMIT (1 << 8)
367
+ /* The NewMask denotes the object was created (using new/malloc) */
368
+ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
369
+ /* The TmpMask is for in/out typemaps that use temporal objects */
370
+ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
371
+ /* Simple returning values */
372
+ #define SWIG_BADOBJ (SWIG_ERROR)
373
+ #define SWIG_OLDOBJ (SWIG_OK)
374
+ #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
375
+ #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
376
+ /* Check, add and del mask methods */
377
+ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
378
+ #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
379
+ #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
380
+ #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
381
+ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
382
+ #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
383
+
384
+ /* Cast-Rank Mode */
385
+ #if defined(SWIG_CASTRANK_MODE)
386
+ # ifndef SWIG_TypeRank
387
+ # define SWIG_TypeRank unsigned long
388
+ # endif
389
+ # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
390
+ # define SWIG_MAXCASTRANK (2)
391
+ # endif
392
+ # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
393
+ # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
394
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
395
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
396
+ }
397
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
398
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
399
+ }
400
+ #else /* no cast-rank mode */
401
+ # define SWIG_AddCast
402
+ # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
403
+ #endif
404
+
405
+
406
+ #include <string.h>
407
+
408
+ #ifdef __cplusplus
409
+ extern "C" {
410
+ #endif
411
+
412
+ typedef void *(*swig_converter_func)(void *, int *);
413
+ typedef struct swig_type_info *(*swig_dycast_func)(void **);
414
+
415
+ /* Structure to store information on one type */
416
+ typedef struct swig_type_info {
417
+ const char *name; /* mangled name of this type */
418
+ const char *str; /* human readable name of this type */
419
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
420
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
421
+ void *clientdata; /* language specific type data */
422
+ int owndata; /* flag if the structure owns the clientdata */
423
+ } swig_type_info;
424
+
425
+ /* Structure to store a type and conversion function used for casting */
426
+ typedef struct swig_cast_info {
427
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
428
+ swig_converter_func converter; /* function to cast the void pointers */
429
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
430
+ struct swig_cast_info *prev; /* pointer to the previous cast */
431
+ } swig_cast_info;
432
+
433
+ /* Structure used to store module information
434
+ * Each module generates one structure like this, and the runtime collects
435
+ * all of these structures and stores them in a circularly linked list.*/
436
+ typedef struct swig_module_info {
437
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
438
+ size_t size; /* Number of types in this module */
439
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
440
+ swig_type_info **type_initial; /* Array of initially generated type structures */
441
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
442
+ void *clientdata; /* Language specific module data */
443
+ } swig_module_info;
444
+
445
+ /*
446
+ Compare two type names skipping the space characters, therefore
447
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
448
+
449
+ Return 0 when the two name types are equivalent, as in
450
+ strncmp, but skipping ' '.
451
+ */
452
+ SWIGRUNTIME int
453
+ SWIG_TypeNameComp(const char *f1, const char *l1,
454
+ const char *f2, const char *l2) {
455
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
456
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
457
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
458
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
459
+ }
460
+ return (int)((l1 - f1) - (l2 - f2));
461
+ }
462
+
463
+ /*
464
+ Check type equivalence in a name list like <name1>|<name2>|...
465
+ Return 0 if not equal, 1 if equal
466
+ */
467
+ SWIGRUNTIME int
468
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
469
+ int equiv = 0;
470
+ const char* te = tb + strlen(tb);
471
+ const char* ne = nb;
472
+ while (!equiv && *ne) {
473
+ for (nb = ne; *ne; ++ne) {
474
+ if (*ne == '|') break;
475
+ }
476
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
477
+ if (*ne) ++ne;
478
+ }
479
+ return equiv;
480
+ }
481
+
482
+ /*
483
+ Check type equivalence in a name list like <name1>|<name2>|...
484
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
485
+ */
486
+ SWIGRUNTIME int
487
+ SWIG_TypeCompare(const char *nb, const char *tb) {
488
+ int equiv = 0;
489
+ const char* te = tb + strlen(tb);
490
+ const char* ne = nb;
491
+ while (!equiv && *ne) {
492
+ for (nb = ne; *ne; ++ne) {
493
+ if (*ne == '|') break;
494
+ }
495
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
496
+ if (*ne) ++ne;
497
+ }
498
+ return equiv;
499
+ }
500
+
501
+
502
+ /*
503
+ Check the typename
504
+ */
505
+ SWIGRUNTIME swig_cast_info *
506
+ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
507
+ if (ty) {
508
+ swig_cast_info *iter = ty->cast;
509
+ while (iter) {
510
+ if (strcmp(iter->type->name, c) == 0) {
511
+ if (iter == ty->cast)
512
+ return iter;
513
+ /* Move iter to the top of the linked list */
514
+ iter->prev->next = iter->next;
515
+ if (iter->next)
516
+ iter->next->prev = iter->prev;
517
+ iter->next = ty->cast;
518
+ iter->prev = 0;
519
+ if (ty->cast) ty->cast->prev = iter;
520
+ ty->cast = iter;
521
+ return iter;
522
+ }
523
+ iter = iter->next;
524
+ }
525
+ }
526
+ return 0;
527
+ }
528
+
529
+ /*
530
+ Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
531
+ */
532
+ SWIGRUNTIME swig_cast_info *
533
+ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
534
+ if (ty) {
535
+ swig_cast_info *iter = ty->cast;
536
+ while (iter) {
537
+ if (iter->type == from) {
538
+ if (iter == ty->cast)
539
+ return iter;
540
+ /* Move iter to the top of the linked list */
541
+ iter->prev->next = iter->next;
542
+ if (iter->next)
543
+ iter->next->prev = iter->prev;
544
+ iter->next = ty->cast;
545
+ iter->prev = 0;
546
+ if (ty->cast) ty->cast->prev = iter;
547
+ ty->cast = iter;
548
+ return iter;
549
+ }
550
+ iter = iter->next;
551
+ }
552
+ }
553
+ return 0;
554
+ }
555
+
556
+ /*
557
+ Cast a pointer up an inheritance hierarchy
558
+ */
559
+ SWIGRUNTIMEINLINE void *
560
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
561
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
562
+ }
563
+
564
+ /*
565
+ Dynamic pointer casting. Down an inheritance hierarchy
566
+ */
567
+ SWIGRUNTIME swig_type_info *
568
+ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
569
+ swig_type_info *lastty = ty;
570
+ if (!ty || !ty->dcast) return ty;
571
+ while (ty && (ty->dcast)) {
572
+ ty = (*ty->dcast)(ptr);
573
+ if (ty) lastty = ty;
574
+ }
575
+ return lastty;
576
+ }
577
+
578
+ /*
579
+ Return the name associated with this type
580
+ */
581
+ SWIGRUNTIMEINLINE const char *
582
+ SWIG_TypeName(const swig_type_info *ty) {
583
+ return ty->name;
584
+ }
585
+
586
+ /*
587
+ Return the pretty name associated with this type,
588
+ that is an unmangled type name in a form presentable to the user.
589
+ */
590
+ SWIGRUNTIME const char *
591
+ SWIG_TypePrettyName(const swig_type_info *type) {
592
+ /* The "str" field contains the equivalent pretty names of the
593
+ type, separated by vertical-bar characters. We choose
594
+ to print the last name, as it is often (?) the most
595
+ specific. */
596
+ if (!type) return NULL;
597
+ if (type->str != NULL) {
598
+ const char *last_name = type->str;
599
+ const char *s;
600
+ for (s = type->str; *s; s++)
601
+ if (*s == '|') last_name = s+1;
602
+ return last_name;
603
+ }
604
+ else
605
+ return type->name;
606
+ }
607
+
608
+ /*
609
+ Set the clientdata field for a type
610
+ */
611
+ SWIGRUNTIME void
612
+ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
613
+ swig_cast_info *cast = ti->cast;
614
+ /* if (ti->clientdata == clientdata) return; */
615
+ ti->clientdata = clientdata;
616
+
617
+ while (cast) {
618
+ if (!cast->converter) {
619
+ swig_type_info *tc = cast->type;
620
+ if (!tc->clientdata) {
621
+ SWIG_TypeClientData(tc, clientdata);
622
+ }
623
+ }
624
+ cast = cast->next;
625
+ }
626
+ }
627
+ SWIGRUNTIME void
628
+ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
629
+ SWIG_TypeClientData(ti, clientdata);
630
+ ti->owndata = 1;
631
+ }
632
+
633
+ /*
634
+ Search for a swig_type_info structure only by mangled name
635
+ Search is a O(log #types)
636
+
637
+ We start searching at module start, and finish searching when start == end.
638
+ Note: if start == end at the beginning of the function, we go all the way around
639
+ the circular list.
640
+ */
641
+ SWIGRUNTIME swig_type_info *
642
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
643
+ swig_module_info *end,
644
+ const char *name) {
645
+ swig_module_info *iter = start;
646
+ do {
647
+ if (iter->size) {
648
+ register size_t l = 0;
649
+ register size_t r = iter->size - 1;
650
+ do {
651
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
652
+ register size_t i = (l + r) >> 1;
653
+ const char *iname = iter->types[i]->name;
654
+ if (iname) {
655
+ register int compare = strcmp(name, iname);
656
+ if (compare == 0) {
657
+ return iter->types[i];
658
+ } else if (compare < 0) {
659
+ if (i) {
660
+ r = i - 1;
661
+ } else {
662
+ break;
663
+ }
664
+ } else if (compare > 0) {
665
+ l = i + 1;
666
+ }
667
+ } else {
668
+ break; /* should never happen */
669
+ }
670
+ } while (l <= r);
671
+ }
672
+ iter = iter->next;
673
+ } while (iter != end);
674
+ return 0;
675
+ }
676
+
677
+ /*
678
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
679
+ It first searches the mangled names of the types, which is a O(log #types)
680
+ If a type is not found it then searches the human readable names, which is O(#types).
681
+
682
+ We start searching at module start, and finish searching when start == end.
683
+ Note: if start == end at the beginning of the function, we go all the way around
684
+ the circular list.
685
+ */
686
+ SWIGRUNTIME swig_type_info *
687
+ SWIG_TypeQueryModule(swig_module_info *start,
688
+ swig_module_info *end,
689
+ const char *name) {
690
+ /* STEP 1: Search the name field using binary search */
691
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
692
+ if (ret) {
693
+ return ret;
694
+ } else {
695
+ /* STEP 2: If the type hasn't been found, do a complete search
696
+ of the str field (the human readable name) */
697
+ swig_module_info *iter = start;
698
+ do {
699
+ register size_t i = 0;
700
+ for (; i < iter->size; ++i) {
701
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
702
+ return iter->types[i];
703
+ }
704
+ iter = iter->next;
705
+ } while (iter != end);
706
+ }
707
+
708
+ /* neither found a match */
709
+ return 0;
710
+ }
711
+
712
+ /*
713
+ Pack binary data into a string
714
+ */
715
+ SWIGRUNTIME char *
716
+ SWIG_PackData(char *c, void *ptr, size_t sz) {
717
+ static const char hex[17] = "0123456789abcdef";
718
+ register const unsigned char *u = (unsigned char *) ptr;
719
+ register const unsigned char *eu = u + sz;
720
+ for (; u != eu; ++u) {
721
+ register unsigned char uu = *u;
722
+ *(c++) = hex[(uu & 0xf0) >> 4];
723
+ *(c++) = hex[uu & 0xf];
724
+ }
725
+ return c;
726
+ }
727
+
728
+ /*
729
+ Unpack binary data from a string
730
+ */
731
+ SWIGRUNTIME const char *
732
+ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
733
+ register unsigned char *u = (unsigned char *) ptr;
734
+ register const unsigned char *eu = u + sz;
735
+ for (; u != eu; ++u) {
736
+ register char d = *(c++);
737
+ register unsigned char uu;
738
+ if ((d >= '0') && (d <= '9'))
739
+ uu = ((d - '0') << 4);
740
+ else if ((d >= 'a') && (d <= 'f'))
741
+ uu = ((d - ('a'-10)) << 4);
742
+ else
743
+ return (char *) 0;
744
+ d = *(c++);
745
+ if ((d >= '0') && (d <= '9'))
746
+ uu |= (d - '0');
747
+ else if ((d >= 'a') && (d <= 'f'))
748
+ uu |= (d - ('a'-10));
749
+ else
750
+ return (char *) 0;
751
+ *u = uu;
752
+ }
753
+ return c;
754
+ }
755
+
756
+ /*
757
+ Pack 'void *' into a string buffer.
758
+ */
759
+ SWIGRUNTIME char *
760
+ SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
761
+ char *r = buff;
762
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
763
+ *(r++) = '_';
764
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
765
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
766
+ strcpy(r,name);
767
+ return buff;
768
+ }
769
+
770
+ SWIGRUNTIME const char *
771
+ SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
772
+ if (*c != '_') {
773
+ if (strcmp(c,"NULL") == 0) {
774
+ *ptr = (void *) 0;
775
+ return name;
776
+ } else {
777
+ return 0;
778
+ }
779
+ }
780
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
781
+ }
782
+
783
+ SWIGRUNTIME char *
784
+ SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
785
+ char *r = buff;
786
+ size_t lname = (name ? strlen(name) : 0);
787
+ if ((2*sz + 2 + lname) > bsz) return 0;
788
+ *(r++) = '_';
789
+ r = SWIG_PackData(r,ptr,sz);
790
+ if (lname) {
791
+ strncpy(r,name,lname+1);
792
+ } else {
793
+ *r = 0;
794
+ }
795
+ return buff;
796
+ }
797
+
798
+ SWIGRUNTIME const char *
799
+ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
800
+ if (*c != '_') {
801
+ if (strcmp(c,"NULL") == 0) {
802
+ memset(ptr,0,sz);
803
+ return name;
804
+ } else {
805
+ return 0;
806
+ }
807
+ }
808
+ return SWIG_UnpackData(++c,ptr,sz);
809
+ }
810
+
811
+ #ifdef __cplusplus
812
+ }
813
+ #endif
814
+
815
+ /* Errors in SWIG */
816
+ #define SWIG_UnknownError -1
817
+ #define SWIG_IOError -2
818
+ #define SWIG_RuntimeError -3
819
+ #define SWIG_IndexError -4
820
+ #define SWIG_TypeError -5
821
+ #define SWIG_DivisionByZero -6
822
+ #define SWIG_OverflowError -7
823
+ #define SWIG_SyntaxError -8
824
+ #define SWIG_ValueError -9
825
+ #define SWIG_SystemError -10
826
+ #define SWIG_AttributeError -11
827
+ #define SWIG_MemoryError -12
828
+ #define SWIG_NullReferenceError -13
829
+
830
+
831
+
832
+ #include <ruby.h>
833
+
834
+ /* Remove global macros defined in Ruby's win32.h */
835
+ #ifdef write
836
+ # undef write
837
+ #endif
838
+ #ifdef read
839
+ # undef read
840
+ #endif
841
+ #ifdef bind
842
+ # undef bind
843
+ #endif
844
+ #ifdef close
845
+ # undef close
846
+ #endif
847
+ #ifdef connect
848
+ # undef connect
849
+ #endif
850
+
851
+
852
+ /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
853
+ #ifndef NUM2LL
854
+ #define NUM2LL(x) NUM2LONG((x))
855
+ #endif
856
+ #ifndef LL2NUM
857
+ #define LL2NUM(x) INT2NUM((long) (x))
858
+ #endif
859
+ #ifndef ULL2NUM
860
+ #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
861
+ #endif
862
+
863
+ /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
864
+ #ifndef NUM2ULL
865
+ #ifdef HAVE_LONG_LONG
866
+ #define NUM2ULL(x) rb_num2ull((x))
867
+ #else
868
+ #define NUM2ULL(x) NUM2ULONG(x)
869
+ #endif
870
+ #endif
871
+
872
+ /* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
873
+ /* Define these for older versions so we can just write code the new way */
874
+ #ifndef RSTRING_LEN
875
+ # define RSTRING_LEN(x) RSTRING(x)->len
876
+ #endif
877
+ #ifndef RSTRING_PTR
878
+ # define RSTRING_PTR(x) RSTRING(x)->ptr
879
+ #endif
880
+ #ifndef RSTRING_END
881
+ # define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
882
+ #endif
883
+ #ifndef RARRAY_LEN
884
+ # define RARRAY_LEN(x) RARRAY(x)->len
885
+ #endif
886
+ #ifndef RARRAY_PTR
887
+ # define RARRAY_PTR(x) RARRAY(x)->ptr
888
+ #endif
889
+ #ifndef RFLOAT_VALUE
890
+ # define RFLOAT_VALUE(x) RFLOAT(x)->value
891
+ #endif
892
+ #ifndef DOUBLE2NUM
893
+ # define DOUBLE2NUM(x) rb_float_new(x)
894
+ #endif
895
+ #ifndef RHASH_TBL
896
+ # define RHASH_TBL(x) (RHASH(x)->tbl)
897
+ #endif
898
+ #ifndef RHASH_ITER_LEV
899
+ # define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
900
+ #endif
901
+ #ifndef RHASH_IFNONE
902
+ # define RHASH_IFNONE(x) (RHASH(x)->ifnone)
903
+ #endif
904
+ #ifndef RHASH_SIZE
905
+ # define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
906
+ #endif
907
+ #ifndef RHASH_EMPTY_P
908
+ # define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
909
+ #endif
910
+ #ifndef RSTRUCT_LEN
911
+ # define RSTRUCT_LEN(x) RSTRUCT(x)->len
912
+ #endif
913
+ #ifndef RSTRUCT_PTR
914
+ # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
915
+ #endif
916
+
917
+
918
+
919
+ /*
920
+ * Need to be very careful about how these macros are defined, especially
921
+ * when compiling C++ code or C code with an ANSI C compiler.
922
+ *
923
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
924
+ * a Ruby method so that it can be passed as an argument to API functions
925
+ * like rb_define_method() and rb_define_singleton_method().
926
+ *
927
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
928
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
929
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
930
+ * and Data_Make_Struct().
931
+ */
932
+
933
+ #ifdef __cplusplus
934
+ # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
935
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
936
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
937
+ # define VOIDFUNC(f) ((void (*)()) f)
938
+ # else
939
+ # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
940
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
941
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
942
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
943
+ # else /* These definitions should work for Ruby 1.7+ */
944
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
945
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
946
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
947
+ # endif
948
+ # endif
949
+ #else
950
+ # define VALUEFUNC(f) (f)
951
+ # define VOIDFUNC(f) (f)
952
+ #endif
953
+
954
+ /* Don't use for expressions have side effect */
955
+ #ifndef RB_STRING_VALUE
956
+ #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
957
+ #endif
958
+ #ifndef StringValue
959
+ #define StringValue(s) RB_STRING_VALUE(s)
960
+ #endif
961
+ #ifndef StringValuePtr
962
+ #define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
963
+ #endif
964
+ #ifndef StringValueLen
965
+ #define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
966
+ #endif
967
+ #ifndef SafeStringValue
968
+ #define SafeStringValue(v) do {\
969
+ StringValue(v);\
970
+ rb_check_safe_str(v);\
971
+ } while (0)
972
+ #endif
973
+
974
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
975
+ #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
976
+ #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
977
+ #endif
978
+
979
+ static VALUE _mSWIG = Qnil;
980
+
981
+ /* -----------------------------------------------------------------------------
982
+ * error manipulation
983
+ * ----------------------------------------------------------------------------- */
984
+
985
+
986
+ /* Define some additional error types */
987
+ #define SWIG_ObjectPreviouslyDeletedError -100
988
+
989
+
990
+ /* Define custom exceptions for errors that do not map to existing Ruby
991
+ exceptions. Note this only works for C++ since a global cannot be
992
+ initialized by a funtion in C. For C, fallback to rb_eRuntimeError.*/
993
+
994
+ SWIGINTERN VALUE
995
+ getNullReferenceError(void) {
996
+ static int init = 0;
997
+ static VALUE rb_eNullReferenceError ;
998
+ if (!init) {
999
+ init = 1;
1000
+ rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
1001
+ }
1002
+ return rb_eNullReferenceError;
1003
+ }
1004
+
1005
+ SWIGINTERN VALUE
1006
+ getObjectPreviouslyDeletedError(void) {
1007
+ static int init = 0;
1008
+ static VALUE rb_eObjectPreviouslyDeleted ;
1009
+ if (!init) {
1010
+ init = 1;
1011
+ rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
1012
+ }
1013
+ return rb_eObjectPreviouslyDeleted;
1014
+ }
1015
+
1016
+
1017
+ SWIGINTERN VALUE
1018
+ SWIG_Ruby_ErrorType(int SWIG_code) {
1019
+ VALUE type;
1020
+ switch (SWIG_code) {
1021
+ case SWIG_MemoryError:
1022
+ type = rb_eNoMemError;
1023
+ break;
1024
+ case SWIG_IOError:
1025
+ type = rb_eIOError;
1026
+ break;
1027
+ case SWIG_RuntimeError:
1028
+ type = rb_eRuntimeError;
1029
+ break;
1030
+ case SWIG_IndexError:
1031
+ type = rb_eIndexError;
1032
+ break;
1033
+ case SWIG_TypeError:
1034
+ type = rb_eTypeError;
1035
+ break;
1036
+ case SWIG_DivisionByZero:
1037
+ type = rb_eZeroDivError;
1038
+ break;
1039
+ case SWIG_OverflowError:
1040
+ type = rb_eRangeError;
1041
+ break;
1042
+ case SWIG_SyntaxError:
1043
+ type = rb_eSyntaxError;
1044
+ break;
1045
+ case SWIG_ValueError:
1046
+ type = rb_eArgError;
1047
+ break;
1048
+ case SWIG_SystemError:
1049
+ type = rb_eFatal;
1050
+ break;
1051
+ case SWIG_AttributeError:
1052
+ type = rb_eRuntimeError;
1053
+ break;
1054
+ case SWIG_NullReferenceError:
1055
+ type = getNullReferenceError();
1056
+ break;
1057
+ case SWIG_ObjectPreviouslyDeletedError:
1058
+ type = getObjectPreviouslyDeletedError();
1059
+ break;
1060
+ case SWIG_UnknownError:
1061
+ type = rb_eRuntimeError;
1062
+ break;
1063
+ default:
1064
+ type = rb_eRuntimeError;
1065
+ }
1066
+ return type;
1067
+ }
1068
+
1069
+
1070
+ /* This function is called when a user inputs a wrong argument to
1071
+ a method.
1072
+ */
1073
+ SWIGINTERN
1074
+ const char* Ruby_Format_TypeError( const char* msg,
1075
+ const char* type,
1076
+ const char* name,
1077
+ const int argn,
1078
+ VALUE input )
1079
+ {
1080
+ char buf[128];
1081
+ VALUE str;
1082
+ VALUE asStr;
1083
+ if ( msg && *msg )
1084
+ {
1085
+ str = rb_str_new2(msg);
1086
+ }
1087
+ else
1088
+ {
1089
+ str = rb_str_new(NULL, 0);
1090
+ }
1091
+
1092
+ str = rb_str_cat2( str, "Expected argument " );
1093
+ sprintf( buf, "%d of type ", argn-1 );
1094
+ str = rb_str_cat2( str, buf );
1095
+ str = rb_str_cat2( str, type );
1096
+ str = rb_str_cat2( str, ", but got " );
1097
+ str = rb_str_cat2( str, rb_obj_classname(input) );
1098
+ str = rb_str_cat2( str, " " );
1099
+ asStr = rb_inspect(input);
1100
+ if ( RSTRING_LEN(asStr) > 30 )
1101
+ {
1102
+ str = rb_str_cat( str, StringValuePtr(asStr), 30 );
1103
+ str = rb_str_cat2( str, "..." );
1104
+ }
1105
+ else
1106
+ {
1107
+ str = rb_str_append( str, asStr );
1108
+ }
1109
+
1110
+ if ( name )
1111
+ {
1112
+ str = rb_str_cat2( str, "\n\tin SWIG method '" );
1113
+ str = rb_str_cat2( str, name );
1114
+ str = rb_str_cat2( str, "'" );
1115
+ }
1116
+
1117
+ return StringValuePtr( str );
1118
+ }
1119
+
1120
+ /* This function is called when an overloaded method fails */
1121
+ SWIGINTERN
1122
+ void Ruby_Format_OverloadedError(
1123
+ const int argc,
1124
+ const int maxargs,
1125
+ const char* method,
1126
+ const char* prototypes
1127
+ )
1128
+ {
1129
+ const char* msg = "Wrong # of arguments";
1130
+ if ( argc <= maxargs ) msg = "Wrong arguments";
1131
+ rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
1132
+ "Possible C/C++ prototypes are:\n%s",
1133
+ msg, method, prototypes);
1134
+ }
1135
+
1136
+ /* -----------------------------------------------------------------------------
1137
+ * See the LICENSE file for information on copyright, usage and redistribution
1138
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1139
+ *
1140
+ * rubytracking.swg
1141
+ *
1142
+ * This file contains support for tracking mappings from
1143
+ * Ruby objects to C++ objects. This functionality is needed
1144
+ * to implement mark functions for Ruby's mark and sweep
1145
+ * garbage collector.
1146
+ * ----------------------------------------------------------------------------- */
1147
+
1148
+ #ifdef __cplusplus
1149
+ extern "C" {
1150
+ #endif
1151
+
1152
+ /* Ruby 1.8 actually assumes the first case. */
1153
+ #if SIZEOF_VOIDP == SIZEOF_LONG
1154
+ # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
1155
+ # define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
1156
+ #elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
1157
+ # define SWIG2NUM(v) LL2NUM((unsigned long long)v)
1158
+ # define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
1159
+ #else
1160
+ # error sizeof(void*) is not the same as long or long long
1161
+ #endif
1162
+
1163
+
1164
+ /* Global Ruby hash table to store Trackings from C/C++
1165
+ structs to Ruby Objects.
1166
+ */
1167
+ static VALUE swig_ruby_trackings = Qnil;
1168
+
1169
+ /* Global variable that stores a reference to the ruby
1170
+ hash table delete function. */
1171
+ static ID swig_ruby_hash_delete;
1172
+
1173
+ /* Setup a Ruby hash table to store Trackings */
1174
+ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1175
+ /* Create a ruby hash table to store Trackings from C++
1176
+ objects to Ruby objects. */
1177
+
1178
+ /* Try to see if some other .so has already created a
1179
+ tracking hash table, which we keep hidden in an instance var
1180
+ in the SWIG module.
1181
+ This is done to allow multiple DSOs to share the same
1182
+ tracking table.
1183
+ */
1184
+ ID trackings_id = rb_intern( "@__trackings__" );
1185
+ VALUE verbose = rb_gv_get("VERBOSE");
1186
+ rb_gv_set("VERBOSE", Qfalse);
1187
+ swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
1188
+ rb_gv_set("VERBOSE", verbose);
1189
+
1190
+ /* No, it hasn't. Create one ourselves */
1191
+ if ( swig_ruby_trackings == Qnil )
1192
+ {
1193
+ swig_ruby_trackings = rb_hash_new();
1194
+ rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
1195
+ }
1196
+
1197
+ /* Now store a reference to the hash table delete function
1198
+ so that we only have to look it up once.*/
1199
+ swig_ruby_hash_delete = rb_intern("delete");
1200
+ }
1201
+
1202
+ /* Get a Ruby number to reference a pointer */
1203
+ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1204
+ /* We cast the pointer to an unsigned long
1205
+ and then store a reference to it using
1206
+ a Ruby number object. */
1207
+
1208
+ /* Convert the pointer to a Ruby number */
1209
+ return SWIG2NUM(ptr);
1210
+ }
1211
+
1212
+ /* Get a Ruby number to reference an object */
1213
+ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1214
+ /* We cast the object to an unsigned long
1215
+ and then store a reference to it using
1216
+ a Ruby number object. */
1217
+
1218
+ /* Convert the Object to a Ruby number */
1219
+ return SWIG2NUM(object);
1220
+ }
1221
+
1222
+ /* Get a Ruby object from a previously stored reference */
1223
+ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1224
+ /* The provided Ruby number object is a reference
1225
+ to the Ruby object we want.*/
1226
+
1227
+ /* Convert the Ruby number to a Ruby object */
1228
+ return NUM2SWIG(reference);
1229
+ }
1230
+
1231
+ /* Add a Tracking from a C/C++ struct to a Ruby object */
1232
+ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
1233
+ /* In a Ruby hash table we store the pointer and
1234
+ the associated Ruby object. The trick here is
1235
+ that we cannot store the Ruby object directly - if
1236
+ we do then it cannot be garbage collected. So
1237
+ instead we typecast it as a unsigned long and
1238
+ convert it to a Ruby number object.*/
1239
+
1240
+ /* Get a reference to the pointer as a Ruby number */
1241
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1242
+
1243
+ /* Get a reference to the Ruby object as a Ruby number */
1244
+ VALUE value = SWIG_RubyObjectToReference(object);
1245
+
1246
+ /* Store the mapping to the global hash table. */
1247
+ rb_hash_aset(swig_ruby_trackings, key, value);
1248
+ }
1249
+
1250
+ /* Get the Ruby object that owns the specified C/C++ struct */
1251
+ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1252
+ /* Get a reference to the pointer as a Ruby number */
1253
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1254
+
1255
+ /* Now lookup the value stored in the global hash table */
1256
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
1257
+
1258
+ if (value == Qnil) {
1259
+ /* No object exists - return nil. */
1260
+ return Qnil;
1261
+ }
1262
+ else {
1263
+ /* Convert this value to Ruby object */
1264
+ return SWIG_RubyReferenceToObject(value);
1265
+ }
1266
+ }
1267
+
1268
+ /* Remove a Tracking from a C/C++ struct to a Ruby object. It
1269
+ is very important to remove objects once they are destroyed
1270
+ since the same memory address may be reused later to create
1271
+ a new object. */
1272
+ SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
1273
+ /* Get a reference to the pointer as a Ruby number */
1274
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1275
+
1276
+ /* Delete the object from the hash table by calling Ruby's
1277
+ do this we need to call the Hash.delete method.*/
1278
+ rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
1279
+ }
1280
+
1281
+ /* This is a helper method that unlinks a Ruby object from its
1282
+ underlying C++ object. This is needed if the lifetime of the
1283
+ Ruby object is longer than the C++ object */
1284
+ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
1285
+ VALUE object = SWIG_RubyInstanceFor(ptr);
1286
+
1287
+ if (object != Qnil) {
1288
+ DATA_PTR(object) = 0;
1289
+ }
1290
+ }
1291
+
1292
+
1293
+ #ifdef __cplusplus
1294
+ }
1295
+ #endif
1296
+
1297
+ /* -----------------------------------------------------------------------------
1298
+ * Ruby API portion that goes into the runtime
1299
+ * ----------------------------------------------------------------------------- */
1300
+
1301
+ #ifdef __cplusplus
1302
+ extern "C" {
1303
+ #endif
1304
+
1305
+ SWIGINTERN VALUE
1306
+ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1307
+ if (NIL_P(target)) {
1308
+ target = o;
1309
+ } else {
1310
+ if (TYPE(target) != T_ARRAY) {
1311
+ VALUE o2 = target;
1312
+ target = rb_ary_new();
1313
+ rb_ary_push(target, o2);
1314
+ }
1315
+ rb_ary_push(target, o);
1316
+ }
1317
+ return target;
1318
+ }
1319
+
1320
+ /* For ruby1.8.4 and earlier. */
1321
+ #ifndef RUBY_INIT_STACK
1322
+ RUBY_EXTERN void Init_stack(VALUE* addr);
1323
+ # define RUBY_INIT_STACK \
1324
+ VALUE variable_in_this_stack_frame; \
1325
+ Init_stack(&variable_in_this_stack_frame);
1326
+ #endif
1327
+
1328
+
1329
+ #ifdef __cplusplus
1330
+ }
1331
+ #endif
1332
+
1333
+
1334
+ /* -----------------------------------------------------------------------------
1335
+ * See the LICENSE file for information on copyright, usage and redistribution
1336
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1337
+ *
1338
+ * rubyrun.swg
1339
+ *
1340
+ * This file contains the runtime support for Ruby modules
1341
+ * and includes code for managing global variables and pointer
1342
+ * type checking.
1343
+ * ----------------------------------------------------------------------------- */
1344
+
1345
+ /* For backward compatibility only */
1346
+ #define SWIG_POINTER_EXCEPTION 0
1347
+
1348
+ /* for raw pointers */
1349
+ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1350
+ #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1351
+ #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
1352
+ #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
1353
+ #define swig_owntype ruby_owntype
1354
+
1355
+ /* for raw packed data */
1356
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
1357
+ #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1358
+
1359
+ /* for class or struct pointers */
1360
+ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1361
+ #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1362
+
1363
+ /* for C or C++ function pointers */
1364
+ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
1365
+ #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
1366
+
1367
+ /* for C++ member pointers, ie, member methods */
1368
+ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
1369
+ #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1370
+
1371
+
1372
+ /* Runtime API */
1373
+
1374
+ #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
1375
+ #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
1376
+
1377
+
1378
+ /* Error manipulation */
1379
+
1380
+ #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
1381
+ #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), msg)
1382
+ #define SWIG_fail goto fail
1383
+
1384
+
1385
+ /* Ruby-specific SWIG API */
1386
+
1387
+ #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
1388
+ #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
1389
+ #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
1390
+ #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
1391
+ #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
1392
+
1393
+ #include "assert.h"
1394
+
1395
+ /* -----------------------------------------------------------------------------
1396
+ * pointers/data manipulation
1397
+ * ----------------------------------------------------------------------------- */
1398
+
1399
+ #ifdef __cplusplus
1400
+ extern "C" {
1401
+ #endif
1402
+
1403
+ typedef struct {
1404
+ VALUE klass;
1405
+ VALUE mImpl;
1406
+ void (*mark)(void *);
1407
+ void (*destroy)(void *);
1408
+ int trackObjects;
1409
+ } swig_class;
1410
+
1411
+
1412
+ /* Global pointer used to keep some internal SWIG stuff */
1413
+ static VALUE _cSWIG_Pointer = Qnil;
1414
+ static VALUE swig_runtime_data_type_pointer = Qnil;
1415
+
1416
+ /* Global IDs used to keep some internal SWIG stuff */
1417
+ static ID swig_arity_id = 0;
1418
+ static ID swig_call_id = 0;
1419
+
1420
+ /*
1421
+ If your swig extension is to be run within an embedded ruby and has
1422
+ director callbacks, you should set -DRUBY_EMBEDDED during compilation.
1423
+ This will reset ruby's stack frame on each entry point from the main
1424
+ program the first time a virtual director function is invoked (in a
1425
+ non-recursive way).
1426
+ If this is not done, you run the risk of Ruby trashing the stack.
1427
+ */
1428
+
1429
+ #ifdef RUBY_EMBEDDED
1430
+
1431
+ # define SWIG_INIT_STACK \
1432
+ if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
1433
+ ++swig_virtual_calls;
1434
+ # define SWIG_RELEASE_STACK --swig_virtual_calls;
1435
+ # define Ruby_DirectorTypeMismatchException(x) \
1436
+ rb_raise( rb_eTypeError, x ); return c_result;
1437
+
1438
+ static unsigned int swig_virtual_calls = 0;
1439
+
1440
+ #else /* normal non-embedded extension */
1441
+
1442
+ # define SWIG_INIT_STACK
1443
+ # define SWIG_RELEASE_STACK
1444
+ # define Ruby_DirectorTypeMismatchException(x) \
1445
+ throw Swig::DirectorTypeMismatchException( x );
1446
+
1447
+ #endif /* RUBY_EMBEDDED */
1448
+
1449
+
1450
+ SWIGRUNTIME VALUE
1451
+ getExceptionClass(void) {
1452
+ static int init = 0;
1453
+ static VALUE rubyExceptionClass ;
1454
+ if (!init) {
1455
+ init = 1;
1456
+ rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
1457
+ }
1458
+ return rubyExceptionClass;
1459
+ }
1460
+
1461
+ /* This code checks to see if the Ruby object being raised as part
1462
+ of an exception inherits from the Ruby class Exception. If so,
1463
+ the object is simply returned. If not, then a new Ruby exception
1464
+ object is created and that will be returned to Ruby.*/
1465
+ SWIGRUNTIME VALUE
1466
+ SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
1467
+ VALUE exceptionClass = getExceptionClass();
1468
+ if (rb_obj_is_kind_of(obj, exceptionClass)) {
1469
+ return obj;
1470
+ } else {
1471
+ return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
1472
+ }
1473
+ }
1474
+
1475
+ /* Initialize Ruby runtime support */
1476
+ SWIGRUNTIME void
1477
+ SWIG_Ruby_InitRuntime(void)
1478
+ {
1479
+ if (_mSWIG == Qnil) {
1480
+ _mSWIG = rb_define_module("SWIG");
1481
+ swig_call_id = rb_intern("call");
1482
+ swig_arity_id = rb_intern("arity");
1483
+ }
1484
+ }
1485
+
1486
+ /* Define Ruby class for C type */
1487
+ SWIGRUNTIME void
1488
+ SWIG_Ruby_define_class(swig_type_info *type)
1489
+ {
1490
+ VALUE klass;
1491
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1492
+ sprintf(klass_name, "TYPE%s", type->name);
1493
+ if (NIL_P(_cSWIG_Pointer)) {
1494
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
1495
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
1496
+ }
1497
+ klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1498
+ free((void *) klass_name);
1499
+ }
1500
+
1501
+ /* Create a new pointer object */
1502
+ SWIGRUNTIME VALUE
1503
+ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1504
+ {
1505
+ int own = flags & SWIG_POINTER_OWN;
1506
+ int track;
1507
+ char *klass_name;
1508
+ swig_class *sklass;
1509
+ VALUE klass;
1510
+ VALUE obj;
1511
+
1512
+ if (!ptr)
1513
+ return Qnil;
1514
+
1515
+ if (type->clientdata) {
1516
+ sklass = (swig_class *) type->clientdata;
1517
+
1518
+ /* Are we tracking this class and have we already returned this Ruby object? */
1519
+ track = sklass->trackObjects;
1520
+ if (track) {
1521
+ obj = SWIG_RubyInstanceFor(ptr);
1522
+
1523
+ /* Check the object's type and make sure it has the correct type.
1524
+ It might not in cases where methods do things like
1525
+ downcast methods. */
1526
+ if (obj != Qnil) {
1527
+ VALUE value = rb_iv_get(obj, "@__swigtype__");
1528
+ char* type_name = RSTRING_PTR(value);
1529
+
1530
+ if (strcmp(type->name, type_name) == 0) {
1531
+ return obj;
1532
+ }
1533
+ }
1534
+ }
1535
+
1536
+ /* Create a new Ruby object */
1537
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
1538
+ ( own ? VOIDFUNC(sklass->destroy) :
1539
+ (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
1540
+ ), ptr);
1541
+
1542
+ /* If tracking is on for this class then track this object. */
1543
+ if (track) {
1544
+ SWIG_RubyAddTracking(ptr, obj);
1545
+ }
1546
+ } else {
1547
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1548
+ sprintf(klass_name, "TYPE%s", type->name);
1549
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
1550
+ free((void *) klass_name);
1551
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1552
+ }
1553
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1554
+
1555
+ return obj;
1556
+ }
1557
+
1558
+ /* Create a new class instance (always owned) */
1559
+ SWIGRUNTIME VALUE
1560
+ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1561
+ {
1562
+ VALUE obj;
1563
+ swig_class *sklass = (swig_class *) type->clientdata;
1564
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
1565
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1566
+ return obj;
1567
+ }
1568
+
1569
+ /* Get type mangle from class name */
1570
+ SWIGRUNTIMEINLINE char *
1571
+ SWIG_Ruby_MangleStr(VALUE obj)
1572
+ {
1573
+ VALUE stype = rb_iv_get(obj, "@__swigtype__");
1574
+ return StringValuePtr(stype);
1575
+ }
1576
+
1577
+ /* Acquire a pointer value */
1578
+ typedef void (*ruby_owntype)(void*);
1579
+
1580
+ SWIGRUNTIME ruby_owntype
1581
+ SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
1582
+ if (obj) {
1583
+ ruby_owntype oldown = RDATA(obj)->dfree;
1584
+ RDATA(obj)->dfree = own;
1585
+ return oldown;
1586
+ } else {
1587
+ return 0;
1588
+ }
1589
+ }
1590
+
1591
+ /* Convert a pointer value */
1592
+ SWIGRUNTIME int
1593
+ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
1594
+ {
1595
+ char *c;
1596
+ swig_cast_info *tc;
1597
+ void *vptr = 0;
1598
+
1599
+ /* Grab the pointer */
1600
+ if (NIL_P(obj)) {
1601
+ *ptr = 0;
1602
+ return SWIG_OK;
1603
+ } else {
1604
+ if (TYPE(obj) != T_DATA) {
1605
+ return SWIG_ERROR;
1606
+ }
1607
+ Data_Get_Struct(obj, void, vptr);
1608
+ }
1609
+
1610
+ if (own) *own = RDATA(obj)->dfree;
1611
+
1612
+ /* Check to see if the input object is giving up ownership
1613
+ of the underlying C struct or C++ object. If so then we
1614
+ need to reset the destructor since the Ruby object no
1615
+ longer owns the underlying C++ object.*/
1616
+ if (flags & SWIG_POINTER_DISOWN) {
1617
+ /* Is tracking on for this class? */
1618
+ int track = 0;
1619
+ if (ty && ty->clientdata) {
1620
+ swig_class *sklass = (swig_class *) ty->clientdata;
1621
+ track = sklass->trackObjects;
1622
+ }
1623
+
1624
+ if (track) {
1625
+ /* We are tracking objects for this class. Thus we change the destructor
1626
+ * to SWIG_RubyRemoveTracking. This allows us to
1627
+ * remove the mapping from the C++ to Ruby object
1628
+ * when the Ruby object is garbage collected. If we don't
1629
+ * do this, then it is possible we will return a reference
1630
+ * to a Ruby object that no longer exists thereby crashing Ruby. */
1631
+ RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
1632
+ } else {
1633
+ RDATA(obj)->dfree = 0;
1634
+ }
1635
+ }
1636
+
1637
+ /* Do type-checking if type info was provided */
1638
+ if (ty) {
1639
+ if (ty->clientdata) {
1640
+ if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
1641
+ if (vptr == 0) {
1642
+ /* The object has already been deleted */
1643
+ return SWIG_ObjectPreviouslyDeletedError;
1644
+ }
1645
+ *ptr = vptr;
1646
+ return SWIG_OK;
1647
+ }
1648
+ }
1649
+ if ((c = SWIG_MangleStr(obj)) == NULL) {
1650
+ return SWIG_ERROR;
1651
+ }
1652
+ tc = SWIG_TypeCheck(c, ty);
1653
+ if (!tc) {
1654
+ return SWIG_ERROR;
1655
+ } else {
1656
+ int newmemory = 0;
1657
+ *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1658
+ assert(!newmemory); /* newmemory handling not yet implemented */
1659
+ }
1660
+ } else {
1661
+ *ptr = vptr;
1662
+ }
1663
+
1664
+ return SWIG_OK;
1665
+ }
1666
+
1667
+ /* Check convert */
1668
+ SWIGRUNTIMEINLINE int
1669
+ SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
1670
+ {
1671
+ char *c = SWIG_MangleStr(obj);
1672
+ if (!c) return 0;
1673
+ return SWIG_TypeCheck(c,ty) != 0;
1674
+ }
1675
+
1676
+ SWIGRUNTIME VALUE
1677
+ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
1678
+ char result[1024];
1679
+ char *r = result;
1680
+ if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
1681
+ *(r++) = '_';
1682
+ r = SWIG_PackData(r, ptr, sz);
1683
+ strcpy(r, type->name);
1684
+ return rb_str_new2(result);
1685
+ }
1686
+
1687
+ /* Convert a packed value value */
1688
+ SWIGRUNTIME int
1689
+ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
1690
+ swig_cast_info *tc;
1691
+ const char *c;
1692
+
1693
+ if (TYPE(obj) != T_STRING) goto type_error;
1694
+ c = StringValuePtr(obj);
1695
+ /* Pointer values must start with leading underscore */
1696
+ if (*c != '_') goto type_error;
1697
+ c++;
1698
+ c = SWIG_UnpackData(c, ptr, sz);
1699
+ if (ty) {
1700
+ tc = SWIG_TypeCheck(c, ty);
1701
+ if (!tc) goto type_error;
1702
+ }
1703
+ return SWIG_OK;
1704
+
1705
+ type_error:
1706
+ return SWIG_ERROR;
1707
+ }
1708
+
1709
+ SWIGRUNTIME swig_module_info *
1710
+ SWIG_Ruby_GetModule(void)
1711
+ {
1712
+ VALUE pointer;
1713
+ swig_module_info *ret = 0;
1714
+ VALUE verbose = rb_gv_get("VERBOSE");
1715
+
1716
+ /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
1717
+ rb_gv_set("VERBOSE", Qfalse);
1718
+
1719
+ /* first check if pointer already created */
1720
+ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
1721
+ if (pointer != Qnil) {
1722
+ Data_Get_Struct(pointer, swig_module_info, ret);
1723
+ }
1724
+
1725
+ /* reinstate warnings */
1726
+ rb_gv_set("VERBOSE", verbose);
1727
+ return ret;
1728
+ }
1729
+
1730
+ SWIGRUNTIME void
1731
+ SWIG_Ruby_SetModule(swig_module_info *pointer)
1732
+ {
1733
+ /* register a new class */
1734
+ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
1735
+ /* create and store the structure pointer to a global variable */
1736
+ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
1737
+ rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
1738
+ }
1739
+
1740
+ /* This function can be used to check whether a proc or method or similarly
1741
+ callable function has been passed. Usually used in a %typecheck, like:
1742
+
1743
+ %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
1744
+ $result = SWIG_Ruby_isCallable( $input );
1745
+ }
1746
+ */
1747
+ SWIGINTERN
1748
+ int SWIG_Ruby_isCallable( VALUE proc )
1749
+ {
1750
+ if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
1751
+ return 1;
1752
+ return 0;
1753
+ }
1754
+
1755
+ /* This function can be used to check the arity (number of arguments)
1756
+ a proc or method can take. Usually used in a %typecheck.
1757
+ Valid arities will be that equal to minimal or those < 0
1758
+ which indicate a variable number of parameters at the end.
1759
+ */
1760
+ SWIGINTERN
1761
+ int SWIG_Ruby_arity( VALUE proc, int minimal )
1762
+ {
1763
+ if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
1764
+ {
1765
+ VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1766
+ int arity = NUM2INT(num);
1767
+ if ( arity < 0 && (arity+1) < -minimal ) return 1;
1768
+ if ( arity == minimal ) return 1;
1769
+ return 1;
1770
+ }
1771
+ return 0;
1772
+ }
1773
+
1774
+
1775
+ #ifdef __cplusplus
1776
+ }
1777
+ #endif
1778
+
1779
+
1780
+
1781
+ #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1782
+
1783
+ #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1784
+
1785
+
1786
+
1787
+ #define SWIG_exception(code, msg) do { SWIG_Error(code, msg);; } while(0)
1788
+
1789
+
1790
+ /* -------- TYPES TABLE (BEGIN) -------- */
1791
+
1792
+ #define SWIGTYPE_p_Job swig_types[0]
1793
+ #define SWIGTYPE_p_char swig_types[1]
1794
+ #define SWIGTYPE_p_gearman_callback swig_types[2]
1795
+ #define SWIGTYPE_p_gearman_client_options_t swig_types[3]
1796
+ #define SWIGTYPE_p_gearman_client_st swig_types[4]
1797
+ #define SWIGTYPE_p_gearman_client_state_t swig_types[5]
1798
+ #define SWIGTYPE_p_gearman_command_info_st swig_types[6]
1799
+ #define SWIGTYPE_p_gearman_command_t swig_types[7]
1800
+ #define SWIGTYPE_p_gearman_con_options_t swig_types[8]
1801
+ #define SWIGTYPE_p_gearman_con_recv_state_t swig_types[9]
1802
+ #define SWIGTYPE_p_gearman_con_send_state_t swig_types[10]
1803
+ #define SWIGTYPE_p_gearman_con_st swig_types[11]
1804
+ #define SWIGTYPE_p_gearman_con_state_t swig_types[12]
1805
+ #define SWIGTYPE_p_gearman_job_options_t swig_types[13]
1806
+ #define SWIGTYPE_p_gearman_job_priority_t swig_types[14]
1807
+ #define SWIGTYPE_p_gearman_job_st swig_types[15]
1808
+ #define SWIGTYPE_p_gearman_magic_t swig_types[16]
1809
+ #define SWIGTYPE_p_gearman_options_t swig_types[17]
1810
+ #define SWIGTYPE_p_gearman_packet_options_t swig_types[18]
1811
+ #define SWIGTYPE_p_gearman_packet_st swig_types[19]
1812
+ #define SWIGTYPE_p_gearman_return_t swig_types[20]
1813
+ #define SWIGTYPE_p_gearman_st swig_types[21]
1814
+ #define SWIGTYPE_p_gearman_task_options_t swig_types[22]
1815
+ #define SWIGTYPE_p_gearman_task_st swig_types[23]
1816
+ #define SWIGTYPE_p_gearman_task_state_t swig_types[24]
1817
+ #define SWIGTYPE_p_gearman_verbose_t swig_types[25]
1818
+ #define SWIGTYPE_p_gearman_worker_function_options_t swig_types[26]
1819
+ #define SWIGTYPE_p_gearman_worker_function_st swig_types[27]
1820
+ #define SWIGTYPE_p_gearman_worker_options_t swig_types[28]
1821
+ #define SWIGTYPE_p_gearman_worker_st swig_types[29]
1822
+ #define SWIGTYPE_p_gearman_worker_state_t swig_types[30]
1823
+ #define SWIGTYPE_p_gearman_worker_work_state_t swig_types[31]
1824
+ #define SWIGTYPE_p_int swig_types[32]
1825
+ #define SWIGTYPE_p_long_long swig_types[33]
1826
+ #define SWIGTYPE_p_p_char swig_types[34]
1827
+ #define SWIGTYPE_p_short swig_types[35]
1828
+ #define SWIGTYPE_p_signed_char swig_types[36]
1829
+ #define SWIGTYPE_p_size_t swig_types[37]
1830
+ #define SWIGTYPE_p_unsigned_char swig_types[38]
1831
+ #define SWIGTYPE_p_unsigned_int swig_types[39]
1832
+ #define SWIGTYPE_p_unsigned_long_long swig_types[40]
1833
+ #define SWIGTYPE_p_unsigned_short swig_types[41]
1834
+ #define SWIGTYPE_p_void swig_types[42]
1835
+ static swig_type_info *swig_types[44];
1836
+ static swig_module_info swig_module = {swig_types, 43, 0, 0, 0, 0};
1837
+ #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1838
+ #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1839
+
1840
+ /* -------- TYPES TABLE (END) -------- */
1841
+
1842
+ #define SWIG_init Init_gearman
1843
+ #define SWIG_name "Gearman"
1844
+
1845
+ static VALUE mGearman;
1846
+
1847
+ #define SWIG_RUBY_THREAD_BEGIN_BLOCK
1848
+ #define SWIG_RUBY_THREAD_END_BLOCK
1849
+
1850
+
1851
+ #define SWIGVERSION 0x010341
1852
+ #define SWIG_VERSION SWIGVERSION
1853
+
1854
+
1855
+ #define SWIG_as_voidptr(a) (void *)((const void *)(a))
1856
+ #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
1857
+
1858
+
1859
+ #ifdef __cplusplus
1860
+ extern "C" {
1861
+ #endif
1862
+
1863
+ // Ruby 1.9 changed the file name of this header
1864
+ #ifdef HAVE_RUBY_IO_H
1865
+ #include "ruby/io.h"
1866
+ #else
1867
+ #include "rubyio.h"
1868
+ #endif
1869
+
1870
+ #ifdef __cplusplus
1871
+ }
1872
+ #endif
1873
+
1874
+
1875
+ #ifdef __cplusplus
1876
+ extern "C" {
1877
+ #endif
1878
+ #ifdef HAVE_SYS_TIME_H
1879
+ # include <sys/time.h>
1880
+ struct timeval rb_time_timeval(VALUE);
1881
+ #endif
1882
+ #ifdef __cplusplus
1883
+ }
1884
+ #endif
1885
+
1886
+
1887
+ #include <stdint.h> // Use the C99 official header
1888
+
1889
+
1890
+ #include <libgearman/gearman.h>
1891
+
1892
+ typedef struct gearman_st Gearman;
1893
+ typedef struct gearman_client_st Client;
1894
+ typedef struct gearman_worker_st Worker;
1895
+ typedef struct gearman_job_st Job;
1896
+ typedef void do_return;
1897
+
1898
+ typedef enum enum_gearman_exception {
1899
+ GearmanException
1900
+ } gearman_exception;
1901
+
1902
+ typedef struct gearman_workload_st {
1903
+ const void *workload;
1904
+ size_t workload_size;
1905
+ } gearman_workload;
1906
+
1907
+
1908
+
1909
+ SWIGINTERN swig_type_info*
1910
+ SWIG_pchar_descriptor(void)
1911
+ {
1912
+ static int init = 0;
1913
+ static swig_type_info* info = 0;
1914
+ if (!init) {
1915
+ info = SWIG_TypeQuery("_p_char");
1916
+ init = 1;
1917
+ }
1918
+ return info;
1919
+ }
1920
+
1921
+
1922
+ SWIGINTERNINLINE VALUE
1923
+ SWIG_FromCharPtrAndSize(const char* carray, size_t size)
1924
+ {
1925
+ if (carray) {
1926
+ if (size > LONG_MAX) {
1927
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1928
+ return pchar_descriptor ?
1929
+ SWIG_NewPointerObj((char *)(carray), pchar_descriptor, 0) : Qnil;
1930
+ } else {
1931
+ return rb_str_new(carray, (long)(size));
1932
+ }
1933
+ } else {
1934
+ return Qnil;
1935
+ }
1936
+ }
1937
+
1938
+
1939
+ SWIGINTERNINLINE VALUE
1940
+ SWIG_FromCharPtr(const char *cptr)
1941
+ {
1942
+ return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
1943
+ }
1944
+
1945
+
1946
+ #include <limits.h>
1947
+ #if !defined(SWIG_NO_LLONG_MAX)
1948
+ # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1949
+ # define LLONG_MAX __LONG_LONG_MAX__
1950
+ # define LLONG_MIN (-LLONG_MAX - 1LL)
1951
+ # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1952
+ # endif
1953
+ #endif
1954
+
1955
+
1956
+ #define SWIG_From_long LONG2NUM
1957
+
1958
+
1959
+ SWIGINTERNINLINE VALUE
1960
+ SWIG_From_int (int value)
1961
+ {
1962
+ return SWIG_From_long (value);
1963
+ }
1964
+
1965
+
1966
+
1967
+ /* TODO: I know this looks silly - it's cause we're going to add the job to it */
1968
+
1969
+ typedef struct ruby_gearman_callback_st {
1970
+ VALUE callback_obj;
1971
+ } gearman_callback;
1972
+
1973
+
1974
+ void* workerCallback(gearman_job_st *job, void *fn_arg,
1975
+ size_t *result_size,
1976
+ gearman_return_t *ret_ptr)
1977
+ {
1978
+ gearman_callback *callback_data= (gearman_callback *)fn_arg;
1979
+ VALUE cb_obj = callback_data->callback_obj;
1980
+ VALUE job_obj = SWIG_NewPointerObj(SWIG_as_voidptr(job),
1981
+ SWIGTYPE_p_gearman_job_st, 0 | 0);
1982
+
1983
+ VALUE ret= rb_funcall(cb_obj,rb_intern("call"), 1, job_obj);
1984
+ *result_size= (size_t)RSTRING(ret)->len;
1985
+ return (void *)STR2CSTR(ret);
1986
+ }
1987
+
1988
+
1989
+
1990
+ SWIGINTERN Gearman *new_Gearman(){
1991
+ return gearman_create(NULL);
1992
+ }
1993
+ SWIGINTERN Gearman *Gearman_copy(Gearman *self){
1994
+ return gearman_clone(NULL, self);
1995
+ }
1996
+ SWIGINTERN char const *Gearman_error(Gearman *self){
1997
+ return gearman_error(self);
1998
+ }
1999
+ SWIGINTERN int Gearman_errno(Gearman *self){
2000
+ return gearman_errno(self);
2001
+ }
2002
+ SWIGINTERN gearman_options_t Gearman_options(Gearman *self){
2003
+ return gearman_options(self);
2004
+ }
2005
+
2006
+ SWIGINTERN VALUE
2007
+ SWIG_ruby_failed(void)
2008
+ {
2009
+ return Qnil;
2010
+ }
2011
+
2012
+
2013
+ /*@SWIG:/usr/local/swigsvn/share/swig/1.3.41/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
2014
+ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
2015
+ {
2016
+ VALUE obj = args[0];
2017
+ VALUE type = TYPE(obj);
2018
+ long *res = (long *)(args[1]);
2019
+ *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
2020
+ return obj;
2021
+ }
2022
+ /*@SWIG@*/
2023
+
2024
+ SWIGINTERN int
2025
+ SWIG_AsVal_long (VALUE obj, long* val)
2026
+ {
2027
+ VALUE type = TYPE(obj);
2028
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
2029
+ long v;
2030
+ VALUE a[2];
2031
+ a[0] = obj;
2032
+ a[1] = (VALUE)(&v);
2033
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2034
+ if (val) *val = v;
2035
+ return SWIG_OK;
2036
+ }
2037
+ }
2038
+ return SWIG_TypeError;
2039
+ }
2040
+
2041
+
2042
+ SWIGINTERN int
2043
+ SWIG_AsVal_int (VALUE obj, int *val)
2044
+ {
2045
+ long v;
2046
+ int res = SWIG_AsVal_long (obj, &v);
2047
+ if (SWIG_IsOK(res)) {
2048
+ if ((v < INT_MIN || v > INT_MAX)) {
2049
+ return SWIG_OverflowError;
2050
+ } else {
2051
+ if (val) *val = (int)(v);
2052
+ }
2053
+ }
2054
+ return res;
2055
+ }
2056
+
2057
+ SWIGINTERN void Gearman_setOptions(Gearman *self,gearman_options_t options){
2058
+ gearman_set_options(self, options);
2059
+ }
2060
+ SWIGINTERN void Gearman_addOptions(Gearman *self,gearman_options_t options){
2061
+ gearman_add_options(self, options);
2062
+ }
2063
+ SWIGINTERN void Gearman_removeOptions(Gearman *self,gearman_options_t options){
2064
+ gearman_remove_options(self, options);
2065
+ }
2066
+ SWIGINTERN int Gearman_timeout(Gearman *self){
2067
+ return gearman_timeout(self);
2068
+ }
2069
+ SWIGINTERN void Gearman_setTimeout(Gearman *self,int timeout){
2070
+ gearman_set_timeout(self, timeout);
2071
+ }
2072
+ SWIGINTERN Client *new_Client(){
2073
+ return gearman_client_create(NULL);
2074
+ }
2075
+ SWIGINTERN Client *Client_copy(Client *self){
2076
+ return gearman_client_clone(NULL, self);
2077
+ }
2078
+ SWIGINTERN char const *Client_error(Client *self){
2079
+ return gearman_client_error(self);
2080
+ }
2081
+ SWIGINTERN int Client_errno(Client *self){
2082
+ return gearman_client_errno(self);
2083
+ }
2084
+ SWIGINTERN gearman_client_options_t Client_options(Client *self){
2085
+ return gearman_client_options(self);
2086
+ }
2087
+ SWIGINTERN void Client_setOptions(Client *self,gearman_client_options_t options){
2088
+ gearman_client_set_options(self, options);
2089
+ }
2090
+ SWIGINTERN void Client_addOptions(Client *self,gearman_client_options_t options){
2091
+ gearman_client_add_options(self, options);
2092
+ }
2093
+ SWIGINTERN void Client_removeOptions(Client *self,gearman_client_options_t options){
2094
+ gearman_client_remove_options(self, options);
2095
+ }
2096
+
2097
+ SWIGINTERN int
2098
+ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
2099
+ {
2100
+ if (TYPE(obj) == T_STRING) {
2101
+ #if defined(StringValuePtr)
2102
+ char *cstr = StringValuePtr(obj);
2103
+ #else
2104
+ char *cstr = STR2CSTR(obj);
2105
+ #endif
2106
+ size_t size = RSTRING_LEN(obj) + 1;
2107
+ if (cptr) {
2108
+ if (alloc) {
2109
+ if (*alloc == SWIG_NEWOBJ) {
2110
+ *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
2111
+ } else {
2112
+ *cptr = cstr;
2113
+ *alloc = SWIG_OLDOBJ;
2114
+ }
2115
+ }
2116
+ }
2117
+ if (psize) *psize = size;
2118
+ return SWIG_OK;
2119
+ } else {
2120
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
2121
+ if (pchar_descriptor) {
2122
+ void* vptr = 0;
2123
+ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
2124
+ if (cptr) *cptr = (char *)vptr;
2125
+ if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
2126
+ if (alloc) *alloc = SWIG_OLDOBJ;
2127
+ return SWIG_OK;
2128
+ }
2129
+ }
2130
+ }
2131
+ return SWIG_TypeError;
2132
+ }
2133
+
2134
+
2135
+
2136
+
2137
+
2138
+ /*@SWIG:/usr/local/swigsvn/share/swig/1.3.41/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
2139
+ SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
2140
+ {
2141
+ VALUE obj = args[0];
2142
+ VALUE type = TYPE(obj);
2143
+ unsigned long *res = (unsigned long *)(args[1]);
2144
+ *res = type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj);
2145
+ return obj;
2146
+ }
2147
+ /*@SWIG@*/
2148
+
2149
+ SWIGINTERN int
2150
+ SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val)
2151
+ {
2152
+ VALUE type = TYPE(obj);
2153
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
2154
+ unsigned long v;
2155
+ VALUE a[2];
2156
+ a[0] = obj;
2157
+ a[1] = (VALUE)(&v);
2158
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2159
+ if (val) *val = v;
2160
+ return SWIG_OK;
2161
+ }
2162
+ }
2163
+ return SWIG_TypeError;
2164
+ }
2165
+
2166
+
2167
+ SWIGINTERN int
2168
+ SWIG_AsVal_unsigned_SS_int (VALUE obj, unsigned int *val)
2169
+ {
2170
+ unsigned long v;
2171
+ int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
2172
+ if (SWIG_IsOK(res)) {
2173
+ if ((v > UINT_MAX)) {
2174
+ return SWIG_OverflowError;
2175
+ } else {
2176
+ if (val) *val = (unsigned int)(v);
2177
+ }
2178
+ }
2179
+ return res;
2180
+ }
2181
+
2182
+ SWIGINTERN gearman_return_t Client_addServer__SWIG_0(Client *self,char const *host,in_port_t port){
2183
+ return gearman_client_add_server(self, host, port);
2184
+ }
2185
+ SWIGINTERN gearman_return_t Client_addServer__SWIG_1(Client *self,char const *host){
2186
+ return gearman_client_add_server(self,
2187
+ "127.0.0.1",
2188
+ 4730);
2189
+ }
2190
+ SWIGINTERN gearman_return_t Client_addServer__SWIG_2(Client *self){
2191
+ return gearman_client_add_server(self,
2192
+ "127.0.0.1",
2193
+ 4730);
2194
+ }
2195
+ SWIGINTERN gearman_return_t Client_addServers(Client *self,char const *servers){
2196
+ return gearman_client_add_servers(self, servers);
2197
+ }
2198
+ SWIGINTERN void Client_removeServers(Client *self){
2199
+ gearman_client_remove_servers(self);
2200
+ }
2201
+
2202
+ SWIGINTERNINLINE int
2203
+ SWIG_AsVal_size_t (VALUE obj, size_t *val)
2204
+ {
2205
+ unsigned long v;
2206
+ int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
2207
+ if (SWIG_IsOK(res) && val) *val = (size_t)(v);
2208
+ return res;
2209
+ }
2210
+
2211
+
2212
+ #define output_helper SWIG_Ruby_AppendOutput
2213
+
2214
+ SWIGINTERN gearman_return_t Client_do(Client *self,char const *function_name,void const *workload,size_t workload_size,char **ret_val,size_t *ret_size,char const *unique){
2215
+ gearman_return_t ret;
2216
+ *ret_val= (void *)gearman_client_do(self, function_name, unique, workload,
2217
+ workload_size, ret_size, &ret);
2218
+
2219
+ return ret;
2220
+ }
2221
+ SWIGINTERN gearman_return_t Client_doHigh(Client *self,char const *function_name,void const *workload,size_t workload_size,char **ret_val,size_t *ret_size,char const *unique){
2222
+ gearman_return_t ret;
2223
+ *ret_val= (void *)gearman_client_do_high(self, function_name, unique,
2224
+ workload, workload_size,
2225
+ ret_size, &ret);
2226
+
2227
+ return ret;
2228
+ }
2229
+ SWIGINTERN gearman_return_t Client_doLow(Client *self,char const *function_name,void const *workload,size_t workload_size,char **ret_val,size_t *ret_size,char const *unique){
2230
+ gearman_return_t ret;
2231
+ *ret_val= (void *)gearman_client_do_low(self, function_name, unique,
2232
+ workload, workload_size,
2233
+ ret_size, &ret);
2234
+
2235
+ return ret;
2236
+ }
2237
+ SWIGINTERN char const *Client_jobHandle(Client *self){
2238
+ return gearman_client_do_job_handle(self);
2239
+ }
2240
+ SWIGINTERN void Client_status(Client *self,uint32_t *numerator,uint32_t *denominator){
2241
+ gearman_client_do_status(self, numerator, denominator);
2242
+ }
2243
+ SWIGINTERN Worker *new_Worker(){
2244
+ return gearman_worker_create(NULL);
2245
+ }
2246
+ SWIGINTERN Worker *Worker_copy(Worker *self){
2247
+ return gearman_worker_clone(NULL, self);
2248
+ }
2249
+ SWIGINTERN char const *Worker_error(Worker *self){
2250
+ return gearman_worker_error(self);
2251
+ }
2252
+ SWIGINTERN int Worker_errno(Worker *self){
2253
+ return gearman_worker_errno(self);
2254
+ }
2255
+ SWIGINTERN gearman_worker_options_t Worker_options(Worker *self){
2256
+ return gearman_worker_options(self);
2257
+ }
2258
+ SWIGINTERN void Worker_setOptions(Worker *self,gearman_worker_options_t options){
2259
+ gearman_worker_set_options(self, options);
2260
+ }
2261
+ SWIGINTERN void Worker_addOptions(Worker *self,gearman_worker_options_t options){
2262
+ gearman_worker_add_options(self, options);
2263
+ }
2264
+ SWIGINTERN void Worker_removeOptions(Worker *self,gearman_worker_options_t options){
2265
+ gearman_worker_remove_options(self, options);
2266
+ }
2267
+ SWIGINTERN int Worker_timeout(Worker *self){
2268
+ return gearman_worker_timeout(self);
2269
+ }
2270
+ SWIGINTERN void Worker_setTimeout(Worker *self,int timeout){
2271
+ gearman_worker_set_timeout(self, timeout);
2272
+ }
2273
+ SWIGINTERN gearman_return_t Worker_addServer__SWIG_0(Worker *self,char const *host,in_port_t port){
2274
+ return gearman_worker_add_server(self, host, port);
2275
+ }
2276
+ SWIGINTERN gearman_return_t Worker_addServer__SWIG_1(Worker *self,char const *host){
2277
+ return gearman_worker_add_server(self,
2278
+ "127.0.0.1",
2279
+ 4730);
2280
+ }
2281
+ SWIGINTERN gearman_return_t Worker_addServer__SWIG_2(Worker *self){
2282
+ return gearman_worker_add_server(self,
2283
+ "127.0.0.1",
2284
+ 4730);
2285
+ }
2286
+ SWIGINTERN gearman_return_t Worker_addServers(Worker *self,char const *servers){
2287
+ return gearman_worker_add_servers(self, servers);
2288
+ }
2289
+ SWIGINTERN gearman_return_t Worker_registerFunction(Worker *self,char const *function_name,uint32_t timeout){
2290
+ return gearman_worker_register(self, function_name, timeout);
2291
+ }
2292
+ SWIGINTERN gearman_return_t Worker_unregister(Worker *self,char const *function_name){
2293
+ return gearman_worker_unregister(self, function_name);
2294
+ }
2295
+ SWIGINTERN gearman_return_t Worker_unregisterAll(Worker *self){
2296
+ return gearman_worker_unregister_all(self);
2297
+ }
2298
+ SWIGINTERN Job *Worker_grabJob(Worker *self){
2299
+ gearman_return_t ret;
2300
+ return gearman_worker_grab_job(self, NULL, &ret);
2301
+ }
2302
+ SWIGINTERN gearman_return_t Worker_addFunction(Worker *self,char const *function_name,gearman_callback *worker_fn,uint32_t timeout){
2303
+ return gearman_worker_add_function(self, function_name, timeout,
2304
+ workerCallback, (void *)worker_fn);
2305
+ }
2306
+ SWIGINTERN gearman_return_t Worker_work(Worker *self){
2307
+ return gearman_worker_work(self);
2308
+ }
2309
+
2310
+
2311
+ #define D_exception(code,msg) do { gearman_raise_exception(code, msg); SWIG_fail; } while(0);
2312
+ #define D_exception_err(code,err) do { gearman_raise_exception(code, err.message); SWIG_fail; } while(0);
2313
+
2314
+ #define getExceptionMethod(excptype,eparent) \
2315
+ SWIGINTERN VALUE \
2316
+ get ## excptype () { \
2317
+ static int init ## excptype = 0 ; \
2318
+ static VALUE rb_e ## excptype ; \
2319
+ VALUE rb_eparent = gearman_get_exception (eparent); \
2320
+ if (! init ## excptype ) { \
2321
+ init ## excptype = 1; \
2322
+ rb_e ## excptype = rb_define_class(#excptype , rb_eparent); \
2323
+ } \
2324
+ return rb_e ## excptype ; \
2325
+ }
2326
+
2327
+ SWIGINTERN VALUE getGearmanException() {
2328
+ static int initGearmanException = 0 ;
2329
+ static VALUE rb_eGearmanException;
2330
+ if (! initGearmanException ) {
2331
+ initGearmanException = 1;
2332
+ rb_eGearmanException = rb_define_class("GearmanException", rb_eRuntimeError);
2333
+ }
2334
+ return rb_eGearmanException ;
2335
+ }
2336
+
2337
+ VALUE gearman_get_exception(gearman_exception excpcode);
2338
+
2339
+ getExceptionMethod(SubGearmanException,GearmanException);
2340
+
2341
+ void gearman_raise_exception(gearman_exception excpcode, const char * msg) {
2342
+ rb_raise(gearman_get_exception(excpcode),msg);
2343
+ }
2344
+
2345
+ VALUE gearman_get_exception(gearman_exception excpcode) {
2346
+
2347
+ VALUE exception;
2348
+
2349
+ switch (excpcode) {
2350
+ case GearmanException:
2351
+ exception = getGearmanException();
2352
+ break;
2353
+ default:
2354
+ exception = rb_eRuntimeError;
2355
+ break;
2356
+ }
2357
+ return exception;
2358
+ }
2359
+
2360
+
2361
+ SWIGINTERN VALUE
2362
+ _wrap_version(int argc, VALUE *argv, VALUE self) {
2363
+ char *result = 0 ;
2364
+ VALUE vresult = Qnil;
2365
+
2366
+ if ((argc < 0) || (argc > 0)) {
2367
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2368
+ }
2369
+ result = (char *)gearman_version();
2370
+ vresult = SWIG_FromCharPtr((const char *)result);
2371
+ return vresult;
2372
+ fail:
2373
+ return Qnil;
2374
+ }
2375
+
2376
+
2377
+ SWIGINTERN VALUE
2378
+ _wrap_bugreport(int argc, VALUE *argv, VALUE self) {
2379
+ char *result = 0 ;
2380
+ VALUE vresult = Qnil;
2381
+
2382
+ if ((argc < 0) || (argc > 0)) {
2383
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2384
+ }
2385
+ result = (char *)gearman_bugreport();
2386
+ vresult = SWIG_FromCharPtr((const char *)result);
2387
+ return vresult;
2388
+ fail:
2389
+ return Qnil;
2390
+ }
2391
+
2392
+
2393
+ swig_class SwigClassGearman;
2394
+
2395
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2396
+ SWIGINTERN VALUE
2397
+ _wrap_Gearman_allocate(VALUE self) {
2398
+ #else
2399
+ SWIGINTERN VALUE
2400
+ _wrap_Gearman_allocate(int argc, VALUE *argv, VALUE self) {
2401
+ #endif
2402
+
2403
+
2404
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_gearman_st);
2405
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2406
+ rb_obj_call_init(vresult, argc, argv);
2407
+ #endif
2408
+ return vresult;
2409
+ }
2410
+
2411
+
2412
+ SWIGINTERN VALUE
2413
+ _wrap_new_Gearman(int argc, VALUE *argv, VALUE self) {
2414
+ Gearman *result = 0 ;
2415
+
2416
+ if ((argc < 0) || (argc > 0)) {
2417
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2418
+ }
2419
+ result = (Gearman *)new_Gearman();
2420
+ DATA_PTR(self) = result;
2421
+ return self;
2422
+ fail:
2423
+ return Qnil;
2424
+ }
2425
+
2426
+
2427
+ SWIGINTERN void delete_Gearman(Gearman *self){
2428
+ gearman_free(self);
2429
+ }
2430
+ SWIGINTERN void
2431
+ free_Gearman(Gearman *arg1) {
2432
+ delete_Gearman(arg1);
2433
+ }
2434
+
2435
+ SWIGINTERN VALUE
2436
+ _wrap_Gearman_copy(int argc, VALUE *argv, VALUE self) {
2437
+ Gearman *arg1 = (Gearman *) 0 ;
2438
+ void *argp1 = 0 ;
2439
+ int res1 = 0 ;
2440
+ Gearman *result = 0 ;
2441
+ VALUE vresult = Qnil;
2442
+
2443
+ if ((argc < 0) || (argc > 0)) {
2444
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2445
+ }
2446
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_st, 0 | 0 );
2447
+ if (!SWIG_IsOK(res1)) {
2448
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gearman *","copy", 1, self ));
2449
+ }
2450
+ arg1 = (Gearman *)(argp1);
2451
+ result = (Gearman *)Gearman_copy(arg1);
2452
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_gearman_st, 0 | 0 );
2453
+ return vresult;
2454
+ fail:
2455
+ return Qnil;
2456
+ }
2457
+
2458
+
2459
+ SWIGINTERN VALUE
2460
+ _wrap_Gearman_error(int argc, VALUE *argv, VALUE self) {
2461
+ Gearman *arg1 = (Gearman *) 0 ;
2462
+ void *argp1 = 0 ;
2463
+ int res1 = 0 ;
2464
+ char *result = 0 ;
2465
+ VALUE vresult = Qnil;
2466
+
2467
+ if ((argc < 0) || (argc > 0)) {
2468
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2469
+ }
2470
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_st, 0 | 0 );
2471
+ if (!SWIG_IsOK(res1)) {
2472
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gearman *","error", 1, self ));
2473
+ }
2474
+ arg1 = (Gearman *)(argp1);
2475
+ result = (char *)Gearman_error(arg1);
2476
+ vresult = SWIG_FromCharPtr((const char *)result);
2477
+ return vresult;
2478
+ fail:
2479
+ return Qnil;
2480
+ }
2481
+
2482
+
2483
+ SWIGINTERN VALUE
2484
+ _wrap_Gearman_errno(int argc, VALUE *argv, VALUE self) {
2485
+ Gearman *arg1 = (Gearman *) 0 ;
2486
+ void *argp1 = 0 ;
2487
+ int res1 = 0 ;
2488
+ int result;
2489
+ VALUE vresult = Qnil;
2490
+
2491
+ if ((argc < 0) || (argc > 0)) {
2492
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2493
+ }
2494
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_st, 0 | 0 );
2495
+ if (!SWIG_IsOK(res1)) {
2496
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gearman *","errno", 1, self ));
2497
+ }
2498
+ arg1 = (Gearman *)(argp1);
2499
+ result = (int)Gearman_errno(arg1);
2500
+ vresult = SWIG_From_int((int)(result));
2501
+ return vresult;
2502
+ fail:
2503
+ return Qnil;
2504
+ }
2505
+
2506
+
2507
+ SWIGINTERN VALUE
2508
+ _wrap_Gearman_options(int argc, VALUE *argv, VALUE self) {
2509
+ Gearman *arg1 = (Gearman *) 0 ;
2510
+ void *argp1 = 0 ;
2511
+ int res1 = 0 ;
2512
+ gearman_options_t result;
2513
+ VALUE vresult = Qnil;
2514
+
2515
+ if ((argc < 0) || (argc > 0)) {
2516
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2517
+ }
2518
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_st, 0 | 0 );
2519
+ if (!SWIG_IsOK(res1)) {
2520
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gearman *","options", 1, self ));
2521
+ }
2522
+ arg1 = (Gearman *)(argp1);
2523
+ result = (gearman_options_t)Gearman_options(arg1);
2524
+ vresult = SWIG_From_int((int)(result));
2525
+ return vresult;
2526
+ fail:
2527
+ return Qnil;
2528
+ }
2529
+
2530
+
2531
+ SWIGINTERN VALUE
2532
+ _wrap_Gearman_set_options(int argc, VALUE *argv, VALUE self) {
2533
+ Gearman *arg1 = (Gearman *) 0 ;
2534
+ gearman_options_t arg2 ;
2535
+ void *argp1 = 0 ;
2536
+ int res1 = 0 ;
2537
+ int val2 ;
2538
+ int ecode2 = 0 ;
2539
+
2540
+ if ((argc < 1) || (argc > 1)) {
2541
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2542
+ }
2543
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_st, 0 | 0 );
2544
+ if (!SWIG_IsOK(res1)) {
2545
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gearman *","setOptions", 1, self ));
2546
+ }
2547
+ arg1 = (Gearman *)(argp1);
2548
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2549
+ if (!SWIG_IsOK(ecode2)) {
2550
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "gearman_options_t","setOptions", 2, argv[0] ));
2551
+ }
2552
+ arg2 = (gearman_options_t)(val2);
2553
+ Gearman_setOptions(arg1,arg2);
2554
+ return Qnil;
2555
+ fail:
2556
+ return Qnil;
2557
+ }
2558
+
2559
+
2560
+ SWIGINTERN VALUE
2561
+ _wrap_Gearman_add_options(int argc, VALUE *argv, VALUE self) {
2562
+ Gearman *arg1 = (Gearman *) 0 ;
2563
+ gearman_options_t arg2 ;
2564
+ void *argp1 = 0 ;
2565
+ int res1 = 0 ;
2566
+ int val2 ;
2567
+ int ecode2 = 0 ;
2568
+
2569
+ if ((argc < 1) || (argc > 1)) {
2570
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2571
+ }
2572
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_st, 0 | 0 );
2573
+ if (!SWIG_IsOK(res1)) {
2574
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gearman *","addOptions", 1, self ));
2575
+ }
2576
+ arg1 = (Gearman *)(argp1);
2577
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2578
+ if (!SWIG_IsOK(ecode2)) {
2579
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "gearman_options_t","addOptions", 2, argv[0] ));
2580
+ }
2581
+ arg2 = (gearman_options_t)(val2);
2582
+ Gearman_addOptions(arg1,arg2);
2583
+ return Qnil;
2584
+ fail:
2585
+ return Qnil;
2586
+ }
2587
+
2588
+
2589
+ SWIGINTERN VALUE
2590
+ _wrap_Gearman_remove_options(int argc, VALUE *argv, VALUE self) {
2591
+ Gearman *arg1 = (Gearman *) 0 ;
2592
+ gearman_options_t arg2 ;
2593
+ void *argp1 = 0 ;
2594
+ int res1 = 0 ;
2595
+ int val2 ;
2596
+ int ecode2 = 0 ;
2597
+
2598
+ if ((argc < 1) || (argc > 1)) {
2599
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2600
+ }
2601
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_st, 0 | 0 );
2602
+ if (!SWIG_IsOK(res1)) {
2603
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gearman *","removeOptions", 1, self ));
2604
+ }
2605
+ arg1 = (Gearman *)(argp1);
2606
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2607
+ if (!SWIG_IsOK(ecode2)) {
2608
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "gearman_options_t","removeOptions", 2, argv[0] ));
2609
+ }
2610
+ arg2 = (gearman_options_t)(val2);
2611
+ Gearman_removeOptions(arg1,arg2);
2612
+ return Qnil;
2613
+ fail:
2614
+ return Qnil;
2615
+ }
2616
+
2617
+
2618
+ SWIGINTERN VALUE
2619
+ _wrap_Gearman_timeout(int argc, VALUE *argv, VALUE self) {
2620
+ Gearman *arg1 = (Gearman *) 0 ;
2621
+ void *argp1 = 0 ;
2622
+ int res1 = 0 ;
2623
+ int result;
2624
+ VALUE vresult = Qnil;
2625
+
2626
+ if ((argc < 0) || (argc > 0)) {
2627
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2628
+ }
2629
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_st, 0 | 0 );
2630
+ if (!SWIG_IsOK(res1)) {
2631
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gearman *","timeout", 1, self ));
2632
+ }
2633
+ arg1 = (Gearman *)(argp1);
2634
+ result = (int)Gearman_timeout(arg1);
2635
+ vresult = SWIG_From_int((int)(result));
2636
+ return vresult;
2637
+ fail:
2638
+ return Qnil;
2639
+ }
2640
+
2641
+
2642
+ SWIGINTERN VALUE
2643
+ _wrap_Gearman_set_timeout(int argc, VALUE *argv, VALUE self) {
2644
+ Gearman *arg1 = (Gearman *) 0 ;
2645
+ int arg2 ;
2646
+ void *argp1 = 0 ;
2647
+ int res1 = 0 ;
2648
+ int val2 ;
2649
+ int ecode2 = 0 ;
2650
+
2651
+ if ((argc < 1) || (argc > 1)) {
2652
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2653
+ }
2654
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_st, 0 | 0 );
2655
+ if (!SWIG_IsOK(res1)) {
2656
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gearman *","setTimeout", 1, self ));
2657
+ }
2658
+ arg1 = (Gearman *)(argp1);
2659
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2660
+ if (!SWIG_IsOK(ecode2)) {
2661
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","setTimeout", 2, argv[0] ));
2662
+ }
2663
+ arg2 = (int)(val2);
2664
+ Gearman_setTimeout(arg1,arg2);
2665
+ return Qnil;
2666
+ fail:
2667
+ return Qnil;
2668
+ }
2669
+
2670
+
2671
+ swig_class SwigClassClient;
2672
+
2673
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2674
+ SWIGINTERN VALUE
2675
+ _wrap_Client_allocate(VALUE self) {
2676
+ #else
2677
+ SWIGINTERN VALUE
2678
+ _wrap_Client_allocate(int argc, VALUE *argv, VALUE self) {
2679
+ #endif
2680
+
2681
+
2682
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_gearman_client_st);
2683
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2684
+ rb_obj_call_init(vresult, argc, argv);
2685
+ #endif
2686
+ return vresult;
2687
+ }
2688
+
2689
+
2690
+ SWIGINTERN VALUE
2691
+ _wrap_new_Client(int argc, VALUE *argv, VALUE self) {
2692
+ Client *result = 0 ;
2693
+
2694
+ if ((argc < 0) || (argc > 0)) {
2695
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2696
+ }
2697
+ result = (Client *)new_Client();
2698
+ DATA_PTR(self) = result;
2699
+ return self;
2700
+ fail:
2701
+ return Qnil;
2702
+ }
2703
+
2704
+
2705
+ SWIGINTERN void delete_Client(Client *self){
2706
+ gearman_client_free(self);
2707
+ }
2708
+ SWIGINTERN void
2709
+ free_Client(Client *arg1) {
2710
+ delete_Client(arg1);
2711
+ }
2712
+
2713
+ SWIGINTERN VALUE
2714
+ _wrap_Client_copy(int argc, VALUE *argv, VALUE self) {
2715
+ Client *arg1 = (Client *) 0 ;
2716
+ void *argp1 = 0 ;
2717
+ int res1 = 0 ;
2718
+ Client *result = 0 ;
2719
+ VALUE vresult = Qnil;
2720
+
2721
+ if ((argc < 0) || (argc > 0)) {
2722
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2723
+ }
2724
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_client_st, 0 | 0 );
2725
+ if (!SWIG_IsOK(res1)) {
2726
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Client *","copy", 1, self ));
2727
+ }
2728
+ arg1 = (Client *)(argp1);
2729
+ result = (Client *)Client_copy(arg1);
2730
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_gearman_client_st, 0 | 0 );
2731
+ return vresult;
2732
+ fail:
2733
+ return Qnil;
2734
+ }
2735
+
2736
+
2737
+ SWIGINTERN VALUE
2738
+ _wrap_Client_error(int argc, VALUE *argv, VALUE self) {
2739
+ Client *arg1 = (Client *) 0 ;
2740
+ void *argp1 = 0 ;
2741
+ int res1 = 0 ;
2742
+ char *result = 0 ;
2743
+ VALUE vresult = Qnil;
2744
+
2745
+ if ((argc < 0) || (argc > 0)) {
2746
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2747
+ }
2748
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_client_st, 0 | 0 );
2749
+ if (!SWIG_IsOK(res1)) {
2750
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Client *","error", 1, self ));
2751
+ }
2752
+ arg1 = (Client *)(argp1);
2753
+ result = (char *)Client_error(arg1);
2754
+ vresult = SWIG_FromCharPtr((const char *)result);
2755
+ return vresult;
2756
+ fail:
2757
+ return Qnil;
2758
+ }
2759
+
2760
+
2761
+ SWIGINTERN VALUE
2762
+ _wrap_Client_errno(int argc, VALUE *argv, VALUE self) {
2763
+ Client *arg1 = (Client *) 0 ;
2764
+ void *argp1 = 0 ;
2765
+ int res1 = 0 ;
2766
+ int result;
2767
+ VALUE vresult = Qnil;
2768
+
2769
+ if ((argc < 0) || (argc > 0)) {
2770
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2771
+ }
2772
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_client_st, 0 | 0 );
2773
+ if (!SWIG_IsOK(res1)) {
2774
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Client *","errno", 1, self ));
2775
+ }
2776
+ arg1 = (Client *)(argp1);
2777
+ result = (int)Client_errno(arg1);
2778
+ vresult = SWIG_From_int((int)(result));
2779
+ return vresult;
2780
+ fail:
2781
+ return Qnil;
2782
+ }
2783
+
2784
+
2785
+ SWIGINTERN VALUE
2786
+ _wrap_Client_options(int argc, VALUE *argv, VALUE self) {
2787
+ Client *arg1 = (Client *) 0 ;
2788
+ void *argp1 = 0 ;
2789
+ int res1 = 0 ;
2790
+ gearman_client_options_t result;
2791
+ VALUE vresult = Qnil;
2792
+
2793
+ if ((argc < 0) || (argc > 0)) {
2794
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2795
+ }
2796
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_client_st, 0 | 0 );
2797
+ if (!SWIG_IsOK(res1)) {
2798
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Client *","options", 1, self ));
2799
+ }
2800
+ arg1 = (Client *)(argp1);
2801
+ result = (gearman_client_options_t)Client_options(arg1);
2802
+ vresult = SWIG_From_int((int)(result));
2803
+ return vresult;
2804
+ fail:
2805
+ return Qnil;
2806
+ }
2807
+
2808
+
2809
+ SWIGINTERN VALUE
2810
+ _wrap_Client_set_options(int argc, VALUE *argv, VALUE self) {
2811
+ Client *arg1 = (Client *) 0 ;
2812
+ gearman_client_options_t arg2 ;
2813
+ void *argp1 = 0 ;
2814
+ int res1 = 0 ;
2815
+ int val2 ;
2816
+ int ecode2 = 0 ;
2817
+
2818
+ if ((argc < 1) || (argc > 1)) {
2819
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2820
+ }
2821
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_client_st, 0 | 0 );
2822
+ if (!SWIG_IsOK(res1)) {
2823
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Client *","setOptions", 1, self ));
2824
+ }
2825
+ arg1 = (Client *)(argp1);
2826
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2827
+ if (!SWIG_IsOK(ecode2)) {
2828
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "gearman_client_options_t","setOptions", 2, argv[0] ));
2829
+ }
2830
+ arg2 = (gearman_client_options_t)(val2);
2831
+ Client_setOptions(arg1,arg2);
2832
+ return Qnil;
2833
+ fail:
2834
+ return Qnil;
2835
+ }
2836
+
2837
+
2838
+ SWIGINTERN VALUE
2839
+ _wrap_Client_add_options(int argc, VALUE *argv, VALUE self) {
2840
+ Client *arg1 = (Client *) 0 ;
2841
+ gearman_client_options_t arg2 ;
2842
+ void *argp1 = 0 ;
2843
+ int res1 = 0 ;
2844
+ int val2 ;
2845
+ int ecode2 = 0 ;
2846
+
2847
+ if ((argc < 1) || (argc > 1)) {
2848
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2849
+ }
2850
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_client_st, 0 | 0 );
2851
+ if (!SWIG_IsOK(res1)) {
2852
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Client *","addOptions", 1, self ));
2853
+ }
2854
+ arg1 = (Client *)(argp1);
2855
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2856
+ if (!SWIG_IsOK(ecode2)) {
2857
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "gearman_client_options_t","addOptions", 2, argv[0] ));
2858
+ }
2859
+ arg2 = (gearman_client_options_t)(val2);
2860
+ Client_addOptions(arg1,arg2);
2861
+ return Qnil;
2862
+ fail:
2863
+ return Qnil;
2864
+ }
2865
+
2866
+
2867
+ SWIGINTERN VALUE
2868
+ _wrap_Client_remove_options(int argc, VALUE *argv, VALUE self) {
2869
+ Client *arg1 = (Client *) 0 ;
2870
+ gearman_client_options_t arg2 ;
2871
+ void *argp1 = 0 ;
2872
+ int res1 = 0 ;
2873
+ int val2 ;
2874
+ int ecode2 = 0 ;
2875
+
2876
+ if ((argc < 1) || (argc > 1)) {
2877
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2878
+ }
2879
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_client_st, 0 | 0 );
2880
+ if (!SWIG_IsOK(res1)) {
2881
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Client *","removeOptions", 1, self ));
2882
+ }
2883
+ arg1 = (Client *)(argp1);
2884
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2885
+ if (!SWIG_IsOK(ecode2)) {
2886
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "gearman_client_options_t","removeOptions", 2, argv[0] ));
2887
+ }
2888
+ arg2 = (gearman_client_options_t)(val2);
2889
+ Client_removeOptions(arg1,arg2);
2890
+ return Qnil;
2891
+ fail:
2892
+ return Qnil;
2893
+ }
2894
+
2895
+
2896
+ SWIGINTERN VALUE
2897
+ _wrap_Client_add_server__SWIG_0(int argc, VALUE *argv, VALUE self) {
2898
+ Client *arg1 = (Client *) 0 ;
2899
+ char *arg2 = (char *) 0 ;
2900
+ in_port_t arg3 ;
2901
+ void *argp1 = 0 ;
2902
+ int res1 = 0 ;
2903
+ int res2 ;
2904
+ char *buf2 = 0 ;
2905
+ int alloc2 = 0 ;
2906
+ unsigned int val3 ;
2907
+ int ecode3 = 0 ;
2908
+ gearman_return_t result;
2909
+ VALUE vresult = Qnil;
2910
+
2911
+ if ((argc < 2) || (argc > 2)) {
2912
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2913
+ }
2914
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_client_st, 0 | 0 );
2915
+ if (!SWIG_IsOK(res1)) {
2916
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Client *","addServer", 1, self ));
2917
+ }
2918
+ arg1 = (Client *)(argp1);
2919
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
2920
+ if (!SWIG_IsOK(res2)) {
2921
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addServer", 2, argv[0] ));
2922
+ }
2923
+ arg2 = (char *)(buf2);
2924
+ ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
2925
+ if (!SWIG_IsOK(ecode3)) {
2926
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "in_port_t","addServer", 3, argv[1] ));
2927
+ }
2928
+ arg3 = (in_port_t)(val3);
2929
+ result = (gearman_return_t)Client_addServer__SWIG_0(arg1,(char const *)arg2,arg3);
2930
+ vresult = SWIG_From_int((int)(result));
2931
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2932
+ return vresult;
2933
+ fail:
2934
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2935
+ return Qnil;
2936
+ }
2937
+
2938
+
2939
+ SWIGINTERN VALUE
2940
+ _wrap_Client_add_server__SWIG_1(int argc, VALUE *argv, VALUE self) {
2941
+ Client *arg1 = (Client *) 0 ;
2942
+ char *arg2 = (char *) 0 ;
2943
+ void *argp1 = 0 ;
2944
+ int res1 = 0 ;
2945
+ int res2 ;
2946
+ char *buf2 = 0 ;
2947
+ int alloc2 = 0 ;
2948
+ gearman_return_t result;
2949
+ VALUE vresult = Qnil;
2950
+
2951
+ if ((argc < 1) || (argc > 1)) {
2952
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2953
+ }
2954
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_client_st, 0 | 0 );
2955
+ if (!SWIG_IsOK(res1)) {
2956
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Client *","addServer", 1, self ));
2957
+ }
2958
+ arg1 = (Client *)(argp1);
2959
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
2960
+ if (!SWIG_IsOK(res2)) {
2961
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addServer", 2, argv[0] ));
2962
+ }
2963
+ arg2 = (char *)(buf2);
2964
+ result = (gearman_return_t)Client_addServer__SWIG_1(arg1,(char const *)arg2);
2965
+ vresult = SWIG_From_int((int)(result));
2966
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2967
+ return vresult;
2968
+ fail:
2969
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2970
+ return Qnil;
2971
+ }
2972
+
2973
+
2974
+ SWIGINTERN VALUE
2975
+ _wrap_Client_add_server__SWIG_2(int argc, VALUE *argv, VALUE self) {
2976
+ Client *arg1 = (Client *) 0 ;
2977
+ void *argp1 = 0 ;
2978
+ int res1 = 0 ;
2979
+ gearman_return_t result;
2980
+ VALUE vresult = Qnil;
2981
+
2982
+ if ((argc < 0) || (argc > 0)) {
2983
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2984
+ }
2985
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_client_st, 0 | 0 );
2986
+ if (!SWIG_IsOK(res1)) {
2987
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Client *","addServer", 1, self ));
2988
+ }
2989
+ arg1 = (Client *)(argp1);
2990
+ result = (gearman_return_t)Client_addServer__SWIG_2(arg1);
2991
+ vresult = SWIG_From_int((int)(result));
2992
+ return vresult;
2993
+ fail:
2994
+ return Qnil;
2995
+ }
2996
+
2997
+
2998
+ SWIGINTERN VALUE _wrap_Client_add_server(int nargs, VALUE *args, VALUE self) {
2999
+ int argc;
3000
+ VALUE argv[4];
3001
+ int ii;
3002
+
3003
+ argc = nargs + 1;
3004
+ argv[0] = self;
3005
+ if (argc > 4) SWIG_fail;
3006
+ for (ii = 1; (ii < argc); ++ii) {
3007
+ argv[ii] = args[ii-1];
3008
+ }
3009
+ if (argc == 1) {
3010
+ int _v;
3011
+ void *vptr = 0;
3012
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_gearman_client_st, 0);
3013
+ _v = SWIG_CheckState(res);
3014
+ if (_v) {
3015
+ return _wrap_Client_add_server__SWIG_2(nargs, args, self);
3016
+ }
3017
+ }
3018
+ if (argc == 2) {
3019
+ int _v;
3020
+ void *vptr = 0;
3021
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_gearman_client_st, 0);
3022
+ _v = SWIG_CheckState(res);
3023
+ if (_v) {
3024
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
3025
+ _v = SWIG_CheckState(res);
3026
+ if (_v) {
3027
+ return _wrap_Client_add_server__SWIG_1(nargs, args, self);
3028
+ }
3029
+ }
3030
+ }
3031
+ if (argc == 3) {
3032
+ int _v;
3033
+ void *vptr = 0;
3034
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_gearman_client_st, 0);
3035
+ _v = SWIG_CheckState(res);
3036
+ if (_v) {
3037
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
3038
+ _v = SWIG_CheckState(res);
3039
+ if (_v) {
3040
+ {
3041
+ int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
3042
+ _v = SWIG_CheckState(res);
3043
+ }
3044
+ if (_v) {
3045
+ return _wrap_Client_add_server__SWIG_0(nargs, args, self);
3046
+ }
3047
+ }
3048
+ }
3049
+ }
3050
+
3051
+ fail:
3052
+ Ruby_Format_OverloadedError( argc, 4, "add_server",
3053
+ " gearman_return_t add_server(char const *host, in_port_t port)\n"
3054
+ " gearman_return_t add_server(char const *host)\n"
3055
+ " gearman_return_t add_server()\n");
3056
+
3057
+ return Qnil;
3058
+ }
3059
+
3060
+
3061
+ SWIGINTERN VALUE
3062
+ _wrap_Client_add_servers(int argc, VALUE *argv, VALUE self) {
3063
+ Client *arg1 = (Client *) 0 ;
3064
+ char *arg2 = (char *) 0 ;
3065
+ void *argp1 = 0 ;
3066
+ int res1 = 0 ;
3067
+ int res2 ;
3068
+ char *buf2 = 0 ;
3069
+ int alloc2 = 0 ;
3070
+ gearman_return_t result;
3071
+ VALUE vresult = Qnil;
3072
+
3073
+ if ((argc < 1) || (argc > 1)) {
3074
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3075
+ }
3076
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_client_st, 0 | 0 );
3077
+ if (!SWIG_IsOK(res1)) {
3078
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Client *","addServers", 1, self ));
3079
+ }
3080
+ arg1 = (Client *)(argp1);
3081
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
3082
+ if (!SWIG_IsOK(res2)) {
3083
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addServers", 2, argv[0] ));
3084
+ }
3085
+ arg2 = (char *)(buf2);
3086
+ result = (gearman_return_t)Client_addServers(arg1,(char const *)arg2);
3087
+ vresult = SWIG_From_int((int)(result));
3088
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3089
+ return vresult;
3090
+ fail:
3091
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3092
+ return Qnil;
3093
+ }
3094
+
3095
+
3096
+ SWIGINTERN VALUE
3097
+ _wrap_Client_remove_servers(int argc, VALUE *argv, VALUE self) {
3098
+ Client *arg1 = (Client *) 0 ;
3099
+ void *argp1 = 0 ;
3100
+ int res1 = 0 ;
3101
+
3102
+ if ((argc < 0) || (argc > 0)) {
3103
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3104
+ }
3105
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_client_st, 0 | 0 );
3106
+ if (!SWIG_IsOK(res1)) {
3107
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Client *","removeServers", 1, self ));
3108
+ }
3109
+ arg1 = (Client *)(argp1);
3110
+ Client_removeServers(arg1);
3111
+ return Qnil;
3112
+ fail:
3113
+ return Qnil;
3114
+ }
3115
+
3116
+
3117
+ SWIGINTERN VALUE
3118
+ _wrap_Client_do(int argc, VALUE *argv, VALUE self) {
3119
+ Client *arg1 = (Client *) 0 ;
3120
+ char *arg2 = (char *) 0 ;
3121
+ void *arg3 = (void *) 0 ;
3122
+ size_t arg4 ;
3123
+ char **arg5 = (char **) 0 ;
3124
+ size_t *arg6 = (size_t *) 0 ;
3125
+ char *arg7 = (char *) NULL ;
3126
+ void *argp1 = 0 ;
3127
+ int res1 = 0 ;
3128
+ int res2 ;
3129
+ char *buf2 = 0 ;
3130
+ int alloc2 = 0 ;
3131
+ char *tmp_ret_val5 ;
3132
+ size_t tmp_ret_size5 ;
3133
+ int res7 ;
3134
+ char *buf7 = 0 ;
3135
+ int alloc7 = 0 ;
3136
+ gearman_return_t result;
3137
+ VALUE vresult = Qnil;
3138
+
3139
+
3140
+ tmp_ret_val5= NULL;
3141
+ tmp_ret_size5= 0;
3142
+ arg5= &tmp_ret_val5;
3143
+ arg6= &tmp_ret_size5;
3144
+
3145
+ if ((argc < 2) || (argc > 3)) {
3146
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3147
+ }
3148
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_client_st, 0 | 0 );
3149
+ if (!SWIG_IsOK(res1)) {
3150
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Client *","do", 1, self ));
3151
+ }
3152
+ arg1 = (Client *)(argp1);
3153
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
3154
+ if (!SWIG_IsOK(res2)) {
3155
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","do", 2, argv[0] ));
3156
+ }
3157
+ arg2 = (char *)(buf2);
3158
+ {
3159
+ arg3 = STR2CSTR(argv[1]);
3160
+ arg4 = (size_t)RSTRING(argv[1])->len;
3161
+ }
3162
+ if (argc > 2) {
3163
+ res7 = SWIG_AsCharPtrAndSize(argv[2], &buf7, NULL, &alloc7);
3164
+ if (!SWIG_IsOK(res7)) {
3165
+ SWIG_exception_fail(SWIG_ArgError(res7), Ruby_Format_TypeError( "", "char const *","do", 7, argv[2] ));
3166
+ }
3167
+ arg7 = (char *)(buf7);
3168
+ }
3169
+ result = (gearman_return_t)Client_do(arg1,(char const *)arg2,(void const *)arg3,arg4,arg5,arg6,(char const *)arg7);
3170
+ vresult = SWIG_From_int((int)(result));
3171
+ {
3172
+ vresult = output_helper(vresult, SWIG_FromCharPtrAndSize(*arg5, *arg6));
3173
+ }
3174
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3175
+ if (alloc7 == SWIG_NEWOBJ) free((char*)buf7);
3176
+ return vresult;
3177
+ fail:
3178
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3179
+ if (alloc7 == SWIG_NEWOBJ) free((char*)buf7);
3180
+ return Qnil;
3181
+ }
3182
+
3183
+
3184
+ SWIGINTERN VALUE
3185
+ _wrap_Client_do_high(int argc, VALUE *argv, VALUE self) {
3186
+ Client *arg1 = (Client *) 0 ;
3187
+ char *arg2 = (char *) 0 ;
3188
+ void *arg3 = (void *) 0 ;
3189
+ size_t arg4 ;
3190
+ char **arg5 = (char **) 0 ;
3191
+ size_t *arg6 = (size_t *) 0 ;
3192
+ char *arg7 = (char *) NULL ;
3193
+ void *argp1 = 0 ;
3194
+ int res1 = 0 ;
3195
+ int res2 ;
3196
+ char *buf2 = 0 ;
3197
+ int alloc2 = 0 ;
3198
+ char *tmp_ret_val5 ;
3199
+ size_t tmp_ret_size5 ;
3200
+ int res7 ;
3201
+ char *buf7 = 0 ;
3202
+ int alloc7 = 0 ;
3203
+ gearman_return_t result;
3204
+ VALUE vresult = Qnil;
3205
+
3206
+
3207
+ tmp_ret_val5= NULL;
3208
+ tmp_ret_size5= 0;
3209
+ arg5= &tmp_ret_val5;
3210
+ arg6= &tmp_ret_size5;
3211
+
3212
+ if ((argc < 2) || (argc > 3)) {
3213
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3214
+ }
3215
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_client_st, 0 | 0 );
3216
+ if (!SWIG_IsOK(res1)) {
3217
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Client *","doHigh", 1, self ));
3218
+ }
3219
+ arg1 = (Client *)(argp1);
3220
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
3221
+ if (!SWIG_IsOK(res2)) {
3222
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","doHigh", 2, argv[0] ));
3223
+ }
3224
+ arg2 = (char *)(buf2);
3225
+ {
3226
+ arg3 = STR2CSTR(argv[1]);
3227
+ arg4 = (size_t)RSTRING(argv[1])->len;
3228
+ }
3229
+ if (argc > 2) {
3230
+ res7 = SWIG_AsCharPtrAndSize(argv[2], &buf7, NULL, &alloc7);
3231
+ if (!SWIG_IsOK(res7)) {
3232
+ SWIG_exception_fail(SWIG_ArgError(res7), Ruby_Format_TypeError( "", "char const *","doHigh", 7, argv[2] ));
3233
+ }
3234
+ arg7 = (char *)(buf7);
3235
+ }
3236
+ result = (gearman_return_t)Client_doHigh(arg1,(char const *)arg2,(void const *)arg3,arg4,arg5,arg6,(char const *)arg7);
3237
+ vresult = SWIG_From_int((int)(result));
3238
+ {
3239
+ vresult = output_helper(vresult, SWIG_FromCharPtrAndSize(*arg5, *arg6));
3240
+ }
3241
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3242
+ if (alloc7 == SWIG_NEWOBJ) free((char*)buf7);
3243
+ return vresult;
3244
+ fail:
3245
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3246
+ if (alloc7 == SWIG_NEWOBJ) free((char*)buf7);
3247
+ return Qnil;
3248
+ }
3249
+
3250
+
3251
+ SWIGINTERN VALUE
3252
+ _wrap_Client_do_low(int argc, VALUE *argv, VALUE self) {
3253
+ Client *arg1 = (Client *) 0 ;
3254
+ char *arg2 = (char *) 0 ;
3255
+ void *arg3 = (void *) 0 ;
3256
+ size_t arg4 ;
3257
+ char **arg5 = (char **) 0 ;
3258
+ size_t *arg6 = (size_t *) 0 ;
3259
+ char *arg7 = (char *) NULL ;
3260
+ void *argp1 = 0 ;
3261
+ int res1 = 0 ;
3262
+ int res2 ;
3263
+ char *buf2 = 0 ;
3264
+ int alloc2 = 0 ;
3265
+ char *tmp_ret_val5 ;
3266
+ size_t tmp_ret_size5 ;
3267
+ int res7 ;
3268
+ char *buf7 = 0 ;
3269
+ int alloc7 = 0 ;
3270
+ gearman_return_t result;
3271
+ VALUE vresult = Qnil;
3272
+
3273
+
3274
+ tmp_ret_val5= NULL;
3275
+ tmp_ret_size5= 0;
3276
+ arg5= &tmp_ret_val5;
3277
+ arg6= &tmp_ret_size5;
3278
+
3279
+ if ((argc < 2) || (argc > 3)) {
3280
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3281
+ }
3282
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_client_st, 0 | 0 );
3283
+ if (!SWIG_IsOK(res1)) {
3284
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Client *","doLow", 1, self ));
3285
+ }
3286
+ arg1 = (Client *)(argp1);
3287
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
3288
+ if (!SWIG_IsOK(res2)) {
3289
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","doLow", 2, argv[0] ));
3290
+ }
3291
+ arg2 = (char *)(buf2);
3292
+ {
3293
+ arg3 = STR2CSTR(argv[1]);
3294
+ arg4 = (size_t)RSTRING(argv[1])->len;
3295
+ }
3296
+ if (argc > 2) {
3297
+ res7 = SWIG_AsCharPtrAndSize(argv[2], &buf7, NULL, &alloc7);
3298
+ if (!SWIG_IsOK(res7)) {
3299
+ SWIG_exception_fail(SWIG_ArgError(res7), Ruby_Format_TypeError( "", "char const *","doLow", 7, argv[2] ));
3300
+ }
3301
+ arg7 = (char *)(buf7);
3302
+ }
3303
+ result = (gearman_return_t)Client_doLow(arg1,(char const *)arg2,(void const *)arg3,arg4,arg5,arg6,(char const *)arg7);
3304
+ vresult = SWIG_From_int((int)(result));
3305
+ {
3306
+ vresult = output_helper(vresult, SWIG_FromCharPtrAndSize(*arg5, *arg6));
3307
+ }
3308
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3309
+ if (alloc7 == SWIG_NEWOBJ) free((char*)buf7);
3310
+ return vresult;
3311
+ fail:
3312
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3313
+ if (alloc7 == SWIG_NEWOBJ) free((char*)buf7);
3314
+ return Qnil;
3315
+ }
3316
+
3317
+
3318
+ SWIGINTERN VALUE
3319
+ _wrap_Client_job_handle(int argc, VALUE *argv, VALUE self) {
3320
+ Client *arg1 = (Client *) 0 ;
3321
+ void *argp1 = 0 ;
3322
+ int res1 = 0 ;
3323
+ char *result = 0 ;
3324
+ VALUE vresult = Qnil;
3325
+
3326
+ if ((argc < 0) || (argc > 0)) {
3327
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3328
+ }
3329
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_client_st, 0 | 0 );
3330
+ if (!SWIG_IsOK(res1)) {
3331
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Client *","jobHandle", 1, self ));
3332
+ }
3333
+ arg1 = (Client *)(argp1);
3334
+ result = (char *)Client_jobHandle(arg1);
3335
+ vresult = SWIG_FromCharPtr((const char *)result);
3336
+ return vresult;
3337
+ fail:
3338
+ return Qnil;
3339
+ }
3340
+
3341
+
3342
+ SWIGINTERN VALUE
3343
+ _wrap_Client_status(int argc, VALUE *argv, VALUE self) {
3344
+ Client *arg1 = (Client *) 0 ;
3345
+ uint32_t *arg2 = (uint32_t *) 0 ;
3346
+ uint32_t *arg3 = (uint32_t *) 0 ;
3347
+ void *argp1 = 0 ;
3348
+ int res1 = 0 ;
3349
+ void *argp2 = 0 ;
3350
+ int res2 = 0 ;
3351
+ void *argp3 = 0 ;
3352
+ int res3 = 0 ;
3353
+
3354
+ if ((argc < 2) || (argc > 2)) {
3355
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3356
+ }
3357
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_client_st, 0 | 0 );
3358
+ if (!SWIG_IsOK(res1)) {
3359
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Client *","status", 1, self ));
3360
+ }
3361
+ arg1 = (Client *)(argp1);
3362
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_unsigned_int, 0 | 0 );
3363
+ if (!SWIG_IsOK(res2)) {
3364
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "uint32_t *","status", 2, argv[0] ));
3365
+ }
3366
+ arg2 = (uint32_t *)(argp2);
3367
+ res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_unsigned_int, 0 | 0 );
3368
+ if (!SWIG_IsOK(res3)) {
3369
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "uint32_t *","status", 3, argv[1] ));
3370
+ }
3371
+ arg3 = (uint32_t *)(argp3);
3372
+ Client_status(arg1,arg2,arg3);
3373
+ return Qnil;
3374
+ fail:
3375
+ return Qnil;
3376
+ }
3377
+
3378
+
3379
+ swig_class SwigClassWorker;
3380
+
3381
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
3382
+ SWIGINTERN VALUE
3383
+ _wrap_Worker_allocate(VALUE self) {
3384
+ #else
3385
+ SWIGINTERN VALUE
3386
+ _wrap_Worker_allocate(int argc, VALUE *argv, VALUE self) {
3387
+ #endif
3388
+
3389
+
3390
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_gearman_worker_st);
3391
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
3392
+ rb_obj_call_init(vresult, argc, argv);
3393
+ #endif
3394
+ return vresult;
3395
+ }
3396
+
3397
+
3398
+ SWIGINTERN VALUE
3399
+ _wrap_new_Worker(int argc, VALUE *argv, VALUE self) {
3400
+ Worker *result = 0 ;
3401
+
3402
+ if ((argc < 0) || (argc > 0)) {
3403
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3404
+ }
3405
+ result = (Worker *)new_Worker();
3406
+ DATA_PTR(self) = result;
3407
+ return self;
3408
+ fail:
3409
+ return Qnil;
3410
+ }
3411
+
3412
+
3413
+ SWIGINTERN void delete_Worker(Worker *self){
3414
+ gearman_worker_free(self);
3415
+ }
3416
+ SWIGINTERN void
3417
+ free_Worker(Worker *arg1) {
3418
+ delete_Worker(arg1);
3419
+ }
3420
+
3421
+ SWIGINTERN VALUE
3422
+ _wrap_Worker_copy(int argc, VALUE *argv, VALUE self) {
3423
+ Worker *arg1 = (Worker *) 0 ;
3424
+ void *argp1 = 0 ;
3425
+ int res1 = 0 ;
3426
+ Worker *result = 0 ;
3427
+ VALUE vresult = Qnil;
3428
+
3429
+ if ((argc < 0) || (argc > 0)) {
3430
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3431
+ }
3432
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
3433
+ if (!SWIG_IsOK(res1)) {
3434
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","copy", 1, self ));
3435
+ }
3436
+ arg1 = (Worker *)(argp1);
3437
+ result = (Worker *)Worker_copy(arg1);
3438
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_gearman_worker_st, 0 | 0 );
3439
+ return vresult;
3440
+ fail:
3441
+ return Qnil;
3442
+ }
3443
+
3444
+
3445
+ SWIGINTERN VALUE
3446
+ _wrap_Worker_error(int argc, VALUE *argv, VALUE self) {
3447
+ Worker *arg1 = (Worker *) 0 ;
3448
+ void *argp1 = 0 ;
3449
+ int res1 = 0 ;
3450
+ char *result = 0 ;
3451
+ VALUE vresult = Qnil;
3452
+
3453
+ if ((argc < 0) || (argc > 0)) {
3454
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3455
+ }
3456
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
3457
+ if (!SWIG_IsOK(res1)) {
3458
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","error", 1, self ));
3459
+ }
3460
+ arg1 = (Worker *)(argp1);
3461
+ result = (char *)Worker_error(arg1);
3462
+ vresult = SWIG_FromCharPtr((const char *)result);
3463
+ return vresult;
3464
+ fail:
3465
+ return Qnil;
3466
+ }
3467
+
3468
+
3469
+ SWIGINTERN VALUE
3470
+ _wrap_Worker_errno(int argc, VALUE *argv, VALUE self) {
3471
+ Worker *arg1 = (Worker *) 0 ;
3472
+ void *argp1 = 0 ;
3473
+ int res1 = 0 ;
3474
+ int result;
3475
+ VALUE vresult = Qnil;
3476
+
3477
+ if ((argc < 0) || (argc > 0)) {
3478
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3479
+ }
3480
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
3481
+ if (!SWIG_IsOK(res1)) {
3482
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","errno", 1, self ));
3483
+ }
3484
+ arg1 = (Worker *)(argp1);
3485
+ result = (int)Worker_errno(arg1);
3486
+ vresult = SWIG_From_int((int)(result));
3487
+ return vresult;
3488
+ fail:
3489
+ return Qnil;
3490
+ }
3491
+
3492
+
3493
+ SWIGINTERN VALUE
3494
+ _wrap_Worker_options(int argc, VALUE *argv, VALUE self) {
3495
+ Worker *arg1 = (Worker *) 0 ;
3496
+ void *argp1 = 0 ;
3497
+ int res1 = 0 ;
3498
+ gearman_worker_options_t result;
3499
+ VALUE vresult = Qnil;
3500
+
3501
+ if ((argc < 0) || (argc > 0)) {
3502
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3503
+ }
3504
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
3505
+ if (!SWIG_IsOK(res1)) {
3506
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","options", 1, self ));
3507
+ }
3508
+ arg1 = (Worker *)(argp1);
3509
+ result = (gearman_worker_options_t)Worker_options(arg1);
3510
+ vresult = SWIG_From_int((int)(result));
3511
+ return vresult;
3512
+ fail:
3513
+ return Qnil;
3514
+ }
3515
+
3516
+
3517
+ SWIGINTERN VALUE
3518
+ _wrap_Worker_set_options(int argc, VALUE *argv, VALUE self) {
3519
+ Worker *arg1 = (Worker *) 0 ;
3520
+ gearman_worker_options_t arg2 ;
3521
+ void *argp1 = 0 ;
3522
+ int res1 = 0 ;
3523
+ int val2 ;
3524
+ int ecode2 = 0 ;
3525
+
3526
+ if ((argc < 1) || (argc > 1)) {
3527
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3528
+ }
3529
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
3530
+ if (!SWIG_IsOK(res1)) {
3531
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","setOptions", 1, self ));
3532
+ }
3533
+ arg1 = (Worker *)(argp1);
3534
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3535
+ if (!SWIG_IsOK(ecode2)) {
3536
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "gearman_worker_options_t","setOptions", 2, argv[0] ));
3537
+ }
3538
+ arg2 = (gearman_worker_options_t)(val2);
3539
+ Worker_setOptions(arg1,arg2);
3540
+ return Qnil;
3541
+ fail:
3542
+ return Qnil;
3543
+ }
3544
+
3545
+
3546
+ SWIGINTERN VALUE
3547
+ _wrap_Worker_add_options(int argc, VALUE *argv, VALUE self) {
3548
+ Worker *arg1 = (Worker *) 0 ;
3549
+ gearman_worker_options_t arg2 ;
3550
+ void *argp1 = 0 ;
3551
+ int res1 = 0 ;
3552
+ int val2 ;
3553
+ int ecode2 = 0 ;
3554
+
3555
+ if ((argc < 1) || (argc > 1)) {
3556
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3557
+ }
3558
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
3559
+ if (!SWIG_IsOK(res1)) {
3560
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","addOptions", 1, self ));
3561
+ }
3562
+ arg1 = (Worker *)(argp1);
3563
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3564
+ if (!SWIG_IsOK(ecode2)) {
3565
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "gearman_worker_options_t","addOptions", 2, argv[0] ));
3566
+ }
3567
+ arg2 = (gearman_worker_options_t)(val2);
3568
+ Worker_addOptions(arg1,arg2);
3569
+ return Qnil;
3570
+ fail:
3571
+ return Qnil;
3572
+ }
3573
+
3574
+
3575
+ SWIGINTERN VALUE
3576
+ _wrap_Worker_remove_options(int argc, VALUE *argv, VALUE self) {
3577
+ Worker *arg1 = (Worker *) 0 ;
3578
+ gearman_worker_options_t arg2 ;
3579
+ void *argp1 = 0 ;
3580
+ int res1 = 0 ;
3581
+ int val2 ;
3582
+ int ecode2 = 0 ;
3583
+
3584
+ if ((argc < 1) || (argc > 1)) {
3585
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3586
+ }
3587
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
3588
+ if (!SWIG_IsOK(res1)) {
3589
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","removeOptions", 1, self ));
3590
+ }
3591
+ arg1 = (Worker *)(argp1);
3592
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3593
+ if (!SWIG_IsOK(ecode2)) {
3594
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "gearman_worker_options_t","removeOptions", 2, argv[0] ));
3595
+ }
3596
+ arg2 = (gearman_worker_options_t)(val2);
3597
+ Worker_removeOptions(arg1,arg2);
3598
+ return Qnil;
3599
+ fail:
3600
+ return Qnil;
3601
+ }
3602
+
3603
+
3604
+ SWIGINTERN VALUE
3605
+ _wrap_Worker_timeout(int argc, VALUE *argv, VALUE self) {
3606
+ Worker *arg1 = (Worker *) 0 ;
3607
+ void *argp1 = 0 ;
3608
+ int res1 = 0 ;
3609
+ int result;
3610
+ VALUE vresult = Qnil;
3611
+
3612
+ if ((argc < 0) || (argc > 0)) {
3613
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3614
+ }
3615
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
3616
+ if (!SWIG_IsOK(res1)) {
3617
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","timeout", 1, self ));
3618
+ }
3619
+ arg1 = (Worker *)(argp1);
3620
+ result = (int)Worker_timeout(arg1);
3621
+ vresult = SWIG_From_int((int)(result));
3622
+ return vresult;
3623
+ fail:
3624
+ return Qnil;
3625
+ }
3626
+
3627
+
3628
+ SWIGINTERN VALUE
3629
+ _wrap_Worker_set_timeout(int argc, VALUE *argv, VALUE self) {
3630
+ Worker *arg1 = (Worker *) 0 ;
3631
+ int arg2 ;
3632
+ void *argp1 = 0 ;
3633
+ int res1 = 0 ;
3634
+ int val2 ;
3635
+ int ecode2 = 0 ;
3636
+
3637
+ if ((argc < 1) || (argc > 1)) {
3638
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3639
+ }
3640
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
3641
+ if (!SWIG_IsOK(res1)) {
3642
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","setTimeout", 1, self ));
3643
+ }
3644
+ arg1 = (Worker *)(argp1);
3645
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3646
+ if (!SWIG_IsOK(ecode2)) {
3647
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","setTimeout", 2, argv[0] ));
3648
+ }
3649
+ arg2 = (int)(val2);
3650
+ Worker_setTimeout(arg1,arg2);
3651
+ return Qnil;
3652
+ fail:
3653
+ return Qnil;
3654
+ }
3655
+
3656
+
3657
+ SWIGINTERN VALUE
3658
+ _wrap_Worker_add_server__SWIG_0(int argc, VALUE *argv, VALUE self) {
3659
+ Worker *arg1 = (Worker *) 0 ;
3660
+ char *arg2 = (char *) 0 ;
3661
+ in_port_t arg3 ;
3662
+ void *argp1 = 0 ;
3663
+ int res1 = 0 ;
3664
+ int res2 ;
3665
+ char *buf2 = 0 ;
3666
+ int alloc2 = 0 ;
3667
+ unsigned int val3 ;
3668
+ int ecode3 = 0 ;
3669
+ gearman_return_t result;
3670
+ VALUE vresult = Qnil;
3671
+
3672
+ if ((argc < 2) || (argc > 2)) {
3673
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3674
+ }
3675
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
3676
+ if (!SWIG_IsOK(res1)) {
3677
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","addServer", 1, self ));
3678
+ }
3679
+ arg1 = (Worker *)(argp1);
3680
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
3681
+ if (!SWIG_IsOK(res2)) {
3682
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addServer", 2, argv[0] ));
3683
+ }
3684
+ arg2 = (char *)(buf2);
3685
+ ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
3686
+ if (!SWIG_IsOK(ecode3)) {
3687
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "in_port_t","addServer", 3, argv[1] ));
3688
+ }
3689
+ arg3 = (in_port_t)(val3);
3690
+ result = (gearman_return_t)Worker_addServer__SWIG_0(arg1,(char const *)arg2,arg3);
3691
+ vresult = SWIG_From_int((int)(result));
3692
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3693
+ return vresult;
3694
+ fail:
3695
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3696
+ return Qnil;
3697
+ }
3698
+
3699
+
3700
+ SWIGINTERN VALUE
3701
+ _wrap_Worker_add_server__SWIG_1(int argc, VALUE *argv, VALUE self) {
3702
+ Worker *arg1 = (Worker *) 0 ;
3703
+ char *arg2 = (char *) 0 ;
3704
+ void *argp1 = 0 ;
3705
+ int res1 = 0 ;
3706
+ int res2 ;
3707
+ char *buf2 = 0 ;
3708
+ int alloc2 = 0 ;
3709
+ gearman_return_t result;
3710
+ VALUE vresult = Qnil;
3711
+
3712
+ if ((argc < 1) || (argc > 1)) {
3713
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3714
+ }
3715
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
3716
+ if (!SWIG_IsOK(res1)) {
3717
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","addServer", 1, self ));
3718
+ }
3719
+ arg1 = (Worker *)(argp1);
3720
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
3721
+ if (!SWIG_IsOK(res2)) {
3722
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addServer", 2, argv[0] ));
3723
+ }
3724
+ arg2 = (char *)(buf2);
3725
+ result = (gearman_return_t)Worker_addServer__SWIG_1(arg1,(char const *)arg2);
3726
+ vresult = SWIG_From_int((int)(result));
3727
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3728
+ return vresult;
3729
+ fail:
3730
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3731
+ return Qnil;
3732
+ }
3733
+
3734
+
3735
+ SWIGINTERN VALUE
3736
+ _wrap_Worker_add_server__SWIG_2(int argc, VALUE *argv, VALUE self) {
3737
+ Worker *arg1 = (Worker *) 0 ;
3738
+ void *argp1 = 0 ;
3739
+ int res1 = 0 ;
3740
+ gearman_return_t result;
3741
+ VALUE vresult = Qnil;
3742
+
3743
+ if ((argc < 0) || (argc > 0)) {
3744
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3745
+ }
3746
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
3747
+ if (!SWIG_IsOK(res1)) {
3748
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","addServer", 1, self ));
3749
+ }
3750
+ arg1 = (Worker *)(argp1);
3751
+ result = (gearman_return_t)Worker_addServer__SWIG_2(arg1);
3752
+ vresult = SWIG_From_int((int)(result));
3753
+ return vresult;
3754
+ fail:
3755
+ return Qnil;
3756
+ }
3757
+
3758
+
3759
+ SWIGINTERN VALUE _wrap_Worker_add_server(int nargs, VALUE *args, VALUE self) {
3760
+ int argc;
3761
+ VALUE argv[4];
3762
+ int ii;
3763
+
3764
+ argc = nargs + 1;
3765
+ argv[0] = self;
3766
+ if (argc > 4) SWIG_fail;
3767
+ for (ii = 1; (ii < argc); ++ii) {
3768
+ argv[ii] = args[ii-1];
3769
+ }
3770
+ if (argc == 1) {
3771
+ int _v;
3772
+ void *vptr = 0;
3773
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_gearman_worker_st, 0);
3774
+ _v = SWIG_CheckState(res);
3775
+ if (_v) {
3776
+ return _wrap_Worker_add_server__SWIG_2(nargs, args, self);
3777
+ }
3778
+ }
3779
+ if (argc == 2) {
3780
+ int _v;
3781
+ void *vptr = 0;
3782
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_gearman_worker_st, 0);
3783
+ _v = SWIG_CheckState(res);
3784
+ if (_v) {
3785
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
3786
+ _v = SWIG_CheckState(res);
3787
+ if (_v) {
3788
+ return _wrap_Worker_add_server__SWIG_1(nargs, args, self);
3789
+ }
3790
+ }
3791
+ }
3792
+ if (argc == 3) {
3793
+ int _v;
3794
+ void *vptr = 0;
3795
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_gearman_worker_st, 0);
3796
+ _v = SWIG_CheckState(res);
3797
+ if (_v) {
3798
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
3799
+ _v = SWIG_CheckState(res);
3800
+ if (_v) {
3801
+ {
3802
+ int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
3803
+ _v = SWIG_CheckState(res);
3804
+ }
3805
+ if (_v) {
3806
+ return _wrap_Worker_add_server__SWIG_0(nargs, args, self);
3807
+ }
3808
+ }
3809
+ }
3810
+ }
3811
+
3812
+ fail:
3813
+ Ruby_Format_OverloadedError( argc, 4, "add_server",
3814
+ " gearman_return_t add_server(char const *host, in_port_t port)\n"
3815
+ " gearman_return_t add_server(char const *host)\n"
3816
+ " gearman_return_t add_server()\n");
3817
+
3818
+ return Qnil;
3819
+ }
3820
+
3821
+
3822
+ SWIGINTERN VALUE
3823
+ _wrap_Worker_add_servers(int argc, VALUE *argv, VALUE self) {
3824
+ Worker *arg1 = (Worker *) 0 ;
3825
+ char *arg2 = (char *) 0 ;
3826
+ void *argp1 = 0 ;
3827
+ int res1 = 0 ;
3828
+ int res2 ;
3829
+ char *buf2 = 0 ;
3830
+ int alloc2 = 0 ;
3831
+ gearman_return_t result;
3832
+ VALUE vresult = Qnil;
3833
+
3834
+ if ((argc < 1) || (argc > 1)) {
3835
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3836
+ }
3837
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
3838
+ if (!SWIG_IsOK(res1)) {
3839
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","addServers", 1, self ));
3840
+ }
3841
+ arg1 = (Worker *)(argp1);
3842
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
3843
+ if (!SWIG_IsOK(res2)) {
3844
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addServers", 2, argv[0] ));
3845
+ }
3846
+ arg2 = (char *)(buf2);
3847
+ result = (gearman_return_t)Worker_addServers(arg1,(char const *)arg2);
3848
+ vresult = SWIG_From_int((int)(result));
3849
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3850
+ return vresult;
3851
+ fail:
3852
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3853
+ return Qnil;
3854
+ }
3855
+
3856
+
3857
+ SWIGINTERN VALUE
3858
+ _wrap_Worker_register_function(int argc, VALUE *argv, VALUE self) {
3859
+ Worker *arg1 = (Worker *) 0 ;
3860
+ char *arg2 = (char *) 0 ;
3861
+ uint32_t arg3 = (uint32_t) 0 ;
3862
+ void *argp1 = 0 ;
3863
+ int res1 = 0 ;
3864
+ int res2 ;
3865
+ char *buf2 = 0 ;
3866
+ int alloc2 = 0 ;
3867
+ unsigned int val3 ;
3868
+ int ecode3 = 0 ;
3869
+ gearman_return_t result;
3870
+ VALUE vresult = Qnil;
3871
+
3872
+ if ((argc < 1) || (argc > 2)) {
3873
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3874
+ }
3875
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
3876
+ if (!SWIG_IsOK(res1)) {
3877
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","registerFunction", 1, self ));
3878
+ }
3879
+ arg1 = (Worker *)(argp1);
3880
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
3881
+ if (!SWIG_IsOK(res2)) {
3882
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","registerFunction", 2, argv[0] ));
3883
+ }
3884
+ arg2 = (char *)(buf2);
3885
+ if (argc > 1) {
3886
+ ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
3887
+ if (!SWIG_IsOK(ecode3)) {
3888
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "uint32_t","registerFunction", 3, argv[1] ));
3889
+ }
3890
+ arg3 = (uint32_t)(val3);
3891
+ }
3892
+ result = (gearman_return_t)Worker_registerFunction(arg1,(char const *)arg2,arg3);
3893
+ vresult = SWIG_From_int((int)(result));
3894
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3895
+ return vresult;
3896
+ fail:
3897
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3898
+ return Qnil;
3899
+ }
3900
+
3901
+
3902
+ SWIGINTERN VALUE
3903
+ _wrap_Worker_unregister(int argc, VALUE *argv, VALUE self) {
3904
+ Worker *arg1 = (Worker *) 0 ;
3905
+ char *arg2 = (char *) 0 ;
3906
+ void *argp1 = 0 ;
3907
+ int res1 = 0 ;
3908
+ int res2 ;
3909
+ char *buf2 = 0 ;
3910
+ int alloc2 = 0 ;
3911
+ gearman_return_t result;
3912
+ VALUE vresult = Qnil;
3913
+
3914
+ if ((argc < 1) || (argc > 1)) {
3915
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3916
+ }
3917
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
3918
+ if (!SWIG_IsOK(res1)) {
3919
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","unregister", 1, self ));
3920
+ }
3921
+ arg1 = (Worker *)(argp1);
3922
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
3923
+ if (!SWIG_IsOK(res2)) {
3924
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","unregister", 2, argv[0] ));
3925
+ }
3926
+ arg2 = (char *)(buf2);
3927
+ result = (gearman_return_t)Worker_unregister(arg1,(char const *)arg2);
3928
+ vresult = SWIG_From_int((int)(result));
3929
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3930
+ return vresult;
3931
+ fail:
3932
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3933
+ return Qnil;
3934
+ }
3935
+
3936
+
3937
+ SWIGINTERN VALUE
3938
+ _wrap_Worker_unregister_all(int argc, VALUE *argv, VALUE self) {
3939
+ Worker *arg1 = (Worker *) 0 ;
3940
+ void *argp1 = 0 ;
3941
+ int res1 = 0 ;
3942
+ gearman_return_t result;
3943
+ VALUE vresult = Qnil;
3944
+
3945
+ if ((argc < 0) || (argc > 0)) {
3946
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3947
+ }
3948
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
3949
+ if (!SWIG_IsOK(res1)) {
3950
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","unregisterAll", 1, self ));
3951
+ }
3952
+ arg1 = (Worker *)(argp1);
3953
+ result = (gearman_return_t)Worker_unregisterAll(arg1);
3954
+ vresult = SWIG_From_int((int)(result));
3955
+ return vresult;
3956
+ fail:
3957
+ return Qnil;
3958
+ }
3959
+
3960
+
3961
+ SWIGINTERN VALUE
3962
+ _wrap_Worker_grab_job(int argc, VALUE *argv, VALUE self) {
3963
+ Worker *arg1 = (Worker *) 0 ;
3964
+ void *argp1 = 0 ;
3965
+ int res1 = 0 ;
3966
+ Job *result = 0 ;
3967
+ VALUE vresult = Qnil;
3968
+
3969
+ if ((argc < 0) || (argc > 0)) {
3970
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3971
+ }
3972
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
3973
+ if (!SWIG_IsOK(res1)) {
3974
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","grabJob", 1, self ));
3975
+ }
3976
+ arg1 = (Worker *)(argp1);
3977
+ result = (Job *)Worker_grabJob(arg1);
3978
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Job, 0 | 0 );
3979
+ return vresult;
3980
+ fail:
3981
+ return Qnil;
3982
+ }
3983
+
3984
+
3985
+ SWIGINTERN VALUE
3986
+ _wrap_Worker_add_function(int argc, VALUE *argv, VALUE self) {
3987
+ Worker *arg1 = (Worker *) 0 ;
3988
+ char *arg2 = (char *) 0 ;
3989
+ gearman_callback *arg3 = (gearman_callback *) 0 ;
3990
+ uint32_t arg4 = (uint32_t) 0 ;
3991
+ void *argp1 = 0 ;
3992
+ int res1 = 0 ;
3993
+ int res2 ;
3994
+ char *buf2 = 0 ;
3995
+ int alloc2 = 0 ;
3996
+ unsigned int val4 ;
3997
+ int ecode4 = 0 ;
3998
+ gearman_return_t result;
3999
+ VALUE vresult = Qnil;
4000
+
4001
+ if ((argc < 2) || (argc > 3)) {
4002
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
4003
+ }
4004
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
4005
+ if (!SWIG_IsOK(res1)) {
4006
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","addFunction", 1, self ));
4007
+ }
4008
+ arg1 = (Worker *)(argp1);
4009
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
4010
+ if (!SWIG_IsOK(res2)) {
4011
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addFunction", 2, argv[0] ));
4012
+ }
4013
+ arg2 = (char *)(buf2);
4014
+ {
4015
+ arg3= (gearman_callback *)malloc(sizeof(gearman_callback));
4016
+ arg3->callback_obj= argv[1];
4017
+ }
4018
+ if (argc > 2) {
4019
+ ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
4020
+ if (!SWIG_IsOK(ecode4)) {
4021
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "uint32_t","addFunction", 4, argv[2] ));
4022
+ }
4023
+ arg4 = (uint32_t)(val4);
4024
+ }
4025
+ result = (gearman_return_t)Worker_addFunction(arg1,(char const *)arg2,arg3,arg4);
4026
+ vresult = SWIG_From_int((int)(result));
4027
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
4028
+ return vresult;
4029
+ fail:
4030
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
4031
+ return Qnil;
4032
+ }
4033
+
4034
+
4035
+ SWIGINTERN VALUE
4036
+ _wrap_Worker_work(int argc, VALUE *argv, VALUE self) {
4037
+ Worker *arg1 = (Worker *) 0 ;
4038
+ void *argp1 = 0 ;
4039
+ int res1 = 0 ;
4040
+ gearman_return_t result;
4041
+ VALUE vresult = Qnil;
4042
+
4043
+ if ((argc < 0) || (argc > 0)) {
4044
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
4045
+ }
4046
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gearman_worker_st, 0 | 0 );
4047
+ if (!SWIG_IsOK(res1)) {
4048
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Worker *","work", 1, self ));
4049
+ }
4050
+ arg1 = (Worker *)(argp1);
4051
+ result = (gearman_return_t)Worker_work(arg1);
4052
+ vresult = SWIG_From_int((int)(result));
4053
+ return vresult;
4054
+ fail:
4055
+ return Qnil;
4056
+ }
4057
+
4058
+
4059
+
4060
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
4061
+
4062
+ static swig_type_info _swigt__p_Job = {"_p_Job", "Job *", 0, 0, (void*)0, 0};
4063
+ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
4064
+ static swig_type_info _swigt__p_gearman_callback = {"_p_gearman_callback", "gearman_callback *", 0, 0, (void*)0, 0};
4065
+ static swig_type_info _swigt__p_gearman_client_options_t = {"_p_gearman_client_options_t", "enum gearman_client_options_t *|gearman_client_options_t *", 0, 0, (void*)0, 0};
4066
+ static swig_type_info _swigt__p_gearman_client_st = {"_p_gearman_client_st", "struct gearman_client_st *|gearman_client_st *|Client *", 0, 0, (void*)0, 0};
4067
+ static swig_type_info _swigt__p_gearman_client_state_t = {"_p_gearman_client_state_t", "enum gearman_client_state_t *|gearman_client_state_t *", 0, 0, (void*)0, 0};
4068
+ static swig_type_info _swigt__p_gearman_command_info_st = {"_p_gearman_command_info_st", "struct gearman_command_info_st *|gearman_command_info_st *", 0, 0, (void*)0, 0};
4069
+ static swig_type_info _swigt__p_gearman_command_t = {"_p_gearman_command_t", "enum gearman_command_t *|gearman_command_t *", 0, 0, (void*)0, 0};
4070
+ static swig_type_info _swigt__p_gearman_con_options_t = {"_p_gearman_con_options_t", "enum gearman_con_options_t *|gearman_con_options_t *", 0, 0, (void*)0, 0};
4071
+ static swig_type_info _swigt__p_gearman_con_recv_state_t = {"_p_gearman_con_recv_state_t", "enum gearman_con_recv_state_t *|gearman_con_recv_state_t *", 0, 0, (void*)0, 0};
4072
+ static swig_type_info _swigt__p_gearman_con_send_state_t = {"_p_gearman_con_send_state_t", "enum gearman_con_send_state_t *|gearman_con_send_state_t *", 0, 0, (void*)0, 0};
4073
+ static swig_type_info _swigt__p_gearman_con_st = {"_p_gearman_con_st", "struct gearman_con_st *|gearman_con_st *", 0, 0, (void*)0, 0};
4074
+ static swig_type_info _swigt__p_gearman_con_state_t = {"_p_gearman_con_state_t", "enum gearman_con_state_t *|gearman_con_state_t *", 0, 0, (void*)0, 0};
4075
+ static swig_type_info _swigt__p_gearman_job_options_t = {"_p_gearman_job_options_t", "enum gearman_job_options_t *|gearman_job_options_t *", 0, 0, (void*)0, 0};
4076
+ static swig_type_info _swigt__p_gearman_job_priority_t = {"_p_gearman_job_priority_t", "enum gearman_job_priority_t *|gearman_job_priority_t *", 0, 0, (void*)0, 0};
4077
+ static swig_type_info _swigt__p_gearman_job_st = {"_p_gearman_job_st", "struct gearman_job_st *|gearman_job_st *", 0, 0, (void*)0, 0};
4078
+ static swig_type_info _swigt__p_gearman_magic_t = {"_p_gearman_magic_t", "enum gearman_magic_t *|gearman_magic_t *", 0, 0, (void*)0, 0};
4079
+ static swig_type_info _swigt__p_gearman_options_t = {"_p_gearman_options_t", "enum gearman_options_t *|gearman_options_t *", 0, 0, (void*)0, 0};
4080
+ static swig_type_info _swigt__p_gearman_packet_options_t = {"_p_gearman_packet_options_t", "enum gearman_packet_options_t *|gearman_packet_options_t *", 0, 0, (void*)0, 0};
4081
+ static swig_type_info _swigt__p_gearman_packet_st = {"_p_gearman_packet_st", "struct gearman_packet_st *|gearman_packet_st *", 0, 0, (void*)0, 0};
4082
+ static swig_type_info _swigt__p_gearman_return_t = {"_p_gearman_return_t", "enum gearman_return_t *|gearman_return_t *", 0, 0, (void*)0, 0};
4083
+ static swig_type_info _swigt__p_gearman_st = {"_p_gearman_st", "Gearman *|struct gearman_st *|gearman_st *", 0, 0, (void*)0, 0};
4084
+ static swig_type_info _swigt__p_gearman_task_options_t = {"_p_gearman_task_options_t", "enum gearman_task_options_t *|gearman_task_options_t *", 0, 0, (void*)0, 0};
4085
+ static swig_type_info _swigt__p_gearman_task_st = {"_p_gearman_task_st", "struct gearman_task_st *|gearman_task_st *", 0, 0, (void*)0, 0};
4086
+ static swig_type_info _swigt__p_gearman_task_state_t = {"_p_gearman_task_state_t", "enum gearman_task_state_t *|gearman_task_state_t *", 0, 0, (void*)0, 0};
4087
+ static swig_type_info _swigt__p_gearman_verbose_t = {"_p_gearman_verbose_t", "enum gearman_verbose_t *|gearman_verbose_t *", 0, 0, (void*)0, 0};
4088
+ static swig_type_info _swigt__p_gearman_worker_function_options_t = {"_p_gearman_worker_function_options_t", "enum gearman_worker_function_options_t *|gearman_worker_function_options_t *", 0, 0, (void*)0, 0};
4089
+ static swig_type_info _swigt__p_gearman_worker_function_st = {"_p_gearman_worker_function_st", "struct gearman_worker_function_st *|gearman_worker_function_st *", 0, 0, (void*)0, 0};
4090
+ static swig_type_info _swigt__p_gearman_worker_options_t = {"_p_gearman_worker_options_t", "enum gearman_worker_options_t *|gearman_worker_options_t *", 0, 0, (void*)0, 0};
4091
+ static swig_type_info _swigt__p_gearman_worker_st = {"_p_gearman_worker_st", "struct gearman_worker_st *|gearman_worker_st *|Worker *", 0, 0, (void*)0, 0};
4092
+ static swig_type_info _swigt__p_gearman_worker_state_t = {"_p_gearman_worker_state_t", "enum gearman_worker_state_t *|gearman_worker_state_t *", 0, 0, (void*)0, 0};
4093
+ static swig_type_info _swigt__p_gearman_worker_work_state_t = {"_p_gearman_worker_work_state_t", "enum gearman_worker_work_state_t *|gearman_worker_work_state_t *", 0, 0, (void*)0, 0};
4094
+ static swig_type_info _swigt__p_int = {"_p_int", "intptr_t *|int *|int_least32_t *|int_fast32_t *|int32_t *|int_fast16_t *", 0, 0, (void*)0, 0};
4095
+ static swig_type_info _swigt__p_long_long = {"_p_long_long", "int_least64_t *|int_fast64_t *|int64_t *|long long *|intmax_t *", 0, 0, (void*)0, 0};
4096
+ static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
4097
+ static swig_type_info _swigt__p_short = {"_p_short", "short *|int_least16_t *|int16_t *", 0, 0, (void*)0, 0};
4098
+ static swig_type_info _swigt__p_signed_char = {"_p_signed_char", "signed char *|int_least8_t *|int_fast8_t *|int8_t *", 0, 0, (void*)0, 0};
4099
+ static swig_type_info _swigt__p_size_t = {"_p_size_t", "size_t *", 0, 0, (void*)0, 0};
4100
+ static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *|uint_least8_t *|uint_fast8_t *|uint8_t *", 0, 0, (void*)0, 0};
4101
+ static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "uintptr_t *|uint_least32_t *|uint_fast32_t *|uint32_t *|unsigned int *|in_port_t *|uint_fast16_t *", 0, 0, (void*)0, 0};
4102
+ static swig_type_info _swigt__p_unsigned_long_long = {"_p_unsigned_long_long", "uint_least64_t *|uint_fast64_t *|uint64_t *|unsigned long long *|uintmax_t *", 0, 0, (void*)0, 0};
4103
+ static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned short *|uint_least16_t *|uint16_t *", 0, 0, (void*)0, 0};
4104
+ static swig_type_info _swigt__p_void = {"_p_void", "do_return *|void *", 0, 0, (void*)0, 0};
4105
+
4106
+ static swig_type_info *swig_type_initial[] = {
4107
+ &_swigt__p_Job,
4108
+ &_swigt__p_char,
4109
+ &_swigt__p_gearman_callback,
4110
+ &_swigt__p_gearman_client_options_t,
4111
+ &_swigt__p_gearman_client_st,
4112
+ &_swigt__p_gearman_client_state_t,
4113
+ &_swigt__p_gearman_command_info_st,
4114
+ &_swigt__p_gearman_command_t,
4115
+ &_swigt__p_gearman_con_options_t,
4116
+ &_swigt__p_gearman_con_recv_state_t,
4117
+ &_swigt__p_gearman_con_send_state_t,
4118
+ &_swigt__p_gearman_con_st,
4119
+ &_swigt__p_gearman_con_state_t,
4120
+ &_swigt__p_gearman_job_options_t,
4121
+ &_swigt__p_gearman_job_priority_t,
4122
+ &_swigt__p_gearman_job_st,
4123
+ &_swigt__p_gearman_magic_t,
4124
+ &_swigt__p_gearman_options_t,
4125
+ &_swigt__p_gearman_packet_options_t,
4126
+ &_swigt__p_gearman_packet_st,
4127
+ &_swigt__p_gearman_return_t,
4128
+ &_swigt__p_gearman_st,
4129
+ &_swigt__p_gearman_task_options_t,
4130
+ &_swigt__p_gearman_task_st,
4131
+ &_swigt__p_gearman_task_state_t,
4132
+ &_swigt__p_gearman_verbose_t,
4133
+ &_swigt__p_gearman_worker_function_options_t,
4134
+ &_swigt__p_gearman_worker_function_st,
4135
+ &_swigt__p_gearman_worker_options_t,
4136
+ &_swigt__p_gearman_worker_st,
4137
+ &_swigt__p_gearman_worker_state_t,
4138
+ &_swigt__p_gearman_worker_work_state_t,
4139
+ &_swigt__p_int,
4140
+ &_swigt__p_long_long,
4141
+ &_swigt__p_p_char,
4142
+ &_swigt__p_short,
4143
+ &_swigt__p_signed_char,
4144
+ &_swigt__p_size_t,
4145
+ &_swigt__p_unsigned_char,
4146
+ &_swigt__p_unsigned_int,
4147
+ &_swigt__p_unsigned_long_long,
4148
+ &_swigt__p_unsigned_short,
4149
+ &_swigt__p_void,
4150
+ };
4151
+
4152
+ static swig_cast_info _swigc__p_Job[] = { {&_swigt__p_Job, 0, 0, 0},{0, 0, 0, 0}};
4153
+ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
4154
+ static swig_cast_info _swigc__p_gearman_callback[] = { {&_swigt__p_gearman_callback, 0, 0, 0},{0, 0, 0, 0}};
4155
+ static swig_cast_info _swigc__p_gearman_client_options_t[] = { {&_swigt__p_gearman_client_options_t, 0, 0, 0},{0, 0, 0, 0}};
4156
+ static swig_cast_info _swigc__p_gearman_client_st[] = { {&_swigt__p_gearman_client_st, 0, 0, 0},{0, 0, 0, 0}};
4157
+ static swig_cast_info _swigc__p_gearman_client_state_t[] = { {&_swigt__p_gearman_client_state_t, 0, 0, 0},{0, 0, 0, 0}};
4158
+ static swig_cast_info _swigc__p_gearman_command_info_st[] = { {&_swigt__p_gearman_command_info_st, 0, 0, 0},{0, 0, 0, 0}};
4159
+ static swig_cast_info _swigc__p_gearman_command_t[] = { {&_swigt__p_gearman_command_t, 0, 0, 0},{0, 0, 0, 0}};
4160
+ static swig_cast_info _swigc__p_gearman_con_options_t[] = { {&_swigt__p_gearman_con_options_t, 0, 0, 0},{0, 0, 0, 0}};
4161
+ static swig_cast_info _swigc__p_gearman_con_recv_state_t[] = { {&_swigt__p_gearman_con_recv_state_t, 0, 0, 0},{0, 0, 0, 0}};
4162
+ static swig_cast_info _swigc__p_gearman_con_send_state_t[] = { {&_swigt__p_gearman_con_send_state_t, 0, 0, 0},{0, 0, 0, 0}};
4163
+ static swig_cast_info _swigc__p_gearman_con_st[] = { {&_swigt__p_gearman_con_st, 0, 0, 0},{0, 0, 0, 0}};
4164
+ static swig_cast_info _swigc__p_gearman_con_state_t[] = { {&_swigt__p_gearman_con_state_t, 0, 0, 0},{0, 0, 0, 0}};
4165
+ static swig_cast_info _swigc__p_gearman_job_options_t[] = { {&_swigt__p_gearman_job_options_t, 0, 0, 0},{0, 0, 0, 0}};
4166
+ static swig_cast_info _swigc__p_gearman_job_priority_t[] = { {&_swigt__p_gearman_job_priority_t, 0, 0, 0},{0, 0, 0, 0}};
4167
+ static swig_cast_info _swigc__p_gearman_job_st[] = { {&_swigt__p_gearman_job_st, 0, 0, 0},{0, 0, 0, 0}};
4168
+ static swig_cast_info _swigc__p_gearman_magic_t[] = { {&_swigt__p_gearman_magic_t, 0, 0, 0},{0, 0, 0, 0}};
4169
+ static swig_cast_info _swigc__p_gearman_options_t[] = { {&_swigt__p_gearman_options_t, 0, 0, 0},{0, 0, 0, 0}};
4170
+ static swig_cast_info _swigc__p_gearman_packet_options_t[] = { {&_swigt__p_gearman_packet_options_t, 0, 0, 0},{0, 0, 0, 0}};
4171
+ static swig_cast_info _swigc__p_gearman_packet_st[] = { {&_swigt__p_gearman_packet_st, 0, 0, 0},{0, 0, 0, 0}};
4172
+ static swig_cast_info _swigc__p_gearman_return_t[] = { {&_swigt__p_gearman_return_t, 0, 0, 0},{0, 0, 0, 0}};
4173
+ static swig_cast_info _swigc__p_gearman_st[] = { {&_swigt__p_gearman_st, 0, 0, 0},{0, 0, 0, 0}};
4174
+ static swig_cast_info _swigc__p_gearman_task_options_t[] = { {&_swigt__p_gearman_task_options_t, 0, 0, 0},{0, 0, 0, 0}};
4175
+ static swig_cast_info _swigc__p_gearman_task_st[] = { {&_swigt__p_gearman_task_st, 0, 0, 0},{0, 0, 0, 0}};
4176
+ static swig_cast_info _swigc__p_gearman_task_state_t[] = { {&_swigt__p_gearman_task_state_t, 0, 0, 0},{0, 0, 0, 0}};
4177
+ static swig_cast_info _swigc__p_gearman_verbose_t[] = { {&_swigt__p_gearman_verbose_t, 0, 0, 0},{0, 0, 0, 0}};
4178
+ static swig_cast_info _swigc__p_gearman_worker_function_options_t[] = { {&_swigt__p_gearman_worker_function_options_t, 0, 0, 0},{0, 0, 0, 0}};
4179
+ static swig_cast_info _swigc__p_gearman_worker_function_st[] = { {&_swigt__p_gearman_worker_function_st, 0, 0, 0},{0, 0, 0, 0}};
4180
+ static swig_cast_info _swigc__p_gearman_worker_options_t[] = { {&_swigt__p_gearman_worker_options_t, 0, 0, 0},{0, 0, 0, 0}};
4181
+ static swig_cast_info _swigc__p_gearman_worker_st[] = { {&_swigt__p_gearman_worker_st, 0, 0, 0},{0, 0, 0, 0}};
4182
+ static swig_cast_info _swigc__p_gearman_worker_state_t[] = { {&_swigt__p_gearman_worker_state_t, 0, 0, 0},{0, 0, 0, 0}};
4183
+ static swig_cast_info _swigc__p_gearman_worker_work_state_t[] = { {&_swigt__p_gearman_worker_work_state_t, 0, 0, 0},{0, 0, 0, 0}};
4184
+ static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
4185
+ static swig_cast_info _swigc__p_long_long[] = { {&_swigt__p_long_long, 0, 0, 0},{0, 0, 0, 0}};
4186
+ static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
4187
+ static swig_cast_info _swigc__p_short[] = { {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}};
4188
+ static swig_cast_info _swigc__p_signed_char[] = { {&_swigt__p_signed_char, 0, 0, 0},{0, 0, 0, 0}};
4189
+ static swig_cast_info _swigc__p_size_t[] = { {&_swigt__p_size_t, 0, 0, 0},{0, 0, 0, 0}};
4190
+ static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
4191
+ static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
4192
+ static swig_cast_info _swigc__p_unsigned_long_long[] = { {&_swigt__p_unsigned_long_long, 0, 0, 0},{0, 0, 0, 0}};
4193
+ static swig_cast_info _swigc__p_unsigned_short[] = { {&_swigt__p_unsigned_short, 0, 0, 0},{0, 0, 0, 0}};
4194
+ static swig_cast_info _swigc__p_void[] = { {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};
4195
+
4196
+ static swig_cast_info *swig_cast_initial[] = {
4197
+ _swigc__p_Job,
4198
+ _swigc__p_char,
4199
+ _swigc__p_gearman_callback,
4200
+ _swigc__p_gearman_client_options_t,
4201
+ _swigc__p_gearman_client_st,
4202
+ _swigc__p_gearman_client_state_t,
4203
+ _swigc__p_gearman_command_info_st,
4204
+ _swigc__p_gearman_command_t,
4205
+ _swigc__p_gearman_con_options_t,
4206
+ _swigc__p_gearman_con_recv_state_t,
4207
+ _swigc__p_gearman_con_send_state_t,
4208
+ _swigc__p_gearman_con_st,
4209
+ _swigc__p_gearman_con_state_t,
4210
+ _swigc__p_gearman_job_options_t,
4211
+ _swigc__p_gearman_job_priority_t,
4212
+ _swigc__p_gearman_job_st,
4213
+ _swigc__p_gearman_magic_t,
4214
+ _swigc__p_gearman_options_t,
4215
+ _swigc__p_gearman_packet_options_t,
4216
+ _swigc__p_gearman_packet_st,
4217
+ _swigc__p_gearman_return_t,
4218
+ _swigc__p_gearman_st,
4219
+ _swigc__p_gearman_task_options_t,
4220
+ _swigc__p_gearman_task_st,
4221
+ _swigc__p_gearman_task_state_t,
4222
+ _swigc__p_gearman_verbose_t,
4223
+ _swigc__p_gearman_worker_function_options_t,
4224
+ _swigc__p_gearman_worker_function_st,
4225
+ _swigc__p_gearman_worker_options_t,
4226
+ _swigc__p_gearman_worker_st,
4227
+ _swigc__p_gearman_worker_state_t,
4228
+ _swigc__p_gearman_worker_work_state_t,
4229
+ _swigc__p_int,
4230
+ _swigc__p_long_long,
4231
+ _swigc__p_p_char,
4232
+ _swigc__p_short,
4233
+ _swigc__p_signed_char,
4234
+ _swigc__p_size_t,
4235
+ _swigc__p_unsigned_char,
4236
+ _swigc__p_unsigned_int,
4237
+ _swigc__p_unsigned_long_long,
4238
+ _swigc__p_unsigned_short,
4239
+ _swigc__p_void,
4240
+ };
4241
+
4242
+
4243
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
4244
+
4245
+ /* -----------------------------------------------------------------------------
4246
+ * Type initialization:
4247
+ * This problem is tough by the requirement that no dynamic
4248
+ * memory is used. Also, since swig_type_info structures store pointers to
4249
+ * swig_cast_info structures and swig_cast_info structures store pointers back
4250
+ * to swig_type_info structures, we need some lookup code at initialization.
4251
+ * The idea is that swig generates all the structures that are needed.
4252
+ * The runtime then collects these partially filled structures.
4253
+ * The SWIG_InitializeModule function takes these initial arrays out of
4254
+ * swig_module, and does all the lookup, filling in the swig_module.types
4255
+ * array with the correct data and linking the correct swig_cast_info
4256
+ * structures together.
4257
+ *
4258
+ * The generated swig_type_info structures are assigned staticly to an initial
4259
+ * array. We just loop through that array, and handle each type individually.
4260
+ * First we lookup if this type has been already loaded, and if so, use the
4261
+ * loaded structure instead of the generated one. Then we have to fill in the
4262
+ * cast linked list. The cast data is initially stored in something like a
4263
+ * two-dimensional array. Each row corresponds to a type (there are the same
4264
+ * number of rows as there are in the swig_type_initial array). Each entry in
4265
+ * a column is one of the swig_cast_info structures for that type.
4266
+ * The cast_initial array is actually an array of arrays, because each row has
4267
+ * a variable number of columns. So to actually build the cast linked list,
4268
+ * we find the array of casts associated with the type, and loop through it
4269
+ * adding the casts to the list. The one last trick we need to do is making
4270
+ * sure the type pointer in the swig_cast_info struct is correct.
4271
+ *
4272
+ * First off, we lookup the cast->type name to see if it is already loaded.
4273
+ * There are three cases to handle:
4274
+ * 1) If the cast->type has already been loaded AND the type we are adding
4275
+ * casting info to has not been loaded (it is in this module), THEN we
4276
+ * replace the cast->type pointer with the type pointer that has already
4277
+ * been loaded.
4278
+ * 2) If BOTH types (the one we are adding casting info to, and the
4279
+ * cast->type) are loaded, THEN the cast info has already been loaded by
4280
+ * the previous module so we just ignore it.
4281
+ * 3) Finally, if cast->type has not already been loaded, then we add that
4282
+ * swig_cast_info to the linked list (because the cast->type) pointer will
4283
+ * be correct.
4284
+ * ----------------------------------------------------------------------------- */
4285
+
4286
+ #ifdef __cplusplus
4287
+ extern "C" {
4288
+ #if 0
4289
+ } /* c-mode */
4290
+ #endif
4291
+ #endif
4292
+
4293
+ #if 0
4294
+ #define SWIGRUNTIME_DEBUG
4295
+ #endif
4296
+
4297
+
4298
+ SWIGRUNTIME void
4299
+ SWIG_InitializeModule(void *clientdata) {
4300
+ size_t i;
4301
+ swig_module_info *module_head, *iter;
4302
+ int found, init;
4303
+
4304
+ clientdata = clientdata;
4305
+
4306
+ /* check to see if the circular list has been setup, if not, set it up */
4307
+ if (swig_module.next==0) {
4308
+ /* Initialize the swig_module */
4309
+ swig_module.type_initial = swig_type_initial;
4310
+ swig_module.cast_initial = swig_cast_initial;
4311
+ swig_module.next = &swig_module;
4312
+ init = 1;
4313
+ } else {
4314
+ init = 0;
4315
+ }
4316
+
4317
+ /* Try and load any already created modules */
4318
+ module_head = SWIG_GetModule(clientdata);
4319
+ if (!module_head) {
4320
+ /* This is the first module loaded for this interpreter */
4321
+ /* so set the swig module into the interpreter */
4322
+ SWIG_SetModule(clientdata, &swig_module);
4323
+ module_head = &swig_module;
4324
+ } else {
4325
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
4326
+ found=0;
4327
+ iter=module_head;
4328
+ do {
4329
+ if (iter==&swig_module) {
4330
+ found=1;
4331
+ break;
4332
+ }
4333
+ iter=iter->next;
4334
+ } while (iter!= module_head);
4335
+
4336
+ /* if the is found in the list, then all is done and we may leave */
4337
+ if (found) return;
4338
+ /* otherwise we must add out module into the list */
4339
+ swig_module.next = module_head->next;
4340
+ module_head->next = &swig_module;
4341
+ }
4342
+
4343
+ /* When multiple interpeters are used, a module could have already been initialized in
4344
+ a different interpreter, but not yet have a pointer in this interpreter.
4345
+ In this case, we do not want to continue adding types... everything should be
4346
+ set up already */
4347
+ if (init == 0) return;
4348
+
4349
+ /* Now work on filling in swig_module.types */
4350
+ #ifdef SWIGRUNTIME_DEBUG
4351
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
4352
+ #endif
4353
+ for (i = 0; i < swig_module.size; ++i) {
4354
+ swig_type_info *type = 0;
4355
+ swig_type_info *ret;
4356
+ swig_cast_info *cast;
4357
+
4358
+ #ifdef SWIGRUNTIME_DEBUG
4359
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4360
+ #endif
4361
+
4362
+ /* if there is another module already loaded */
4363
+ if (swig_module.next != &swig_module) {
4364
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
4365
+ }
4366
+ if (type) {
4367
+ /* Overwrite clientdata field */
4368
+ #ifdef SWIGRUNTIME_DEBUG
4369
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
4370
+ #endif
4371
+ if (swig_module.type_initial[i]->clientdata) {
4372
+ type->clientdata = swig_module.type_initial[i]->clientdata;
4373
+ #ifdef SWIGRUNTIME_DEBUG
4374
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
4375
+ #endif
4376
+ }
4377
+ } else {
4378
+ type = swig_module.type_initial[i];
4379
+ }
4380
+
4381
+ /* Insert casting types */
4382
+ cast = swig_module.cast_initial[i];
4383
+ while (cast->type) {
4384
+
4385
+ /* Don't need to add information already in the list */
4386
+ ret = 0;
4387
+ #ifdef SWIGRUNTIME_DEBUG
4388
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
4389
+ #endif
4390
+ if (swig_module.next != &swig_module) {
4391
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
4392
+ #ifdef SWIGRUNTIME_DEBUG
4393
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
4394
+ #endif
4395
+ }
4396
+ if (ret) {
4397
+ if (type == swig_module.type_initial[i]) {
4398
+ #ifdef SWIGRUNTIME_DEBUG
4399
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
4400
+ #endif
4401
+ cast->type = ret;
4402
+ ret = 0;
4403
+ } else {
4404
+ /* Check for casting already in the list */
4405
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
4406
+ #ifdef SWIGRUNTIME_DEBUG
4407
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
4408
+ #endif
4409
+ if (!ocast) ret = 0;
4410
+ }
4411
+ }
4412
+
4413
+ if (!ret) {
4414
+ #ifdef SWIGRUNTIME_DEBUG
4415
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
4416
+ #endif
4417
+ if (type->cast) {
4418
+ type->cast->prev = cast;
4419
+ cast->next = type->cast;
4420
+ }
4421
+ type->cast = cast;
4422
+ }
4423
+ cast++;
4424
+ }
4425
+ /* Set entry in modules->types array equal to the type */
4426
+ swig_module.types[i] = type;
4427
+ }
4428
+ swig_module.types[i] = 0;
4429
+
4430
+ #ifdef SWIGRUNTIME_DEBUG
4431
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
4432
+ for (i = 0; i < swig_module.size; ++i) {
4433
+ int j = 0;
4434
+ swig_cast_info *cast = swig_module.cast_initial[i];
4435
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4436
+ while (cast->type) {
4437
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
4438
+ cast++;
4439
+ ++j;
4440
+ }
4441
+ printf("---- Total casts: %d\n",j);
4442
+ }
4443
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
4444
+ #endif
4445
+ }
4446
+
4447
+ /* This function will propagate the clientdata field of type to
4448
+ * any new swig_type_info structures that have been added into the list
4449
+ * of equivalent types. It is like calling
4450
+ * SWIG_TypeClientData(type, clientdata) a second time.
4451
+ */
4452
+ SWIGRUNTIME void
4453
+ SWIG_PropagateClientData(void) {
4454
+ size_t i;
4455
+ swig_cast_info *equiv;
4456
+ static int init_run = 0;
4457
+
4458
+ if (init_run) return;
4459
+ init_run = 1;
4460
+
4461
+ for (i = 0; i < swig_module.size; i++) {
4462
+ if (swig_module.types[i]->clientdata) {
4463
+ equiv = swig_module.types[i]->cast;
4464
+ while (equiv) {
4465
+ if (!equiv->converter) {
4466
+ if (equiv->type && !equiv->type->clientdata)
4467
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
4468
+ }
4469
+ equiv = equiv->next;
4470
+ }
4471
+ }
4472
+ }
4473
+ }
4474
+
4475
+ #ifdef __cplusplus
4476
+ #if 0
4477
+ { /* c-mode */
4478
+ #endif
4479
+ }
4480
+ #endif
4481
+
4482
+ /*
4483
+
4484
+ */
4485
+ #ifdef __cplusplus
4486
+ extern "C"
4487
+ #endif
4488
+ SWIGEXPORT void Init_gearman(void) {
4489
+ size_t i;
4490
+
4491
+ SWIG_InitRuntime();
4492
+ mGearman = rb_define_module("Gearman");
4493
+
4494
+ SWIG_InitializeModule(0);
4495
+ for (i = 0; i < swig_module.size; i++) {
4496
+ SWIG_define_class(swig_module.types[i]);
4497
+ }
4498
+
4499
+ SWIG_RubyInitializeTrackings();
4500
+ rb_define_const(mGearman, "GEARMAN_DEFAULT_TCP_HOST", SWIG_FromCharPtr("127.0.0.1"));
4501
+ rb_define_const(mGearman, "GEARMAN_DEFAULT_TCP_PORT", SWIG_From_int((int)(4730)));
4502
+ rb_define_const(mGearman, "GEARMAN_DEFAULT_SOCKET_TIMEOUT", SWIG_From_int((int)(10)));
4503
+ rb_define_const(mGearman, "GEARMAN_DEFAULT_SOCKET_SEND_SIZE", SWIG_From_int((int)(32768)));
4504
+ rb_define_const(mGearman, "GEARMAN_DEFAULT_SOCKET_RECV_SIZE", SWIG_From_int((int)(32768)));
4505
+ rb_define_const(mGearman, "GEARMAN_MAX_ERROR_SIZE", SWIG_From_int((int)(1024)));
4506
+ rb_define_const(mGearman, "GEARMAN_PACKET_HEADER_SIZE", SWIG_From_int((int)(12)));
4507
+ rb_define_const(mGearman, "GEARMAN_JOB_HANDLE_SIZE", SWIG_From_int((int)(64)));
4508
+ rb_define_const(mGearman, "GEARMAN_OPTION_SIZE", SWIG_From_int((int)(64)));
4509
+ rb_define_const(mGearman, "GEARMAN_UNIQUE_SIZE", SWIG_From_int((int)(64)));
4510
+ rb_define_const(mGearman, "GEARMAN_MAX_COMMAND_ARGS", SWIG_From_int((int)(8)));
4511
+ rb_define_const(mGearman, "GEARMAN_ARGS_BUFFER_SIZE", SWIG_From_int((int)(128)));
4512
+ rb_define_const(mGearman, "GEARMAN_SEND_BUFFER_SIZE", SWIG_From_int((int)(8192)));
4513
+ rb_define_const(mGearman, "GEARMAN_RECV_BUFFER_SIZE", SWIG_From_int((int)(8192)));
4514
+ rb_define_const(mGearman, "GEARMAN_WORKER_WAIT_TIMEOUT", SWIG_From_int((int)((10*1000))));
4515
+ rb_define_const(mGearman, "GEARMAN_SUCCESS", SWIG_From_int((int)(GEARMAN_SUCCESS)));
4516
+ rb_define_const(mGearman, "GEARMAN_IO_WAIT", SWIG_From_int((int)(GEARMAN_IO_WAIT)));
4517
+ rb_define_const(mGearman, "GEARMAN_SHUTDOWN", SWIG_From_int((int)(GEARMAN_SHUTDOWN)));
4518
+ rb_define_const(mGearman, "GEARMAN_SHUTDOWN_GRACEFUL", SWIG_From_int((int)(GEARMAN_SHUTDOWN_GRACEFUL)));
4519
+ rb_define_const(mGearman, "GEARMAN_ERRNO", SWIG_From_int((int)(GEARMAN_ERRNO)));
4520
+ rb_define_const(mGearman, "GEARMAN_EVENT", SWIG_From_int((int)(GEARMAN_EVENT)));
4521
+ rb_define_const(mGearman, "GEARMAN_TOO_MANY_ARGS", SWIG_From_int((int)(GEARMAN_TOO_MANY_ARGS)));
4522
+ rb_define_const(mGearman, "GEARMAN_NO_ACTIVE_FDS", SWIG_From_int((int)(GEARMAN_NO_ACTIVE_FDS)));
4523
+ rb_define_const(mGearman, "GEARMAN_INVALID_MAGIC", SWIG_From_int((int)(GEARMAN_INVALID_MAGIC)));
4524
+ rb_define_const(mGearman, "GEARMAN_INVALID_COMMAND", SWIG_From_int((int)(GEARMAN_INVALID_COMMAND)));
4525
+ rb_define_const(mGearman, "GEARMAN_INVALID_PACKET", SWIG_From_int((int)(GEARMAN_INVALID_PACKET)));
4526
+ rb_define_const(mGearman, "GEARMAN_UNEXPECTED_PACKET", SWIG_From_int((int)(GEARMAN_UNEXPECTED_PACKET)));
4527
+ rb_define_const(mGearman, "GEARMAN_GETADDRINFO", SWIG_From_int((int)(GEARMAN_GETADDRINFO)));
4528
+ rb_define_const(mGearman, "GEARMAN_NO_SERVERS", SWIG_From_int((int)(GEARMAN_NO_SERVERS)));
4529
+ rb_define_const(mGearman, "GEARMAN_LOST_CONNECTION", SWIG_From_int((int)(GEARMAN_LOST_CONNECTION)));
4530
+ rb_define_const(mGearman, "GEARMAN_MEMORY_ALLOCATION_FAILURE", SWIG_From_int((int)(GEARMAN_MEMORY_ALLOCATION_FAILURE)));
4531
+ rb_define_const(mGearman, "GEARMAN_JOB_EXISTS", SWIG_From_int((int)(GEARMAN_JOB_EXISTS)));
4532
+ rb_define_const(mGearman, "GEARMAN_JOB_QUEUE_FULL", SWIG_From_int((int)(GEARMAN_JOB_QUEUE_FULL)));
4533
+ rb_define_const(mGearman, "GEARMAN_SERVER_ERROR", SWIG_From_int((int)(GEARMAN_SERVER_ERROR)));
4534
+ rb_define_const(mGearman, "GEARMAN_WORK_ERROR", SWIG_From_int((int)(GEARMAN_WORK_ERROR)));
4535
+ rb_define_const(mGearman, "GEARMAN_WORK_DATA", SWIG_From_int((int)(GEARMAN_WORK_DATA)));
4536
+ rb_define_const(mGearman, "GEARMAN_WORK_WARNING", SWIG_From_int((int)(GEARMAN_WORK_WARNING)));
4537
+ rb_define_const(mGearman, "GEARMAN_WORK_STATUS", SWIG_From_int((int)(GEARMAN_WORK_STATUS)));
4538
+ rb_define_const(mGearman, "GEARMAN_WORK_EXCEPTION", SWIG_From_int((int)(GEARMAN_WORK_EXCEPTION)));
4539
+ rb_define_const(mGearman, "GEARMAN_WORK_FAIL", SWIG_From_int((int)(GEARMAN_WORK_FAIL)));
4540
+ rb_define_const(mGearman, "GEARMAN_NOT_CONNECTED", SWIG_From_int((int)(GEARMAN_NOT_CONNECTED)));
4541
+ rb_define_const(mGearman, "GEARMAN_COULD_NOT_CONNECT", SWIG_From_int((int)(GEARMAN_COULD_NOT_CONNECT)));
4542
+ rb_define_const(mGearman, "GEARMAN_SEND_IN_PROGRESS", SWIG_From_int((int)(GEARMAN_SEND_IN_PROGRESS)));
4543
+ rb_define_const(mGearman, "GEARMAN_RECV_IN_PROGRESS", SWIG_From_int((int)(GEARMAN_RECV_IN_PROGRESS)));
4544
+ rb_define_const(mGearman, "GEARMAN_NOT_FLUSHING", SWIG_From_int((int)(GEARMAN_NOT_FLUSHING)));
4545
+ rb_define_const(mGearman, "GEARMAN_DATA_TOO_LARGE", SWIG_From_int((int)(GEARMAN_DATA_TOO_LARGE)));
4546
+ rb_define_const(mGearman, "GEARMAN_INVALID_FUNCTION_NAME", SWIG_From_int((int)(GEARMAN_INVALID_FUNCTION_NAME)));
4547
+ rb_define_const(mGearman, "GEARMAN_INVALID_WORKER_FUNCTION", SWIG_From_int((int)(GEARMAN_INVALID_WORKER_FUNCTION)));
4548
+ rb_define_const(mGearman, "GEARMAN_NO_REGISTERED_FUNCTIONS", SWIG_From_int((int)(GEARMAN_NO_REGISTERED_FUNCTIONS)));
4549
+ rb_define_const(mGearman, "GEARMAN_NO_JOBS", SWIG_From_int((int)(GEARMAN_NO_JOBS)));
4550
+ rb_define_const(mGearman, "GEARMAN_ECHO_DATA_CORRUPTION", SWIG_From_int((int)(GEARMAN_ECHO_DATA_CORRUPTION)));
4551
+ rb_define_const(mGearman, "GEARMAN_NEED_WORKLOAD_FN", SWIG_From_int((int)(GEARMAN_NEED_WORKLOAD_FN)));
4552
+ rb_define_const(mGearman, "GEARMAN_PAUSE", SWIG_From_int((int)(GEARMAN_PAUSE)));
4553
+ rb_define_const(mGearman, "GEARMAN_UNKNOWN_STATE", SWIG_From_int((int)(GEARMAN_UNKNOWN_STATE)));
4554
+ rb_define_const(mGearman, "GEARMAN_PTHREAD", SWIG_From_int((int)(GEARMAN_PTHREAD)));
4555
+ rb_define_const(mGearman, "GEARMAN_PIPE_EOF", SWIG_From_int((int)(GEARMAN_PIPE_EOF)));
4556
+ rb_define_const(mGearman, "GEARMAN_QUEUE_ERROR", SWIG_From_int((int)(GEARMAN_QUEUE_ERROR)));
4557
+ rb_define_const(mGearman, "GEARMAN_FLUSH_DATA", SWIG_From_int((int)(GEARMAN_FLUSH_DATA)));
4558
+ rb_define_const(mGearman, "GEARMAN_SEND_BUFFER_TOO_SMALL", SWIG_From_int((int)(GEARMAN_SEND_BUFFER_TOO_SMALL)));
4559
+ rb_define_const(mGearman, "GEARMAN_IGNORE_PACKET", SWIG_From_int((int)(GEARMAN_IGNORE_PACKET)));
4560
+ rb_define_const(mGearman, "GEARMAN_UNKNOWN_OPTION", SWIG_From_int((int)(GEARMAN_UNKNOWN_OPTION)));
4561
+ rb_define_const(mGearman, "GEARMAN_TIMEOUT", SWIG_From_int((int)(GEARMAN_TIMEOUT)));
4562
+ rb_define_const(mGearman, "GEARMAN_MAX_RETURN", SWIG_From_int((int)(GEARMAN_MAX_RETURN)));
4563
+ rb_define_const(mGearman, "GEARMAN_VERBOSE_FATAL", SWIG_From_int((int)(GEARMAN_VERBOSE_FATAL)));
4564
+ rb_define_const(mGearman, "GEARMAN_VERBOSE_ERROR", SWIG_From_int((int)(GEARMAN_VERBOSE_ERROR)));
4565
+ rb_define_const(mGearman, "GEARMAN_VERBOSE_INFO", SWIG_From_int((int)(GEARMAN_VERBOSE_INFO)));
4566
+ rb_define_const(mGearman, "GEARMAN_VERBOSE_DEBUG", SWIG_From_int((int)(GEARMAN_VERBOSE_DEBUG)));
4567
+ rb_define_const(mGearman, "GEARMAN_VERBOSE_CRAZY", SWIG_From_int((int)(GEARMAN_VERBOSE_CRAZY)));
4568
+ rb_define_const(mGearman, "GEARMAN_VERBOSE_MAX", SWIG_From_int((int)(GEARMAN_VERBOSE_MAX)));
4569
+ rb_define_const(mGearman, "GEARMAN_ALLOCATED", SWIG_From_int((int)(GEARMAN_ALLOCATED)));
4570
+ rb_define_const(mGearman, "GEARMAN_NON_BLOCKING", SWIG_From_int((int)(GEARMAN_NON_BLOCKING)));
4571
+ rb_define_const(mGearman, "GEARMAN_DONT_TRACK_PACKETS", SWIG_From_int((int)(GEARMAN_DONT_TRACK_PACKETS)));
4572
+ rb_define_const(mGearman, "GEARMAN_CON_ALLOCATED", SWIG_From_int((int)(GEARMAN_CON_ALLOCATED)));
4573
+ rb_define_const(mGearman, "GEARMAN_CON_READY", SWIG_From_int((int)(GEARMAN_CON_READY)));
4574
+ rb_define_const(mGearman, "GEARMAN_CON_PACKET_IN_USE", SWIG_From_int((int)(GEARMAN_CON_PACKET_IN_USE)));
4575
+ rb_define_const(mGearman, "GEARMAN_CON_EXTERNAL_FD", SWIG_From_int((int)(GEARMAN_CON_EXTERNAL_FD)));
4576
+ rb_define_const(mGearman, "GEARMAN_CON_IGNORE_LOST_CONNECTION", SWIG_From_int((int)(GEARMAN_CON_IGNORE_LOST_CONNECTION)));
4577
+ rb_define_const(mGearman, "GEARMAN_CON_CLOSE_AFTER_FLUSH", SWIG_From_int((int)(GEARMAN_CON_CLOSE_AFTER_FLUSH)));
4578
+ rb_define_const(mGearman, "GEARMAN_CON_STATE_ADDRINFO", SWIG_From_int((int)(GEARMAN_CON_STATE_ADDRINFO)));
4579
+ rb_define_const(mGearman, "GEARMAN_CON_STATE_CONNECT", SWIG_From_int((int)(GEARMAN_CON_STATE_CONNECT)));
4580
+ rb_define_const(mGearman, "GEARMAN_CON_STATE_CONNECTING", SWIG_From_int((int)(GEARMAN_CON_STATE_CONNECTING)));
4581
+ rb_define_const(mGearman, "GEARMAN_CON_STATE_CONNECTED", SWIG_From_int((int)(GEARMAN_CON_STATE_CONNECTED)));
4582
+ rb_define_const(mGearman, "GEARMAN_CON_SEND_STATE_NONE", SWIG_From_int((int)(GEARMAN_CON_SEND_STATE_NONE)));
4583
+ rb_define_const(mGearman, "GEARMAN_CON_SEND_STATE_PRE_FLUSH", SWIG_From_int((int)(GEARMAN_CON_SEND_STATE_PRE_FLUSH)));
4584
+ rb_define_const(mGearman, "GEARMAN_CON_SEND_STATE_FORCE_FLUSH", SWIG_From_int((int)(GEARMAN_CON_SEND_STATE_FORCE_FLUSH)));
4585
+ rb_define_const(mGearman, "GEARMAN_CON_SEND_STATE_FLUSH", SWIG_From_int((int)(GEARMAN_CON_SEND_STATE_FLUSH)));
4586
+ rb_define_const(mGearman, "GEARMAN_CON_SEND_STATE_FLUSH_DATA", SWIG_From_int((int)(GEARMAN_CON_SEND_STATE_FLUSH_DATA)));
4587
+ rb_define_const(mGearman, "GEARMAN_CON_RECV_STATE_NONE", SWIG_From_int((int)(GEARMAN_CON_RECV_STATE_NONE)));
4588
+ rb_define_const(mGearman, "GEARMAN_CON_RECV_STATE_READ", SWIG_From_int((int)(GEARMAN_CON_RECV_STATE_READ)));
4589
+ rb_define_const(mGearman, "GEARMAN_CON_RECV_STATE_READ_DATA", SWIG_From_int((int)(GEARMAN_CON_RECV_STATE_READ_DATA)));
4590
+ rb_define_const(mGearman, "GEARMAN_PACKET_ALLOCATED", SWIG_From_int((int)(GEARMAN_PACKET_ALLOCATED)));
4591
+ rb_define_const(mGearman, "GEARMAN_PACKET_COMPLETE", SWIG_From_int((int)(GEARMAN_PACKET_COMPLETE)));
4592
+ rb_define_const(mGearman, "GEARMAN_PACKET_FREE_DATA", SWIG_From_int((int)(GEARMAN_PACKET_FREE_DATA)));
4593
+ rb_define_const(mGearman, "GEARMAN_MAGIC_TEXT", SWIG_From_int((int)(GEARMAN_MAGIC_TEXT)));
4594
+ rb_define_const(mGearman, "GEARMAN_MAGIC_REQUEST", SWIG_From_int((int)(GEARMAN_MAGIC_REQUEST)));
4595
+ rb_define_const(mGearman, "GEARMAN_MAGIC_RESPONSE", SWIG_From_int((int)(GEARMAN_MAGIC_RESPONSE)));
4596
+ rb_define_const(mGearman, "GEARMAN_COMMAND_TEXT", SWIG_From_int((int)(GEARMAN_COMMAND_TEXT)));
4597
+ rb_define_const(mGearman, "GEARMAN_COMMAND_CAN_DO", SWIG_From_int((int)(GEARMAN_COMMAND_CAN_DO)));
4598
+ rb_define_const(mGearman, "GEARMAN_COMMAND_CANT_DO", SWIG_From_int((int)(GEARMAN_COMMAND_CANT_DO)));
4599
+ rb_define_const(mGearman, "GEARMAN_COMMAND_RESET_ABILITIES", SWIG_From_int((int)(GEARMAN_COMMAND_RESET_ABILITIES)));
4600
+ rb_define_const(mGearman, "GEARMAN_COMMAND_PRE_SLEEP", SWIG_From_int((int)(GEARMAN_COMMAND_PRE_SLEEP)));
4601
+ rb_define_const(mGearman, "GEARMAN_COMMAND_UNUSED", SWIG_From_int((int)(GEARMAN_COMMAND_UNUSED)));
4602
+ rb_define_const(mGearman, "GEARMAN_COMMAND_NOOP", SWIG_From_int((int)(GEARMAN_COMMAND_NOOP)));
4603
+ rb_define_const(mGearman, "GEARMAN_COMMAND_SUBMIT_JOB", SWIG_From_int((int)(GEARMAN_COMMAND_SUBMIT_JOB)));
4604
+ rb_define_const(mGearman, "GEARMAN_COMMAND_JOB_CREATED", SWIG_From_int((int)(GEARMAN_COMMAND_JOB_CREATED)));
4605
+ rb_define_const(mGearman, "GEARMAN_COMMAND_GRAB_JOB", SWIG_From_int((int)(GEARMAN_COMMAND_GRAB_JOB)));
4606
+ rb_define_const(mGearman, "GEARMAN_COMMAND_NO_JOB", SWIG_From_int((int)(GEARMAN_COMMAND_NO_JOB)));
4607
+ rb_define_const(mGearman, "GEARMAN_COMMAND_JOB_ASSIGN", SWIG_From_int((int)(GEARMAN_COMMAND_JOB_ASSIGN)));
4608
+ rb_define_const(mGearman, "GEARMAN_COMMAND_WORK_STATUS", SWIG_From_int((int)(GEARMAN_COMMAND_WORK_STATUS)));
4609
+ rb_define_const(mGearman, "GEARMAN_COMMAND_WORK_COMPLETE", SWIG_From_int((int)(GEARMAN_COMMAND_WORK_COMPLETE)));
4610
+ rb_define_const(mGearman, "GEARMAN_COMMAND_WORK_FAIL", SWIG_From_int((int)(GEARMAN_COMMAND_WORK_FAIL)));
4611
+ rb_define_const(mGearman, "GEARMAN_COMMAND_GET_STATUS", SWIG_From_int((int)(GEARMAN_COMMAND_GET_STATUS)));
4612
+ rb_define_const(mGearman, "GEARMAN_COMMAND_ECHO_REQ", SWIG_From_int((int)(GEARMAN_COMMAND_ECHO_REQ)));
4613
+ rb_define_const(mGearman, "GEARMAN_COMMAND_ECHO_RES", SWIG_From_int((int)(GEARMAN_COMMAND_ECHO_RES)));
4614
+ rb_define_const(mGearman, "GEARMAN_COMMAND_SUBMIT_JOB_BG", SWIG_From_int((int)(GEARMAN_COMMAND_SUBMIT_JOB_BG)));
4615
+ rb_define_const(mGearman, "GEARMAN_COMMAND_ERROR", SWIG_From_int((int)(GEARMAN_COMMAND_ERROR)));
4616
+ rb_define_const(mGearman, "GEARMAN_COMMAND_STATUS_RES", SWIG_From_int((int)(GEARMAN_COMMAND_STATUS_RES)));
4617
+ rb_define_const(mGearman, "GEARMAN_COMMAND_SUBMIT_JOB_HIGH", SWIG_From_int((int)(GEARMAN_COMMAND_SUBMIT_JOB_HIGH)));
4618
+ rb_define_const(mGearman, "GEARMAN_COMMAND_SET_CLIENT_ID", SWIG_From_int((int)(GEARMAN_COMMAND_SET_CLIENT_ID)));
4619
+ rb_define_const(mGearman, "GEARMAN_COMMAND_CAN_DO_TIMEOUT", SWIG_From_int((int)(GEARMAN_COMMAND_CAN_DO_TIMEOUT)));
4620
+ rb_define_const(mGearman, "GEARMAN_COMMAND_ALL_YOURS", SWIG_From_int((int)(GEARMAN_COMMAND_ALL_YOURS)));
4621
+ rb_define_const(mGearman, "GEARMAN_COMMAND_WORK_EXCEPTION", SWIG_From_int((int)(GEARMAN_COMMAND_WORK_EXCEPTION)));
4622
+ rb_define_const(mGearman, "GEARMAN_COMMAND_OPTION_REQ", SWIG_From_int((int)(GEARMAN_COMMAND_OPTION_REQ)));
4623
+ rb_define_const(mGearman, "GEARMAN_COMMAND_OPTION_RES", SWIG_From_int((int)(GEARMAN_COMMAND_OPTION_RES)));
4624
+ rb_define_const(mGearman, "GEARMAN_COMMAND_WORK_DATA", SWIG_From_int((int)(GEARMAN_COMMAND_WORK_DATA)));
4625
+ rb_define_const(mGearman, "GEARMAN_COMMAND_WORK_WARNING", SWIG_From_int((int)(GEARMAN_COMMAND_WORK_WARNING)));
4626
+ rb_define_const(mGearman, "GEARMAN_COMMAND_GRAB_JOB_UNIQ", SWIG_From_int((int)(GEARMAN_COMMAND_GRAB_JOB_UNIQ)));
4627
+ rb_define_const(mGearman, "GEARMAN_COMMAND_JOB_ASSIGN_UNIQ", SWIG_From_int((int)(GEARMAN_COMMAND_JOB_ASSIGN_UNIQ)));
4628
+ rb_define_const(mGearman, "GEARMAN_COMMAND_SUBMIT_JOB_HIGH_BG", SWIG_From_int((int)(GEARMAN_COMMAND_SUBMIT_JOB_HIGH_BG)));
4629
+ rb_define_const(mGearman, "GEARMAN_COMMAND_SUBMIT_JOB_LOW", SWIG_From_int((int)(GEARMAN_COMMAND_SUBMIT_JOB_LOW)));
4630
+ rb_define_const(mGearman, "GEARMAN_COMMAND_SUBMIT_JOB_LOW_BG", SWIG_From_int((int)(GEARMAN_COMMAND_SUBMIT_JOB_LOW_BG)));
4631
+ rb_define_const(mGearman, "GEARMAN_COMMAND_SUBMIT_JOB_SCHED", SWIG_From_int((int)(GEARMAN_COMMAND_SUBMIT_JOB_SCHED)));
4632
+ rb_define_const(mGearman, "GEARMAN_COMMAND_SUBMIT_JOB_EPOCH", SWIG_From_int((int)(GEARMAN_COMMAND_SUBMIT_JOB_EPOCH)));
4633
+ rb_define_const(mGearman, "GEARMAN_COMMAND_MAX", SWIG_From_int((int)(GEARMAN_COMMAND_MAX)));
4634
+ rb_define_const(mGearman, "GEARMAN_TASK_ALLOCATED", SWIG_From_int((int)(GEARMAN_TASK_ALLOCATED)));
4635
+ rb_define_const(mGearman, "GEARMAN_TASK_SEND_IN_USE", SWIG_From_int((int)(GEARMAN_TASK_SEND_IN_USE)));
4636
+ rb_define_const(mGearman, "GEARMAN_TASK_STATE_NEW", SWIG_From_int((int)(GEARMAN_TASK_STATE_NEW)));
4637
+ rb_define_const(mGearman, "GEARMAN_TASK_STATE_SUBMIT", SWIG_From_int((int)(GEARMAN_TASK_STATE_SUBMIT)));
4638
+ rb_define_const(mGearman, "GEARMAN_TASK_STATE_WORKLOAD", SWIG_From_int((int)(GEARMAN_TASK_STATE_WORKLOAD)));
4639
+ rb_define_const(mGearman, "GEARMAN_TASK_STATE_WORK", SWIG_From_int((int)(GEARMAN_TASK_STATE_WORK)));
4640
+ rb_define_const(mGearman, "GEARMAN_TASK_STATE_CREATED", SWIG_From_int((int)(GEARMAN_TASK_STATE_CREATED)));
4641
+ rb_define_const(mGearman, "GEARMAN_TASK_STATE_DATA", SWIG_From_int((int)(GEARMAN_TASK_STATE_DATA)));
4642
+ rb_define_const(mGearman, "GEARMAN_TASK_STATE_WARNING", SWIG_From_int((int)(GEARMAN_TASK_STATE_WARNING)));
4643
+ rb_define_const(mGearman, "GEARMAN_TASK_STATE_STATUS", SWIG_From_int((int)(GEARMAN_TASK_STATE_STATUS)));
4644
+ rb_define_const(mGearman, "GEARMAN_TASK_STATE_COMPLETE", SWIG_From_int((int)(GEARMAN_TASK_STATE_COMPLETE)));
4645
+ rb_define_const(mGearman, "GEARMAN_TASK_STATE_EXCEPTION", SWIG_From_int((int)(GEARMAN_TASK_STATE_EXCEPTION)));
4646
+ rb_define_const(mGearman, "GEARMAN_TASK_STATE_FAIL", SWIG_From_int((int)(GEARMAN_TASK_STATE_FAIL)));
4647
+ rb_define_const(mGearman, "GEARMAN_TASK_STATE_FINISHED", SWIG_From_int((int)(GEARMAN_TASK_STATE_FINISHED)));
4648
+ rb_define_const(mGearman, "GEARMAN_JOB_ALLOCATED", SWIG_From_int((int)(GEARMAN_JOB_ALLOCATED)));
4649
+ rb_define_const(mGearman, "GEARMAN_JOB_ASSIGNED_IN_USE", SWIG_From_int((int)(GEARMAN_JOB_ASSIGNED_IN_USE)));
4650
+ rb_define_const(mGearman, "GEARMAN_JOB_WORK_IN_USE", SWIG_From_int((int)(GEARMAN_JOB_WORK_IN_USE)));
4651
+ rb_define_const(mGearman, "GEARMAN_JOB_FINISHED", SWIG_From_int((int)(GEARMAN_JOB_FINISHED)));
4652
+ rb_define_const(mGearman, "GEARMAN_JOB_PRIORITY_HIGH", SWIG_From_int((int)(GEARMAN_JOB_PRIORITY_HIGH)));
4653
+ rb_define_const(mGearman, "GEARMAN_JOB_PRIORITY_NORMAL", SWIG_From_int((int)(GEARMAN_JOB_PRIORITY_NORMAL)));
4654
+ rb_define_const(mGearman, "GEARMAN_JOB_PRIORITY_LOW", SWIG_From_int((int)(GEARMAN_JOB_PRIORITY_LOW)));
4655
+ rb_define_const(mGearman, "GEARMAN_JOB_PRIORITY_MAX", SWIG_From_int((int)(GEARMAN_JOB_PRIORITY_MAX)));
4656
+ rb_define_const(mGearman, "GEARMAN_CLIENT_ALLOCATED", SWIG_From_int((int)(GEARMAN_CLIENT_ALLOCATED)));
4657
+ rb_define_const(mGearman, "GEARMAN_CLIENT_NON_BLOCKING", SWIG_From_int((int)(GEARMAN_CLIENT_NON_BLOCKING)));
4658
+ rb_define_const(mGearman, "GEARMAN_CLIENT_TASK_IN_USE", SWIG_From_int((int)(GEARMAN_CLIENT_TASK_IN_USE)));
4659
+ rb_define_const(mGearman, "GEARMAN_CLIENT_UNBUFFERED_RESULT", SWIG_From_int((int)(GEARMAN_CLIENT_UNBUFFERED_RESULT)));
4660
+ rb_define_const(mGearman, "GEARMAN_CLIENT_NO_NEW", SWIG_From_int((int)(GEARMAN_CLIENT_NO_NEW)));
4661
+ rb_define_const(mGearman, "GEARMAN_CLIENT_FREE_TASKS", SWIG_From_int((int)(GEARMAN_CLIENT_FREE_TASKS)));
4662
+ rb_define_const(mGearman, "GEARMAN_CLIENT_STATE_IDLE", SWIG_From_int((int)(GEARMAN_CLIENT_STATE_IDLE)));
4663
+ rb_define_const(mGearman, "GEARMAN_CLIENT_STATE_NEW", SWIG_From_int((int)(GEARMAN_CLIENT_STATE_NEW)));
4664
+ rb_define_const(mGearman, "GEARMAN_CLIENT_STATE_SUBMIT", SWIG_From_int((int)(GEARMAN_CLIENT_STATE_SUBMIT)));
4665
+ rb_define_const(mGearman, "GEARMAN_CLIENT_STATE_PACKET", SWIG_From_int((int)(GEARMAN_CLIENT_STATE_PACKET)));
4666
+ rb_define_const(mGearman, "GEARMAN_WORKER_ALLOCATED", SWIG_From_int((int)(GEARMAN_WORKER_ALLOCATED)));
4667
+ rb_define_const(mGearman, "GEARMAN_WORKER_NON_BLOCKING", SWIG_From_int((int)(GEARMAN_WORKER_NON_BLOCKING)));
4668
+ rb_define_const(mGearman, "GEARMAN_WORKER_PACKET_INIT", SWIG_From_int((int)(GEARMAN_WORKER_PACKET_INIT)));
4669
+ rb_define_const(mGearman, "GEARMAN_WORKER_GRAB_JOB_IN_USE", SWIG_From_int((int)(GEARMAN_WORKER_GRAB_JOB_IN_USE)));
4670
+ rb_define_const(mGearman, "GEARMAN_WORKER_PRE_SLEEP_IN_USE", SWIG_From_int((int)(GEARMAN_WORKER_PRE_SLEEP_IN_USE)));
4671
+ rb_define_const(mGearman, "GEARMAN_WORKER_WORK_JOB_IN_USE", SWIG_From_int((int)(GEARMAN_WORKER_WORK_JOB_IN_USE)));
4672
+ rb_define_const(mGearman, "GEARMAN_WORKER_CHANGE", SWIG_From_int((int)(GEARMAN_WORKER_CHANGE)));
4673
+ rb_define_const(mGearman, "GEARMAN_WORKER_GRAB_UNIQ", SWIG_From_int((int)(GEARMAN_WORKER_GRAB_UNIQ)));
4674
+ rb_define_const(mGearman, "GEARMAN_WORKER_TIMEOUT_RETURN", SWIG_From_int((int)(GEARMAN_WORKER_TIMEOUT_RETURN)));
4675
+ rb_define_const(mGearman, "GEARMAN_WORKER_STATE_START", SWIG_From_int((int)(GEARMAN_WORKER_STATE_START)));
4676
+ rb_define_const(mGearman, "GEARMAN_WORKER_STATE_FUNCTION_SEND", SWIG_From_int((int)(GEARMAN_WORKER_STATE_FUNCTION_SEND)));
4677
+ rb_define_const(mGearman, "GEARMAN_WORKER_STATE_CONNECT", SWIG_From_int((int)(GEARMAN_WORKER_STATE_CONNECT)));
4678
+ rb_define_const(mGearman, "GEARMAN_WORKER_STATE_GRAB_JOB_SEND", SWIG_From_int((int)(GEARMAN_WORKER_STATE_GRAB_JOB_SEND)));
4679
+ rb_define_const(mGearman, "GEARMAN_WORKER_STATE_GRAB_JOB_RECV", SWIG_From_int((int)(GEARMAN_WORKER_STATE_GRAB_JOB_RECV)));
4680
+ rb_define_const(mGearman, "GEARMAN_WORKER_STATE_PRE_SLEEP", SWIG_From_int((int)(GEARMAN_WORKER_STATE_PRE_SLEEP)));
4681
+ rb_define_const(mGearman, "GEARMAN_WORKER_FUNCTION_PACKET_IN_USE", SWIG_From_int((int)(GEARMAN_WORKER_FUNCTION_PACKET_IN_USE)));
4682
+ rb_define_const(mGearman, "GEARMAN_WORKER_FUNCTION_CHANGE", SWIG_From_int((int)(GEARMAN_WORKER_FUNCTION_CHANGE)));
4683
+ rb_define_const(mGearman, "GEARMAN_WORKER_FUNCTION_REMOVE", SWIG_From_int((int)(GEARMAN_WORKER_FUNCTION_REMOVE)));
4684
+ rb_define_const(mGearman, "GEARMAN_WORKER_WORK_STATE_GRAB_JOB", SWIG_From_int((int)(GEARMAN_WORKER_WORK_STATE_GRAB_JOB)));
4685
+ rb_define_const(mGearman, "GEARMAN_WORKER_WORK_STATE_FUNCTION", SWIG_From_int((int)(GEARMAN_WORKER_WORK_STATE_FUNCTION)));
4686
+ rb_define_const(mGearman, "GEARMAN_WORKER_WORK_STATE_COMPLETE", SWIG_From_int((int)(GEARMAN_WORKER_WORK_STATE_COMPLETE)));
4687
+ rb_define_const(mGearman, "GEARMAN_WORKER_WORK_STATE_FAIL", SWIG_From_int((int)(GEARMAN_WORKER_WORK_STATE_FAIL)));
4688
+ rb_define_module_function(mGearman, "version", _wrap_version, -1);
4689
+ rb_define_module_function(mGearman, "bugreport", _wrap_bugreport, -1);
4690
+
4691
+ SwigClassGearman.klass = rb_define_class_under(mGearman, "Gearman", rb_cObject);
4692
+ SWIG_TypeClientData(SWIGTYPE_p_gearman_st, (void *) &SwigClassGearman);
4693
+ rb_define_alloc_func(SwigClassGearman.klass, _wrap_Gearman_allocate);
4694
+ rb_define_method(SwigClassGearman.klass, "initialize", _wrap_new_Gearman, -1);
4695
+ rb_define_method(SwigClassGearman.klass, "copy", _wrap_Gearman_copy, -1);
4696
+ rb_define_method(SwigClassGearman.klass, "error", _wrap_Gearman_error, -1);
4697
+ rb_define_method(SwigClassGearman.klass, "errno", _wrap_Gearman_errno, -1);
4698
+ rb_define_method(SwigClassGearman.klass, "options", _wrap_Gearman_options, -1);
4699
+ rb_define_method(SwigClassGearman.klass, "set_options", _wrap_Gearman_set_options, -1);
4700
+ rb_define_method(SwigClassGearman.klass, "add_options", _wrap_Gearman_add_options, -1);
4701
+ rb_define_method(SwigClassGearman.klass, "remove_options", _wrap_Gearman_remove_options, -1);
4702
+ rb_define_method(SwigClassGearman.klass, "timeout", _wrap_Gearman_timeout, -1);
4703
+ rb_define_method(SwigClassGearman.klass, "set_timeout", _wrap_Gearman_set_timeout, -1);
4704
+ SwigClassGearman.mark = 0;
4705
+ SwigClassGearman.destroy = (void (*)(void *)) free_Gearman;
4706
+ SwigClassGearman.trackObjects = 0;
4707
+
4708
+ SwigClassClient.klass = rb_define_class_under(mGearman, "Client", rb_cObject);
4709
+ SWIG_TypeClientData(SWIGTYPE_p_gearman_client_st, (void *) &SwigClassClient);
4710
+ rb_define_alloc_func(SwigClassClient.klass, _wrap_Client_allocate);
4711
+ rb_define_method(SwigClassClient.klass, "initialize", _wrap_new_Client, -1);
4712
+ rb_define_method(SwigClassClient.klass, "copy", _wrap_Client_copy, -1);
4713
+ rb_define_method(SwigClassClient.klass, "error", _wrap_Client_error, -1);
4714
+ rb_define_method(SwigClassClient.klass, "errno", _wrap_Client_errno, -1);
4715
+ rb_define_method(SwigClassClient.klass, "options", _wrap_Client_options, -1);
4716
+ rb_define_method(SwigClassClient.klass, "set_options", _wrap_Client_set_options, -1);
4717
+ rb_define_method(SwigClassClient.klass, "add_options", _wrap_Client_add_options, -1);
4718
+ rb_define_method(SwigClassClient.klass, "remove_options", _wrap_Client_remove_options, -1);
4719
+ rb_define_method(SwigClassClient.klass, "add_server", _wrap_Client_add_server, -1);
4720
+ rb_define_method(SwigClassClient.klass, "add_servers", _wrap_Client_add_servers, -1);
4721
+ rb_define_method(SwigClassClient.klass, "remove_servers", _wrap_Client_remove_servers, -1);
4722
+ rb_define_method(SwigClassClient.klass, "do", _wrap_Client_do, -1);
4723
+ rb_define_method(SwigClassClient.klass, "do_high", _wrap_Client_do_high, -1);
4724
+ rb_define_method(SwigClassClient.klass, "do_low", _wrap_Client_do_low, -1);
4725
+ rb_define_method(SwigClassClient.klass, "job_handle", _wrap_Client_job_handle, -1);
4726
+ rb_define_method(SwigClassClient.klass, "status", _wrap_Client_status, -1);
4727
+ SwigClassClient.mark = 0;
4728
+ SwigClassClient.destroy = (void (*)(void *)) free_Client;
4729
+ SwigClassClient.trackObjects = 0;
4730
+
4731
+ SwigClassWorker.klass = rb_define_class_under(mGearman, "Worker", rb_cObject);
4732
+ SWIG_TypeClientData(SWIGTYPE_p_gearman_worker_st, (void *) &SwigClassWorker);
4733
+ rb_define_alloc_func(SwigClassWorker.klass, _wrap_Worker_allocate);
4734
+ rb_define_method(SwigClassWorker.klass, "initialize", _wrap_new_Worker, -1);
4735
+ rb_define_method(SwigClassWorker.klass, "copy", _wrap_Worker_copy, -1);
4736
+ rb_define_method(SwigClassWorker.klass, "error", _wrap_Worker_error, -1);
4737
+ rb_define_method(SwigClassWorker.klass, "errno", _wrap_Worker_errno, -1);
4738
+ rb_define_method(SwigClassWorker.klass, "options", _wrap_Worker_options, -1);
4739
+ rb_define_method(SwigClassWorker.klass, "set_options", _wrap_Worker_set_options, -1);
4740
+ rb_define_method(SwigClassWorker.klass, "add_options", _wrap_Worker_add_options, -1);
4741
+ rb_define_method(SwigClassWorker.klass, "remove_options", _wrap_Worker_remove_options, -1);
4742
+ rb_define_method(SwigClassWorker.klass, "timeout", _wrap_Worker_timeout, -1);
4743
+ rb_define_method(SwigClassWorker.klass, "set_timeout", _wrap_Worker_set_timeout, -1);
4744
+ rb_define_method(SwigClassWorker.klass, "add_server", _wrap_Worker_add_server, -1);
4745
+ rb_define_method(SwigClassWorker.klass, "add_servers", _wrap_Worker_add_servers, -1);
4746
+ rb_define_method(SwigClassWorker.klass, "register_function", _wrap_Worker_register_function, -1);
4747
+ rb_define_method(SwigClassWorker.klass, "unregister", _wrap_Worker_unregister, -1);
4748
+ rb_define_method(SwigClassWorker.klass, "unregister_all", _wrap_Worker_unregister_all, -1);
4749
+ rb_define_method(SwigClassWorker.klass, "grab_job", _wrap_Worker_grab_job, -1);
4750
+ rb_define_method(SwigClassWorker.klass, "add_function", _wrap_Worker_add_function, -1);
4751
+ rb_define_method(SwigClassWorker.klass, "work", _wrap_Worker_work, -1);
4752
+ SwigClassWorker.mark = 0;
4753
+ SwigClassWorker.destroy = (void (*)(void *)) free_Worker;
4754
+ SwigClassWorker.trackObjects = 0;
4755
+ }
4756
+