5 #include <ctu_std_api.h>
#define CT_PUREFN
mark a function as pure, always returns the same value for the same arguments
#define CT_NODISCARD
mark a function as returning a value that must be used
#define IN_NOTNULL
annotate a parameter as not being null
#define IN_DOMAIN(cmp, it)
annotate a parameter as being bounded by the expression of cmp and it
CT_NODISCARD CT_STD_API set_t * set_new(size_t size, hash_info_t info, arena_t *arena)
create a new set
CT_NODISCARD CT_PUREFN CT_STD_API bool set_empty(set_t *set)
check if a set is empty
CT_STD_API const void * set_add(set_t *set, const void *key)
add a key to a set
CT_STD_API void set_reset(set_t *set)
clear all keys from a set
CT_STD_API void set_delete(set_t *set, const void *key)
remove a key from a set
CT_NODISCARD CT_PUREFN CT_STD_API set_iter_t set_iter(set_t *set)
acquire a set iterator for a set
CT_NODISCARD CT_STD_API const void * set_next(set_iter_t *iter)
get the next item from a set iterator
CT_NODISCARD CT_PUREFN CT_STD_API bool set_contains(const set_t *set, const void *key)
check if a set contains a key
CT_NODISCARD CT_PUREFN CT_STD_API bool set_has_next(set_iter_t *iter)
check if a set iterator has more items
information for using a type in a hashset or hashmap
a node in a chain of set entries
const void * key
the key to this bucket
item_t * next
the next item
item_t * current
the current item
size_t index
the current bucket index
set_t * set
the set to iterate over