Section: libcprops - cp_hashlist (3)
Updated: OCTOBER 2005
Return to Main Contents
cp_hashlist_set_mode, cp_hashlist_unset_mode - set/unset hashlist mode bits
int cp_hashlist_set_mode(cp_hashlist *list, int mode);
int cp_hashlist_unset_mode(cp_hashlist *list, int mode);
cp_hashlist_set_mode sets the mode bit specified by mode by
logically ORing them with the currently set mode bits on the specified
list. cp_hashlist_unset_mode resets the bits set in the parameter
to zero. The effect of mode bit settings is as follows:
- COLLECTION_MODE_COPY - on insertion, the applicable copy functions
specified are used to store copies of the key and value.
- COLLECTION_MODE_DEEP - when removing or replacing a mapping, the
destructor functions are called on the key and value constituting
- 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.
may be configured with multiple values options disabled. In this event setting
this bit will have no effect.
- 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.
- COLLECTION_MODE_LIST_ORDER - when retrieving multiple values with the
bit set, values are returned in their order in the list rather than in
insertion order. This operation is O(n) as opposed to O(m) where n is the total
number of entries in the list and m is the number of matches for the requested
returns 0 on success, -1 on locking failure or EINVAL if attempting to set
COLLECTION_MODE_NOSYNC while the current thread owns the list lock.
returns 0 on success or -1 on locking failure.
- RETURN VALUE
- SEE ALSO
This document was created by
using the manual pages.
Time: 12:01:45 GMT, May 23, 2006