putp.3x (2010 09)

p
putp(3X) putp(3X)
(ENHANCED CURSES)
NAME
putp, tputs — output commands to the terminal
SYNOPSIS
#include <term.h>
int putp(const char *str);
int tputs(const char *str, int affcnt, int (*putfunc)(int));
DESCRIPTION
These functions output commands contained in the terminfo database to the terminal.
The
putp() function is equivalent to tputs(str,1,putchar). The output of
putp() always goes to
stdout, not to the fildes specified in
setupterm().
The
tputs() function outputs str to the terminal. The str argument must be a terminfo string variable
or the return value from
tgetstr(), tgoto()
, tigetstr() or tparm(). The affcnt argument is
the number of lines affected, or 1 if not applicable. If the terminfo database indicates that the terminal
in use requires padding after any command in the generated string,
tputs() inserts pad characters into
the string that is sent to the terminal, at positions indicated by the terminfo database. The
tputs()
function outputs each character of the generated string by calling the user-supplied function putfunc (see
below).
The user-supplied function putfunc (specified as an argument to
tputs) is either putchar() or some
other function with the same prototype. The
tputs() function ignores the return value of putfunc .
RETURN VALUE
Upon successful completion, these functions return OK. Otherwise, they return ERR.
ERRORS
No errors are defined.
APPLICATION 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.
SEE ALSO
doupdate(3X), is_linetouched(3X), tgetent(3X), tigetflag(3X), putchar() (in the X/Open System Interfaces
and Headers, Issue 4, Version 2 specification), <term.h>.
CHANGE HISTORY
First released in X/Open Curses, Issue 4.
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)