from Ken Arnold
[unix-history] / usr / src / lib / libcurses / curses.3
CommitLineData
844471ae
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
64f4641e 5.\" @(#)curses.3 6.2 (Berkeley) %G%
844471ae 6.\"
95bb4131 7.TH CURSES 3X ""
844471ae
KM
8.UC 4
9.SH NAME
10curses \- screen functions with ``optimal'' cursor motion
11.SH SYNOPSIS
64f4641e
KM
12.B # include <curses.h>
13.sp
844471ae 14.B cc
64f4641e 15\&...
844471ae 16.B \-lcurses \-ltermcap
844471ae 17.SH DESCRIPTION
eb74245b
KM
18These routines give the user a method of updating screens with reasonable
19optimization. They keep an image of the current screen,
20and the user sets up an image of a new one. Then the
844471ae 21.I refresh()
eb74245b
KM
22tells the routines to make the current screen look like the new one.
23In order to initialize the routines, the routine
844471ae 24.I initscr()
eb74245b
KM
25must be called before any of the other routines that deal with windows and
26screens are used. The routine
844471ae 27.I endwin()
64f4641e 28should always called before exiting.
844471ae
KM
29.SH SEE ALSO
30.I "Screen Updating and Cursor Movement Optimization: A Library Package,"
31Ken Arnold,
32.br
eb74245b
KM
33ioctl(2),
34getenv(3),
35tty(4),
844471ae
KM
36termcap(5)
37.SH AUTHOR
38Ken Arnold
39.SH FUNCTIONS
40.nf
64f4641e
KM
41.ds w \fIwin\fP
42.ds s \fIstdscr\fP
43.ds yx (\fIy\fP,\fIx\fP\|)
844471ae
KM
44.ta 3i
45addch(ch) add a character to \*s
46addstr(str) add a string to \*s
47box(win,vert,hor) draw a box around a window
64f4641e
KM
48baudrate() return current baud rate
49cbreak() set cbreak mode
844471ae 50clear() clear \*s
64f4641e 51clearok(scr,boolf) set clear flag for \fIscr\fP
844471ae
KM
52clrtobot() clear to bottom on \*s
53clrtoeol() clear to end of line on \*s
54delch() delete a character
55deleteln() delete a line
56delwin(win) delete \*w
57echo() set echo mode
58endwin() end window modes
59erase() erase \*s
64f4641e
KM
60erasechar() return user's erase char
61flusok(win,boolf) set flush-on-refresh flag for \*w
62fullname(termbuf,name) get full name from \fItermbuf\fP
844471ae 63getch() get a char through \*s
64f4641e 64getcap(name) get terminal capability \fIname\fP
844471ae
KM
65getstr(str) get a string through \*s
66gettmode() get tty modes
64f4641e
KM
67getyx(win,y,x) get \*(yx co-ordinates
68idlok(win,boolf) set use-insert/delete-line for \*w
69inch() get char at current \*(yx co-ordinates
844471ae
KM
70initscr() initialize screens
71insch(c) insert a char
72insertln() insert a line
64f4641e 73killchar() return user's kill char
844471ae 74leaveok(win,boolf) set leave flag for \*w
64f4641e
KM
75longname(termbuf,name) get long name from \fItermbuf\fP
76move(y,x) move to \*(yx on \*s
844471ae 77mvcur(lasty,lastx,newy,newx) actually move cursor
64f4641e 78mvwin(win,y,x) move \*w pos to \*(yx
844471ae
KM
79newwin(lines,cols,begin_y,begin_x)\ create a new window
80nl() set newline mapping
64f4641e 81nocbreak() unset cbreak mode
844471ae
KM
82noecho() unset echo mode
83nonl() unset newline mapping
84noraw() unset raw mode
85overlay(win1,win2) overlay win1 on win2
86overwrite(win1,win2) overwrite win1 on top of win2
87printw(fmt,arg1,arg2,...) printf on \*s
88raw() set raw mode
89refresh() make current screen look like \*s
90resetty() reset tty flags to stored value
91savetty() stored current tty flags
92scanw(fmt,arg1,arg2,...) scanf through \*s
93scroll(win) scroll \*w one line
94scrollok(win,boolf) set scroll flag
95setterm(name) set term variables for name
96standend() end standout mode
97standout() start standout mode
98subwin(win,lines,cols,begin_y,begin_x)\ create a subwindow
64f4641e
KM
99touchline(win,y,sx,ex) mark line \fIy\fP \fIsx\fP through \fIsy\fP as changed
100touchoverlap(win1,win2) mark overlap of \fIwin1\fP on \fIwin2\fP as changed
844471ae 101touchwin(win) \*(lqchange\*(rq all of \*w
64f4641e 102unctrl(ch) printable version of \fIch\fP
844471ae
KM
103waddch(win,ch) add char to \*w
104waddstr(win,str) add string to \*w
105wclear(win) clear \*w
106wclrtobot(win) clear to bottom of \*w
107wclrtoeol(win) clear to end of line on \*w
108wdelch(win,c) delete char from \*w
109wdeleteln(win) delete line from \*w
110werase(win) erase \*w
111wgetch(win) get a char through \*w
112wgetstr(win,str) get a string through \*w
64f4641e 113winch(win) get char at current \*(yx in \*w
844471ae
KM
114winsch(win,c) insert char into \*w
115winsertln(win) insert line into \*w
64f4641e 116wmove(win,y,x) set current \*(yx co-ordinates on \*w
844471ae
KM
117wprintw(win,fmt,arg1,arg2,...)\ printf on \*w
118wrefresh(win) make screen look like \*w
119wscanw(win,fmt,arg1,arg2,...)\ scanf through \*w
120wstandend(win) end standout mode on \*w
121wstandout(win) start standout mode on \*w
eb74245b 122.SH BUGS
64f4641e
KM
123.PP
124.IR getch() ,
125.IR getstr() ,
126and
127.IR scanw()
128have been rarely used,
129and are probably buggy.
130.PP
131Insert/delete line and char sequences
132are not used as often as they should be,
133and scrolling regions are not used at all.