-
-
-/* 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];
- data_out (buf, &var->print, val);
- buf[var->print.w] = '\0';
- s = buf;
- }
-
- return s;
-}