Retro Rocket Kernel
BASIC-Powered Operating System
hashmap.h File Reference
#include "kernel.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

Functions

struct hashmap * hashmap_new (size_t elsize, size_t cap, uint64_t seed0, uint64_t seed1, uint64_t(*hash)(const void *item, uint64_t seed0, uint64_t seed1), int(*compare)(const void *a, const void *b, void *udata), void(*elfree)(const void *item), void *udata)
 
struct hashmap * hashmap_new_with_allocator (void *(*malloc)(size_t), void *(*realloc)(void *, size_t), void(*free)(const void *), size_t elsize, size_t cap, uint64_t seed0, uint64_t seed1, uint64_t(*hash)(const void *item, uint64_t seed0, uint64_t seed1), int(*compare)(const void *a, const void *b, void *udata), void(*elfree)(const void *item), void *udata)
 
void hashmap_free (struct hashmap *map)
 
void hashmap_clear (struct hashmap *map, bool update_cap)
 
size_t hashmap_count (struct hashmap *map)
 
bool hashmap_oom (struct hashmap *map)
 
void * hashmap_get (struct hashmap *map, const void *item)
 
void * hashmap_set (struct hashmap *map, const void *item)
 
void * hashmap_delete (struct hashmap *map, void *item)
 
void * hashmap_probe (struct hashmap *map, uint64_t position)
 
bool hashmap_scan (struct hashmap *map, bool(*iter)(const void *item, void *udata), void *udata)
 
bool hashmap_iter (struct hashmap *map, size_t *i, void **item)
 
uint64_t hashmap_sip (const void *data, size_t len, uint64_t seed0, uint64_t seed1)
 
uint64_t hashmap_murmur (const void *data, size_t len, uint64_t seed0, uint64_t seed1)
 
void hashmap_set_allocator (void *(*malloc)(size_t), void(*free)(const void *))
 

Function Documentation

◆ hashmap_clear()

void hashmap_clear ( struct hashmap *  map,
bool  update_cap 
)

◆ hashmap_count()

size_t hashmap_count ( struct hashmap *  map)

◆ hashmap_delete()

void* hashmap_delete ( struct hashmap *  map,
void *  item 
)

◆ hashmap_free()

void hashmap_free ( struct hashmap *  map)

◆ hashmap_get()

void* hashmap_get ( struct hashmap *  map,
const void *  item 
)

◆ hashmap_iter()

bool hashmap_iter ( struct hashmap *  map,
size_t *  i,
void **  item 
)

◆ hashmap_murmur()

uint64_t hashmap_murmur ( const void *  data,
size_t  len,
uint64_t  seed0,
uint64_t  seed1 
)

◆ hashmap_new()

struct hashmap* hashmap_new ( size_t  elsize,
size_t  cap,
uint64_t  seed0,
uint64_t  seed1,
uint64_t(*)(const void *item, uint64_t seed0, uint64_t seed1)  hash,
int(*)(const void *a, const void *b, void *udata)  compare,
void(*)(const void *item)  elfree,
void *  udata 
)

◆ hashmap_new_with_allocator()

struct hashmap* hashmap_new_with_allocator ( void *(*)(size_t)  malloc,
void *(*)(void *, size_t)  realloc,
void(*)(const void *)  free,
size_t  elsize,
size_t  cap,
uint64_t  seed0,
uint64_t  seed1,
uint64_t(*)(const void *item, uint64_t seed0, uint64_t seed1)  hash,
int(*)(const void *a, const void *b, void *udata)  compare,
void(*)(const void *item)  elfree,
void *  udata 
)

◆ hashmap_oom()

bool hashmap_oom ( struct hashmap *  map)

◆ hashmap_probe()

void* hashmap_probe ( struct hashmap *  map,
uint64_t  position 
)

◆ hashmap_scan()

bool hashmap_scan ( struct hashmap *  map,
bool(*)(const void *item, void *udata)  iter,
void *  udata 
)

◆ hashmap_set()

void* hashmap_set ( struct hashmap *  map,
const void *  item 
)

◆ hashmap_set_allocator()

void hashmap_set_allocator ( void *(*)(size_t)  malloc,
void(*)(const void *)  free 
)

◆ hashmap_sip()

uint64_t hashmap_sip ( const void *  data,
size_t  len,
uint64_t  seed0,
uint64_t  seed1 
)