cp_multimap *cp_multimap_create(cp_key_fn key_fn, cp_compare_fn cmp);
cp_multimap*
cp_multimap_create_by_option(int mode, cp_key_fn key_fn,
cp_compare_fn cmp,
cp_copy_fn copy,
cp_destructor_fn dtr);
void cp_multimap_destroy(cp_multimap *tree);
void cp_multimap_destroy_custom(cp_multimap *tree,
cp_destructor_fn dtr);
cp_multimap_create_by_option allows specifying mode bits and an item copy and destructor function. If the mode parameter has the COLLECTION_MODE_MULTIPLE_VALUES bit set, the default index based on the given key and comparison functions is assumed to allow multiple values. In this case an additional unique index is created implicitly.
Additional indices may be added at any point after creation time by calling cp_multimap_create_index.
cp_multimap_destroy frees the memory associated with a multimap. cp_multimap_destroy_custom sets the item destructor function to the dtr parameter and deallocates the multimap. Note that the entry destructor function is called only if the map has the COLLECTION_MODE_DEEP mode bit set. Calling cp_multimap_destroy_custom does not set this bit.