+ const int old_width = v->width;
+
+ if (mv_is_resizable (&v->miss, new_width))
+ mv_resize (&v->miss, new_width);
+ else
+ mv_init (&v->miss, new_width);
+
+ if (v->val_labs != NULL)
+ {
+ if (val_labs_can_set_width (v->val_labs, new_width))
+ val_labs_set_width (v->val_labs, new_width);
+ else
+ {
+ val_labs_destroy (v->val_labs);
+ v->val_labs = NULL;
+ }
+ }
+
+ fmt_resize (&v->print, new_width);
+ fmt_resize (&v->write, new_width);
+
+ v->width = new_width;
+
+ {
+ const int old_val_count = value_cnt_from_width (old_width);
+ const int new_val_count = value_cnt_from_width (new_width);
+
+ if ( old_val_count != new_val_count)
+ dict_var_resized (v, new_val_count - old_val_count);
+ }
+
+ dict_var_changed (v);
+}
+
+/* Returns true if variable V is numeric, false otherwise. */
+bool
+var_is_numeric (const struct variable *v)
+{
+ return var_get_type (v) == VAL_NUMERIC;
+}
+
+/* Returns true if variable V is a string variable, false
+ otherwise. */
+bool
+var_is_alpha (const struct variable *v)
+{
+ return var_get_type (v) == VAL_STRING;
+}
+
+/* Returns true if variable V is a short string variable, false
+ otherwise. */
+bool
+var_is_short_string (const struct variable *v)
+{
+ return v->width > 0 && v->width <= MAX_SHORT_STRING;
+}
+
+/* Returns true if variable V is a long string variable, false
+ otherwise. */
+bool
+var_is_long_string (const struct variable *v)
+{
+ return v->width > MAX_SHORT_STRING;
+}
+
+/* Returns the number of "union value"s need to store a value of
+ variable V. */
+size_t
+var_get_value_cnt (const struct variable *v)
+{
+ return value_cnt_from_width (v->width);
+}
+\f
+/* Returns variable V's missing values. */
+const struct missing_values *
+var_get_missing_values (const struct variable *v)
+{
+ return &v->miss;