vidattr(3X) vidattr(3X)
NAME
vidattr, vidattr, vidputs, vidputs - output attributes to the termi-
nal
SYNOPSIS
cc [flag ...] file ... -lcurses [library ...]
#include <curses.h>
int vidattr(chtype attr);
int vidattr(attrt attr, short colorpairnumber, void *opt);
int vidputs(chtype attr, int (*putfunc)(int));
int vidputs(attrt attr, short colorpairnumber, void *opt, int
(*putfunc)(int));
DESCRIPTION
These functions output commands to the terminal that change the
terminal's attributes.
If the terminfo database indicates that the terminal in use can
display characters in the rendition specified by attr, then vidattr()
outputs one or more commands to request that the terminal display sub-
sequent characters in that rendition. The function outputs by calling
putchar(). The vidattr() function neither relies on nor updates the
model which Curses maintains of the prior rendition mode.
The vidputs() function computes the same terminal output string that
vidattr() does, based on attr, but vidputs() outputs by calling the
user-supplied function putfunc. The vidattr() and vidputs() func-
tions correspond to vidattr() and vidputs() respectively, but take a
set of arguments, one of type attrt for the attributes, short for the
colour pair number and a void *, and thus support the attribute con-
stants with the WA prefix.
The opts argument is reserved for definition in a future edition of
this manual page. Currently, the application must provide a null
pointer as opts.
The user-supplied function putfunc (which can be specified as an argu-
ment to either vidputs() or vidputs()) is either putchar() or some
other function with the same prototype. Both the vidputs() and the
vidputs() function ignore the return value of putfunc.
RETURN VALUE
Upon successful completion, these functions return OK. Otherwise, they
return ERR.
ERRORS
No errors are defined.
Page 1 Reliant UNIX 5.44 Printed 11/98
vidattr(3X) vidattr(3X)
NOTES
After use of any of these functions, the model Curses maintains of the
state of the terminal might not match the actual state of the termi-
nal. The application should touch and refresh the window before resum-
ing conventional use of Curses.
Use of these functions requires that the application contain so much
information about a particular class of terminal that it defeats the
purpose of using Curses.
On some terminals, a command to change rendition conceptually occupies
space in the screen buffer (with or without width). Thus, a command to
set the terminal to a new rendition would change the rendition of some
characters already displayed.
SEE ALSO
putchar(3S), putwchar(3S), curses(3X), doupdate(3X),
islinetouched(3X), tigetflag(3X), curses(5).
Page 2 Reliant UNIX 5.44 Printed 11/98