v->width = new_width;
dict_var_resized (v, old_width);
- dict_var_changed (v);
+ dict_var_changed (v, VAR_TRAIT_WIDTH);
}
/* Returns true if variable V is numeric, false otherwise. */
var_set_missing_values (struct variable *v, const struct missing_values *miss)
{
var_set_missing_values_quiet (v, miss);
- dict_var_changed (v);
+ dict_var_changed (v, VAR_TRAIT_MISSING_VALUES);
}
/* Sets variable V to have no user-missing values. */
var_set_value_labels (struct variable *v, const struct val_labs *vls)
{
var_set_value_labels_quiet (v, vls);
- dict_var_changed (v);
+ dict_var_changed (v, VAR_TRAIT_LABEL);
}
var_set_print_format (struct variable *v, const struct fmt_spec *print)
{
var_set_print_format_quiet (v, print);
- dict_var_changed (v);
+ dict_var_changed (v, VAR_TRAIT_FORMAT);
}
/* Returns V's write format specification. */
var_set_write_format (struct variable *v, const struct fmt_spec *write)
{
var_set_write_format_quiet (v, write);
- dict_var_changed (v);
+ dict_var_changed (v, VAR_TRAIT_FORMAT);
}
void
var_set_both_formats (struct variable *v, const struct fmt_spec *format)
{
- var_set_print_format (v, format);
- var_set_write_format (v, format);
+ var_set_print_format_quiet (v, format);
+ var_set_write_format_quiet (v, format);
+ dict_var_changed (v, VAR_TRAIT_FORMAT);
}
/* Returns the default print and write format for a variable of
{
bool truncated = var_set_label_quiet (v, label, issue_warning);
- dict_var_changed (v);
+ dict_var_changed (v, VAR_TRAIT_LABEL);
return truncated;
}
var_set_measure (struct variable *v, enum measure measure)
{
var_set_measure_quiet (v, measure);
- dict_var_changed (v);
+ dict_var_changed (v, VAR_TRAIT_MEASURE);
}
var_set_display_width (struct variable *v, int new_width)
{
var_set_display_width_quiet (v, new_width);
- dict_var_changed (v);
+ dict_var_changed (v, VAR_TRAIT_DISPLAY_WIDTH);
}
var_set_alignment (struct variable *v, enum alignment alignment)
{
var_set_alignment_quiet (v, alignment);
- dict_var_changed (v);
+ dict_var_changed (v, VAR_TRAIT_ALIGNMENT);
}
var_set_leave (struct variable *v, bool leave)
{
var_set_leave_quiet (v, leave);
- dict_var_changed (v);
+ dict_var_changed (v, VAR_TRAIT_LEAVE);
}
var->short_names[idx] = utf8_to_upper (short_name);
}
- dict_var_changed (var);
+ dict_var_changed (var, VAR_TRAIT_NAME);
}
/* Clears V's short names. */
var_set_attributes (struct variable *v, const struct attrset *attrs)
{
var_set_attributes_quiet (v, attrs);
- dict_var_changed (v);
+ dict_var_changed (v, VAR_TRAIT_ATTRIBUTES);
}
#include "data/missing-values.h"
#include "data/val-type.h"
+/* Bitfields to identify traits of a variable */
+
+#define VAR_TRAIT_NAME 0x0001
+#define VAR_TRAIT_WIDTH 0x0002
+#define VAR_TRAIT_FORMAT 0x0004
+#define VAR_TRAIT_LABEL 0x0008
+#define VAR_TRAIT_VALUE_LABELS 0x0010
+#define VAR_TRAIT_MISSING_VALUES 0x0020
+#define VAR_TRAIT_ALIGNMENT 0x0040
+#define VAR_TRAIT_MEASURE 0x0080
+#define VAR_TRAIT_DISPLAY_WIDTH 0x0100
+#define VAR_TRAIT_LEAVE 0x0200
+#define VAR_TRAIT_POSITION 0x0400
+#define VAR_TRAIT_ATTRIBUTES 0x0800
+
union value;
/* Variables.