1.\" $NetBSD: curses_refresh.3,v 1.10 2003/04/16 13:35:01 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 March 26, 2003 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.In curses.h 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. 71Any changes made to subwindows of 72.Dv stdscr 73are also propagated. 74.Pp 75The 76.Fn wrefresh 77function is the same as the 78.Fn refresh 79function, excepting that changes are propagated to the terminal from the 80window specified by 81.Fa win . 82.Pp 83The 84.Fn wnoutrefresh 85function performs the internal processing required by curses to determine 86what changes need to be made to synchronise the internal screen buffer 87and the terminal but does not modify the terminal display. 88.Pp 89The 90.Fn doupdate 91function updates the terminal display to match the internal curses 92representation of the display. 93.Pp 94The 95.Fn wnoutrefresh 96and 97.Fn doupdate 98functions can be used together to speed up terminal redraws by 99deferring the actual terminal updates until after a batch of updates 100to multiple windows has been done. 101.Pp 102The 103.Fn refresh 104function is equivalent to 105.Fn wnoutrefresh stdscr 106followed by 107.Fn doupdate . 108.Pp 109The 110.Fn leaveok 111function determines whether refresh operations may leave the screen cursor 112in an arbitrary position on the screen. 113Setting 114.Fa flag 115to 116.Dv FALSE 117ensures that the screen cursor is positioned at the current cursor 118position after a refresh operation has taken place. 119.Pp 120The 121.Fn flushok 122function is used to determine whether or not the screen's output file 123descriptor will be flushed on refresh. 124Setting 125.Fa flag 126to 127.Dv TRUE 128will cause the output to be flushed. 129.Sh RETURN VALUES 130Functions returning pointers will return 131.Dv NULL 132if an error is detected. 133The functions that return an int will return one of the following 134values: 135.Pp 136.Bl -tag -width ERR -compact 137.It Er OK 138The function completed successfully. 139.It Er ERR 140An error occurred in the function. 141.El 142.Sh SEE ALSO 143.Xr curses_pad 3 , 144.Xr curses_touch 3 , 145.Xr getch 3 146.Sh NOTES 147Calling 148.Fn wrefresh 149on a new, unchanged window has no effect. 150.Sh STANDARDS 151The 152.Nx 153Curses library complies with the X/Open Curses specification, part of the 154Single Unix Specification. 155.Sh HISTORY 156The Curses package appeared in 157.Bx 4.0 . 158