интерфейсы библиотеки Сurses к базе данных terminfo (curses interfaces to terminfo database)
Возвращаемое значение (Return value)
Routines that return an integer return ERR
upon failure and OK
(SVr4 only specifies 'an integer value other than ERR
') upon
successful completion, unless otherwise noted in the preceding
routine descriptions.
Routines that return pointers always return NULL
on error.
X/Open defines no error conditions. In this implementation
del_curterm
returns an error if its terminal parameter is null.
putp
calls tputs
, returning the same error-codes.
restartterm
returns an error if the associated call to setupterm
returns an error.
setupterm
returns an error if it cannot allocate enough memory, or
create the initial windows (stdscr, curscr, newscr).
Other error conditions are documented above.
tputs
returns an error if the string parameter is null. It
does not detect I/O errors: X/Open states that tputs
ignores the return value of the output function putc.
Compatibility macros
This implementation provides a few macros for compatibility with
systems before SVr4 (see HISTORY
). Those include crmode
,
fixterm
, gettmode
, nocrmode
, resetterm
, saveterm
, and setterm
.
In SVr4, those are found in <curses.h>
, but except for setterm
,
are likewise macros. The one function, setterm
, is mentioned in
the manual page. The manual page notes that the setterm
routine
was replaced by setupterm
, stating that the call:
setupterm(
term, 1, (int *)0)
provides the same functionality as setterm(
term)
, and is not
recommended for new programs. This implementation provides each
of those symbols as macros for BSD compatibility,