Diffusion C API  6.7.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
set_s Struct Reference

This respresents a set. More...

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 )(const void *)
 Function used to duplicate values as they're added to the set. More...
 
void(* free_fn )(void *)
 Function used to free values from the set. More...
 
unsigned long(* hash_fn )(const void *)
 Function used to calculate the hash for the value. More...
 
int(* cmp_fn )(const void *, const void *)
 Function used to compare if two entries have the same value. More...
 

Detailed Description

This respresents a set.

Field Documentation

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)(const 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.


The documentation for this struct was generated from the following file: