xref: /netbsd-src/lib/libcurses/curses_refresh.3 (revision b8c616269f5ebf18ab2e35cb8099d683130a177c)
1.\"	$NetBSD: curses_refresh.3,v 1.6 2002/12/23 12:19:48 wiz Exp $
2.\"
3.\" Copyright (c) 2002
4.\"	Brett Lymn (blymn@netbsd.org, brett_lymn@yahoo.com.au)
5.\"
6.\" This code is donated to the NetBSD Foundation by the Author.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in the
15.\"    documentation and/or other materials provided with the distribution.
16.\" 3. The name of the Author may not be used to endorse or promote
17.\"    products derived from this software without specific prior written
18.\"    permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"
33.Dd December 4, 2002
34.Dt CURSES_REFRESH 3
35.Os
36.Sh NAME
37.Nm curses_refresh ,
38.Nm refresh ,
39.Nm wrefresh ,
40.Nm wnoutrefresh ,
41.Nm doupdate ,
42.Nm leaveok ,
43.Nm flushok
44.Nd curses terminal update routines
45.Sh LIBRARY
46.Lb libcurses
47.Sh SYNOPSIS
48.Fd #include \*[Lt]curses.h\*[Gt]
49.Ft int
50.Fn refresh "void"
51.Ft int
52.Fn wrefresh "WINDOW *win"
53.Ft int
54.Fn wnoutrefresh "WINDOW *win"
55.Ft int
56.Fn doupdate "void"
57.Ft int
58.Fn leaveok "WINDOW *win" "boolf flag"
59.Ft int
60.Fn flushok "WINDOW *win" "boolf flag"
61.Sh DESCRIPTION
62These functions update the terminal with the contents of
63.Dv stdscr
64or of the specified window(s).
65.Pp
66The
67.Fn refresh
68function causes curses to propagate changes made to
69.Dv stdscr
70to the terminal display.
71.Pp
72The
73.Fn wrefresh
74function is the same as the
75.Fn refresh
76function, excepting that changes are propagated to the terminal from the
77window specified by
78.Fa win .
79.Pp
80The
81.Fn wnoutrefresh
82function performs the internal processing required by curses to determine
83what changes need to be made to synchronise the internal screen buffer
84and the terminal but does not modify the terminal display.
85.Pp
86The
87.Fn doupdate
88function updates the terminal display to match the internal curses
89representation of the display.
90.Pp
91The
92.Fn wnoutrefresh
93and
94.Fn doupdate
95functions can be used together to speed up terminal redraws by
96deferring the actual terminal updates until after a batch of updates
97to multiple windows has been done.
98.Pp
99The
100.Fn refresh
101function is equivalent to
102.Fn wnoutrefresh stdscr
103followed by
104.Fn doupdate .
105.Pp
106The
107.Fn leaveok
108function determines whether refresh operations may leave the screen cursor
109in an arbitrary position on the screen.
110Setting
111.Fa flag
112to
113.Dv FALSE
114ensures that the screen cursor is positioned at the current cursor
115position after a refresh operation has taken place.
116.Pp
117The
118.Fn flushok
119function is used to determine whether or not the screen's output file
120descriptor will be flushed on refresh.
121Setting
122.Fa flag
123to
124.Dv TRUE
125will cause the output to be flushed.
126.Sh RETURN VALUES
127Functions returning pointers will return
128.Dv NULL
129if an error is detected.
130The functions that return an int will return one of the following
131values:
132.Pp
133.Bl -tag -width ERR -compact
134.It Er OK
135The function completed successfully.
136.It Er ERR
137An error occurred in the function.
138.El
139.Sh SEE ALSO
140.Xr curses_getch 3 ,
141.Xr curses_pad 3 ,
142.Xr curses_touch 3
143.Sh STANDARDS
144The
145.Nx
146Curses library complies with the X/Open Curses specification, part of the
147Single Unix Specification.
148.Sh HISTORY
149The Curses package appeared in
150.Bx 4.0 .
151