1 /* PSPP - computes sample statistics.
2 Copyright (C) 2005 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 #define missing_values_h 1
26 Opaque--use access functions defined below. */
29 int type; /* Types of missing values, one of MVT_*. */
30 int width; /* 0=numeric, otherwise string width. */
31 union value values[3]; /* Missing values. [y,z] are the range. */
34 /* Classes of missing values. */
37 MV_NEVER = 0, /* Never considered missing. */
38 MV_USER = 1, /* Missing if value is user-missing. */
39 MV_SYSTEM = 2, /* Missing if value is system-missing. */
40 MV_ANY = MV_USER | MV_SYSTEM /* Missing if it is user or system-missing. */
43 void mv_init (struct missing_values *, int width);
44 void mv_clear (struct missing_values *);
46 void mv_copy (struct missing_values *, const struct missing_values *);
47 bool mv_is_empty (const struct missing_values *);
48 int mv_get_width (const struct missing_values *);
50 bool mv_add_value (struct missing_values *, const union value *);
51 bool mv_add_str (struct missing_values *, const char[]);
52 bool mv_add_num (struct missing_values *, double);
53 bool mv_add_num_range (struct missing_values *, double low, double high);
55 bool mv_has_value (const struct missing_values *);
56 void mv_pop_value (struct missing_values *, union value *);
57 void mv_peek_value (const struct missing_values *mv, union value *v, int idx);
58 void mv_replace_value (struct missing_values *mv, const union value *v, int idx);
60 int mv_n_values (const struct missing_values *mv);
63 bool mv_has_range (const struct missing_values *);
64 void mv_pop_range (struct missing_values *, double *low, double *high);
65 void mv_peek_range (const struct missing_values *, double *low, double *high);
67 bool mv_is_resizable (const struct missing_values *, int width);
68 void mv_resize (struct missing_values *, int width);
70 typedef bool mv_is_missing_func (const struct missing_values *,
73 /* Is a value missing? */
74 bool mv_is_value_missing (const struct missing_values *, const union value *,
76 bool mv_is_num_missing (const struct missing_values *, double, enum mv_class);
77 bool mv_is_str_missing (const struct missing_values *, const char[],
80 #endif /* missing-values.h */