aboutsummaryrefslogtreecommitdiff
path: root/hashtable.h
blob: 21467a857bb9693c7515794e81c69a1f7c75a662 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#pragma once

#include "global.h"


struct hashtable;

struct hashtable* ht_alloc();
void ht_free(struct hashtable *ht);

void ht_insert(struct hashtable *ht, u64 key, void *value);

// Returns NULL if key is not present in the table.
void* ht_find(const struct hashtable *ht, u64 key);

// Does nothing if the key is not present in the table.
void ht_delete(struct hashtable *ht, u64 key);