Tinyhash
This is a library containing multiple C implementations of hashmap.
Loading...
Searching...
No Matches
src
common
key.h
Go to the documentation of this file.
1
#ifndef __TINYHASH_COMMON_KEY_H__
2
#define __TINYHASH_COMMON_KEY_H__
3
4
#include <stdbool.h>
5
#include <stdint.h>
6
#include <stdio.h>
7
8
#include "
types.h
"
9
14
typedef
struct
{
15
uint32_t
hash
;
16
size_t
size
;
17
th_any_t
data
;
18
}
th_key_t
;
19
28
th_key_t
th_key_create
(
th_any_t
data,
size_t
size);
29
38
bool
th_key_is_equal
(
th_key_t
*first,
th_key_t
*second);
39
40
#endif
th_key_create
th_key_t th_key_create(th_any_t data, size_t size)
Create a key struct from data and size, it will automatically compute its hash.
Definition
key.c:6
th_key_is_equal
bool th_key_is_equal(th_key_t *first, th_key_t *second)
Key comparator function.
Definition
key.c:14
th_key_t
Represent an entry key.
Definition
key.h:14
th_key_t::hash
uint32_t hash
Definition
key.h:15
th_key_t::data
th_any_t data
Definition
key.h:17
th_key_t::size
size_t size
Definition
key.h:16
types.h
th_any_t
void * th_any_t
Represent any type of data.
Definition
types.h:8
Generated by
1.10.0