From: Date: Sat, 19 Jan 2008 23:24:44 +0000 (-0500) Subject: Typed clone and cleanup functions with memcached_ prefixes, X-Git-Tag: 0.14~8^2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=21853f0b38535d7a5a13d3c68f481e9effe60da8;p=awesomized%2Flibmemcached Typed clone and cleanup functions with memcached_ prefixes, --- diff --git a/include/memcached.h b/include/memcached.h index aa93b3b3..a3721dee 100644 --- a/include/memcached.h +++ b/include/memcached.h @@ -72,8 +72,8 @@ typedef struct memcached_stat_st memcached_stat_st; typedef struct memcached_result_st memcached_result_st; typedef struct memcached_string_st memcached_string_st; typedef struct memcached_server_st memcached_server_st; -typedef memcached_return (*clone_func)(memcached_st *parent, memcached_st *clone); -typedef memcached_return (*cleanup_func)(memcached_st *ptr); +typedef memcached_return (*memcached_clone_func)(memcached_st *parent, memcached_st *clone); +typedef memcached_return (*memcached_cleanup_func)(memcached_st *ptr); typedef void (*memcached_free_function)(memcached_st *ptr, void *mem); typedef void *(*memcached_malloc_function)(memcached_st *ptr, const size_t size); typedef void *(*memcached_realloc_function)(memcached_st *ptr, void *mem, const size_t size); @@ -216,8 +216,8 @@ struct memcached_st { memcached_server_distribution distribution; void *user_data; unsigned int wheel[MEMCACHED_WHEEL_SIZE]; - clone_func on_clone; - cleanup_func on_cleanup; + memcached_clone_func on_clone; + memcached_cleanup_func on_cleanup; memcached_free_function call_free; memcached_malloc_function call_malloc; memcached_realloc_function call_realloc; diff --git a/lib/memcached_callback.c b/lib/memcached_callback.c index 5348183c..ad14300a 100644 --- a/lib/memcached_callback.c +++ b/lib/memcached_callback.c @@ -20,13 +20,13 @@ memcached_return memcached_callback_set(memcached_st *ptr, } case MEMCACHED_CALLBACK_CLEANUP_FUNCTION: { - cleanup_func func= (cleanup_func)data; + memcached_cleanup_func func= (memcached_cleanup_func)data; ptr->on_cleanup= func; break; } case MEMCACHED_CALLBACK_CLONE_FUNCTION: { - clone_func func= (clone_func)data; + memcached_clone_func func= (memcached_clone_func)data; ptr->on_clone= func; break; } diff --git a/tests/function.c b/tests/function.c index 3bff805c..a6781e26 100644 --- a/tests/function.c +++ b/tests/function.c @@ -975,23 +975,23 @@ uint8_t callback_test(memcached_st *memc) /* Test Clone Callback */ { - clone_func temp_function; + memcached_clone_func temp_function; memcached_return rc; rc= memcached_callback_set(memc, MEMCACHED_CALLBACK_CLONE_FUNCTION, clone_test_callback); assert(rc == MEMCACHED_SUCCESS); - temp_function= (clone_func)memcached_callback_get(memc, MEMCACHED_CALLBACK_CLONE_FUNCTION, &rc); + temp_function= (memcached_clone_func)memcached_callback_get(memc, MEMCACHED_CALLBACK_CLONE_FUNCTION, &rc); assert(temp_function == clone_test_callback); } /* Test Cleanup Callback */ { - cleanup_func temp_function; + memcached_cleanup_func temp_function; memcached_return rc; rc= memcached_callback_set(memc, MEMCACHED_CALLBACK_CLONE_FUNCTION, cleanup_test_callback); assert(rc == MEMCACHED_SUCCESS); - temp_function= (cleanup_func)memcached_callback_get(memc, MEMCACHED_CALLBACK_CLONE_FUNCTION, &rc); + temp_function= (memcached_cleanup_func)memcached_callback_get(memc, MEMCACHED_CALLBACK_CLONE_FUNCTION, &rc); assert(temp_function == cleanup_test_callback); }