These functions inspect the properties and contents of
struct missing_values
objects.
The first set of functions inspects the discrete values that sets of user-missing values may contain:
bool
mv_is_empty (const struct missing_values *mv)
¶Returns true if mv contains no user-missing values, false if it contains at least one user-missing value (either a discrete value or a numeric range).
int
mv_get_width (const struct missing_values *mv)
¶Returns the width of the user-missing values that mv represents.
int
mv_n_values (const struct missing_values *mv)
¶Returns the number of discrete user-missing values included in mv. The return value will be between 0 and 3. For sets of numeric user-missing values that include a range, the return value will be 0 or 1.
bool
mv_has_value (const struct missing_values *mv)
¶Returns true if mv has at least one discrete user-missing
values, that is, if mv_n_values
would return nonzero for
mv.
const union value *
mv_get_value (const struct missing_values *mv, int index)
¶Returns the discrete user-missing value in mv with the given
index. The caller must not modify or free the returned value or
refer to it after modifying or freeing mv. The index must be
less than the number of discrete user-missing values in mv, as
reported by mv_n_values
.
The second set of functions inspects the single range of values that numeric sets of user-missing values may contain:
bool
mv_has_range (const struct missing_values *mv)
¶Returns true if mv includes a range, false otherwise.
void
mv_get_range (const struct missing_values *mv, double *low, double *high)
¶Stores the low endpoint of mv’s range in *low
and
the high endpoint of the range in *high
. mv must
include a range.