Zephyr API 3.6.99
Loading...
Searching...
No Matches
hash_map_sc.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Meta
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
15#ifndef ZEPHYR_INCLUDE_SYS_HASH_MAP_SC_H_
16#define ZEPHYR_INCLUDE_SYS_HASH_MAP_SC_H_
17
18#include <stdbool.h>
19#include <stddef.h>
20#include <stdint.h>
21#include <stdlib.h>
22
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
43#define SYS_HASHMAP_SC_DEFINE_ADVANCED(_name, _hash_func, _alloc_func, ...) \
44 SYS_HASHMAP_DEFINE_ADVANCED(_name, &sys_hashmap_sc_api, sys_hashmap_config, \
45 sys_hashmap_data, _hash_func, _alloc_func, __VA_ARGS__)
46
60#define SYS_HASHMAP_SC_DEFINE_STATIC_ADVANCED(_name, _hash_func, _alloc_func, ...) \
61 SYS_HASHMAP_DEFINE_STATIC_ADVANCED(_name, &sys_hashmap_sc_api, sys_hashmap_config, \
62 sys_hashmap_data, _hash_func, _alloc_func, __VA_ARGS__)
63
71#define SYS_HASHMAP_SC_DEFINE_STATIC(_name) \
72 SYS_HASHMAP_SC_DEFINE_STATIC_ADVANCED( \
73 _name, sys_hash32, SYS_HASHMAP_DEFAULT_ALLOCATOR, \
74 SYS_HASHMAP_CONFIG(SIZE_MAX, SYS_HASHMAP_DEFAULT_LOAD_FACTOR))
75
83#define SYS_HASHMAP_SC_DEFINE(_name) \
84 SYS_HASHMAP_SC_DEFINE_ADVANCED( \
85 _name, sys_hash32, SYS_HASHMAP_DEFAULT_ALLOCATOR, \
86 SYS_HASHMAP_CONFIG(SIZE_MAX, SYS_HASHMAP_DEFAULT_LOAD_FACTOR))
87
88#ifdef CONFIG_SYS_HASH_MAP_CHOICE_SC
89#define SYS_HASHMAP_DEFAULT_DEFINE(_name) SYS_HASHMAP_SC_DEFINE(_name)
90#define SYS_HASHMAP_DEFAULT_DEFINE_STATIC(_name) SYS_HASHMAP_SC_DEFINE_STATIC(_name)
91#define SYS_HASHMAP_DEFAULT_DEFINE_ADVANCED(_name, _hash_func, _alloc_func, ...) \
92 SYS_HASHMAP_SC_DEFINE_ADVANCED(_name, _hash_func, _alloc_func, __VA_ARGS__)
93#define SYS_HASHMAP_DEFAULT_DEFINE_STATIC_ADVANCED(_name, _hash_func, _alloc_func, ...) \
94 SYS_HASHMAP_SC_DEFINE_STATIC_ADVANCED(_name, _hash_func, _alloc_func, __VA_ARGS__)
95#endif
96
97extern const struct sys_hashmap_api sys_hashmap_sc_api;
98
99#ifdef __cplusplus
100}
101#endif
102
103#endif /* ZEPHYR_INCLUDE_SYS_HASH_MAP_SC_H_ */
const struct sys_hashmap_api sys_hashmap_sc_api
Generic Hashmap API.
Definition hash_map_api.h:168