1.\" Copyright (c) 1985, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.\" from: @(#)curses.3 8.1 (Berkeley) 6/4/93 33.\" $Id: curses.3,v 1.5 1993/11/09 04:07:14 cgd Exp $ 34.\" 35.Dd June 4, 1993 36.Dt CURSES 3 37.Os BSD 4 38.Sh NAME 39.Nm curses 40.Nd screen functions with ``optimal'' cursor motion 41.Sh SYNOPSIS 42.Nm cc 43.Op Ar flags 44.Ar files 45.Fl lcurses ltermcap 46.Op Ar libraries 47.Sh DESCRIPTION 48These routines give the user a method of updating screens with reasonable 49optimization. They keep an image of the current screen, 50and the user sets up an image of a new one. Then the 51.Fn refresh 52tells the routines to make the current screen look like the new one. 53In order to initialize the routines, the routine 54.Fn initscr 55must be called before any of the other routines that deal with windows and 56screens are used. The routine 57.Fn endwin 58should be called before exiting. 59.Sh SEE ALSO 60.Xr ioctl 2 , 61.Xr getenv 3 , 62.Xr tty 4 , 63.Xr termcap 5 64.Rs 65.%T Screen Updating and Cursor Movement Optimization: A Library Package 66.%A Ken Arnold 67.Re 68.Sh AUTHOR 69.An Ken Arnold 70.Sh FUNCTIONS 71.Bl -column "subwin(win,lines,cols,begin_y,begin_x) " 72.It addch(ch) add a character to 73.Em stdscr 74.It addstr(str) add a string to 75.Em stdscr 76.It box(win,vert,hor) draw a box around a window 77.It cbreak() set cbreak mode 78.It clear() clear 79.Em stdscr 80.It clearok(scr,boolf) set clear flag for 81.Em scr 82.It clrtobot() clear to bottom on 83.Em stdscr 84.It clrtoeol() clear to end of line on 85.Em stdscr 86.It delch() delete a character 87.It deleteln() delete a line 88.It delwin(win) delete 89.Em stdscr 90.It echo() set echo mode 91.It endwin() end window modes 92.It erase() erase 93.Em stdscr 94.It flusok(win,boolf) set flush-on-refresh flag for 95.Em win 96.It getch() get a char through 97.Em stdscr 98.It getcap(name) get terminal capability 99.Em name 100.It getstr(str) get a string through 101.Em stdscr 102.It gettmode() get tty modes 103.It getyx(win,y,x) get (y,x) co-ordinates 104.It inch() get char at current (y,x) co-ordinates 105.It initscr() initialize screens 106.It insch(c) insert a char 107.It insertln() insert a line 108.It leaveok(win,boolf) set leave flag for 109.Em stdscr 110.It longname(termbuf,name) get long name from 111.Em termbuf 112.It move(y,x) move to (y,x) on 113.Em stdscr 114.It mvcur(lasty,lastx,newy,newx) actually move cursor 115.It newwin(lines,cols,begin_y,begin_x)\ create a new window 116.It nl() set newline mapping 117.It nocbreak() unset cbreak mode 118.It noecho() unset echo mode 119.It nonl() unset newline mapping 120.It noraw() unset raw mode 121.It overlay(win1,win2) overlay win1 on win2 122.It overwrite(win1,win2) overwrite win1 on top of win2 123.It printw(fmt,arg1,arg2,...) printf on 124.Em stdscr 125.It raw() set raw mode 126.It refresh() make current screen look like 127.Em stdscr 128.It resetty() reset tty flags to stored value 129.It savetty() stored current tty flags 130.It scanw(fmt,arg1,arg2,...) scanf through 131.Em stdscr 132.It scroll(win) scroll 133.Em win 134one line 135.It scrollok(win,boolf) set scroll flag 136.It setterm(name) set term variables for name 137.It standend() end standout mode 138.It standout() start standout mode 139.It subwin(win,lines,cols,begin_y,begin_x)\ create a subwindow 140.It touchline(win,y,sx,ex) mark line 141.Em y 142.Em sx 143through 144.Em sy 145as changed 146.It touchoverlap(win1,win2) mark overlap of 147.Em win1 148on 149.Em win2 150as changed 151.It touchwin(win) \*(lqchange\*(rq all of 152.Em win 153.It unctrl(ch) printable version of 154.Em ch 155.It waddch(win,ch) add char to 156.Em win 157.It waddstr(win,str) add string to 158.Em win 159.It wclear(win) clear 160.Em win 161.It wclrtobot(win) clear to bottom of 162.Em win 163.It wclrtoeol(win) clear to end of line on 164.Em win 165.It wdelch(win,c) delete char from 166.Em win 167.It wdeleteln(win) delete line from 168.Em win 169.It werase(win) erase 170.Em win 171.It wgetch(win) get a char through 172.Em win 173.It wgetstr(win,str) get a string through 174.Em win 175.It winch(win) get char at current (y,x) in 176.Em win 177.It winsch(win,c) insert char into 178.Em win 179.It winsertln(win) insert line into 180.Em win 181.It wmove(win,y,x) set current (y,x) co-ordinates on 182.Em win 183.It wprintw(win,fmt,arg1,arg2,...)\ printf on 184.Em win 185.It wrefresh(win) make screen look like 186.Em win 187.It wscanw(win,fmt,arg1,arg2,...)\ scanf through 188.Em win 189.It wstandend(win) end standout mode on 190.Em win 191.It wstandout(win) start standout mode on 192.Em win 193.El 194.Sh HISTORY 195The 196.Nm 197package appeared in 198.Bx 4.0 . 199