4 <STRONG>ncurses</STRONG> - CRT screen handling and optimization package
9 <STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
13 <H2>DESCRIPTION</H2><PRE>
14 The <STRONG>ncurses</STRONG> library routines give the user a terminal-
15 independent method of updating character screens with
16 reasonable optimization. This implementation is ``new
17 curses'' (ncurses) and is the approved replacement for
18 4.4BSD classic curses, which has been discontinued.
20 The <STRONG>ncurses</STRONG> routines emulate the <STRONG><A HREF="ncurses.3x.html">curses(3X)</A></STRONG> library of
21 System V Release 4 UNIX, and the XPG4 curses standard (XSI
22 curses) but the <STRONG>ncurses</STRONG> library is freely redistributable
23 in source form. Differences from the SVr4 curses are
24 summarized under the EXTENSIONS and BUGS sections below
25 and described in detail in the EXTENSIONS and BUGS
26 sections of individual man pages.
28 A program using these routines must be linked with the
29 <STRONG>-lncurses</STRONG> option, or (if it has been generated) with the
30 debugging library <STRONG>-lncurses_g</STRONG>. (Your system integrator
31 may also have installed these libraries under the names
32 <STRONG>-lcurses</STRONG> and <STRONG>-lcurses_g</STRONG>.) The ncurses_g library generates
33 trace logs (in a file called 'trace' in the current
34 directory) that describe curses actions.
36 The <STRONG>ncurses</STRONG> package supports: overall screen, window and
37 pad manipulation; output to windows and pads; reading
38 terminal input; control over terminal and <STRONG>curses</STRONG> input and
39 output options; environment query routines; color
40 manipulation; use of soft label keys; terminfo
41 capabilities; and access to low-level terminal-
42 manipulation routines.
44 To initialize the routines, the routine <STRONG>initscr</STRONG> or <STRONG>newterm</STRONG>
45 must be called before any of the other routines that deal
46 with windows and screens are used. The routine <STRONG>endwin</STRONG>
47 must be called before exiting. To get character-at-a-time
48 input without echoing (most interactive, screen oriented
49 programs want this), the following sequence should be
52 <STRONG>initscr();</STRONG> <STRONG>cbreak();</STRONG> <STRONG>noecho();</STRONG>
54 Most programs would additionally use the sequence:
56 <STRONG>nonl();</STRONG>
57 <STRONG>intrflush(stdscr,</STRONG> <STRONG>FALSE);</STRONG>
58 <STRONG>keypad(stdscr,</STRONG> <STRONG>TRUE);</STRONG>
60 defined, must be output. This can be done by executing
61 the <STRONG>tput</STRONG> <STRONG>init</STRONG> command after the shell environment variable
62 <STRONG>TERM</STRONG> has been exported. <STRONG>tset(1)</STRONG> is usually responsible
63 for doing this. [See <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> for further details.]
65 The <STRONG>ncurses</STRONG> library permits manipulation of data
66 structures, called <EM>windows</EM>, which can be thought of as
67 two-dimensional arrays of characters representing all or
68 part of a CRT screen. A default window called <STRONG>stdscr</STRONG>,
69 which is the size of the terminal screen, is supplied.
70 Others may be created with <STRONG>newwin</STRONG>.
72 Note that <STRONG>curses</STRONG> does not handle overlapping windows,
73 that's done by the <STRONG><A HREF="panel.3x.html">panel(3X)</A></STRONG> library. This means that you
74 can either use <STRONG>stdscr</STRONG> or divide the screen into tiled
75 windows and not using <STRONG>stdscr</STRONG> at all. Mixing the two will
76 result in unpredictable, and undesired, effects.
78 Windows are referred to by variables declared as <STRONG>WINDOW</STRONG> <STRONG>*</STRONG>.
79 These data structures are manipulated with routines
80 described here and elsewhere in the <STRONG>ncurses</STRONG> manual pages.
81 Among which the most basic routines are <STRONG>move</STRONG> and <STRONG>addch</STRONG>.
82 More general versions of these routines are included with
83 names beginning with <STRONG>w</STRONG>, allowing the user to specify a
84 window. The routines not beginning with <STRONG>w</STRONG> affect <STRONG>stdscr</STRONG>.)
86 After using routines to manipulate a window, <STRONG>refresh</STRONG> is
87 called, telling <STRONG>curses</STRONG> to make the user's CRT screen look
88 like <STRONG>stdscr</STRONG>. The characters in a window are actually of
89 type <STRONG>chtype</STRONG>, (character and attribute data) so that other
90 information about the character may also be stored with
93 Special windows called <EM>pads</EM> may also be manipulated.
94 These are windows which are not constrained to the size of
95 the screen and whose contents need not be completely
96 displayed. See <STRONG><A HREF="curs_pad.3x.html">curs_pad(3X)</A></STRONG> for more information.
98 In addition to drawing characters on the screen, video
99 attributes and colors may be supported, causing the
100 characters to show up in such modes as underlined, in
101 reverse video, or in color on terminals that support such
102 display enhancements. Line drawing characters may be
103 specified to be output. On input, <STRONG>curses</STRONG> is also able to
104 translate arrow and function keys that transmit escape
105 sequences into single values. The video attributes, line
106 drawing characters, and input values use names, defined in
107 <STRONG><curses.h></STRONG>, such as <STRONG>A_REVERSE</STRONG>, <STRONG>ACS_HLINE</STRONG>, and <STRONG>KEY_LEFT</STRONG>.
109 If the environment variables <STRONG>LINES</STRONG> and <STRONG>COLUMNS</STRONG> are set, or
110 if the program is executing in a window environment, line
111 and column information in the environment will override
112 of a screen is changeable (see <STRONG>ENVIRONMENT</STRONG>).
114 If the environment variable <STRONG>TERMINFO</STRONG> is defined, any
115 program using <STRONG>curses</STRONG> checks for a local terminal
116 definition before checking in the standard place. For
117 example, if <STRONG>TERM</STRONG> is set to <STRONG>att4424</STRONG>, then the compiled
118 terminal definition is found in
120 <STRONG>@DATADIR@/terminfo/a/att4424</STRONG>.
122 (The <STRONG>a</STRONG> is copied from the first letter of <STRONG>att4424</STRONG> to avoid
123 creation of huge directories.) However, if <STRONG>TERMINFO</STRONG> is
124 set to <STRONG>$HOME/myterms</STRONG>, <STRONG>curses</STRONG> first checks
126 <STRONG>$HOME/myterms/a/att4424</STRONG>,
128 and if that fails, it then checks
130 <STRONG>@DATADIR@/terminfo/a/att4424</STRONG>.
132 This is useful for developing experimental definitions or
133 when write permission in <STRONG>@DATADIR@/terminfo</STRONG> is not
136 The integer variables <STRONG>LINES</STRONG> and <STRONG>COLS</STRONG> are defined in
137 <STRONG><curses.h></STRONG> and will be filled in by <STRONG>initscr</STRONG> with the size
138 of the screen. The constants <STRONG>TRUE</STRONG> and <STRONG>FALSE</STRONG> have the
139 values <STRONG>1</STRONG> and <STRONG>0</STRONG>, respectively.
141 The <STRONG>curses</STRONG> routines also define the <STRONG>WINDOW</STRONG> <STRONG>*</STRONG> variable
142 <STRONG>curscr</STRONG> which is used for certain low-level operations like
143 clearing and redrawing a screen containing garbage. The
144 <STRONG>curscr</STRONG> can be used in only a few routines.
147 <STRONG>Routine</STRONG> <STRONG>and</STRONG> <STRONG>Argument</STRONG> <STRONG>Names</STRONG>
148 Many <STRONG>curses</STRONG> routines have two or more versions. The
149 routines prefixed with <STRONG>w</STRONG> require a window argument. The
150 routines prefixed with <STRONG>p</STRONG> require a pad argument. Those
151 without a prefix generally use <STRONG>stdscr</STRONG>.
153 The routines prefixed with <STRONG>mv</STRONG> require a <EM>y</EM> and <EM>x</EM> coordinate
154 to move to before performing the appropriate action. The
155 <STRONG>mv</STRONG> routines imply a call to <STRONG>move</STRONG> before the call to the
156 other routine. The coordinate <EM>y</EM> always refers to the row
157 (of the window), and <EM>x</EM> always refers to the column. The
158 upper left-hand corner is always (0,0), not (1,1).
160 The routines prefixed with <STRONG>mvw</STRONG> take both a window argument
161 and <EM>x</EM> and <EM>y</EM> coordinates. The window argument is always
162 specified before the coordinates.
164 <STRONG>WINDOW</STRONG>.
166 Option setting routines require a Boolean flag <EM>bf</EM> with the
167 value <STRONG>TRUE</STRONG> or <STRONG>FALSE</STRONG>; <EM>bf</EM> is always of type <STRONG>bool</STRONG>. The
168 variables <EM>ch</EM> and <EM>attrs</EM> below are always of type <STRONG>chtype</STRONG>.
169 The types <STRONG>WINDOW</STRONG>, <STRONG>SCREEN</STRONG>, <STRONG>bool</STRONG>, and <STRONG>chtype</STRONG> are defined in
170 <STRONG><curses.h></STRONG>. The type <STRONG>TERMINAL</STRONG> is defined in <STRONG><term.h></STRONG>.
171 All other arguments are integers.
174 <STRONG>Routine</STRONG> <STRONG>Name</STRONG> <STRONG>Index</STRONG>
175 The following table lists each <STRONG>curses</STRONG> routine and the name
176 of the manual page on which it is described. Routines
177 flagged with `*' are ncurses-specific, not described by
178 XPG4 or present in SVr4.
180 center tab(/); l l l l . <STRONG>curses</STRONG> Routine Name/Manual Page
181 Name = addch/<STRONG><A HREF="curs_addch.3x.html">curs_addch(3X)</A></STRONG> addchnstr/<STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3X)</A></STRONG>
182 addchstr/<STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3X)</A></STRONG> addnstr/<STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3X)</A></STRONG>
183 addstr/<STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3X)</A></STRONG> attr_get/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG>
184 attr_off/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG> attr_on/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG>
185 attr_set/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG> attroff/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG>
186 attron/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG> attrset/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG>
187 baudrate/<STRONG><A HREF="curs_termattrs.3x.html">curs_termattrs(3X)</A></STRONG> beep/<STRONG><A HREF="curs_beep.3x.html">curs_beep(3X)</A></STRONG>
188 bkgd/<STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3X)</A></STRONG> bkgdset/<STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3X)</A></STRONG>
189 border/<STRONG><A HREF="curs_border.3x.html">curs_border(3X)</A></STRONG> box/<STRONG><A HREF="curs_border.3x.html">curs_border(3X)</A></STRONG>
190 can_change_color/<STRONG><A HREF="curs_color.3x.html">curs_color(3X)</A></STRONG> cbreak/<STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3X)</A></STRONG>
191 chgat/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG> clear/<STRONG><A HREF="curs_clear.3x.html">curs_clear(3X)</A></STRONG>
192 clearok/<STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3X)</A></STRONG> clrtobot/<STRONG><A HREF="curs_clear.3x.html">curs_clear(3X)</A></STRONG>
193 clrtoeol/<STRONG><A HREF="curs_clear.3x.html">curs_clear(3X)</A></STRONG> color_content/<STRONG><A HREF="curs_color.3x.html">curs_color(3X)</A></STRONG>
194 color_set/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG> copywin/<STRONG><A HREF="curs_overlay.3x.html">curs_overlay(3X)</A></STRONG>
195 curs_set/<STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3X)</A></STRONG> def_prog_mode/<STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3X)</A></STRONG>
196 def_shell_mode/<STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3X)</A></STRONG> define_key/<STRONG><A HREF="define_key.3x.html">define_key(3X)</A></STRONG>*
197 del_curterm/<STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3X)</A></STRONG> delay_output/<STRONG><A HREF="curs_util.3x.html">curs_util(3X)</A></STRONG>
198 delch/<STRONG><A HREF="curs_delch.3x.html">curs_delch(3X)</A></STRONG> deleteln/<STRONG><A HREF="curs_deleteln.3x.html">curs_deleteln(3X)</A></STRONG>
199 delscreen/<STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3X)</A></STRONG> delwin/<STRONG><A HREF="curs_window.3x.html">curs_window(3X)</A></STRONG>
200 derwin/<STRONG><A HREF="curs_window.3x.html">curs_window(3X)</A></STRONG> doupdate/<STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3X)</A></STRONG>
201 dupwin/<STRONG><A HREF="curs_window.3x.html">curs_window(3X)</A></STRONG> echo/<STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3X)</A></STRONG>
202 echochar/<STRONG><A HREF="curs_addch.3x.html">curs_addch(3X)</A></STRONG> endwin/<STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3X)</A></STRONG>
203 erase/<STRONG><A HREF="curs_clear.3x.html">curs_clear(3X)</A></STRONG> erasechar/<STRONG><A HREF="curs_termattrs.3x.html">curs_termattrs(3X)</A></STRONG>
204 filter/<STRONG><A HREF="curs_util.3x.html">curs_util(3X)</A></STRONG> flash/<STRONG><A HREF="curs_beep.3x.html">curs_beep(3X)</A></STRONG>
205 flushinp/<STRONG><A HREF="curs_util.3x.html">curs_util(3X)</A></STRONG> getbegyx/<STRONG><A HREF="curs_getyx.3x.html">curs_getyx(3X)</A></STRONG>
206 getbkgd/<STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3X)</A></STRONG> getch/<STRONG><A HREF="curs_getch.3x.html">curs_getch(3X)</A></STRONG>
207 getmaxyx/<STRONG><A HREF="curs_getyx.3x.html">curs_getyx(3X)</A></STRONG> getmouse/<STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3X)</A></STRONG>*
208 getnstr/<STRONG><A HREF="curs_getstr.3x.html">curs_getstr(3X)</A></STRONG> getparyx/<STRONG><A HREF="curs_getyx.3x.html">curs_getyx(3X)</A></STRONG>
209 getstr/<STRONG><A HREF="curs_getstr.3x.html">curs_getstr(3X)</A></STRONG> getsyx/<STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3X)</A></STRONG>
210 getwin/<STRONG><A HREF="curs_util.3x.html">curs_util(3X)</A></STRONG> getyx/<STRONG><A HREF="curs_getyx.3x.html">curs_getyx(3X)</A></STRONG>
211 halfdelay/<STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3X)</A></STRONG> has_colors/<STRONG><A HREF="curs_color.3x.html">curs_color(3X)</A></STRONG>
212 has_ic/<STRONG><A HREF="curs_termattrs.3x.html">curs_termattrs(3X)</A></STRONG> has_il/<STRONG><A HREF="curs_termattrs.3x.html">curs_termattrs(3X)</A></STRONG>
213 has_key/<STRONG><A HREF="curs_getch.3x.html">curs_getch(3X)</A></STRONG>* hline/<STRONG><A HREF="curs_border.3x.html">curs_border(3X)</A></STRONG>
214 idcok/<STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3X)</A></STRONG> idlok/<STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3X)</A></STRONG>
215 immedok/<STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3X)</A></STRONG> inch/<STRONG><A HREF="curs_inch.3x.html">curs_inch(3X)</A></STRONG>
216 initscr/<STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3X)</A></STRONG> innstr/<STRONG><A HREF="curs_instr.3x.html">curs_instr(3X)</A></STRONG>
217 insch/<STRONG><A HREF="curs_insch.3x.html">curs_insch(3X)</A></STRONG> insdelln/<STRONG><A HREF="curs_deleteln.3x.html">curs_deleteln(3X)</A></STRONG>
218 insertln/<STRONG><A HREF="curs_deleteln.3x.html">curs_deleteln(3X)</A></STRONG> insnstr/<STRONG><A HREF="curs_insstr.3x.html">curs_insstr(3X)</A></STRONG>
219 insstr/<STRONG><A HREF="curs_insstr.3x.html">curs_insstr(3X)</A></STRONG> instr/<STRONG><A HREF="curs_instr.3x.html">curs_instr(3X)</A></STRONG>
220 intrflush/<STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3X)</A></STRONG> is_linetouched/<STRONG><A HREF="curs_touch.3x.html">curs_touch(3X)</A></STRONG>
221 is_wintouched/<STRONG><A HREF="curs_touch.3x.html">curs_touch(3X)</A></STRONG> isendwin/<STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3X)</A></STRONG>
222 keyname/<STRONG><A HREF="curs_util.3x.html">curs_util(3X)</A></STRONG> keyok/<STRONG><A HREF="keyok.3x.html">keyok(3X)</A></STRONG>*
223 keypad/<STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3X)</A></STRONG> killchar/<STRONG><A HREF="curs_termattrs.3x.html">curs_termattrs(3X)</A></STRONG>
224 leaveok/<STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3X)</A></STRONG> longname/<STRONG><A HREF="curs_termattrs.3x.html">curs_termattrs(3X)</A></STRONG>
225 mcprint/<STRONG><A HREF="curs_print.3x.html">curs_print(3X)</A></STRONG>* meta/<STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3X)</A></STRONG>
226 mouseinterval/<STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3X)</A></STRONG>* mousemask/<STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3X)</A></STRONG>*
227 move/<STRONG><A HREF="curs_move.3x.html">curs_move(3X)</A></STRONG> mvaddch/<STRONG><A HREF="curs_addch.3x.html">curs_addch(3X)</A></STRONG>
228 mvaddchnstr/<STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3X)</A></STRONG> mvaddchstr/<STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3X)</A></STRONG>
229 mvaddnstr/<STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3X)</A></STRONG> mvaddstr/<STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3X)</A></STRONG>
230 mvchgat/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG> mvcur/<STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3X)</A></STRONG>
231 mvdelch/<STRONG><A HREF="curs_delch.3x.html">curs_delch(3X)</A></STRONG> mvderwin/<STRONG><A HREF="curs_window.3x.html">curs_window(3X)</A></STRONG>
232 mvgetch/<STRONG><A HREF="curs_getch.3x.html">curs_getch(3X)</A></STRONG> mvgetnstr/<STRONG><A HREF="curs_getstr.3x.html">curs_getstr(3X)</A></STRONG>
233 mvgetstr/<STRONG><A HREF="curs_getstr.3x.html">curs_getstr(3X)</A></STRONG> mvhline/<STRONG><A HREF="curs_border.3x.html">curs_border(3X)</A></STRONG>
234 mvinch/<STRONG><A HREF="curs_inch.3x.html">curs_inch(3X)</A></STRONG> mvinchnstr/<STRONG><A HREF="curs_inchstr.3x.html">curs_inchstr(3X)</A></STRONG>
235 mvinchstr/<STRONG><A HREF="curs_inchstr.3x.html">curs_inchstr(3X)</A></STRONG> mvinnstr/<STRONG><A HREF="curs_instr.3x.html">curs_instr(3X)</A></STRONG>
236 mvinsch/<STRONG><A HREF="curs_insch.3x.html">curs_insch(3X)</A></STRONG> mvinsnstr/<STRONG><A HREF="curs_insstr.3x.html">curs_insstr(3X)</A></STRONG>
237 mvinsstr/<STRONG><A HREF="curs_insstr.3x.html">curs_insstr(3X)</A></STRONG> mvinstr/<STRONG><A HREF="curs_instr.3x.html">curs_instr(3X)</A></STRONG>
238 mvprintw/<STRONG><A HREF="curs_printw.3x.html">curs_printw(3X)</A></STRONG> mvscanw/<STRONG><A HREF="curs_scanw.3x.html">curs_scanw(3X)</A></STRONG>
239 mvwaddch/<STRONG><A HREF="curs_addch.3x.html">curs_addch(3X)</A></STRONG> mvwaddchnstr/<STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3X)</A></STRONG>
240 mvwaddchstr/<STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3X)</A></STRONG> mvwaddnstr/<STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3X)</A></STRONG>
241 mvwaddstr/<STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3X)</A></STRONG> mvwchgat/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG>
242 mvwdelch/<STRONG><A HREF="curs_delch.3x.html">curs_delch(3X)</A></STRONG> mvwgetch/<STRONG><A HREF="curs_getch.3x.html">curs_getch(3X)</A></STRONG>
243 mvwgetnstr/<STRONG><A HREF="curs_getstr.3x.html">curs_getstr(3X)</A></STRONG> mvwgetstr/<STRONG><A HREF="curs_getstr.3x.html">curs_getstr(3X)</A></STRONG>
244 mvwhline/<STRONG><A HREF="curs_border.3x.html">curs_border(3X)</A></STRONG> mvwin/<STRONG><A HREF="curs_window.3x.html">curs_window(3X)</A></STRONG>
245 mvwinch/<STRONG><A HREF="curs_inch.3x.html">curs_inch(3X)</A></STRONG> mvwinchnstr/<STRONG><A HREF="curs_inchstr.3x.html">curs_inchstr(3X)</A></STRONG>
246 mvwinchstr/<STRONG><A HREF="curs_inchstr.3x.html">curs_inchstr(3X)</A></STRONG> mvwinnstr/<STRONG><A HREF="curs_instr.3x.html">curs_instr(3X)</A></STRONG>
247 mvwinsch/<STRONG><A HREF="curs_insch.3x.html">curs_insch(3X)</A></STRONG> mvwinsnstr/<STRONG><A HREF="curs_insstr.3x.html">curs_insstr(3X)</A></STRONG>
248 mvwinsstr/<STRONG><A HREF="curs_insstr.3x.html">curs_insstr(3X)</A></STRONG> mvwinstr/<STRONG><A HREF="curs_instr.3x.html">curs_instr(3X)</A></STRONG>
249 mvwprintw/<STRONG><A HREF="curs_printw.3x.html">curs_printw(3X)</A></STRONG> mvwscanw/<STRONG><A HREF="curs_scanw.3x.html">curs_scanw(3X)</A></STRONG>
250 mvwvline/<STRONG><A HREF="curs_border.3x.html">curs_border(3X)</A></STRONG> napms/<STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3X)</A></STRONG>
251 newpad/<STRONG><A HREF="curs_pad.3x.html">curs_pad(3X)</A></STRONG> newterm/<STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3X)</A></STRONG>
252 newwin/<STRONG><A HREF="curs_window.3x.html">curs_window(3X)</A></STRONG> nl/<STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3X)</A></STRONG>
253 nocbreak/<STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3X)</A></STRONG> nodelay/<STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3X)</A></STRONG>
254 noecho/<STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3X)</A></STRONG> nonl/<STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3X)</A></STRONG>
255 noqiflush/<STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3X)</A></STRONG> noraw/<STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3X)</A></STRONG>
256 notimeout/<STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3X)</A></STRONG> overlay/<STRONG><A HREF="curs_overlay.3x.html">curs_overlay(3X)</A></STRONG>
257 overwrite/<STRONG><A HREF="curs_overlay.3x.html">curs_overlay(3X)</A></STRONG> pair_content/<STRONG><A HREF="curs_color.3x.html">curs_color(3X)</A></STRONG>
258 pechochar/<STRONG><A HREF="curs_pad.3x.html">curs_pad(3X)</A></STRONG> pnoutrefresh/<STRONG><A HREF="curs_pad.3x.html">curs_pad(3X)</A></STRONG>
259 prefresh/<STRONG><A HREF="curs_pad.3x.html">curs_pad(3X)</A></STRONG> printw/<STRONG><A HREF="curs_printw.3x.html">curs_printw(3X)</A></STRONG>
260 putp/<STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3X)</A></STRONG> putwin/<STRONG><A HREF="curs_util.3x.html">curs_util(3X)</A></STRONG>
261 qiflush/<STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3X)</A></STRONG> raw/<STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3X)</A></STRONG>
262 redrawwin/<STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3X)</A></STRONG> refresh/<STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3X)</A></STRONG>
263 reset_prog_mode/<STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3X)</A></STRONG>
264 reset_shell_mode/<STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3X)</A></STRONG> resetty/<STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3X)</A></STRONG>
265 resizeterm/<STRONG><A HREF="resizeterm.3x.html">resizeterm(3X)</A></STRONG>* restartterm/<STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3X)</A></STRONG>
266 ripoffline/<STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3X)</A></STRONG> savetty/<STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3X)</A></STRONG>
267 scanw/<STRONG><A HREF="curs_scanw.3x.html">curs_scanw(3X)</A></STRONG> scr_dump/<STRONG><A HREF="curs_scr_dump.3x.html">curs_scr_dump(3X)</A></STRONG>
268 scroll/<STRONG><A HREF="curs_scroll.3x.html">curs_scroll(3X)</A></STRONG> scrollok/<STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3X)</A></STRONG>
269 set_curterm/<STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3X)</A></STRONG> set_term/<STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3X)</A></STRONG>
270 setscrreg/<STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3X)</A></STRONG> setsyx/<STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3X)</A></STRONG>
271 setterm/<STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3X)</A></STRONG> setupterm/<STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3X)</A></STRONG>
272 slk_attr/<STRONG><A HREF="curs_slk.3x.html">curs_slk(3X)</A></STRONG>* slk_attr_off/<STRONG><A HREF="curs_slk.3x.html">curs_slk(3X)</A></STRONG>
273 slk_attr_on/<STRONG><A HREF="curs_slk.3x.html">curs_slk(3X)</A></STRONG> slk_attr_set/<STRONG><A HREF="curs_slk.3x.html">curs_slk(3X)</A></STRONG>
274 slk_attroff/<STRONG><A HREF="curs_slk.3x.html">curs_slk(3X)</A></STRONG> slk_attron/<STRONG><A HREF="curs_slk.3x.html">curs_slk(3X)</A></STRONG>
275 slk_attrset/<STRONG><A HREF="curs_slk.3x.html">curs_slk(3X)</A></STRONG> slk_clear/<STRONG><A HREF="curs_slk.3x.html">curs_slk(3X)</A></STRONG>
276 slk_color/<STRONG><A HREF="curs_slk.3x.html">curs_slk(3X)</A></STRONG> slk_init/<STRONG><A HREF="curs_slk.3x.html">curs_slk(3X)</A></STRONG>
277 slk_label/<STRONG><A HREF="curs_slk.3x.html">curs_slk(3X)</A></STRONG> slk_noutrefresh/<STRONG><A HREF="curs_slk.3x.html">curs_slk(3X)</A></STRONG>
278 slk_refresh/<STRONG><A HREF="curs_slk.3x.html">curs_slk(3X)</A></STRONG> slk_restore/<STRONG><A HREF="curs_slk.3x.html">curs_slk(3X)</A></STRONG>
279 slk_set/<STRONG><A HREF="curs_slk.3x.html">curs_slk(3X)</A></STRONG> slk_touch/<STRONG><A HREF="curs_slk.3x.html">curs_slk(3X)</A></STRONG>
280 standend/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG> standout/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG>
281 start_color/<STRONG><A HREF="curs_color.3x.html">curs_color(3X)</A></STRONG> subpad/<STRONG><A HREF="curs_pad.3x.html">curs_pad(3X)</A></STRONG>
282 subwin/<STRONG><A HREF="curs_window.3x.html">curs_window(3X)</A></STRONG> syncok/<STRONG><A HREF="curs_window.3x.html">curs_window(3X)</A></STRONG>
283 termattrs/<STRONG><A HREF="curs_termattrs.3x.html">curs_termattrs(3X)</A></STRONG> termname/<STRONG><A HREF="curs_termattrs.3x.html">curs_termattrs(3X)</A></STRONG>
284 tgetent/<STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3X)</A></STRONG> tgetflag/<STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3X)</A></STRONG>
285 tgetnum/<STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3X)</A></STRONG> tgetstr/<STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3X)</A></STRONG>
286 tgoto/<STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3X)</A></STRONG> tigetflag/<STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3X)</A></STRONG>
287 tigetnum/<STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3X)</A></STRONG> tigetstr/<STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3X)</A></STRONG>
288 timeout/<STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3X)</A></STRONG> touchline/<STRONG><A HREF="curs_touch.3x.html">curs_touch(3X)</A></STRONG>
289 touchwin/<STRONG><A HREF="curs_touch.3x.html">curs_touch(3X)</A></STRONG> tparm/<STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3X)</A></STRONG>
290 tputs/<STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3X)</A></STRONG> tputs/<STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3X)</A></STRONG>
291 typeahead/<STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3X)</A></STRONG> unctrl/<STRONG><A HREF="curs_util.3x.html">curs_util(3X)</A></STRONG>
292 ungetch/<STRONG><A HREF="curs_getch.3x.html">curs_getch(3X)</A></STRONG> ungetmouse/<STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3X)</A></STRONG>*
293 untouchwin/<STRONG><A HREF="curs_touch.3x.html">curs_touch(3X)</A></STRONG> use_default_colors/<STRONG><A HREF="dft_fgbg.3x.html">dft_fgbg(3X)</A></STRONG>*
294 use_env/<STRONG><A HREF="curs_util.3x.html">curs_util(3X)</A></STRONG> vidattr/<STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3X)</A></STRONG>
295 vidputs/<STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3X)</A></STRONG> vline/<STRONG><A HREF="curs_border.3x.html">curs_border(3X)</A></STRONG>
296 vw_printw/<STRONG><A HREF="curs_printw.3x.html">curs_printw(3X)</A></STRONG> vw_scanw/<STRONG><A HREF="curs_scanw.3x.html">curs_scanw(3X)</A></STRONG>
297 vwprintw/<STRONG><A HREF="curs_printw.3x.html">curs_printw(3X)</A></STRONG> vwscanw/<STRONG><A HREF="curs_scanw.3x.html">curs_scanw(3X)</A></STRONG>
298 waddch/<STRONG><A HREF="curs_addch.3x.html">curs_addch(3X)</A></STRONG> waddchnstr/<STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3X)</A></STRONG>
299 waddchstr/<STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3X)</A></STRONG> waddnstr/<STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3X)</A></STRONG>
300 waddstr/<STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3X)</A></STRONG> wattr_get/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG>
301 wattr_off/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG> wattr_on/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG>
302 wattr_set/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG> wattroff/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG>
303 wattron/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG> wattrset/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG>
304 wbkgd/<STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3X)</A></STRONG> wbkgdset/<STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3X)</A></STRONG>
305 wborder/<STRONG><A HREF="curs_border.3x.html">curs_border(3X)</A></STRONG> wchgat/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG>
306 wclear/<STRONG><A HREF="curs_clear.3x.html">curs_clear(3X)</A></STRONG> wclrtobot/<STRONG><A HREF="curs_clear.3x.html">curs_clear(3X)</A></STRONG>
307 wclrtoeol/<STRONG><A HREF="curs_clear.3x.html">curs_clear(3X)</A></STRONG> wcolor_set/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG>
308 wcursyncup/<STRONG><A HREF="curs_window.3x.html">curs_window(3X)</A></STRONG> wdelch/<STRONG><A HREF="curs_delch.3x.html">curs_delch(3X)</A></STRONG>
309 wdeleteln/<STRONG><A HREF="curs_deleteln.3x.html">curs_deleteln(3X)</A></STRONG> wechochar/<STRONG><A HREF="curs_addch.3x.html">curs_addch(3X)</A></STRONG>
310 wenclose/<STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3X)</A></STRONG>* werase/<STRONG><A HREF="curs_clear.3x.html">curs_clear(3X)</A></STRONG>
311 wgetch/<STRONG><A HREF="curs_getch.3x.html">curs_getch(3X)</A></STRONG> wgetnstr/<STRONG><A HREF="curs_getstr.3x.html">curs_getstr(3X)</A></STRONG>
312 wgetstr/<STRONG><A HREF="curs_getstr.3x.html">curs_getstr(3X)</A></STRONG> whline/<STRONG><A HREF="curs_border.3x.html">curs_border(3X)</A></STRONG>
313 winch/<STRONG><A HREF="curs_inch.3x.html">curs_inch(3X)</A></STRONG> winchnstr/<STRONG><A HREF="curs_inchstr.3x.html">curs_inchstr(3X)</A></STRONG>
314 winchstr/<STRONG><A HREF="curs_inchstr.3x.html">curs_inchstr(3X)</A></STRONG> winnstr/<STRONG><A HREF="curs_instr.3x.html">curs_instr(3X)</A></STRONG>
315 winsch/<STRONG><A HREF="curs_insch.3x.html">curs_insch(3X)</A></STRONG> winsdelln/<STRONG><A HREF="curs_deleteln.3x.html">curs_deleteln(3X)</A></STRONG>
316 winsertln/<STRONG><A HREF="curs_deleteln.3x.html">curs_deleteln(3X)</A></STRONG> winsnstr/<STRONG><A HREF="curs_insstr.3x.html">curs_insstr(3X)</A></STRONG>
317 winsstr/<STRONG><A HREF="curs_insstr.3x.html">curs_insstr(3X)</A></STRONG> winstr/<STRONG><A HREF="curs_instr.3x.html">curs_instr(3X)</A></STRONG>
318 wmouse_trafo/<STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3X)</A></STRONG> wmove/<STRONG><A HREF="curs_move.3x.html">curs_move(3X)</A></STRONG>
319 wnoutrefresh/<STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3X)</A></STRONG> wprintw/<STRONG><A HREF="curs_printw.3x.html">curs_printw(3X)</A></STRONG>
320 wscrl/<STRONG><A HREF="curs_scroll.3x.html">curs_scroll(3X)</A></STRONG> wsetscrreg/<STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3X)</A></STRONG>
321 wstandend/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG> wstandout/<STRONG><A HREF="curs_attr.3x.html">curs_attr(3X)</A></STRONG>
322 wsyncdown/<STRONG><A HREF="curs_window.3x.html">curs_window(3X)</A></STRONG> wsyncup/<STRONG><A HREF="curs_window.3x.html">curs_window(3X)</A></STRONG>
323 wtimeout/<STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3X)</A></STRONG> wtouchln/<STRONG><A HREF="curs_touch.3x.html">curs_touch(3X)</A></STRONG>
324 wvline/<STRONG><A HREF="curs_border.3x.html">curs_border(3X)</A></STRONG>
328 <H2>RETURN VALUE</H2><PRE>
329 Routines that return an integer return <STRONG>ERR</STRONG> upon failure
330 and an integer value other than <STRONG>ERR</STRONG> upon successful
331 completion, unless otherwise noted in the routine
334 All macros return the value of the <STRONG>w</STRONG> version, except
335 <STRONG>setscrreg</STRONG>, <STRONG>wsetscrreg</STRONG>, <STRONG>getyx</STRONG>, <STRONG>getbegyx</STRONG>, <STRONG>getmaxyx</STRONG>. The
336 return values of <STRONG>setscrreg</STRONG>, <STRONG>wsetscrreg</STRONG>, <STRONG>getyx</STRONG>, <STRONG>getbegyx</STRONG>,
337 and <STRONG>getmaxyx</STRONG> are undefined (<EM>i</EM>.<EM>e</EM>., these should not be used
338 as the right-hand side of assignment statements).
340 Routines that return pointers return <STRONG>NULL</STRONG> on error.
344 <H2>ENVIRONMENT</H2><PRE>
345 The following environment symbols are useful for
346 customizing the runtime behavior of the <STRONG>ncurses</STRONG> library.
347 The most important ones have been already discussed in
351 The debugging library checks this environment symbol
352 when the application has redirected output to a file.
353 The symbol's numeric value is used for the baudrate.
354 If no value is found <STRONG>ncurses</STRONG> uses 9600. This allows
355 testers to construct repeatable test-cases that take
356 into account costs that depend on baudrate.
358 CC When set, change occurrences of the command_character
359 (i.e., the <STRONG>cmdch</STRONG> capability) of the loaded terminfo
360 entries to the value of this symbol. Very few
361 terminfo entries provide this feature.
364 Specify the width of the screen in characters.
365 Applications running in a windowing environment
366 usually are able to obtain the width of the window in
367 which they are executing. If neither the $COLUMNS
368 value nor the terminal's screen size is available,
369 <STRONG>ncurses</STRONG> uses the size which may be specified in the
370 terminfo database (i.e., the <STRONG>cols</STRONG> capability).
372 It is important that your application use a correct
373 size for the screen. However, this is not always
374 possible because your application may be running on a
375 host which does not honor NAWS (Negotiations About
377 Either COLUMNS or LINES symbols may be specified
378 independently. This is mainly useful to circumvent
379 legacy misfeatures of terminal descriptions, e.g.,
380 xterm which commonly specifies a 65 line screen. For
381 best results, <STRONG>lines</STRONG> and <STRONG>cols</STRONG> should not be specified
382 in a terminal description for terminals which are run
385 Use the <STRONG>use_env</STRONG> function to disable this feature.
388 Specifies the total time, in milliseconds, for which
389 ncurses will await a character sequence, e.g., a
390 function key. The default value, 1000 milliseconds,
391 is enough for most uses. However, it is made a
392 variable to accommodate unusual applications.
394 The most common instance where you may wish to change
395 this value is to work with slow hosts, e.g., running
396 on a network. If the host cannot read characters
397 rapidly enough, it will have the same effect as if
398 the terminal did not send characters rapidly enough.
399 The library will still see a timeout.
401 Note that xterm mouse events are built up from
402 character sequences received from the xterm. If your
403 application makes heavy use of multiple-clicking, you
404 may wish to lengthen this default value because the
405 timeout applies to the composed multi-click event as
406 well as the individual clicks.
408 HOME Tells <STRONG>ncurses</STRONG> where your home directory is. That is
409 where it may read and write auxiliary terminal
416 Like COLUMNS, specify the height of the screen in
417 characters. See COLUMNS for a detailed description.
420 This applies only to the OS/2 EMX port. It specifies
421 the order of buttons on the mouse. OS/2 numbers a
422 3-button mouse inconsistently from other platforms:
428 123 or 321. If it is not specified, <STRONG>ncurses</STRONG> uses
432 Most of the terminal descriptions in the terminfo
433 database are written for real "hardware" terminals.
434 Many people use terminal emulators which run in a
435 windowing environment and use curses-based
436 applications. Terminal emulators can duplicate all
437 of the important aspects of a hardware terminal, but
438 they do not have the same limitations. The chief
439 limitation of a hardware terminal from the standpoint
440 of your application is the management of dataflow,
441 i.e., timing. Unless a hardware terminal is
442 interfaced into a terminal concentrator (which does
443 flow control), it (or your application) must manage
444 dataflow, preventing overruns. The cheapest solution
445 (no hardware cost) is for your program to do this by
446 pausing after operations that the terminal does
447 slowly, such as clearing the display.
449 As a result, many terminal descriptions (including
450 the vt100) have delay times embedded. You may wish
451 to use these descriptions, but not want to pay the
454 Set the NCURSES_NO_PADDING symbol to disable all but
455 mandatory padding. Mandatory padding is used as a
456 part of special control sequences such as <EM>flash</EM>.
459 Normally <STRONG>ncurses</STRONG> enables buffered output during
460 terminal initialization. This is done (as in SVr4
461 curses) for performance reasons. For testing
462 purposes, both of <STRONG>ncurses</STRONG> and certain applications,
463 this feature is made optional. Setting the
464 NCURSES_NO_SETBUF variable disables output buffering,
465 leaving the output in the original (usually line
469 During initialization, the <STRONG>ncurses</STRONG> debugging library
470 checks the NCURSES_TRACE symbol. If it is defined,
471 to a numeric value, <STRONG>ncurses</STRONG> calls the <STRONG>trace</STRONG> function,
472 using that value as the argument.
474 The argument values, which are defined in <STRONG>curses.h</STRONG>,
475 provide several types of information. When running
476 with traces enabled, your application will write the
477 file <STRONG>trace</STRONG> to the current directory.
479 TERM Denotes your terminal type. Each terminal type is
480 If the <STRONG>ncurses</STRONG> library has been configured with
481 <EM>termcap</EM> support, <STRONG>ncurses</STRONG> will check for a terminal's
482 description in termcap form if it is not available in
483 the terminfo database.
485 The TERMCAP symbol contains either a terminal
486 description (with newlines stripped out), or a file
487 name telling where the information denoted by the
488 TERM symbol exists. In either case, setting it
489 directs <STRONG>ncurses</STRONG> to ignore the usual place for this
490 information, e.g., /etc/termcap.
493 Overrides the directory in which <STRONG>ncurses</STRONG> searches for
494 your terminal description. This is the simplest, but
495 not the only way to change the list of directories.
496 The complete list of directories in order follows:
498 - the last directory to which <STRONG>ncurses</STRONG> wrote, if any,
501 - the directory specified by the TERMINFO symbol
505 - directories listed in the TERMINFO_DIRS symbol
507 - one or more directories whose names are configured
508 and compiled into the ncurses library, e.g.,
512 Specifies a list of directories to search for
513 terminal descriptions. The list is separated by
514 colons (i.e., ":"). All of the terminal descriptions
515 are in terminfo form, which makes a subdirectory
516 named for the first letter of the terminal names
520 If TERMCAP does not hold a file name then <STRONG>ncurses</STRONG>
521 checks the TERMPATH symbol. This is a list of
522 filenames separated by colons (i.e., ":"). If the
523 TERMPATH symbol is not set, <STRONG>ncurses</STRONG> looks in the
524 files /etc/termcap, /usr/share/misc/termcap and
525 $HOME/.termcap, in that order.
531 directory containing initialization files for the
532 terminal capability database @DATADIR@/terminfo
533 terminal capability database
535 <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> and 3X pages whose names begin "curs_" for
536 detailed routine descriptions.
540 <H2>EXTENSIONS</H2><PRE>
541 The <STRONG>ncurses</STRONG> library can be compiled with an option
542 (<STRONG>-DUSE_GETCAP</STRONG>) that falls back to the old-style
543 /etc/termcap file if the terminal setup code cannot find a
544 terminfo entry corresponding to <STRONG>TERM</STRONG>. Use of this feature
545 is not recommended, as it essentially includes an entire
546 termcap compiler in the <STRONG>ncurses</STRONG> startup code, at
547 significant cost in core and startup cycles.
549 The <STRONG>ncurses</STRONG> library includes facilities for capturing
550 mouse events on certain terminals (including xterm). See
551 the <STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3X)</A></STRONG> manual page for details.
553 The <STRONG>ncurses</STRONG> library includes facilities for responding to
554 window resizing events, e.g., when running in an xterm.
555 See the <STRONG><A HREF="resizeterm.3x.html">resizeterm(3X)</A></STRONG> and <STRONG><A HREF="wresize.3x.html">wresize(3X)</A></STRONG> manual pages for
556 details. In addition, the library may be configured with
559 The <STRONG>ncurses</STRONG> library extends the fixed set of function key
560 capabilities of terminals by allowing the application
561 designer to define additional key sequences at runtime.
562 See the <STRONG><A HREF="define_key.3x.html">define_key(3X)</A></STRONG> and <STRONG><A HREF="keyok.3x.html">keyok(3X)</A></STRONG> manual pages for
565 The <STRONG>ncurses</STRONG> library can exploit the capabilities of
566 terminals which implement the ISO-6429 SGR 39 and SGR 49
567 controls, which allow an application to reset the terminal
568 to its original foreground and background colors. From
569 the users' perspective, the application is able to draw
570 colored text on a background whose color is set
571 independently, providing better control over color
572 contrasts. See the <STRONG><A HREF="use_default_colors.3x.html">use_default_colors(3X)</A></STRONG> manual page for
575 The <STRONG>ncurses</STRONG> library includes a function for directing
576 application output to a printer attached to the terminal
577 device. See the <STRONG><A HREF="curs_print.3x.html">curs_print(3X)</A></STRONG> manual page for details.
581 <H2>PORTABILITY</H2><PRE>
582 The <STRONG>ncurses</STRONG> library is intended to be BASE-level
583 conformant with the XSI Curses standard. Certain portions
584 of the EXTENDED XSI Curses functionality (including color
585 support) are supported. The following EXTENDED XSI Curses
586 calls in support of wide (multibyte) characters are not
587 yet implemented: <STRONG>add_wch</STRONG>, <STRONG>add_wchnstr</STRONG>, <STRONG>add_wchstr</STRONG>,
588 <STRONG>addnwstr</STRONG>, <STRONG>addwstr</STRONG>, <STRONG>bkgrnd</STRONG>, <STRONG>bkgrndset</STRONG>, <STRONG>border_set</STRONG>, <STRONG>box_set</STRONG>,
589 <STRONG>echo_wchar</STRONG>, <STRONG>erasewchar</STRONG>, <STRONG>get_wch</STRONG>, <STRONG>get_wstr</STRONG>, <STRONG>getbkgrnd</STRONG>,
590 <STRONG>getcchar</STRONG>, <STRONG>getn_wstr</STRONG>, <STRONG>getwchtype</STRONG>, <STRONG>hline_set</STRONG>, <STRONG>in_wch</STRONG>,
591 <STRONG>killwchar</STRONG>, <STRONG>mvadd_wch</STRONG>, <STRONG>mvadd_wchnstr</STRONG>, <STRONG>mvadd_wchstr</STRONG>,
592 <STRONG>mvaddnwstr</STRONG>, <STRONG>mvaddwstr</STRONG>, <STRONG>mvget_wch</STRONG>, <STRONG>mvget_wstr</STRONG>, <STRONG>mvgetn_wstr</STRONG>,
593 <STRONG>mvhline_set</STRONG>, <STRONG>mvin_wch</STRONG>, <STRONG>mvinnwstr</STRONG>, <STRONG>mvins_nwstr</STRONG>, <STRONG>mvins_wch</STRONG>,
594 <STRONG>mvins_wstr</STRONG>, <STRONG>mvinwchnstr</STRONG>, <STRONG>mvinwchstr</STRONG>, <STRONG>mvinwchstr</STRONG>, <STRONG>mvinwstr</STRONG>,
595 <STRONG>mvvline_set</STRONG>, <STRONG>mvwadd_wch</STRONG>, <STRONG>mvwadd_wchnstr</STRONG>, <STRONG>mvwadd_wchstr</STRONG>,
596 <STRONG>mvwaddnwstr</STRONG>, <STRONG>mvwaddwstr</STRONG>, <STRONG>mvwget_ch</STRONG>, <STRONG>mvwget_wch</STRONG>,
597 <STRONG>mvwget_wstr</STRONG>, <STRONG>mvwgetn_wstr</STRONG>, <STRONG>mvwhline_set</STRONG>, <STRONG>mvwin_wch</STRONG>,
598 <STRONG>mvwin_wchnstr</STRONG>, <STRONG>mvwin_wchstr</STRONG>, <STRONG>mvwinnwstr</STRONG>, <STRONG>mvwins_nwstr</STRONG>,
599 <STRONG>mvwins_wch</STRONG>, <STRONG>mvwins_wstr</STRONG>, <STRONG>mvwinwchnstr</STRONG>. <STRONG>mvwinwstr</STRONG>,
600 <STRONG>mvwvline_set</STRONG>, <STRONG>pecho_wchar</STRONG>, <STRONG>setcchar</STRONG>, <STRONG>slk_wset</STRONG>, <STRONG>term_attrs</STRONG>,
601 <STRONG>unget_wch</STRONG>, <STRONG>vhline_set</STRONG>, <STRONG>vid_attr</STRONG>, <STRONG>vid_puts</STRONG>, <STRONG>vline_set</STRONG>,
602 <STRONG>wadd_wch</STRONG>, <STRONG>wadd_wchnstr</STRONG>, <STRONG>wadd_wchstr</STRONG>, <STRONG>waddnwstr</STRONG>, <STRONG>waddwstr</STRONG>,
603 <STRONG>waddwstr</STRONG>, <STRONG>wbkgrnd</STRONG>, <STRONG>wbkgrndset</STRONG>, <STRONG>wbkgrndset</STRONG>, <STRONG>wborder_set</STRONG>,
604 <STRONG>wecho_wchar</STRONG>, <STRONG>wecho_wchar</STRONG>, <STRONG>wget_wch</STRONG>, <STRONG>wget_wstr</STRONG>, <STRONG>wgetbkgrnd</STRONG>,
605 <STRONG>wgetn_wstr</STRONG>, <STRONG>whline_set</STRONG>, <STRONG>win_wch</STRONG>, <STRONG>win_wchnstr</STRONG>, <STRONG>win_wchstr</STRONG>,
606 <STRONG>winnwstr</STRONG>, <STRONG>wins_nwstr</STRONG>, <STRONG>wins_wch</STRONG>, <STRONG>wins_wstr</STRONG>, <STRONG>winwchnstr</STRONG>,
607 <STRONG>winwchstr</STRONG>, <STRONG>winwstr</STRONG>, <STRONG>wunctrl</STRONG>, <STRONG>wvline_set</STRONG>,
609 A small number of local differences (that is, individual
610 differences between the XSI Curses and <STRONG>ncurses</STRONG> calls) are
611 described in <STRONG>PORTABILITY</STRONG> sections of the library man
614 The routine <STRONG>has_key</STRONG> is not part of XPG4, nor is it present
615 in SVr4. See the <STRONG><A HREF="curs_getch.3x.html">curs_getch(3X)</A></STRONG> manual page for details.
617 The routine <STRONG>slk_attr</STRONG> is not part of XPG4, nor is it
618 present in SVr4. See the <STRONG><A HREF="curs_slk.3x.html">curs_slk(3X)</A></STRONG> manual page for
621 The routines <STRONG>getmouse</STRONG>, <STRONG>mousemask</STRONG>, <STRONG>ungetmouse</STRONG>,
622 <STRONG>mouseinterval</STRONG>, and <STRONG>wenclose</STRONG> relating to mouse interfacing
623 are not part of XPG4, nor are they present in SVr4. See
624 the <STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3X)</A></STRONG> manual page for details.
626 The routine <STRONG>mcprint</STRONG> was not present in any previous curses
627 implementation. See the <STRONG><A HREF="curs_print.3x.html">curs_print(3X)</A></STRONG> manual page for
630 The routine <STRONG>wresize</STRONG> is not part of XPG4, nor is it present
631 in SVr4. See the <STRONG><A HREF="wresize.3x.html">wresize(3X)</A></STRONG> manual page for details.
633 In historic curses versions, delays embedded in the
634 capabilities <STRONG>cr</STRONG>, <STRONG>ind</STRONG>, <STRONG>cub1</STRONG>, <STRONG>ff</STRONG> and <STRONG>tab</STRONG> activated
635 corresponding delay bits in the UNIX tty driver. In this
636 implementation, all padding is done by NUL sends. This
637 method is slightly more expensive, but narrows the
638 interface to the UNIX kernel significantly and increases
639 the package's portability correspondingly.
641 In the XSI standard and SVr4 manual pages, many entry
642 points have prototype arguments of the for <STRONG>char</STRONG> <STRONG>*const</STRONG> (or
643 (see section 3.5.4.1), these declarations are either (a)
644 meaningless, or (b) meaningless and illegal. The
645 declaration <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*x</STRONG> is a modifiable pointer to
646 unmodifiable data, but <STRONG>char</STRONG> <STRONG>*const</STRONG> <STRONG>x</STRONG>' is an unmodifiable
647 pointer to modifiable data. Given that C passes arguments
648 by value, <STRONG><type></STRONG> <STRONG>*const</STRONG> as a formal type is at best
649 dubious. Some compilers choke on the prototypes.
650 Therefore, in this implementation, they have been changed
651 to <STRONG>const</STRONG> <STRONG><type></STRONG> <STRONG>*</STRONG> globally.
656 The header file <STRONG><curses.h></STRONG> automatically includes the
657 header files <STRONG><stdio.h></STRONG> and <STRONG><unctrl.h></STRONG>.
659 If standard output from a <STRONG>ncurses</STRONG> program is re-directed
660 to something which is not a tty, screen updates will be
661 directed to standard error. This was an undocumented
662 feature of AT&T System V Release 3 curses.
666 <H2>AUTHORS</H2><PRE>
667 Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.
668 Based on pcurses by Pavel Curtis.