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},