Next: , Previous: Value Labels Creation and Destruction, Up: Value Labels


2.4.2 Value Labels Properties

These functions inspect and manipulate basic properties of struct val_labs objects.

— Function: size_t val_labs_count (const struct val_labs *val_labs)

Returns the number of value labels in val_labs.

— Function: bool val_labs_can_set_width (const struct val_labs *val_labs, int new_width)

Tests whether val_labs's width may be changed to new_width using val_labs_set_width. Returns true if it is allowed, false otherwise.

A set of value labels may be resized to a given width only if each value in it may be resized to that width, as determined by value_is_resizable (see value_is_resizable).

— Function: void val_labs_set_width (struct val_labs *val_labs, int new_width)

Changes the width of val_labs's values to new_width, which must be a valid new width as determined by val_labs_can_set_width.

If new_width is a long string width, this function deletes all value labels from val_labs.