The routines can_change_color
and has_colors
return TRUE
or
FALSE
.
All other routines return the integer ERR
upon failure and an OK
(SVr4 specifies only 'an integer value other than ERR
') upon
successful completion.
X/Open defines no error conditions. SVr4 does document some
error conditions which apply in general:
• This implementation will return ERR
on attempts to use color
values outside the range 0
to COLORS
-1 (except for the
default colors extension), or use color pairs outside the
range 0
to COLOR_PAIRS-1
.
Color values used in init_color
must be in the range 0
to
1000
.
An error is returned from all functions if the terminal has
not been initialized.
An error is returned from secondary functions such as
init_pair
if start_color
was not called.
• SVr4 does much the same, except that it returns ERR
from
pair_content
if the pair was not initialized using init_pairs
and it returns ERR
from color_content
if the terminal does
not support changing colors.
This implementation does not return ERR
for either case.
Specific functions make additional checks:
init_color
returns an error if the terminal does not support this
feature, e.g., if the initialize_color
capability is
absent from the terminal description.
start_color
returns an error if the color table cannot be allocated.