From: Date: Sat, 22 Mar 2008 22:26:03 +0000 (-0700) Subject: Updating interface. Removed function calls where not needed. X-Git-Tag: 0.20~1^2~39 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=7f29090240ac387635a3369abaf6425cf020fb33;p=awesomized%2Flibmemcached Updating interface. Removed function calls where not needed. --- diff --git a/ChangeLog b/ChangeLog index fd539d39..9eadd965 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ * Fixed for cas by key operation. * Fix for memcached_server_st list structures to have correct count. * Added callback MEMCACHED_CALLBACK_DELETE_TRIGGER + * Removed function call in favor of macro (aka cut out some instructions) 0.18 Sun Mar 16 21:57:55 PDT 2008 diff --git a/libmemcached/memcached_storage.c b/libmemcached/memcached_storage.c index 0f6daa4e..3645952a 100644 --- a/libmemcached/memcached_storage.c +++ b/libmemcached/memcached_storage.c @@ -8,16 +8,6 @@ */ #include "common.h" -#include "memcached_io.h" - -typedef enum { - SET_OP, - REPLACE_OP, - ADD_OP, - PREPEND_OP, - APPEND_OP, - CAS_OP, -} memcached_storage_action; /* Inline this */ static char *storage_op_string(memcached_storage_action verb) @@ -41,14 +31,14 @@ static char *storage_op_string(memcached_storage_action verb) return SET_OP; } -static inline memcached_return memcached_send(memcached_st *ptr, - char *master_key, size_t master_key_length, - char *key, size_t key_length, - char *value, size_t value_length, - time_t expiration, - uint32_t flags, - uint64_t cas, - memcached_storage_action verb) +memcached_return memcached_send(memcached_st *ptr, + char *master_key, size_t master_key_length, + char *key, size_t key_length, + char *value, size_t value_length, + time_t expiration, + uint32_t flags, + uint64_t cas, + memcached_storage_action verb) { char to_write; size_t write_length; @@ -125,178 +115,3 @@ error: return rc; } - -memcached_return memcached_set(memcached_st *ptr, char *key, size_t key_length, - char *value, size_t value_length, - time_t expiration, - uint32_t flags) -{ - memcached_return rc; - LIBMEMCACHED_MEMCACHED_SET_START(); - rc= memcached_send(ptr, key, key_length, - key, key_length, value, value_length, - expiration, flags, 0, SET_OP); - LIBMEMCACHED_MEMCACHED_SET_END(); - return rc; -} - -memcached_return memcached_add(memcached_st *ptr, - char *key, size_t key_length, - char *value, size_t value_length, - time_t expiration, - uint32_t flags) -{ - memcached_return rc; - LIBMEMCACHED_MEMCACHED_ADD_START(); - rc= memcached_send(ptr, key, key_length, - key, key_length, value, value_length, - expiration, flags, 0, ADD_OP); - LIBMEMCACHED_MEMCACHED_ADD_END(); - return rc; -} - -memcached_return memcached_replace(memcached_st *ptr, - char *key, size_t key_length, - char *value, size_t value_length, - time_t expiration, - uint32_t flags) -{ - memcached_return rc; - LIBMEMCACHED_MEMCACHED_REPLACE_START(); - rc= memcached_send(ptr, key, key_length, - key, key_length, value, value_length, - expiration, flags, 0, REPLACE_OP); - LIBMEMCACHED_MEMCACHED_REPLACE_END(); - return rc; -} - -memcached_return memcached_prepend(memcached_st *ptr, - char *key, size_t key_length, - char *value, size_t value_length, - time_t expiration, - uint32_t flags) -{ - memcached_return rc; - rc= memcached_send(ptr, key, key_length, - key, key_length, value, value_length, - expiration, flags, 0, PREPEND_OP); - return rc; -} - -memcached_return memcached_append(memcached_st *ptr, - char *key, size_t key_length, - char *value, size_t value_length, - time_t expiration, - uint32_t flags) -{ - memcached_return rc; - rc= memcached_send(ptr, key, key_length, - key, key_length, value, value_length, - expiration, flags, 0, APPEND_OP); - return rc; -} - -memcached_return memcached_cas(memcached_st *ptr, - char *key, size_t key_length, - char *value, size_t value_length, - time_t expiration, - uint32_t flags, - uint64_t cas) -{ - memcached_return rc; - rc= memcached_send(ptr, key, key_length, - key, key_length, value, value_length, - expiration, flags, cas, CAS_OP); - return rc; -} - -memcached_return memcached_set_by_key(memcached_st *ptr, - char *master_key, size_t master_key_length, - char *key, size_t key_length, - char *value, size_t value_length, - time_t expiration, - uint32_t flags) -{ - memcached_return rc; - LIBMEMCACHED_MEMCACHED_SET_START(); - rc= memcached_send(ptr, key, key_length, - key, key_length, value, value_length, - expiration, flags, 0, SET_OP); - LIBMEMCACHED_MEMCACHED_SET_END(); - return rc; -} - -memcached_return memcached_add_by_key(memcached_st *ptr, - char *master_key, size_t master_key_length, - char *key, size_t key_length, - char *value, size_t value_length, - time_t expiration, - uint32_t flags) -{ - memcached_return rc; - LIBMEMCACHED_MEMCACHED_ADD_START(); - rc= memcached_send(ptr, key, key_length, - key, key_length, value, value_length, - expiration, flags, 0, ADD_OP); - LIBMEMCACHED_MEMCACHED_ADD_END(); - return rc; -} - -memcached_return memcached_replace_by_key(memcached_st *ptr, - char *master_key, size_t master_key_length, - char *key, size_t key_length, - char *value, size_t value_length, - time_t expiration, - uint32_t flags) -{ - memcached_return rc; - LIBMEMCACHED_MEMCACHED_REPLACE_START(); - rc= memcached_send(ptr, key, key_length, - key, key_length, value, value_length, - expiration, flags, 0, REPLACE_OP); - LIBMEMCACHED_MEMCACHED_REPLACE_END(); - return rc; -} - -memcached_return memcached_prepend_by_key(memcached_st *ptr, - char *master_key, size_t master_key_length, - char *key, size_t key_length, - char *value, size_t value_length, - time_t expiration, - uint32_t flags) -{ - memcached_return rc; - rc= memcached_send(ptr, key, key_length, - key, key_length, value, value_length, - expiration, flags, 0, PREPEND_OP); - return rc; -} - -memcached_return memcached_append_by_key(memcached_st *ptr, - char *master_key, size_t master_key_length, - char *key, size_t key_length, - char *value, size_t value_length, - time_t expiration, - uint32_t flags) -{ - memcached_return rc; - rc= memcached_send(ptr, key, key_length, - key, key_length, value, value_length, - expiration, flags, 0, APPEND_OP); - return rc; -} - -memcached_return memcached_cas_by_key(memcached_st *ptr, - char *master_key, size_t master_key_length, - char *key, size_t key_length, - char *value, size_t value_length, - time_t expiration, - uint32_t flags, - uint64_t cas) -{ - memcached_return rc; - rc= memcached_send(ptr, master_key, master_key_length, - key, key_length, value, value_length, - expiration, flags, cas, CAS_OP); - return rc; -}