X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fmemcached_storage.c;h=3645952af6a0a5238a0d737e1c3c34a9156256b2;hb=d77f982dc42cd474dc677dec96e90f5e8d50a488;hp=0f6daa4ec1fa2b5568ad762730c25ef8b1867ef8;hpb=e46de6497d3b9c26c4ae6c44acfdfa1582ccf8bc;p=awesomized%2Flibmemcached 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; -}