Add support for query_id, and fixes a few cases where programmer error can
[awesomized/libmemcached] / libmemcached / behavior.h
1 /* LibMemcached
2 * Copyright (C) 2006-2009 Brian Aker
3 * All rights reserved.
4 *
5 * Use and distribution licensed under the BSD license. See
6 * the COPYING file in the parent directory for full text.
7 *
8 * Summary: Change the behavior of the memcached connection.
9 *
10 */
11
12 #ifndef __LIBMEMCACHED_BEHAVIOR_H__
13 #define __LIBMEMCACHED_BEHAVIOR_H__
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 LIBMEMCACHED_API
20 memcached_return_t memcached_behavior_set(memcached_st *ptr, const memcached_behavior_t flag, uint64_t data);
21
22 LIBMEMCACHED_API
23 uint64_t memcached_behavior_get(memcached_st *ptr, const memcached_behavior_t flag);
24
25 LIBMEMCACHED_API
26 memcached_return_t memcached_behavior_set_distribution(memcached_st *ptr, memcached_server_distribution_t type);
27
28 LIBMEMCACHED_API
29 memcached_server_distribution_t memcached_behavior_get_distribution(memcached_st *ptr);
30
31 LIBMEMCACHED_API
32 memcached_return_t memcached_behavior_set_key_hash(memcached_st *ptr, memcached_hash_t type);
33
34 LIBMEMCACHED_API
35 memcached_hash_t memcached_behavior_get_key_hash(memcached_st *ptr);
36
37 LIBMEMCACHED_API
38 memcached_return_t memcached_behavior_set_distribution_hash(memcached_st *ptr, memcached_hash_t type);
39
40 LIBMEMCACHED_API
41 memcached_hash_t memcached_behavior_get_distribution_hash(memcached_st *ptr);
42
43 LIBMEMCACHED_LOCAL
44 bool _is_auto_eject_host(const memcached_st *ptr);
45
46 LIBMEMCACHED_LOCAL
47 const char *libmemcached_string_behavior(const memcached_behavior_t flag);
48
49 LIBMEMCACHED_LOCAL
50 const char *libmemcached_string_distribution(const memcached_server_distribution_t flag);
51
52 LIBMEMCACHED_API
53 memcached_return_t memcached_bucket_set(memcached_st *self,
54 const uint32_t *host_map,
55 const uint32_t *forward_map,
56 const uint32_t buckets,
57 const uint32_t replicas);
58
59 #ifdef __cplusplus
60 }
61 #endif
62
63 #endif /* __LIBMEMCACHED_BEHAVIOR_H__ */