docs: sanitize
[awesomized/libmemcached] / docs / source / libhashkit / hashkit_function.rst
1 Set Hash Function
2 =================
3
4 SYNOPSIS
5 --------
6
7 #include <libhashkit-|libhashkit_version|/hashkit.h>
8 Compile and link with -lhashkit
9
10 .. type:: uint32_t (*hashkit_hash_fn)(const char *key, size_t key_length, void *context)
11
12 .. function:: hashkit_return_t hashkit_set_function(hashkit_st *hash, hashkit_hash_algorithm_t hash_algorithm)
13
14 .. function:: hashkit_return_t hashkit_set_custom_function(hashkit_st *hash, hashkit_hash_fn function, void *context)
15
16 .. function:: hashkit_hash_algorithm_t hashkit_get_function(const hashkit_st *hash)
17
18 .. function:: hashkit_return_t hashkit_set_distribution_function(hashkit_st *hash, hashkit_hash_algorithm_t hash_algorithm)
19
20 .. function:: hashkit_return_t hashkit_set_custom_distribution_function(hashkit_st *self, hashkit_hash_fn function, void *context)
21
22 .. function:: hashkit_hash_algorithm_t hashkit_get_distribution_function(const hashkit_st *self)
23
24 DESCRIPTION
25 -----------
26
27 These functions are used to set and retrieve the key and distribution hash functions.
28
29 RETURN VALUE
30 ------------
31
32 `hashkit_set_function`, `hashkit_set_custom_function` and the distribution
33 equivalents return `hashkit_return_t` `HASHKIT_SUCCESS` on success.
34
35 `hashkit_get_function` and `hashkit_get_distribution_function` return
36 `hashkit_hash_algorithm_t` indicating the hash function used.
37
38 SEE ALSO
39 --------
40
41 .. only:: man
42
43 :manpage:`libhashkit(3)`
44 :manpage:`hashkit_create(3)`
45 :manpage:`hashkit_functions(3)`
46
47 .. only:: html
48
49 * :doc:`../libhashkit`
50 * :doc:`hashkit_create`
51 * :doc:`hashkit_functions`
52