Updating interface. Removed function calls where not needed.
author <brian@gir.tangent.org> <>
Sat, 22 Mar 2008 22:26:03 +0000 (15:26 -0700)
committer <brian@gir.tangent.org> <>
Sat, 22 Mar 2008 22:26:03 +0000 (15:26 -0700)
ChangeLog
libmemcached/memcached_storage.c

index fd539d399eed0395a00358f674a7ab3dc5756b24..9eadd965e6f394a78282b3cce9484bf1ecb7484f 100644 (file)
--- 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
index 0f6daa4ec1fa2b5568ad762730c25ef8b1867ef8..3645952af6a0a5238a0d737e1c3c34a9156256b2 100644 (file)
@@ -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;
-}