cp_hashtable_remove_all(3) - Linux man page

Name

cp_hashtable_remove, cp_hashtable_remove_deep, cp_hashtable_remove_all - remove mappings from a hashtable

Synopsis

#include <cprops/hashtable.h>

void *cp_hashtable_remove(cp_hashtable *table, void *key);
int cp_hashtable_remove_deep(cp_hashtable *table, void *key);
int cp_hashtable_remove_all(cp_hashtable *table);

Description

cp_hashtable_remove attempts to remove the mapping for key from hashtable table. If COLLECTION_MODE_MULTIPLE_VALUES is set all mappings for this key are removed. If COLLECTION_MODE_DEEP is set the finalization functions set at table initialization are invoked upon the key and value being removed.

cp_hashtable_remove_deep is the same as cp_hashtable_remove with the COLLECTION_MODE_DEEP bit set.

cp_hashtable_remove_all removes all mappings from the table.

Return Value

cp_hashtable_remove and cp_hashtable_remove_deep return a pointer to the last removed value - which may no longer be valid if the memory it points to is released by the finalization function, or NULL if no mapping was found for key.
cp_hashtable_remove_all returns 0 on success or non-zero on locking failure.

See Also

cp_hashtable_create(3), cp_hashtable_set_mode(3)