Go to the documentation of this file.
19 # include <sys/types.h>
28 # define HASHSET_INIT_CAPACITY 51
void hashset_put(t_hashset *hs, const void *val)
Adds a copy of the specified element to the hashset.
t_hashset * hashset_copy(const t_hashset *hs)
Copies the hashset and all it contents.
size_t capacity
The current capacity of the hashset.
t_hashset * hashset_new(const t_type *type)
Initializes a new empty set.
void hashset_delete(t_hashset *hs)
Deletes this hashset and frees all its items and the associated data.
int hashset_contains(const t_hashset *hs, const void *val)
Is the specified element contained in the set?
Doubly-linked list of generic items.
A full representation of a data type, used to achieve polymorphism in the implementation of data stru...
size_t size
The number of elements in the hashset.
size_t hashset_size(const t_hashset *hs)
Returns the number of elements in this set.
t_queue * hashset_vals(const t_hashset *hs)
Returns a queue with all the elements in the set.
A dynamically resizing linear-probing hashset.
void hashset_remove(t_hashset *hs, const void *val)
Removed the specified element from the set.
const t_type * type
The type of elements in the hashset.