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