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