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

#include "global.h"


struct hashtable;

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

// Overwrites if the key already exists in the table.
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);