DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

vidattr(3curses)


vidattr -- output attributes to the terminal

Synopsis

cc [options] file -lcurses
#include <curses.h>

int vidattr(chtype attr);

int vid_attr(attr_t attr, short color_pair_number, void *opt);

int vidputs(chtype attr, int (*putfunc)(int));

int vid_puts(attr_t attr, short color_pair_number, 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(3curses) outputs one or more commands to request that the terminal display subsequent characters in that rendition. The function outputs by calling putchar(3S). The vidattr(3curses) function neither relies on nor updates the model which Curses maintains of the prior rendition mode.

The vidputs(3curses) function computes the same terminal output string that vidattr(3curses) does, based on attr, but vidputs(3curses) outputs by calling the user-supplied function putfunc. The vid_attr(3curses) and vid_puts(3curses) functions correspond to vidattr(3curses) and vidputs(3curses) respectively, but take a set of arguments, one of type attr_t for the attributes, short for the colour pair number and a void *, and thus support the attribute constants with the WA_ prefix.

The opts argument is reserved for definition in a future edition of this document. Currently, the application must provide a null pointer as opts.

The user-supplied function putfunc (which can be specified as an argument to either vidputs(3curses) or vid_puts(3curses)) is either putchar(3S) or some other function with the same prototype. Both the vidputs(3curses) and the vid_puts(3curses) 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.

Usage

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 terminal. The application should touch and refresh the window before resuming 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.

Standards Conformance

The Single UNIX Specification, Version 2; The Open Group.

References

doupdate(3curses), is_linetouched(3curses), putchar(3S), putwc(3S), tigetflag(3curses), curses(4)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004