ptr->on_clone= func;
break;
}
+#ifdef MEMCACHED_ENABLE_DEPRECATED
case MEMCACHED_CALLBACK_MALLOC_FUNCTION:
{
memcached_malloc_function func= *(memcached_malloc_function *)&data;
ptr->call_free= func;
break;
}
+#endif
case MEMCACHED_CALLBACK_GET_FAILURE:
{
memcached_trigger_key func= *(memcached_trigger_key *)&data;
*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;
*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;
} 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 {
return MEMCACHED_SUCCESS;
}
+#ifdef MEMCACHED_ENABLE_DEPRECATED
static memcached_return deprecated_set_memory_alloc(memcached_st *memc)
{
void *test_ptr= NULL;
}
return MEMCACHED_SUCCESS;
}
+#endif
static memcached_return set_memory_alloc(memcached_st *memc)
{
{"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},
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