-typedef enum {
- MEM_NO_BLOCK= (1 << 0),
- MEM_TCP_NODELAY= (1 << 1),
- MEM_REUSE_MEMORY= (1 << 2),
- MEM_USE_MD5= (1 << 3),
- /* 4 was once Ketama */
- MEM_USE_CRC= (1 << 5),
- MEM_USE_CACHE_LOOKUPS= (1 << 6),
- MEM_SUPPORT_CAS= (1 << 7),
- MEM_BUFFER_REQUESTS= (1 << 8),
- MEM_USE_SORT_HOSTS= (1 << 9),
- MEM_VERIFY_KEY= (1 << 10),
- /* 11 used for weighted ketama */
- MEM_KETAMA_WEIGHTED= (1 << 11),
- MEM_BINARY_PROTOCOL= (1 << 12),
-} memcached_flags;
-
-/* Hashing algo */
-void md5_signature(const unsigned char *key, unsigned int length, unsigned char *result);
-uint32_t hash_crc32(const char *data,
- size_t data_len);
-uint32_t hsieh_hash(const char *key, size_t key_length);
-uint32_t murmur_hash(const char *key, size_t key_length);
-
-memcached_return memcached_connect(memcached_server_st *ptr);
-memcached_return memcached_response(memcached_server_st *ptr,
- char *buffer, size_t buffer_length,
- memcached_result_st *result);
-uint32_t memcached_generate_hash(memcached_st *ptr, const char *key, size_t key_length);
-void memcached_quit_server(memcached_server_st *ptr, uint8_t io_death);
-
-#define memcached_server_response_increment(A) (A)->cursor_active++
-#define memcached_server_response_decrement(A) (A)->cursor_active--
-#define memcached_server_response_reset(A) (A)->cursor_active=0
-
-memcached_return memcached_do(memcached_server_st *ptr, const void *commmand,
- size_t command_length, uint8_t with_flush);
-memcached_return memcached_version(memcached_st *ptr);
-memcached_return value_fetch(memcached_server_st *ptr,
- char *buffer,
- memcached_result_st *result);
-void server_list_free(memcached_st *ptr, memcached_server_st *servers);
-
-memcached_return memcachd_key_test(char **keys, size_t *key_length,
- unsigned int number_of_keys);
-
-memcached_return run_distribution(memcached_st *ptr);
-
-uint32_t generate_hash_value(const char *key, size_t key_length, memcached_hash hash_algorithm);
-
-uint32_t generate_hash(memcached_st *ptr, const char *key, size_t key_length);
-memcached_return server_remove(memcached_server_st *st_ptr);
-
-extern uint64_t ntohll(uint64_t);
-extern uint64_t htonll(uint64_t);
-
-#endif /* __COMMON_H__ */
+memcached_return_t run_distribution(memcached_st *ptr);
+
+#define memcached_server_response_increment(A) (A)->cursor_active_++
+#define memcached_server_response_decrement(A) (A)->cursor_active_--
+#define memcached_server_response_reset(A) (A)->cursor_active_=0
+
+#define memcached_instance_response_increment(A) (A)->cursor_active_++
+#define memcached_instance_response_decrement(A) (A)->cursor_active_--
+#define memcached_instance_response_reset(A) (A)->cursor_active_=0
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef __cplusplus
+bool memcached_purge(org::libmemcached::Instance*);
+org::libmemcached::Instance* memcached_instance_by_position(const memcached_st *ptr, uint32_t server_key);
+#endif