- gchar *text = NULL;
-
- g_string_append (gstring, var_get_name (var));
- g_string_append (gstring, "\n");
-
-
- g_string_append_printf (gstring, _("Label: %s\n"), label_to_string (var));
- {
- const struct fmt_spec *fmt = var_get_print_format (var);
- char buffer[FMT_STRING_LEN_MAX + 1];
-
- fmt_to_string (fmt, buffer);
- /* No conversion necessary. buffer will always be ascii */
- g_string_append_printf (gstring, _("Type: %s\n"), buffer);
- }
-
- text = missing_values_to_string (var, NULL);
- g_string_append_printf (gstring, _("Missing Values: %s\n"),
- text);
- g_free (text);
-
- g_string_append_printf (gstring, _("Measurement Level: %s\n"),
- measure_to_string (var_get_measure (var)));
-
-
- /* Value Labels */
- if ( var_has_value_labels (var))
- {
- const struct val_labs *vls = var_get_value_labels (var);
- const struct val_lab **labels;
- size_t n_labels;
- size_t i;
-
- g_string_append (gstring, "\n");
- g_string_append (gstring, _("Value Labels:\n"));
-
- labels = val_labs_sorted (vls);
- n_labels = val_labs_count (vls);
- for (i = 0; i < n_labels; i++)
- {
- const struct val_lab *vl = labels[i];
- gchar *const vstr = value_to_text (vl->value, var);
-
- g_string_append_printf (gstring, _("%s %s\n"),
- vstr, val_lab_get_escaped_label (vl));
-
- g_free (vstr);
- }
- free (labels);
- }