qpid_proton 0.36.0 → 0.37.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,14 +1,18 @@
1
1
  /* ----------------------------------------------------------------------------
2
2
  * This file was automatically generated by SWIG (http://www.swig.org).
3
- * Version 2.0.10
4
- *
5
- * This file is not intended to be easily readable and contains a number of
3
+ * Version 4.0.2
4
+ *
5
+ * This file is not intended to be easily readable and contains a number of
6
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.
7
+ * changes to this file unless you know what you are doing--modify the SWIG
8
+ * interface file instead.
9
9
  * ----------------------------------------------------------------------------- */
10
10
 
11
+
12
+ #ifndef SWIGRUBY
11
13
  #define SWIGRUBY
14
+ #endif
15
+
12
16
 
13
17
  /* -----------------------------------------------------------------------------
14
18
  * This section contains generic SWIG labels for method/variable
@@ -41,28 +45,28 @@
41
45
  #ifndef SWIGUNUSED
42
46
  # if defined(__GNUC__)
43
47
  # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
44
- # define SWIGUNUSED __attribute__ ((__unused__))
48
+ # define SWIGUNUSED __attribute__ ((__unused__))
45
49
  # else
46
50
  # define SWIGUNUSED
47
51
  # endif
48
52
  # elif defined(__ICC)
49
- # define SWIGUNUSED __attribute__ ((__unused__))
53
+ # define SWIGUNUSED __attribute__ ((__unused__))
50
54
  # else
51
- # define SWIGUNUSED
55
+ # define SWIGUNUSED
52
56
  # endif
53
57
  #endif
54
58
 
55
59
  #ifndef SWIG_MSC_UNSUPPRESS_4505
56
60
  # if defined(_MSC_VER)
57
61
  # pragma warning(disable : 4505) /* unreferenced local function has been removed */
58
- # endif
62
+ # endif
59
63
  #endif
60
64
 
61
65
  #ifndef SWIGUNUSEDPARM
62
66
  # ifdef __cplusplus
63
67
  # define SWIGUNUSEDPARM(p)
64
68
  # else
65
- # define SWIGUNUSEDPARM(p) p SWIGUNUSED
69
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
66
70
  # endif
67
71
  #endif
68
72
 
@@ -77,9 +81,11 @@
77
81
  #endif
78
82
 
79
83
  /* exporting methods */
80
- #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
81
- # ifndef GCC_HASCLASSVISIBILITY
82
- # define GCC_HASCLASSVISIBILITY
84
+ #if defined(__GNUC__)
85
+ # if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
86
+ # ifndef GCC_HASCLASSVISIBILITY
87
+ # define GCC_HASCLASSVISIBILITY
88
+ # endif
83
89
  # endif
84
90
  #endif
85
91
 
@@ -105,7 +111,7 @@
105
111
  # define SWIGSTDCALL __stdcall
106
112
  # else
107
113
  # define SWIGSTDCALL
108
- # endif
114
+ # endif
109
115
  #endif
110
116
 
111
117
  /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -118,6 +124,19 @@
118
124
  # define _SCL_SECURE_NO_DEPRECATE
119
125
  #endif
120
126
 
127
+ /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
128
+ #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
129
+ # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
130
+ #endif
131
+
132
+ /* Intel's compiler complains if a variable which was never initialised is
133
+ * cast to void, which is a common idiom which we use to indicate that we
134
+ * are aware a variable isn't used. So we just silence that warning.
135
+ * See: https://github.com/swig/swig/issues/192 for more discussion.
136
+ */
137
+ #ifdef __INTEL_COMPILER
138
+ # pragma warning disable 592
139
+ #endif
121
140
 
122
141
  /* -----------------------------------------------------------------------------
123
142
  * This section contains generic SWIG labels for method/variable
@@ -150,28 +169,28 @@
150
169
  #ifndef SWIGUNUSED
151
170
  # if defined(__GNUC__)
152
171
  # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
153
- # define SWIGUNUSED __attribute__ ((__unused__))
172
+ # define SWIGUNUSED __attribute__ ((__unused__))
154
173
  # else
155
174
  # define SWIGUNUSED
156
175
  # endif
157
176
  # elif defined(__ICC)
158
- # define SWIGUNUSED __attribute__ ((__unused__))
177
+ # define SWIGUNUSED __attribute__ ((__unused__))
159
178
  # else
160
- # define SWIGUNUSED
179
+ # define SWIGUNUSED
161
180
  # endif
162
181
  #endif
163
182
 
164
183
  #ifndef SWIG_MSC_UNSUPPRESS_4505
165
184
  # if defined(_MSC_VER)
166
185
  # pragma warning(disable : 4505) /* unreferenced local function has been removed */
167
- # endif
186
+ # endif
168
187
  #endif
169
188
 
170
189
  #ifndef SWIGUNUSEDPARM
171
190
  # ifdef __cplusplus
172
191
  # define SWIGUNUSEDPARM(p)
173
192
  # else
174
- # define SWIGUNUSEDPARM(p) p SWIGUNUSED
193
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
175
194
  # endif
176
195
  #endif
177
196
 
@@ -186,9 +205,11 @@
186
205
  #endif
187
206
 
188
207
  /* exporting methods */
189
- #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
190
- # ifndef GCC_HASCLASSVISIBILITY
191
- # define GCC_HASCLASSVISIBILITY
208
+ #if defined(__GNUC__)
209
+ # if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
210
+ # ifndef GCC_HASCLASSVISIBILITY
211
+ # define GCC_HASCLASSVISIBILITY
212
+ # endif
192
213
  # endif
193
214
  #endif
194
215
 
@@ -214,7 +235,7 @@
214
235
  # define SWIGSTDCALL __stdcall
215
236
  # else
216
237
  # define SWIGSTDCALL
217
- # endif
238
+ # endif
218
239
  #endif
219
240
 
220
241
  /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -227,6 +248,19 @@
227
248
  # define _SCL_SECURE_NO_DEPRECATE
228
249
  #endif
229
250
 
251
+ /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
252
+ #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
253
+ # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
254
+ #endif
255
+
256
+ /* Intel's compiler complains if a variable which was never initialised is
257
+ * cast to void, which is a common idiom which we use to indicate that we
258
+ * are aware a variable isn't used. So we just silence that warning.
259
+ * See: https://github.com/swig/swig/issues/192 for more discussion.
260
+ */
261
+ #ifdef __INTEL_COMPILER
262
+ # pragma warning disable 592
263
+ #endif
230
264
 
231
265
  /* -----------------------------------------------------------------------------
232
266
  * swigrun.swg
@@ -252,7 +286,7 @@
252
286
  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
253
287
  creating a static or dynamic library from the SWIG runtime code.
254
288
  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
255
-
289
+
256
290
  But only do this if strictly necessary, ie, if you have problems
257
291
  with your compiler or suchlike.
258
292
  */
@@ -273,21 +307,22 @@
273
307
  /* Flags for pointer conversions */
274
308
  #define SWIG_POINTER_DISOWN 0x1
275
309
  #define SWIG_CAST_NEW_MEMORY 0x2
310
+ #define SWIG_POINTER_NO_NULL 0x4
276
311
 
277
312
  /* Flags for new pointer objects */
278
313
  #define SWIG_POINTER_OWN 0x1
279
314
 
280
315
 
281
- /*
316
+ /*
282
317
  Flags/methods for returning states.
283
-
284
- The SWIG conversion methods, as ConvertPtr, return an integer
318
+
319
+ The SWIG conversion methods, as ConvertPtr, return an integer
285
320
  that tells if the conversion was successful or not. And if not,
286
321
  an error code can be returned (see swigerrors.swg for the codes).
287
-
322
+
288
323
  Use the following macros/flags to set or process the returning
289
324
  states.
290
-
325
+
291
326
  In old versions of SWIG, code such as the following was usually written:
292
327
 
293
328
  if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
@@ -320,23 +355,23 @@
320
355
  } else {
321
356
  // fail code
322
357
  }
323
-
358
+
324
359
  I.e., now SWIG_ConvertPtr can return new objects and you can
325
360
  identify the case and take care of the deallocation. Of course that
326
361
  also requires SWIG_ConvertPtr to return new result values, such as
327
362
 
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
- }
363
+ int SWIG_ConvertPtr(obj, ptr,...) {
364
+ if (<obj is ok>) {
365
+ if (<need new object>) {
366
+ *ptr = <ptr to new allocated object>;
367
+ return SWIG_NEWOBJ;
368
+ } else {
369
+ *ptr = <ptr to old object>;
370
+ return SWIG_OLDOBJ;
371
+ }
372
+ } else {
373
+ return SWIG_BADOBJ;
374
+ }
340
375
  }
341
376
 
342
377
  Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
@@ -350,17 +385,17 @@
350
385
  int fooi(int);
351
386
 
352
387
  and you call
353
-
388
+
354
389
  food(1) // cast rank '1' (1 -> 1.0)
355
390
  fooi(1) // cast rank '0'
356
391
 
357
392
  just use the SWIG_AddCast()/SWIG_CheckState()
358
393
  */
359
394
 
360
- #define SWIG_OK (0)
395
+ #define SWIG_OK (0)
361
396
  #define SWIG_ERROR (-1)
362
397
  #define SWIG_IsOK(r) (r >= 0)
363
- #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
398
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
364
399
 
365
400
  /* The CastRankLimit says how many bits are used for the cast rank */
366
401
  #define SWIG_CASTRANKLIMIT (1 << 8)
@@ -391,11 +426,11 @@
391
426
  # endif
392
427
  # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
393
428
  # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
394
- SWIGINTERNINLINE int SWIG_AddCast(int r) {
429
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
395
430
  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
396
431
  }
397
- SWIGINTERNINLINE int SWIG_CheckState(int r) {
398
- return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
432
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
433
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
399
434
  }
400
435
  #else /* no cast-rank mode */
401
436
  # define SWIG_AddCast(r) (r)
@@ -442,7 +477,7 @@ typedef struct swig_module_info {
442
477
  void *clientdata; /* Language specific module data */
443
478
  } swig_module_info;
444
479
 
445
- /*
480
+ /*
446
481
  Compare two type names skipping the space characters, therefore
447
482
  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
448
483
 
@@ -515,7 +550,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
515
550
  return 0;
516
551
  }
517
552
 
518
- /*
553
+ /*
519
554
  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
520
555
  */
521
556
  SWIGRUNTIME swig_cast_info *
@@ -550,7 +585,7 @@ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
550
585
  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
551
586
  }
552
587
 
553
- /*
588
+ /*
554
589
  Dynamic pointer casting. Down an inheritance hierarchy
555
590
  */
556
591
  SWIGRUNTIME swig_type_info *
@@ -594,7 +629,7 @@ SWIG_TypePrettyName(const swig_type_info *type) {
594
629
  return type->name;
595
630
  }
596
631
 
597
- /*
632
+ /*
598
633
  Set the clientdata field for a type
599
634
  */
600
635
  SWIGRUNTIME void
@@ -602,14 +637,14 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
602
637
  swig_cast_info *cast = ti->cast;
603
638
  /* if (ti->clientdata == clientdata) return; */
604
639
  ti->clientdata = clientdata;
605
-
640
+
606
641
  while (cast) {
607
642
  if (!cast->converter) {
608
643
  swig_type_info *tc = cast->type;
609
644
  if (!tc->clientdata) {
610
645
  SWIG_TypeClientData(tc, clientdata);
611
646
  }
612
- }
647
+ }
613
648
  cast = cast->next;
614
649
  }
615
650
  }
@@ -618,31 +653,31 @@ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
618
653
  SWIG_TypeClientData(ti, clientdata);
619
654
  ti->owndata = 1;
620
655
  }
621
-
656
+
622
657
  /*
623
658
  Search for a swig_type_info structure only by mangled name
624
659
  Search is a O(log #types)
625
-
626
- We start searching at module start, and finish searching when start == end.
660
+
661
+ We start searching at module start, and finish searching when start == end.
627
662
  Note: if start == end at the beginning of the function, we go all the way around
628
663
  the circular list.
629
664
  */
630
665
  SWIGRUNTIME swig_type_info *
631
- SWIG_MangledTypeQueryModule(swig_module_info *start,
632
- swig_module_info *end,
666
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
667
+ swig_module_info *end,
633
668
  const char *name) {
634
669
  swig_module_info *iter = start;
635
670
  do {
636
671
  if (iter->size) {
637
- register size_t l = 0;
638
- register size_t r = iter->size - 1;
672
+ size_t l = 0;
673
+ size_t r = iter->size - 1;
639
674
  do {
640
675
  /* since l+r >= 0, we can (>> 1) instead (/ 2) */
641
- register size_t i = (l + r) >> 1;
676
+ size_t i = (l + r) >> 1;
642
677
  const char *iname = iter->types[i]->name;
643
678
  if (iname) {
644
- register int compare = strcmp(name, iname);
645
- if (compare == 0) {
679
+ int compare = strcmp(name, iname);
680
+ if (compare == 0) {
646
681
  return iter->types[i];
647
682
  } else if (compare < 0) {
648
683
  if (i) {
@@ -667,14 +702,14 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
667
702
  Search for a swig_type_info structure for either a mangled name or a human readable name.
668
703
  It first searches the mangled names of the types, which is a O(log #types)
669
704
  If a type is not found it then searches the human readable names, which is O(#types).
670
-
671
- We start searching at module start, and finish searching when start == end.
705
+
706
+ We start searching at module start, and finish searching when start == end.
672
707
  Note: if start == end at the beginning of the function, we go all the way around
673
708
  the circular list.
674
709
  */
675
710
  SWIGRUNTIME swig_type_info *
676
- SWIG_TypeQueryModule(swig_module_info *start,
677
- swig_module_info *end,
711
+ SWIG_TypeQueryModule(swig_module_info *start,
712
+ swig_module_info *end,
678
713
  const char *name) {
679
714
  /* STEP 1: Search the name field using binary search */
680
715
  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
@@ -685,7 +720,7 @@ SWIG_TypeQueryModule(swig_module_info *start,
685
720
  of the str field (the human readable name) */
686
721
  swig_module_info *iter = start;
687
722
  do {
688
- register size_t i = 0;
723
+ size_t i = 0;
689
724
  for (; i < iter->size; ++i) {
690
725
  if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
691
726
  return iter->types[i];
@@ -693,56 +728,56 @@ SWIG_TypeQueryModule(swig_module_info *start,
693
728
  iter = iter->next;
694
729
  } while (iter != end);
695
730
  }
696
-
731
+
697
732
  /* neither found a match */
698
733
  return 0;
699
734
  }
700
735
 
701
- /*
736
+ /*
702
737
  Pack binary data into a string
703
738
  */
704
739
  SWIGRUNTIME char *
705
740
  SWIG_PackData(char *c, void *ptr, size_t sz) {
706
741
  static const char hex[17] = "0123456789abcdef";
707
- register const unsigned char *u = (unsigned char *) ptr;
708
- register const unsigned char *eu = u + sz;
742
+ const unsigned char *u = (unsigned char *) ptr;
743
+ const unsigned char *eu = u + sz;
709
744
  for (; u != eu; ++u) {
710
- register unsigned char uu = *u;
745
+ unsigned char uu = *u;
711
746
  *(c++) = hex[(uu & 0xf0) >> 4];
712
747
  *(c++) = hex[uu & 0xf];
713
748
  }
714
749
  return c;
715
750
  }
716
751
 
717
- /*
752
+ /*
718
753
  Unpack binary data from a string
719
754
  */
720
755
  SWIGRUNTIME const char *
721
756
  SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
722
- register unsigned char *u = (unsigned char *) ptr;
723
- register const unsigned char *eu = u + sz;
757
+ unsigned char *u = (unsigned char *) ptr;
758
+ const unsigned char *eu = u + sz;
724
759
  for (; u != eu; ++u) {
725
- register char d = *(c++);
726
- register unsigned char uu;
760
+ char d = *(c++);
761
+ unsigned char uu;
727
762
  if ((d >= '0') && (d <= '9'))
728
- uu = ((d - '0') << 4);
763
+ uu = (unsigned char)((d - '0') << 4);
729
764
  else if ((d >= 'a') && (d <= 'f'))
730
- uu = ((d - ('a'-10)) << 4);
731
- else
765
+ uu = (unsigned char)((d - ('a'-10)) << 4);
766
+ else
732
767
  return (char *) 0;
733
768
  d = *(c++);
734
769
  if ((d >= '0') && (d <= '9'))
735
- uu |= (d - '0');
770
+ uu |= (unsigned char)(d - '0');
736
771
  else if ((d >= 'a') && (d <= 'f'))
737
- uu |= (d - ('a'-10));
738
- else
772
+ uu |= (unsigned char)(d - ('a'-10));
773
+ else
739
774
  return (char *) 0;
740
775
  *u = uu;
741
776
  }
742
777
  return c;
743
778
  }
744
779
 
745
- /*
780
+ /*
746
781
  Pack 'void *' into a string buffer.
747
782
  */
748
783
  SWIGRUNTIME char *
@@ -802,18 +837,18 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
802
837
  #endif
803
838
 
804
839
  /* Errors in SWIG */
805
- #define SWIG_UnknownError -1
806
- #define SWIG_IOError -2
807
- #define SWIG_RuntimeError -3
808
- #define SWIG_IndexError -4
809
- #define SWIG_TypeError -5
810
- #define SWIG_DivisionByZero -6
811
- #define SWIG_OverflowError -7
812
- #define SWIG_SyntaxError -8
813
- #define SWIG_ValueError -9
840
+ #define SWIG_UnknownError -1
841
+ #define SWIG_IOError -2
842
+ #define SWIG_RuntimeError -3
843
+ #define SWIG_IndexError -4
844
+ #define SWIG_TypeError -5
845
+ #define SWIG_DivisionByZero -6
846
+ #define SWIG_OverflowError -7
847
+ #define SWIG_SyntaxError -8
848
+ #define SWIG_ValueError -9
814
849
  #define SWIG_SystemError -10
815
850
  #define SWIG_AttributeError -11
816
- #define SWIG_MemoryError -12
851
+ #define SWIG_MemoryError -12
817
852
  #define SWIG_NullReferenceError -13
818
853
 
819
854
 
@@ -911,42 +946,53 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
911
946
  #ifndef RSTRUCT_PTR
912
947
  # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
913
948
  #endif
949
+ #ifndef RTYPEDDATA_P
950
+ # define RTYPEDDATA_P(x) (TYPE(x) != T_DATA)
951
+ #endif
914
952
 
915
953
 
916
954
 
917
955
  /*
918
- * Need to be very careful about how these macros are defined, especially
919
- * when compiling C++ code or C code with an ANSI C compiler.
956
+ * The following macros are used for providing the correct type of a
957
+ * function pointer to the Ruby C API.
958
+ * Starting with Ruby 2.7 (corresponding to RB_METHOD_DEFINITION_DECL being
959
+ * defined) these macros act transparently due to Ruby's moving away from
960
+ * ANYARGS and instead employing strict function signatures.
961
+ *
962
+ * Note: In case of C (not C++) the macros are transparent even before
963
+ * Ruby 2.7 due to the fact that the Ruby C API used function declarators
964
+ * with empty parentheses, which allows for an unspecified number of
965
+ * arguments.
966
+ *
967
+ * PROTECTFUNC(f) is used for the function pointer argument of the Ruby
968
+ * C API function rb_protect().
920
969
  *
921
- * VALUEFUNC(f) is a macro used to typecast a C function that implements
922
- * a Ruby method so that it can be passed as an argument to API functions
923
- * like rb_define_method() and rb_define_singleton_method().
970
+ * VALUEFUNC(f) is used for the function pointer argument(s) of Ruby C API
971
+ * functions like rb_define_method() and rb_define_singleton_method().
924
972
  *
925
- * VOIDFUNC(f) is a macro used to typecast a C function that implements
926
- * either the "mark" or "free" stuff for a Ruby Data object, so that it
927
- * can be passed as an argument to API functions like Data_Wrap_Struct()
973
+ * VOIDFUNC(f) is used to typecast a C function that implements either
974
+ * the "mark" or "free" stuff for a Ruby Data object, so that it can be
975
+ * passed as an argument to Ruby C API functions like Data_Wrap_Struct()
928
976
  * and Data_Make_Struct().
977
+ *
978
+ * SWIG_RUBY_VOID_ANYARGS_FUNC(f) is used for the function pointer
979
+ * argument(s) of Ruby C API functions like rb_define_virtual_variable().
980
+ *
981
+ * SWIG_RUBY_INT_ANYARGS_FUNC(f) is used for the function pointer
982
+ * argument(s) of Ruby C API functions like st_foreach().
929
983
  */
930
-
931
- #ifdef __cplusplus
932
- # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
933
- # define PROTECTFUNC(f) ((VALUE (*)()) f)
934
- # define VALUEFUNC(f) ((VALUE (*)()) f)
935
- # define VOIDFUNC(f) ((void (*)()) f)
936
- # else
937
- # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
938
- # define PROTECTFUNC(f) ((VALUE (*)()) f)
939
- # define VALUEFUNC(f) ((VALUE (*)()) f)
940
- # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
941
- # else /* These definitions should work for Ruby 1.7+ */
942
- # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
943
- # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
944
- # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
945
- # endif
946
- # endif
984
+ #if defined(__cplusplus) && !defined(RB_METHOD_DEFINITION_DECL)
985
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
986
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
987
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
988
+ # define SWIG_RUBY_VOID_ANYARGS_FUNC(f) ((void (*)(ANYARGS))(f))
989
+ # define SWIG_RUBY_INT_ANYARGS_FUNC(f) ((int (*)(ANYARGS))(f))
947
990
  #else
991
+ # define PROTECTFUNC(f) (f)
948
992
  # define VALUEFUNC(f) (f)
949
993
  # define VOIDFUNC(f) (f)
994
+ # define SWIG_RUBY_VOID_ANYARGS_FUNC(f) (f)
995
+ # define SWIG_RUBY_INT_ANYARGS_FUNC(f) (f)
950
996
  #endif
951
997
 
952
998
  /* Don't use for expressions have side effect */
@@ -1134,7 +1180,7 @@ void Ruby_Format_OverloadedError(
1134
1180
  /* -----------------------------------------------------------------------------
1135
1181
  * rubytracking.swg
1136
1182
  *
1137
- * This file contains support for tracking mappings from
1183
+ * This file contains support for tracking mappings from
1138
1184
  * Ruby objects to C++ objects. This functionality is needed
1139
1185
  * to implement mark functions for Ruby's mark and sweep
1140
1186
  * garbage collector.
@@ -1144,6 +1190,11 @@ void Ruby_Format_OverloadedError(
1144
1190
  extern "C" {
1145
1191
  #endif
1146
1192
 
1193
+ #if !defined(ST_DATA_T_DEFINED)
1194
+ /* Needs to be explicitly included for Ruby 1.8 and earlier */
1195
+ #include <st.h>
1196
+ #endif
1197
+
1147
1198
  /* Ruby 1.8 actually assumes the first case. */
1148
1199
  #if SIZEOF_VOIDP == SIZEOF_LONG
1149
1200
  # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
@@ -1155,109 +1206,69 @@ extern "C" {
1155
1206
  # error sizeof(void*) is not the same as long or long long
1156
1207
  #endif
1157
1208
 
1158
-
1159
- /* Global Ruby hash table to store Trackings from C/C++
1160
- structs to Ruby Objects.
1209
+ /* Global hash table to store Trackings from C/C++
1210
+ structs to Ruby Objects.
1161
1211
  */
1162
- static VALUE swig_ruby_trackings = Qnil;
1212
+ static st_table* swig_ruby_trackings = NULL;
1163
1213
 
1164
- /* Global variable that stores a reference to the ruby
1165
- hash table delete function. */
1166
- static ID swig_ruby_hash_delete;
1214
+ static VALUE swig_ruby_trackings_count(ID id, VALUE *var) {
1215
+ return SWIG2NUM(swig_ruby_trackings->num_entries);
1216
+ }
1167
1217
 
1168
- /* Setup a Ruby hash table to store Trackings */
1218
+
1219
+ /* Setup a hash table to store Trackings */
1169
1220
  SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1170
- /* Create a ruby hash table to store Trackings from C++
1221
+ /* Create a hash table to store Trackings from C++
1171
1222
  objects to Ruby objects. */
1172
1223
 
1173
- /* Try to see if some other .so has already created a
1224
+ /* Try to see if some other .so has already created a
1174
1225
  tracking hash table, which we keep hidden in an instance var
1175
1226
  in the SWIG module.
1176
1227
  This is done to allow multiple DSOs to share the same
1177
1228
  tracking table.
1178
1229
  */
1179
- ID trackings_id = rb_intern( "@__trackings__" );
1230
+ VALUE trackings_value = Qnil;
1231
+ /* change the variable name so that we can mix modules
1232
+ compiled with older SWIG's - this used to be called "@__trackings__" */
1233
+ ID trackings_id = rb_intern( "@__safetrackings__" );
1180
1234
  VALUE verbose = rb_gv_get("VERBOSE");
1181
1235
  rb_gv_set("VERBOSE", Qfalse);
1182
- swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
1236
+ trackings_value = rb_ivar_get( _mSWIG, trackings_id );
1183
1237
  rb_gv_set("VERBOSE", verbose);
1184
1238
 
1185
- /* No, it hasn't. Create one ourselves */
1186
- if ( swig_ruby_trackings == Qnil )
1187
- {
1188
- swig_ruby_trackings = rb_hash_new();
1189
- rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
1190
- }
1191
-
1192
- /* Now store a reference to the hash table delete function
1193
- so that we only have to look it up once.*/
1194
- swig_ruby_hash_delete = rb_intern("delete");
1195
- }
1196
-
1197
- /* Get a Ruby number to reference a pointer */
1198
- SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1199
- /* We cast the pointer to an unsigned long
1200
- and then store a reference to it using
1201
- a Ruby number object. */
1202
-
1203
- /* Convert the pointer to a Ruby number */
1204
- return SWIG2NUM(ptr);
1205
- }
1206
-
1207
- /* Get a Ruby number to reference an object */
1208
- SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1209
- /* We cast the object to an unsigned long
1210
- and then store a reference to it using
1211
- a Ruby number object. */
1212
-
1213
- /* Convert the Object to a Ruby number */
1214
- return SWIG2NUM(object);
1215
- }
1216
-
1217
- /* Get a Ruby object from a previously stored reference */
1218
- SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1219
- /* The provided Ruby number object is a reference
1220
- to the Ruby object we want.*/
1239
+ /* The trick here is that we have to store the hash table
1240
+ pointer in a Ruby variable. We do not want Ruby's GC to
1241
+ treat this pointer as a Ruby object, so we convert it to
1242
+ a Ruby numeric value. */
1243
+ if (trackings_value == Qnil) {
1244
+ /* No, it hasn't. Create one ourselves */
1245
+ swig_ruby_trackings = st_init_numtable();
1246
+ rb_ivar_set( _mSWIG, trackings_id, SWIG2NUM(swig_ruby_trackings) );
1247
+ } else {
1248
+ swig_ruby_trackings = (st_table*)NUM2SWIG(trackings_value);
1249
+ }
1221
1250
 
1222
- /* Convert the Ruby number to a Ruby object */
1223
- return NUM2SWIG(reference);
1251
+ rb_define_virtual_variable("SWIG_TRACKINGS_COUNT",
1252
+ VALUEFUNC(swig_ruby_trackings_count),
1253
+ SWIG_RUBY_VOID_ANYARGS_FUNC((rb_gvar_setter_t*)NULL));
1224
1254
  }
1225
1255
 
1226
1256
  /* Add a Tracking from a C/C++ struct to a Ruby object */
1227
1257
  SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
1228
- /* In a Ruby hash table we store the pointer and
1229
- the associated Ruby object. The trick here is
1230
- that we cannot store the Ruby object directly - if
1231
- we do then it cannot be garbage collected. So
1232
- instead we typecast it as a unsigned long and
1233
- convert it to a Ruby number object.*/
1234
-
1235
- /* Get a reference to the pointer as a Ruby number */
1236
- VALUE key = SWIG_RubyPtrToReference(ptr);
1237
-
1238
- /* Get a reference to the Ruby object as a Ruby number */
1239
- VALUE value = SWIG_RubyObjectToReference(object);
1240
-
1241
1258
  /* Store the mapping to the global hash table. */
1242
- rb_hash_aset(swig_ruby_trackings, key, value);
1259
+ st_insert(swig_ruby_trackings, (st_data_t)ptr, object);
1243
1260
  }
1244
1261
 
1245
1262
  /* Get the Ruby object that owns the specified C/C++ struct */
1246
1263
  SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1247
- /* Get a reference to the pointer as a Ruby number */
1248
- VALUE key = SWIG_RubyPtrToReference(ptr);
1249
-
1250
1264
  /* Now lookup the value stored in the global hash table */
1251
- VALUE value = rb_hash_aref(swig_ruby_trackings, key);
1252
-
1253
- if (value == Qnil) {
1254
- /* No object exists - return nil. */
1265
+ VALUE value;
1266
+
1267
+ if (st_lookup(swig_ruby_trackings, (st_data_t)ptr, &value)) {
1268
+ return value;
1269
+ } else {
1255
1270
  return Qnil;
1256
1271
  }
1257
- else {
1258
- /* Convert this value to Ruby object */
1259
- return SWIG_RubyReferenceToObject(value);
1260
- }
1261
1272
  }
1262
1273
 
1263
1274
  /* Remove a Tracking from a C/C++ struct to a Ruby object. It
@@ -1265,25 +1276,39 @@ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1265
1276
  since the same memory address may be reused later to create
1266
1277
  a new object. */
1267
1278
  SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
1268
- /* Get a reference to the pointer as a Ruby number */
1269
- VALUE key = SWIG_RubyPtrToReference(ptr);
1270
-
1271
- /* Delete the object from the hash table by calling Ruby's
1272
- do this we need to call the Hash.delete method.*/
1273
- rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
1279
+ /* Delete the object from the hash table */
1280
+ st_delete(swig_ruby_trackings, (st_data_t *)&ptr, NULL);
1274
1281
  }
1275
1282
 
1276
1283
  /* This is a helper method that unlinks a Ruby object from its
1277
1284
  underlying C++ object. This is needed if the lifetime of the
1278
- Ruby object is longer than the C++ object */
1285
+ Ruby object is longer than the C++ object. */
1279
1286
  SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
1280
1287
  VALUE object = SWIG_RubyInstanceFor(ptr);
1281
1288
 
1282
1289
  if (object != Qnil) {
1290
+ // object might have the T_ZOMBIE type, but that's just
1291
+ // because the GC has flagged it as such for a deferred
1292
+ // destruction. Until then, it's still a T_DATA object.
1283
1293
  DATA_PTR(object) = 0;
1284
1294
  }
1285
1295
  }
1286
1296
 
1297
+ /* This is a helper method that iterates over all the trackings
1298
+ passing the C++ object pointer and its related Ruby object
1299
+ to the passed callback function. */
1300
+
1301
+ /* Proxy method to abstract the internal trackings datatype */
1302
+ static int swig_ruby_internal_iterate_callback(st_data_t ptr, st_data_t obj, st_data_t meth) {
1303
+ ((void (*) (void *, VALUE))meth)((void *)ptr, (VALUE)obj);
1304
+ return ST_CONTINUE;
1305
+ }
1306
+
1307
+ SWIGRUNTIME void SWIG_RubyIterateTrackings( void(*meth)(void* ptr, VALUE obj) ) {
1308
+ st_foreach(swig_ruby_trackings,
1309
+ SWIG_RUBY_INT_ANYARGS_FUNC(swig_ruby_internal_iterate_callback),
1310
+ (st_data_t)meth);
1311
+ }
1287
1312
 
1288
1313
  #ifdef __cplusplus
1289
1314
  }
@@ -1342,7 +1367,7 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1342
1367
  #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1343
1368
  #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
1344
1369
  #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
1345
- #define swig_owntype ruby_owntype
1370
+ #define swig_owntype swig_ruby_owntype
1346
1371
 
1347
1372
  /* for raw packed data */
1348
1373
  #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
@@ -1479,14 +1504,13 @@ SWIG_Ruby_InitRuntime(void)
1479
1504
  SWIGRUNTIME void
1480
1505
  SWIG_Ruby_define_class(swig_type_info *type)
1481
1506
  {
1482
- VALUE klass;
1483
1507
  char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1484
1508
  sprintf(klass_name, "TYPE%s", type->name);
1485
1509
  if (NIL_P(_cSWIG_Pointer)) {
1486
1510
  _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
1487
1511
  rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
1488
1512
  }
1489
- klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1513
+ rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1490
1514
  free((void *) klass_name);
1491
1515
  }
1492
1516
 
@@ -1500,10 +1524,11 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1500
1524
  swig_class *sklass;
1501
1525
  VALUE klass;
1502
1526
  VALUE obj;
1503
-
1527
+
1504
1528
  if (!ptr)
1505
1529
  return Qnil;
1506
-
1530
+
1531
+ assert(type);
1507
1532
  if (type->clientdata) {
1508
1533
  sklass = (swig_class *) type->clientdata;
1509
1534
 
@@ -1511,7 +1536,7 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1511
1536
  track = sklass->trackObjects;
1512
1537
  if (track) {
1513
1538
  obj = SWIG_RubyInstanceFor(ptr);
1514
-
1539
+
1515
1540
  /* Check the object's type and make sure it has the correct type.
1516
1541
  It might not in cases where methods do things like
1517
1542
  downcast methods. */
@@ -1543,7 +1568,7 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1543
1568
  obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1544
1569
  }
1545
1570
  rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1546
-
1571
+
1547
1572
  return obj;
1548
1573
  }
1549
1574
 
@@ -1563,26 +1588,30 @@ SWIGRUNTIMEINLINE char *
1563
1588
  SWIG_Ruby_MangleStr(VALUE obj)
1564
1589
  {
1565
1590
  VALUE stype = rb_iv_get(obj, "@__swigtype__");
1591
+ if (NIL_P(stype))
1592
+ return NULL;
1566
1593
  return StringValuePtr(stype);
1567
1594
  }
1568
1595
 
1569
1596
  /* Acquire a pointer value */
1570
- typedef void (*ruby_owntype)(void*);
1571
-
1572
- SWIGRUNTIME ruby_owntype
1573
- SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
1574
- if (obj) {
1575
- ruby_owntype oldown = RDATA(obj)->dfree;
1576
- RDATA(obj)->dfree = own;
1577
- return oldown;
1578
- } else {
1579
- return 0;
1597
+ typedef struct {
1598
+ void (*datafree)(void *);
1599
+ int own;
1600
+ } swig_ruby_owntype;
1601
+
1602
+ SWIGRUNTIME swig_ruby_owntype
1603
+ SWIG_Ruby_AcquirePtr(VALUE obj, swig_ruby_owntype own) {
1604
+ swig_ruby_owntype oldown = {0, 0};
1605
+ if (TYPE(obj) == T_DATA && !RTYPEDDATA_P(obj)) {
1606
+ oldown.datafree = RDATA(obj)->dfree;
1607
+ RDATA(obj)->dfree = own.datafree;
1580
1608
  }
1609
+ return oldown;
1581
1610
  }
1582
1611
 
1583
1612
  /* Convert a pointer value */
1584
1613
  SWIGRUNTIME int
1585
- SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
1614
+ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, swig_ruby_owntype *own)
1586
1615
  {
1587
1616
  char *c;
1588
1617
  swig_cast_info *tc;
@@ -1590,16 +1619,20 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
1590
1619
 
1591
1620
  /* Grab the pointer */
1592
1621
  if (NIL_P(obj)) {
1593
- *ptr = 0;
1594
- return SWIG_OK;
1622
+ if (ptr)
1623
+ *ptr = 0;
1624
+ return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
1595
1625
  } else {
1596
- if (TYPE(obj) != T_DATA) {
1626
+ if (TYPE(obj) != T_DATA || (TYPE(obj) == T_DATA && RTYPEDDATA_P(obj))) {
1597
1627
  return SWIG_ERROR;
1598
1628
  }
1599
1629
  Data_Get_Struct(obj, void, vptr);
1600
1630
  }
1601
1631
 
1602
- if (own) *own = RDATA(obj)->dfree;
1632
+ if (own) {
1633
+ own->datafree = RDATA(obj)->dfree;
1634
+ own->own = 0;
1635
+ }
1603
1636
 
1604
1637
  /* Check to see if the input object is giving up ownership
1605
1638
  of the underlying C struct or C++ object. If so then we
@@ -1634,8 +1667,6 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
1634
1667
  /* The object has already been deleted */
1635
1668
  return SWIG_ObjectPreviouslyDeletedError;
1636
1669
  }
1637
- *ptr = vptr;
1638
- return SWIG_OK;
1639
1670
  }
1640
1671
  }
1641
1672
  if ((c = SWIG_MangleStr(obj)) == NULL) {
@@ -1645,12 +1676,23 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
1645
1676
  if (!tc) {
1646
1677
  return SWIG_ERROR;
1647
1678
  } else {
1648
- int newmemory = 0;
1649
- *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1650
- assert(!newmemory); /* newmemory handling not yet implemented */
1679
+ if (ptr) {
1680
+ if (tc->type == ty) {
1681
+ *ptr = vptr;
1682
+ } else {
1683
+ int newmemory = 0;
1684
+ *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1685
+ if (newmemory == SWIG_CAST_NEW_MEMORY) {
1686
+ assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
1687
+ if (own)
1688
+ own->own = own->own | SWIG_CAST_NEW_MEMORY;
1689
+ }
1690
+ }
1691
+ }
1651
1692
  }
1652
1693
  } else {
1653
- *ptr = vptr;
1694
+ if (ptr)
1695
+ *ptr = vptr;
1654
1696
  }
1655
1697
 
1656
1698
  return SWIG_OK;
@@ -1676,7 +1718,7 @@ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
1676
1718
  return rb_str_new2(result);
1677
1719
  }
1678
1720
 
1679
- /* Convert a packed value value */
1721
+ /* Convert a packed pointer value */
1680
1722
  SWIGRUNTIME int
1681
1723
  SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
1682
1724
  swig_cast_info *tc;
@@ -1864,7 +1906,7 @@ static VALUE mCproton;
1864
1906
  #define SWIG_RUBY_THREAD_END_BLOCK
1865
1907
 
1866
1908
 
1867
- #define SWIGVERSION 0x020010
1909
+ #define SWIGVERSION 0x040002
1868
1910
  #define SWIG_VERSION SWIGVERSION
1869
1911
 
1870
1912
 
@@ -1893,15 +1935,16 @@ static VALUE mCproton;
1893
1935
 
1894
1936
 
1895
1937
  SWIGINTERN VALUE
1896
- SWIG_ruby_failed(void)
1938
+ SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2))
1897
1939
  {
1898
1940
  return Qnil;
1899
1941
  }
1900
1942
 
1901
1943
 
1902
- /*@SWIG:/usr/share/swig/2.0.10/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
1903
- SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
1944
+ /*@SWIG:/usr/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
1945
+ SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE arg)
1904
1946
  {
1947
+ VALUE *args = (VALUE *)arg;
1905
1948
  VALUE obj = args[0];
1906
1949
  VALUE type = TYPE(obj);
1907
1950
  unsigned long *res = (unsigned long *)(args[1]);
@@ -1919,21 +1962,79 @@ SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val)
1919
1962
  VALUE a[2];
1920
1963
  a[0] = obj;
1921
1964
  a[1] = (VALUE)(&v);
1922
- if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1965
+ if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
1966
+ if (val) *val = v;
1967
+ return SWIG_OK;
1968
+ }
1969
+ }
1970
+ return SWIG_TypeError;
1971
+ }
1972
+
1973
+
1974
+ #include <limits.h>
1975
+ #if !defined(SWIG_NO_LLONG_MAX)
1976
+ # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1977
+ # define LLONG_MAX __LONG_LONG_MAX__
1978
+ # define LLONG_MIN (-LLONG_MAX - 1LL)
1979
+ # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1980
+ # endif
1981
+ #endif
1982
+
1983
+
1984
+ #if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE)
1985
+ # define SWIG_LONG_LONG_AVAILABLE
1986
+ #endif
1987
+
1988
+
1989
+ #ifdef SWIG_LONG_LONG_AVAILABLE
1990
+ /*@SWIG:/usr/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
1991
+ SWIGINTERN VALUE SWIG_AUX_NUM2ULL(VALUE arg)
1992
+ {
1993
+ VALUE *args = (VALUE *)arg;
1994
+ VALUE obj = args[0];
1995
+ VALUE type = TYPE(obj);
1996
+ long long *res = (long long *)(args[1]);
1997
+ *res = type == T_FIXNUM ? NUM2ULL(obj) : rb_big2ull(obj);
1998
+ return obj;
1999
+ }
2000
+ /*@SWIG@*/
2001
+
2002
+ SWIGINTERN int
2003
+ SWIG_AsVal_unsigned_SS_long_SS_long (VALUE obj, unsigned long long *val)
2004
+ {
2005
+ VALUE type = TYPE(obj);
2006
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
2007
+ unsigned long long v;
2008
+ VALUE a[2];
2009
+ a[0] = obj;
2010
+ a[1] = (VALUE)(&v);
2011
+ if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2ULL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
1923
2012
  if (val) *val = v;
1924
2013
  return SWIG_OK;
1925
2014
  }
1926
2015
  }
1927
2016
  return SWIG_TypeError;
1928
2017
  }
2018
+ #endif
1929
2019
 
1930
2020
 
1931
2021
  SWIGINTERNINLINE int
1932
2022
  SWIG_AsVal_size_t (VALUE obj, size_t *val)
1933
2023
  {
1934
- unsigned long v;
1935
- int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
1936
- if (SWIG_IsOK(res) && val) *val = (size_t)(v);
2024
+ int res = SWIG_TypeError;
2025
+ #ifdef SWIG_LONG_LONG_AVAILABLE
2026
+ if (sizeof(size_t) <= sizeof(unsigned long)) {
2027
+ #endif
2028
+ unsigned long v;
2029
+ res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
2030
+ if (SWIG_IsOK(res) && val) *val = (size_t)(v);
2031
+ #ifdef SWIG_LONG_LONG_AVAILABLE
2032
+ } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
2033
+ unsigned long long v;
2034
+ res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0);
2035
+ if (SWIG_IsOK(res) && val) *val = (size_t)(v);
2036
+ }
2037
+ #endif
1937
2038
  return res;
1938
2039
  }
1939
2040
 
@@ -1960,7 +2061,7 @@ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1960
2061
  if (cptr) {
1961
2062
  if (alloc) {
1962
2063
  if (*alloc == SWIG_NEWOBJ) {
1963
- *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
2064
+ *cptr = (char *)memcpy(malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
1964
2065
  } else {
1965
2066
  *cptr = cstr;
1966
2067
  *alloc = SWIG_OLDOBJ;
@@ -2005,16 +2106,6 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size)
2005
2106
  }
2006
2107
 
2007
2108
 
2008
- #include <limits.h>
2009
- #if !defined(SWIG_NO_LLONG_MAX)
2010
- # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
2011
- # define LLONG_MAX __LONG_LONG_MAX__
2012
- # define LLONG_MIN (-LLONG_MAX - 1LL)
2013
- # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
2014
- # endif
2015
- #endif
2016
-
2017
-
2018
2109
  #define SWIG_From_long LONG2NUM
2019
2110
 
2020
2111
 
@@ -2227,9 +2318,10 @@ SWIG_From_bool (bool value)
2227
2318
 
2228
2319
 
2229
2320
 
2230
- /*@SWIG:/usr/share/swig/2.0.10/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2231
- SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
2321
+ /*@SWIG:/usr/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2322
+ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE arg)
2232
2323
  {
2324
+ VALUE *args = (VALUE *)arg;
2233
2325
  VALUE obj = args[0];
2234
2326
  VALUE type = TYPE(obj);
2235
2327
  long *res = (long *)(args[1]);
@@ -2247,7 +2339,7 @@ SWIG_AsVal_long (VALUE obj, long* val)
2247
2339
  VALUE a[2];
2248
2340
  a[0] = obj;
2249
2341
  a[1] = (VALUE)(&v);
2250
- if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2342
+ if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
2251
2343
  if (val) *val = v;
2252
2344
  return SWIG_OK;
2253
2345
  }
@@ -2460,10 +2552,28 @@ SWIG_From_unsigned_SS_long (unsigned long value)
2460
2552
  }
2461
2553
 
2462
2554
 
2555
+ #ifdef SWIG_LONG_LONG_AVAILABLE
2556
+ SWIGINTERNINLINE VALUE
2557
+ SWIG_From_unsigned_SS_long_SS_long (unsigned long long value)
2558
+ {
2559
+ return ULL2NUM(value);
2560
+ }
2561
+ #endif
2562
+
2563
+
2463
2564
  SWIGINTERNINLINE VALUE
2464
2565
  SWIG_From_size_t (size_t value)
2465
2566
  {
2466
- return SWIG_From_unsigned_SS_long ((unsigned long)(value));
2567
+ #ifdef SWIG_LONG_LONG_AVAILABLE
2568
+ if (sizeof(size_t) <= sizeof(unsigned long)) {
2569
+ #endif
2570
+ return SWIG_From_unsigned_SS_long ((unsigned long)(value));
2571
+ #ifdef SWIG_LONG_LONG_AVAILABLE
2572
+ } else {
2573
+ /* assume sizeof(size_t) <= sizeof(unsigned long long) */
2574
+ return SWIG_From_unsigned_SS_long_SS_long ((unsigned long long)(value));
2575
+ }
2576
+ #endif
2467
2577
  }
2468
2578
 
2469
2579
 
@@ -2474,30 +2584,64 @@ SWIG_From_unsigned_SS_int (unsigned int value)
2474
2584
  }
2475
2585
 
2476
2586
 
2477
- SWIGINTERNINLINE VALUE
2478
- SWIG_From_long_SS_long (long long value)
2479
- {
2480
- return LL2NUM(value);
2481
- }
2587
+ #include <float.h>
2482
2588
 
2483
2589
 
2484
- SWIGINTERNINLINE VALUE
2485
- SWIG_From_unsigned_SS_long_SS_long (unsigned long long value)
2486
- {
2487
- return ULL2NUM(value);
2488
- }
2590
+ #include <math.h>
2489
2591
 
2490
2592
 
2491
- #include <float.h>
2593
+ /* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */
2594
+ #ifndef SWIG_isfinite
2595
+ /* isfinite() is a macro for C99 */
2596
+ # if defined(isfinite)
2597
+ # define SWIG_isfinite(X) (isfinite(X))
2598
+ # elif defined(__cplusplus) && __cplusplus >= 201103L
2599
+ /* Use a template so that this works whether isfinite() is std::isfinite() or
2600
+ * in the global namespace. The reality seems to vary between compiler
2601
+ * versions.
2602
+ *
2603
+ * Make sure namespace std exists to avoid compiler warnings.
2604
+ *
2605
+ * extern "C++" is required as this fragment can end up inside an extern "C" { } block
2606
+ */
2607
+ namespace std { }
2608
+ extern "C++" template<typename T>
2609
+ inline int SWIG_isfinite_func(T x) {
2610
+ using namespace std;
2611
+ return isfinite(x);
2612
+ }
2613
+ # define SWIG_isfinite(X) (SWIG_isfinite_func(X))
2614
+ # elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))
2615
+ # define SWIG_isfinite(X) (__builtin_isfinite(X))
2616
+ # elif defined(__clang__) && defined(__has_builtin)
2617
+ # if __has_builtin(__builtin_isfinite)
2618
+ # define SWIG_isfinite(X) (__builtin_isfinite(X))
2619
+ # endif
2620
+ # elif defined(_MSC_VER)
2621
+ # define SWIG_isfinite(X) (_finite(X))
2622
+ # elif defined(__sun) && defined(__SVR4)
2623
+ # include <ieeefp.h>
2624
+ # define SWIG_isfinite(X) (finite(X))
2625
+ # endif
2626
+ #endif
2492
2627
 
2493
2628
 
2494
- /*@SWIG:/usr/share/swig/2.0.10/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2495
- SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args)
2629
+ /* Accept infinite as a valid float value unless we are unable to check if a value is finite */
2630
+ #ifdef SWIG_isfinite
2631
+ # define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX) && SWIG_isfinite(X))
2632
+ #else
2633
+ # define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX))
2634
+ #endif
2635
+
2636
+
2637
+ /*@SWIG:/usr/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2638
+ SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE arg)
2496
2639
  {
2640
+ VALUE *args = (VALUE *)arg;
2497
2641
  VALUE obj = args[0];
2498
2642
  VALUE type = TYPE(obj);
2499
2643
  double *res = (double *)(args[1]);
2500
- *res = NUM2DBL(obj);
2644
+ *res = NUM2DBL(obj); (void)type;
2501
2645
  return obj;
2502
2646
  }
2503
2647
  /*@SWIG@*/
@@ -2511,7 +2655,7 @@ SWIG_AsVal_double (VALUE obj, double *val)
2511
2655
  VALUE a[2];
2512
2656
  a[0] = obj;
2513
2657
  a[1] = (VALUE)(&v);
2514
- if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2DBL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2658
+ if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2DBL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
2515
2659
  if (val) *val = v;
2516
2660
  return SWIG_OK;
2517
2661
  }
@@ -2526,7 +2670,7 @@ SWIG_AsVal_float (VALUE obj, float *val)
2526
2670
  double v;
2527
2671
  int res = SWIG_AsVal_double (obj, &v);
2528
2672
  if (SWIG_IsOK(res)) {
2529
- if ((v < -FLT_MAX || v > FLT_MAX)) {
2673
+ if (SWIG_Float_Overflow_Check(v)) {
2530
2674
  return SWIG_OverflowError;
2531
2675
  } else {
2532
2676
  if (val) *val = (float)(v);
@@ -2536,35 +2680,6 @@ SWIG_AsVal_float (VALUE obj, float *val)
2536
2680
  }
2537
2681
 
2538
2682
 
2539
- /*@SWIG:/usr/share/swig/2.0.10/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2540
- SWIGINTERN VALUE SWIG_AUX_NUM2ULL(VALUE *args)
2541
- {
2542
- VALUE obj = args[0];
2543
- VALUE type = TYPE(obj);
2544
- long long *res = (long long *)(args[1]);
2545
- *res = type == T_FIXNUM ? NUM2ULL(obj) : rb_big2ull(obj);
2546
- return obj;
2547
- }
2548
- /*@SWIG@*/
2549
-
2550
- SWIGINTERN int
2551
- SWIG_AsVal_unsigned_SS_long_SS_long (VALUE obj, unsigned long long *val)
2552
- {
2553
- VALUE type = TYPE(obj);
2554
- if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
2555
- unsigned long long v;
2556
- VALUE a[2];
2557
- a[0] = obj;
2558
- a[1] = (VALUE)(&v);
2559
- if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2560
- if (val) *val = v;
2561
- return SWIG_OK;
2562
- }
2563
- }
2564
- return SWIG_TypeError;
2565
- }
2566
-
2567
-
2568
2683
  SWIGINTERN int
2569
2684
  SWIG_AsVal_bool (VALUE obj, bool *val)
2570
2685
  {
@@ -2608,9 +2723,11 @@ SWIG_AsVal_unsigned_SS_short (VALUE obj, unsigned short *val)
2608
2723
  }
2609
2724
 
2610
2725
 
2611
- /*@SWIG:/usr/share/swig/2.0.10/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2612
- SWIGINTERN VALUE SWIG_AUX_NUM2LL(VALUE *args)
2726
+ #ifdef SWIG_LONG_LONG_AVAILABLE
2727
+ /*@SWIG:/usr/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2728
+ SWIGINTERN VALUE SWIG_AUX_NUM2LL(VALUE arg)
2613
2729
  {
2730
+ VALUE *args = (VALUE *)arg;
2614
2731
  VALUE obj = args[0];
2615
2732
  VALUE type = TYPE(obj);
2616
2733
  long long *res = (long long *)(args[1]);
@@ -2628,13 +2745,23 @@ SWIG_AsVal_long_SS_long (VALUE obj, long long *val)
2628
2745
  VALUE a[2];
2629
2746
  a[0] = obj;
2630
2747
  a[1] = (VALUE)(&v);
2631
- if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2748
+ if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
2632
2749
  if (val) *val = v;
2633
2750
  return SWIG_OK;
2634
2751
  }
2635
2752
  }
2636
2753
  return SWIG_TypeError;
2637
2754
  }
2755
+ #endif
2756
+
2757
+
2758
+ #ifdef SWIG_LONG_LONG_AVAILABLE
2759
+ SWIGINTERNINLINE VALUE
2760
+ SWIG_From_long_SS_long (long long value)
2761
+ {
2762
+ return LL2NUM(value);
2763
+ }
2764
+ #endif
2638
2765
 
2639
2766
 
2640
2767
  /* assume the binding does the incref in the wrapper */
@@ -2755,7 +2882,7 @@ _wrap_pn_message_encode(int argc, VALUE *argv, VALUE self) {
2755
2882
  if (!SWIG_IsOK(res2)) {
2756
2883
  SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "(char *OUTPUT, size_t *OUTPUT_SIZE)","pn_message_encode", 2, argv[1] ));
2757
2884
  }
2758
- buff2= (char *)malloc((n2+1)*sizeof(char));
2885
+ buff2= (char *)calloc(n2+1, sizeof(char));
2759
2886
  arg2 = (char *)(buff2);
2760
2887
  size2 = (size_t)(n2);
2761
2888
  arg3 = &size2;
@@ -2834,7 +2961,7 @@ _wrap_pn_link_recv(int argc, VALUE *argv, VALUE self) {
2834
2961
  if (!SWIG_IsOK(res2)) {
2835
2962
  SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "(char *OUTPUT, size_t *OUTPUT_SIZE)","wrap_pn_link_recv", 2, argv[1] ));
2836
2963
  }
2837
- buff2= (char *)malloc((n2+1)*sizeof(char));
2964
+ buff2= (char *)calloc(n2+1, sizeof(char));
2838
2965
  arg2 = (char *)(buff2);
2839
2966
  size2 = (size_t)(n2);
2840
2967
  arg3 = &size2;
@@ -2913,7 +3040,7 @@ _wrap_pn_transport_output(int argc, VALUE *argv, VALUE self) {
2913
3040
  if (!SWIG_IsOK(res2)) {
2914
3041
  SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "(char *OUTPUT, size_t *OUTPUT_SIZE)","wrap_pn_transport_output", 2, argv[1] ));
2915
3042
  }
2916
- buff2= (char *)malloc((n2+1)*sizeof(char));
3043
+ buff2= (char *)calloc(n2+1, sizeof(char));
2917
3044
  arg2 = (char *)(buff2);
2918
3045
  size2 = (size_t)(n2);
2919
3046
  arg3 = &size2;
@@ -2954,7 +3081,7 @@ _wrap_pn_transport_peek(int argc, VALUE *argv, VALUE self) {
2954
3081
  if (!SWIG_IsOK(res2)) {
2955
3082
  SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "(char *OUTPUT, size_t *OUTPUT_SIZE)","wrap_pn_transport_peek", 2, argv[1] ));
2956
3083
  }
2957
- buff2= (char *)malloc((n2+1)*sizeof(char));
3084
+ buff2= (char *)calloc(n2+1, sizeof(char));
2958
3085
  arg2 = (char *)(buff2);
2959
3086
  size2 = (size_t)(n2);
2960
3087
  arg3 = &size2;
@@ -3063,7 +3190,7 @@ _wrap_pn_ssl_get_cipher_name(int argc, VALUE *argv, VALUE self) {
3063
3190
  if (!SWIG_IsOK(res2)) {
3064
3191
  SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "(char *OUTPUT, size_t MAX_OUTPUT_SIZE)","pn_ssl_get_cipher_name", 2, argv[1] ));
3065
3192
  }
3066
- buff2= (char *)malloc((size2+1)*sizeof(char));
3193
+ buff2= (char *)calloc(size2+1, sizeof(char));
3067
3194
  arg3 = (size_t)(size2);
3068
3195
  arg2 = (char *)(buff2);
3069
3196
  result = (bool)pn_ssl_get_cipher_name(arg1,arg2,arg3);
@@ -3102,7 +3229,7 @@ _wrap_pn_ssl_get_protocol_name(int argc, VALUE *argv, VALUE self) {
3102
3229
  if (!SWIG_IsOK(res2)) {
3103
3230
  SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "(char *OUTPUT, size_t MAX_OUTPUT_SIZE)","pn_ssl_get_protocol_name", 2, argv[1] ));
3104
3231
  }
3105
- buff2= (char *)malloc((size2+1)*sizeof(char));
3232
+ buff2= (char *)calloc(size2+1, sizeof(char));
3106
3233
  arg3 = (size_t)(size2);
3107
3234
  arg2 = (char *)(buff2);
3108
3235
  result = (bool)pn_ssl_get_protocol_name(arg1,arg2,arg3);
@@ -3517,7 +3644,7 @@ _wrap_pn_ssl_get_peer_hostname(int argc, VALUE *argv, VALUE self) {
3517
3644
  if (!SWIG_IsOK(res2)) {
3518
3645
  SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "(char *OUTPUT, size_t *OUTPUT_SIZE)","pn_ssl_get_peer_hostname", 2, argv[1] ));
3519
3646
  }
3520
- buff2= (char *)malloc((n2+1)*sizeof(char));
3647
+ buff2= (char *)calloc(n2+1, sizeof(char));
3521
3648
  arg2 = (char *)(buff2);
3522
3649
  size2 = (size_t)(n2);
3523
3650
  arg3 = &size2;
@@ -3647,22 +3774,20 @@ fail:
3647
3774
  }
3648
3775
 
3649
3776
 
3650
- #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
3651
3777
  SWIGINTERN VALUE
3652
- _wrap_Pni_rbhandler_t_allocate(VALUE self) {
3778
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
3779
+ _wrap_Pni_rbhandler_t_allocate(VALUE self)
3653
3780
  #else
3654
- SWIGINTERN VALUE
3655
- _wrap_Pni_rbhandler_t_allocate(int argc, VALUE *argv, VALUE self) {
3781
+ _wrap_Pni_rbhandler_t_allocate(int argc, VALUE *argv, VALUE self)
3656
3782
  #endif
3657
-
3658
-
3659
- VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Pni_rbhandler_t);
3783
+ {
3784
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Pni_rbhandler_t);
3660
3785
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
3661
- rb_obj_call_init(vresult, argc, argv);
3786
+ rb_obj_call_init(vresult, argc, argv);
3662
3787
  #endif
3663
- return vresult;
3664
- }
3665
-
3788
+ return vresult;
3789
+ }
3790
+
3666
3791
 
3667
3792
  SWIGINTERN VALUE
3668
3793
  _wrap_new_Pni_rbhandler_t(int argc, VALUE *argv, VALUE self) {
@@ -3680,7 +3805,8 @@ fail:
3680
3805
 
3681
3806
 
3682
3807
  SWIGINTERN void
3683
- free_Pni_rbhandler_t(Pni_rbhandler_t *arg1) {
3808
+ free_Pni_rbhandler_t(void *self) {
3809
+ Pni_rbhandler_t *arg1 = (Pni_rbhandler_t *)self;
3684
3810
  free((char *) arg1);
3685
3811
  }
3686
3812
 
@@ -4006,7 +4132,7 @@ _wrap_pn_rwbytes(int argc, VALUE *argv, VALUE self) {
4006
4132
  }
4007
4133
  arg2 = (char *)(buf2);
4008
4134
  result = pn_rwbytes(arg1,arg2);
4009
- vresult = SWIG_NewPointerObj((pn_rwbytes_t *)memcpy((pn_rwbytes_t *)malloc(sizeof(pn_rwbytes_t)),&result,sizeof(pn_rwbytes_t)), SWIGTYPE_p_pn_rwbytes_t, SWIG_POINTER_OWN | 0 );
4135
+ vresult = SWIG_NewPointerObj((pn_rwbytes_t *)memcpy((pn_rwbytes_t *)calloc(1,sizeof(pn_rwbytes_t)),&result,sizeof(pn_rwbytes_t)), SWIGTYPE_p_pn_rwbytes_t, SWIG_POINTER_OWN | 0 );
4010
4136
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
4011
4137
  return vresult;
4012
4138
  fail:
@@ -4337,7 +4463,7 @@ _wrap_pn_class_compare(int argc, VALUE *argv, VALUE self) {
4337
4463
  SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "void *","pn_class_compare", 3, argv[2] ));
4338
4464
  }
4339
4465
  result = pn_class_compare((struct pn_class_t const *)arg1,arg2,arg3);
4340
- vresult = SWIG_NewPointerObj((intptr_t *)memcpy((intptr_t *)malloc(sizeof(intptr_t)),&result,sizeof(intptr_t)), SWIGTYPE_p_intptr_t, SWIG_POINTER_OWN | 0 );
4466
+ vresult = SWIG_NewPointerObj((intptr_t *)memcpy((intptr_t *)calloc(1,sizeof(intptr_t)),&result,sizeof(intptr_t)), SWIGTYPE_p_intptr_t, SWIG_POINTER_OWN | 0 );
4341
4467
  return vresult;
4342
4468
  fail:
4343
4469
  return Qnil;
@@ -4553,7 +4679,7 @@ _wrap_pn_void_compare(int argc, VALUE *argv, VALUE self) {
4553
4679
  SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "void *","pn_void_compare", 2, argv[1] ));
4554
4680
  }
4555
4681
  result = pn_void_compare(arg1,arg2);
4556
- vresult = SWIG_NewPointerObj((intptr_t *)memcpy((intptr_t *)malloc(sizeof(intptr_t)),&result,sizeof(intptr_t)), SWIGTYPE_p_intptr_t, SWIG_POINTER_OWN | 0 );
4682
+ vresult = SWIG_NewPointerObj((intptr_t *)memcpy((intptr_t *)calloc(1,sizeof(intptr_t)),&result,sizeof(intptr_t)), SWIGTYPE_p_intptr_t, SWIG_POINTER_OWN | 0 );
4557
4683
  return vresult;
4558
4684
  fail:
4559
4685
  return Qnil;
@@ -4873,7 +4999,7 @@ _wrap_pn_compare(int argc, VALUE *argv, VALUE self) {
4873
4999
  SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "void *","pn_compare", 2, argv[1] ));
4874
5000
  }
4875
5001
  result = pn_compare(arg1,arg2);
4876
- vresult = SWIG_NewPointerObj((intptr_t *)memcpy((intptr_t *)malloc(sizeof(intptr_t)),&result,sizeof(intptr_t)), SWIGTYPE_p_intptr_t, SWIG_POINTER_OWN | 0 );
5002
+ vresult = SWIG_NewPointerObj((intptr_t *)memcpy((intptr_t *)calloc(1,sizeof(intptr_t)),&result,sizeof(intptr_t)), SWIGTYPE_p_intptr_t, SWIG_POINTER_OWN | 0 );
4877
5003
  return vresult;
4878
5004
  fail:
4879
5005
  return Qnil;
@@ -18300,6 +18426,38 @@ fail:
18300
18426
  }
18301
18427
 
18302
18428
 
18429
+ SWIGINTERN VALUE
18430
+ _wrap_pn_connection_driver_read_buffer_sized(int argc, VALUE *argv, VALUE self) {
18431
+ pn_connection_driver_t *arg1 = (pn_connection_driver_t *) 0 ;
18432
+ size_t arg2 ;
18433
+ void *argp1 = 0 ;
18434
+ int res1 = 0 ;
18435
+ size_t val2 ;
18436
+ int ecode2 = 0 ;
18437
+ pn_rwbytes_t result;
18438
+ VALUE vresult = Qnil;
18439
+
18440
+ if ((argc < 2) || (argc > 2)) {
18441
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
18442
+ }
18443
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_pn_connection_driver_t, 0 | 0 );
18444
+ if (!SWIG_IsOK(res1)) {
18445
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "pn_connection_driver_t *","pn_connection_driver_read_buffer_sized", 1, argv[0] ));
18446
+ }
18447
+ arg1 = (pn_connection_driver_t *)(argp1);
18448
+ ecode2 = SWIG_AsVal_size_t(argv[1], &val2);
18449
+ if (!SWIG_IsOK(ecode2)) {
18450
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","pn_connection_driver_read_buffer_sized", 2, argv[1] ));
18451
+ }
18452
+ arg2 = (size_t)(val2);
18453
+ result = pn_connection_driver_read_buffer_sized(arg1,arg2);
18454
+ vresult = SWIG_NewPointerObj((pn_rwbytes_t *)memcpy((pn_rwbytes_t *)calloc(1,sizeof(pn_rwbytes_t)),&result,sizeof(pn_rwbytes_t)), SWIGTYPE_p_pn_rwbytes_t, SWIG_POINTER_OWN | 0 );
18455
+ return vresult;
18456
+ fail:
18457
+ return Qnil;
18458
+ }
18459
+
18460
+
18303
18461
  SWIGINTERN VALUE
18304
18462
  _wrap_pn_connection_driver_read_buffer(int argc, VALUE *argv, VALUE self) {
18305
18463
  pn_connection_driver_t *arg1 = (pn_connection_driver_t *) 0 ;
@@ -18317,7 +18475,7 @@ _wrap_pn_connection_driver_read_buffer(int argc, VALUE *argv, VALUE self) {
18317
18475
  }
18318
18476
  arg1 = (pn_connection_driver_t *)(argp1);
18319
18477
  result = pn_connection_driver_read_buffer(arg1);
18320
- vresult = SWIG_NewPointerObj((pn_rwbytes_t *)memcpy((pn_rwbytes_t *)malloc(sizeof(pn_rwbytes_t)),&result,sizeof(pn_rwbytes_t)), SWIGTYPE_p_pn_rwbytes_t, SWIG_POINTER_OWN | 0 );
18478
+ vresult = SWIG_NewPointerObj((pn_rwbytes_t *)memcpy((pn_rwbytes_t *)calloc(1,sizeof(pn_rwbytes_t)),&result,sizeof(pn_rwbytes_t)), SWIGTYPE_p_pn_rwbytes_t, SWIG_POINTER_OWN | 0 );
18321
18479
  return vresult;
18322
18480
  fail:
18323
18481
  return Qnil;
@@ -19437,18 +19595,18 @@ static swig_cast_info *swig_cast_initial[] = {
19437
19595
 
19438
19596
  /* -----------------------------------------------------------------------------
19439
19597
  * Type initialization:
19440
- * This problem is tough by the requirement that no dynamic
19441
- * memory is used. Also, since swig_type_info structures store pointers to
19598
+ * This problem is tough by the requirement that no dynamic
19599
+ * memory is used. Also, since swig_type_info structures store pointers to
19442
19600
  * swig_cast_info structures and swig_cast_info structures store pointers back
19443
- * to swig_type_info structures, we need some lookup code at initialization.
19444
- * The idea is that swig generates all the structures that are needed.
19445
- * The runtime then collects these partially filled structures.
19446
- * The SWIG_InitializeModule function takes these initial arrays out of
19601
+ * to swig_type_info structures, we need some lookup code at initialization.
19602
+ * The idea is that swig generates all the structures that are needed.
19603
+ * The runtime then collects these partially filled structures.
19604
+ * The SWIG_InitializeModule function takes these initial arrays out of
19447
19605
  * swig_module, and does all the lookup, filling in the swig_module.types
19448
19606
  * array with the correct data and linking the correct swig_cast_info
19449
19607
  * structures together.
19450
19608
  *
19451
- * The generated swig_type_info structures are assigned staticly to an initial
19609
+ * The generated swig_type_info structures are assigned statically to an initial
19452
19610
  * array. We just loop through that array, and handle each type individually.
19453
19611
  * First we lookup if this type has been already loaded, and if so, use the
19454
19612
  * loaded structure instead of the generated one. Then we have to fill in the
@@ -19458,17 +19616,17 @@ static swig_cast_info *swig_cast_initial[] = {
19458
19616
  * a column is one of the swig_cast_info structures for that type.
19459
19617
  * The cast_initial array is actually an array of arrays, because each row has
19460
19618
  * a variable number of columns. So to actually build the cast linked list,
19461
- * we find the array of casts associated with the type, and loop through it
19619
+ * we find the array of casts associated with the type, and loop through it
19462
19620
  * adding the casts to the list. The one last trick we need to do is making
19463
19621
  * sure the type pointer in the swig_cast_info struct is correct.
19464
19622
  *
19465
- * First off, we lookup the cast->type name to see if it is already loaded.
19623
+ * First off, we lookup the cast->type name to see if it is already loaded.
19466
19624
  * There are three cases to handle:
19467
19625
  * 1) If the cast->type has already been loaded AND the type we are adding
19468
19626
  * casting info to has not been loaded (it is in this module), THEN we
19469
19627
  * replace the cast->type pointer with the type pointer that has already
19470
19628
  * been loaded.
19471
- * 2) If BOTH types (the one we are adding casting info to, and the
19629
+ * 2) If BOTH types (the one we are adding casting info to, and the
19472
19630
  * cast->type) are loaded, THEN the cast info has already been loaded by
19473
19631
  * the previous module so we just ignore it.
19474
19632
  * 3) Finally, if cast->type has not already been loaded, then we add that
@@ -19492,7 +19650,7 @@ SWIGRUNTIME void
19492
19650
  SWIG_InitializeModule(void *clientdata) {
19493
19651
  size_t i;
19494
19652
  swig_module_info *module_head, *iter;
19495
- int found, init;
19653
+ int init;
19496
19654
 
19497
19655
  /* check to see if the circular list has been setup, if not, set it up */
19498
19656
  if (swig_module.next==0) {
@@ -19511,27 +19669,23 @@ SWIG_InitializeModule(void *clientdata) {
19511
19669
  /* This is the first module loaded for this interpreter */
19512
19670
  /* so set the swig module into the interpreter */
19513
19671
  SWIG_SetModule(clientdata, &swig_module);
19514
- module_head = &swig_module;
19515
19672
  } else {
19516
19673
  /* the interpreter has loaded a SWIG module, but has it loaded this one? */
19517
- found=0;
19518
19674
  iter=module_head;
19519
19675
  do {
19520
19676
  if (iter==&swig_module) {
19521
- found=1;
19522
- break;
19677
+ /* Our module is already in the list, so there's nothing more to do. */
19678
+ return;
19523
19679
  }
19524
19680
  iter=iter->next;
19525
19681
  } while (iter!= module_head);
19526
19682
 
19527
- /* if the is found in the list, then all is done and we may leave */
19528
- if (found) return;
19529
- /* otherwise we must add out module into the list */
19683
+ /* otherwise we must add our module into the list */
19530
19684
  swig_module.next = module_head->next;
19531
19685
  module_head->next = &swig_module;
19532
19686
  }
19533
19687
 
19534
- /* When multiple interpeters are used, a module could have already been initialized in
19688
+ /* When multiple interpreters are used, a module could have already been initialized in
19535
19689
  a different interpreter, but not yet have a pointer in this interpreter.
19536
19690
  In this case, we do not want to continue adding types... everything should be
19537
19691
  set up already */
@@ -19539,15 +19693,15 @@ SWIG_InitializeModule(void *clientdata) {
19539
19693
 
19540
19694
  /* Now work on filling in swig_module.types */
19541
19695
  #ifdef SWIGRUNTIME_DEBUG
19542
- printf("SWIG_InitializeModule: size %d\n", swig_module.size);
19696
+ printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
19543
19697
  #endif
19544
19698
  for (i = 0; i < swig_module.size; ++i) {
19545
19699
  swig_type_info *type = 0;
19546
19700
  swig_type_info *ret;
19547
19701
  swig_cast_info *cast;
19548
-
19702
+
19549
19703
  #ifdef SWIGRUNTIME_DEBUG
19550
- printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
19704
+ printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
19551
19705
  #endif
19552
19706
 
19553
19707
  /* if there is another module already loaded */
@@ -19572,7 +19726,7 @@ SWIG_InitializeModule(void *clientdata) {
19572
19726
  /* Insert casting types */
19573
19727
  cast = swig_module.cast_initial[i];
19574
19728
  while (cast->type) {
19575
-
19729
+
19576
19730
  /* Don't need to add information already in the list */
19577
19731
  ret = 0;
19578
19732
  #ifdef SWIGRUNTIME_DEBUG
@@ -19623,7 +19777,7 @@ SWIG_InitializeModule(void *clientdata) {
19623
19777
  for (i = 0; i < swig_module.size; ++i) {
19624
19778
  int j = 0;
19625
19779
  swig_cast_info *cast = swig_module.cast_initial[i];
19626
- printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
19780
+ printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
19627
19781
  while (cast->type) {
19628
19782
  printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
19629
19783
  cast++;
@@ -19740,18 +19894,18 @@ SWIGEXPORT void Init_cproton(void) {
19740
19894
  rb_define_module_function(mCproton, "pni_connection_driver", _wrap_pni_connection_driver, -1);
19741
19895
  rb_define_const(mCproton, "PROTON_IMPORT_EXPORT_H", SWIG_From_int((int)(1)));
19742
19896
  rb_define_const(mCproton, "PN_VERSION_MAJOR", SWIG_From_int((int)(0)));
19743
- rb_define_const(mCproton, "PN_VERSION_MINOR", SWIG_From_int((int)(36)));
19897
+ rb_define_const(mCproton, "PN_VERSION_MINOR", SWIG_From_int((int)(37)));
19744
19898
  rb_define_const(mCproton, "PN_VERSION_POINT", SWIG_From_int((int)(0)));
19745
19899
  rb_define_const(mCproton, "PROTON_TYPES_H", SWIG_From_int((int)(1)));
19746
19900
  rb_define_const(mCproton, "PN_MILLIS_MAX", SWIG_From_unsigned_SS_int((unsigned int)((~0U))));
19747
19901
  rb_define_module_function(mCproton, "pn_bytes", _wrap_pn_bytes, -1);
19748
- rb_define_singleton_method(mCproton, "pn_bytes_null", _wrap_pn_bytes_null_get, 0);
19902
+ rb_define_singleton_method(mCproton, "pn_bytes_null", VALUEFUNC(_wrap_pn_bytes_null_get), 0);
19749
19903
  rb_define_module_function(mCproton, "pn_rwbytes", _wrap_pn_rwbytes, -1);
19750
- rb_define_singleton_method(mCproton, "pn_rwbytes_null", _wrap_pn_rwbytes_null_get, 0);
19904
+ rb_define_singleton_method(mCproton, "pn_rwbytes_null", VALUEFUNC(_wrap_pn_rwbytes_null_get), 0);
19751
19905
  rb_define_const(mCproton, "PROTON_OBJECT_H", SWIG_From_int((int)(1)));
19752
- rb_define_singleton_method(mCproton, "PN_OBJECT", _wrap_PN_OBJECT_get, 0);
19753
- rb_define_singleton_method(mCproton, "PN_VOID", _wrap_PN_VOID_get, 0);
19754
- rb_define_singleton_method(mCproton, "PN_WEAKREF", _wrap_PN_WEAKREF_get, 0);
19906
+ rb_define_singleton_method(mCproton, "PN_OBJECT", VALUEFUNC(_wrap_PN_OBJECT_get), 0);
19907
+ rb_define_singleton_method(mCproton, "PN_VOID", VALUEFUNC(_wrap_PN_VOID_get), 0);
19908
+ rb_define_singleton_method(mCproton, "PN_WEAKREF", VALUEFUNC(_wrap_PN_WEAKREF_get), 0);
19755
19909
  rb_define_module_function(mCproton, "pn_class_id", _wrap_pn_class_id, -1);
19756
19910
  rb_define_module_function(mCproton, "pn_class_name", _wrap_pn_class_name, -1);
19757
19911
  rb_define_module_function(mCproton, "pn_class_new", _wrap_pn_class_new, -1);
@@ -20443,6 +20597,7 @@ SWIGEXPORT void Init_cproton(void) {
20443
20597
  rb_define_module_function(mCproton, "pn_connection_driver_bind", _wrap_pn_connection_driver_bind, -1);
20444
20598
  rb_define_module_function(mCproton, "pn_connection_driver_destroy", _wrap_pn_connection_driver_destroy, -1);
20445
20599
  rb_define_module_function(mCproton, "pn_connection_driver_release_connection", _wrap_pn_connection_driver_release_connection, -1);
20600
+ rb_define_module_function(mCproton, "pn_connection_driver_read_buffer_sized", _wrap_pn_connection_driver_read_buffer_sized, -1);
20446
20601
  rb_define_module_function(mCproton, "pn_connection_driver_read_buffer", _wrap_pn_connection_driver_read_buffer, -1);
20447
20602
  rb_define_module_function(mCproton, "pn_connection_driver_read_done", _wrap_pn_connection_driver_read_done, -1);
20448
20603
  rb_define_module_function(mCproton, "pn_connection_driver_read_close", _wrap_pn_connection_driver_read_close, -1);