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 +--------------------------------------------------------------------+
21 HASHKIT_MEMORY_ALLOCATION_FAILURE
,
23 HASHKIT_INVALID_ARGUMENT
,
24 HASHKIT_MAXIMUM_RETURN
/* Always add new error code before */
27 static inline bool hashkit_success(const hashkit_return_t rc
) {
28 return (rc
== HASHKIT_SUCCESS
);
31 static inline bool hashkit_failed(const hashkit_return_t rc
) {
32 return (rc
!= HASHKIT_SUCCESS
);
36 HASHKIT_HASH_DEFAULT
= 0, // hashkit_one_at_a_time()
40 HASHKIT_HASH_FNV1A_64
,
42 HASHKIT_HASH_FNV1A_32
,
49 } hashkit_hash_algorithm_t
;
52 * Hash distributions that are available to use.
55 HASHKIT_DISTRIBUTION_MODULA
,
56 HASHKIT_DISTRIBUTION_RANDOM
,
57 HASHKIT_DISTRIBUTION_KETAMA
,
58 HASHKIT_DISTRIBUTION_MAX
/* Always add new values before this. */
59 } hashkit_distribution_t
;
65 typedef struct hashkit_st hashkit_st
;
66 typedef struct hashkit_string_st hashkit_string_st
;
68 typedef uint32_t (*hashkit_hash_fn
)(const char *key
, size_t key_length
, void *context
);