+value_resize (union value *value, int old_width, int new_width)
+{
+ assert (value_is_resizable (value, old_width, new_width));
+ if (new_width != old_width && new_width > 0)
+ {
+ union value tmp;
+ value_init (&tmp, new_width);
+ value_copy_rpad (&tmp, new_width, value, old_width, ' ');
+ value_destroy (value, old_width);
+ *value = tmp;
+ }
+}
+
+/* Returns true if VALUE, with the given WIDTH, is all spaces, false otherwise.
+ Returns false if VALUE is numeric. */
+bool
+value_is_spaces (const union value *value, int width)
+{
+ int i;
+
+ for (i = 0; i < width; i++)
+ if (value->s[i] != ' ')
+ return false;
+
+ return true;
+}
+
+/* Returns true if resizing a value from OLD_WIDTH to NEW_WIDTH
+ actually changes anything, false otherwise. If false is
+ returned, calls to value_resize() with the specified
+ parameters may be omitted without any ill effects.
+
+ This is generally useful only if many values can skip being
+ resized from OLD_WIDTH to NEW_WIDTH. Otherwise you might as
+ well just call value_resize directly. */
+bool
+value_needs_resize (int old_width, int new_width)