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