xref: /original-bsd/lib/libcurses/curses.3 (revision c3e32dec)
1.\" Copyright (c) 1985, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)curses.3	8.1 (Berkeley) 06/04/93
7.\"
8.Dd
9.Dt CURSES 3
10.Os BSD 4
11.Sh NAME
12.Nm curses
13.Nd screen functions with ``optimal'' cursor motion
14.Sh SYNOPSIS
15.Nm cc
16.Op Ar flags
17.Ar files
18.Fl lcurses ltermcap
19.Op Ar libraries
20.Sh DESCRIPTION
21These routines give the user a method of updating screens with reasonable
22optimization.  They keep an image of the current screen,
23and the user sets up an image of a new one.  Then the
24.Fn refresh
25tells the routines to make the current screen look like the new one.
26In order to initialize the routines, the routine
27.Fn initscr
28must be called before any of the other routines that deal with windows and
29screens are used.  The routine
30.Fn endwin
31should be called before exiting.
32.Sh SEE ALSO
33.Xr ioctl 2 ,
34.Xr getenv 3 ,
35.Xr tty 4 ,
36.Xr termcap 5
37.Rs
38.%T Screen Updating and Cursor Movement Optimization: A Library Package
39.%A Ken Arnold
40.Re
41.Sh AUTHOR
42.An Ken Arnold
43.Sh FUNCTIONS
44.Bl -column "subwin(win,lines,cols,begin_y,begin_x)   "
45.It addch(ch)	add a character to
46.Em stdscr
47.It addstr(str)	add a string to
48.Em stdscr
49.It box(win,vert,hor)	draw a box around a window
50.It cbreak()	set cbreak mode
51.It clear()	clear
52.Em stdscr
53.It clearok(scr,boolf)	set clear flag for
54.Em scr
55.It clrtobot()	clear to bottom on
56.Em stdscr
57.It clrtoeol()	clear to end of line on
58.Em stdscr
59.It delch()	delete a character
60.It deleteln()	delete a line
61.It delwin(win)	delete
62.Em stdscr
63.It echo()	set echo mode
64.It endwin()	end window modes
65.It erase()	erase
66.Em stdscr
67.It flusok(win,boolf)	set flush-on-refresh flag for
68.Em win
69.It getch()	get a char through
70.Em stdscr
71.It getcap(name)	get terminal capability
72.Em name
73.It getstr(str)	get a string through
74.Em stdscr
75.It gettmode()	get tty modes
76.It getyx(win,y,x)	get (y,x) co-ordinates
77.It inch()	get char at current (y,x) co-ordinates
78.It initscr()	initialize screens
79.It insch(c)	insert a char
80.It insertln()	insert a line
81.It leaveok(win,boolf)	set leave flag for
82.Em stdscr
83.It longname(termbuf,name)	get long name from
84.Em termbuf
85.It move(y,x)	move to (y,x) on
86.Em stdscr
87.It mvcur(lasty,lastx,newy,newx)	actually move cursor
88.It newwin(lines,cols,begin_y,begin_x)\ 	create a new window
89.It nl()	set newline mapping
90.It nocbreak()	unset cbreak mode
91.It noecho()	unset echo mode
92.It nonl()	unset newline mapping
93.It noraw()	unset raw mode
94.It overlay(win1,win2)	overlay win1 on win2
95.It overwrite(win1,win2)	overwrite win1 on top of win2
96.It printw(fmt,arg1,arg2,...)	printf on
97.Em stdscr
98.It raw()	set raw mode
99.It refresh()	make current screen look like
100.Em stdscr
101.It resetty()	reset tty flags to stored value
102.It savetty()	stored current tty flags
103.It scanw(fmt,arg1,arg2,...)	scanf through
104.Em stdscr
105.It scroll(win)	scroll
106.Em win
107one line
108.It scrollok(win,boolf)	set scroll flag
109.It setterm(name)	set term variables for name
110.It standend()	end standout mode
111.It standout()	start standout mode
112.It subwin(win,lines,cols,begin_y,begin_x)\ 	create a subwindow
113.It touchline(win,y,sx,ex)	mark line
114.Em y
115.Em sx
116through
117.Em sy
118as changed
119.It touchoverlap(win1,win2)	mark overlap of
120.Em win1
121on
122.Em win2
123as changed
124.It touchwin(win)	\*(lqchange\*(rq all of
125.Em win
126.It unctrl(ch)	printable version of
127.Em ch
128.It waddch(win,ch)	add char to
129.Em win
130.It waddstr(win,str)	add string to
131.Em win
132.It wclear(win)	clear
133.Em win
134.It wclrtobot(win)	clear to bottom of
135.Em win
136.It wclrtoeol(win)	clear to end of line on
137.Em win
138.It wdelch(win,c)	delete char from
139.Em win
140.It wdeleteln(win)	delete line from
141.Em win
142.It werase(win)	erase
143.Em win
144.It wgetch(win)	get a char through
145.Em win
146.It wgetstr(win,str)	get a string through
147.Em win
148.It winch(win)	get char at current (y,x) in
149.Em win
150.It winsch(win,c)	insert char into
151.Em win
152.It winsertln(win)	insert line into
153.Em win
154.It wmove(win,y,x)	set current (y,x) co-ordinates on
155.Em win
156.It wprintw(win,fmt,arg1,arg2,...)\ 	printf on
157.Em win
158.It wrefresh(win)	make screen look like
159.Em win
160.It wscanw(win,fmt,arg1,arg2,...)\ 	scanf through
161.Em win
162.It wstandend(win)	end standout mode on
163.Em win
164.It wstandout(win)	start standout mode on
165.Em win
166.El
167.Sh HISTORY
168The
169.Nm
170package appeared in
171.Bx 4.0 .
172