![]() |
Diffusion C API 6.12.0
|
This represents a set. More...
#include <set.h>
Data Fields | |
| unsigned long | slots |
| The maximum number of available slots in this set. | |
| unsigned long | size |
| The number of items held in this set. | |
| SET_ENTRY_T ** | entries |
| An array of entries assigned to slots. | |
| void *(* | dup_fn )(void *) |
| Function used to duplicate values as they're added to the set. | |
| void(* | free_fn )(void *) |
| Function used to free values from the set. | |
| unsigned long(* | hash_fn )(const void *) |
| Function used to calculate the hash for the value. | |
| int(* | cmp_fn )(const void *, const void *) |
| Function used to compare if two entries have the same value. | |
This represents a set.
| int(* set_s::cmp_fn) (const void *, const void *) |
Function used to compare if two entries have the same value.
Two different values may produce the same hash and both need to be stored; supplying this function allows this.
| void *(* set_s::dup_fn) (void *) |
Function used to duplicate values as they're added to the set.
If NULL the values are not duplicated, and the user responsible for memory management.
| void(* set_s::free_fn) (void *) |
Function used to free values from the set.
If NULL, the user is responsible for memory management. Typically used if dup_fn has been provided.
| unsigned long(* set_s::hash_fn) (const void *) |
Function used to calculate the hash for the value.
If NULL, a hash function is used which works with NULL-terminated char arrays.