cp_hashtable_set_mode(3)
| cp_hashtable(3) | libcprops - cp_hashtable | cp_hashtable(3) |
NAME
cp_hashtable_set_mode, cp_hashtable_unset_mode - set/unset hashtable mode bits
SYNOPSIS
#include <cprops/hashtable.h>
int cp_hashtable_set_mode(cp_hashtable *table,
int mode);
int cp_hashtable_get_mode(cp_hashtable *table);
int cp_hashtable_unset_mode(cp_hashtable *table, int
mode);
DESCRIPTION
cp_hashtable_set_mode sets the mode bit specified by mode by logically ORing them with the currently set mode bits on the specified table. cp_hashtable_unset_mode resets the bits set in the parameter to zero and cp_hashtable_get_mode returns the current operation mode. The effect of mode bit settings is as follows:
- COLLECTION_MODE_DEEP - when removing or replacing a mapping, the
- destructor functions are called on the key and value constituting the mapping.
- COLLECTION_MODE_MULTIPLE_VALUES - allows multiple mappings for a given
- key on insertion. When retrieving values the results are given in a newly allocated cp_list, even if it contains only one entry.
- COLLECTION_MODE_COPY - on insertion, the applicable copy functions
- specified are used to store copies of the key and value.
- COLLECTION_MODE_NOSYNC - operations are performed with no locking.
- Synchronization features should not be used on tables created in this mode.
- COLLECTION_MODE_NORESIZE - the table is not extended on insertion nor
- compacted on removal regardless of maximal and minimal fill factor settings.
RETURN VALUE
cp_hashtable_get_mode returns the table mode on success or
-1 if a locking error occurs.
cp_hashtable_set_mode returns 0 on success, -1 if a locking error
occurs or EINVAL if attempting to set COLLECTION_MODE_NOSYNC while the
current thread owns the table lock. cp_hashtable_unset_mode returns 0
on success or -1 if a locking error occurs.
SEE ALSO
cp_hashtable(3), cp_hashtable_create(3), cp_hashtable_put(3), cp_hashtable_get(3)
| OCTOBER 2005 | libcprops.0.0.3 |
