void SOPC_Dict_SetValueFreeFunc(SOPC_Dict *d, SOPC_Dict_Free_Fct *func)
Sets the free function for this dictionary's values.
bool SOPC_Dict_KeyEqual_Fct(const uintptr_t a, const uintptr_t b)
Type of functions used when checking two keys for equality. The function should return TRUE if and on...
Definition sopc_dict.h:49
SOPC_Dict_Free_Fct * SOPC_Dict_GetKeyFreeFunc(const SOPC_Dict *d)
Retrieves the free function for this dictionary's keys.
void SOPC_Dict_Free_Fct(uintptr_t data)
Type of functions used to free keys and values.
Definition sopc_dict.h:37
void SOPC_Dict_ForEach_Fct(const uintptr_t key, uintptr_t value, uintptr_t user_data)
Type of callback functions for SOPC_Dict_ForEach. Both the key and value belong to the dictionary....
Definition sopc_dict.h:56
size_t SOPC_Dict_Capacity(const SOPC_Dict *d)
Returns the number if items this dictionary can hold.
void SOPC_Dict_Delete(SOPC_Dict *d)
Deletes a dictionary.
void SOPC_Dict_ForEach(SOPC_Dict *d, SOPC_Dict_ForEach_Fct *func, uintptr_t user_data)
Iterates over the dictionary, calling the given function for each (key, value) pair.
struct _SOPC_Dict SOPC_Dict
Definition sopc_dict.h:32
bool SOPC_Dict_Insert(SOPC_Dict *d, uintptr_t key, uintptr_t value)
Inserts a new key and value in the dictionary.
uint64_t SOPC_Dict_KeyHash_Fct(const uintptr_t data)
Type of hash functions.
Definition sopc_dict.h:42
SOPC_Dict_Free_Fct * SOPC_Dict_GetValueFreeFunc(const SOPC_Dict *d)
Retrieves the free function for this dictionary's values.
SOPC_Dict * SOPC_Dict_Create(uintptr_t empty_key, SOPC_Dict_KeyHash_Fct *key_hash, SOPC_Dict_KeyEqual_Fct *key_equal, SOPC_Dict_Free_Fct *key_free, SOPC_Dict_Free_Fct *value_free)
Creates a new, empty dictionary.
uintptr_t SOPC_Dict_GetKey(const SOPC_Dict *d, const uintptr_t key, bool *found)
Looks up a given key in the dictionary.
bool SOPC_Dict_Reserve(SOPC_Dict *d, size_t n_items)
Reserve space for a given number of items in a dictionary.
size_t SOPC_Dict_Size(const SOPC_Dict *d)
Returns the number of items in this dictionary.
uintptr_t SOPC_Dict_Get(const SOPC_Dict *d, const uintptr_t key, bool *found)
Looks up the value associated with a key in the dictionary.
void SOPC_Dict_SetKeyFreeFunc(SOPC_Dict *d, SOPC_Dict_Free_Fct *func)
Sets the free function for this dictionary's keys.
void SOPC_Dict_Remove(SOPC_Dict *d, const uintptr_t key)
Removes a values from the dictionary.
void SOPC_Dict_SetTombstoneKey(SOPC_Dict *d, uintptr_t tombstone_key)
Set the key used to mark removed values.