dataset: Before deleting variables, make sure new values are added.
[pspp] / src / data / variable.h
index a17470f26b41c6227e9107fca297911821aafecf..4a1ac6f81acc81920a9d34c5c9208a6ee9e8681d 100644 (file)
@@ -85,10 +85,9 @@ void var_set_missing_values (struct variable *, const struct missing_values *);
 void var_clear_missing_values (struct variable *);
 bool var_has_missing_values (const struct variable *);
 
-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 uint8_t[], enum mv_class);
+enum mv_class var_is_value_missing (const struct variable *, const union value *);
+enum mv_class var_is_num_missing (const struct variable *, double);
+enum mv_class var_is_str_missing (const struct variable *, const uint8_t[]);
 
 /* Value labels. */
 const char *var_lookup_value_label (const struct variable *,
@@ -110,11 +109,11 @@ void var_replace_value_label (struct variable *,
 void var_clear_value_labels (struct variable *);
 
 /* Print and write formats. */
-const struct fmt_spec *var_get_print_format (const struct variable *);
-void var_set_print_format (struct variable *, const struct fmt_spec *);
-const struct fmt_spec *var_get_write_format (const struct variable *);
-void var_set_write_format (struct variable *, const struct fmt_spec *);
-void var_set_both_formats (struct variable *, const struct fmt_spec *);
+struct fmt_spec var_get_print_format (const struct variable *);
+void var_set_print_format (struct variable *, struct fmt_spec);
+struct fmt_spec var_get_write_format (const struct variable *);
+void var_set_write_format (struct variable *, struct fmt_spec);
+void var_set_both_formats (struct variable *, struct fmt_spec);
 
 struct fmt_spec var_default_formats (int width);
 
@@ -128,9 +127,10 @@ bool var_has_label (const struct variable *);
 /* How data is measured. */
 enum measure
   {
-    MEASURE_NOMINAL = 0,
-    MEASURE_ORDINAL = 1,
-    MEASURE_SCALE = 2,
+    MEASURE_UNKNOWN = 0,
+    MEASURE_NOMINAL = 1,
+    MEASURE_ORDINAL = 2,
+    MEASURE_SCALE = 3,
     n_MEASURES
   };
 
@@ -141,7 +141,8 @@ const char *measure_to_syntax (enum measure);
 enum measure var_get_measure (const struct variable *);
 void var_set_measure (struct variable *, enum measure);
 
-enum measure var_default_measure (enum val_type);
+enum measure var_default_measure_for_type (enum val_type);
+enum measure var_default_measure_for_format (enum fmt_type);
 
 /* Intended usage of a variable, for populating dialogs. */
 enum var_role
@@ -191,7 +192,7 @@ void var_set_leave (struct variable *, bool leave);
 bool var_must_leave (const struct variable *);
 
 /* Short names. */
-size_t var_get_short_name_cnt (const struct variable *);
+size_t var_get_n_short_names (const struct variable *);
 const char *var_get_short_name (const struct variable *, size_t idx);
 void var_set_short_name (struct variable *, size_t, const char *);
 void var_clear_short_names (struct variable *);