cp_multimap

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

NAME

cp_multimap_callback, cp_multimap_callback_by_index, cp_multimap_callback_preorder, cp_multimap_callback_postorder - invoke a callback on items in a multi-map

 

SYNOPSIS

#include <cprops/multimap.h>
int cp_multimap_callback(cp_multimap *tree,
                          cp_callback_fn callback,
                          void *prm);
int cp_multimap_callback_by_index(cp_multimap *tree,
                                   cp_index *index,
                                   cp_callback_fn callback,
                                   void *prm);
int cp_multimap_callback_preorder(cp_multimap *tree,
                                   cp_callback_fn callback,
                                   void *prm);
int cp_multimap_callback_postorder(cp_multimap *tree,
                                    cp_callback_fn callback,
                                    void *prm);

 

DESCRIPTION

cp_multimap_callback* perform a scan of the map, invoking the given callback function with each entry and the given parameter. The callback iteration is terminated if the callback function returns non-zero. The prototype for the callback function is as follows:

int callback_fn(void *entry, void *client_prm);

The callback function is invoked iteratively with entry pointing at the current tree node. This is a cp_index_map_node object. The entry member points to the actual entry, on unique indices, or to a cp_vector on non-unique indices. See cp_multimap(3) for an example of a callback function implementation.

cp_mutlimap_callback performs an in-order iteration. cp_multimap_callback_preorder and cp_multimap_callback_postorder perform a pre- and postorder iteration respectively. cp_multimap_callback_by_index allows specifying a secondary index to perform an in-order iterator with. The index parameter must be a cp_index created by calling cp_multimap_create_index on the map being searched.
 

RETURN VALUE

0 if the iteration completes, or the non-zero value returned by the callback function terminating the iteration.
 

SEE ALSO

cp_multimap(3), cp_multimap_create_index(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