C++ interface bits for libhashkit
[m6w6/libmemcached] / libhashkit / function.h
1 /* HashKit
2 * Copyright (C) 2010 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
9 #ifndef HASHKIT_FUNCTION_H
10 #define HASHKIT_FUNCTION_H
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16 /**
17 This sets/gets the default function we will be using.
18 */
19 HASHKIT_API
20 hashkit_return_t hashkit_set_function(hashkit_st *hash, hashkit_hash_algorithm_t hash_algorithm);
21
22 HASHKIT_API
23 hashkit_return_t hashkit_set_custom_function(hashkit_st *hash, hashkit_hash_fn function, void *context);
24
25 HASHKIT_API
26 hashkit_hash_algorithm_t hashkit_get_function(const hashkit_st *hash);
27
28 /**
29 This sets/gets the function we use for distribution.
30 */
31 HASHKIT_API
32 hashkit_return_t hashkit_set_distribution_function(hashkit_st *hash, hashkit_hash_algorithm_t hash_algorithm);
33
34 HASHKIT_API
35 hashkit_return_t hashkit_set_custom_distribution_function(hashkit_st *self, hashkit_hash_fn function, void *context);
36
37 HASHKIT_API
38 hashkit_hash_algorithm_t hashkit_get_distribution_function(const hashkit_st *self);
39
40 #ifdef __cplusplus
41 }
42 #endif
43
44 #endif /* HASHKIT_FUNCTION_H */