Tinyhash
This is a library containing multiple C implementations of hashmap.
Loading...
Searching...
No Matches
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
14typedef struct {
15 uint32_t hash;
16 size_t size;
18} th_key_t;
19
28th_key_t th_key_create(th_any_t data, size_t size);
29
38bool th_key_is_equal(th_key_t *first, th_key_t *second);
39
40#endif
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
bool th_key_is_equal(th_key_t *first, th_key_t *second)
Key comparator function.
Definition key.c:14
Represent an entry key.
Definition key.h:14
uint32_t hash
Definition key.h:15
th_any_t data
Definition key.h:17
size_t size
Definition key.h:16
void * th_any_t
Represent any type of data.
Definition types.h:8