Fixing increment and decrement to take a 64bit unsigned value.
authorBrian Aker <brian@tangent.org>
Mon, 12 Nov 2007 07:07:28 +0000 (23:07 -0800)
committerBrian Aker <brian@tangent.org>
Mon, 12 Nov 2007 07:07:28 +0000 (23:07 -0800)
ChangeLog
configure.ac
docs/memcached_auto.pod
include/memcached.h
lib/memcached_auto.c
tests/function.c

index 1a54023afa169cbf3667a2e64bf11e437d9e6a8f..2b273ae568b1e22bf961db5f1e5484dfd8179a07 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
   * fix for when no servers are definied.
   * different buffers are now kept for different connections to
     speed up async efforts
+  * Modified increment/decrement functions to return uint64_t values
 
 0.8 Mon Nov  5 10:40:41 PST 2007
   * Adding support for CRC hash method 
index 2dd4a2294026cfbb9f22856931eda48bdffd0ced..58fac5ba012c7ae2d0f9759d14cf8680dd017140 100644 (file)
@@ -14,7 +14,7 @@ MEMCACHED_API_VERSION=1.0
 AC_SUBST(MEMCACHED_API_VERSION)
 
 #shared library versioning
-MEMCACHED_LIBRARY_VERSION=1:0:0
+MEMCACHED_LIBRARY_VERSION=1:1:0
 #                         | | |
 #                  +------+ | +---+
 #                  |        |     |
index ebf63caa90e66093df749afc6b670960c1a58933..27332e93ee7fe41ef028450130cc9862eaedf3e1 100755 (executable)
@@ -14,13 +14,13 @@ C Client Library for memcached (libmemcached, -lmemcached)
     memcached_increment (memcached_st *ptr, 
                          char *key, size_t key_length,
                          unsigned int offset,
-                         unsigned int *value);
+                         uint64_t *value);
 
   memcached_return
     memcached_decrement (memcached_st *ptr, 
                          char *key, size_t key_length,
                          unsigned int offset,
-                         unsigned int *value);
+                         uint64_t *value);
 
 =head1 DESCRIPTION
 
index a684a1ecd24186e2a041f9b1dc43b1a204f0c8c3..6bf1e0be4efd5cd718939e83265306d14dc91484 100644 (file)
@@ -182,11 +182,11 @@ memcached_return memcached_delete(memcached_st *ptr, char *key, size_t key_lengt
 memcached_return memcached_increment(memcached_st *ptr, 
                                      char *key, size_t key_length,
                                      unsigned int offset,
-                                     unsigned int *value);
+                                     uint64_t *value);
 memcached_return memcached_decrement(memcached_st *ptr, 
                                      char *key, size_t key_length,
                                      unsigned int offset,
-                                     unsigned int *value);
+                                     uint64_t *value);
 void memcached_stat_free(memcached_st *, memcached_stat_st *);
 memcached_stat_st *memcached_stat(memcached_st *ptr, char *args, memcached_return *error);
 memcached_return memcached_stat_servername(memcached_stat_st *stat, char *args, 
index 25f9aaf9efb7f44a5348a46fc2e12bc4d790762c..ad91f75b47962ccad83e11f19d8eeb6d889d9912 100644 (file)
@@ -4,7 +4,7 @@ static memcached_return memcached_auto(memcached_st *ptr,
                                        char *verb,
                                        char *key, size_t key_length,
                                        unsigned int offset,
-                                       unsigned int *value)
+                                       uint64_t *value)
 {
   size_t send_length, sent_length;
   memcached_return rc;
@@ -53,7 +53,7 @@ static memcached_return memcached_auto(memcached_st *ptr,
   }
   else
   {
-    *value= strtol(buffer, (char **)NULL, 10);
+    *value= (uint64_t)strtoll(buffer, (char **)NULL, 10);
     rc= MEMCACHED_SUCCESS;
   }
 
@@ -63,7 +63,7 @@ static memcached_return memcached_auto(memcached_st *ptr,
 memcached_return memcached_increment(memcached_st *ptr, 
                                      char *key, size_t key_length,
                                      unsigned int offset,
-                                     unsigned int *value)
+                                     uint64_t *value)
 {
   memcached_return rc;
 
@@ -77,7 +77,7 @@ memcached_return memcached_increment(memcached_st *ptr,
 memcached_return memcached_decrement(memcached_st *ptr, 
                                      char *key, size_t key_length,
                                      unsigned int offset,
-                                     unsigned int *value)
+                                     uint64_t *value)
 {
   memcached_return rc;
 
index 6bac2d530d5ab946d2b44a434bb997421e12610c..37f2c49003112d83969f594abc16b42948c9aecd 100644 (file)
@@ -354,7 +354,7 @@ uint8_t stats_servername_test(memcached_st *memc)
 
 uint8_t increment_test(memcached_st *memc)
 {
-  unsigned int new_number;
+  uint64_t new_number;
   memcached_return rc;
   char *key= "number";
   char *value= "0";
@@ -379,7 +379,7 @@ uint8_t increment_test(memcached_st *memc)
 
 uint8_t decrement_test(memcached_st *memc)
 {
-  unsigned int new_number;
+  uint64_t new_number;
   memcached_return rc;
   char *key= "number";
   char *value= "3";