'\"macro stdmacro
.if n .pH g3x.curs_refresh @(#)curs_refresh	40.3 of 12/15/89
.\" Copyright 1989 AT&T
.\" ident	"@(#)svid_ti:ti_lib/curs_refresh	1.5"
.nr X
.if \nX=0 .ds x} curs_refresh 3X "" "\&"
.if \nX=1 .ds x} curs_refresh 3X ""
.if \nX=2 .ds x} curs_refresh 3X "" "\&"
.if \nX=3 .ds x} curs_refresh "" "" "\&"
.TH \*(x}
.SH NAME
\f4curs_refresh\f2: \f4 refresh\f1, \f4wrefresh\f1, \f4wnoutrefresh\f1, \f4doupdate\f1, \f4redrawwin\f1, \f4wredrawln\f1 \- refresh \f4curses\fP windows and lines
.SH SYNOPSIS
.nf
.ft 4
#include <curses.h>
.sp
int refresh(void);
.sp 0.5
int wrefresh(WINDOW *win);
.sp 0.5
int wnoutrefresh(WINDOW *win);
.sp 0.5
int doupdate(void);
.sp 0.5
int redrawwin(WINDOW *win);
.sp 0.5
.ig
.\" no such interface in curses.h v 1.45; notified ss 2/21/89, if not earlier
wredrawwin(WINDOW *win);
.sp 0.5
..
int wredrawln(WINDOW *win, int beg_line, int num_lines);
.ft 1
.fi
.SH DESCRIPTION
The \f4refresh\f1 and \f4wrefresh\f1 routines
(or \f4wnoutrefresh\f1 and \f4\%doupdate\f1)
must be called to get any output on the terminal,
as other routines merely manipulate data structures.
The routine \f4wrefresh\f1
copies the named window to the physical terminal screen,
taking into account what is already there in order to do optimizations.
The \f4refresh\f1 routine is the same,
using \f4stdscr\f1 as the default window.
Unless
\f4leaveok\f1
has been enabled, the physical cursor of the terminal is left at the location
of the cursor for that window.
.P
The \f4wnoutrefresh\f1 and \f4doupdate\f1 routines allow multiple
updates with more efficiency than
\f4wrefresh\f1 alone.
In addition to all the window structures,
\f4curses\fP keeps two data structures
representing the terminal screen:
a physical screen,
describing what is actually on the screen,
and a virtual screen,
describing what the programmer wants to have on the screen.
.P
The routine \f4wrefresh\f1 works by first calling
\f4wnoutrefresh\f1,
which copies the named window to the virtual screen,
and then calling \f4doupdate\f1,
which compares the virtual screen to the physical
screen and does the actual update.
If the programmer wishes to output several windows at once,
a series of calls to
\f4wrefresh\f1
results in alternating calls to
\f4wnoutrefresh\f1 and \f4doupdate\f1,
causing several bursts of output to the screen.
By first calling
\f4wnoutrefresh\f1
for each window, it is then possible to call
\f4doupdate\f1
once, resulting in only one burst of output, with fewer total
characters transmitted and less CPU time used.
If the \f2win\fP argument to \f4wrefresh\fP is the global variable
\f4curscr\fP, the screen is immediately cleared and repainted from
scratch.
.P
The \f4redrawwin\f1 routine
indicates to \f4curses\fP that some screen lines are corrupted
and should be thrown away before anything is written over them.
These routines could be used for programs such as editors,
which want a command to redraw some part of the screen or the entire screen.
The routine
\f4redrawln\f1 is preferred over \f4redrawwin\f1
where a noisy communication line exists and redrawing the entire window
could be subject to even more communication noise.
Just redrawing 
several lines offers the possibility that they would show up
unblemished.
.SH RETURN VALUE
All routines return the integer \f4ERR\f1 upon
failure and an integer value other than \f4ERR\f1
upon successful completion.
.SH NOTES
.P
The header file \f4<curses.h>\f1 automatically includes the header files
\f4<stdio.h>\f1 and \f4<unctrl.h>\f1.
.PP
Note that \f4refresh\f1 and \f4redrawwin\f1 may be macros.
.SH SEE ALSO
.na
\f4curses\fP(3X),
\f4curs_outopts\fP(3X).
.ad
