1 | // SPDX-License-Identifier: GPL-3.0-or-later |
2 | |
3 | #pragma once |
4 | |
5 | #include <mos/moslib_global.h> |
6 | #include <mos/types.h> |
7 | |
8 | /** |
9 | * @defgroup libs_hashmap_commonfuncs libs.HashMap.Common |
10 | * @ingroup libs_hashmap |
11 | * @brief Common hash and comparison functions for hashmaps. |
12 | * @{ |
13 | */ |
14 | #define hashmap_common_type_init(map, cap, type) hashmap_init(map, cap, hashmap_hash_##type, hashmap_compare_##type) |
15 | |
16 | MOSAPI hash_t __pure hashmap_hash_string(uintn key); |
17 | MOSAPI int __pure hashmap_compare_string(uintn key1, uintn key2); |
18 | |
19 | MOSAPI int __pure hashmap_simple_key_compare(uintn key1, uintn key2); |
20 | |
21 | MOSAPI hash_t __pure hashmap_identity_hash(uintn key); |
22 | /** @} */ |
23 | |