N
AME
mapping_values
- return all the values from a mapping
S
YNTAX
#include "mapping.h"
struct array *mapping_values(struct mapping *m)
D
ESCRIPTION
This function returns an array with all the values from the mapping m. The values in the array are ordered in the same order as the keys when using mapping_indices, but only if no other mapping operations are done between the mapping_values and the mapping_indices.
E
XAMPLE
struct mapping *slow_copy_mapping(struct mapping *m)
{
struct array *indices, *values;
indices=mapping_indices(m);
values=mapping_indices(m);
m=mkmapping(indices,values);
free_array(indices);
free_array(values);
return m;
}
K
EYWORDS
mapping
S
EE
A
LSO
mapping_indices
,
copy_mapping
and
mkmapping