-
-
-/* Get a string representing the value.
- That is, if it has a label, then return that label,
- otherwise, if the value is alpha, then return the string for it,
- else format it and return the formatted string
-*/
-const char *
-value_to_string (const union value *val, const struct variable *var)
-{
- char *s;
-
- assert (val != NULL);
- assert (var != NULL);
-
- s = val_labs_find (var->val_labs, *val);
- if (s == NULL)
- {
- static char buf[MAX_STRING + 1];
- const struct fmt_spec *print = var_get_print_format (var);
- data_out (val, print, buf);
- buf[print->w] = '\0';
- s = buf;
- }
-
- return s;
-}