Merging replication
[awesomized/libmemcached] / libmemcached / memcached.h
index 370643150d1fa44308ac0654411ae214e348e348..9ac0df70e42b585ba4a3425b5ce578128c560004 100644 (file)
@@ -21,6 +21,7 @@
 #ifdef MEMCACHED_INTERNAL
 #include <libmemcached/libmemcached_config.h>
 #endif
+#include <libmemcached/memcached_configure.h>
 #include <libmemcached/memcached_constants.h>
 #include <libmemcached/memcached_types.h>
 #include <libmemcached/memcached_watchpoint.h>
@@ -42,7 +43,7 @@ struct memcached_continuum_item_st {
   uint32_t value;
 };
 
-#define LIBMEMCACHED_VERSION_STRING "0.29"
+#define LIBMEMCACHED_VERSION_STRING "0.30"
 
 struct memcached_analysis_st {
   uint32_t average_item_size;
@@ -85,7 +86,10 @@ struct memcached_stat_st {
 struct memcached_st {
   uint8_t purging;
   bool is_allocated;
+  uint8_t distribution;
+  uint8_t hash;
   uint32_t continuum_points_counter;
+  memcached_server_st *hosts;
   int32_t snd_timeout;
   int32_t rcv_timeout;
   uint32_t server_failure_limit;
@@ -100,25 +104,24 @@ struct memcached_st {
   int32_t connect_timeout;
   int32_t retry_timeout;
   uint32_t continuum_count;
-  memcached_hash hash;
   int send_size;
   int recv_size;
-  memcached_server_st *hosts;
   void *user_data;
   time_t next_distribution_rebuild;
   size_t prefix_key_length;
+  memcached_hash hash_continuum;
   memcached_result_st result;
-  memcached_server_distribution distribution;
   memcached_continuum_item_st *continuum;
   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;
+  memcached_calloc_function call_calloc;
   memcached_trigger_key get_key_failure;
   memcached_trigger_delete_key delete_trigger;
   char prefix_key[MEMCACHED_PREFIX_KEY_MAX_SIZE];
-  memcached_hash hash_continuum;
+  uint32_t number_of_replicas;
 };
 
 
@@ -163,7 +166,11 @@ void memcached_quit(memcached_st *ptr);
 char *memcached_strerror(memcached_st *ptr, memcached_return rc);
 memcached_return memcached_behavior_set(memcached_st *ptr, memcached_behavior flag, uint64_t data);
 uint64_t memcached_behavior_get(memcached_st *ptr, memcached_behavior flag);
+
+/* The two public hash bits */
 uint32_t memcached_generate_hash_value(const char *key, size_t key_length, memcached_hash hash_algorithm);
+uint32_t memcached_generate_hash(memcached_st *ptr, const char *key, size_t key_length);
+
 memcached_return memcached_flush_buffers(memcached_st *mem);
 
 /* Server Public functions */
@@ -226,10 +233,29 @@ void *memcached_callback_get(memcached_st *ptr,
 memcached_return memcached_dump(memcached_st *ptr, memcached_dump_func *function, void *context, uint32_t number_of_callbacks);
 
 
+memcached_return memcached_set_memory_allocators(memcached_st *ptr,
+                                                 memcached_malloc_function mem_malloc,
+                                                 memcached_free_function mem_free,
+                                                 memcached_realloc_function mem_realloc,
+                                                 memcached_calloc_function mem_calloc);
+
+void memcached_get_memory_allocators(memcached_st *ptr,
+                                     memcached_malloc_function *mem_malloc,
+                                     memcached_free_function *mem_free,
+                                     memcached_realloc_function *mem_realloc,
+                                     memcached_calloc_function *mem_calloc);
+
+void *memcached_get_user_data(memcached_st *ptr);
+void *memcached_set_user_data(memcached_st *ptr, void *data);
+
 #ifdef __cplusplus
 }
 #endif
 
 #include <libmemcached/memcached_storage.h>
 
+#ifdef MEMCACHED_INTERNAL
+#include <libmemcached/memcached_internal.h>
+#endif
+
 #endif /* __MEMCACHED_H__ */