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