memcached 0.18.0 → 0.19.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,5 +1,7 @@
1
1
 
2
- v0.18.0. Make Memcached::Rails compatible with Rails 2.3.2 (Ian Fung).
2
+ v0.19.pre. Support dynamic setting of the namespace (mhat). Support SASL (seanlynch).
3
+
4
+ v0.18. Make Memcached::Rails compatible with Rails 2.3.2 (Ian Fung).
3
5
 
4
6
  v0.17.7. Disable dependency tracking.
5
7
 
data/Manifest CHANGED
@@ -10,7 +10,9 @@ ext/libmemcached-0.32.tar.gz
10
10
  ext/libmemcached.patch
11
11
  ext/rlibmemcached.i
12
12
  ext/rlibmemcached_wrap.c
13
+ ext/sasl.patch
13
14
  lib/memcached.rb
15
+ lib/memcached/auth.rb
14
16
  lib/memcached/behaviors.rb
15
17
  lib/memcached/exceptions.rb
16
18
  lib/memcached/integer.rb
data/README CHANGED
@@ -7,7 +7,7 @@ An interface to the libmemcached C client.
7
7
 
8
8
  Copyright 2009 Cloudburst, LLC. Licensed under the AFL 3. See the included LICENSE file. Portions copyright 2007-2009 TangentOrg, Brian Aker, licensed under the BSD license, and used with permission.
9
9
 
10
- The public certificate for this gem is here[http://rubyforge.org/frs/download.php/25331/evan_weaver-original-public_cert.pem].
10
+ The public certificate for this gem is here[http://blog.evanweaver.com/files/evan_weaver-original-public_cert.pem].
11
11
 
12
12
  If you use this software, please {make a donation}[http://blog.evanweaver.com/donate/], or {recommend Evan}[http://www.workingwithrails.com/person/7739-evan-weaver] at Working with Rails.
13
13
 
@@ -101,7 +101,7 @@ There is a compatibility wrapper for legacy applications called Memcached::Rails
101
101
 
102
102
  == Reporting problems
103
103
 
104
- The support forum is here[http://rubyforge.org/forum/forum.php?forum_id=20894].
104
+ The support forum is here[http://github.com/fauna/memcached/issues].
105
105
 
106
106
  Patches and contributions are very welcome. Please note that contributors are required to assign copyright for their additions to Cloudburst, LLC.
107
107
 
@@ -5,19 +5,20 @@ HERE = File.expand_path(File.dirname(__FILE__))
5
5
  BUNDLE = Dir.glob("libmemcached-*.tar.gz").first
6
6
  BUNDLE_PATH = BUNDLE.sub(".tar.gz", "")
7
7
 
8
+ $CFLAGS = "#{RbConfig::CONFIG['CFLAGS']} #{$CFLAGS}".gsub("$(cflags)", "").gsub("-fno-common", "")
9
+ $LDFLAGS = "#{RbConfig::CONFIG['LDFLAGS']} #{$LDFLAGS}".gsub("$(ldflags)", "").gsub("-fno-common", "")
10
+ $CXXFLAGS = " -std=gnu++98 #{$CFLAGS}"
11
+ $CPPFLAGS = $ARCH_FLAG = $DLDFLAGS = ""
12
+
8
13
  if ENV['DEBUG']
9
14
  puts "Setting debug flags."
10
15
  $CFLAGS << " -O0 -ggdb -DHAVE_DEBUG"
11
- $EXTRA_CONF = " --enable-debug"
16
+ $EXTRA_CONF = ""
12
17
  end
13
18
 
14
- $CFLAGS = "#{RbConfig::CONFIG['CFLAGS']} #{$CFLAGS}".gsub("$(cflags)", "")
15
- $LDFLAGS = "#{RbConfig::CONFIG['LDFLAGS']} #{$LDFLAGS}".gsub("$(ldflags)", "")
16
- $CXXFLAGS = " -std=gnu++98"
17
- $CPPFLAGS = $ARCH_FLAG = $DLDFLAGS = ""
18
-
19
19
  if !ENV["EXTERNAL_LIB"]
20
20
  $includes = " -I#{HERE}/include"
21
+ $defines = " -DLIBMEMCACHED_WITH_SASL_SUPPORT"
21
22
  $libraries = " -L#{HERE}/lib"
22
23
  $CFLAGS = "#{$includes} #{$libraries} #{$CFLAGS}"
23
24
  $LDFLAGS = "#{$libraries} #{$LDFLAGS}"
@@ -31,17 +32,22 @@ if !ENV["EXTERNAL_LIB"]
31
32
  puts "Building libmemcached."
32
33
  puts(cmd = "tar xzf #{BUNDLE} 2>&1")
33
34
  raise "'#{cmd}' failed" unless system(cmd)
34
-
35
- puts "Patching libmemcached."
35
+
36
+ puts "Patching libmemcached source."
36
37
  puts(cmd = "patch -p1 < libmemcached.patch")
37
38
  raise "'#{cmd}' failed" unless system(cmd)
38
39
 
40
+ puts "Patching libmemcached with SASL support."
41
+ puts(cmd = "patch -p1 < sasl.patch")
42
+ raise "'#{cmd}' failed" unless system(cmd)
43
+
39
44
  Dir.chdir(BUNDLE_PATH) do
40
45
  puts(cmd = "env CFLAGS='-fPIC #{$CFLAGS}' LDFLAGS='-fPIC #{$LDFLAGS}' ./configure --prefix=#{HERE} --without-memcached --disable-shared --disable-utils --disable-dependency-tracking #{$EXTRA_CONF} 2>&1")
41
-
42
46
  raise "'#{cmd}' failed" unless system(cmd)
47
+
43
48
  puts(cmd = "make CXXFLAGS='#{$CXXFLAGS}' || true 2>&1")
44
49
  raise "'#{cmd}' failed" unless system(cmd)
50
+
45
51
  puts(cmd = "make install || true 2>&1")
46
52
  raise "'#{cmd}' failed" unless system(cmd)
47
53
  end
@@ -55,12 +61,14 @@ if !ENV["EXTERNAL_LIB"]
55
61
  system("cp -f libmemcached.a libmemcached_gem.a")
56
62
  system("cp -f libmemcached.la libmemcached_gem.la")
57
63
  end
58
- $LIBS << " -lmemcached_gem"
64
+ $LIBS << " -lmemcached_gem -lsasl2"
59
65
  end
60
66
 
61
67
  if ENV['SWIG']
62
68
  puts "Running SWIG."
63
- puts(cmd = "swig #{$includes} -ruby -autorename rlibmemcached.i")
69
+ puts(cmd = "swig #{$defines} #{$includes} -ruby -autorename rlibmemcached.i")
70
+ raise "'#{cmd}' failed" unless system(cmd)
71
+ puts(cmd = "sed -i '' 's/STR2CSTR/StringValuePtr/' rlibmemcached_wrap.c")
64
72
  raise "'#{cmd}' failed" unless system(cmd)
65
73
  end
66
74
 
@@ -64,7 +64,11 @@
64
64
 
65
65
  // Void type strings without lengths for prefix_key callback
66
66
  %typemap(in) (void *data) {
67
- $1 = STR2CSTR($input);
67
+ if ( (size_t) RSTRING_LEN($input) == 0) {
68
+ $1 = NULL;
69
+ } else {
70
+ $1 = STR2CSTR($input);
71
+ }
68
72
  };
69
73
 
70
74
  %apply (const char *str, size_t len) {
@@ -98,6 +102,12 @@
98
102
  $result = UINT2NUM($1);
99
103
  };
100
104
 
105
+ // Void type strings without lengths for prefix_key callback
106
+ // Currently not used by the gem
107
+ %typemap(out) (void *) {
108
+ $result = rb_str_new2($1);
109
+ };
110
+
101
111
  // String for memcached_fetch
102
112
  %typemap(in, numinputs=0) (char *key, size_t *key_length) {
103
113
  char string[256];
@@ -133,6 +143,7 @@
133
143
  %include "libmemcached/memcached_storage.h"
134
144
  %include "libmemcached/memcached_result.h"
135
145
  %include "libmemcached/memcached_server.h"
146
+ %include "libmemcached/memcached_sasl.h"
136
147
 
137
148
  //// Custom C functions
138
149
 
@@ -210,3 +221,10 @@ VALUE memcached_generate_hash_rvalue(const char *key, size_t key_length,memcache
210
221
  };
211
222
  %}
212
223
 
224
+ // Initialization for SASL
225
+ %init %{
226
+ if (sasl_client_init(NULL) != SASL_OK) {
227
+ fprintf(stderr, "Failed to initialized SASL.\n");
228
+ }
229
+ %}
230
+
@@ -1814,11 +1814,11 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
1814
1814
  #define SWIGTYPE_p_memcached_trigger_delete_key swig_types[25]
1815
1815
  #define SWIGTYPE_p_memcached_trigger_key swig_types[26]
1816
1816
  #define SWIGTYPE_p_p_char swig_types[27]
1817
- #define SWIGTYPE_p_size_t swig_types[28]
1818
- #define SWIGTYPE_p_time_t swig_types[29]
1819
- #define SWIGTYPE_p_uint32_t swig_types[30]
1820
- #define SWIGTYPE_p_uint64_t swig_types[31]
1821
- #define SWIGTYPE_p_void swig_types[32]
1817
+ #define SWIGTYPE_p_sasl_callback_t swig_types[28]
1818
+ #define SWIGTYPE_p_size_t swig_types[29]
1819
+ #define SWIGTYPE_p_time_t swig_types[30]
1820
+ #define SWIGTYPE_p_uint32_t swig_types[31]
1821
+ #define SWIGTYPE_p_uint64_t swig_types[32]
1822
1822
  static swig_type_info *swig_types[34];
1823
1823
  static swig_module_info swig_module = {swig_types, 33, 0, 0, 0, 0};
1824
1824
  #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
@@ -1978,7 +1978,7 @@ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1978
1978
  #if defined(StringValuePtr)
1979
1979
  char *cstr = StringValuePtr(obj);
1980
1980
  #else
1981
- char *cstr = STR2CSTR(obj);
1981
+ char *cstr = StringValuePtr(obj);
1982
1982
  #endif
1983
1983
  size_t size = RSTRING_LEN(obj) + 1;
1984
1984
  if (cptr) {
@@ -5645,7 +5645,9 @@ _wrap_MemcachedSt_user_data_get(int argc, VALUE *argv, VALUE self) {
5645
5645
  }
5646
5646
  arg1 = (struct memcached_st *)(argp1);
5647
5647
  result = (void *) ((arg1)->user_data);
5648
- vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 );
5648
+ {
5649
+ vresult = rb_str_new2(result);
5650
+ }
5649
5651
  return vresult;
5650
5652
  fail:
5651
5653
  return Qnil;
@@ -6692,6 +6694,59 @@ fail:
6692
6694
  }
6693
6695
 
6694
6696
 
6697
+ SWIGINTERN VALUE
6698
+ _wrap_MemcachedSt_sasl_callbacks_set(int argc, VALUE *argv, VALUE self) {
6699
+ struct memcached_st *arg1 = (struct memcached_st *) 0 ;
6700
+ sasl_callback_t *arg2 = (sasl_callback_t *) 0 ;
6701
+ void *argp1 = 0 ;
6702
+ int res1 = 0 ;
6703
+ void *argp2 = 0 ;
6704
+ int res2 = 0 ;
6705
+
6706
+ if ((argc < 1) || (argc > 1)) {
6707
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
6708
+ }
6709
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
6710
+ if (!SWIG_IsOK(res1)) {
6711
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_st *","sasl_callbacks", 1, self ));
6712
+ }
6713
+ arg1 = (struct memcached_st *)(argp1);
6714
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_sasl_callback_t, SWIG_POINTER_DISOWN | 0 );
6715
+ if (!SWIG_IsOK(res2)) {
6716
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "sasl_callback_t const *","sasl_callbacks", 2, argv[0] ));
6717
+ }
6718
+ arg2 = (sasl_callback_t *)(argp2);
6719
+ if (arg1) (arg1)->sasl_callbacks = (sasl_callback_t const *)arg2;
6720
+ return Qnil;
6721
+ fail:
6722
+ return Qnil;
6723
+ }
6724
+
6725
+
6726
+ SWIGINTERN VALUE
6727
+ _wrap_MemcachedSt_sasl_callbacks_get(int argc, VALUE *argv, VALUE self) {
6728
+ struct memcached_st *arg1 = (struct memcached_st *) 0 ;
6729
+ void *argp1 = 0 ;
6730
+ int res1 = 0 ;
6731
+ sasl_callback_t *result = 0 ;
6732
+ VALUE vresult = Qnil;
6733
+
6734
+ if ((argc < 0) || (argc > 0)) {
6735
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
6736
+ }
6737
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
6738
+ if (!SWIG_IsOK(res1)) {
6739
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_st *","sasl_callbacks", 1, self ));
6740
+ }
6741
+ arg1 = (struct memcached_st *)(argp1);
6742
+ result = (sasl_callback_t *) ((arg1)->sasl_callbacks);
6743
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_sasl_callback_t, 0 | 0 );
6744
+ return vresult;
6745
+ fail:
6746
+ return Qnil;
6747
+ }
6748
+
6749
+
6695
6750
  #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
6696
6751
  SWIGINTERN VALUE
6697
6752
  _wrap_MemcachedSt_allocate(VALUE self) {
@@ -6861,7 +6916,7 @@ _wrap_memcached_delete(int argc, VALUE *argv, VALUE self) {
6861
6916
  }
6862
6917
  arg1 = (memcached_st *)(argp1);
6863
6918
  {
6864
- arg2 = STR2CSTR(argv[1]);
6919
+ arg2 = StringValuePtr(argv[1]);
6865
6920
  arg3 = (size_t) RSTRING_LEN(argv[1]);
6866
6921
  }
6867
6922
  {
@@ -6904,7 +6959,7 @@ _wrap_memcached_increment(int argc, VALUE *argv, VALUE self) {
6904
6959
  }
6905
6960
  arg1 = (memcached_st *)(argp1);
6906
6961
  {
6907
- arg2 = STR2CSTR(argv[1]);
6962
+ arg2 = StringValuePtr(argv[1]);
6908
6963
  arg3 = (size_t) RSTRING_LEN(argv[1]);
6909
6964
  }
6910
6965
  ecode4 = SWIG_AsVal_unsigned_SS_long(argv[2], &val4);
@@ -6952,7 +7007,7 @@ _wrap_memcached_decrement(int argc, VALUE *argv, VALUE self) {
6952
7007
  }
6953
7008
  arg1 = (memcached_st *)(argp1);
6954
7009
  {
6955
- arg2 = STR2CSTR(argv[1]);
7010
+ arg2 = StringValuePtr(argv[1]);
6956
7011
  arg3 = (size_t) RSTRING_LEN(argv[1]);
6957
7012
  }
6958
7013
  ecode4 = SWIG_AsVal_unsigned_SS_long(argv[2], &val4);
@@ -7004,7 +7059,7 @@ _wrap_memcached_increment_with_initial(int argc, VALUE *argv, VALUE self) {
7004
7059
  }
7005
7060
  arg1 = (memcached_st *)(argp1);
7006
7061
  {
7007
- arg2 = STR2CSTR(argv[1]);
7062
+ arg2 = StringValuePtr(argv[1]);
7008
7063
  arg3 = (size_t) RSTRING_LEN(argv[1]);
7009
7064
  }
7010
7065
  {
@@ -7079,7 +7134,7 @@ _wrap_memcached_decrement_with_initial(int argc, VALUE *argv, VALUE self) {
7079
7134
  }
7080
7135
  arg1 = (memcached_st *)(argp1);
7081
7136
  {
7082
- arg2 = STR2CSTR(argv[1]);
7137
+ arg2 = StringValuePtr(argv[1]);
7083
7138
  arg3 = (size_t) RSTRING_LEN(argv[1]);
7084
7139
  }
7085
7140
  {
@@ -7456,7 +7511,7 @@ _wrap_memcached_generate_hash_value(int argc, VALUE *argv, VALUE self) {
7456
7511
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
7457
7512
  }
7458
7513
  {
7459
- arg1 = STR2CSTR(argv[0]);
7514
+ arg1 = StringValuePtr(argv[0]);
7460
7515
  arg2 = (size_t) RSTRING_LEN(argv[0]);
7461
7516
  }
7462
7517
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
@@ -7493,7 +7548,7 @@ _wrap_memcached_generate_hash(int argc, VALUE *argv, VALUE self) {
7493
7548
  }
7494
7549
  arg1 = (memcached_st *)(argp1);
7495
7550
  {
7496
- arg2 = STR2CSTR(argv[1]);
7551
+ arg2 = StringValuePtr(argv[1]);
7497
7552
  arg3 = (size_t) RSTRING_LEN(argv[1]);
7498
7553
  }
7499
7554
  result = memcached_generate_hash(arg1,(char const *)arg2,arg3);
@@ -8141,7 +8196,7 @@ _wrap_memcached_delete_by_key(int argc, VALUE *argv, VALUE self) {
8141
8196
  }
8142
8197
  arg1 = (memcached_st *)(argp1);
8143
8198
  {
8144
- arg4 = arg2 = STR2CSTR(argv[1]);
8199
+ arg4 = arg2 = StringValuePtr(argv[1]);
8145
8200
  arg5 = arg3 = (size_t) RSTRING_LEN(argv[1]);
8146
8201
  }
8147
8202
  {
@@ -8230,7 +8285,11 @@ _wrap_memcached_callback_set(int argc, VALUE *argv, VALUE self) {
8230
8285
  }
8231
8286
  arg2 = (memcached_callback)(val2);
8232
8287
  {
8233
- arg3 = STR2CSTR(argv[2]);
8288
+ if ( (size_t) RSTRING_LEN(argv[2]) == 0) {
8289
+ arg3 = NULL;
8290
+ } else {
8291
+ arg3 = StringValuePtr(argv[2]);
8292
+ }
8234
8293
  }
8235
8294
  result = (memcached_return)memcached_callback_set(arg1,arg2,arg3);
8236
8295
  vresult = SWIG_From_int((int)(result));
@@ -8269,7 +8328,9 @@ _wrap_memcached_callback_get(int argc, VALUE *argv, VALUE self) {
8269
8328
  }
8270
8329
  arg2 = (memcached_callback)(val2);
8271
8330
  result = (void *)memcached_callback_get(arg1,arg2,arg3);
8272
- vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 );
8331
+ {
8332
+ vresult = rb_str_new2(result);
8333
+ }
8273
8334
  if (SWIG_IsTmpObj(res3)) {
8274
8335
  vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_unsigned_SS_short((*arg3)));
8275
8336
  } else {
@@ -8484,7 +8545,9 @@ _wrap_memcached_get_user_data(int argc, VALUE *argv, VALUE self) {
8484
8545
  }
8485
8546
  arg1 = (memcached_st *)(argp1);
8486
8547
  result = (void *)memcached_get_user_data(arg1);
8487
- vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 );
8548
+ {
8549
+ vresult = rb_str_new2(result);
8550
+ }
8488
8551
  return vresult;
8489
8552
  fail:
8490
8553
  return Qnil;
@@ -8509,10 +8572,16 @@ _wrap_memcached_set_user_data(int argc, VALUE *argv, VALUE self) {
8509
8572
  }
8510
8573
  arg1 = (memcached_st *)(argp1);
8511
8574
  {
8512
- arg2 = STR2CSTR(argv[1]);
8575
+ if ( (size_t) RSTRING_LEN(argv[1]) == 0) {
8576
+ arg2 = NULL;
8577
+ } else {
8578
+ arg2 = StringValuePtr(argv[1]);
8579
+ }
8513
8580
  }
8514
8581
  result = (void *)memcached_set_user_data(arg1,arg2);
8515
- vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 );
8582
+ {
8583
+ vresult = rb_str_new2(result);
8584
+ }
8516
8585
  return vresult;
8517
8586
  fail:
8518
8587
  return Qnil;
@@ -8574,7 +8643,7 @@ _wrap_memcached_get(int argc, VALUE *argv, VALUE self) {
8574
8643
  }
8575
8644
  arg1 = (memcached_st *)(argp1);
8576
8645
  {
8577
- arg2 = STR2CSTR(argv[1]);
8646
+ arg2 = StringValuePtr(argv[1]);
8578
8647
  arg3 = (size_t) RSTRING_LEN(argv[1]);
8579
8648
  }
8580
8649
  result = (char *)memcached_get(arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
@@ -8675,7 +8744,7 @@ _wrap_memcached_get_by_key(int argc, VALUE *argv, VALUE self) {
8675
8744
  }
8676
8745
  arg1 = (memcached_st *)(argp1);
8677
8746
  {
8678
- arg4 = arg2 = STR2CSTR(argv[1]);
8747
+ arg4 = arg2 = StringValuePtr(argv[1]);
8679
8748
  arg5 = arg3 = (size_t) RSTRING_LEN(argv[1]);
8680
8749
  }
8681
8750
  result = (char *)memcached_get_by_key(arg1,(char const *)arg2,arg3,(char const *)arg4,arg5,arg6,arg7,arg8);
@@ -8895,11 +8964,11 @@ _wrap_memcached_set(int argc, VALUE *argv, VALUE self) {
8895
8964
  }
8896
8965
  arg1 = (memcached_st *)(argp1);
8897
8966
  {
8898
- arg2 = STR2CSTR(argv[1]);
8967
+ arg2 = StringValuePtr(argv[1]);
8899
8968
  arg3 = (size_t) RSTRING_LEN(argv[1]);
8900
8969
  }
8901
8970
  {
8902
- arg4 = STR2CSTR(argv[2]);
8971
+ arg4 = StringValuePtr(argv[2]);
8903
8972
  arg5 = (size_t) RSTRING_LEN(argv[2]);
8904
8973
  }
8905
8974
  {
@@ -8946,11 +9015,11 @@ _wrap_memcached_add(int argc, VALUE *argv, VALUE self) {
8946
9015
  }
8947
9016
  arg1 = (memcached_st *)(argp1);
8948
9017
  {
8949
- arg2 = STR2CSTR(argv[1]);
9018
+ arg2 = StringValuePtr(argv[1]);
8950
9019
  arg3 = (size_t) RSTRING_LEN(argv[1]);
8951
9020
  }
8952
9021
  {
8953
- arg4 = STR2CSTR(argv[2]);
9022
+ arg4 = StringValuePtr(argv[2]);
8954
9023
  arg5 = (size_t) RSTRING_LEN(argv[2]);
8955
9024
  }
8956
9025
  {
@@ -8997,11 +9066,11 @@ _wrap_memcached_replace(int argc, VALUE *argv, VALUE self) {
8997
9066
  }
8998
9067
  arg1 = (memcached_st *)(argp1);
8999
9068
  {
9000
- arg2 = STR2CSTR(argv[1]);
9069
+ arg2 = StringValuePtr(argv[1]);
9001
9070
  arg3 = (size_t) RSTRING_LEN(argv[1]);
9002
9071
  }
9003
9072
  {
9004
- arg4 = STR2CSTR(argv[2]);
9073
+ arg4 = StringValuePtr(argv[2]);
9005
9074
  arg5 = (size_t) RSTRING_LEN(argv[2]);
9006
9075
  }
9007
9076
  {
@@ -9048,11 +9117,11 @@ _wrap_memcached_append(int argc, VALUE *argv, VALUE self) {
9048
9117
  }
9049
9118
  arg1 = (memcached_st *)(argp1);
9050
9119
  {
9051
- arg2 = STR2CSTR(argv[1]);
9120
+ arg2 = StringValuePtr(argv[1]);
9052
9121
  arg3 = (size_t) RSTRING_LEN(argv[1]);
9053
9122
  }
9054
9123
  {
9055
- arg4 = STR2CSTR(argv[2]);
9124
+ arg4 = StringValuePtr(argv[2]);
9056
9125
  arg5 = (size_t) RSTRING_LEN(argv[2]);
9057
9126
  }
9058
9127
  {
@@ -9099,11 +9168,11 @@ _wrap_memcached_prepend(int argc, VALUE *argv, VALUE self) {
9099
9168
  }
9100
9169
  arg1 = (memcached_st *)(argp1);
9101
9170
  {
9102
- arg2 = STR2CSTR(argv[1]);
9171
+ arg2 = StringValuePtr(argv[1]);
9103
9172
  arg3 = (size_t) RSTRING_LEN(argv[1]);
9104
9173
  }
9105
9174
  {
9106
- arg4 = STR2CSTR(argv[2]);
9175
+ arg4 = StringValuePtr(argv[2]);
9107
9176
  arg5 = (size_t) RSTRING_LEN(argv[2]);
9108
9177
  }
9109
9178
  {
@@ -9153,11 +9222,11 @@ _wrap_memcached_cas(int argc, VALUE *argv, VALUE self) {
9153
9222
  }
9154
9223
  arg1 = (memcached_st *)(argp1);
9155
9224
  {
9156
- arg2 = STR2CSTR(argv[1]);
9225
+ arg2 = StringValuePtr(argv[1]);
9157
9226
  arg3 = (size_t) RSTRING_LEN(argv[1]);
9158
9227
  }
9159
9228
  {
9160
- arg4 = STR2CSTR(argv[2]);
9229
+ arg4 = StringValuePtr(argv[2]);
9161
9230
  arg5 = (size_t) RSTRING_LEN(argv[2]);
9162
9231
  }
9163
9232
  {
@@ -9211,11 +9280,11 @@ _wrap_memcached_set_by_key(int argc, VALUE *argv, VALUE self) {
9211
9280
  }
9212
9281
  arg1 = (memcached_st *)(argp1);
9213
9282
  {
9214
- arg4 = arg2 = STR2CSTR(argv[1]);
9283
+ arg4 = arg2 = StringValuePtr(argv[1]);
9215
9284
  arg5 = arg3 = (size_t) RSTRING_LEN(argv[1]);
9216
9285
  }
9217
9286
  {
9218
- arg6 = STR2CSTR(argv[2]);
9287
+ arg6 = StringValuePtr(argv[2]);
9219
9288
  arg7 = (size_t) RSTRING_LEN(argv[2]);
9220
9289
  }
9221
9290
  {
@@ -9264,11 +9333,11 @@ _wrap_memcached_add_by_key(int argc, VALUE *argv, VALUE self) {
9264
9333
  }
9265
9334
  arg1 = (memcached_st *)(argp1);
9266
9335
  {
9267
- arg4 = arg2 = STR2CSTR(argv[1]);
9336
+ arg4 = arg2 = StringValuePtr(argv[1]);
9268
9337
  arg5 = arg3 = (size_t) RSTRING_LEN(argv[1]);
9269
9338
  }
9270
9339
  {
9271
- arg6 = STR2CSTR(argv[2]);
9340
+ arg6 = StringValuePtr(argv[2]);
9272
9341
  arg7 = (size_t) RSTRING_LEN(argv[2]);
9273
9342
  }
9274
9343
  {
@@ -9317,11 +9386,11 @@ _wrap_memcached_replace_by_key(int argc, VALUE *argv, VALUE self) {
9317
9386
  }
9318
9387
  arg1 = (memcached_st *)(argp1);
9319
9388
  {
9320
- arg4 = arg2 = STR2CSTR(argv[1]);
9389
+ arg4 = arg2 = StringValuePtr(argv[1]);
9321
9390
  arg5 = arg3 = (size_t) RSTRING_LEN(argv[1]);
9322
9391
  }
9323
9392
  {
9324
- arg6 = STR2CSTR(argv[2]);
9393
+ arg6 = StringValuePtr(argv[2]);
9325
9394
  arg7 = (size_t) RSTRING_LEN(argv[2]);
9326
9395
  }
9327
9396
  {
@@ -9370,11 +9439,11 @@ _wrap_memcached_prepend_by_key(int argc, VALUE *argv, VALUE self) {
9370
9439
  }
9371
9440
  arg1 = (memcached_st *)(argp1);
9372
9441
  {
9373
- arg4 = arg2 = STR2CSTR(argv[1]);
9442
+ arg4 = arg2 = StringValuePtr(argv[1]);
9374
9443
  arg5 = arg3 = (size_t) RSTRING_LEN(argv[1]);
9375
9444
  }
9376
9445
  {
9377
- arg6 = STR2CSTR(argv[2]);
9446
+ arg6 = StringValuePtr(argv[2]);
9378
9447
  arg7 = (size_t) RSTRING_LEN(argv[2]);
9379
9448
  }
9380
9449
  {
@@ -9423,11 +9492,11 @@ _wrap_memcached_append_by_key(int argc, VALUE *argv, VALUE self) {
9423
9492
  }
9424
9493
  arg1 = (memcached_st *)(argp1);
9425
9494
  {
9426
- arg4 = arg2 = STR2CSTR(argv[1]);
9495
+ arg4 = arg2 = StringValuePtr(argv[1]);
9427
9496
  arg5 = arg3 = (size_t) RSTRING_LEN(argv[1]);
9428
9497
  }
9429
9498
  {
9430
- arg6 = STR2CSTR(argv[2]);
9499
+ arg6 = StringValuePtr(argv[2]);
9431
9500
  arg7 = (size_t) RSTRING_LEN(argv[2]);
9432
9501
  }
9433
9502
  {
@@ -9479,11 +9548,11 @@ _wrap_memcached_cas_by_key(int argc, VALUE *argv, VALUE self) {
9479
9548
  }
9480
9549
  arg1 = (memcached_st *)(argp1);
9481
9550
  {
9482
- arg4 = arg2 = STR2CSTR(argv[1]);
9551
+ arg4 = arg2 = StringValuePtr(argv[1]);
9483
9552
  arg5 = arg3 = (size_t) RSTRING_LEN(argv[1]);
9484
9553
  }
9485
9554
  {
9486
- arg6 = STR2CSTR(argv[2]);
9555
+ arg6 = StringValuePtr(argv[2]);
9487
9556
  arg7 = (size_t) RSTRING_LEN(argv[2]);
9488
9557
  }
9489
9558
  {
@@ -11697,7 +11766,7 @@ _wrap_memcached_server_by_key(int argc, VALUE *argv, VALUE self) {
11697
11766
  }
11698
11767
  arg1 = (memcached_st *)(argp1);
11699
11768
  {
11700
- arg2 = STR2CSTR(argv[1]);
11769
+ arg2 = StringValuePtr(argv[1]);
11701
11770
  arg3 = (size_t) RSTRING_LEN(argv[1]);
11702
11771
  }
11703
11772
  result = (memcached_server_st *)memcached_server_by_key(arg1,(char const *)arg2,arg3,arg4);
@@ -11977,6 +12046,153 @@ fail:
11977
12046
  }
11978
12047
 
11979
12048
 
12049
+ SWIGINTERN VALUE
12050
+ _wrap_memcached_set_sasl_callbacks(int argc, VALUE *argv, VALUE self) {
12051
+ memcached_st *arg1 = (memcached_st *) 0 ;
12052
+ sasl_callback_t *arg2 = (sasl_callback_t *) 0 ;
12053
+ void *argp1 = 0 ;
12054
+ int res1 = 0 ;
12055
+ void *argp2 = 0 ;
12056
+ int res2 = 0 ;
12057
+
12058
+ if ((argc < 2) || (argc > 2)) {
12059
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
12060
+ }
12061
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
12062
+ if (!SWIG_IsOK(res1)) {
12063
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "memcached_st *","memcached_set_sasl_callbacks", 1, argv[0] ));
12064
+ }
12065
+ arg1 = (memcached_st *)(argp1);
12066
+ res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_sasl_callback_t, 0 | 0 );
12067
+ if (!SWIG_IsOK(res2)) {
12068
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "sasl_callback_t const *","memcached_set_sasl_callbacks", 2, argv[1] ));
12069
+ }
12070
+ arg2 = (sasl_callback_t *)(argp2);
12071
+ memcached_set_sasl_callbacks(arg1,(sasl_callback_t const *)arg2);
12072
+ return Qnil;
12073
+ fail:
12074
+ return Qnil;
12075
+ }
12076
+
12077
+
12078
+ SWIGINTERN VALUE
12079
+ _wrap_memcached_set_sasl_auth_data(int argc, VALUE *argv, VALUE self) {
12080
+ memcached_st *arg1 = (memcached_st *) 0 ;
12081
+ char *arg2 = (char *) 0 ;
12082
+ char *arg3 = (char *) 0 ;
12083
+ void *argp1 = 0 ;
12084
+ int res1 = 0 ;
12085
+ int res2 ;
12086
+ char *buf2 = 0 ;
12087
+ int alloc2 = 0 ;
12088
+ int res3 ;
12089
+ char *buf3 = 0 ;
12090
+ int alloc3 = 0 ;
12091
+ memcached_return result;
12092
+ VALUE vresult = Qnil;
12093
+
12094
+ if ((argc < 3) || (argc > 3)) {
12095
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
12096
+ }
12097
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
12098
+ if (!SWIG_IsOK(res1)) {
12099
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "memcached_st *","memcached_set_sasl_auth_data", 1, argv[0] ));
12100
+ }
12101
+ arg1 = (memcached_st *)(argp1);
12102
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
12103
+ if (!SWIG_IsOK(res2)) {
12104
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","memcached_set_sasl_auth_data", 2, argv[1] ));
12105
+ }
12106
+ arg2 = (char *)(buf2);
12107
+ res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
12108
+ if (!SWIG_IsOK(res3)) {
12109
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","memcached_set_sasl_auth_data", 3, argv[2] ));
12110
+ }
12111
+ arg3 = (char *)(buf3);
12112
+ result = (memcached_return)memcached_set_sasl_auth_data(arg1,(char const *)arg2,(char const *)arg3);
12113
+ vresult = SWIG_From_int((int)(result));
12114
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
12115
+ if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
12116
+ return vresult;
12117
+ fail:
12118
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
12119
+ if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
12120
+ return Qnil;
12121
+ }
12122
+
12123
+
12124
+ SWIGINTERN VALUE
12125
+ _wrap_memcached_destroy_sasl_auth_data(int argc, VALUE *argv, VALUE self) {
12126
+ memcached_st *arg1 = (memcached_st *) 0 ;
12127
+ void *argp1 = 0 ;
12128
+ int res1 = 0 ;
12129
+ memcached_return result;
12130
+ VALUE vresult = Qnil;
12131
+
12132
+ if ((argc < 1) || (argc > 1)) {
12133
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
12134
+ }
12135
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
12136
+ if (!SWIG_IsOK(res1)) {
12137
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "memcached_st *","memcached_destroy_sasl_auth_data", 1, argv[0] ));
12138
+ }
12139
+ arg1 = (memcached_st *)(argp1);
12140
+ result = (memcached_return)memcached_destroy_sasl_auth_data(arg1);
12141
+ vresult = SWIG_From_int((int)(result));
12142
+ return vresult;
12143
+ fail:
12144
+ return Qnil;
12145
+ }
12146
+
12147
+
12148
+ SWIGINTERN VALUE
12149
+ _wrap_memcached_get_sasl_callbacks(int argc, VALUE *argv, VALUE self) {
12150
+ memcached_st *arg1 = (memcached_st *) 0 ;
12151
+ void *argp1 = 0 ;
12152
+ int res1 = 0 ;
12153
+ sasl_callback_t *result = 0 ;
12154
+ VALUE vresult = Qnil;
12155
+
12156
+ if ((argc < 1) || (argc > 1)) {
12157
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
12158
+ }
12159
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_memcached_st, 0 | 0 );
12160
+ if (!SWIG_IsOK(res1)) {
12161
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "memcached_st *","memcached_get_sasl_callbacks", 1, argv[0] ));
12162
+ }
12163
+ arg1 = (memcached_st *)(argp1);
12164
+ result = (sasl_callback_t *)memcached_get_sasl_callbacks(arg1);
12165
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_sasl_callback_t, 0 | 0 );
12166
+ return vresult;
12167
+ fail:
12168
+ return Qnil;
12169
+ }
12170
+
12171
+
12172
+ SWIGINTERN VALUE
12173
+ _wrap_memcached_sasl_authenticate_connection(int argc, VALUE *argv, VALUE self) {
12174
+ memcached_server_st *arg1 = (memcached_server_st *) 0 ;
12175
+ void *argp1 = 0 ;
12176
+ int res1 = 0 ;
12177
+ memcached_return result;
12178
+ VALUE vresult = Qnil;
12179
+
12180
+ if ((argc < 1) || (argc > 1)) {
12181
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
12182
+ }
12183
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_memcached_server_st, 0 | 0 );
12184
+ if (!SWIG_IsOK(res1)) {
12185
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "memcached_server_st *","memcached_sasl_authenticate_connection", 1, argv[0] ));
12186
+ }
12187
+ arg1 = (memcached_server_st *)(argp1);
12188
+ result = (memcached_return)memcached_sasl_authenticate_connection(arg1);
12189
+ vresult = SWIG_From_int((int)(result));
12190
+ return vresult;
12191
+ fail:
12192
+ return Qnil;
12193
+ }
12194
+
12195
+
11980
12196
  SWIGINTERN VALUE
11981
12197
  _wrap_memcached_get_rvalue(int argc, VALUE *argv, VALUE self) {
11982
12198
  memcached_st *arg1 = (memcached_st *) 0 ;
@@ -12004,7 +12220,7 @@ _wrap_memcached_get_rvalue(int argc, VALUE *argv, VALUE self) {
12004
12220
  }
12005
12221
  arg1 = (memcached_st *)(argp1);
12006
12222
  {
12007
- arg2 = STR2CSTR(argv[1]);
12223
+ arg2 = StringValuePtr(argv[1]);
12008
12224
  arg3 = (size_t) RSTRING_LEN(argv[1]);
12009
12225
  }
12010
12226
  result = (VALUE)memcached_get_rvalue(arg1,(char const *)arg2,arg3,arg4,arg5);
@@ -12222,7 +12438,7 @@ _wrap_memcached_generate_hash_rvalue(int argc, VALUE *argv, VALUE self) {
12222
12438
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
12223
12439
  }
12224
12440
  {
12225
- arg1 = STR2CSTR(argv[0]);
12441
+ arg1 = StringValuePtr(argv[0]);
12226
12442
  arg2 = (size_t) RSTRING_LEN(argv[0]);
12227
12443
  }
12228
12444
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
@@ -12269,11 +12485,11 @@ static swig_type_info _swigt__p_memcached_string_st = {"_p_memcached_string_st",
12269
12485
  static swig_type_info _swigt__p_memcached_trigger_delete_key = {"_p_memcached_trigger_delete_key", "memcached_trigger_delete_key *", 0, 0, (void*)0, 0};
12270
12486
  static swig_type_info _swigt__p_memcached_trigger_key = {"_p_memcached_trigger_key", "memcached_trigger_key *", 0, 0, (void*)0, 0};
12271
12487
  static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
12488
+ static swig_type_info _swigt__p_sasl_callback_t = {"_p_sasl_callback_t", "sasl_callback_t *", 0, 0, (void*)0, 0};
12272
12489
  static swig_type_info _swigt__p_size_t = {"_p_size_t", "size_t *", 0, 0, (void*)0, 0};
12273
12490
  static swig_type_info _swigt__p_time_t = {"_p_time_t", "time_t *", 0, 0, (void*)0, 0};
12274
12491
  static swig_type_info _swigt__p_uint32_t = {"_p_uint32_t", "uint32_t *", 0, 0, (void*)0, 0};
12275
12492
  static swig_type_info _swigt__p_uint64_t = {"_p_uint64_t", "uint64_t *", 0, 0, (void*)0, 0};
12276
- static swig_type_info _swigt__p_void = {"_p_void", "void *", 0, 0, (void*)0, 0};
12277
12493
 
12278
12494
  static swig_type_info *swig_type_initial[] = {
12279
12495
  &_swigt__p_addrinfo,
@@ -12304,11 +12520,11 @@ static swig_type_info *swig_type_initial[] = {
12304
12520
  &_swigt__p_memcached_trigger_delete_key,
12305
12521
  &_swigt__p_memcached_trigger_key,
12306
12522
  &_swigt__p_p_char,
12523
+ &_swigt__p_sasl_callback_t,
12307
12524
  &_swigt__p_size_t,
12308
12525
  &_swigt__p_time_t,
12309
12526
  &_swigt__p_uint32_t,
12310
12527
  &_swigt__p_uint64_t,
12311
- &_swigt__p_void,
12312
12528
  };
12313
12529
 
12314
12530
  static swig_cast_info _swigc__p_addrinfo[] = { {&_swigt__p_addrinfo, 0, 0, 0},{0, 0, 0, 0}};
@@ -12339,11 +12555,11 @@ static swig_cast_info _swigc__p_memcached_string_st[] = { {&_swigt__p_memcached
12339
12555
  static swig_cast_info _swigc__p_memcached_trigger_delete_key[] = { {&_swigt__p_memcached_trigger_delete_key, 0, 0, 0},{0, 0, 0, 0}};
12340
12556
  static swig_cast_info _swigc__p_memcached_trigger_key[] = { {&_swigt__p_memcached_trigger_key, 0, 0, 0},{0, 0, 0, 0}};
12341
12557
  static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
12558
+ static swig_cast_info _swigc__p_sasl_callback_t[] = { {&_swigt__p_sasl_callback_t, 0, 0, 0},{0, 0, 0, 0}};
12342
12559
  static swig_cast_info _swigc__p_size_t[] = { {&_swigt__p_size_t, 0, 0, 0},{0, 0, 0, 0}};
12343
12560
  static swig_cast_info _swigc__p_time_t[] = { {&_swigt__p_time_t, 0, 0, 0},{0, 0, 0, 0}};
12344
12561
  static swig_cast_info _swigc__p_uint32_t[] = { {&_swigt__p_uint32_t, 0, 0, 0},{0, 0, 0, 0}};
12345
12562
  static swig_cast_info _swigc__p_uint64_t[] = { {&_swigt__p_uint64_t, 0, 0, 0},{0, 0, 0, 0}};
12346
- static swig_cast_info _swigc__p_void[] = { {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};
12347
12563
 
12348
12564
  static swig_cast_info *swig_cast_initial[] = {
12349
12565
  _swigc__p_addrinfo,
@@ -12374,11 +12590,11 @@ static swig_cast_info *swig_cast_initial[] = {
12374
12590
  _swigc__p_memcached_trigger_delete_key,
12375
12591
  _swigc__p_memcached_trigger_key,
12376
12592
  _swigc__p_p_char,
12593
+ _swigc__p_sasl_callback_t,
12377
12594
  _swigc__p_size_t,
12378
12595
  _swigc__p_time_t,
12379
12596
  _swigc__p_uint32_t,
12380
12597
  _swigc__p_uint64_t,
12381
- _swigc__p_void,
12382
12598
  };
12383
12599
 
12384
12600
 
@@ -12808,6 +13024,8 @@ SWIGEXPORT void Init_rlibmemcached(void) {
12808
13024
  rb_define_method(SwigClassMemcachedSt.klass, "live_host_indices", _wrap_MemcachedSt_live_host_indices_get, -1);
12809
13025
  rb_define_method(SwigClassMemcachedSt.klass, "live_host_indices_size=", _wrap_MemcachedSt_live_host_indices_size_set, -1);
12810
13026
  rb_define_method(SwigClassMemcachedSt.klass, "live_host_indices_size", _wrap_MemcachedSt_live_host_indices_size_get, -1);
13027
+ rb_define_method(SwigClassMemcachedSt.klass, "sasl_callbacks=", _wrap_MemcachedSt_sasl_callbacks_set, -1);
13028
+ rb_define_method(SwigClassMemcachedSt.klass, "sasl_callbacks", _wrap_MemcachedSt_sasl_callbacks_get, -1);
12811
13029
  SwigClassMemcachedSt.mark = 0;
12812
13030
  SwigClassMemcachedSt.destroy = (void (*)(void *)) memcached_free;
12813
13031
  SwigClassMemcachedSt.trackObjects = 0;
@@ -12907,6 +13125,9 @@ SWIGEXPORT void Init_rlibmemcached(void) {
12907
13125
  rb_define_const(mRlibmemcached, "MEMCACHED_INVALID_HOST_PROTOCOL", SWIG_From_int((int)(MEMCACHED_INVALID_HOST_PROTOCOL)));
12908
13126
  rb_define_const(mRlibmemcached, "MEMCACHED_SERVER_MARKED_DEAD", SWIG_From_int((int)(MEMCACHED_SERVER_MARKED_DEAD)));
12909
13127
  rb_define_const(mRlibmemcached, "MEMCACHED_UNKNOWN_STAT_KEY", SWIG_From_int((int)(MEMCACHED_UNKNOWN_STAT_KEY)));
13128
+ rb_define_const(mRlibmemcached, "MEMCACHED_AUTH_PROBLEM", SWIG_From_int((int)(MEMCACHED_AUTH_PROBLEM)));
13129
+ rb_define_const(mRlibmemcached, "MEMCACHED_AUTH_FAILURE", SWIG_From_int((int)(MEMCACHED_AUTH_FAILURE)));
13130
+ rb_define_const(mRlibmemcached, "MEMCACHED_AUTH_CONTINUE", SWIG_From_int((int)(MEMCACHED_AUTH_CONTINUE)));
12910
13131
  rb_define_const(mRlibmemcached, "MEMCACHED_MAXIMUM_RETURN", SWIG_From_int((int)(MEMCACHED_MAXIMUM_RETURN)));
12911
13132
  rb_define_const(mRlibmemcached, "MEMCACHED_DISTRIBUTION_MODULA", SWIG_From_int((int)(MEMCACHED_DISTRIBUTION_MODULA)));
12912
13133
  rb_define_const(mRlibmemcached, "MEMCACHED_DISTRIBUTION_CONSISTENT", SWIG_From_int((int)(MEMCACHED_DISTRIBUTION_CONSISTENT)));
@@ -13080,11 +13301,21 @@ SWIGEXPORT void Init_rlibmemcached(void) {
13080
13301
  rb_define_module_function(mRlibmemcached, "memcached_server_clone", _wrap_memcached_server_clone, -1);
13081
13302
  rb_define_module_function(mRlibmemcached, "memcached_analyze", _wrap_memcached_analyze, -1);
13082
13303
  rb_define_module_function(mRlibmemcached, "memcached_server_remove", _wrap_memcached_server_remove, -1);
13304
+ rb_define_module_function(mRlibmemcached, "memcached_set_sasl_callbacks", _wrap_memcached_set_sasl_callbacks, -1);
13305
+ rb_define_module_function(mRlibmemcached, "memcached_set_sasl_auth_data", _wrap_memcached_set_sasl_auth_data, -1);
13306
+ rb_define_module_function(mRlibmemcached, "memcached_destroy_sasl_auth_data", _wrap_memcached_destroy_sasl_auth_data, -1);
13307
+ rb_define_module_function(mRlibmemcached, "memcached_get_sasl_callbacks", _wrap_memcached_get_sasl_callbacks, -1);
13308
+ rb_define_module_function(mRlibmemcached, "memcached_sasl_authenticate_connection", _wrap_memcached_sasl_authenticate_connection, -1);
13083
13309
  rb_define_module_function(mRlibmemcached, "memcached_get_rvalue", _wrap_memcached_get_rvalue, -1);
13084
13310
  rb_define_module_function(mRlibmemcached, "memcached_fetch_rvalue", _wrap_memcached_fetch_rvalue, -1);
13085
13311
  rb_define_module_function(mRlibmemcached, "memcached_stat_get_rvalue", _wrap_memcached_stat_get_rvalue, -1);
13086
13312
  rb_define_module_function(mRlibmemcached, "memcached_select_server_at", _wrap_memcached_select_server_at, -1);
13087
13313
  rb_define_module_function(mRlibmemcached, "memcached_select_stat_at", _wrap_memcached_select_stat_at, -1);
13088
13314
  rb_define_module_function(mRlibmemcached, "memcached_generate_hash_rvalue", _wrap_memcached_generate_hash_rvalue, -1);
13315
+
13316
+ if (sasl_client_init(NULL) != SASL_OK) {
13317
+ fprintf(stderr, "Failed to initialized SASL.\n");
13318
+ }
13319
+
13089
13320
  }
13090
13321