cp_multimap_get(3) - Linux man page

Name

cp_multimap_get, cp_multimap_get_by_index, cp_multimap_find, cp_multimap_find_by_index - retrieve entries from a multimap

Synopsis

#include <cprops/multimap.h>

void *cp_multimap_get(cp_multimap *tree, void *entry);
void *cp_multimap_get_by_index(cp_multimap *
map,

cp_index *index, void *entry);

void *cp_multimap_find(cp_multimap *map, void *key, cp_op op);
void *cp_multimap_find_by_index(cp_multimap *
map,

cp_index *index, void *entry, cp_op op);

Description

cp_multimap_get returns the requested entry using the primary index. cp_multimap_get_by_index allows specifying a different index. The functions cp_multimap_find and cp_multimap_find_by_index allow lookups for entries by relational operator - the op parameter may be one of the following:

CP_OP_LT - returns an entry less than the given key
CP_OP_LE
- returns an entry less than or equal to the given key
CP_OP_EQ
- returns an entry equal to the given key - this is the same as cp_multimap_get
CP_OP_NE
- returns an entry not equal to the given key
CP_OP_GE
- returns an entry greater or equal to the given key
CP_OP_GT
- returns an entry greater than the given key

If the index used for the retrieval operation is non-unique, matches are returned in a cp_vector object. The number of matches returned may be determined by calling cp_vector_size on the result, which will be a number equal or greater to one.

Return Value

All functions return NULL if no match was found, or the item matched. For non-unique keys, one or more matches are wrapped in a cp_vector object.

See Also

cp_multimap_contains(3), cp_vector(3)

Referenced By

cp_multimap(3), cp_multimap_remove(3)