Libft
Custom implementation of core libc functions with additional utility helpers.
Loading...
Searching...
No Matches
priv_hashmap.h
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* priv_hashmap.h :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: gastesan <gastesan@student.42.fr> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2026/06/11 15:36:16 by adouieb #+# #+# */
9/* Updated: 2026/06/28 14:38:27 by gastesan ### ########.fr */
10/* */
11/* ************************************************************************** */
12
13#ifndef PRIV_HASHMAP_H
14# define PRIV_HASHMAP_H
15
16# include "libft.h"
17
27size_t hash_string(const char *key);
28
29// TODO: doc
30bool hashmap_need_resize(t_hashmap *map, const char *key);
31
46bool hashmap_resize(t_hashmap *map);
47
63bool hashmap_insert(t_hashmap *map, t_key_value *new);
64
65#endif
bool hashmap_resize(t_hashmap *map)
Doubles the bucket capacity and rehashes every stored pair.
Definition resize.c:58
bool hashmap_insert(t_hashmap *map, t_key_value *new)
Inserts a pair into the map, or replaces an existing one.
Definition insert.c:16
size_t hash_string(const char *key)
Default string hash function (djb2).
Definition hash_function.c:15
bool hashmap_need_resize(t_hashmap *map, const char *key)
Definition resize.c:17
Separate-chaining hash map keyed by NUL-terminated strings.
Definition libft.h:216
Key/value pair stored inside a hashmap bucket.
Definition libft.h:192