KronkNet 1.0
Loading...
Searching...
No Matches
hashmap.h
1/*
2** FREE PROJECT, 2026
3** KRONKNET
4** File description:
5** Header file for KRONKNET, a simple ring-buffer library in C.
6*/
7#ifndef KRONKNET_HASHMAP_IMPL_H
8 #define KRONKNET_HASHMAP_IMPL_H
9 #include "kronknet/utils/hashmap/hashmap.h"
10 #include <stddef.h>
11 #include <stdint.h>
12
14
15 uint64_t key;
16 uint64_t hash;
17 void* data;
20 knMapDeleter deleter;
21
22} knMapNode;
23
24// NOTE: Using for UDP mode in kronknet
25typedef struct kronknet_hashmap_s {
26
27 size_t inserted;
28 size_t size;
29 knMapNode** raw;
30 knMapHash hash;
31
32} knMap;
33
34int knMap_reHash(knMap* map, size_t newSize);
35
36#endif /* KRONKNET_HASHMAP_IMPL_H */
Definition hashmap.h:13
void * data
The connection data ptr.
Definition hashmap.h:17
struct kronknet_hashmap_node_s * next
The next node.
Definition hashmap.h:18
uint64_t hash
The hash (to overwring).
Definition hashmap.h:16
struct kronknet_hashmap_node_s * prev
The previous node.
Definition hashmap.h:19
knMapDeleter deleter
How to clear this data.
Definition hashmap.h:20
uint64_t key
The unhashed key.
Definition hashmap.h:15
Definition hashmap.h:25
size_t inserted
The nbr of insterted data.
Definition hashmap.h:27
size_t size
The size of the hashmap.
Definition hashmap.h:28
knMapHash hash
The hash function.
Definition hashmap.h:30
knMapNode ** raw
The raw array of nodes.
Definition hashmap.h:29