X/Open Curses Library Functions vidattr(3XCURSES)
NAME
vidattr, vidattr, vidputs, vidputs - output attributes to
the terminal
SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib \
-R /usr/xpg4/lib -lcurses [ library... ]
c89 [ flag... ] file... -lcurses [ library... ]
#include
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));
PARAMETERS
attr Is the rendition of the foreground win-
dow.
colorpairnumber Is a color pair.
opt Is reserved for future use. Currently,
this must be a null pointer.
putfunc Is a user-supplied output function.
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 subsequent characters in that rendi-
tion. The function outputs by calling putchar(3C). The
vidattr() function neither relies on your updates the model
which Curses maintains of the prior rendition mode.
SunOS 5.11 Last change: 5 Jun 2002 1
X/Open Curses Library Functions vidattr(3XCURSES)
The vidputs() function computes the terminal output string
that vidattr() does, based on attr, but vidputs() outputs by
calling the user-supplied function putfunc. The vidattr()
and vidputs() functions correspond to vidattr() and vid-
puts() respectively, but take a set of arguments, one of
type attrt for the attributes, one of type short for the
color pair number, and a void *, and thus support the attri-
bute constants with the WA prefix.
The opts argument is reserved for definition in a future
release. Currently, it is implemented as a null pointer.
The user-supplied function putfunc (which can be specified
as an argument to either vidputs() or vidputs()) is either
putchar() or some other function with the same prototype.
Both the vidputs() and vidputs() functions ignore the
return value of putfunc.
RETURN VALUES
Upon successful completion, these functions return OK. Oth-
erwise, they return ER.
ERORS
No errors are defined.
USAGE
After use of any of these functions, the model Curses main-
tains of the state of the terminal might not match the
actual state of the terminal. The application should touch
and refresh the window before resuming conventional use of
Curses.
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 conceptu-
ally occupies space in the screen buffer (with or without
width). Thus, a command to set the terminal to a new rendi-
tion would change the rendition of some characters already
displayed.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 5 Jun 2002 2
X/Open Curses Library Functions vidattr(3XCURSES)
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Standard
MT-Level Unsafe
SEE ALSO
doupdate(3XCURSES), islinetouched(3XCURSES),
libcurses(3XCURSES), putchar(3C), tigetflag(3XCURSES),
attributes(5), standards(5)
SunOS 5.11 Last change: 5 Jun 2002 3
|