From: Brian Aker Date: Mon, 22 Jun 2009 01:47:19 +0000 (-0700) Subject: Merging Trond, also fixed make test. X-Git-Tag: 0.31~13 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=ef9ddf55563059fcf3608bab479e15f28e9ceb0f;hp=f63d634e21459280599f663154089fa724903bd6;p=m6w6%2Flibmemcached Merging Trond, also fixed make test. --- diff --git a/libmemcached/memcached_callback.c b/libmemcached/memcached_callback.c index de792d0e..3433585c 100644 --- a/libmemcached/memcached_callback.c +++ b/libmemcached/memcached_callback.c @@ -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; diff --git a/libmemcached/memcached_constants.h b/libmemcached/memcached_constants.h index 5fdede9a..5d0e31d0 100644 --- a/libmemcached/memcached_constants.h +++ b/libmemcached/memcached_constants.h @@ -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 { diff --git a/tests/function.c b/tests/function.c index c505b111..8728ccd4 100644 --- a/tests/function.c +++ b/tests/function.c @@ -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}, diff --git a/tests/output.res b/tests/output.res index 3a2ed00e..c2a6e946 100644 --- a/tests/output.res +++ b/tests/output.res @@ -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