data_structures
|
Go to the source code of this file.
Data Structures | |
struct | s_hashset |
A dynamically resizing linear-probing hashset. More... | |
Macros | |
#define | HASHSET_INIT_CAPACITY 51 |
The default initial capacity of a newly initialized hashset. More... | |
Typedefs | |
typedef struct s_hashset | t_hashset |
Functions | |
t_hashset * | hashset_new (const t_type *type) |
Initializes a new empty set. More... | |
void | hashset_put (t_hashset *hs, const void *val) |
Adds a copy of the specified element to the hashset. More... | |
t_queue * | hashset_vals (const t_hashset *hs) |
Returns a queue with all the elements in the set. More... | |
size_t | hashset_size (const t_hashset *hs) |
Returns the number of elements in this set. More... | |
void | hashset_delete (t_hashset *hs) |
Deletes this hashset and frees all its items and the associated data. More... | |
int | hashset_contains (const t_hashset *hs, const void *val) |
Is the specified element contained in the set? More... | |
void | hashset_remove (t_hashset *hs, const void *val) |
Removed the specified element from the set. More... | |
t_hashset * | hashset_copy (const t_hashset *hs) |
Copies the hashset and all it contents. More... | |
#define HASHSET_INIT_CAPACITY 51 |
int hashset_contains | ( | const t_hashset * | hs, |
const void * | val | ||
) |
Is the specified element contained in the set?
val | The value |
1
if the element is in the set, 0
otherwise Definition at line 17 of file hashset_contains.c.
Copies the hashset and all it contents.
Definition at line 16 of file hashset_copy.c.
void hashset_delete | ( | t_hashset * | hs | ) |
Deletes this hashset and frees all its items and the associated data.
Does nothing if the argument is NULL
.
Definition at line 16 of file hashset_delete.c.
Initializes a new empty set.
type | The type of items that this set can hold |
hash
function). Definition at line 16 of file hashset_new.c.
void hashset_put | ( | t_hashset * | hs, |
const void * | val | ||
) |
Adds a copy of the specified element to the hashset.
val | The value |
Definition at line 17 of file hashset_put.c.
void hashset_remove | ( | t_hashset * | hs, |
const void * | val | ||
) |
Removed the specified element from the set.
val | The value |
1
on success, 0
if the element is not in the set. Definition at line 32 of file hashset_remove.c.
size_t hashset_size | ( | const t_hashset * | hs | ) |
Returns the number of elements in this set.
Definition at line 16 of file hashset_size.c.
Returns a queue with all the elements in the set.
Definition at line 16 of file hashset_vals.c.