/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
- Written by Ben Pfaff <blp@gnu.org>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#define variable_h 1
#include <stddef.h>
-#include "config.h"
#include <stdbool.h>
+#include <data/missing-values.h>
union value;
enum var_type var_get_type (const struct variable *);
int var_get_width (const struct variable *);
void var_set_width (struct variable *, int width);
+
+typedef bool var_predicate_func (const struct variable *);
+
bool var_is_numeric (const struct variable *);
bool var_is_alpha (const struct variable *);
bool var_is_short_string (const struct variable *);
void var_clear_missing_values (struct variable *);
bool var_has_missing_values (const struct variable *);
-typedef bool var_is_missing_func (const struct variable *,
- const union value *);
-bool var_is_value_missing (const struct variable *, const union value *);
-bool var_is_num_missing (const struct variable *, double);
-bool var_is_str_missing (const struct variable *, const char[]);
-bool var_is_value_user_missing (const struct variable *,
- const union value *);
-bool var_is_num_user_missing (const struct variable *, double);
-bool var_is_str_user_missing (const struct variable *, const char[]);
-bool var_is_value_system_missing (const struct variable *,
- const union value *);
+bool var_is_value_missing (const struct variable *, const union value *,
+ enum mv_class);
+bool var_is_num_missing (const struct variable *, double, enum mv_class);
+bool var_is_str_missing (const struct variable *, const char[], enum mv_class);
/* Value labels. */
const struct val_labs *var_get_value_labels (const struct variable *);
/* How data is measured. */
enum measure
{
- MEASURE_NOMINAL = 1,
- MEASURE_ORDINAL = 2,
- MEASURE_SCALE = 3,
+ MEASURE_NOMINAL = 0,
+ MEASURE_ORDINAL = 1,
+ MEASURE_SCALE = 2,
n_MEASURES
};
/* Variable auxiliary data. */
void *var_get_aux (const struct variable *);
-void *var_attach_aux (struct variable *,
+void *var_attach_aux (const struct variable *,
void *aux, void (*aux_dtor) (struct variable *));
void var_clear_aux (struct variable *);
void *var_detach_aux (struct variable *);
/* Observed categorical values. */
struct cat_vals *var_get_obs_vals (const struct variable *);
-void var_set_obs_vals (struct variable *, struct cat_vals *);
+void var_set_obs_vals (const struct variable *, struct cat_vals *);
bool var_has_obs_vals (const struct variable *);
/* Classes of variables. */