Typo fix.
[awesomized/libmemcached] / libmemcached / auto.cc
index f9f84d7b699a1cc53d07a69a771c0c6624c970ea..685528f2fae41adc40e8924016fdd3d8b88601c1 100644 (file)
@@ -37,7 +37,7 @@
 
 #include <libmemcached/common.h>
 
-static void auto_response(org::libmemcached::Instance* instance, const bool reply,  memcached_return_t& rc, uint64_t* value)
+static void auto_response(memcached_instance_st* instance, const bool reply,  memcached_return_t& rc, uint64_t* value)
 {
   // If the message was successfully sent, then get the response, otherwise
   // fail.
@@ -54,7 +54,6 @@ static void auto_response(org::libmemcached::Instance* instance, const bool repl
 
   if (memcached_fatal(rc))
   {
-    fprintf(stderr, "%s\n", memcached_strerror(NULL, rc));
     assert(memcached_last_error(instance->root) != MEMCACHED_SUCCESS);
     *value= UINT64_MAX;
   }
@@ -64,7 +63,7 @@ static void auto_response(org::libmemcached::Instance* instance, const bool repl
   }
 }
 
-static memcached_return_t text_incr_decr(org::libmemcached::Instance* instance,
+static memcached_return_t text_incr_decr(memcached_instance_st* instance,
                                          const bool is_incr,
                                          const char *key, size_t key_length,
                                          const uint64_t offset,
@@ -98,7 +97,7 @@ static memcached_return_t text_incr_decr(org::libmemcached::Instance* instance,
   return memcached_vdo(instance, vector, 7, true);
 }
 
-static memcached_return_t binary_incr_decr(org::libmemcached::Instance* instance,
+static memcached_return_t binary_incr_decr(memcached_instance_st* instance,
                                            protocol_binary_command cmd,
                                            const char *key, const size_t key_length,
                                            const uint64_t offset,
@@ -151,7 +150,7 @@ memcached_return_t memcached_increment(memcached_st *memc,
 }
 
 static memcached_return_t increment_decrement_by_key(const protocol_binary_command command,
-                                                     memcached_st *memc,
+                                                     Memcached *memc,
                                                      const char *group_key, size_t group_key_length,
                                                      const char *key, size_t key_length,
                                                      uint64_t offset,
@@ -181,7 +180,7 @@ static memcached_return_t increment_decrement_by_key(const protocol_binary_comma
   }
 
   uint32_t server_key= memcached_generate_hash_with_redistribution(memc, group_key, group_key_length);
-  org::libmemcached::Instance* instance= memcached_instance_fetch(memc, server_key);
+  memcached_instance_st* instance= memcached_instance_fetch(memc, server_key);
 
   bool reply= memcached_is_replying(instance->root);
 
@@ -206,7 +205,7 @@ static memcached_return_t increment_decrement_by_key(const protocol_binary_comma
 }
 
 static memcached_return_t increment_decrement_with_initial_by_key(const protocol_binary_command command,
-                                                                  memcached_st *memc,
+                                                                  Memcached *memc,
                                                                   const char *group_key,
                                                                   size_t group_key_length,
                                                                   const char *key,
@@ -240,7 +239,7 @@ static memcached_return_t increment_decrement_with_initial_by_key(const protocol
   }
 
   uint32_t server_key= memcached_generate_hash_with_redistribution(memc, group_key, group_key_length);
-  org::libmemcached::Instance* instance= memcached_instance_fetch(memc, server_key);
+  memcached_instance_st* instance= memcached_instance_fetch(memc, server_key);
 
   bool reply= memcached_is_replying(instance->root);
 
@@ -272,12 +271,13 @@ memcached_return_t memcached_decrement(memcached_st *memc,
 }
 
 
-memcached_return_t memcached_increment_by_key(memcached_st *memc,
+memcached_return_t memcached_increment_by_key(memcached_st *shell,
                                               const char *group_key, size_t group_key_length,
                                               const char *key, size_t key_length,
                                               uint64_t offset,
                                               uint64_t *value)
 {
+  Memcached* memc= memcached2Memcached(shell);
   LIBMEMCACHED_MEMCACHED_INCREMENT_START();
   memcached_return_t rc= increment_decrement_by_key(PROTOCOL_BINARY_CMD_INCREMENT,
                                                     memc,
@@ -290,12 +290,13 @@ memcached_return_t memcached_increment_by_key(memcached_st *memc,
   return rc;
 }
 
-memcached_return_t memcached_decrement_by_key(memcached_st *memc,
+memcached_return_t memcached_decrement_by_key(memcached_st *shell,
                                               const char *group_key, size_t group_key_length,
                                               const char *key, size_t key_length,
                                               uint64_t offset,
                                               uint64_t *value)
 {
+  Memcached* memc= memcached2Memcached(shell);
   LIBMEMCACHED_MEMCACHED_DECREMENT_START();
   memcached_return_t rc= increment_decrement_by_key(PROTOCOL_BINARY_CMD_DECREMENT,
                                                     memc,
@@ -320,7 +321,7 @@ memcached_return_t memcached_increment_with_initial(memcached_st *memc,
                                                  offset, initial, expiration, value);
 }
 
-memcached_return_t memcached_increment_with_initial_by_key(memcached_st *memc,
+memcached_return_t memcached_increment_with_initial_by_key(memcached_st *shell,
                                                            const char *group_key,
                                                            size_t group_key_length,
                                                            const char *key,
@@ -331,6 +332,7 @@ memcached_return_t memcached_increment_with_initial_by_key(memcached_st *memc,
                                                            uint64_t *value)
 {
   LIBMEMCACHED_MEMCACHED_INCREMENT_WITH_INITIAL_START();
+  Memcached* memc= memcached2Memcached(shell);
   memcached_return_t rc= increment_decrement_with_initial_by_key(PROTOCOL_BINARY_CMD_INCREMENT, 
                                                                  memc,
                                                                  group_key, group_key_length,
@@ -354,7 +356,7 @@ memcached_return_t memcached_decrement_with_initial(memcached_st *memc,
                                                  offset, initial, expiration, value);
 }
 
-memcached_return_t memcached_decrement_with_initial_by_key(memcached_st *memc,
+memcached_return_t memcached_decrement_with_initial_by_key(memcached_st *shell,
                                                            const char *group_key,
                                                            size_t group_key_length,
                                                            const char *key,
@@ -365,6 +367,7 @@ memcached_return_t memcached_decrement_with_initial_by_key(memcached_st *memc,
                                                            uint64_t *value)
 {
   LIBMEMCACHED_MEMCACHED_INCREMENT_WITH_INITIAL_START();
+  Memcached* memc= memcached2Memcached(shell);
   memcached_return_t rc= increment_decrement_with_initial_by_key(PROTOCOL_BINARY_CMD_DECREMENT, 
                                                                  memc,
                                                                  group_key, group_key_length,