semver: 1.0 -> 1
[m6w6/libmemcached] / include / libhashkit-1 / function.h
1 /*
2 +--------------------------------------------------------------------+
3 | libmemcached - C/C++ Client Library for memcached |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted under the terms of the BSD license. |
7 | You should have received a copy of the license in a bundled file |
8 | named LICENSE; in case you did not receive a copy you can review |
9 | the terms online at: https://opensource.org/licenses/BSD-3-Clause |
10 +--------------------------------------------------------------------+
11 | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ |
12 | Copyright (c) 2020 Michael Wallner <mike@php.net> |
13 +--------------------------------------------------------------------+
14 */
15
16 #pragma once
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 /**
23 This sets/gets the default function we will be using.
24 */
25 HASHKIT_API
26 hashkit_return_t hashkit_set_function(hashkit_st *hash, hashkit_hash_algorithm_t hash_algorithm);
27
28 HASHKIT_API
29 hashkit_return_t hashkit_set_custom_function(hashkit_st *hash, hashkit_hash_fn function,
30 void *context);
31
32 HASHKIT_API
33 hashkit_hash_algorithm_t hashkit_get_function(const hashkit_st *hash);
34
35 /**
36 This sets/gets the function we use for distribution.
37 */
38 HASHKIT_API
39 hashkit_return_t hashkit_set_distribution_function(hashkit_st *hash,
40 hashkit_hash_algorithm_t hash_algorithm);
41
42 HASHKIT_API
43 hashkit_return_t hashkit_set_custom_distribution_function(hashkit_st *self,
44 hashkit_hash_fn function, void *context);
45
46 HASHKIT_API
47 hashkit_hash_algorithm_t hashkit_get_distribution_function(const hashkit_st *self);
48
49 #ifdef __cplusplus
50 }
51 #endif