cp_multimap

Section: libcprops - cp_multimap (3)
Updated: OCT 2007
Index Return to Main Contents
 

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)


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 18:30:35 GMT, December 01, 2007