+struct resize_datum_aux
+ {
+ const struct dictionary *dict;
+ const struct variable *new_variable;
+ const struct variable *old_variable;
+ };
+
+static void
+resize_datum (const union value *old, union value *new, const void *aux_)
+{
+ const struct resize_datum_aux *aux = aux_;
+ int new_width = var_get_width (aux->new_variable);
+ const char *enc = dict_get_encoding (aux->dict);
+ const struct fmt_spec *newfmt = var_get_print_format (aux->new_variable);
+ char *s = data_out (old, enc, var_get_print_format (aux->old_variable),
+ settings_get_fmt_settings ());
+ enum fmt_type type = (fmt_usable_for_input (newfmt->type)
+ ? newfmt->type
+ : FMT_DOLLAR);
+ free (data_in (ss_cstr (s), enc, type, settings_get_fmt_settings (),
+ new, new_width, enc));
+ free (s);
+}