t_hashset * hashset_new(const t_type *type)
Initializes a new empty set.
size_t capacity
The current capacity of the hashset.
void * ds_xcalloc(size_t count, size_t size)
Replicates behaviour of calloc from libc, but fails on memory allocation errors.
#define HASHSET_INIT_CAPACITY
The default initial capacity of a newly initialized hashset.
size_t(* hash)(const void *, size_t)
(optional) A function pointer used to get a hash value of this data type
A full representation of a data type, used to achieve polymorphism in the implementation of data stru...
A dynamically resizing linear-probing hashset.
void ds_exit_set(int err)
Set errno to the specified value, print the error message, and exit the process.
const t_type * type
The type of elements in the hashset.