reactor-c
C Runtime for Lingua Franca
|
Functions | |
hashset_t | hashset_create (unsigned short nbits) |
Create a hashset instance. The returned value is a pointer. The caller must call hashset_destroy() to free allocated memory. | |
size_t | hashset_num_items (hashset_t set) |
Return the number of items in the hashset. | |
void | hashset_destroy (hashset_t set) |
Destroy the hashset instance, freeing allocated memory. | |
int | hashset_add (hashset_t set, void *item) |
Add a pointer to the hashset. Note that 0 and 1 are special values, meaning nil and deleted items. This function will return -1 indicating error if you try to add 0 or 1. This function may resize the hashset if it is approaching capacity. Returns zero if the item is already in the set and non-zero otherwise. | |
int | hashset_remove (hashset_t set, void *item) |
Remove an item from the hashset. Return non-zero if the item was removed and zero if the item is not on the hashset. | |
int | hashset_is_member (hashset_t set, void *item) |
Returns non-zero if the item is in the hashset and zero otherwise. | |
int hashset_add | ( | hashset_t | set, |
void * | item ) |
Add a pointer to the hashset. Note that 0 and 1 are special values, meaning nil and deleted items. This function will return -1 indicating error if you try to add 0 or 1. This function may resize the hashset if it is approaching capacity. Returns zero if the item is already in the set and non-zero otherwise.
hashset_t hashset_create | ( | unsigned short | nbits | ) |
Create a hashset instance. The returned value is a pointer. The caller must call hashset_destroy() to free allocated memory.
nbits | The log base 2 of the initial capacity of the hashset. |
void hashset_destroy | ( | hashset_t | set | ) |
Destroy the hashset instance, freeing allocated memory.
int hashset_is_member | ( | hashset_t | set, |
void * | item ) |
Returns non-zero if the item is in the hashset and zero otherwise.
size_t hashset_num_items | ( | hashset_t | set | ) |
Return the number of items in the hashset.
int hashset_remove | ( | hashset_t | set, |
void * | item ) |
Remove an item from the hashset. Return non-zero if the item was removed and zero if the item is not on the hashset.