vinted-memcached 1.8.3 → 1.8.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build_release_pipeline.yaml +53 -0
  3. data/.gitignore +33 -0
  4. data/BENCHMARKS +130 -126
  5. data/CHANGELOG +1 -6
  6. data/Gemfile +8 -1
  7. data/Gemfile.lock +25 -25
  8. data/README.md +144 -0
  9. data/Rakefile +21 -93
  10. data/ext/rlibmemcached/extconf.rb +76 -0
  11. data/ext/{rlibmemcached.i → rlibmemcached/rlibmemcached.i} +48 -63
  12. data/ext/{rlibmemcached_wrap.c → rlibmemcached/rlibmemcached_wrap.c} +629 -612
  13. data/lib/memcached/exceptions.rb +1 -12
  14. data/lib/memcached/experimental.rb +1 -33
  15. data/lib/memcached/memcached.rb +41 -34
  16. data/lib/memcached/version.rb +1 -1
  17. data/lib/memcached.rb +9 -4
  18. data/memcached.gemspec +0 -0
  19. data/memcached.pem +21 -0
  20. data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_connect.c +23 -13
  21. data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_io.c +18 -13
  22. data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_purge.c +1 -1
  23. metadata +193 -233
  24. data/Manifest +0 -209
  25. data/README.rdoc +0 -124
  26. data/ext/extconf-make.rb +0 -25
  27. data/ext/extconf.rb +0 -78
  28. data/lib/memcached/auth.rb +0 -16
  29. data/test/profile/benchmark.rb +0 -280
  30. data/test/profile/c_profiler.rb +0 -14
  31. data/test/profile/exercise.rb +0 -185
  32. data/test/profile/rb_profiler.rb +0 -21
  33. data/test/profile/valgrind.rb +0 -10
  34. data/test/setup.rb +0 -30
  35. data/test/teardown.rb +0 -0
  36. data/test/test_helper.rb +0 -18
  37. data/test/unit/binding_test.rb +0 -8
  38. data/test/unit/memcached_experimental_test.rb +0 -272
  39. data/test/unit/memcached_test.rb +0 -1487
  40. data/test/unit/rails_test.rb +0 -330
  41. /data/{ext → vendor}/libmemcached-0.32/AUTHORS +0 -0
  42. /data/{ext → vendor}/libmemcached-0.32/COPYING +0 -0
  43. /data/{ext → vendor}/libmemcached-0.32/ChangeLog +0 -0
  44. /data/{ext → vendor}/libmemcached-0.32/INSTALL +0 -0
  45. /data/{ext → vendor}/libmemcached-0.32/Makefile.am +0 -0
  46. /data/{ext → vendor}/libmemcached-0.32/Makefile.in +0 -0
  47. /data/{ext → vendor}/libmemcached-0.32/NEWS +0 -0
  48. /data/{ext → vendor}/libmemcached-0.32/README +0 -0
  49. /data/{ext → vendor}/libmemcached-0.32/THANKS +0 -0
  50. /data/{ext → vendor}/libmemcached-0.32/TODO +0 -0
  51. /data/{ext → vendor}/libmemcached-0.32/aclocal.m4 +0 -0
  52. /data/{ext → vendor}/libmemcached-0.32/clients/Makefile.am +0 -0
  53. /data/{ext → vendor}/libmemcached-0.32/clients/Makefile.in +0 -0
  54. /data/{ext → vendor}/libmemcached-0.32/clients/client_options.h +0 -0
  55. /data/{ext → vendor}/libmemcached-0.32/clients/execute.c +0 -0
  56. /data/{ext → vendor}/libmemcached-0.32/clients/execute.h +0 -0
  57. /data/{ext → vendor}/libmemcached-0.32/clients/generator.c +0 -0
  58. /data/{ext → vendor}/libmemcached-0.32/clients/generator.h +0 -0
  59. /data/{ext → vendor}/libmemcached-0.32/clients/memcat.c +0 -0
  60. /data/{ext → vendor}/libmemcached-0.32/clients/memcp.c +0 -0
  61. /data/{ext → vendor}/libmemcached-0.32/clients/memdump.c +0 -0
  62. /data/{ext → vendor}/libmemcached-0.32/clients/memerror.c +0 -0
  63. /data/{ext → vendor}/libmemcached-0.32/clients/memflush.c +0 -0
  64. /data/{ext → vendor}/libmemcached-0.32/clients/memrm.c +0 -0
  65. /data/{ext → vendor}/libmemcached-0.32/clients/memslap.c +0 -0
  66. /data/{ext → vendor}/libmemcached-0.32/clients/memstat.c +0 -0
  67. /data/{ext → vendor}/libmemcached-0.32/clients/utilities.c +0 -0
  68. /data/{ext → vendor}/libmemcached-0.32/clients/utilities.h +0 -0
  69. /data/{ext → vendor}/libmemcached-0.32/config/compile +0 -0
  70. /data/{ext → vendor}/libmemcached-0.32/config/config.guess +0 -0
  71. /data/{ext → vendor}/libmemcached-0.32/config/config.rpath +0 -0
  72. /data/{ext → vendor}/libmemcached-0.32/config/config.sub +0 -0
  73. /data/{ext → vendor}/libmemcached-0.32/config/depcomp +0 -0
  74. /data/{ext → vendor}/libmemcached-0.32/config/install-sh +0 -0
  75. /data/{ext → vendor}/libmemcached-0.32/config/ltmain.sh +0 -0
  76. /data/{ext → vendor}/libmemcached-0.32/config/missing +0 -0
  77. /data/{ext → vendor}/libmemcached-0.32/config.h.in +0 -0
  78. /data/{ext → vendor}/libmemcached-0.32/configure +0 -0
  79. /data/{ext → vendor}/libmemcached-0.32/configure.ac +0 -0
  80. /data/{ext → vendor}/libmemcached-0.32/libmemcached/Makefile.am +0 -0
  81. /data/{ext → vendor}/libmemcached-0.32/libmemcached/Makefile.in +0 -0
  82. /data/{ext → vendor}/libmemcached-0.32/libmemcached/byteorder.c +0 -0
  83. /data/{ext → vendor}/libmemcached-0.32/libmemcached/common.h +0 -0
  84. /data/{ext → vendor}/libmemcached-0.32/libmemcached/crc.c +0 -0
  85. /data/{ext → vendor}/libmemcached-0.32/libmemcached/hsieh_hash.c +0 -0
  86. /data/{ext → vendor}/libmemcached-0.32/libmemcached/jenkins_hash.c +0 -0
  87. /data/{ext → vendor}/libmemcached-0.32/libmemcached/libmemcached.ver +0 -0
  88. /data/{ext → vendor}/libmemcached-0.32/libmemcached/libmemcached_probes.d +0 -0
  89. /data/{ext → vendor}/libmemcached-0.32/libmemcached/libmemcached_probes.h +0 -0
  90. /data/{ext → vendor}/libmemcached-0.32/libmemcached/md5.c +0 -0
  91. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached/README.txt +0 -0
  92. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached/protocol_binary.h +0 -0
  93. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached.c +0 -0
  94. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached.h +0 -0
  95. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached.hpp +0 -0
  96. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_allocators.c +0 -0
  97. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_analyze.c +0 -0
  98. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_auto.c +0 -0
  99. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_behavior.c +0 -0
  100. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_callback.c +0 -0
  101. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_configure.h.in +0 -0
  102. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_constants.h +0 -0
  103. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_delete.c +0 -0
  104. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_do.c +0 -0
  105. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_dump.c +0 -0
  106. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_exist.c +0 -0
  107. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_exist.h +0 -0
  108. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_fetch.c +0 -0
  109. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_flush.c +0 -0
  110. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_flush_buffers.c +0 -0
  111. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_get.c +0 -0
  112. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_get.h +0 -0
  113. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_hash.c +0 -0
  114. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_hosts.c +0 -0
  115. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_internal.h +0 -0
  116. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_io.h +0 -0
  117. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_key.c +0 -0
  118. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_parse.c +0 -0
  119. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_pool.h +0 -0
  120. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_quit.c +0 -0
  121. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_response.c +0 -0
  122. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_result.c +0 -0
  123. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_result.h +0 -0
  124. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_sasl.c +0 -0
  125. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_sasl.h +0 -0
  126. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_server.c +0 -0
  127. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_server.h +0 -0
  128. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_stats.c +0 -0
  129. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_storage.c +0 -0
  130. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_storage.h +0 -0
  131. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_strerror.c +0 -0
  132. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_string.c +0 -0
  133. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_string.h +0 -0
  134. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_touch.c +0 -0
  135. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_touch.h +0 -0
  136. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_types.h +0 -0
  137. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_util.h +0 -0
  138. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_verbosity.c +0 -0
  139. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_version.c +0 -0
  140. /data/{ext → vendor}/libmemcached-0.32/libmemcached/memcached_watchpoint.h +0 -0
  141. /data/{ext → vendor}/libmemcached-0.32/libmemcached/murmur_hash.c +0 -0
  142. /data/{ext → vendor}/libmemcached-0.32/libmemcached/visibility.h +0 -0
  143. /data/{ext → vendor}/libmemcached-0.32/libmemcachedutil/Makefile.am +0 -0
  144. /data/{ext → vendor}/libmemcached-0.32/libmemcachedutil/Makefile.in +0 -0
  145. /data/{ext → vendor}/libmemcached-0.32/libmemcachedutil/libmemcachedutil.ver +0 -0
  146. /data/{ext → vendor}/libmemcached-0.32/libmemcachedutil/memcached_pool.c +0 -0
  147. /data/{ext → vendor}/libmemcached-0.32/m4/ac_cxx_compile_stdcxx_0x.m4 +0 -0
  148. /data/{ext → vendor}/libmemcached-0.32/m4/ac_cxx_header_stdcxx_98.m4 +0 -0
  149. /data/{ext → vendor}/libmemcached-0.32/m4/acx_pthread.m4 +0 -0
  150. /data/{ext → vendor}/libmemcached-0.32/m4/byteorder.m4 +0 -0
  151. /data/{ext → vendor}/libmemcached-0.32/m4/deprecated.m4 +0 -0
  152. /data/{ext → vendor}/libmemcached-0.32/m4/enable_utillib.m4 +0 -0
  153. /data/{ext → vendor}/libmemcached-0.32/m4/extensions.m4 +0 -0
  154. /data/{ext → vendor}/libmemcached-0.32/m4/hsieh.m4 +0 -0
  155. /data/{ext → vendor}/libmemcached-0.32/m4/lib-prefix.m4 +0 -0
  156. /data/{ext → vendor}/libmemcached-0.32/m4/libtool.m4 +0 -0
  157. /data/{ext → vendor}/libmemcached-0.32/m4/ltoptions.m4 +0 -0
  158. /data/{ext → vendor}/libmemcached-0.32/m4/ltsugar.m4 +0 -0
  159. /data/{ext → vendor}/libmemcached-0.32/m4/ltversion.m4 +0 -0
  160. /data/{ext → vendor}/libmemcached-0.32/m4/lt~obsolete.m4 +0 -0
  161. /data/{ext → vendor}/libmemcached-0.32/m4/memcached.m4 +0 -0
  162. /data/{ext → vendor}/libmemcached-0.32/m4/pandora_64bit.m4 +0 -0
  163. /data/{ext → vendor}/libmemcached-0.32/m4/pandora_canonical.m4 +0 -0
  164. /data/{ext → vendor}/libmemcached-0.32/m4/pandora_check_compiler_version.m4 +0 -0
  165. /data/{ext → vendor}/libmemcached-0.32/m4/pandora_check_cxx_standard.m4 +0 -0
  166. /data/{ext → vendor}/libmemcached-0.32/m4/pandora_enable_dtrace.m4 +0 -0
  167. /data/{ext → vendor}/libmemcached-0.32/m4/pandora_ensure_gcc_version.m4 +0 -0
  168. /data/{ext → vendor}/libmemcached-0.32/m4/pandora_have_better_malloc.m4 +0 -0
  169. /data/{ext → vendor}/libmemcached-0.32/m4/pandora_have_sasl.m4 +0 -0
  170. /data/{ext → vendor}/libmemcached-0.32/m4/pandora_header_assert.m4 +0 -0
  171. /data/{ext → vendor}/libmemcached-0.32/m4/pandora_libtool.m4 +0 -0
  172. /data/{ext → vendor}/libmemcached-0.32/m4/pandora_optimize.m4 +0 -0
  173. /data/{ext → vendor}/libmemcached-0.32/m4/pandora_shared_ptr.m4 +0 -0
  174. /data/{ext → vendor}/libmemcached-0.32/m4/pandora_vc_build.m4 +0 -0
  175. /data/{ext → vendor}/libmemcached-0.32/m4/pandora_warnings.m4 +0 -0
  176. /data/{ext → vendor}/libmemcached-0.32/m4/pod2man.m4 +0 -0
  177. /data/{ext → vendor}/libmemcached-0.32/m4/protocol_binary.m4 +0 -0
  178. /data/{ext → vendor}/libmemcached-0.32/m4/setsockopt.m4 +0 -0
  179. /data/{ext → vendor}/libmemcached-0.32/m4/visibility.m4 +0 -0
  180. /data/{ext → vendor}/libmemcached-0.32/support/Makefile.am +0 -0
  181. /data/{ext → vendor}/libmemcached-0.32/support/Makefile.in +0 -0
  182. /data/{ext → vendor}/libmemcached-0.32/support/libmemcached-fc.spec.in +0 -0
  183. /data/{ext → vendor}/libmemcached-0.32/support/libmemcached.pc.in +0 -0
  184. /data/{ext → vendor}/libmemcached-0.32/support/libmemcached.spec +0 -0
  185. /data/{ext → vendor}/libmemcached-0.32/support/libmemcached.spec.in +0 -0
  186. /data/{ext → vendor}/libmemcached-0.32/support/set_benchmark.sh +0 -0
  187. /data/{ext → vendor}/libmemcached-0.32/tests/Makefile.am +0 -0
  188. /data/{ext → vendor}/libmemcached-0.32/tests/Makefile.in +0 -0
  189. /data/{ext → vendor}/libmemcached-0.32/tests/atomsmasher.c +0 -0
  190. /data/{ext → vendor}/libmemcached-0.32/tests/function.c +0 -0
  191. /data/{ext → vendor}/libmemcached-0.32/tests/ketama_test_cases.h +0 -0
  192. /data/{ext → vendor}/libmemcached-0.32/tests/output.cmp +0 -0
  193. /data/{ext → vendor}/libmemcached-0.32/tests/output.res +0 -0
  194. /data/{ext → vendor}/libmemcached-0.32/tests/output2.res +0 -0
  195. /data/{ext → vendor}/libmemcached-0.32/tests/plus.cpp +0 -0
  196. /data/{ext → vendor}/libmemcached-0.32/tests/r/memcat.res +0 -0
  197. /data/{ext → vendor}/libmemcached-0.32/tests/r/memcp.res +0 -0
  198. /data/{ext → vendor}/libmemcached-0.32/tests/r/memrm.res +0 -0
  199. /data/{ext → vendor}/libmemcached-0.32/tests/r/memslap.res +0 -0
  200. /data/{ext → vendor}/libmemcached-0.32/tests/r/memstat.res +0 -0
  201. /data/{ext → vendor}/libmemcached-0.32/tests/server.c +0 -0
  202. /data/{ext → vendor}/libmemcached-0.32/tests/server.h +0 -0
  203. /data/{ext → vendor}/libmemcached-0.32/tests/start.c +0 -0
  204. /data/{ext → vendor}/libmemcached-0.32/tests/t/memcat.test +0 -0
  205. /data/{ext → vendor}/libmemcached-0.32/tests/t/memcp.test +0 -0
  206. /data/{ext → vendor}/libmemcached-0.32/tests/t/memrm.test +0 -0
  207. /data/{ext → vendor}/libmemcached-0.32/tests/t/memslap.test +0 -0
  208. /data/{ext → vendor}/libmemcached-0.32/tests/t/memstat.test +0 -0
  209. /data/{ext → vendor}/libmemcached-0.32/tests/test.c +0 -0
  210. /data/{ext → vendor}/libmemcached-0.32/tests/test.h +0 -0
  211. /data/{ext → vendor}/libmemcached-0.32/tests/udp.c +0 -0
@@ -1,14 +1,18 @@
1
1
  /* ----------------------------------------------------------------------------
2
2
  * This file was automatically generated by SWIG (http://www.swig.org).
3
- * Version 2.0.9
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,14 +426,14 @@
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
- # define SWIG_AddCast
436
+ # define SWIG_AddCast(r) (r)
402
437
  # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
403
438
  #endif
404
439
 
@@ -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
 
@@ -462,18 +497,18 @@ SWIG_TypeNameComp(const char *f1, const char *l1,
462
497
 
463
498
  /*
464
499
  Check type equivalence in a name list like <name1>|<name2>|...
465
- Return 0 if not equal, 1 if equal
500
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
466
501
  */
467
502
  SWIGRUNTIME int
468
- SWIG_TypeEquiv(const char *nb, const char *tb) {
469
- int equiv = 0;
503
+ SWIG_TypeCmp(const char *nb, const char *tb) {
504
+ int equiv = 1;
470
505
  const char* te = tb + strlen(tb);
471
506
  const char* ne = nb;
472
- while (!equiv && *ne) {
507
+ while (equiv != 0 && *ne) {
473
508
  for (nb = ne; *ne; ++ne) {
474
509
  if (*ne == '|') break;
475
510
  }
476
- equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
511
+ equiv = SWIG_TypeNameComp(nb, ne, tb, te);
477
512
  if (*ne) ++ne;
478
513
  }
479
514
  return equiv;
@@ -481,24 +516,13 @@ SWIG_TypeEquiv(const char *nb, const char *tb) {
481
516
 
482
517
  /*
483
518
  Check type equivalence in a name list like <name1>|<name2>|...
484
- Return 0 if equal, -1 if nb < tb, 1 if nb > tb
519
+ Return 0 if not equal, 1 if equal
485
520
  */
486
521
  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;
522
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
523
+ return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
499
524
  }
500
525
 
501
-
502
526
  /*
503
527
  Check the typename
504
528
  */
@@ -526,7 +550,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
526
550
  return 0;
527
551
  }
528
552
 
529
- /*
553
+ /*
530
554
  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
531
555
  */
532
556
  SWIGRUNTIME swig_cast_info *
@@ -561,7 +585,7 @@ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
561
585
  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
562
586
  }
563
587
 
564
- /*
588
+ /*
565
589
  Dynamic pointer casting. Down an inheritance hierarchy
566
590
  */
567
591
  SWIGRUNTIME swig_type_info *
@@ -605,7 +629,7 @@ SWIG_TypePrettyName(const swig_type_info *type) {
605
629
  return type->name;
606
630
  }
607
631
 
608
- /*
632
+ /*
609
633
  Set the clientdata field for a type
610
634
  */
611
635
  SWIGRUNTIME void
@@ -613,14 +637,14 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
613
637
  swig_cast_info *cast = ti->cast;
614
638
  /* if (ti->clientdata == clientdata) return; */
615
639
  ti->clientdata = clientdata;
616
-
640
+
617
641
  while (cast) {
618
642
  if (!cast->converter) {
619
643
  swig_type_info *tc = cast->type;
620
644
  if (!tc->clientdata) {
621
645
  SWIG_TypeClientData(tc, clientdata);
622
646
  }
623
- }
647
+ }
624
648
  cast = cast->next;
625
649
  }
626
650
  }
@@ -629,31 +653,31 @@ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
629
653
  SWIG_TypeClientData(ti, clientdata);
630
654
  ti->owndata = 1;
631
655
  }
632
-
656
+
633
657
  /*
634
658
  Search for a swig_type_info structure only by mangled name
635
659
  Search is a O(log #types)
636
-
637
- 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.
638
662
  Note: if start == end at the beginning of the function, we go all the way around
639
663
  the circular list.
640
664
  */
641
665
  SWIGRUNTIME swig_type_info *
642
- SWIG_MangledTypeQueryModule(swig_module_info *start,
643
- swig_module_info *end,
666
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
667
+ swig_module_info *end,
644
668
  const char *name) {
645
669
  swig_module_info *iter = start;
646
670
  do {
647
671
  if (iter->size) {
648
- register size_t l = 0;
649
- register size_t r = iter->size - 1;
672
+ size_t l = 0;
673
+ size_t r = iter->size - 1;
650
674
  do {
651
675
  /* since l+r >= 0, we can (>> 1) instead (/ 2) */
652
- register size_t i = (l + r) >> 1;
676
+ size_t i = (l + r) >> 1;
653
677
  const char *iname = iter->types[i]->name;
654
678
  if (iname) {
655
- register int compare = strcmp(name, iname);
656
- if (compare == 0) {
679
+ int compare = strcmp(name, iname);
680
+ if (compare == 0) {
657
681
  return iter->types[i];
658
682
  } else if (compare < 0) {
659
683
  if (i) {
@@ -678,14 +702,14 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
678
702
  Search for a swig_type_info structure for either a mangled name or a human readable name.
679
703
  It first searches the mangled names of the types, which is a O(log #types)
680
704
  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.
705
+
706
+ We start searching at module start, and finish searching when start == end.
683
707
  Note: if start == end at the beginning of the function, we go all the way around
684
708
  the circular list.
685
709
  */
686
710
  SWIGRUNTIME swig_type_info *
687
- SWIG_TypeQueryModule(swig_module_info *start,
688
- swig_module_info *end,
711
+ SWIG_TypeQueryModule(swig_module_info *start,
712
+ swig_module_info *end,
689
713
  const char *name) {
690
714
  /* STEP 1: Search the name field using binary search */
691
715
  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
@@ -696,7 +720,7 @@ SWIG_TypeQueryModule(swig_module_info *start,
696
720
  of the str field (the human readable name) */
697
721
  swig_module_info *iter = start;
698
722
  do {
699
- register size_t i = 0;
723
+ size_t i = 0;
700
724
  for (; i < iter->size; ++i) {
701
725
  if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
702
726
  return iter->types[i];
@@ -704,56 +728,56 @@ SWIG_TypeQueryModule(swig_module_info *start,
704
728
  iter = iter->next;
705
729
  } while (iter != end);
706
730
  }
707
-
731
+
708
732
  /* neither found a match */
709
733
  return 0;
710
734
  }
711
735
 
712
- /*
736
+ /*
713
737
  Pack binary data into a string
714
738
  */
715
739
  SWIGRUNTIME char *
716
740
  SWIG_PackData(char *c, void *ptr, size_t sz) {
717
741
  static const char hex[17] = "0123456789abcdef";
718
- register const unsigned char *u = (unsigned char *) ptr;
719
- register const unsigned char *eu = u + sz;
742
+ const unsigned char *u = (unsigned char *) ptr;
743
+ const unsigned char *eu = u + sz;
720
744
  for (; u != eu; ++u) {
721
- register unsigned char uu = *u;
745
+ unsigned char uu = *u;
722
746
  *(c++) = hex[(uu & 0xf0) >> 4];
723
747
  *(c++) = hex[uu & 0xf];
724
748
  }
725
749
  return c;
726
750
  }
727
751
 
728
- /*
752
+ /*
729
753
  Unpack binary data from a string
730
754
  */
731
755
  SWIGRUNTIME const char *
732
756
  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;
757
+ unsigned char *u = (unsigned char *) ptr;
758
+ const unsigned char *eu = u + sz;
735
759
  for (; u != eu; ++u) {
736
- register char d = *(c++);
737
- register unsigned char uu;
760
+ char d = *(c++);
761
+ unsigned char uu;
738
762
  if ((d >= '0') && (d <= '9'))
739
- uu = ((d - '0') << 4);
763
+ uu = (unsigned char)((d - '0') << 4);
740
764
  else if ((d >= 'a') && (d <= 'f'))
741
- uu = ((d - ('a'-10)) << 4);
742
- else
765
+ uu = (unsigned char)((d - ('a'-10)) << 4);
766
+ else
743
767
  return (char *) 0;
744
768
  d = *(c++);
745
769
  if ((d >= '0') && (d <= '9'))
746
- uu |= (d - '0');
770
+ uu |= (unsigned char)(d - '0');
747
771
  else if ((d >= 'a') && (d <= 'f'))
748
- uu |= (d - ('a'-10));
749
- else
772
+ uu |= (unsigned char)(d - ('a'-10));
773
+ else
750
774
  return (char *) 0;
751
775
  *u = uu;
752
776
  }
753
777
  return c;
754
778
  }
755
779
 
756
- /*
780
+ /*
757
781
  Pack 'void *' into a string buffer.
758
782
  */
759
783
  SWIGRUNTIME char *
@@ -813,18 +837,18 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
813
837
  #endif
814
838
 
815
839
  /* 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
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
825
849
  #define SWIG_SystemError -10
826
850
  #define SWIG_AttributeError -11
827
- #define SWIG_MemoryError -12
851
+ #define SWIG_MemoryError -12
828
852
  #define SWIG_NullReferenceError -13
829
853
 
830
854
 
@@ -922,42 +946,53 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
922
946
  #ifndef RSTRUCT_PTR
923
947
  # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
924
948
  #endif
949
+ #ifndef RTYPEDDATA_P
950
+ # define RTYPEDDATA_P(x) (TYPE(x) != T_DATA)
951
+ #endif
925
952
 
926
953
 
927
954
 
928
955
  /*
929
- * Need to be very careful about how these macros are defined, especially
930
- * 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().
931
969
  *
932
- * VALUEFUNC(f) is a macro used to typecast a C function that implements
933
- * a Ruby method so that it can be passed as an argument to API functions
934
- * 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().
935
972
  *
936
- * VOIDFUNC(f) is a macro used to typecast a C function that implements
937
- * either the "mark" or "free" stuff for a Ruby Data object, so that it
938
- * 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()
939
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().
940
983
  */
941
-
942
- #ifdef __cplusplus
943
- # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
944
- # define PROTECTFUNC(f) ((VALUE (*)()) f)
945
- # define VALUEFUNC(f) ((VALUE (*)()) f)
946
- # define VOIDFUNC(f) ((void (*)()) f)
947
- # else
948
- # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
949
- # define PROTECTFUNC(f) ((VALUE (*)()) f)
950
- # define VALUEFUNC(f) ((VALUE (*)()) f)
951
- # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
952
- # else /* These definitions should work for Ruby 1.7+ */
953
- # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
954
- # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
955
- # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
956
- # endif
957
- # 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))
958
990
  #else
991
+ # define PROTECTFUNC(f) (f)
959
992
  # define VALUEFUNC(f) (f)
960
993
  # define VOIDFUNC(f) (f)
994
+ # define SWIG_RUBY_VOID_ANYARGS_FUNC(f) (f)
995
+ # define SWIG_RUBY_INT_ANYARGS_FUNC(f) (f)
961
996
  #endif
962
997
 
963
998
  /* Don't use for expressions have side effect */
@@ -1145,7 +1180,7 @@ void Ruby_Format_OverloadedError(
1145
1180
  /* -----------------------------------------------------------------------------
1146
1181
  * rubytracking.swg
1147
1182
  *
1148
- * This file contains support for tracking mappings from
1183
+ * This file contains support for tracking mappings from
1149
1184
  * Ruby objects to C++ objects. This functionality is needed
1150
1185
  * to implement mark functions for Ruby's mark and sweep
1151
1186
  * garbage collector.
@@ -1155,6 +1190,11 @@ void Ruby_Format_OverloadedError(
1155
1190
  extern "C" {
1156
1191
  #endif
1157
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
+
1158
1198
  /* Ruby 1.8 actually assumes the first case. */
1159
1199
  #if SIZEOF_VOIDP == SIZEOF_LONG
1160
1200
  # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
@@ -1166,109 +1206,69 @@ extern "C" {
1166
1206
  # error sizeof(void*) is not the same as long or long long
1167
1207
  #endif
1168
1208
 
1169
-
1170
- /* Global Ruby hash table to store Trackings from C/C++
1171
- structs to Ruby Objects.
1209
+ /* Global hash table to store Trackings from C/C++
1210
+ structs to Ruby Objects.
1172
1211
  */
1173
- static VALUE swig_ruby_trackings = Qnil;
1212
+ static st_table* swig_ruby_trackings = NULL;
1213
+
1214
+ static VALUE swig_ruby_trackings_count(ID id, VALUE *var) {
1215
+ return SWIG2NUM(swig_ruby_trackings->num_entries);
1216
+ }
1174
1217
 
1175
- /* Global variable that stores a reference to the ruby
1176
- hash table delete function. */
1177
- static ID swig_ruby_hash_delete;
1178
1218
 
1179
- /* Setup a Ruby hash table to store Trackings */
1219
+ /* Setup a hash table to store Trackings */
1180
1220
  SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1181
- /* Create a ruby hash table to store Trackings from C++
1221
+ /* Create a hash table to store Trackings from C++
1182
1222
  objects to Ruby objects. */
1183
1223
 
1184
- /* Try to see if some other .so has already created a
1224
+ /* Try to see if some other .so has already created a
1185
1225
  tracking hash table, which we keep hidden in an instance var
1186
1226
  in the SWIG module.
1187
1227
  This is done to allow multiple DSOs to share the same
1188
1228
  tracking table.
1189
1229
  */
1190
- 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__" );
1191
1234
  VALUE verbose = rb_gv_get("VERBOSE");
1192
1235
  rb_gv_set("VERBOSE", Qfalse);
1193
- swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
1236
+ trackings_value = rb_ivar_get( _mSWIG, trackings_id );
1194
1237
  rb_gv_set("VERBOSE", verbose);
1195
1238
 
1196
- /* No, it hasn't. Create one ourselves */
1197
- if ( swig_ruby_trackings == Qnil )
1198
- {
1199
- swig_ruby_trackings = rb_hash_new();
1200
- rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
1201
- }
1202
-
1203
- /* Now store a reference to the hash table delete function
1204
- so that we only have to look it up once.*/
1205
- swig_ruby_hash_delete = rb_intern("delete");
1206
- }
1207
-
1208
- /* Get a Ruby number to reference a pointer */
1209
- SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1210
- /* We cast the pointer to an unsigned long
1211
- and then store a reference to it using
1212
- a Ruby number object. */
1213
-
1214
- /* Convert the pointer to a Ruby number */
1215
- return SWIG2NUM(ptr);
1216
- }
1217
-
1218
- /* Get a Ruby number to reference an object */
1219
- SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1220
- /* We cast the object to an unsigned long
1221
- and then store a reference to it using
1222
- a Ruby number object. */
1223
-
1224
- /* Convert the Object to a Ruby number */
1225
- return SWIG2NUM(object);
1226
- }
1227
-
1228
- /* Get a Ruby object from a previously stored reference */
1229
- SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1230
- /* The provided Ruby number object is a reference
1231
- 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
+ }
1232
1250
 
1233
- /* Convert the Ruby number to a Ruby object */
1234
- 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));
1235
1254
  }
1236
1255
 
1237
1256
  /* Add a Tracking from a C/C++ struct to a Ruby object */
1238
1257
  SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
1239
- /* In a Ruby hash table we store the pointer and
1240
- the associated Ruby object. The trick here is
1241
- that we cannot store the Ruby object directly - if
1242
- we do then it cannot be garbage collected. So
1243
- instead we typecast it as a unsigned long and
1244
- convert it to a Ruby number object.*/
1245
-
1246
- /* Get a reference to the pointer as a Ruby number */
1247
- VALUE key = SWIG_RubyPtrToReference(ptr);
1248
-
1249
- /* Get a reference to the Ruby object as a Ruby number */
1250
- VALUE value = SWIG_RubyObjectToReference(object);
1251
-
1252
1258
  /* Store the mapping to the global hash table. */
1253
- rb_hash_aset(swig_ruby_trackings, key, value);
1259
+ st_insert(swig_ruby_trackings, (st_data_t)ptr, object);
1254
1260
  }
1255
1261
 
1256
1262
  /* Get the Ruby object that owns the specified C/C++ struct */
1257
1263
  SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1258
- /* Get a reference to the pointer as a Ruby number */
1259
- VALUE key = SWIG_RubyPtrToReference(ptr);
1260
-
1261
1264
  /* Now lookup the value stored in the global hash table */
1262
- VALUE value = rb_hash_aref(swig_ruby_trackings, key);
1263
-
1264
- if (value == Qnil) {
1265
- /* 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 {
1266
1270
  return Qnil;
1267
1271
  }
1268
- else {
1269
- /* Convert this value to Ruby object */
1270
- return SWIG_RubyReferenceToObject(value);
1271
- }
1272
1272
  }
1273
1273
 
1274
1274
  /* Remove a Tracking from a C/C++ struct to a Ruby object. It
@@ -1276,25 +1276,39 @@ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1276
1276
  since the same memory address may be reused later to create
1277
1277
  a new object. */
1278
1278
  SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
1279
- /* Get a reference to the pointer as a Ruby number */
1280
- VALUE key = SWIG_RubyPtrToReference(ptr);
1281
-
1282
- /* Delete the object from the hash table by calling Ruby's
1283
- do this we need to call the Hash.delete method.*/
1284
- 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);
1285
1281
  }
1286
1282
 
1287
1283
  /* This is a helper method that unlinks a Ruby object from its
1288
1284
  underlying C++ object. This is needed if the lifetime of the
1289
- Ruby object is longer than the C++ object */
1285
+ Ruby object is longer than the C++ object. */
1290
1286
  SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
1291
1287
  VALUE object = SWIG_RubyInstanceFor(ptr);
1292
1288
 
1293
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.
1294
1293
  DATA_PTR(object) = 0;
1295
1294
  }
1296
1295
  }
1297
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
+ }
1298
1312
 
1299
1313
  #ifdef __cplusplus
1300
1314
  }
@@ -1324,7 +1338,7 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1324
1338
  }
1325
1339
 
1326
1340
  /* For ruby1.8.4 and earlier. */
1327
- #ifdef __NEVER__
1341
+ #ifndef RUBY_INIT_STACK
1328
1342
  RUBY_EXTERN void Init_stack(VALUE* addr);
1329
1343
  # define RUBY_INIT_STACK \
1330
1344
  VALUE variable_in_this_stack_frame; \
@@ -1353,7 +1367,7 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1353
1367
  #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1354
1368
  #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
1355
1369
  #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
1356
- #define swig_owntype ruby_owntype
1370
+ #define swig_owntype swig_ruby_owntype
1357
1371
 
1358
1372
  /* for raw packed data */
1359
1373
  #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
@@ -1490,14 +1504,13 @@ SWIG_Ruby_InitRuntime(void)
1490
1504
  SWIGRUNTIME void
1491
1505
  SWIG_Ruby_define_class(swig_type_info *type)
1492
1506
  {
1493
- VALUE klass;
1494
1507
  char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1495
1508
  sprintf(klass_name, "TYPE%s", type->name);
1496
1509
  if (NIL_P(_cSWIG_Pointer)) {
1497
1510
  _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
1498
1511
  rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
1499
1512
  }
1500
- klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1513
+ rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1501
1514
  free((void *) klass_name);
1502
1515
  }
1503
1516
 
@@ -1511,10 +1524,11 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1511
1524
  swig_class *sklass;
1512
1525
  VALUE klass;
1513
1526
  VALUE obj;
1514
-
1527
+
1515
1528
  if (!ptr)
1516
1529
  return Qnil;
1517
-
1530
+
1531
+ assert(type);
1518
1532
  if (type->clientdata) {
1519
1533
  sklass = (swig_class *) type->clientdata;
1520
1534
 
@@ -1522,7 +1536,7 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1522
1536
  track = sklass->trackObjects;
1523
1537
  if (track) {
1524
1538
  obj = SWIG_RubyInstanceFor(ptr);
1525
-
1539
+
1526
1540
  /* Check the object's type and make sure it has the correct type.
1527
1541
  It might not in cases where methods do things like
1528
1542
  downcast methods. */
@@ -1554,7 +1568,7 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1554
1568
  obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1555
1569
  }
1556
1570
  rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1557
-
1571
+
1558
1572
  return obj;
1559
1573
  }
1560
1574
 
@@ -1574,26 +1588,30 @@ SWIGRUNTIMEINLINE char *
1574
1588
  SWIG_Ruby_MangleStr(VALUE obj)
1575
1589
  {
1576
1590
  VALUE stype = rb_iv_get(obj, "@__swigtype__");
1591
+ if (NIL_P(stype))
1592
+ return NULL;
1577
1593
  return StringValuePtr(stype);
1578
1594
  }
1579
1595
 
1580
1596
  /* Acquire a pointer value */
1581
- typedef void (*ruby_owntype)(void*);
1582
-
1583
- SWIGRUNTIME ruby_owntype
1584
- SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
1585
- if (obj) {
1586
- ruby_owntype oldown = RDATA(obj)->dfree;
1587
- RDATA(obj)->dfree = own;
1588
- return oldown;
1589
- } else {
1590
- 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;
1591
1608
  }
1609
+ return oldown;
1592
1610
  }
1593
1611
 
1594
1612
  /* Convert a pointer value */
1595
1613
  SWIGRUNTIME int
1596
- 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)
1597
1615
  {
1598
1616
  char *c;
1599
1617
  swig_cast_info *tc;
@@ -1601,16 +1619,20 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
1601
1619
 
1602
1620
  /* Grab the pointer */
1603
1621
  if (NIL_P(obj)) {
1604
- *ptr = 0;
1605
- return SWIG_OK;
1622
+ if (ptr)
1623
+ *ptr = 0;
1624
+ return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
1606
1625
  } else {
1607
- if (TYPE(obj) != T_DATA) {
1626
+ if (TYPE(obj) != T_DATA || (TYPE(obj) == T_DATA && RTYPEDDATA_P(obj))) {
1608
1627
  return SWIG_ERROR;
1609
1628
  }
1610
1629
  Data_Get_Struct(obj, void, vptr);
1611
1630
  }
1612
1631
 
1613
- if (own) *own = RDATA(obj)->dfree;
1632
+ if (own) {
1633
+ own->datafree = RDATA(obj)->dfree;
1634
+ own->own = 0;
1635
+ }
1614
1636
 
1615
1637
  /* Check to see if the input object is giving up ownership
1616
1638
  of the underlying C struct or C++ object. If so then we
@@ -1645,8 +1667,6 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
1645
1667
  /* The object has already been deleted */
1646
1668
  return SWIG_ObjectPreviouslyDeletedError;
1647
1669
  }
1648
- *ptr = vptr;
1649
- return SWIG_OK;
1650
1670
  }
1651
1671
  }
1652
1672
  if ((c = SWIG_MangleStr(obj)) == NULL) {
@@ -1656,12 +1676,23 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
1656
1676
  if (!tc) {
1657
1677
  return SWIG_ERROR;
1658
1678
  } else {
1659
- int newmemory = 0;
1660
- *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1661
- 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
+ }
1662
1692
  }
1663
1693
  } else {
1664
- *ptr = vptr;
1694
+ if (ptr)
1695
+ *ptr = vptr;
1665
1696
  }
1666
1697
 
1667
1698
  return SWIG_OK;
@@ -1687,7 +1718,7 @@ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
1687
1718
  return rb_str_new2(result);
1688
1719
  }
1689
1720
 
1690
- /* Convert a packed value value */
1721
+ /* Convert a packed pointer value */
1691
1722
  SWIGRUNTIME int
1692
1723
  SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
1693
1724
  swig_cast_info *tc;
@@ -1735,6 +1766,7 @@ SWIG_Ruby_SetModule(swig_module_info *pointer)
1735
1766
  {
1736
1767
  /* register a new class */
1737
1768
  VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
1769
+ rb_undef_alloc_func(cl);
1738
1770
  /* create and store the structure pointer to a global variable */
1739
1771
  swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
1740
1772
  rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
@@ -1750,7 +1782,7 @@ SWIG_Ruby_SetModule(swig_module_info *pointer)
1750
1782
  SWIGINTERN
1751
1783
  int SWIG_Ruby_isCallable( VALUE proc )
1752
1784
  {
1753
- if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
1785
+ if ( rb_respond_to( proc, swig_call_id ) )
1754
1786
  return 1;
1755
1787
  return 0;
1756
1788
  }
@@ -1763,7 +1795,7 @@ int SWIG_Ruby_isCallable( VALUE proc )
1763
1795
  SWIGINTERN
1764
1796
  int SWIG_Ruby_arity( VALUE proc, int minimal )
1765
1797
  {
1766
- if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
1798
+ if ( rb_respond_to( proc, swig_arity_id ) )
1767
1799
  {
1768
1800
  VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1769
1801
  int arity = NUM2INT(num);
@@ -1838,7 +1870,7 @@ static VALUE mRlibmemcached;
1838
1870
  #define SWIG_RUBY_THREAD_END_BLOCK
1839
1871
 
1840
1872
 
1841
- #define SWIGVERSION 0x020009
1873
+ #define SWIGVERSION 0x040002
1842
1874
  #define SWIG_VERSION SWIGVERSION
1843
1875
 
1844
1876
 
@@ -1855,7 +1887,7 @@ static VALUE mRlibmemcached;
1855
1887
  extern "C" {
1856
1888
  #endif
1857
1889
 
1858
- // Ruby 1.9 changed the file name of this header
1890
+ /* Ruby 1.9 changed the file name of this header */
1859
1891
  #ifdef HAVE_RUBY_IO_H
1860
1892
  #include "ruby/io.h"
1861
1893
  #else
@@ -1937,19 +1969,20 @@ SWIG_FromCharPtr(const char *cptr)
1937
1969
 
1938
1970
 
1939
1971
  SWIGINTERN VALUE
1940
- SWIG_ruby_failed(void)
1972
+ SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2))
1941
1973
  {
1942
1974
  return Qnil;
1943
1975
  }
1944
1976
 
1945
1977
 
1946
- /*@SWIG:/opt/local/share/swig/2.0.9/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
1947
- SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args)
1978
+ /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
1979
+ SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE arg)
1948
1980
  {
1981
+ VALUE *args = (VALUE *)arg;
1949
1982
  VALUE obj = args[0];
1950
1983
  VALUE type = TYPE(obj);
1951
1984
  double *res = (double *)(args[1]);
1952
- *res = NUM2DBL(obj);
1985
+ *res = NUM2DBL(obj); (void)type;
1953
1986
  return obj;
1954
1987
  }
1955
1988
  /*@SWIG@*/
@@ -1963,7 +1996,7 @@ SWIG_AsVal_double (VALUE obj, double *val)
1963
1996
  VALUE a[2];
1964
1997
  a[0] = obj;
1965
1998
  a[1] = (VALUE)(&v);
1966
- if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2DBL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1999
+ if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2DBL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
1967
2000
  if (val) *val = v;
1968
2001
  return SWIG_OK;
1969
2002
  }
@@ -1984,7 +2017,7 @@ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1984
2017
  if (cptr) {
1985
2018
  if (alloc) {
1986
2019
  if (*alloc == SWIG_NEWOBJ) {
1987
- *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
2020
+ *cptr = (char *)memcpy(malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
1988
2021
  } else {
1989
2022
  *cptr = cstr;
1990
2023
  *alloc = SWIG_OLDOBJ;
@@ -2015,7 +2048,8 @@ SWIG_AsCharArray(VALUE obj, char *val, size_t size)
2015
2048
  char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ;
2016
2049
  int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc);
2017
2050
  if (SWIG_IsOK(res)) {
2018
- if ((csize == size + 1) && cptr && !(cptr[csize-1])) --csize;
2051
+ /* special case of single char conversion when we don't need space for NUL */
2052
+ if (size == 1 && csize == 2 && cptr && !cptr[1]) --csize;
2019
2053
  if (csize <= size) {
2020
2054
  if (val) {
2021
2055
  if (csize) memcpy(val, cptr, csize*sizeof(char));
@@ -2033,9 +2067,20 @@ SWIG_AsCharArray(VALUE obj, char *val, size_t size)
2033
2067
  }
2034
2068
 
2035
2069
 
2036
- /*@SWIG:/opt/local/share/swig/2.0.9/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2037
- SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
2070
+ SWIGINTERN size_t
2071
+ SWIG_strnlen(const char* s, size_t maxlen)
2038
2072
  {
2073
+ const char *p;
2074
+ for (p = s; maxlen-- && *p; p++)
2075
+ ;
2076
+ return p - s;
2077
+ }
2078
+
2079
+
2080
+ /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2081
+ SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE arg)
2082
+ {
2083
+ VALUE *args = (VALUE *)arg;
2039
2084
  VALUE obj = args[0];
2040
2085
  VALUE type = TYPE(obj);
2041
2086
  unsigned long *res = (unsigned long *)(args[1]);
@@ -2053,7 +2098,7 @@ SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val)
2053
2098
  VALUE a[2];
2054
2099
  a[0] = obj;
2055
2100
  a[1] = (VALUE)(&v);
2056
- if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2101
+ if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
2057
2102
  if (val) *val = v;
2058
2103
  return SWIG_OK;
2059
2104
  }
@@ -2092,9 +2137,10 @@ SWIG_From_unsigned_SS_short (unsigned short value)
2092
2137
  }
2093
2138
 
2094
2139
 
2095
- /*@SWIG:/opt/local/share/swig/2.0.9/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2096
- SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
2140
+ /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2141
+ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE arg)
2097
2142
  {
2143
+ VALUE *args = (VALUE *)arg;
2098
2144
  VALUE obj = args[0];
2099
2145
  VALUE type = TYPE(obj);
2100
2146
  long *res = (long *)(args[1]);
@@ -2112,7 +2158,7 @@ SWIG_AsVal_long (VALUE obj, long* val)
2112
2158
  VALUE a[2];
2113
2159
  a[0] = obj;
2114
2160
  a[1] = (VALUE)(&v);
2115
- if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2161
+ if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
2116
2162
  if (val) *val = v;
2117
2163
  return SWIG_OK;
2118
2164
  }
@@ -2164,59 +2210,16 @@ SWIG_From_bool (bool value)
2164
2210
  }
2165
2211
 
2166
2212
 
2167
- SWIGINTERNINLINE int
2168
- SWIG_AsVal_size_t (VALUE obj, size_t *val)
2169
- {
2170
- unsigned long v;
2171
- int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
2172
- if (SWIG_IsOK(res) && val) *val = (size_t)(v);
2173
- return res;
2174
- }
2175
-
2176
-
2177
- SWIGINTERNINLINE VALUE
2178
- SWIG_From_size_t (size_t value)
2179
- {
2180
- return SWIG_From_unsigned_SS_long ((unsigned long)(value));
2181
- }
2182
-
2183
-
2184
-
2185
-
2186
-
2187
- SWIGINTERNINLINE VALUE
2188
- SWIG_From_long_SS_long (long long value)
2189
- {
2190
- return LL2NUM(value);
2191
- }
2192
-
2193
-
2194
- SWIGINTERNINLINE VALUE
2195
- SWIG_From_unsigned_SS_long_SS_long (unsigned long long value)
2196
- {
2197
- return ULL2NUM(value);
2198
- }
2199
-
2200
-
2201
- SWIGINTERN int
2202
- SWIG_AsVal_unsigned_SS_int (VALUE obj, unsigned int *val)
2203
- {
2204
- unsigned long v;
2205
- int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
2206
- if (SWIG_IsOK(res)) {
2207
- if ((v > UINT_MAX)) {
2208
- return SWIG_OverflowError;
2209
- } else {
2210
- if (val) *val = (unsigned int)(v);
2211
- }
2212
- }
2213
- return res;
2214
- }
2213
+ #if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE)
2214
+ # define SWIG_LONG_LONG_AVAILABLE
2215
+ #endif
2215
2216
 
2216
2217
 
2217
- /*@SWIG:/opt/local/share/swig/2.0.9/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2218
- SWIGINTERN VALUE SWIG_AUX_NUM2ULL(VALUE *args)
2218
+ #ifdef SWIG_LONG_LONG_AVAILABLE
2219
+ /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2220
+ SWIGINTERN VALUE SWIG_AUX_NUM2ULL(VALUE arg)
2219
2221
  {
2222
+ VALUE *args = (VALUE *)arg;
2220
2223
  VALUE obj = args[0];
2221
2224
  VALUE type = TYPE(obj);
2222
2225
  long long *res = (long long *)(args[1]);
@@ -2234,82 +2237,135 @@ SWIG_AsVal_unsigned_SS_long_SS_long (VALUE obj, unsigned long long *val)
2234
2237
  VALUE a[2];
2235
2238
  a[0] = obj;
2236
2239
  a[1] = (VALUE)(&v);
2237
- if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2240
+ if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2ULL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
2238
2241
  if (val) *val = v;
2239
2242
  return SWIG_OK;
2240
2243
  }
2241
2244
  }
2242
2245
  return SWIG_TypeError;
2243
2246
  }
2247
+ #endif
2244
2248
 
2245
2249
 
2246
- SWIGINTERNINLINE VALUE
2247
- SWIG_From_unsigned_SS_int (unsigned int value)
2248
- {
2249
- return SWIG_From_unsigned_SS_long (value);
2250
+ SWIGINTERNINLINE int
2251
+ SWIG_AsVal_size_t (VALUE obj, size_t *val)
2252
+ {
2253
+ int res = SWIG_TypeError;
2254
+ #ifdef SWIG_LONG_LONG_AVAILABLE
2255
+ if (sizeof(size_t) <= sizeof(unsigned long)) {
2256
+ #endif
2257
+ unsigned long v;
2258
+ res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
2259
+ if (SWIG_IsOK(res) && val) *val = (size_t)(v);
2260
+ #ifdef SWIG_LONG_LONG_AVAILABLE
2261
+ } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
2262
+ unsigned long long v;
2263
+ res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0);
2264
+ if (SWIG_IsOK(res) && val) *val = (size_t)(v);
2265
+ }
2266
+ #endif
2267
+ return res;
2250
2268
  }
2251
2269
 
2252
2270
 
2253
- VALUE rb_str_new_by_ref(char *ptr, long len)
2271
+ #ifdef SWIG_LONG_LONG_AVAILABLE
2272
+ SWIGINTERNINLINE VALUE
2273
+ SWIG_From_unsigned_SS_long_SS_long (unsigned long long value)
2254
2274
  {
2255
- #ifdef OBJSETUP
2256
- NEWOBJ(str, struct RString);
2257
- OBJSETUP(str, rb_cString, T_STRING);
2258
- #ifdef RSTRING_NOEMBED
2259
- /* Ruby 1.9 */
2260
- str->as.heap.ptr = ptr;
2261
- str->as.heap.len = len;
2262
- str->as.heap.aux.capa = len + 1;
2263
- // Set STR_NOEMBED
2264
- FL_SET(str, FL_USER1);
2265
- #else
2266
- /* Ruby 1.8 */
2267
- str->ptr = ptr;
2268
- str->len = len;
2269
- str->aux.capa = 0;
2270
- #endif
2271
- #else
2272
- /* Rubinius, JRuby */
2273
- VALUE str = rb_str_new(ptr, len);
2274
- free(ptr);
2275
+ return ULL2NUM(value);
2276
+ }
2277
+ #endif
2278
+
2279
+
2280
+ SWIGINTERNINLINE VALUE
2281
+ SWIG_From_size_t (size_t value)
2282
+ {
2283
+ #ifdef SWIG_LONG_LONG_AVAILABLE
2284
+ if (sizeof(size_t) <= sizeof(unsigned long)) {
2285
+ #endif
2286
+ return SWIG_From_unsigned_SS_long ((unsigned long)(value));
2287
+ #ifdef SWIG_LONG_LONG_AVAILABLE
2288
+ } else {
2289
+ /* assume sizeof(size_t) <= sizeof(unsigned long long) */
2290
+ return SWIG_From_unsigned_SS_long_SS_long ((unsigned long long)(value));
2291
+ }
2275
2292
  #endif
2276
- return (VALUE)str;
2277
2293
  }
2278
2294
 
2279
2295
 
2280
- VALUE memcached_get_rvalue(memcached_st *ptr, const char *key, size_t key_length, uint32_t *flags, memcached_return *error) {
2281
- size_t value_length = 0;
2282
- char *value = memcached_get(ptr, key, key_length, &value_length, flags, error);
2283
- return rb_str_new_by_ref(value, value_length);
2284
- };
2285
2296
 
2286
2297
 
2287
- VALUE memcached_get_len_rvalue(memcached_st *ptr, const char *key, size_t key_length, uint32_t user_spec_len, uint32_t *flags, memcached_return *error) {
2288
- size_t value_length = 0;
2289
- char *value = memcached_get_len(ptr, key, key_length, user_spec_len, &value_length, flags, error);
2290
- return rb_str_new_by_ref(value, value_length);
2291
- };
2298
+
2299
+ SWIGINTERN int
2300
+ SWIG_AsVal_unsigned_SS_int (VALUE obj, unsigned int *val)
2301
+ {
2302
+ unsigned long v;
2303
+ int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
2304
+ if (SWIG_IsOK(res)) {
2305
+ if ((v > UINT_MAX)) {
2306
+ return SWIG_OverflowError;
2307
+ } else {
2308
+ if (val) *val = (unsigned int)(v);
2309
+ }
2310
+ }
2311
+ return res;
2312
+ }
2313
+
2314
+
2315
+ SWIGINTERNINLINE VALUE
2316
+ SWIG_From_unsigned_SS_int (unsigned int value)
2317
+ {
2318
+ return SWIG_From_unsigned_SS_long (value);
2319
+ }
2292
2320
 
2293
2321
 
2294
2322
  VALUE memcached_get_from_last_rvalue(memcached_st *ptr, const char *key, size_t key_length, uint32_t *flags, memcached_return *error) {
2295
2323
  size_t value_length = 0;
2296
2324
  char *value = memcached_get_from_last(ptr, key, key_length, &value_length, flags, error);
2297
- return rb_str_new_by_ref(value, value_length);
2325
+ VALUE str = rb_str_new(value, value_length);
2326
+ free(value);
2327
+ return str;
2298
2328
  };
2299
2329
 
2300
2330
 
2301
- VALUE memcached_fetch_rvalue(memcached_st *ptr, char *key, size_t *key_length, uint32_t *flags, memcached_return *error) {
2302
- size_t value_length = 0;
2331
+ VALUE memcached_fetch_rvalue(memcached_st *ptr, const char **key, size_t *key_length, uint32_t *flags, memcached_return *error) {
2303
2332
  VALUE ary = rb_ary_new();
2304
- *key_length = 0;
2305
- if (error) *error = MEMCACHED_TIMEOUT; // timeouts leave error uninitialized
2306
- char *value = memcached_fetch(ptr, key, key_length, &value_length, flags, error);
2307
- VALUE str = rb_str_new_by_ref(value, value_length);
2333
+
2334
+ *error = MEMCACHED_TIMEOUT; // timeouts leave error uninitialized
2335
+ memcached_result_st *result = memcached_fetch_result(ptr, &ptr->result, error);
2336
+ VALUE str = Qnil;
2337
+ if (result == NULL || *error != MEMCACHED_SUCCESS) {
2338
+ *key = NULL;
2339
+ *key_length = 0;
2340
+ *flags = 0;
2341
+ str = Qnil;
2342
+ } else {
2343
+ *key = memcached_result_key_value(result);
2344
+ *key_length = memcached_result_key_length(result);
2345
+ *flags = memcached_result_flags(result);
2346
+ str = rb_str_new(memcached_result_value(result), memcached_result_length(result));
2347
+ }
2308
2348
  rb_ary_push(ary, str);
2309
2349
  return ary;
2310
2350
  };
2311
2351
 
2312
2352
 
2353
+ VALUE memcached_get_rvalue(memcached_st *ptr, const char *key, size_t key_length, uint32_t *flags, memcached_return *error) {
2354
+ *error = memcached_mget(ptr, &key, &key_length, 1);
2355
+ if (*error != MEMCACHED_SUCCESS) {
2356
+ return rb_ary_new_from_args(1, Qnil);
2357
+ }
2358
+ VALUE ret = memcached_fetch_rvalue(ptr, &key, &key_length, flags, error);
2359
+ if (*error == MEMCACHED_END) {
2360
+ *error = MEMCACHED_NOTFOUND;
2361
+ } else {
2362
+ memcached_return end_error;
2363
+ memcached_fetch_result(ptr, &ptr->result, &end_error);
2364
+ }
2365
+ return ret;
2366
+ };
2367
+
2368
+
2313
2369
  memcached_server_st *memcached_select_server_at(memcached_st *in_ptr, int index) {
2314
2370
  return &(in_ptr->hosts[index]);
2315
2371
  };
@@ -2806,22 +2862,20 @@ fail:
2806
2862
  }
2807
2863
 
2808
2864
 
2809
- #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2810
2865
  SWIGINTERN VALUE
2811
- _wrap_MemcachedAnalysisSt_allocate(VALUE self) {
2866
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2867
+ _wrap_MemcachedAnalysisSt_allocate(VALUE self)
2812
2868
  #else
2813
- SWIGINTERN VALUE
2814
- _wrap_MemcachedAnalysisSt_allocate(int argc, VALUE *argv, VALUE self) {
2869
+ _wrap_MemcachedAnalysisSt_allocate(int argc, VALUE *argv, VALUE self)
2815
2870
  #endif
2816
-
2817
-
2818
- VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_memcached_analysis_st);
2871
+ {
2872
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_memcached_analysis_st);
2819
2873
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2820
- rb_obj_call_init(vresult, argc, argv);
2874
+ rb_obj_call_init(vresult, argc, argv);
2821
2875
  #endif
2822
- return vresult;
2823
- }
2824
-
2876
+ return vresult;
2877
+ }
2878
+
2825
2879
 
2826
2880
  SWIGINTERN VALUE
2827
2881
  _wrap_new_MemcachedAnalysisSt(int argc, VALUE *argv, VALUE self) {
@@ -2839,7 +2893,8 @@ fail:
2839
2893
 
2840
2894
 
2841
2895
  SWIGINTERN void
2842
- free_memcached_analysis_st(struct memcached_analysis_st *arg1) {
2896
+ free_memcached_analysis_st(void *self) {
2897
+ struct memcached_analysis_st *arg1 = (struct memcached_analysis_st *)self;
2843
2898
  free((char *) arg1);
2844
2899
  }
2845
2900
 
@@ -4296,9 +4351,9 @@ _wrap_MemcachedStatSt_version_get(int argc, VALUE *argv, VALUE self) {
4296
4351
  arg1 = (struct memcached_stat_st *)(argp1);
4297
4352
  result = (char *)(char *) ((arg1)->version);
4298
4353
  {
4299
- size_t size = 24;
4354
+ size_t size = SWIG_strnlen(result, 24);
4355
+
4300
4356
 
4301
- while (size && (result[size - 1] == '\0')) --size;
4302
4357
 
4303
4358
  vresult = SWIG_FromCharPtrAndSize(result, size);
4304
4359
  }
@@ -4308,22 +4363,20 @@ fail:
4308
4363
  }
4309
4364
 
4310
4365
 
4311
- #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
4312
4366
  SWIGINTERN VALUE
4313
- _wrap_MemcachedStatSt_allocate(VALUE self) {
4367
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
4368
+ _wrap_MemcachedStatSt_allocate(VALUE self)
4314
4369
  #else
4315
- SWIGINTERN VALUE
4316
- _wrap_MemcachedStatSt_allocate(int argc, VALUE *argv, VALUE self) {
4370
+ _wrap_MemcachedStatSt_allocate(int argc, VALUE *argv, VALUE self)
4317
4371
  #endif
4318
-
4319
-
4320
- VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_memcached_stat_st);
4372
+ {
4373
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_memcached_stat_st);
4321
4374
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
4322
- rb_obj_call_init(vresult, argc, argv);
4375
+ rb_obj_call_init(vresult, argc, argv);
4323
4376
  #endif
4324
- return vresult;
4325
- }
4326
-
4377
+ return vresult;
4378
+ }
4379
+
4327
4380
 
4328
4381
  SWIGINTERN VALUE
4329
4382
  _wrap_new_MemcachedStatSt(int argc, VALUE *argv, VALUE self) {
@@ -4501,7 +4554,6 @@ fail:
4501
4554
  }
4502
4555
 
4503
4556
 
4504
-
4505
4557
  /*
4506
4558
  Document-method: Rlibmemcached::MemcachedSt.hash
4507
4559
 
@@ -4510,7 +4562,6 @@ fail:
4510
4562
 
4511
4563
  Hashing function for class.
4512
4564
  */
4513
-
4514
4565
  /*
4515
4566
  Document-method: Rlibmemcached::MemcachedSt.hash=
4516
4567
 
@@ -4738,7 +4789,7 @@ _wrap_MemcachedSt_snd_timeout_get(int argc, VALUE *argv, VALUE self) {
4738
4789
  }
4739
4790
  arg1 = (struct memcached_st *)(argp1);
4740
4791
  result = ((arg1)->snd_timeout);
4741
- vresult = SWIG_NewPointerObj((int32_t *)memcpy((int32_t *)malloc(sizeof(int32_t)),&result,sizeof(int32_t)), SWIGTYPE_p_int32_t, SWIG_POINTER_OWN | 0 );
4792
+ vresult = SWIG_NewPointerObj((int32_t *)memcpy((int32_t *)calloc(1,sizeof(int32_t)),&result,sizeof(int32_t)), SWIGTYPE_p_int32_t, SWIG_POINTER_OWN | 0 );
4742
4793
  return vresult;
4743
4794
  fail:
4744
4795
  return Qnil;
@@ -4797,7 +4848,66 @@ _wrap_MemcachedSt_rcv_timeout_get(int argc, VALUE *argv, VALUE self) {
4797
4848
  }
4798
4849
  arg1 = (struct memcached_st *)(argp1);
4799
4850
  result = ((arg1)->rcv_timeout);
4800
- vresult = SWIG_NewPointerObj((int32_t *)memcpy((int32_t *)malloc(sizeof(int32_t)),&result,sizeof(int32_t)), SWIGTYPE_p_int32_t, SWIG_POINTER_OWN | 0 );
4851
+ vresult = SWIG_NewPointerObj((int32_t *)memcpy((int32_t *)calloc(1,sizeof(int32_t)),&result,sizeof(int32_t)), SWIGTYPE_p_int32_t, SWIG_POINTER_OWN | 0 );
4852
+ return vresult;
4853
+ fail:
4854
+ return Qnil;
4855
+ }
4856
+
4857
+
4858
+ SWIGINTERN VALUE
4859
+ _wrap_MemcachedSt_poll_max_retries_set(int argc, VALUE *argv, VALUE self) {
4860
+ struct memcached_st *arg1 = (struct memcached_st *) 0 ;
4861
+ int32_t arg2 ;
4862
+ void *argp1 = 0 ;
4863
+ int res1 = 0 ;
4864
+ void *argp2 ;
4865
+ int res2 = 0 ;
4866
+
4867
+ if ((argc < 1) || (argc > 1)) {
4868
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
4869
+ }
4870
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
4871
+ if (!SWIG_IsOK(res1)) {
4872
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_st *","poll_max_retries", 1, self ));
4873
+ }
4874
+ arg1 = (struct memcached_st *)(argp1);
4875
+ {
4876
+ res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_int32_t, 0 );
4877
+ if (!SWIG_IsOK(res2)) {
4878
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "int32_t","poll_max_retries", 2, argv[0] ));
4879
+ }
4880
+ if (!argp2) {
4881
+ SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "int32_t","poll_max_retries", 2, argv[0]));
4882
+ } else {
4883
+ arg2 = *((int32_t *)(argp2));
4884
+ }
4885
+ }
4886
+ if (arg1) (arg1)->poll_max_retries = arg2;
4887
+ return Qnil;
4888
+ fail:
4889
+ return Qnil;
4890
+ }
4891
+
4892
+
4893
+ SWIGINTERN VALUE
4894
+ _wrap_MemcachedSt_poll_max_retries_get(int argc, VALUE *argv, VALUE self) {
4895
+ struct memcached_st *arg1 = (struct memcached_st *) 0 ;
4896
+ void *argp1 = 0 ;
4897
+ int res1 = 0 ;
4898
+ int32_t result;
4899
+ VALUE vresult = Qnil;
4900
+
4901
+ if ((argc < 0) || (argc > 0)) {
4902
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
4903
+ }
4904
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
4905
+ if (!SWIG_IsOK(res1)) {
4906
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_st *","poll_max_retries", 1, self ));
4907
+ }
4908
+ arg1 = (struct memcached_st *)(argp1);
4909
+ result = ((arg1)->poll_max_retries);
4910
+ vresult = SWIG_NewPointerObj((int32_t *)memcpy((int32_t *)calloc(1,sizeof(int32_t)),&result,sizeof(int32_t)), SWIGTYPE_p_int32_t, SWIG_POINTER_OWN | 0 );
4801
4911
  return vresult;
4802
4912
  fail:
4803
4913
  return Qnil;
@@ -5328,7 +5438,7 @@ _wrap_MemcachedSt_poll_timeout_get(int argc, VALUE *argv, VALUE self) {
5328
5438
  }
5329
5439
  arg1 = (struct memcached_st *)(argp1);
5330
5440
  result = ((arg1)->poll_timeout);
5331
- vresult = SWIG_NewPointerObj((int32_t *)memcpy((int32_t *)malloc(sizeof(int32_t)),&result,sizeof(int32_t)), SWIGTYPE_p_int32_t, SWIG_POINTER_OWN | 0 );
5441
+ vresult = SWIG_NewPointerObj((int32_t *)memcpy((int32_t *)calloc(1,sizeof(int32_t)),&result,sizeof(int32_t)), SWIGTYPE_p_int32_t, SWIG_POINTER_OWN | 0 );
5332
5442
  return vresult;
5333
5443
  fail:
5334
5444
  return Qnil;
@@ -5387,7 +5497,7 @@ _wrap_MemcachedSt_connect_timeout_get(int argc, VALUE *argv, VALUE self) {
5387
5497
  }
5388
5498
  arg1 = (struct memcached_st *)(argp1);
5389
5499
  result = ((arg1)->connect_timeout);
5390
- vresult = SWIG_NewPointerObj((int32_t *)memcpy((int32_t *)malloc(sizeof(int32_t)),&result,sizeof(int32_t)), SWIGTYPE_p_int32_t, SWIG_POINTER_OWN | 0 );
5500
+ vresult = SWIG_NewPointerObj((int32_t *)memcpy((int32_t *)calloc(1,sizeof(int32_t)),&result,sizeof(int32_t)), SWIGTYPE_p_int32_t, SWIG_POINTER_OWN | 0 );
5391
5501
  return vresult;
5392
5502
  fail:
5393
5503
  return Qnil;
@@ -5446,7 +5556,7 @@ _wrap_MemcachedSt_retry_timeout_get(int argc, VALUE *argv, VALUE self) {
5446
5556
  }
5447
5557
  arg1 = (struct memcached_st *)(argp1);
5448
5558
  result = ((arg1)->retry_timeout);
5449
- vresult = SWIG_NewPointerObj((int32_t *)memcpy((int32_t *)malloc(sizeof(int32_t)),&result,sizeof(int32_t)), SWIGTYPE_p_int32_t, SWIG_POINTER_OWN | 0 );
5559
+ vresult = SWIG_NewPointerObj((int32_t *)memcpy((int32_t *)calloc(1,sizeof(int32_t)),&result,sizeof(int32_t)), SWIGTYPE_p_int32_t, SWIG_POINTER_OWN | 0 );
5450
5560
  return vresult;
5451
5561
  fail:
5452
5562
  return Qnil;
@@ -5883,7 +5993,7 @@ _wrap_MemcachedSt_result_get(int argc, VALUE *argv, VALUE self) {
5883
5993
  }
5884
5994
  arg1 = (struct memcached_st *)(argp1);
5885
5995
  result = ((arg1)->result);
5886
- vresult = SWIG_NewPointerObj((memcached_result_st *)memcpy((memcached_result_st *)malloc(sizeof(memcached_result_st)),&result,sizeof(memcached_result_st)), SWIGTYPE_p_memcached_result_st, SWIG_POINTER_OWN | 0 );
5996
+ vresult = SWIG_NewPointerObj((memcached_result_st *)memcpy((memcached_result_st *)calloc(1,sizeof(memcached_result_st)),&result,sizeof(memcached_result_st)), SWIGTYPE_p_memcached_result_st, SWIG_POINTER_OWN | 0 );
5887
5997
  return vresult;
5888
5998
  fail:
5889
5999
  return Qnil;
@@ -5995,7 +6105,7 @@ _wrap_MemcachedSt_on_clone_get(int argc, VALUE *argv, VALUE self) {
5995
6105
  }
5996
6106
  arg1 = (struct memcached_st *)(argp1);
5997
6107
  result = ((arg1)->on_clone);
5998
- vresult = SWIG_NewPointerObj((memcached_clone_func *)memcpy((memcached_clone_func *)malloc(sizeof(memcached_clone_func)),&result,sizeof(memcached_clone_func)), SWIGTYPE_p_memcached_clone_func, SWIG_POINTER_OWN | 0 );
6108
+ vresult = SWIG_NewPointerObj((memcached_clone_func *)memcpy((memcached_clone_func *)calloc(1,sizeof(memcached_clone_func)),&result,sizeof(memcached_clone_func)), SWIGTYPE_p_memcached_clone_func, SWIG_POINTER_OWN | 0 );
5999
6109
  return vresult;
6000
6110
  fail:
6001
6111
  return Qnil;
@@ -6054,7 +6164,7 @@ _wrap_MemcachedSt_on_cleanup_get(int argc, VALUE *argv, VALUE self) {
6054
6164
  }
6055
6165
  arg1 = (struct memcached_st *)(argp1);
6056
6166
  result = ((arg1)->on_cleanup);
6057
- vresult = SWIG_NewPointerObj((memcached_cleanup_func *)memcpy((memcached_cleanup_func *)malloc(sizeof(memcached_cleanup_func)),&result,sizeof(memcached_cleanup_func)), SWIGTYPE_p_memcached_cleanup_func, SWIG_POINTER_OWN | 0 );
6167
+ vresult = SWIG_NewPointerObj((memcached_cleanup_func *)memcpy((memcached_cleanup_func *)calloc(1,sizeof(memcached_cleanup_func)),&result,sizeof(memcached_cleanup_func)), SWIGTYPE_p_memcached_cleanup_func, SWIG_POINTER_OWN | 0 );
6058
6168
  return vresult;
6059
6169
  fail:
6060
6170
  return Qnil;
@@ -6113,7 +6223,7 @@ _wrap_MemcachedSt_call_free_get(int argc, VALUE *argv, VALUE self) {
6113
6223
  }
6114
6224
  arg1 = (struct memcached_st *)(argp1);
6115
6225
  result = ((arg1)->call_free);
6116
- vresult = SWIG_NewPointerObj((memcached_free_function *)memcpy((memcached_free_function *)malloc(sizeof(memcached_free_function)),&result,sizeof(memcached_free_function)), SWIGTYPE_p_memcached_free_function, SWIG_POINTER_OWN | 0 );
6226
+ vresult = SWIG_NewPointerObj((memcached_free_function *)memcpy((memcached_free_function *)calloc(1,sizeof(memcached_free_function)),&result,sizeof(memcached_free_function)), SWIGTYPE_p_memcached_free_function, SWIG_POINTER_OWN | 0 );
6117
6227
  return vresult;
6118
6228
  fail:
6119
6229
  return Qnil;
@@ -6172,7 +6282,7 @@ _wrap_MemcachedSt_call_malloc_get(int argc, VALUE *argv, VALUE self) {
6172
6282
  }
6173
6283
  arg1 = (struct memcached_st *)(argp1);
6174
6284
  result = ((arg1)->call_malloc);
6175
- vresult = SWIG_NewPointerObj((memcached_malloc_function *)memcpy((memcached_malloc_function *)malloc(sizeof(memcached_malloc_function)),&result,sizeof(memcached_malloc_function)), SWIGTYPE_p_memcached_malloc_function, SWIG_POINTER_OWN | 0 );
6285
+ vresult = SWIG_NewPointerObj((memcached_malloc_function *)memcpy((memcached_malloc_function *)calloc(1,sizeof(memcached_malloc_function)),&result,sizeof(memcached_malloc_function)), SWIGTYPE_p_memcached_malloc_function, SWIG_POINTER_OWN | 0 );
6176
6286
  return vresult;
6177
6287
  fail:
6178
6288
  return Qnil;
@@ -6231,7 +6341,7 @@ _wrap_MemcachedSt_call_realloc_get(int argc, VALUE *argv, VALUE self) {
6231
6341
  }
6232
6342
  arg1 = (struct memcached_st *)(argp1);
6233
6343
  result = ((arg1)->call_realloc);
6234
- vresult = SWIG_NewPointerObj((memcached_realloc_function *)memcpy((memcached_realloc_function *)malloc(sizeof(memcached_realloc_function)),&result,sizeof(memcached_realloc_function)), SWIGTYPE_p_memcached_realloc_function, SWIG_POINTER_OWN | 0 );
6344
+ vresult = SWIG_NewPointerObj((memcached_realloc_function *)memcpy((memcached_realloc_function *)calloc(1,sizeof(memcached_realloc_function)),&result,sizeof(memcached_realloc_function)), SWIGTYPE_p_memcached_realloc_function, SWIG_POINTER_OWN | 0 );
6235
6345
  return vresult;
6236
6346
  fail:
6237
6347
  return Qnil;
@@ -6290,7 +6400,7 @@ _wrap_MemcachedSt_call_calloc_get(int argc, VALUE *argv, VALUE self) {
6290
6400
  }
6291
6401
  arg1 = (struct memcached_st *)(argp1);
6292
6402
  result = ((arg1)->call_calloc);
6293
- vresult = SWIG_NewPointerObj((memcached_calloc_function *)memcpy((memcached_calloc_function *)malloc(sizeof(memcached_calloc_function)),&result,sizeof(memcached_calloc_function)), SWIGTYPE_p_memcached_calloc_function, SWIG_POINTER_OWN | 0 );
6403
+ vresult = SWIG_NewPointerObj((memcached_calloc_function *)memcpy((memcached_calloc_function *)calloc(1,sizeof(memcached_calloc_function)),&result,sizeof(memcached_calloc_function)), SWIGTYPE_p_memcached_calloc_function, SWIG_POINTER_OWN | 0 );
6294
6404
  return vresult;
6295
6405
  fail:
6296
6406
  return Qnil;
@@ -6349,7 +6459,7 @@ _wrap_MemcachedSt_get_key_failure_get(int argc, VALUE *argv, VALUE self) {
6349
6459
  }
6350
6460
  arg1 = (struct memcached_st *)(argp1);
6351
6461
  result = ((arg1)->get_key_failure);
6352
- vresult = SWIG_NewPointerObj((memcached_trigger_key *)memcpy((memcached_trigger_key *)malloc(sizeof(memcached_trigger_key)),&result,sizeof(memcached_trigger_key)), SWIGTYPE_p_memcached_trigger_key, SWIG_POINTER_OWN | 0 );
6462
+ vresult = SWIG_NewPointerObj((memcached_trigger_key *)memcpy((memcached_trigger_key *)calloc(1,sizeof(memcached_trigger_key)),&result,sizeof(memcached_trigger_key)), SWIGTYPE_p_memcached_trigger_key, SWIG_POINTER_OWN | 0 );
6353
6463
  return vresult;
6354
6464
  fail:
6355
6465
  return Qnil;
@@ -6408,7 +6518,7 @@ _wrap_MemcachedSt_delete_trigger_get(int argc, VALUE *argv, VALUE self) {
6408
6518
  }
6409
6519
  arg1 = (struct memcached_st *)(argp1);
6410
6520
  result = ((arg1)->delete_trigger);
6411
- vresult = SWIG_NewPointerObj((memcached_trigger_delete_key *)memcpy((memcached_trigger_delete_key *)malloc(sizeof(memcached_trigger_delete_key)),&result,sizeof(memcached_trigger_delete_key)), SWIGTYPE_p_memcached_trigger_delete_key, SWIG_POINTER_OWN | 0 );
6521
+ vresult = SWIG_NewPointerObj((memcached_trigger_delete_key *)memcpy((memcached_trigger_delete_key *)calloc(1,sizeof(memcached_trigger_delete_key)),&result,sizeof(memcached_trigger_delete_key)), SWIGTYPE_p_memcached_trigger_delete_key, SWIG_POINTER_OWN | 0 );
6412
6522
  return vresult;
6413
6523
  fail:
6414
6524
  return Qnil;
@@ -6463,9 +6573,9 @@ _wrap_MemcachedSt_prefix_key_get(int argc, VALUE *argv, VALUE self) {
6463
6573
  arg1 = (struct memcached_st *)(argp1);
6464
6574
  result = (char *)(char *) ((arg1)->prefix_key);
6465
6575
  {
6466
- size_t size = MEMCACHED_PREFIX_KEY_MAX_SIZE;
6576
+ size_t size = SWIG_strnlen(result, MEMCACHED_PREFIX_KEY_MAX_SIZE);
6577
+
6467
6578
 
6468
- while (size && (result[size - 1] == '\0')) --size;
6469
6579
 
6470
6580
  vresult = SWIG_FromCharPtrAndSize(result, size);
6471
6581
  }
@@ -6756,22 +6866,20 @@ fail:
6756
6866
  }
6757
6867
 
6758
6868
 
6759
- #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
6760
6869
  SWIGINTERN VALUE
6761
- _wrap_MemcachedSt_allocate(VALUE self) {
6870
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
6871
+ _wrap_MemcachedSt_allocate(VALUE self)
6762
6872
  #else
6763
- SWIGINTERN VALUE
6764
- _wrap_MemcachedSt_allocate(int argc, VALUE *argv, VALUE self) {
6873
+ _wrap_MemcachedSt_allocate(int argc, VALUE *argv, VALUE self)
6765
6874
  #endif
6766
-
6767
-
6768
- VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_memcached_st);
6875
+ {
6876
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_memcached_st);
6769
6877
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
6770
- rb_obj_call_init(vresult, argc, argv);
6878
+ rb_obj_call_init(vresult, argc, argv);
6771
6879
  #endif
6772
- return vresult;
6773
- }
6774
-
6880
+ return vresult;
6881
+ }
6882
+
6775
6883
 
6776
6884
  SWIGINTERN VALUE
6777
6885
  _wrap_new_MemcachedSt(int argc, VALUE *argv, VALUE self) {
@@ -9034,6 +9142,11 @@ _wrap_memcached_fetch(int argc, VALUE *argv, VALUE self) {
9034
9142
  memcached_return *arg6 = (memcached_return *) 0 ;
9035
9143
  void *argp1 = 0 ;
9036
9144
  int res1 = 0 ;
9145
+ int res2 ;
9146
+ char *buf2 = 0 ;
9147
+ int alloc2 = 0 ;
9148
+ void *argp3 = 0 ;
9149
+ int res3 = 0 ;
9037
9150
  size_t temp4 ;
9038
9151
  int res4 = SWIG_TMPOBJ ;
9039
9152
  uint32_t temp5 ;
@@ -9043,23 +9156,27 @@ _wrap_memcached_fetch(int argc, VALUE *argv, VALUE self) {
9043
9156
  char *result = 0 ;
9044
9157
  VALUE vresult = Qnil;
9045
9158
 
9046
- {
9047
- char string[256];
9048
- size_t length = 0;
9049
- arg2 = string;
9050
- arg3 = &length;
9051
- }
9052
9159
  arg4 = &temp4;
9053
9160
  arg5 = &temp5;
9054
9161
  arg6 = &temp6;
9055
- if ((argc < 1) || (argc > 1)) {
9056
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
9162
+ if ((argc < 3) || (argc > 3)) {
9163
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
9057
9164
  }
9058
9165
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
9059
9166
  if (!SWIG_IsOK(res1)) {
9060
9167
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "memcached_st *","memcached_fetch", 1, argv[0] ));
9061
9168
  }
9062
9169
  arg1 = (memcached_st *)(argp1);
9170
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
9171
+ if (!SWIG_IsOK(res2)) {
9172
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","memcached_fetch", 2, argv[1] ));
9173
+ }
9174
+ arg2 = (char *)(buf2);
9175
+ res3 = SWIG_ConvertPtr(argv[2], &argp3,SWIGTYPE_p_size_t, 0 | 0 );
9176
+ if (!SWIG_IsOK(res3)) {
9177
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "size_t *","memcached_fetch", 3, argv[2] ));
9178
+ }
9179
+ arg3 = (size_t *)(argp3);
9063
9180
  result = (char *)memcached_fetch(arg1,arg2,arg3,arg4,arg5,arg6);
9064
9181
  vresult = SWIG_FromCharPtr((const char *)result);
9065
9182
  {
@@ -9083,8 +9200,10 @@ _wrap_memcached_fetch(int argc, VALUE *argv, VALUE self) {
9083
9200
  int new_flags = SWIG_IsNewObj(res6) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
9084
9201
  vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_memcached_return, new_flags));
9085
9202
  }
9203
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
9086
9204
  return vresult;
9087
9205
  fail:
9206
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
9088
9207
  return Qnil;
9089
9208
  }
9090
9209
 
@@ -10265,7 +10384,7 @@ _wrap_MemcachedResultSt_value_get(int argc, VALUE *argv, VALUE self) {
10265
10384
  }
10266
10385
  arg1 = (struct memcached_result_st *)(argp1);
10267
10386
  result = ((arg1)->value);
10268
- vresult = SWIG_NewPointerObj((memcached_string_st *)memcpy((memcached_string_st *)malloc(sizeof(memcached_string_st)),&result,sizeof(memcached_string_st)), SWIGTYPE_p_memcached_string_st, SWIG_POINTER_OWN | 0 );
10387
+ vresult = SWIG_NewPointerObj((memcached_string_st *)memcpy((memcached_string_st *)calloc(1,sizeof(memcached_string_st)),&result,sizeof(memcached_string_st)), SWIGTYPE_p_memcached_string_st, SWIG_POINTER_OWN | 0 );
10269
10388
  return vresult;
10270
10389
  fail:
10271
10390
  return Qnil;
@@ -10320,9 +10439,9 @@ _wrap_MemcachedResultSt_key_get(int argc, VALUE *argv, VALUE self) {
10320
10439
  arg1 = (struct memcached_result_st *)(argp1);
10321
10440
  result = (char *)(char *) ((arg1)->key);
10322
10441
  {
10323
- size_t size = 251;
10442
+ size_t size = SWIG_strnlen(result, 251);
10443
+
10324
10444
 
10325
- while (size && (result[size - 1] == '\0')) --size;
10326
10445
 
10327
10446
  vresult = SWIG_FromCharPtrAndSize(result, size);
10328
10447
  }
@@ -10332,22 +10451,20 @@ fail:
10332
10451
  }
10333
10452
 
10334
10453
 
10335
- #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
10336
10454
  SWIGINTERN VALUE
10337
- _wrap_MemcachedResultSt_allocate(VALUE self) {
10455
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
10456
+ _wrap_MemcachedResultSt_allocate(VALUE self)
10338
10457
  #else
10339
- SWIGINTERN VALUE
10340
- _wrap_MemcachedResultSt_allocate(int argc, VALUE *argv, VALUE self) {
10458
+ _wrap_MemcachedResultSt_allocate(int argc, VALUE *argv, VALUE self)
10341
10459
  #endif
10342
-
10343
-
10344
- VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_memcached_result_st);
10460
+ {
10461
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_memcached_result_st);
10345
10462
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
10346
- rb_obj_call_init(vresult, argc, argv);
10463
+ rb_obj_call_init(vresult, argc, argv);
10347
10464
  #endif
10348
- return vresult;
10349
- }
10350
-
10465
+ return vresult;
10466
+ }
10467
+
10351
10468
 
10352
10469
  SWIGINTERN VALUE
10353
10470
  _wrap_new_MemcachedResultSt(int argc, VALUE *argv, VALUE self) {
@@ -10365,7 +10482,8 @@ fail:
10365
10482
 
10366
10483
 
10367
10484
  SWIGINTERN void
10368
- free_memcached_result_st(struct memcached_result_st *arg1) {
10485
+ free_memcached_result_st(void *self) {
10486
+ struct memcached_result_st *arg1 = (struct memcached_result_st *)self;
10369
10487
  free((char *) arg1);
10370
10488
  }
10371
10489
 
@@ -11312,7 +11430,7 @@ _wrap_MemcachedServerSt_read_ptr_set(int argc, VALUE *argv, VALUE self) {
11312
11430
  if (arg1->read_ptr) free((char*)arg1->read_ptr);
11313
11431
  if (arg2) {
11314
11432
  size_t size = strlen((const char *)(arg2)) + 1;
11315
- arg1->read_ptr = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
11433
+ arg1->read_ptr = (char *)(char *)memcpy(malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
11316
11434
  } else {
11317
11435
  arg1->read_ptr = 0;
11318
11436
  }
@@ -11374,7 +11492,7 @@ _wrap_MemcachedServerSt_cached_server_error_set(int argc, VALUE *argv, VALUE sel
11374
11492
  if (arg1->cached_server_error) free((char*)arg1->cached_server_error);
11375
11493
  if (arg2) {
11376
11494
  size_t size = strlen((const char *)(arg2)) + 1;
11377
- arg1->cached_server_error = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
11495
+ arg1->cached_server_error = (char *)(char *)memcpy(malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
11378
11496
  } else {
11379
11497
  arg1->cached_server_error = 0;
11380
11498
  }
@@ -11838,9 +11956,9 @@ _wrap_MemcachedServerSt_read_buffer_get(int argc, VALUE *argv, VALUE self) {
11838
11956
  arg1 = (struct memcached_server_st *)(argp1);
11839
11957
  result = (char *)(char *) ((arg1)->read_buffer);
11840
11958
  {
11841
- size_t size = 8196;
11959
+ size_t size = SWIG_strnlen(result, 8196);
11960
+
11842
11961
 
11843
- while (size && (result[size - 1] == '\0')) --size;
11844
11962
 
11845
11963
  vresult = SWIG_FromCharPtrAndSize(result, size);
11846
11964
  }
@@ -11898,9 +12016,9 @@ _wrap_MemcachedServerSt_write_buffer_get(int argc, VALUE *argv, VALUE self) {
11898
12016
  arg1 = (struct memcached_server_st *)(argp1);
11899
12017
  result = (char *)(char *) ((arg1)->write_buffer);
11900
12018
  {
11901
- size_t size = 8196;
12019
+ size_t size = SWIG_strnlen(result, 8196);
12020
+
11902
12021
 
11903
- while (size && (result[size - 1] == '\0')) --size;
11904
12022
 
11905
12023
  vresult = SWIG_FromCharPtrAndSize(result, size);
11906
12024
  }
@@ -11958,9 +12076,9 @@ _wrap_MemcachedServerSt_hostname_get(int argc, VALUE *argv, VALUE self) {
11958
12076
  arg1 = (struct memcached_server_st *)(argp1);
11959
12077
  result = (char *)(char *) ((arg1)->hostname);
11960
12078
  {
11961
- size_t size = 64;
12079
+ size_t size = SWIG_strnlen(result, 64);
12080
+
11962
12081
 
11963
- while (size && (result[size - 1] == '\0')) --size;
11964
12082
 
11965
12083
  vresult = SWIG_FromCharPtrAndSize(result, size);
11966
12084
  }
@@ -11970,22 +12088,20 @@ fail:
11970
12088
  }
11971
12089
 
11972
12090
 
11973
- #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
11974
12091
  SWIGINTERN VALUE
11975
- _wrap_MemcachedServerSt_allocate(VALUE self) {
12092
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
12093
+ _wrap_MemcachedServerSt_allocate(VALUE self)
11976
12094
  #else
11977
- SWIGINTERN VALUE
11978
- _wrap_MemcachedServerSt_allocate(int argc, VALUE *argv, VALUE self) {
12095
+ _wrap_MemcachedServerSt_allocate(int argc, VALUE *argv, VALUE self)
11979
12096
  #endif
11980
-
11981
-
11982
- VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_memcached_server_st);
12097
+ {
12098
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_memcached_server_st);
11983
12099
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
11984
- rb_obj_call_init(vresult, argc, argv);
12100
+ rb_obj_call_init(vresult, argc, argv);
11985
12101
  #endif
11986
- return vresult;
11987
- }
11988
-
12102
+ return vresult;
12103
+ }
12104
+
11989
12105
 
11990
12106
  SWIGINTERN VALUE
11991
12107
  _wrap_new_MemcachedServerSt(int argc, VALUE *argv, VALUE self) {
@@ -12683,42 +12799,7 @@ fail:
12683
12799
 
12684
12800
 
12685
12801
  SWIGINTERN VALUE
12686
- _wrap_rb_str_new_by_ref(int argc, VALUE *argv, VALUE self) {
12687
- char *arg1 = (char *) 0 ;
12688
- long arg2 ;
12689
- int res1 ;
12690
- char *buf1 = 0 ;
12691
- int alloc1 = 0 ;
12692
- long val2 ;
12693
- int ecode2 = 0 ;
12694
- VALUE result;
12695
- VALUE vresult = Qnil;
12696
-
12697
- if ((argc < 2) || (argc > 2)) {
12698
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
12699
- }
12700
- res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
12701
- if (!SWIG_IsOK(res1)) {
12702
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char *","rb_str_new_by_ref", 1, argv[0] ));
12703
- }
12704
- arg1 = (char *)(buf1);
12705
- ecode2 = SWIG_AsVal_long(argv[1], &val2);
12706
- if (!SWIG_IsOK(ecode2)) {
12707
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "long","rb_str_new_by_ref", 2, argv[1] ));
12708
- }
12709
- arg2 = (long)(val2);
12710
- result = (VALUE)rb_str_new_by_ref(arg1,arg2);
12711
- vresult = result;
12712
- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
12713
- return vresult;
12714
- fail:
12715
- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
12716
- return Qnil;
12717
- }
12718
-
12719
-
12720
- SWIGINTERN VALUE
12721
- _wrap_memcached_get_rvalue(int argc, VALUE *argv, VALUE self) {
12802
+ _wrap_memcached_get_from_last_rvalue(int argc, VALUE *argv, VALUE self) {
12722
12803
  memcached_st *arg1 = (memcached_st *) 0 ;
12723
12804
  char *arg2 = (char *) 0 ;
12724
12805
  size_t arg3 ;
@@ -12740,7 +12821,7 @@ _wrap_memcached_get_rvalue(int argc, VALUE *argv, VALUE self) {
12740
12821
  }
12741
12822
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
12742
12823
  if (!SWIG_IsOK(res1)) {
12743
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "memcached_st *","memcached_get_rvalue", 1, argv[0] ));
12824
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "memcached_st *","memcached_get_from_last_rvalue", 1, argv[0] ));
12744
12825
  }
12745
12826
  arg1 = (memcached_st *)(argp1);
12746
12827
  {
@@ -12749,7 +12830,7 @@ _wrap_memcached_get_rvalue(int argc, VALUE *argv, VALUE self) {
12749
12830
  arg2 = RSTRING_PTR(str);
12750
12831
  arg3 = RSTRING_LEN(str);
12751
12832
  }
12752
- result = (VALUE)memcached_get_rvalue(arg1,(char const *)arg2,arg3,arg4,arg5);
12833
+ result = (VALUE)memcached_get_from_last_rvalue(arg1,(char const *)arg2,arg3,arg4,arg5);
12753
12834
  vresult = result;
12754
12835
  if (SWIG_IsTmpObj(res4)) {
12755
12836
  vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_unsigned_SS_int((*arg4)));
@@ -12770,70 +12851,10 @@ fail:
12770
12851
 
12771
12852
 
12772
12853
  SWIGINTERN VALUE
12773
- _wrap_memcached_get_len_rvalue(int argc, VALUE *argv, VALUE self) {
12774
- memcached_st *arg1 = (memcached_st *) 0 ;
12775
- char *arg2 = (char *) 0 ;
12776
- size_t arg3 ;
12777
- uint32_t arg4 ;
12778
- uint32_t *arg5 = (uint32_t *) 0 ;
12779
- memcached_return *arg6 = (memcached_return *) 0 ;
12780
- void *argp1 = 0 ;
12781
- int res1 = 0 ;
12782
- unsigned int val4 ;
12783
- int ecode4 = 0 ;
12784
- uint32_t temp5 ;
12785
- int res5 = SWIG_TMPOBJ ;
12786
- memcached_return temp6 ;
12787
- int res6 = SWIG_TMPOBJ ;
12788
- VALUE result;
12789
- VALUE vresult = Qnil;
12790
-
12791
- arg5 = &temp5;
12792
- arg6 = &temp6;
12793
- if ((argc < 3) || (argc > 3)) {
12794
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
12795
- }
12796
- res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
12797
- if (!SWIG_IsOK(res1)) {
12798
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "memcached_st *","memcached_get_len_rvalue", 1, argv[0] ));
12799
- }
12800
- arg1 = (memcached_st *)(argp1);
12801
- {
12802
- VALUE str;
12803
- str = rb_string_value(&argv[1]);
12804
- arg2 = RSTRING_PTR(str);
12805
- arg3 = RSTRING_LEN(str);
12806
- }
12807
- ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
12808
- if (!SWIG_IsOK(ecode4)) {
12809
- SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "uint32_t","memcached_get_len_rvalue", 4, argv[2] ));
12810
- }
12811
- arg4 = (uint32_t)(val4);
12812
- result = (VALUE)memcached_get_len_rvalue(arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
12813
- vresult = result;
12814
- if (SWIG_IsTmpObj(res5)) {
12815
- vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_unsigned_SS_int((*arg5)));
12816
- } else {
12817
- int new_flags = SWIG_IsNewObj(res5) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
12818
- vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_uint32_t, new_flags));
12819
- }
12820
- if (SWIG_IsTmpObj(res6)) {
12821
- vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_unsigned_SS_short((*arg6)));
12822
- } else {
12823
- int new_flags = SWIG_IsNewObj(res6) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
12824
- vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_memcached_return, new_flags));
12825
- }
12826
- return vresult;
12827
- fail:
12828
- return Qnil;
12829
- }
12830
-
12831
-
12832
- SWIGINTERN VALUE
12833
- _wrap_memcached_get_from_last_rvalue(int argc, VALUE *argv, VALUE self) {
12854
+ _wrap_memcached_fetch_rvalue(int argc, VALUE *argv, VALUE self) {
12834
12855
  memcached_st *arg1 = (memcached_st *) 0 ;
12835
- char *arg2 = (char *) 0 ;
12836
- size_t arg3 ;
12856
+ char **arg2 = (char **) 0 ;
12857
+ size_t *arg3 = (size_t *) 0 ;
12837
12858
  uint32_t *arg4 = (uint32_t *) 0 ;
12838
12859
  memcached_return *arg5 = (memcached_return *) 0 ;
12839
12860
  void *argp1 = 0 ;
@@ -12845,24 +12866,27 @@ _wrap_memcached_get_from_last_rvalue(int argc, VALUE *argv, VALUE self) {
12845
12866
  VALUE result;
12846
12867
  VALUE vresult = Qnil;
12847
12868
 
12869
+ {
12870
+ const char *key_ptr;
12871
+ size_t key_length_ptr;
12872
+ arg2 = &key_ptr;
12873
+ arg3 = &key_length_ptr;
12874
+ }
12848
12875
  arg4 = &temp4;
12849
12876
  arg5 = &temp5;
12850
- if ((argc < 2) || (argc > 2)) {
12851
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
12877
+ if ((argc < 1) || (argc > 1)) {
12878
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
12852
12879
  }
12853
12880
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
12854
12881
  if (!SWIG_IsOK(res1)) {
12855
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "memcached_st *","memcached_get_from_last_rvalue", 1, argv[0] ));
12882
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "memcached_st *","memcached_fetch_rvalue", 1, argv[0] ));
12856
12883
  }
12857
12884
  arg1 = (memcached_st *)(argp1);
12885
+ result = (VALUE)memcached_fetch_rvalue(arg1,(char const **)arg2,arg3,arg4,arg5);
12886
+ vresult = result;
12858
12887
  {
12859
- VALUE str;
12860
- str = rb_string_value(&argv[1]);
12861
- arg2 = RSTRING_PTR(str);
12862
- arg3 = RSTRING_LEN(str);
12888
+ rb_ary_push(vresult, rb_str_new(*arg2, *arg3));
12863
12889
  }
12864
- result = (VALUE)memcached_get_from_last_rvalue(arg1,(char const *)arg2,arg3,arg4,arg5);
12865
- vresult = result;
12866
12890
  if (SWIG_IsTmpObj(res4)) {
12867
12891
  vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_unsigned_SS_int((*arg4)));
12868
12892
  } else {
@@ -12882,10 +12906,10 @@ fail:
12882
12906
 
12883
12907
 
12884
12908
  SWIGINTERN VALUE
12885
- _wrap_memcached_fetch_rvalue(int argc, VALUE *argv, VALUE self) {
12909
+ _wrap_memcached_get_rvalue(int argc, VALUE *argv, VALUE self) {
12886
12910
  memcached_st *arg1 = (memcached_st *) 0 ;
12887
12911
  char *arg2 = (char *) 0 ;
12888
- size_t *arg3 = (size_t *) 0 ;
12912
+ size_t arg3 ;
12889
12913
  uint32_t *arg4 = (uint32_t *) 0 ;
12890
12914
  memcached_return *arg5 = (memcached_return *) 0 ;
12891
12915
  void *argp1 = 0 ;
@@ -12897,27 +12921,24 @@ _wrap_memcached_fetch_rvalue(int argc, VALUE *argv, VALUE self) {
12897
12921
  VALUE result;
12898
12922
  VALUE vresult = Qnil;
12899
12923
 
12900
- {
12901
- char string[256];
12902
- size_t length = 0;
12903
- arg2 = string;
12904
- arg3 = &length;
12905
- }
12906
12924
  arg4 = &temp4;
12907
12925
  arg5 = &temp5;
12908
- if ((argc < 1) || (argc > 1)) {
12909
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
12926
+ if ((argc < 2) || (argc > 2)) {
12927
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
12910
12928
  }
12911
12929
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
12912
12930
  if (!SWIG_IsOK(res1)) {
12913
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "memcached_st *","memcached_fetch_rvalue", 1, argv[0] ));
12931
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "memcached_st *","memcached_get_rvalue", 1, argv[0] ));
12914
12932
  }
12915
12933
  arg1 = (memcached_st *)(argp1);
12916
- result = (VALUE)memcached_fetch_rvalue(arg1,arg2,arg3,arg4,arg5);
12917
- vresult = result;
12918
12934
  {
12919
- rb_ary_push(vresult, rb_str_new(arg2, *arg3));
12935
+ VALUE str;
12936
+ str = rb_string_value(&argv[1]);
12937
+ arg2 = RSTRING_PTR(str);
12938
+ arg3 = RSTRING_LEN(str);
12920
12939
  }
12940
+ result = (VALUE)memcached_get_rvalue(arg1,(char const *)arg2,arg3,arg4,arg5);
12941
+ vresult = result;
12921
12942
  if (SWIG_IsTmpObj(res4)) {
12922
12943
  vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_unsigned_SS_int((*arg4)));
12923
12944
  } else {
@@ -13188,18 +13209,18 @@ static swig_cast_info *swig_cast_initial[] = {
13188
13209
 
13189
13210
  /* -----------------------------------------------------------------------------
13190
13211
  * Type initialization:
13191
- * This problem is tough by the requirement that no dynamic
13192
- * memory is used. Also, since swig_type_info structures store pointers to
13212
+ * This problem is tough by the requirement that no dynamic
13213
+ * memory is used. Also, since swig_type_info structures store pointers to
13193
13214
  * swig_cast_info structures and swig_cast_info structures store pointers back
13194
- * to swig_type_info structures, we need some lookup code at initialization.
13195
- * The idea is that swig generates all the structures that are needed.
13196
- * The runtime then collects these partially filled structures.
13197
- * The SWIG_InitializeModule function takes these initial arrays out of
13215
+ * to swig_type_info structures, we need some lookup code at initialization.
13216
+ * The idea is that swig generates all the structures that are needed.
13217
+ * The runtime then collects these partially filled structures.
13218
+ * The SWIG_InitializeModule function takes these initial arrays out of
13198
13219
  * swig_module, and does all the lookup, filling in the swig_module.types
13199
13220
  * array with the correct data and linking the correct swig_cast_info
13200
13221
  * structures together.
13201
13222
  *
13202
- * The generated swig_type_info structures are assigned staticly to an initial
13223
+ * The generated swig_type_info structures are assigned statically to an initial
13203
13224
  * array. We just loop through that array, and handle each type individually.
13204
13225
  * First we lookup if this type has been already loaded, and if so, use the
13205
13226
  * loaded structure instead of the generated one. Then we have to fill in the
@@ -13209,17 +13230,17 @@ static swig_cast_info *swig_cast_initial[] = {
13209
13230
  * a column is one of the swig_cast_info structures for that type.
13210
13231
  * The cast_initial array is actually an array of arrays, because each row has
13211
13232
  * a variable number of columns. So to actually build the cast linked list,
13212
- * we find the array of casts associated with the type, and loop through it
13233
+ * we find the array of casts associated with the type, and loop through it
13213
13234
  * adding the casts to the list. The one last trick we need to do is making
13214
13235
  * sure the type pointer in the swig_cast_info struct is correct.
13215
13236
  *
13216
- * First off, we lookup the cast->type name to see if it is already loaded.
13237
+ * First off, we lookup the cast->type name to see if it is already loaded.
13217
13238
  * There are three cases to handle:
13218
13239
  * 1) If the cast->type has already been loaded AND the type we are adding
13219
13240
  * casting info to has not been loaded (it is in this module), THEN we
13220
13241
  * replace the cast->type pointer with the type pointer that has already
13221
13242
  * been loaded.
13222
- * 2) If BOTH types (the one we are adding casting info to, and the
13243
+ * 2) If BOTH types (the one we are adding casting info to, and the
13223
13244
  * cast->type) are loaded, THEN the cast info has already been loaded by
13224
13245
  * the previous module so we just ignore it.
13225
13246
  * 3) Finally, if cast->type has not already been loaded, then we add that
@@ -13243,7 +13264,7 @@ SWIGRUNTIME void
13243
13264
  SWIG_InitializeModule(void *clientdata) {
13244
13265
  size_t i;
13245
13266
  swig_module_info *module_head, *iter;
13246
- int found, init;
13267
+ int init;
13247
13268
 
13248
13269
  /* check to see if the circular list has been setup, if not, set it up */
13249
13270
  if (swig_module.next==0) {
@@ -13262,27 +13283,23 @@ SWIG_InitializeModule(void *clientdata) {
13262
13283
  /* This is the first module loaded for this interpreter */
13263
13284
  /* so set the swig module into the interpreter */
13264
13285
  SWIG_SetModule(clientdata, &swig_module);
13265
- module_head = &swig_module;
13266
13286
  } else {
13267
13287
  /* the interpreter has loaded a SWIG module, but has it loaded this one? */
13268
- found=0;
13269
13288
  iter=module_head;
13270
13289
  do {
13271
13290
  if (iter==&swig_module) {
13272
- found=1;
13273
- break;
13291
+ /* Our module is already in the list, so there's nothing more to do. */
13292
+ return;
13274
13293
  }
13275
13294
  iter=iter->next;
13276
13295
  } while (iter!= module_head);
13277
13296
 
13278
- /* if the is found in the list, then all is done and we may leave */
13279
- if (found) return;
13280
- /* otherwise we must add out module into the list */
13297
+ /* otherwise we must add our module into the list */
13281
13298
  swig_module.next = module_head->next;
13282
13299
  module_head->next = &swig_module;
13283
13300
  }
13284
13301
 
13285
- /* When multiple interpeters are used, a module could have already been initialized in
13302
+ /* When multiple interpreters are used, a module could have already been initialized in
13286
13303
  a different interpreter, but not yet have a pointer in this interpreter.
13287
13304
  In this case, we do not want to continue adding types... everything should be
13288
13305
  set up already */
@@ -13290,15 +13307,15 @@ SWIG_InitializeModule(void *clientdata) {
13290
13307
 
13291
13308
  /* Now work on filling in swig_module.types */
13292
13309
  #ifdef SWIGRUNTIME_DEBUG
13293
- printf("SWIG_InitializeModule: size %d\n", swig_module.size);
13310
+ printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
13294
13311
  #endif
13295
13312
  for (i = 0; i < swig_module.size; ++i) {
13296
13313
  swig_type_info *type = 0;
13297
13314
  swig_type_info *ret;
13298
13315
  swig_cast_info *cast;
13299
-
13316
+
13300
13317
  #ifdef SWIGRUNTIME_DEBUG
13301
- printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
13318
+ printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
13302
13319
  #endif
13303
13320
 
13304
13321
  /* if there is another module already loaded */
@@ -13323,7 +13340,7 @@ SWIG_InitializeModule(void *clientdata) {
13323
13340
  /* Insert casting types */
13324
13341
  cast = swig_module.cast_initial[i];
13325
13342
  while (cast->type) {
13326
-
13343
+
13327
13344
  /* Don't need to add information already in the list */
13328
13345
  ret = 0;
13329
13346
  #ifdef SWIGRUNTIME_DEBUG
@@ -13374,7 +13391,7 @@ SWIG_InitializeModule(void *clientdata) {
13374
13391
  for (i = 0; i < swig_module.size; ++i) {
13375
13392
  int j = 0;
13376
13393
  swig_cast_info *cast = swig_module.cast_initial[i];
13377
- printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
13394
+ printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
13378
13395
  while (cast->type) {
13379
13396
  printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
13380
13397
  cast++;
@@ -13542,6 +13559,8 @@ SWIGEXPORT void Init_rlibmemcached(void) {
13542
13559
  rb_define_method(SwigClassMemcachedSt.klass, "snd_timeout", _wrap_MemcachedSt_snd_timeout_get, -1);
13543
13560
  rb_define_method(SwigClassMemcachedSt.klass, "rcv_timeout=", _wrap_MemcachedSt_rcv_timeout_set, -1);
13544
13561
  rb_define_method(SwigClassMemcachedSt.klass, "rcv_timeout", _wrap_MemcachedSt_rcv_timeout_get, -1);
13562
+ rb_define_method(SwigClassMemcachedSt.klass, "poll_max_retries=", _wrap_MemcachedSt_poll_max_retries_set, -1);
13563
+ rb_define_method(SwigClassMemcachedSt.klass, "poll_max_retries", _wrap_MemcachedSt_poll_max_retries_get, -1);
13545
13564
  rb_define_method(SwigClassMemcachedSt.klass, "server_failure_limit=", _wrap_MemcachedSt_server_failure_limit_set, -1);
13546
13565
  rb_define_method(SwigClassMemcachedSt.klass, "server_failure_limit", _wrap_MemcachedSt_server_failure_limit_get, -1);
13547
13566
  rb_define_method(SwigClassMemcachedSt.klass, "io_msg_watermark=", _wrap_MemcachedSt_io_msg_watermark_set, -1);
@@ -13900,11 +13919,9 @@ SWIGEXPORT void Init_rlibmemcached(void) {
13900
13919
  rb_define_module_function(mRlibmemcached, "memcached_touch_by_key", _wrap_memcached_touch_by_key, -1);
13901
13920
  rb_define_module_function(mRlibmemcached, "memcached_exist", _wrap_memcached_exist, -1);
13902
13921
  rb_define_module_function(mRlibmemcached, "memcached_exist_by_key", _wrap_memcached_exist_by_key, -1);
13903
- rb_define_module_function(mRlibmemcached, "rb_str_new_by_ref", _wrap_rb_str_new_by_ref, -1);
13904
- rb_define_module_function(mRlibmemcached, "memcached_get_rvalue", _wrap_memcached_get_rvalue, -1);
13905
- rb_define_module_function(mRlibmemcached, "memcached_get_len_rvalue", _wrap_memcached_get_len_rvalue, -1);
13906
13922
  rb_define_module_function(mRlibmemcached, "memcached_get_from_last_rvalue", _wrap_memcached_get_from_last_rvalue, -1);
13907
13923
  rb_define_module_function(mRlibmemcached, "memcached_fetch_rvalue", _wrap_memcached_fetch_rvalue, -1);
13924
+ rb_define_module_function(mRlibmemcached, "memcached_get_rvalue", _wrap_memcached_get_rvalue, -1);
13908
13925
  rb_define_module_function(mRlibmemcached, "memcached_select_server_at", _wrap_memcached_select_server_at, -1);
13909
13926
  rb_define_module_function(mRlibmemcached, "memcached_select_stat_at", _wrap_memcached_select_stat_at, -1);
13910
13927
  rb_define_module_function(mRlibmemcached, "memcached_generate_hash_rvalue", _wrap_memcached_generate_hash_rvalue, -1);