memcached 0.12 → 0.14

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,4 +1,8 @@
1
1
 
2
+ v0.14. Update to libmemcached 0.26. Various bugfixes. Expose memcached_generate_hash_rvalue.
3
+
4
+ v0.13. Update to libmemcached 0.25. Use new built-in failover. Document fixed timeouts.
5
+
2
6
  v0.12. Update to libmemcached 0.24. Support weights and flags. Default to HASH_WITH_PREFIX behavior. Note, if you use ketama, upgrading will invalidate your entire cache.
3
7
 
4
8
  v0.11. Update to libmemcached 0.22. Support hostname lookups. Register %freefunc for MemcachedSt and remove destroy() method. Use new built-in behavior for namespacing. Raise on version mismatch. Remove private hash function. Fix bug related to socket size behavior reset when struct is initialized with missing servers (Jeffrey Hardy). Note, if you use a namespace, upgrading will invalidate your entire cache.
data/COMPATIBILITY CHANGED
@@ -4,7 +4,9 @@
4
4
  This chart shows which versions of the Ruby library are compatible with which versions of libmemcached.
5
5
 
6
6
  <b>Library version</b>:: <b>libmemcached version</b>
7
- 0.12:: 0.25
7
+ 0.14:: 0.26
8
+ 0.13:: 0.25
9
+ 0.12:: 0.24
8
10
  0.11:: 0.22
9
11
  0.10:: 0.20
10
12
  0.9:: 0.19
data/README CHANGED
@@ -22,14 +22,14 @@ The <b>memcached</b> library wraps the pure-C libmemcached client via SWIG.
22
22
 
23
23
  == Installation
24
24
 
25
- You need Ruby 1.8.6, and {libmemcached 0.25}[http://tangent.org/552/libmemcached.html]. Other versions are not supported. You also need {memcached itself}[http://www.danga.com/memcached/] if you want to test against a local server.
25
+ You need Ruby 1.8.6, and {libmemcached 0.26}[http://tangent.org/552/libmemcached.html]. Other versions are not supported. You also need {memcached itself}[http://www.danga.com/memcached/] if you want to test against a local server.
26
26
 
27
- For Linux, download and extract the {libmemcached tarball}[http://download.tangent.org/libmemcached-0.25.tar.gz]. Then run:
27
+ For Linux, download and extract the {libmemcached tarball}[http://download.tangent.org/libmemcached-0.26.tar.gz]. Then run:
28
28
  ./configure
29
29
  make && sudo make install
30
30
 
31
31
  For OS X, you may be able to install it from MacPorts:
32
- sudo port install libmemcached @0.25
32
+ sudo port install libmemcached @0.26
33
33
 
34
34
  Now install the gem:
35
35
  sudo gem install memcached --no-rdoc --no-ri
@@ -107,8 +107,6 @@ There is a compatibility wrapper for legacy applications called Memcached::Rails
107
107
  # Join the thread so that exceptions don't get lost
108
108
  thread.join
109
109
 
110
- Make sure to call Memcached#destroy before your thread exits or you will leak memory.
111
-
112
110
  == Benchmarks
113
111
 
114
112
  <b>memcached</b> is up to 150x faster than <b>memcache-client</b>, and up to 15x faster than <b>caffeine</b>. See BENCHMARKS[link:files/BENCHMARKS.html] for details.
data/ext/rlibmemcached.i CHANGED
@@ -19,7 +19,7 @@
19
19
  %apply unsigned short { uint8_t };
20
20
  %apply unsigned int { uint16_t };
21
21
  %apply unsigned long { uint32_t flags, uint32_t offset, uint32_t weight };
22
- %apply unsigned long long {uint64_t data, uint64_t cas };
22
+ %apply unsigned long long { uint64_t data, uint64_t cas };
23
23
 
24
24
  // Array of strings map for multiget
25
25
  %typemap(in) (char **keys, size_t *key_length, unsigned int number_of_keys) {
@@ -72,7 +72,7 @@
72
72
 
73
73
  // Uint64
74
74
  %typemap(out) (uint64_t) {
75
- $result = INT2FIX($1);
75
+ $result = ULL2NUM($1);
76
76
  };
77
77
 
78
78
  // String for memcached_fetch
@@ -93,7 +93,7 @@
93
93
  int i;
94
94
  VALUE ary = rb_ary_new();
95
95
  $result = rb_ary_new();
96
-
96
+
97
97
  for(i=0; $1[i] != NULL; i++) {
98
98
  rb_ary_store(ary, i, rb_str_new2($1[i]));
99
99
  }
@@ -176,3 +176,13 @@ memcached_stat_st *memcached_select_stat_at(memcached_st *in_ptr, memcached_stat
176
176
  return &(stat_ptr[index]);
177
177
  };
178
178
  %}
179
+
180
+ // Wrap only hash function
181
+ // Uint32
182
+ VALUE memcached_generate_hash_rvalue(const char *key, size_t key_length, memcached_hash hash_algorithm);
183
+ %{
184
+ VALUE memcached_generate_hash_rvalue(const char *key, size_t key_length,memcached_hash hash_algorithm) {
185
+ return UINT2NUM(memcached_generate_hash_value(key, key_length, hash_algorithm));
186
+ };
187
+ %}
188
+
@@ -1765,36 +1765,35 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
1765
1765
  #define SWIGTYPE_p_addrinfo swig_types[0]
1766
1766
  #define SWIGTYPE_p_char swig_types[1]
1767
1767
  #define SWIGTYPE_p_int32_t swig_types[2]
1768
- #define SWIGTYPE_p_memcached_allocated swig_types[3]
1769
- #define SWIGTYPE_p_memcached_behavior swig_types[4]
1770
- #define SWIGTYPE_p_memcached_callback swig_types[5]
1771
- #define SWIGTYPE_p_memcached_cleanup_func swig_types[6]
1772
- #define SWIGTYPE_p_memcached_clone_func swig_types[7]
1773
- #define SWIGTYPE_p_memcached_connection swig_types[8]
1774
- #define SWIGTYPE_p_memcached_continuum_item_st swig_types[9]
1775
- #define SWIGTYPE_p_memcached_execute_function swig_types[10]
1776
- #define SWIGTYPE_p_memcached_free_function swig_types[11]
1777
- #define SWIGTYPE_p_memcached_hash swig_types[12]
1778
- #define SWIGTYPE_p_memcached_malloc_function swig_types[13]
1779
- #define SWIGTYPE_p_memcached_realloc_function swig_types[14]
1780
- #define SWIGTYPE_p_memcached_result_st swig_types[15]
1781
- #define SWIGTYPE_p_memcached_return swig_types[16]
1782
- #define SWIGTYPE_p_memcached_server_distribution swig_types[17]
1783
- #define SWIGTYPE_p_memcached_server_function swig_types[18]
1784
- #define SWIGTYPE_p_memcached_server_st swig_types[19]
1785
- #define SWIGTYPE_p_memcached_st swig_types[20]
1786
- #define SWIGTYPE_p_memcached_stat_st swig_types[21]
1787
- #define SWIGTYPE_p_memcached_string_st swig_types[22]
1788
- #define SWIGTYPE_p_memcached_trigger_delete_key swig_types[23]
1789
- #define SWIGTYPE_p_memcached_trigger_key swig_types[24]
1790
- #define SWIGTYPE_p_p_char swig_types[25]
1791
- #define SWIGTYPE_p_size_t swig_types[26]
1792
- #define SWIGTYPE_p_time_t swig_types[27]
1793
- #define SWIGTYPE_p_uint32_t swig_types[28]
1794
- #define SWIGTYPE_p_uint64_t swig_types[29]
1795
- #define SWIGTYPE_p_void swig_types[30]
1796
- static swig_type_info *swig_types[32];
1797
- static swig_module_info swig_module = {swig_types, 31, 0, 0, 0, 0};
1768
+ #define SWIGTYPE_p_memcached_behavior swig_types[3]
1769
+ #define SWIGTYPE_p_memcached_callback swig_types[4]
1770
+ #define SWIGTYPE_p_memcached_cleanup_func swig_types[5]
1771
+ #define SWIGTYPE_p_memcached_clone_func swig_types[6]
1772
+ #define SWIGTYPE_p_memcached_connection swig_types[7]
1773
+ #define SWIGTYPE_p_memcached_continuum_item_st swig_types[8]
1774
+ #define SWIGTYPE_p_memcached_execute_function swig_types[9]
1775
+ #define SWIGTYPE_p_memcached_free_function swig_types[10]
1776
+ #define SWIGTYPE_p_memcached_hash swig_types[11]
1777
+ #define SWIGTYPE_p_memcached_malloc_function swig_types[12]
1778
+ #define SWIGTYPE_p_memcached_realloc_function swig_types[13]
1779
+ #define SWIGTYPE_p_memcached_result_st swig_types[14]
1780
+ #define SWIGTYPE_p_memcached_return swig_types[15]
1781
+ #define SWIGTYPE_p_memcached_server_distribution swig_types[16]
1782
+ #define SWIGTYPE_p_memcached_server_function swig_types[17]
1783
+ #define SWIGTYPE_p_memcached_server_st swig_types[18]
1784
+ #define SWIGTYPE_p_memcached_st swig_types[19]
1785
+ #define SWIGTYPE_p_memcached_stat_st swig_types[20]
1786
+ #define SWIGTYPE_p_memcached_string_st swig_types[21]
1787
+ #define SWIGTYPE_p_memcached_trigger_delete_key swig_types[22]
1788
+ #define SWIGTYPE_p_memcached_trigger_key swig_types[23]
1789
+ #define SWIGTYPE_p_p_char swig_types[24]
1790
+ #define SWIGTYPE_p_size_t swig_types[25]
1791
+ #define SWIGTYPE_p_time_t swig_types[26]
1792
+ #define SWIGTYPE_p_uint32_t swig_types[27]
1793
+ #define SWIGTYPE_p_uint64_t swig_types[28]
1794
+ #define SWIGTYPE_p_void swig_types[29]
1795
+ static swig_type_info *swig_types[31];
1796
+ static swig_module_info swig_module = {swig_types, 30, 0, 0, 0, 0};
1798
1797
  #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1799
1798
  #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1800
1799
 
@@ -1968,26 +1967,26 @@ SWIG_ruby_failed(void)
1968
1967
 
1969
1968
 
1970
1969
  /*@SWIG:/opt/local/share/swig/1.3.36/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
1971
- SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
1970
+ SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
1972
1971
  {
1973
1972
  VALUE obj = args[0];
1974
1973
  VALUE type = TYPE(obj);
1975
- long *res = (long *)(args[1]);
1976
- *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
1974
+ unsigned long *res = (unsigned long *)(args[1]);
1975
+ *res = type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj);
1977
1976
  return obj;
1978
1977
  }
1979
1978
  /*@SWIG@*/
1980
1979
 
1981
1980
  SWIGINTERN int
1982
- SWIG_AsVal_long (VALUE obj, long* val)
1981
+ SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val)
1983
1982
  {
1984
1983
  VALUE type = TYPE(obj);
1985
1984
  if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
1986
- long v;
1985
+ unsigned long v;
1987
1986
  VALUE a[2];
1988
1987
  a[0] = obj;
1989
1988
  a[1] = (VALUE)(&v);
1990
- if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1989
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1991
1990
  if (val) *val = v;
1992
1991
  return SWIG_OK;
1993
1992
  }
@@ -1997,42 +1996,56 @@ SWIG_AsVal_long (VALUE obj, long* val)
1997
1996
 
1998
1997
 
1999
1998
  SWIGINTERN int
2000
- SWIG_AsVal_int (VALUE obj, int *val)
1999
+ SWIG_AsVal_unsigned_SS_short (VALUE obj, unsigned short *val)
2001
2000
  {
2002
- long v;
2003
- int res = SWIG_AsVal_long (obj, &v);
2001
+ unsigned long v;
2002
+ int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
2004
2003
  if (SWIG_IsOK(res)) {
2005
- if ((v < INT_MIN || v > INT_MAX)) {
2004
+ if ((v > USHRT_MAX)) {
2006
2005
  return SWIG_OverflowError;
2007
2006
  } else {
2008
- if (val) *val = (int)(v);
2007
+ if (val) *val = (unsigned short)(v);
2009
2008
  }
2010
2009
  }
2011
2010
  return res;
2012
2011
  }
2013
2012
 
2014
2013
 
2014
+ SWIGINTERNINLINE VALUE
2015
+ SWIG_From_unsigned_SS_long (unsigned long value)
2016
+ {
2017
+ return ULONG2NUM(value);
2018
+ }
2019
+
2020
+
2021
+ SWIGINTERNINLINE VALUE
2022
+ SWIG_From_unsigned_SS_short (unsigned short value)
2023
+ {
2024
+ return SWIG_From_unsigned_SS_long (value);
2025
+ }
2026
+
2027
+
2015
2028
  /*@SWIG:/opt/local/share/swig/1.3.36/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
2016
- SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
2029
+ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
2017
2030
  {
2018
2031
  VALUE obj = args[0];
2019
2032
  VALUE type = TYPE(obj);
2020
- unsigned long *res = (unsigned long *)(args[1]);
2021
- *res = type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj);
2033
+ long *res = (long *)(args[1]);
2034
+ *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
2022
2035
  return obj;
2023
2036
  }
2024
2037
  /*@SWIG@*/
2025
2038
 
2026
2039
  SWIGINTERN int
2027
- SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val)
2040
+ SWIG_AsVal_long (VALUE obj, long* val)
2028
2041
  {
2029
2042
  VALUE type = TYPE(obj);
2030
2043
  if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
2031
- unsigned long v;
2044
+ long v;
2032
2045
  VALUE a[2];
2033
2046
  a[0] = obj;
2034
2047
  a[1] = (VALUE)(&v);
2035
- if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2048
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2036
2049
  if (val) *val = v;
2037
2050
  return SWIG_OK;
2038
2051
  }
@@ -2041,10 +2054,46 @@ SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val)
2041
2054
  }
2042
2055
 
2043
2056
 
2057
+ SWIGINTERN int
2058
+ SWIG_AsVal_int (VALUE obj, int *val)
2059
+ {
2060
+ long v;
2061
+ int res = SWIG_AsVal_long (obj, &v);
2062
+ if (SWIG_IsOK(res)) {
2063
+ if ((v < INT_MIN || v > INT_MAX)) {
2064
+ return SWIG_OverflowError;
2065
+ } else {
2066
+ if (val) *val = (int)(v);
2067
+ }
2068
+ }
2069
+ return res;
2070
+ }
2071
+
2072
+
2073
+ SWIGINTERN int
2074
+ SWIG_AsVal_bool (VALUE obj, bool *val)
2075
+ {
2076
+ if (obj == Qtrue) {
2077
+ if (val) *val = true;
2078
+ return SWIG_OK;
2079
+ } else if (obj == Qfalse) {
2080
+ if (val) *val = false;
2081
+ return SWIG_OK;
2082
+ } else {
2083
+ int res = 0;
2084
+ if (SWIG_AsVal_int (obj, &res) == SWIG_OK) {
2085
+ if (val) *val = res ? true : false;
2086
+ return SWIG_OK;
2087
+ }
2088
+ }
2089
+ return SWIG_TypeError;
2090
+ }
2091
+
2092
+
2044
2093
  SWIGINTERNINLINE VALUE
2045
- SWIG_From_unsigned_SS_long (unsigned long value)
2094
+ SWIG_From_bool (bool value)
2046
2095
  {
2047
- return ULONG2NUM(value);
2096
+ return value ? Qtrue : Qfalse;
2048
2097
  }
2049
2098
 
2050
2099
 
@@ -2065,32 +2114,6 @@ SWIG_From_size_t (size_t value)
2065
2114
  }
2066
2115
 
2067
2116
 
2068
- SWIGINTERN int
2069
- SWIG_AsVal_char (VALUE obj, char *val)
2070
- {
2071
- int res = SWIG_AsCharArray(obj, val, 1);
2072
- if (!SWIG_IsOK(res)) {
2073
- long v;
2074
- res = SWIG_AddCast(SWIG_AsVal_long (obj, &v));
2075
- if (SWIG_IsOK(res)) {
2076
- if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) {
2077
- if (val) *val = (char)(v);
2078
- } else {
2079
- res = SWIG_OverflowError;
2080
- }
2081
- }
2082
- }
2083
- return res;
2084
- }
2085
-
2086
-
2087
- SWIGINTERNINLINE VALUE
2088
- SWIG_From_char (char c)
2089
- {
2090
- return SWIG_FromCharPtrAndSize(&c,1);
2091
- }
2092
-
2093
-
2094
2117
 
2095
2118
 
2096
2119
 
@@ -2108,13 +2131,6 @@ SWIG_From_unsigned_SS_long_SS_long (unsigned long long value)
2108
2131
  }
2109
2132
 
2110
2133
 
2111
- SWIGINTERNINLINE VALUE
2112
- SWIG_From_unsigned_SS_short (unsigned short value)
2113
- {
2114
- return SWIG_From_unsigned_SS_long (value);
2115
- }
2116
-
2117
-
2118
2134
  SWIGINTERN int
2119
2135
  SWIG_AsVal_unsigned_SS_int (VALUE obj, unsigned int *val)
2120
2136
  {
@@ -2167,22 +2183,6 @@ SWIG_From_unsigned_SS_int (unsigned int value)
2167
2183
  }
2168
2184
 
2169
2185
 
2170
- SWIGINTERN int
2171
- SWIG_AsVal_unsigned_SS_short (VALUE obj, unsigned short *val)
2172
- {
2173
- unsigned long v;
2174
- int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
2175
- if (SWIG_IsOK(res)) {
2176
- if ((v > USHRT_MAX)) {
2177
- return SWIG_OverflowError;
2178
- } else {
2179
- if (val) *val = (unsigned short)(v);
2180
- }
2181
- }
2182
- return res;
2183
- }
2184
-
2185
-
2186
2186
  VALUE memcached_get_rvalue(memcached_st *ptr, const char *key, size_t key_length, uint32_t *flags, memcached_return *error) {
2187
2187
  VALUE ret;
2188
2188
  size_t value_length;
@@ -2228,6 +2228,11 @@ memcached_stat_st *memcached_select_stat_at(memcached_st *in_ptr, memcached_stat
2228
2228
  return &(stat_ptr[index]);
2229
2229
  };
2230
2230
 
2231
+
2232
+ VALUE memcached_generate_hash_rvalue(const char *key, size_t key_length,memcached_hash hash_algorithm) {
2233
+ return UINT2NUM(memcached_generate_hash_value(key, key_length, hash_algorithm));
2234
+ };
2235
+
2231
2236
  swig_class cMemcachedContinuumItemSt;
2232
2237
 
2233
2238
  SWIGINTERN VALUE
@@ -3089,7 +3094,7 @@ _wrap_MemcachedStatSt_limit_maxbytes_get(int argc, VALUE *argv, VALUE self) {
3089
3094
  arg1 = (struct memcached_stat_st *)(argp1);
3090
3095
  result = ((arg1)->limit_maxbytes);
3091
3096
  {
3092
- vresult = INT2FIX(result);
3097
+ vresult = ULL2NUM(result);
3093
3098
  }
3094
3099
  return vresult;
3095
3100
  fail:
@@ -3327,7 +3332,7 @@ _wrap_MemcachedStatSt_bytes_get(int argc, VALUE *argv, VALUE self) {
3327
3332
  arg1 = (struct memcached_stat_st *)(argp1);
3328
3333
  result = ((arg1)->bytes);
3329
3334
  {
3330
- vresult = INT2FIX(result);
3335
+ vresult = ULL2NUM(result);
3331
3336
  }
3332
3337
  return vresult;
3333
3338
  fail:
@@ -3388,7 +3393,7 @@ _wrap_MemcachedStatSt_cmd_get_get(int argc, VALUE *argv, VALUE self) {
3388
3393
  arg1 = (struct memcached_stat_st *)(argp1);
3389
3394
  result = ((arg1)->cmd_get);
3390
3395
  {
3391
- vresult = INT2FIX(result);
3396
+ vresult = ULL2NUM(result);
3392
3397
  }
3393
3398
  return vresult;
3394
3399
  fail:
@@ -3449,7 +3454,7 @@ _wrap_MemcachedStatSt_cmd_set_get(int argc, VALUE *argv, VALUE self) {
3449
3454
  arg1 = (struct memcached_stat_st *)(argp1);
3450
3455
  result = ((arg1)->cmd_set);
3451
3456
  {
3452
- vresult = INT2FIX(result);
3457
+ vresult = ULL2NUM(result);
3453
3458
  }
3454
3459
  return vresult;
3455
3460
  fail:
@@ -3510,7 +3515,7 @@ _wrap_MemcachedStatSt_get_hits_get(int argc, VALUE *argv, VALUE self) {
3510
3515
  arg1 = (struct memcached_stat_st *)(argp1);
3511
3516
  result = ((arg1)->get_hits);
3512
3517
  {
3513
- vresult = INT2FIX(result);
3518
+ vresult = ULL2NUM(result);
3514
3519
  }
3515
3520
  return vresult;
3516
3521
  fail:
@@ -3571,7 +3576,7 @@ _wrap_MemcachedStatSt_get_misses_get(int argc, VALUE *argv, VALUE self) {
3571
3576
  arg1 = (struct memcached_stat_st *)(argp1);
3572
3577
  result = ((arg1)->get_misses);
3573
3578
  {
3574
- vresult = INT2FIX(result);
3579
+ vresult = ULL2NUM(result);
3575
3580
  }
3576
3581
  return vresult;
3577
3582
  fail:
@@ -3632,7 +3637,7 @@ _wrap_MemcachedStatSt_evictions_get(int argc, VALUE *argv, VALUE self) {
3632
3637
  arg1 = (struct memcached_stat_st *)(argp1);
3633
3638
  result = ((arg1)->evictions);
3634
3639
  {
3635
- vresult = INT2FIX(result);
3640
+ vresult = ULL2NUM(result);
3636
3641
  }
3637
3642
  return vresult;
3638
3643
  fail:
@@ -3693,7 +3698,7 @@ _wrap_MemcachedStatSt_bytes_read_get(int argc, VALUE *argv, VALUE self) {
3693
3698
  arg1 = (struct memcached_stat_st *)(argp1);
3694
3699
  result = ((arg1)->bytes_read);
3695
3700
  {
3696
- vresult = INT2FIX(result);
3701
+ vresult = ULL2NUM(result);
3697
3702
  }
3698
3703
  return vresult;
3699
3704
  fail:
@@ -3754,7 +3759,7 @@ _wrap_MemcachedStatSt_bytes_written_get(int argc, VALUE *argv, VALUE self) {
3754
3759
  arg1 = (struct memcached_stat_st *)(argp1);
3755
3760
  result = ((arg1)->bytes_written);
3756
3761
  {
3757
- vresult = INT2FIX(result);
3762
+ vresult = ULL2NUM(result);
3758
3763
  }
3759
3764
  return vresult;
3760
3765
  fail:
@@ -3861,13 +3866,66 @@ free_memcached_stat_st(struct memcached_stat_st *arg1) {
3861
3866
 
3862
3867
  swig_class cMemcachedSt;
3863
3868
 
3869
+ SWIGINTERN VALUE
3870
+ _wrap_MemcachedSt_purging_set(int argc, VALUE *argv, VALUE self) {
3871
+ struct memcached_st *arg1 = (struct memcached_st *) 0 ;
3872
+ uint8_t arg2 ;
3873
+ void *argp1 = 0 ;
3874
+ int res1 = 0 ;
3875
+ unsigned short val2 ;
3876
+ int ecode2 = 0 ;
3877
+
3878
+ if ((argc < 1) || (argc > 1)) {
3879
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3880
+ }
3881
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
3882
+ if (!SWIG_IsOK(res1)) {
3883
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_st *","purging", 1, self ));
3884
+ }
3885
+ arg1 = (struct memcached_st *)(argp1);
3886
+ ecode2 = SWIG_AsVal_unsigned_SS_short(argv[0], &val2);
3887
+ if (!SWIG_IsOK(ecode2)) {
3888
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "uint8_t","purging", 2, argv[0] ));
3889
+ }
3890
+ arg2 = (uint8_t)(val2);
3891
+ if (arg1) (arg1)->purging = arg2;
3892
+ return Qnil;
3893
+ fail:
3894
+ return Qnil;
3895
+ }
3896
+
3897
+
3898
+ SWIGINTERN VALUE
3899
+ _wrap_MemcachedSt_purging_get(int argc, VALUE *argv, VALUE self) {
3900
+ struct memcached_st *arg1 = (struct memcached_st *) 0 ;
3901
+ void *argp1 = 0 ;
3902
+ int res1 = 0 ;
3903
+ uint8_t result;
3904
+ VALUE vresult = Qnil;
3905
+
3906
+ if ((argc < 0) || (argc > 0)) {
3907
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3908
+ }
3909
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
3910
+ if (!SWIG_IsOK(res1)) {
3911
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_st *","purging", 1, self ));
3912
+ }
3913
+ arg1 = (struct memcached_st *)(argp1);
3914
+ result = ((arg1)->purging);
3915
+ vresult = SWIG_From_unsigned_SS_short((unsigned short)(result));
3916
+ return vresult;
3917
+ fail:
3918
+ return Qnil;
3919
+ }
3920
+
3921
+
3864
3922
  SWIGINTERN VALUE
3865
3923
  _wrap_MemcachedSt_is_allocated_set(int argc, VALUE *argv, VALUE self) {
3866
3924
  struct memcached_st *arg1 = (struct memcached_st *) 0 ;
3867
- memcached_allocated arg2 ;
3925
+ bool arg2 ;
3868
3926
  void *argp1 = 0 ;
3869
3927
  int res1 = 0 ;
3870
- int val2 ;
3928
+ bool val2 ;
3871
3929
  int ecode2 = 0 ;
3872
3930
 
3873
3931
  if ((argc < 1) || (argc > 1)) {
@@ -3878,11 +3936,11 @@ _wrap_MemcachedSt_is_allocated_set(int argc, VALUE *argv, VALUE self) {
3878
3936
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_st *","is_allocated", 1, self ));
3879
3937
  }
3880
3938
  arg1 = (struct memcached_st *)(argp1);
3881
- ecode2 = SWIG_AsVal_int(argv[0], &val2);
3939
+ ecode2 = SWIG_AsVal_bool(argv[0], &val2);
3882
3940
  if (!SWIG_IsOK(ecode2)) {
3883
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "memcached_allocated","is_allocated", 2, argv[0] ));
3941
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","is_allocated", 2, argv[0] ));
3884
3942
  }
3885
- arg2 = (memcached_allocated)(val2);
3943
+ arg2 = (bool)(val2);
3886
3944
  if (arg1) (arg1)->is_allocated = arg2;
3887
3945
  return Qnil;
3888
3946
  fail:
@@ -3895,7 +3953,7 @@ _wrap_MemcachedSt_is_allocated_get(int argc, VALUE *argv, VALUE self) {
3895
3953
  struct memcached_st *arg1 = (struct memcached_st *) 0 ;
3896
3954
  void *argp1 = 0 ;
3897
3955
  int res1 = 0 ;
3898
- memcached_allocated result;
3956
+ bool result;
3899
3957
  VALUE vresult = Qnil;
3900
3958
 
3901
3959
  if ((argc < 0) || (argc > 0)) {
@@ -3906,8 +3964,8 @@ _wrap_MemcachedSt_is_allocated_get(int argc, VALUE *argv, VALUE self) {
3906
3964
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_st *","is_allocated", 1, self ));
3907
3965
  }
3908
3966
  arg1 = (struct memcached_st *)(argp1);
3909
- result = (memcached_allocated) ((arg1)->is_allocated);
3910
- vresult = SWIG_From_int((int)(result));
3967
+ result = (bool) ((arg1)->is_allocated);
3968
+ vresult = SWIG_From_bool((bool)(result));
3911
3969
  return vresult;
3912
3970
  fail:
3913
3971
  return Qnil;
@@ -5754,28 +5812,27 @@ fail:
5754
5812
 
5755
5813
 
5756
5814
  SWIGINTERN VALUE
5757
- _wrap_MemcachedSt_purging_set(int argc, VALUE *argv, VALUE self) {
5815
+ _wrap_MemcachedSt_next_distribution_rebuild_set(int argc, VALUE *argv, VALUE self) {
5758
5816
  struct memcached_st *arg1 = (struct memcached_st *) 0 ;
5759
- char arg2 ;
5817
+ time_t arg2 ;
5760
5818
  void *argp1 = 0 ;
5761
5819
  int res1 = 0 ;
5762
- char val2 ;
5763
- int ecode2 = 0 ;
5764
5820
 
5765
5821
  if ((argc < 1) || (argc > 1)) {
5766
5822
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
5767
5823
  }
5768
5824
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
5769
5825
  if (!SWIG_IsOK(res1)) {
5770
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_st *","purging", 1, self ));
5826
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_st *","next_distribution_rebuild", 1, self ));
5771
5827
  }
5772
5828
  arg1 = (struct memcached_st *)(argp1);
5773
- ecode2 = SWIG_AsVal_char(argv[0], &val2);
5774
- if (!SWIG_IsOK(ecode2)) {
5775
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "char","purging", 2, argv[0] ));
5776
- }
5777
- arg2 = (char)(val2);
5778
- if (arg1) (arg1)->purging = arg2;
5829
+ {
5830
+ if (NIL_P(argv[0]))
5831
+ arg2 = (time_t)-1;
5832
+ else
5833
+ arg2 = NUM2LONG(rb_funcall(argv[0], rb_intern("tv_sec"), 0));
5834
+ }
5835
+ if (arg1) (arg1)->next_distribution_rebuild = arg2;
5779
5836
  return Qnil;
5780
5837
  fail:
5781
5838
  return Qnil;
@@ -5783,11 +5840,11 @@ fail:
5783
5840
 
5784
5841
 
5785
5842
  SWIGINTERN VALUE
5786
- _wrap_MemcachedSt_purging_get(int argc, VALUE *argv, VALUE self) {
5843
+ _wrap_MemcachedSt_next_distribution_rebuild_get(int argc, VALUE *argv, VALUE self) {
5787
5844
  struct memcached_st *arg1 = (struct memcached_st *) 0 ;
5788
5845
  void *argp1 = 0 ;
5789
5846
  int res1 = 0 ;
5790
- char result;
5847
+ time_t result;
5791
5848
  VALUE vresult = Qnil;
5792
5849
 
5793
5850
  if ((argc < 0) || (argc > 0)) {
@@ -5795,11 +5852,13 @@ _wrap_MemcachedSt_purging_get(int argc, VALUE *argv, VALUE self) {
5795
5852
  }
5796
5853
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
5797
5854
  if (!SWIG_IsOK(res1)) {
5798
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_st *","purging", 1, self ));
5855
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_st *","next_distribution_rebuild", 1, self ));
5799
5856
  }
5800
5857
  arg1 = (struct memcached_st *)(argp1);
5801
- result = (char) ((arg1)->purging);
5802
- vresult = SWIG_From_char((char)(result));
5858
+ result = ((arg1)->next_distribution_rebuild);
5859
+ {
5860
+ vresult = rb_time_new(result, 0);
5861
+ }
5803
5862
  return vresult;
5804
5863
  fail:
5805
5864
  return Qnil;
@@ -6374,7 +6433,7 @@ _wrap_memcached_behavior_get(int argc, VALUE *argv, VALUE self) {
6374
6433
  arg2 = (memcached_behavior)(val2);
6375
6434
  result = memcached_behavior_get(arg1,arg2);
6376
6435
  {
6377
- vresult = INT2FIX(result);
6436
+ vresult = ULL2NUM(result);
6378
6437
  }
6379
6438
  return vresult;
6380
6439
  fail:
@@ -6382,6 +6441,36 @@ fail:
6382
6441
  }
6383
6442
 
6384
6443
 
6444
+ SWIGINTERN VALUE
6445
+ _wrap_memcached_generate_hash_value(int argc, VALUE *argv, VALUE self) {
6446
+ char *arg1 = (char *) 0 ;
6447
+ size_t arg2 ;
6448
+ memcached_hash arg3 ;
6449
+ int val3 ;
6450
+ int ecode3 = 0 ;
6451
+ uint32_t result;
6452
+ VALUE vresult = Qnil;
6453
+
6454
+ if ((argc < 2) || (argc > 2)) {
6455
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
6456
+ }
6457
+ {
6458
+ arg1 = STR2CSTR(argv[0]);
6459
+ arg2 = (size_t) RSTRING(argv[0])->len;
6460
+ }
6461
+ ecode3 = SWIG_AsVal_int(argv[1], &val3);
6462
+ if (!SWIG_IsOK(ecode3)) {
6463
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "memcached_hash","memcached_generate_hash_value", 3, argv[1] ));
6464
+ }
6465
+ arg3 = (memcached_hash)(val3);
6466
+ result = memcached_generate_hash_value((char const *)arg1,arg2,arg3);
6467
+ vresult = SWIG_NewPointerObj((uint32_t *)memcpy((uint32_t *)malloc(sizeof(uint32_t)),&result,sizeof(uint32_t)), SWIGTYPE_p_uint32_t, SWIG_POINTER_OWN | 0 );
6468
+ return vresult;
6469
+ fail:
6470
+ return Qnil;
6471
+ }
6472
+
6473
+
6385
6474
  SWIGINTERN VALUE
6386
6475
  _wrap_memcached_server_add_udp(int argc, VALUE *argv, VALUE self) {
6387
6476
  memcached_st *arg1 = (memcached_st *) 0 ;
@@ -6853,10 +6942,10 @@ _wrap_memcached_servers_parse(int argc, VALUE *argv, VALUE self) {
6853
6942
  }
6854
6943
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
6855
6944
  if (!SWIG_IsOK(res1)) {
6856
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char *","memcached_servers_parse", 1, argv[0] ));
6945
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","memcached_servers_parse", 1, argv[0] ));
6857
6946
  }
6858
6947
  arg1 = (char *)(buf1);
6859
- result = (memcached_server_st *)memcached_servers_parse(arg1);
6948
+ result = (memcached_server_st *)memcached_servers_parse((char const *)arg1);
6860
6949
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_memcached_server_st, 0 | 0 );
6861
6950
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
6862
6951
  return vresult;
@@ -6900,10 +6989,10 @@ _wrap_memcached_stat_get_value(int argc, VALUE *argv, VALUE self) {
6900
6989
  arg2 = (memcached_stat_st *)(argp2);
6901
6990
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
6902
6991
  if (!SWIG_IsOK(res3)) {
6903
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char *","memcached_stat_get_value", 3, argv[2] ));
6992
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","memcached_stat_get_value", 3, argv[2] ));
6904
6993
  }
6905
6994
  arg3 = (char *)(buf3);
6906
- result = (char *)memcached_stat_get_value(arg1,arg2,arg3,arg4);
6995
+ result = (char *)memcached_stat_get_value(arg1,arg2,(char const *)arg3,arg4);
6907
6996
  vresult = SWIG_FromCharPtr((const char *)result);
6908
6997
  if (SWIG_IsTmpObj(res4)) {
6909
6998
  vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_unsigned_SS_short((*arg4)));
@@ -8120,10 +8209,10 @@ swig_class cMemcachedResultSt;
8120
8209
  SWIGINTERN VALUE
8121
8210
  _wrap_MemcachedResultSt_is_allocated_set(int argc, VALUE *argv, VALUE self) {
8122
8211
  struct memcached_result_st *arg1 = (struct memcached_result_st *) 0 ;
8123
- memcached_allocated arg2 ;
8212
+ bool arg2 ;
8124
8213
  void *argp1 = 0 ;
8125
8214
  int res1 = 0 ;
8126
- int val2 ;
8215
+ bool val2 ;
8127
8216
  int ecode2 = 0 ;
8128
8217
 
8129
8218
  if ((argc < 1) || (argc > 1)) {
@@ -8134,11 +8223,11 @@ _wrap_MemcachedResultSt_is_allocated_set(int argc, VALUE *argv, VALUE self) {
8134
8223
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_result_st *","is_allocated", 1, self ));
8135
8224
  }
8136
8225
  arg1 = (struct memcached_result_st *)(argp1);
8137
- ecode2 = SWIG_AsVal_int(argv[0], &val2);
8226
+ ecode2 = SWIG_AsVal_bool(argv[0], &val2);
8138
8227
  if (!SWIG_IsOK(ecode2)) {
8139
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "memcached_allocated","is_allocated", 2, argv[0] ));
8228
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","is_allocated", 2, argv[0] ));
8140
8229
  }
8141
- arg2 = (memcached_allocated)(val2);
8230
+ arg2 = (bool)(val2);
8142
8231
  if (arg1) (arg1)->is_allocated = arg2;
8143
8232
  return Qnil;
8144
8233
  fail:
@@ -8151,7 +8240,7 @@ _wrap_MemcachedResultSt_is_allocated_get(int argc, VALUE *argv, VALUE self) {
8151
8240
  struct memcached_result_st *arg1 = (struct memcached_result_st *) 0 ;
8152
8241
  void *argp1 = 0 ;
8153
8242
  int res1 = 0 ;
8154
- memcached_allocated result;
8243
+ bool result;
8155
8244
  VALUE vresult = Qnil;
8156
8245
 
8157
8246
  if ((argc < 0) || (argc > 0)) {
@@ -8162,8 +8251,8 @@ _wrap_MemcachedResultSt_is_allocated_get(int argc, VALUE *argv, VALUE self) {
8162
8251
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_result_st *","is_allocated", 1, self ));
8163
8252
  }
8164
8253
  arg1 = (struct memcached_result_st *)(argp1);
8165
- result = (memcached_allocated) ((arg1)->is_allocated);
8166
- vresult = SWIG_From_int((int)(result));
8254
+ result = (bool) ((arg1)->is_allocated);
8255
+ vresult = SWIG_From_bool((bool)(result));
8167
8256
  return vresult;
8168
8257
  fail:
8169
8258
  return Qnil;
@@ -8762,10 +8851,10 @@ swig_class cMemcachedServerSt;
8762
8851
  SWIGINTERN VALUE
8763
8852
  _wrap_MemcachedServerSt_is_allocated_set(int argc, VALUE *argv, VALUE self) {
8764
8853
  struct memcached_server_st *arg1 = (struct memcached_server_st *) 0 ;
8765
- memcached_allocated arg2 ;
8854
+ bool arg2 ;
8766
8855
  void *argp1 = 0 ;
8767
8856
  int res1 = 0 ;
8768
- int val2 ;
8857
+ bool val2 ;
8769
8858
  int ecode2 = 0 ;
8770
8859
 
8771
8860
  if ((argc < 1) || (argc > 1)) {
@@ -8776,11 +8865,11 @@ _wrap_MemcachedServerSt_is_allocated_set(int argc, VALUE *argv, VALUE self) {
8776
8865
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_server_st *","is_allocated", 1, self ));
8777
8866
  }
8778
8867
  arg1 = (struct memcached_server_st *)(argp1);
8779
- ecode2 = SWIG_AsVal_int(argv[0], &val2);
8868
+ ecode2 = SWIG_AsVal_bool(argv[0], &val2);
8780
8869
  if (!SWIG_IsOK(ecode2)) {
8781
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "memcached_allocated","is_allocated", 2, argv[0] ));
8870
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","is_allocated", 2, argv[0] ));
8782
8871
  }
8783
- arg2 = (memcached_allocated)(val2);
8872
+ arg2 = (bool)(val2);
8784
8873
  if (arg1) (arg1)->is_allocated = arg2;
8785
8874
  return Qnil;
8786
8875
  fail:
@@ -8793,7 +8882,7 @@ _wrap_MemcachedServerSt_is_allocated_get(int argc, VALUE *argv, VALUE self) {
8793
8882
  struct memcached_server_st *arg1 = (struct memcached_server_st *) 0 ;
8794
8883
  void *argp1 = 0 ;
8795
8884
  int res1 = 0 ;
8796
- memcached_allocated result;
8885
+ bool result;
8797
8886
  VALUE vresult = Qnil;
8798
8887
 
8799
8888
  if ((argc < 0) || (argc > 0)) {
@@ -8804,8 +8893,8 @@ _wrap_MemcachedServerSt_is_allocated_get(int argc, VALUE *argv, VALUE self) {
8804
8893
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_server_st *","is_allocated", 1, self ));
8805
8894
  }
8806
8895
  arg1 = (struct memcached_server_st *)(argp1);
8807
- result = (memcached_allocated) ((arg1)->is_allocated);
8808
- vresult = SWIG_From_int((int)(result));
8896
+ result = (bool) ((arg1)->is_allocated);
8897
+ vresult = SWIG_From_bool((bool)(result));
8809
8898
  return vresult;
8810
8899
  fail:
8811
8900
  return Qnil;
@@ -9428,10 +9517,10 @@ fail:
9428
9517
  SWIGINTERN VALUE
9429
9518
  _wrap_MemcachedServerSt_sockaddr_inited_set(int argc, VALUE *argv, VALUE self) {
9430
9519
  struct memcached_server_st *arg1 = (struct memcached_server_st *) 0 ;
9431
- memcached_allocated arg2 ;
9520
+ bool arg2 ;
9432
9521
  void *argp1 = 0 ;
9433
9522
  int res1 = 0 ;
9434
- int val2 ;
9523
+ bool val2 ;
9435
9524
  int ecode2 = 0 ;
9436
9525
 
9437
9526
  if ((argc < 1) || (argc > 1)) {
@@ -9442,11 +9531,11 @@ _wrap_MemcachedServerSt_sockaddr_inited_set(int argc, VALUE *argv, VALUE self) {
9442
9531
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_server_st *","sockaddr_inited", 1, self ));
9443
9532
  }
9444
9533
  arg1 = (struct memcached_server_st *)(argp1);
9445
- ecode2 = SWIG_AsVal_int(argv[0], &val2);
9534
+ ecode2 = SWIG_AsVal_bool(argv[0], &val2);
9446
9535
  if (!SWIG_IsOK(ecode2)) {
9447
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "memcached_allocated","sockaddr_inited", 2, argv[0] ));
9536
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","sockaddr_inited", 2, argv[0] ));
9448
9537
  }
9449
- arg2 = (memcached_allocated)(val2);
9538
+ arg2 = (bool)(val2);
9450
9539
  if (arg1) (arg1)->sockaddr_inited = arg2;
9451
9540
  return Qnil;
9452
9541
  fail:
@@ -9459,7 +9548,7 @@ _wrap_MemcachedServerSt_sockaddr_inited_get(int argc, VALUE *argv, VALUE self) {
9459
9548
  struct memcached_server_st *arg1 = (struct memcached_server_st *) 0 ;
9460
9549
  void *argp1 = 0 ;
9461
9550
  int res1 = 0 ;
9462
- memcached_allocated result;
9551
+ bool result;
9463
9552
  VALUE vresult = Qnil;
9464
9553
 
9465
9554
  if ((argc < 0) || (argc > 0)) {
@@ -9470,8 +9559,8 @@ _wrap_MemcachedServerSt_sockaddr_inited_get(int argc, VALUE *argv, VALUE self) {
9470
9559
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_server_st *","sockaddr_inited", 1, self ));
9471
9560
  }
9472
9561
  arg1 = (struct memcached_server_st *)(argp1);
9473
- result = (memcached_allocated) ((arg1)->sockaddr_inited);
9474
- vresult = SWIG_From_int((int)(result));
9562
+ result = (bool) ((arg1)->sockaddr_inited);
9563
+ vresult = SWIG_From_bool((bool)(result));
9475
9564
  return vresult;
9476
9565
  fail:
9477
9566
  return Qnil;
@@ -9956,7 +10045,7 @@ _wrap_MemcachedServerSt_limit_maxbytes_get(int argc, VALUE *argv, VALUE self) {
9956
10045
  arg1 = (struct memcached_server_st *)(argp1);
9957
10046
  result = ((arg1)->limit_maxbytes);
9958
10047
  {
9959
- vresult = INT2FIX(result);
10048
+ vresult = ULL2NUM(result);
9960
10049
  }
9961
10050
  return vresult;
9962
10051
  fail:
@@ -10290,6 +10379,73 @@ fail:
10290
10379
  }
10291
10380
 
10292
10381
 
10382
+ SWIGINTERN VALUE
10383
+ _wrap_memcached_server_create_with(int argc, VALUE *argv, VALUE self) {
10384
+ memcached_st *arg1 = (memcached_st *) 0 ;
10385
+ memcached_server_st *arg2 = (memcached_server_st *) 0 ;
10386
+ char *arg3 = (char *) 0 ;
10387
+ unsigned int arg4 ;
10388
+ uint32_t arg5 ;
10389
+ memcached_connection arg6 ;
10390
+ void *argp1 = 0 ;
10391
+ int res1 = 0 ;
10392
+ void *argp2 = 0 ;
10393
+ int res2 = 0 ;
10394
+ int res3 ;
10395
+ char *buf3 = 0 ;
10396
+ int alloc3 = 0 ;
10397
+ unsigned int val4 ;
10398
+ int ecode4 = 0 ;
10399
+ unsigned long val5 ;
10400
+ int ecode5 = 0 ;
10401
+ int val6 ;
10402
+ int ecode6 = 0 ;
10403
+ memcached_server_st *result = 0 ;
10404
+ VALUE vresult = Qnil;
10405
+
10406
+ if ((argc < 6) || (argc > 6)) {
10407
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail;
10408
+ }
10409
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
10410
+ if (!SWIG_IsOK(res1)) {
10411
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "memcached_st *","memcached_server_create_with", 1, argv[0] ));
10412
+ }
10413
+ arg1 = (memcached_st *)(argp1);
10414
+ res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_memcached_server_st, 0 | 0 );
10415
+ if (!SWIG_IsOK(res2)) {
10416
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "memcached_server_st *","memcached_server_create_with", 2, argv[1] ));
10417
+ }
10418
+ arg2 = (memcached_server_st *)(argp2);
10419
+ res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
10420
+ if (!SWIG_IsOK(res3)) {
10421
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","memcached_server_create_with", 3, argv[2] ));
10422
+ }
10423
+ arg3 = (char *)(buf3);
10424
+ ecode4 = SWIG_AsVal_unsigned_SS_int(argv[3], &val4);
10425
+ if (!SWIG_IsOK(ecode4)) {
10426
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "unsigned int","memcached_server_create_with", 4, argv[3] ));
10427
+ }
10428
+ arg4 = (unsigned int)(val4);
10429
+ ecode5 = SWIG_AsVal_unsigned_SS_long(argv[4], &val5);
10430
+ if (!SWIG_IsOK(ecode5)) {
10431
+ SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "uint32_t","memcached_server_create_with", 5, argv[4] ));
10432
+ }
10433
+ arg5 = (uint32_t)(val5);
10434
+ ecode6 = SWIG_AsVal_int(argv[5], &val6);
10435
+ if (!SWIG_IsOK(ecode6)) {
10436
+ SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "memcached_connection","memcached_server_create_with", 6, argv[5] ));
10437
+ }
10438
+ arg6 = (memcached_connection)(val6);
10439
+ result = (memcached_server_st *)memcached_server_create_with(arg1,arg2,(char const *)arg3,arg4,arg5,arg6);
10440
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_memcached_server_st, 0 | 0 );
10441
+ if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
10442
+ return vresult;
10443
+ fail:
10444
+ if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
10445
+ return Qnil;
10446
+ }
10447
+
10448
+
10293
10449
  SWIGINTERN VALUE
10294
10450
  _wrap_memcached_server_free(int argc, VALUE *argv, VALUE self) {
10295
10451
  memcached_server_st *arg1 = (memcached_server_st *) 0 ;
@@ -10574,13 +10730,42 @@ fail:
10574
10730
  }
10575
10731
 
10576
10732
 
10733
+ SWIGINTERN VALUE
10734
+ _wrap_memcached_generate_hash_rvalue(int argc, VALUE *argv, VALUE self) {
10735
+ char *arg1 = (char *) 0 ;
10736
+ size_t arg2 ;
10737
+ memcached_hash arg3 ;
10738
+ int val3 ;
10739
+ int ecode3 = 0 ;
10740
+ VALUE result;
10741
+ VALUE vresult = Qnil;
10742
+
10743
+ if ((argc < 2) || (argc > 2)) {
10744
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
10745
+ }
10746
+ {
10747
+ arg1 = STR2CSTR(argv[0]);
10748
+ arg2 = (size_t) RSTRING(argv[0])->len;
10749
+ }
10750
+ ecode3 = SWIG_AsVal_int(argv[1], &val3);
10751
+ if (!SWIG_IsOK(ecode3)) {
10752
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "memcached_hash","memcached_generate_hash_rvalue", 3, argv[1] ));
10753
+ }
10754
+ arg3 = (memcached_hash)(val3);
10755
+ result = (VALUE)memcached_generate_hash_rvalue((char const *)arg1,arg2,arg3);
10756
+ vresult = result;
10757
+ return vresult;
10758
+ fail:
10759
+ return Qnil;
10760
+ }
10761
+
10762
+
10577
10763
 
10578
10764
  /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
10579
10765
 
10580
10766
  static swig_type_info _swigt__p_addrinfo = {"_p_addrinfo", "struct addrinfo *", 0, 0, (void*)0, 0};
10581
10767
  static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
10582
10768
  static swig_type_info _swigt__p_int32_t = {"_p_int32_t", "int32_t *", 0, 0, (void*)0, 0};
10583
- static swig_type_info _swigt__p_memcached_allocated = {"_p_memcached_allocated", "enum memcached_allocated *|memcached_allocated *", 0, 0, (void*)0, 0};
10584
10769
  static swig_type_info _swigt__p_memcached_behavior = {"_p_memcached_behavior", "enum memcached_behavior *|memcached_behavior *", 0, 0, (void*)0, 0};
10585
10770
  static swig_type_info _swigt__p_memcached_callback = {"_p_memcached_callback", "enum memcached_callback *|memcached_callback *", 0, 0, (void*)0, 0};
10586
10771
  static swig_type_info _swigt__p_memcached_cleanup_func = {"_p_memcached_cleanup_func", "memcached_cleanup_func *", 0, 0, (void*)0, 0};
@@ -10613,7 +10798,6 @@ static swig_type_info *swig_type_initial[] = {
10613
10798
  &_swigt__p_addrinfo,
10614
10799
  &_swigt__p_char,
10615
10800
  &_swigt__p_int32_t,
10616
- &_swigt__p_memcached_allocated,
10617
10801
  &_swigt__p_memcached_behavior,
10618
10802
  &_swigt__p_memcached_callback,
10619
10803
  &_swigt__p_memcached_cleanup_func,
@@ -10646,7 +10830,6 @@ static swig_type_info *swig_type_initial[] = {
10646
10830
  static swig_cast_info _swigc__p_addrinfo[] = { {&_swigt__p_addrinfo, 0, 0, 0},{0, 0, 0, 0}};
10647
10831
  static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
10648
10832
  static swig_cast_info _swigc__p_int32_t[] = { {&_swigt__p_int32_t, 0, 0, 0},{0, 0, 0, 0}};
10649
- static swig_cast_info _swigc__p_memcached_allocated[] = { {&_swigt__p_memcached_allocated, 0, 0, 0},{0, 0, 0, 0}};
10650
10833
  static swig_cast_info _swigc__p_memcached_behavior[] = { {&_swigt__p_memcached_behavior, 0, 0, 0},{0, 0, 0, 0}};
10651
10834
  static swig_cast_info _swigc__p_memcached_callback[] = { {&_swigt__p_memcached_callback, 0, 0, 0},{0, 0, 0, 0}};
10652
10835
  static swig_cast_info _swigc__p_memcached_cleanup_func[] = { {&_swigt__p_memcached_cleanup_func, 0, 0, 0},{0, 0, 0, 0}};
@@ -10679,7 +10862,6 @@ static swig_cast_info *swig_cast_initial[] = {
10679
10862
  _swigc__p_addrinfo,
10680
10863
  _swigc__p_char,
10681
10864
  _swigc__p_int32_t,
10682
- _swigc__p_memcached_allocated,
10683
10865
  _swigc__p_memcached_behavior,
10684
10866
  _swigc__p_memcached_callback,
10685
10867
  _swigc__p_memcached_cleanup_func,
@@ -11042,6 +11224,8 @@ SWIGEXPORT void Init_rlibmemcached(void) {
11042
11224
  SWIG_TypeClientData(SWIGTYPE_p_memcached_st, (void *) &cMemcachedSt);
11043
11225
  rb_define_alloc_func(cMemcachedSt.klass, _wrap_MemcachedSt_allocate);
11044
11226
  rb_define_method(cMemcachedSt.klass, "initialize", _wrap_new_MemcachedSt, -1);
11227
+ rb_define_method(cMemcachedSt.klass, "purging=", _wrap_MemcachedSt_purging_set, -1);
11228
+ rb_define_method(cMemcachedSt.klass, "purging", _wrap_MemcachedSt_purging_get, -1);
11045
11229
  rb_define_method(cMemcachedSt.klass, "is_allocated=", _wrap_MemcachedSt_is_allocated_set, -1);
11046
11230
  rb_define_method(cMemcachedSt.klass, "is_allocated", _wrap_MemcachedSt_is_allocated_get, -1);
11047
11231
  rb_define_method(cMemcachedSt.klass, "hosts=", _wrap_MemcachedSt_hosts_set, -1);
@@ -11108,8 +11292,8 @@ SWIGEXPORT void Init_rlibmemcached(void) {
11108
11292
  rb_define_method(cMemcachedSt.klass, "io_msg_watermark", _wrap_MemcachedSt_io_msg_watermark_get, -1);
11109
11293
  rb_define_method(cMemcachedSt.klass, "io_bytes_watermark=", _wrap_MemcachedSt_io_bytes_watermark_set, -1);
11110
11294
  rb_define_method(cMemcachedSt.klass, "io_bytes_watermark", _wrap_MemcachedSt_io_bytes_watermark_get, -1);
11111
- rb_define_method(cMemcachedSt.klass, "purging=", _wrap_MemcachedSt_purging_set, -1);
11112
- rb_define_method(cMemcachedSt.klass, "purging", _wrap_MemcachedSt_purging_get, -1);
11295
+ rb_define_method(cMemcachedSt.klass, "next_distribution_rebuild=", _wrap_MemcachedSt_next_distribution_rebuild_set, -1);
11296
+ rb_define_method(cMemcachedSt.klass, "next_distribution_rebuild", _wrap_MemcachedSt_next_distribution_rebuild_get, -1);
11113
11297
  cMemcachedSt.mark = 0;
11114
11298
  cMemcachedSt.destroy = (void (*)(void *)) memcached_free;
11115
11299
  cMemcachedSt.trackObjects = 0;
@@ -11129,6 +11313,7 @@ SWIGEXPORT void Init_rlibmemcached(void) {
11129
11313
  rb_define_module_function(mRlibmemcached, "memcached_strerror", _wrap_memcached_strerror, -1);
11130
11314
  rb_define_module_function(mRlibmemcached, "memcached_behavior_set", _wrap_memcached_behavior_set, -1);
11131
11315
  rb_define_module_function(mRlibmemcached, "memcached_behavior_get", _wrap_memcached_behavior_get, -1);
11316
+ rb_define_module_function(mRlibmemcached, "memcached_generate_hash_value", _wrap_memcached_generate_hash_value, -1);
11132
11317
  rb_define_module_function(mRlibmemcached, "memcached_server_add_udp", _wrap_memcached_server_add_udp, -1);
11133
11318
  rb_define_module_function(mRlibmemcached, "memcached_server_add_unix_socket", _wrap_memcached_server_add_unix_socket, -1);
11134
11319
  rb_define_module_function(mRlibmemcached, "memcached_server_add", _wrap_memcached_server_add, -1);
@@ -11192,6 +11377,7 @@ SWIGEXPORT void Init_rlibmemcached(void) {
11192
11377
  rb_define_const(mRlibmemcached, "MEMCACHED_TIMEOUT", SWIG_From_int((int)(MEMCACHED_TIMEOUT)));
11193
11378
  rb_define_const(mRlibmemcached, "MEMCACHED_BUFFERED", SWIG_From_int((int)(MEMCACHED_BUFFERED)));
11194
11379
  rb_define_const(mRlibmemcached, "MEMCACHED_BAD_KEY_PROVIDED", SWIG_From_int((int)(MEMCACHED_BAD_KEY_PROVIDED)));
11380
+ rb_define_const(mRlibmemcached, "MEMCACHED_SERVER_MARKED_DEAD", SWIG_From_int((int)(MEMCACHED_SERVER_MARKED_DEAD)));
11195
11381
  rb_define_const(mRlibmemcached, "MEMCACHED_MAXIMUM_RETURN", SWIG_From_int((int)(MEMCACHED_MAXIMUM_RETURN)));
11196
11382
  rb_define_const(mRlibmemcached, "MEMCACHED_DISTRIBUTION_MODULA", SWIG_From_int((int)(MEMCACHED_DISTRIBUTION_MODULA)));
11197
11383
  rb_define_const(mRlibmemcached, "MEMCACHED_DISTRIBUTION_CONSISTENT", SWIG_From_int((int)(MEMCACHED_DISTRIBUTION_CONSISTENT)));
@@ -11222,6 +11408,7 @@ SWIGEXPORT void Init_rlibmemcached(void) {
11222
11408
  rb_define_const(mRlibmemcached, "MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK", SWIG_From_int((int)(MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK)));
11223
11409
  rb_define_const(mRlibmemcached, "MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK", SWIG_From_int((int)(MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK)));
11224
11410
  rb_define_const(mRlibmemcached, "MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY", SWIG_From_int((int)(MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY)));
11411
+ rb_define_const(mRlibmemcached, "MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS", SWIG_From_int((int)(MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS)));
11225
11412
  rb_define_const(mRlibmemcached, "MEMCACHED_CALLBACK_PREFIX_KEY", SWIG_From_int((int)(MEMCACHED_CALLBACK_PREFIX_KEY)));
11226
11413
  rb_define_const(mRlibmemcached, "MEMCACHED_CALLBACK_USER_DATA", SWIG_From_int((int)(MEMCACHED_CALLBACK_USER_DATA)));
11227
11414
  rb_define_const(mRlibmemcached, "MEMCACHED_CALLBACK_CLEANUP_FUNCTION", SWIG_From_int((int)(MEMCACHED_CALLBACK_CLEANUP_FUNCTION)));
@@ -11245,9 +11432,6 @@ SWIGEXPORT void Init_rlibmemcached(void) {
11245
11432
  rb_define_const(mRlibmemcached, "MEMCACHED_CONNECTION_TCP", SWIG_From_int((int)(MEMCACHED_CONNECTION_TCP)));
11246
11433
  rb_define_const(mRlibmemcached, "MEMCACHED_CONNECTION_UDP", SWIG_From_int((int)(MEMCACHED_CONNECTION_UDP)));
11247
11434
  rb_define_const(mRlibmemcached, "MEMCACHED_CONNECTION_UNIX_SOCKET", SWIG_From_int((int)(MEMCACHED_CONNECTION_UNIX_SOCKET)));
11248
- rb_define_const(mRlibmemcached, "MEMCACHED_NOT_ALLOCATED", SWIG_From_int((int)(MEMCACHED_NOT_ALLOCATED)));
11249
- rb_define_const(mRlibmemcached, "MEMCACHED_ALLOCATED", SWIG_From_int((int)(MEMCACHED_ALLOCATED)));
11250
- rb_define_const(mRlibmemcached, "MEMCACHED_USED", SWIG_From_int((int)(MEMCACHED_USED)));
11251
11435
  rb_define_module_function(mRlibmemcached, "memcached_get", _wrap_memcached_get, -1);
11252
11436
  rb_define_module_function(mRlibmemcached, "memcached_mget", _wrap_memcached_mget, -1);
11253
11437
  rb_define_module_function(mRlibmemcached, "memcached_get_by_key", _wrap_memcached_get_by_key, -1);
@@ -11357,6 +11541,7 @@ SWIGEXPORT void Init_rlibmemcached(void) {
11357
11541
  rb_define_module_function(mRlibmemcached, "memcached_server_cursor", _wrap_memcached_server_cursor, -1);
11358
11542
  rb_define_module_function(mRlibmemcached, "memcached_server_by_key", _wrap_memcached_server_by_key, -1);
11359
11543
  rb_define_module_function(mRlibmemcached, "memcached_server_create", _wrap_memcached_server_create, -1);
11544
+ rb_define_module_function(mRlibmemcached, "memcached_server_create_with", _wrap_memcached_server_create_with, -1);
11360
11545
  rb_define_module_function(mRlibmemcached, "memcached_server_free", _wrap_memcached_server_free, -1);
11361
11546
  rb_define_module_function(mRlibmemcached, "memcached_server_clone", _wrap_memcached_server_clone, -1);
11362
11547
  rb_define_module_function(mRlibmemcached, "memcached_get_rvalue", _wrap_memcached_get_rvalue, -1);
@@ -11364,5 +11549,6 @@ SWIGEXPORT void Init_rlibmemcached(void) {
11364
11549
  rb_define_module_function(mRlibmemcached, "memcached_stat_get_rvalue", _wrap_memcached_stat_get_rvalue, -1);
11365
11550
  rb_define_module_function(mRlibmemcached, "memcached_select_server_at", _wrap_memcached_select_server_at, -1);
11366
11551
  rb_define_module_function(mRlibmemcached, "memcached_select_stat_at", _wrap_memcached_select_stat_at, -1);
11552
+ rb_define_module_function(mRlibmemcached, "memcached_generate_hash_rvalue", _wrap_memcached_generate_hash_rvalue, -1);
11367
11553
  }
11368
11554