Merging Trond, also fixed make test.
authorBrian Aker <brian@gir.tangent.org>
Mon, 22 Jun 2009 01:47:19 +0000 (18:47 -0700)
committerBrian Aker <brian@gir.tangent.org>
Mon, 22 Jun 2009 01:47:19 +0000 (18:47 -0700)
libmemcached/memcached_callback.c
libmemcached/memcached_constants.h
tests/function.c
tests/output.res

index de792d0ecb5089ba3cb57994c22b20c9d053cd13..3433585cec331ed323e204bd48ce396f4f94a9a8 100644 (file)
@@ -62,6 +62,7 @@ memcached_return memcached_callback_set(memcached_st *ptr,
       ptr->on_clone= func;
       break;
     }
+#ifdef MEMCACHED_ENABLE_DEPRECATED
   case MEMCACHED_CALLBACK_MALLOC_FUNCTION:
     {
       memcached_malloc_function func= *(memcached_malloc_function *)&data;
@@ -80,6 +81,7 @@ memcached_return memcached_callback_set(memcached_st *ptr,
       ptr->call_free= func;
       break;
     }
+#endif
   case MEMCACHED_CALLBACK_GET_FAILURE:
     {
       memcached_trigger_key func= *(memcached_trigger_key *)&data;
@@ -138,6 +140,7 @@ void *memcached_callback_get(memcached_st *ptr,
       *error= ptr->on_clone ? MEMCACHED_SUCCESS : MEMCACHED_FAILURE;
       return *(void **)&ptr->on_clone;
     }
+#ifdef MEMCACHED_ENABLE_DEPRECATED
   case MEMCACHED_CALLBACK_MALLOC_FUNCTION:
     {
       *error= ptr->call_malloc ? MEMCACHED_SUCCESS : MEMCACHED_FAILURE;
@@ -153,6 +156,7 @@ void *memcached_callback_get(memcached_st *ptr,
       *error= ptr->call_free ? MEMCACHED_SUCCESS : MEMCACHED_FAILURE;
       return *(void **)&ptr->call_free;
     }
+#endif
   case MEMCACHED_CALLBACK_GET_FAILURE:
     {
       *error= ptr->get_key_failure ? MEMCACHED_SUCCESS : MEMCACHED_FAILURE;
index 5fdede9a765923ddc6b428f7732078ca1ced2c24..5d0e31d0c3f352aa0d45f5d29b67bbd4e4503381 100644 (file)
@@ -110,15 +110,17 @@ typedef enum {
 } memcached_behavior;
 
 typedef enum {
-  MEMCACHED_CALLBACK_PREFIX_KEY,
-  MEMCACHED_CALLBACK_USER_DATA,
-  MEMCACHED_CALLBACK_CLEANUP_FUNCTION,
-  MEMCACHED_CALLBACK_CLONE_FUNCTION,
-  MEMCACHED_CALLBACK_MALLOC_FUNCTION,
-  MEMCACHED_CALLBACK_REALLOC_FUNCTION,
-  MEMCACHED_CALLBACK_FREE_FUNCTION,
-  MEMCACHED_CALLBACK_GET_FAILURE,
-  MEMCACHED_CALLBACK_DELETE_TRIGGER
+  MEMCACHED_CALLBACK_PREFIX_KEY = 0,
+  MEMCACHED_CALLBACK_USER_DATA = 1,
+  MEMCACHED_CALLBACK_CLEANUP_FUNCTION = 2,
+  MEMCACHED_CALLBACK_CLONE_FUNCTION = 3,
+#ifdef MEMCACHED_ENABLE_DEPRECATED
+  MEMCACHED_CALLBACK_MALLOC_FUNCTION = 4,
+  MEMCACHED_CALLBACK_REALLOC_FUNCTION = 5,
+  MEMCACHED_CALLBACK_FREE_FUNCTION = 6,
+#endif
+  MEMCACHED_CALLBACK_GET_FAILURE = 7,
+  MEMCACHED_CALLBACK_DELETE_TRIGGER = 8
 } memcached_callback;
 
 typedef enum {
index c505b1118088247d28f67aca9449ba6ab0079bcf..8728ccd421dd124993cd35f10b3c98c38a4dd542 100644 (file)
@@ -3161,6 +3161,7 @@ static memcached_return set_prefix(memcached_st *memc)
   return MEMCACHED_SUCCESS;
 }
 
+#ifdef MEMCACHED_ENABLE_DEPRECATED
 static memcached_return deprecated_set_memory_alloc(memcached_st *memc)
 {
   void *test_ptr= NULL;
@@ -3205,6 +3206,7 @@ static memcached_return deprecated_set_memory_alloc(memcached_st *memc)
   }
   return MEMCACHED_SUCCESS;
 }
+#endif
 
 static memcached_return set_memory_alloc(memcached_st *memc)
 {
@@ -4545,7 +4547,9 @@ collection_st collection[] ={
   {"poll_timeout", poll_timeout, 0, tests},
   {"gets", enable_cas, 0, tests},
   {"consistent", enable_consistent, 0, tests},
+#ifdef MEMCACHED_ENABLE_DEPRECATED
   {"deprecated_memory_allocators", deprecated_set_memory_alloc, 0, tests},
+#endif
   {"memory_allocators", set_memory_alloc, 0, tests},
   {"prefix", set_prefix, 0, tests},
   {"version_1_2_3", check_for_1_2_3, 0, version_1_2_3},
index 3a2ed00e85ff2ffe79f49fe6b248e698dd379d6b..c2a6e946ef78dfa0666232dcda4d54a374fd3cae 100644 (file)
@@ -634,40 +634,3 @@ Error 33 -> A BAD KEY WAS PROVIDED/CHARACTERS OUT OF RANGE
 Error 34 -> THE HOST TRANSPORT PROTOCOL DOES NOT MATCH THAT OF THE CLIENT
 Error 35 -> SERVER IS MARKED DEAD
 Error 36 -> ENCOUNTERED AN UNKNOWN STAT KEY
-Error 0 -> SUCCESS
-Error 1 -> FAILURE
-Error 2 -> HOSTNAME LOOKUP FAILURE
-Error 3 -> CONNECTION FAILURE
-Error 4 -> CONNECTION BIND FAILURE
-Error 5 -> WRITE FAILURE
-Error 6 -> READ FAILURE
-Error 7 -> UNKNOWN READ FAILURE
-Error 8 -> PROTOCOL ERROR
-Error 9 -> CLIENT ERROR
-Error 10 -> SERVER ERROR
-Error 11 -> CONNECTION SOCKET CREATE FAILURE
-Error 12 -> CONNECTION DATA EXISTS
-Error 13 -> CONNECTION DATA DOES NOT EXIST
-Error 14 -> NOT STORED
-Error 15 -> STORED
-Error 16 -> NOT FOUND
-Error 17 -> MEMORY ALLOCATION FAILURE
-Error 18 -> PARTIAL READ
-Error 19 -> SOME ERRORS WERE REPORTED
-Error 20 -> NO SERVERS DEFINED
-Error 21 -> SERVER END
-Error 22 -> SERVER DELETE
-Error 23 -> SERVER VALUE
-Error 24 -> STAT VALUE
-Error 25 -> ITEM VALUE
-Error 26 -> SYSTEM ERROR
-Error 27 -> COULD NOT OPEN UNIX SOCKET
-Error 28 -> ACTION NOT SUPPORTED
-Error 29 -> A KEY LENGTH OF ZERO WAS PROVIDED
-Error 30 -> FETCH WAS NOT COMPLETED
-Error 31 -> A TIMEOUT OCCURRED
-Error 32 -> ACTION QUEUED
-Error 33 -> A BAD KEY WAS PROVIDED/CHARACTERS OUT OF RANGE
-Error 34 -> THE HOST TRANSPORT PROTOCOL DOES NOT MATCH THAT OF THE CLIENT
-Error 35 -> SERVER IS MARKED DEAD
-Error 36 -> ENCOUNTERED AN UNKNOWN STAT KEY