]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/ncurses.3x
ncurses 6.4 - patch 20230909
[ncurses.git] / man / ncurses.3x
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright 2018-2021,2023 Thomas E. Dickey                                *
4 .\" Copyright 1998-2015,2017 Free Software Foundation, Inc.                  *
5 .\"                                                                          *
6 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
7 .\" copy of this software and associated documentation files (the            *
8 .\" "Software"), to deal in the Software without restriction, including      *
9 .\" without limitation the rights to use, copy, modify, merge, publish,      *
10 .\" distribute, distribute with modifications, sublicense, and/or sell       *
11 .\" copies of the Software, and to permit persons to whom the Software is    *
12 .\" furnished to do so, subject to the following conditions:                 *
13 .\"                                                                          *
14 .\" The above copyright notice and this permission notice shall be included  *
15 .\" in all copies or substantial portions of the Software.                   *
16 .\"                                                                          *
17 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
18 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
19 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
20 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
21 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
22 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
23 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
24 .\"                                                                          *
25 .\" Except as contained in this notice, the name(s) of the above copyright   *
26 .\" holders shall not be used in advertising or otherwise to promote the     *
27 .\" sale, use or other dealings in this Software without prior written       *
28 .\" authorization.                                                           *
29 .\"***************************************************************************
30 .\"
31 .\" $Id: ncurses.3x,v 1.167 2023/09/09 21:11:08 tom Exp $
32 .hy 0
33 .TH ncurses 3X 2023-09-09 "ncurses 6.4" "Library calls"
34 .ie \n(.g .ds `` \(lq
35 .el       .ds `` ``
36 .ie \n(.g .ds '' \(rq
37 .el       .ds '' ''
38 .ie n .ds CW R
39 .el   \{
40 .ie \n(.g .ds CW CR
41 .el       .ds CW CW
42 .\}
43 .de bP
44 .ie n  .IP \(bu 4
45 .el    .IP \(bu 2
46 ..
47 .de NS
48 .ie n  .sp
49 .el    .sp .5
50 .ie n  .in +4
51 .el    .in +2
52 .nf
53 .ft \*(CW
54 ..
55 .de NE
56 .fi
57 .ft R
58 .ie n  .in -4
59 .el    .in -2
60 ..
61 .ds n 5
62 .ds d @TERMINFO@
63 .SH NAME
64 \fBncurses\fP \- CRT screen handling and optimization package
65 .SH SYNOPSIS
66 \fB#include <curses.h>\fP
67 .SH DESCRIPTION
68 The \fBncurses\fP library routines give the user a terminal-independent method
69 of updating character screens with reasonable optimization.
70 This implementation is \*(``new curses\*('' (ncurses) and
71 is the approved replacement for
72 4.4BSD classic curses, which has been discontinued.
73 This describes \fBncurses\fP
74 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
75 .PP
76 The \fBncurses\fP library emulates the curses library of
77 System V Release 4 UNIX,
78 and XPG4 (X/Open Portability Guide) curses (also known as XSI curses).
79 XSI stands for X/Open System Interfaces Extension.
80 The \fBncurses\fP library is freely redistributable in source form.
81 Differences from the SVr4
82 curses are summarized under the
83 \fIEXTENSIONS\fP and \fIPORTABILITY\fP sections below and
84 described in detail in the respective
85 \fIEXTENSIONS\fP, \fIPORTABILITY\fP and \fIBUGS\fP sections
86 of individual man pages.
87 .PP
88 The \fBncurses\fP library also provides many useful extensions,
89 i.e., features which cannot be implemented by a simple add-on library
90 but which require access to the internals of the library.
91 .PP
92 A program using these routines must be linked with the \fB\-lncurses\fP option,
93 or (if it has been generated) with the debugging library \fB\-lncurses_g\fP.
94 (Your system integrator may also have installed these libraries under
95 the names \fB\-lcurses\fP and \fB\-lcurses_g\fP.)
96 The ncurses_g library generates trace logs
97 (in a file called \*(``trace\*('' in the current directory)
98 that describe curses actions.
99 See also the section on \fBALTERNATE CONFIGURATIONS\fP.
100 .PP
101 The \fBncurses\fP package supports: overall screen, window and pad
102 manipulation; output to windows and pads; reading terminal input; control over
103 terminal and \fBcurses\fP input and output options; environment query
104 routines; color manipulation; use of soft label keys; terminfo capabilities;
105 and access to low-level terminal-manipulation routines.
106 .SS Initialization
107 The library uses the locale which the calling program has initialized.
108 That is normally done with \fBsetlocale\fP(3):
109 .NS
110 \fBsetlocale(LC_ALL, "");\fP
111 .NE
112 .PP
113 If the locale is not initialized,
114 the library assumes that characters are printable as in ISO\-8859\-1,
115 to work with certain legacy programs.
116 You should initialize the locale and not rely on specific details of
117 the library when the locale has not been setup.
118 .PP
119 The function \fBinitscr\fP or \fBnewterm\fP
120 must be called to initialize the library
121 before any of the other routines that deal with windows
122 and screens are used.
123 The routine \fBendwin\fP(3X) must be called before exiting.
124 .PP
125 To get character-at-a-time input without echoing (most
126 interactive, screen oriented programs want this), the following
127 sequence should be used:
128 .NS
129 \fBinitscr(); cbreak(); noecho();\fP
130 .NE
131 .PP
132 Most programs would additionally use the sequence:
133 .NS
134 \fBintrflush(stdscr, FALSE);\fP
135 \fBkeypad(stdscr, TRUE);\fP
136 .NE
137 .PP
138 Before a \fBcurses\fP program is run, the tab stops of the terminal
139 should be set and its initialization strings, if defined, must be output.
140 This can be done by executing the \fB@TPUT@ init\fP command
141 after the shell environment variable \fBTERM\fP has been exported.
142 \fB@TSET@(1)\fP is usually responsible for doing this.
143 [See \fBterminfo\fP(\*n) for further details.]
144 .SS Datatypes
145 The \fBncurses\fP library permits manipulation of data structures,
146 called \fIwindows\fP, which can be thought of as two-dimensional
147 arrays of characters representing all or part of a CRT screen.
148 A default window called \fBstdscr\fP, which is the size of the terminal
149 screen, is supplied.
150 Others may be created with \fBnewwin\fP.
151 .PP
152 Note that \fBcurses\fP does not handle overlapping windows, that's done by
153 the \fBpanel\fP(3X) library.
154 This means that you can either use
155 \fBstdscr\fP or divide the screen into tiled windows and not using
156 \fBstdscr\fP at all.
157 Mixing the two will result in unpredictable, and undesired, effects.
158 .PP
159 Windows are referred to by variables declared as \fBWINDOW *\fP.
160 These data structures are manipulated with routines described here and
161 elsewhere in the \fBncurses\fP manual pages.
162 Among those, the most basic
163 routines are \fBmove\fP and \fBaddch\fP.
164 More general versions of
165 these routines are included with names beginning with \fBw\fP,
166 allowing the user to specify a window.
167 The routines not beginning
168 with \fBw\fP affect \fBstdscr\fP.
169 .PP
170 After using routines to manipulate a window, \fBrefresh\fP(3X) is called,
171 telling \fBcurses\fP to make the user's CRT screen look like
172 \fBstdscr\fP.
173 The characters in a window are actually of type
174 \fBchtype\fP, (character and attribute data) so that other information
175 about the character may also be stored with each character.
176 .PP
177 Special windows called \fIpads\fP may also be manipulated.
178 These are windows
179 which are not constrained to the size of the screen and whose contents need not
180 be completely displayed.
181 See \fBcurs_pad\fP(3X) for more information.
182 .PP
183 In addition to drawing characters on the screen, video attributes and colors
184 may be supported, causing the characters to show up in such modes as
185 underlined, in reverse video, or in color on terminals that support such
186 display enhancements.
187 Line drawing characters may be specified to be output.
188 On input, \fBcurses\fP is also able to translate arrow and function keys that
189 transmit escape sequences into single values.
190 The video attributes, line
191 drawing characters, and input values use names, defined in \fB<curses.h>\fP,
192 such as \fBA_REVERSE\fP, \fBACS_HLINE\fP, and \fBKEY_LEFT\fP.
193 .SS Environment variables
194 If the environment variables \fBLINES\fP and \fBCOLUMNS\fP are set, or if the
195 program is executing in a window environment, line and column information in
196 the environment will override information read by \fIterminfo\fP.
197 This would affect a program running in an AT&T 630 layer,
198 for example, where the size of a
199 screen is changeable (see \fBENVIRONMENT\fP).
200 .PP
201 If the environment variable \fBTERMINFO\fP is defined, any program using
202 \fBcurses\fP checks for a local terminal definition before checking in the
203 standard place.
204 For example, if \fBTERM\fP is set to \fBatt4424\fP, then the
205 compiled terminal definition is found in
206 .NS
207 \fB\*d/a/att4424\fP.
208 .NE
209 .PP
210 (The \fBa\fP is copied from the first letter of \fBatt4424\fP to avoid
211 creation of huge directories.)  However, if \fBTERMINFO\fP is set to
212 \fB$HOME/myterms\fP, \fBcurses\fP first checks
213 .NS
214 \fB$HOME/myterms/a/att4424\fP,
215 .NE
216 .PP
217 and if that fails, it then checks
218 .NS
219 \fB\*d/a/att4424\fP.
220 .NE
221 .PP
222 This is useful for developing experimental definitions or when write
223 permission in \fB\*d\fP is not available.
224 .PP
225 The integer variables \fBLINES\fP and \fBCOLS\fP are defined in
226 \fB<curses.h>\fP and will be filled in by \fBinitscr\fP with the size of the
227 screen.
228 The constants \fBTRUE\fP and \fBFALSE\fP have the values \fB1\fP and
229 \fB0\fP, respectively.
230 .PP
231 The \fBcurses\fP routines also define the \fBWINDOW *\fP variable \fBcurscr\fP
232 which is used for certain low-level operations like clearing and redrawing a
233 screen containing garbage.
234 The \fBcurscr\fP can be used in only a few routines.
235 .\"
236 .SS Routine and Argument Names
237 Many \fBcurses\fP routines have two or more versions.
238 The routines prefixed with \fIw\fP require a window argument.
239 The routines prefixed with \fIp\fP require a pad argument.
240 Those without a prefix generally use \fBstdscr\fP.
241 .PP
242 The routines prefixed with \fBmv\fP require a \fIy\fP and \fIx\fP
243 coordinate to move to before performing the appropriate action.
244 The \fBmv\fP routines imply a call to \fBmove\fP before the call to the
245 other routine.
246 The coordinate \fIy\fP always refers to the row (of
247 the window), and \fIx\fP always refers to the column.
248 The upper left-hand corner is always (0,0), not (1,1).
249 .PP
250 The routines prefixed with \fBmvw\fP take both a window argument and
251 \fIx\fP and \fIy\fP coordinates.
252 The window argument is always specified before the coordinates.
253 .PP
254 In each case, \fIwin\fP is the window affected, and \fIpad\fP is the
255 pad affected; \fIwin\fP and \fIpad\fP are always pointers to type
256 \fBWINDOW\fP.
257 .PP
258 Option setting routines require a Boolean flag \fIbf\fP with the value
259 \fBTRUE\fP or \fBFALSE\fP; \fIbf\fP is always of type \fBbool\fP.
260 Most of the data types used in the library routines,
261 such as \fBWINDOW\fP, \fBSCREEN\fP, \fBbool\fP, and \fBchtype\fP
262 are defined in \fB<curses.h>\fP.
263 Types used for the terminfo routines such as
264 \fBTERMINAL\fP are defined in \fB<term.h>\fP.
265 .PP
266 This manual page describes functions which may appear in any configuration
267 of the library.
268 There are two common configurations of the library:
269 .RS 3
270 .TP 5
271 .I ncurses
272 the \*(``normal\*('' library, which handles 8-bit characters.
273 The normal (8-bit) library stores characters combined with attributes
274 in \fBchtype\fP data.
275 .IP
276 Attributes alone (no corresponding character) may be stored in \fBchtype\fP
277 or the equivalent \fBattr_t\fP data.
278 In either case, the data is stored in something like an integer.
279 .IP
280 Each cell (row and column) in a \fBWINDOW\fP is stored as a \fBchtype\fP.
281 .TP 5
282 .I ncursesw
283 the so-called \*(``wide\*('' library, which handles multibyte characters
284 (see the section on \fBALTERNATE CONFIGURATIONS\fP).
285 The \*(``wide\*('' library includes all of the calls
286 from the \*(``normal\*('' library.
287 It adds about one third more calls using data types which store
288 multibyte characters:
289 .RS 5
290 .TP 5
291 .B cchar_t
292 corresponds to \fBchtype\fP.
293 However it is a structure, because more data is stored than can fit into
294 an integer.
295 The characters are large enough to require a full integer value \- and there
296 may be more than one character per cell.
297 The video attributes and color are stored in separate fields of the structure.
298 .IP
299 Each cell (row and column) in a \fBWINDOW\fP is stored as a \fBcchar_t\fP.
300 .IP
301 The \fBsetcchar\fP(3X) and \fBgetcchar\fP(3X)
302 functions store and retrieve the data from
303 a \fBcchar_t\fP structure.
304 .TP 5
305 .B wchar_t
306 stores a \*(``wide\*('' character.
307 Like \fBchtype\fP, this may be an integer.
308 .TP 5
309 .B wint_t
310 stores a \fBwchar_t\fP or \fBWEOF\fP \- not the same, though both may have
311 the same size.
312 .RE
313 .IP
314 The \*(``wide\*('' library provides new functions which are analogous to
315 functions in the \*(``normal\*('' library.
316 There is a naming convention which relates many of the normal/wide variants:
317 a \*(``_w\*('' is inserted into the name.
318 For example, \fBwaddch\fP becomes \fBwadd_wch\fP.
319 .RE
320 .\"
321 .SS Routine Name Index
322 The following table lists the \fBcurses\fP routines provided in
323 the \*(``normal\*('' and \*(``wide\*('' libraries and the names of
324 the manual pages on which they are described.
325 Routines flagged with \*(``*\*(''
326 are ncurses-specific, not described by XPG4 or present in SVr4.
327 .PP
328 .TS
329 center tab(/);
330 l l
331 l l .
332 \fBcurses\fP Routine Name/Manual Page Name
333 =
334 COLOR_PAIR/\fBcurs_color\fP(3X)
335 PAIR_NUMBER/\fBcurs_attr\fP(3X)
336 add_wch/\fBcurs_add_wch\fP(3X)
337 add_wchnstr/\fBcurs_add_wchstr\fP(3X)
338 add_wchstr/\fBcurs_add_wchstr\fP(3X)
339 addch/\fBcurs_addch\fP(3X)
340 addchnstr/\fBcurs_addchstr\fP(3X)
341 addchstr/\fBcurs_addchstr\fP(3X)
342 addnstr/\fBcurs_addstr\fP(3X)
343 addnwstr/\fBcurs_addwstr\fP(3X)
344 addstr/\fBcurs_addstr\fP(3X)
345 addwstr/\fBcurs_addwstr\fP(3X)
346 alloc_pair/\fBnew_pair\fP(3X)*
347 assume_default_colors/\fBdefault_colors\fP(3X)*
348 attr_get/\fBcurs_attr\fP(3X)
349 attr_off/\fBcurs_attr\fP(3X)
350 attr_on/\fBcurs_attr\fP(3X)
351 attr_set/\fBcurs_attr\fP(3X)
352 attroff/\fBcurs_attr\fP(3X)
353 attron/\fBcurs_attr\fP(3X)
354 attrset/\fBcurs_attr\fP(3X)
355 baudrate/\fBcurs_termattrs\fP(3X)
356 beep/\fBcurs_beep\fP(3X)
357 bkgd/\fBcurs_bkgd\fP(3X)
358 bkgdset/\fBcurs_bkgd\fP(3X)
359 bkgrnd/\fBcurs_bkgrnd\fP(3X)
360 bkgrndset/\fBcurs_bkgrnd\fP(3X)
361 border/\fBcurs_border\fP(3X)
362 border_set/\fBcurs_border_set\fP(3X)
363 box/\fBcurs_border\fP(3X)
364 box_set/\fBcurs_border_set\fP(3X)
365 can_change_color/\fBcurs_color\fP(3X)
366 cbreak/\fBcurs_inopts\fP(3X)
367 chgat/\fBcurs_attr\fP(3X)
368 clear/\fBcurs_clear\fP(3X)
369 clearok/\fBcurs_outopts\fP(3X)
370 clrtobot/\fBcurs_clear\fP(3X)
371 clrtoeol/\fBcurs_clear\fP(3X)
372 color_content/\fBcurs_color\fP(3X)
373 color_set/\fBcurs_attr\fP(3X)
374 copywin/\fBcurs_overlay\fP(3X)
375 curs_set/\fBcurs_kernel\fP(3X)
376 curses_trace/\fBcurs_trace\fP(3X)*
377 curses_version/\fBcurs_extend\fP(3X)*
378 def_prog_mode/\fBcurs_kernel\fP(3X)
379 def_shell_mode/\fBcurs_kernel\fP(3X)
380 define_key/\fBdefine_key\fP(3X)*
381 del_curterm/\fBcurs_terminfo\fP(3X)
382 delay_output/\fBcurs_util\fP(3X)
383 delch/\fBcurs_delch\fP(3X)
384 deleteln/\fBcurs_deleteln\fP(3X)
385 delscreen/\fBcurs_initscr\fP(3X)
386 delwin/\fBcurs_window\fP(3X)
387 derwin/\fBcurs_window\fP(3X)
388 doupdate/\fBcurs_refresh\fP(3X)
389 dupwin/\fBcurs_window\fP(3X)
390 echo/\fBcurs_inopts\fP(3X)
391 echo_wchar/\fBcurs_add_wch\fP(3X)
392 echochar/\fBcurs_addch\fP(3X)
393 endwin/\fBcurs_initscr\fP(3X)
394 erase/\fBcurs_clear\fP(3X)
395 erasechar/\fBcurs_termattrs\fP(3X)
396 erasewchar/\fBcurs_termattrs\fP(3X)
397 exit_curses/\fBcurs_memleaks\fP(3X)*
398 exit_terminfo/\fBcurs_memleaks\fP(3X)*
399 extended_color_content/\fBcurs_color\fP(3X)*
400 extended_pair_content/\fBcurs_color\fP(3X)*
401 extended_slk_color/\fBcurs_slk\fP(3X)*
402 filter/\fBcurs_util\fP(3X)
403 find_pair/\fBnew_pair\fP(3X)*
404 flash/\fBcurs_beep\fP(3X)
405 flushinp/\fBcurs_util\fP(3X)
406 free_pair/\fBnew_pair\fP(3X)*
407 get_wch/\fBcurs_get_wch\fP(3X)
408 get_wstr/\fBcurs_get_wstr\fP(3X)
409 getattrs/\fBcurs_attr\fP(3X)
410 getbegx/\fBcurs_legacy\fP(3X)*
411 getbegy/\fBcurs_legacy\fP(3X)*
412 getbegyx/\fBcurs_getyx\fP(3X)
413 getbkgd/\fBcurs_bkgd\fP(3X)
414 getbkgrnd/\fBcurs_bkgrnd\fP(3X)
415 getcchar/\fBcurs_getcchar\fP(3X)
416 getch/\fBcurs_getch\fP(3X)
417 getcurx/\fBcurs_legacy\fP(3X)*
418 getcury/\fBcurs_legacy\fP(3X)*
419 getmaxx/\fBcurs_legacy\fP(3X)*
420 getmaxy/\fBcurs_legacy\fP(3X)*
421 getmaxyx/\fBcurs_getyx\fP(3X)
422 getmouse/\fBcurs_mouse\fP(3X)*
423 getn_wstr/\fBcurs_get_wstr\fP(3X)
424 getnstr/\fBcurs_getstr\fP(3X)
425 getparx/\fBcurs_legacy\fP(3X)*
426 getpary/\fBcurs_legacy\fP(3X)*
427 getparyx/\fBcurs_getyx\fP(3X)
428 getstr/\fBcurs_getstr\fP(3X)
429 getsyx/\fBcurs_kernel\fP(3X)
430 getwin/\fBcurs_util\fP(3X)
431 getyx/\fBcurs_getyx\fP(3X)
432 halfdelay/\fBcurs_inopts\fP(3X)
433 has_colors/\fBcurs_color\fP(3X)
434 has_ic/\fBcurs_termattrs\fP(3X)
435 has_il/\fBcurs_termattrs\fP(3X)
436 has_key/\fBcurs_getch\fP(3X)*
437 has_mouse/\fBcurs_mouse\fP(3X)*
438 hline/\fBcurs_border\fP(3X)
439 hline_set/\fBcurs_border_set\fP(3X)
440 idcok/\fBcurs_outopts\fP(3X)
441 idlok/\fBcurs_outopts\fP(3X)
442 immedok/\fBcurs_outopts\fP(3X)
443 in_wch/\fBcurs_in_wch\fP(3X)
444 in_wchnstr/\fBcurs_in_wchstr\fP(3X)
445 in_wchstr/\fBcurs_in_wchstr\fP(3X)
446 inch/\fBcurs_inch\fP(3X)
447 inchnstr/\fBcurs_inchstr\fP(3X)
448 inchstr/\fBcurs_inchstr\fP(3X)
449 init_color/\fBcurs_color\fP(3X)
450 init_extended_color/\fBcurs_color\fP(3X)*
451 init_extended_pair/\fBcurs_color\fP(3X)*
452 init_pair/\fBcurs_color\fP(3X)
453 initscr/\fBcurs_initscr\fP(3X)
454 innstr/\fBcurs_instr\fP(3X)
455 innwstr/\fBcurs_inwstr\fP(3X)
456 ins_nwstr/\fBcurs_ins_wstr\fP(3X)
457 ins_wch/\fBcurs_ins_wch\fP(3X)
458 ins_wstr/\fBcurs_ins_wstr\fP(3X)
459 insch/\fBcurs_insch\fP(3X)
460 insdelln/\fBcurs_deleteln\fP(3X)
461 insertln/\fBcurs_deleteln\fP(3X)
462 insnstr/\fBcurs_insstr\fP(3X)
463 insstr/\fBcurs_insstr\fP(3X)
464 instr/\fBcurs_instr\fP(3X)
465 intrflush/\fBcurs_inopts\fP(3X)
466 inwstr/\fBcurs_inwstr\fP(3X)
467 is_cbreak/\fBcurs_inopts\fP(3X)*
468 is_cleared/\fBcurs_opaque\fP(3X)*
469 is_echo/\fBcurs_inopts\fP(3X)*
470 is_idcok/\fBcurs_opaque\fP(3X)*
471 is_idlok/\fBcurs_opaque\fP(3X)*
472 is_immedok/\fBcurs_opaque\fP(3X)*
473 is_keypad/\fBcurs_opaque\fP(3X)*
474 is_leaveok/\fBcurs_opaque\fP(3X)*
475 is_linetouched/\fBcurs_touch\fP(3X)
476 is_nl/\fBcurs_inopts\fP(3X)*
477 is_nodelay/\fBcurs_opaque\fP(3X)*
478 is_notimeout/\fBcurs_opaque\fP(3X)*
479 is_pad/\fBcurs_opaque\fP(3X)*
480 is_raw/\fBcurs_inopts\fP(3X)*
481 is_scrollok/\fBcurs_opaque\fP(3X)*
482 is_subwin/\fBcurs_opaque\fP(3X)*
483 is_syncok/\fBcurs_opaque\fP(3X)*
484 is_term_resized/\fBresizeterm\fP(3X)*
485 is_wintouched/\fBcurs_touch\fP(3X)
486 isendwin/\fBcurs_initscr\fP(3X)
487 key_defined/\fBkey_defined\fP(3X)*
488 key_name/\fBcurs_util\fP(3X)
489 keybound/\fBkeybound\fP(3X)*
490 keyname/\fBcurs_util\fP(3X)
491 keyok/\fBkeyok\fP(3X)*
492 keypad/\fBcurs_inopts\fP(3X)
493 killchar/\fBcurs_termattrs\fP(3X)
494 killwchar/\fBcurs_termattrs\fP(3X)
495 leaveok/\fBcurs_outopts\fP(3X)
496 longname/\fBcurs_termattrs\fP(3X)
497 mcprint/\fBcurs_print\fP(3X)*
498 meta/\fBcurs_inopts\fP(3X)
499 mouse_trafo/\fBcurs_mouse\fP(3X)*
500 mouseinterval/\fBcurs_mouse\fP(3X)*
501 mousemask/\fBcurs_mouse\fP(3X)*
502 move/\fBcurs_move\fP(3X)
503 mvadd_wch/\fBcurs_add_wch\fP(3X)
504 mvadd_wchnstr/\fBcurs_add_wchstr\fP(3X)
505 mvadd_wchstr/\fBcurs_add_wchstr\fP(3X)
506 mvaddch/\fBcurs_addch\fP(3X)
507 mvaddchnstr/\fBcurs_addchstr\fP(3X)
508 mvaddchstr/\fBcurs_addchstr\fP(3X)
509 mvaddnstr/\fBcurs_addstr\fP(3X)
510 mvaddnwstr/\fBcurs_addwstr\fP(3X)
511 mvaddstr/\fBcurs_addstr\fP(3X)
512 mvaddwstr/\fBcurs_addwstr\fP(3X)
513 mvchgat/\fBcurs_attr\fP(3X)
514 mvcur/\fBcurs_terminfo\fP(3X)
515 mvdelch/\fBcurs_delch\fP(3X)
516 mvderwin/\fBcurs_window\fP(3X)
517 mvget_wch/\fBcurs_get_wch\fP(3X)
518 mvget_wstr/\fBcurs_get_wstr\fP(3X)
519 mvgetch/\fBcurs_getch\fP(3X)
520 mvgetn_wstr/\fBcurs_get_wstr\fP(3X)
521 mvgetnstr/\fBcurs_getstr\fP(3X)
522 mvgetstr/\fBcurs_getstr\fP(3X)
523 mvhline/\fBcurs_border\fP(3X)
524 mvhline_set/\fBcurs_border_set\fP(3X)
525 mvin_wch/\fBcurs_in_wch\fP(3X)
526 mvin_wchnstr/\fBcurs_in_wchstr\fP(3X)
527 mvin_wchstr/\fBcurs_in_wchstr\fP(3X)
528 mvinch/\fBcurs_inch\fP(3X)
529 mvinchnstr/\fBcurs_inchstr\fP(3X)
530 mvinchstr/\fBcurs_inchstr\fP(3X)
531 mvinnstr/\fBcurs_instr\fP(3X)
532 mvinnwstr/\fBcurs_inwstr\fP(3X)
533 mvins_nwstr/\fBcurs_ins_wstr\fP(3X)
534 mvins_wch/\fBcurs_ins_wch\fP(3X)
535 mvins_wstr/\fBcurs_ins_wstr\fP(3X)
536 mvinsch/\fBcurs_insch\fP(3X)
537 mvinsnstr/\fBcurs_insstr\fP(3X)
538 mvinsstr/\fBcurs_insstr\fP(3X)
539 mvinstr/\fBcurs_instr\fP(3X)
540 mvinwstr/\fBcurs_inwstr\fP(3X)
541 mvprintw/\fBcurs_printw\fP(3X)
542 mvscanw/\fBcurs_scanw\fP(3X)
543 mvvline/\fBcurs_border\fP(3X)
544 mvvline_set/\fBcurs_border_set\fP(3X)
545 mvwadd_wch/\fBcurs_add_wch\fP(3X)
546 mvwadd_wchnstr/\fBcurs_add_wchstr\fP(3X)
547 mvwadd_wchstr/\fBcurs_add_wchstr\fP(3X)
548 mvwaddch/\fBcurs_addch\fP(3X)
549 mvwaddchnstr/\fBcurs_addchstr\fP(3X)
550 mvwaddchstr/\fBcurs_addchstr\fP(3X)
551 mvwaddnstr/\fBcurs_addstr\fP(3X)
552 mvwaddnwstr/\fBcurs_addwstr\fP(3X)
553 mvwaddstr/\fBcurs_addstr\fP(3X)
554 mvwaddwstr/\fBcurs_addwstr\fP(3X)
555 mvwchgat/\fBcurs_attr\fP(3X)
556 mvwdelch/\fBcurs_delch\fP(3X)
557 mvwget_wch/\fBcurs_get_wch\fP(3X)
558 mvwget_wstr/\fBcurs_get_wstr\fP(3X)
559 mvwgetch/\fBcurs_getch\fP(3X)
560 mvwgetn_wstr/\fBcurs_get_wstr\fP(3X)
561 mvwgetnstr/\fBcurs_getstr\fP(3X)
562 mvwgetstr/\fBcurs_getstr\fP(3X)
563 mvwhline/\fBcurs_border\fP(3X)
564 mvwhline_set/\fBcurs_border_set\fP(3X)
565 mvwin/\fBcurs_window\fP(3X)
566 mvwin_wch/\fBcurs_in_wch\fP(3X)
567 mvwin_wchnstr/\fBcurs_in_wchstr\fP(3X)
568 mvwin_wchstr/\fBcurs_in_wchstr\fP(3X)
569 mvwinch/\fBcurs_inch\fP(3X)
570 mvwinchnstr/\fBcurs_inchstr\fP(3X)
571 mvwinchstr/\fBcurs_inchstr\fP(3X)
572 mvwinnstr/\fBcurs_instr\fP(3X)
573 mvwinnwstr/\fBcurs_inwstr\fP(3X)
574 mvwins_nwstr/\fBcurs_ins_wstr\fP(3X)
575 mvwins_wch/\fBcurs_ins_wch\fP(3X)
576 mvwins_wstr/\fBcurs_ins_wstr\fP(3X)
577 mvwinsch/\fBcurs_insch\fP(3X)
578 mvwinsnstr/\fBcurs_insstr\fP(3X)
579 mvwinsstr/\fBcurs_insstr\fP(3X)
580 mvwinstr/\fBcurs_instr\fP(3X)
581 mvwinwstr/\fBcurs_inwstr\fP(3X)
582 mvwprintw/\fBcurs_printw\fP(3X)
583 mvwscanw/\fBcurs_scanw\fP(3X)
584 mvwvline/\fBcurs_border\fP(3X)
585 mvwvline_set/\fBcurs_border_set\fP(3X)
586 napms/\fBcurs_kernel\fP(3X)
587 newpad/\fBcurs_pad\fP(3X)
588 newterm/\fBcurs_initscr\fP(3X)
589 newwin/\fBcurs_window\fP(3X)
590 nl/\fBcurs_inopts\fP(3X)
591 nocbreak/\fBcurs_inopts\fP(3X)
592 nodelay/\fBcurs_inopts\fP(3X)
593 noecho/\fBcurs_inopts\fP(3X)
594 nofilter/\fBcurs_util\fP(3X)*
595 nonl/\fBcurs_inopts\fP(3X)
596 noqiflush/\fBcurs_inopts\fP(3X)
597 noraw/\fBcurs_inopts\fP(3X)
598 notimeout/\fBcurs_inopts\fP(3X)
599 overlay/\fBcurs_overlay\fP(3X)
600 overwrite/\fBcurs_overlay\fP(3X)
601 pair_content/\fBcurs_color\fP(3X)
602 pecho_wchar/\fBcurs_pad\fP(3X)*
603 pechochar/\fBcurs_pad\fP(3X)
604 pnoutrefresh/\fBcurs_pad\fP(3X)
605 prefresh/\fBcurs_pad\fP(3X)
606 printw/\fBcurs_printw\fP(3X)
607 putp/\fBcurs_terminfo\fP(3X)
608 putwin/\fBcurs_util\fP(3X)
609 qiflush/\fBcurs_inopts\fP(3X)
610 raw/\fBcurs_inopts\fP(3X)
611 redrawwin/\fBcurs_refresh\fP(3X)
612 refresh/\fBcurs_refresh\fP(3X)
613 reset_color_pairs/\fBcurs_color\fP(3X)*
614 reset_prog_mode/\fBcurs_kernel\fP(3X)
615 reset_shell_mode/\fBcurs_kernel\fP(3X)
616 resetty/\fBcurs_kernel\fP(3X)
617 resize_term/\fBresizeterm\fP(3X)*
618 resizeterm/\fBresizeterm\fP(3X)*
619 restartterm/\fBcurs_terminfo\fP(3X)
620 ripoffline/\fBcurs_kernel\fP(3X)
621 savetty/\fBcurs_kernel\fP(3X)
622 scanw/\fBcurs_scanw\fP(3X)
623 scr_dump/\fBcurs_scr_dump\fP(3X)
624 scr_init/\fBcurs_scr_dump\fP(3X)
625 scr_restore/\fBcurs_scr_dump\fP(3X)
626 scr_set/\fBcurs_scr_dump\fP(3X)
627 scrl/\fBcurs_scroll\fP(3X)
628 scroll/\fBcurs_scroll\fP(3X)
629 scrollok/\fBcurs_outopts\fP(3X)
630 set_curterm/\fBcurs_terminfo\fP(3X)
631 set_term/\fBcurs_initscr\fP(3X)
632 setcchar/\fBcurs_getcchar\fP(3X)
633 setscrreg/\fBcurs_outopts\fP(3X)
634 setsyx/\fBcurs_kernel\fP(3X)
635 setupterm/\fBcurs_terminfo\fP(3X)
636 slk_attr/\fBcurs_slk\fP(3X)*
637 slk_attr_off/\fBcurs_slk\fP(3X)
638 slk_attr_on/\fBcurs_slk\fP(3X)
639 slk_attr_set/\fBcurs_slk\fP(3X)
640 slk_attroff/\fBcurs_slk\fP(3X)
641 slk_attron/\fBcurs_slk\fP(3X)
642 slk_attrset/\fBcurs_slk\fP(3X)
643 slk_clear/\fBcurs_slk\fP(3X)
644 slk_color/\fBcurs_slk\fP(3X)
645 slk_init/\fBcurs_slk\fP(3X)
646 slk_label/\fBcurs_slk\fP(3X)
647 slk_noutrefresh/\fBcurs_slk\fP(3X)
648 slk_refresh/\fBcurs_slk\fP(3X)
649 slk_restore/\fBcurs_slk\fP(3X)
650 slk_set/\fBcurs_slk\fP(3X)
651 slk_touch/\fBcurs_slk\fP(3X)
652 slk_wset/\fBcurs_slk\fP(3X)*
653 standend/\fBcurs_attr\fP(3X)
654 standout/\fBcurs_attr\fP(3X)
655 start_color/\fBcurs_color\fP(3X)
656 subpad/\fBcurs_pad\fP(3X)
657 subwin/\fBcurs_window\fP(3X)
658 syncok/\fBcurs_window\fP(3X)
659 term_attrs/\fBcurs_termattrs\fP(3X)
660 termattrs/\fBcurs_termattrs\fP(3X)
661 termname/\fBcurs_termattrs\fP(3X)
662 tgetent/\fBcurs_termcap\fP(3X)
663 tgetflag/\fBcurs_termcap\fP(3X)
664 tgetnum/\fBcurs_termcap\fP(3X)
665 tgetstr/\fBcurs_termcap\fP(3X)
666 tgoto/\fBcurs_termcap\fP(3X)
667 tigetflag/\fBcurs_terminfo\fP(3X)
668 tigetnum/\fBcurs_terminfo\fP(3X)
669 tigetstr/\fBcurs_terminfo\fP(3X)
670 timeout/\fBcurs_inopts\fP(3X)
671 tiparm/\fBcurs_terminfo\fP(3X)*
672 tiparm_s/\fBcurs_terminfo\fP(3X)*
673 tiscan_s/\fBcurs_terminfo\fP(3X)*
674 touchline/\fBcurs_touch\fP(3X)
675 touchwin/\fBcurs_touch\fP(3X)
676 tparm/\fBcurs_terminfo\fP(3X)
677 tputs/\fBcurs_termcap\fP(3X)
678 tputs/\fBcurs_terminfo\fP(3X)
679 trace/\fBcurs_trace\fP(3X)*
680 typeahead/\fBcurs_inopts\fP(3X)
681 unctrl/\fBcurs_util\fP(3X)
682 unget_wch/\fBcurs_get_wch\fP(3X)
683 ungetch/\fBcurs_getch\fP(3X)
684 ungetmouse/\fBcurs_mouse\fP(3X)*
685 untouchwin/\fBcurs_touch\fP(3X)
686 use_default_colors/\fBdefault_colors\fP(3X)*
687 use_env/\fBcurs_util\fP(3X)
688 use_extended_names/\fBcurs_extend\fP(3X)*
689 use_legacy_coding/\fBlegacy_coding\fP(3X)*
690 use_tioctl/\fBcurs_util\fP(3X)*
691 vid_attr/\fBcurs_terminfo\fP(3X)
692 vid_puts/\fBcurs_terminfo\fP(3X)
693 vidattr/\fBcurs_terminfo\fP(3X)
694 vidputs/\fBcurs_terminfo\fP(3X)
695 vline/\fBcurs_border\fP(3X)
696 vline_set/\fBcurs_border_set\fP(3X)
697 vw_printw/\fBcurs_printw\fP(3X)
698 vw_scanw/\fBcurs_scanw\fP(3X)
699 vwprintw/\fBcurs_printw\fP(3X)
700 vwscanw/\fBcurs_scanw\fP(3X)
701 wadd_wch/\fBcurs_add_wch\fP(3X)
702 wadd_wchnstr/\fBcurs_add_wchstr\fP(3X)
703 wadd_wchstr/\fBcurs_add_wchstr\fP(3X)
704 waddch/\fBcurs_addch\fP(3X)
705 waddchnstr/\fBcurs_addchstr\fP(3X)
706 waddchstr/\fBcurs_addchstr\fP(3X)
707 waddnstr/\fBcurs_addstr\fP(3X)
708 waddnwstr/\fBcurs_addwstr\fP(3X)
709 waddstr/\fBcurs_addstr\fP(3X)
710 waddwstr/\fBcurs_addwstr\fP(3X)
711 wattr_get/\fBcurs_attr\fP(3X)
712 wattr_off/\fBcurs_attr\fP(3X)
713 wattr_on/\fBcurs_attr\fP(3X)
714 wattr_set/\fBcurs_attr\fP(3X)
715 wattroff/\fBcurs_attr\fP(3X)
716 wattron/\fBcurs_attr\fP(3X)
717 wattrset/\fBcurs_attr\fP(3X)
718 wbkgd/\fBcurs_bkgd\fP(3X)
719 wbkgdset/\fBcurs_bkgd\fP(3X)
720 wbkgrnd/\fBcurs_bkgrnd\fP(3X)
721 wbkgrndset/\fBcurs_bkgrnd\fP(3X)
722 wborder/\fBcurs_border\fP(3X)
723 wborder_set/\fBcurs_border_set\fP(3X)
724 wchgat/\fBcurs_attr\fP(3X)
725 wclear/\fBcurs_clear\fP(3X)
726 wclrtobot/\fBcurs_clear\fP(3X)
727 wclrtoeol/\fBcurs_clear\fP(3X)
728 wcolor_set/\fBcurs_attr\fP(3X)
729 wcursyncup/\fBcurs_window\fP(3X)
730 wdelch/\fBcurs_delch\fP(3X)
731 wdeleteln/\fBcurs_deleteln\fP(3X)
732 wecho_wchar/\fBcurs_add_wch\fP(3X)
733 wechochar/\fBcurs_addch\fP(3X)
734 wenclose/\fBcurs_mouse\fP(3X)*
735 werase/\fBcurs_clear\fP(3X)
736 wget_wch/\fBcurs_get_wch\fP(3X)
737 wget_wstr/\fBcurs_get_wstr\fP(3X)
738 wgetbkgrnd/\fBcurs_bkgrnd\fP(3X)
739 wgetch/\fBcurs_getch\fP(3X)
740 wgetdelay/\fBcurs_opaque\fP(3X)*
741 wgetn_wstr/\fBcurs_get_wstr\fP(3X)
742 wgetnstr/\fBcurs_getstr\fP(3X)
743 wgetparent/\fBcurs_opaque\fP(3X)*
744 wgetscrreg/\fBcurs_opaque\fP(3X)*
745 wgetstr/\fBcurs_getstr\fP(3X)
746 whline/\fBcurs_border\fP(3X)
747 whline_set/\fBcurs_border_set\fP(3X)
748 win_wch/\fBcurs_in_wch\fP(3X)
749 win_wchnstr/\fBcurs_in_wchstr\fP(3X)
750 win_wchstr/\fBcurs_in_wchstr\fP(3X)
751 winch/\fBcurs_inch\fP(3X)
752 winchnstr/\fBcurs_inchstr\fP(3X)
753 winchstr/\fBcurs_inchstr\fP(3X)
754 winnstr/\fBcurs_instr\fP(3X)
755 winnwstr/\fBcurs_inwstr\fP(3X)
756 wins_nwstr/\fBcurs_ins_wstr\fP(3X)
757 wins_wch/\fBcurs_ins_wch\fP(3X)
758 wins_wstr/\fBcurs_ins_wstr\fP(3X)
759 winsch/\fBcurs_insch\fP(3X)
760 winsdelln/\fBcurs_deleteln\fP(3X)
761 winsertln/\fBcurs_deleteln\fP(3X)
762 winsnstr/\fBcurs_insstr\fP(3X)
763 winsstr/\fBcurs_insstr\fP(3X)
764 winstr/\fBcurs_instr\fP(3X)
765 winwstr/\fBcurs_inwstr\fP(3X)
766 wmouse_trafo/\fBcurs_mouse\fP(3X)*
767 wmove/\fBcurs_move\fP(3X)
768 wnoutrefresh/\fBcurs_refresh\fP(3X)
769 wprintw/\fBcurs_printw\fP(3X)
770 wredrawln/\fBcurs_refresh\fP(3X)
771 wrefresh/\fBcurs_refresh\fP(3X)
772 wresize/\fBwresize\fP(3X)*
773 wscanw/\fBcurs_scanw\fP(3X)
774 wscrl/\fBcurs_scroll\fP(3X)
775 wsetscrreg/\fBcurs_outopts\fP(3X)
776 wstandend/\fBcurs_attr\fP(3X)
777 wstandout/\fBcurs_attr\fP(3X)
778 wsyncdown/\fBcurs_window\fP(3X)
779 wsyncup/\fBcurs_window\fP(3X)
780 wtimeout/\fBcurs_inopts\fP(3X)
781 wtouchln/\fBcurs_touch\fP(3X)
782 wunctrl/\fBcurs_util\fP(3X)
783 wvline/\fBcurs_border\fP(3X)
784 wvline_set/\fBcurs_border_set\fP(3X)
785 .TE
786 .PP
787 Depending on the configuration,
788 additional sets of functions may be available:
789 .RS 3
790 .TP 5
791 \fBcurs_memleaks\fP(3X) - curses memory-leak checking
792 .TP 5
793 \fBcurs_sp_funcs\fP(3X) - curses screen-pointer extension
794 .TP 5
795 \fBcurs_threads\fP(3X) - curses thread support
796 .TP 5
797 \fBcurs_trace\fP(3X) - curses debugging routines
798 .RE
799 .SH RETURN VALUE
800 Routines that return an integer return \fBERR\fP upon failure and an
801 integer value other than \fBERR\fP upon successful completion, unless
802 otherwise noted in the routine descriptions.
803 .PP
804 As a general rule, routines check for null pointers passed as parameters,
805 and handle this as an error.
806 .PP
807 All macros return the value of the \fBw\fP version, except \fBsetscrreg\fP,
808 \fBwsetscrreg\fP, \fBgetyx\fP, \fBgetbegyx\fP, and \fBgetmaxyx\fP.
809 The return values of
810 \fBsetscrreg\fP,
811 \fBwsetscrreg\fP,
812 \fBgetyx\fP,
813 \fBgetbegyx\fP, and
814 \fBgetmaxyx\fP are undefined (i.e., these should not be used as the
815 right-hand side of assignment statements).
816 .PP
817 Functions with a \*(``mv\*('' prefix first perform a cursor movement using
818 \fBwmove\fP, and return an error if the position is outside the window,
819 or if the window pointer is null.
820 Most \*(``mv\*(''-prefixed functions
821 (except variadic functions such as \fBmvprintw\fP)
822 are provided both as macros and functions.
823 .PP
824 Routines that return pointers return \fBNULL\fP on error.
825 .SH ENVIRONMENT
826 The following environment symbols are useful for customizing the
827 runtime behavior of the \fBncurses\fP library.
828 The most important ones have been already discussed in detail.
829 .SS CC command-character
830 When set, change occurrences of the command_character
831 (i.e., the \fBcmdch\fP capability)
832 of the loaded terminfo entries to the value of this variable.
833 Very few terminfo entries provide this feature.
834 .PP
835 Because this name is also used in development environments to represent
836 the C compiler's name, \fBncurses\fP ignores it if it does not happen to
837 be a single character.
838 .SS BAUDRATE
839 The debugging library checks this environment variable when the application
840 has redirected output to a file.
841 The variable's numeric value is used for the baudrate.
842 If no value is found, \fBncurses\fP uses 9600.
843 This allows testers to construct repeatable test-cases
844 that take into account costs that depend on baudrate.
845 .SS COLUMNS
846 Specify the width of the screen in characters.
847 Applications running in a windowing environment usually are able to
848 obtain the width of the window in which they are executing.
849 If neither the \fBCOLUMNS\fP value nor the terminal's screen size is available,
850 \fBncurses\fP uses the size which may be specified in the terminfo database
851 (i.e., the \fBcols\fP capability).
852 .PP
853 It is important that your application use a correct size for the screen.
854 This is not always possible because your application may be
855 running on a host which does not honor NAWS (Negotiations About Window
856 Size), or because you are temporarily running as another user.
857 However, setting \fBCOLUMNS\fP and/or \fBLINES\fP overrides the library's
858 use of the screen size obtained from the operating system.
859 .PP
860 Either \fBCOLUMNS\fP or \fBLINES\fP symbols may be specified independently.
861 This is mainly useful to circumvent legacy misfeatures of terminal descriptions,
862 e.g., xterm which commonly specifies a 65 line screen.
863 For best results, \fBlines\fP and \fBcols\fP should not be specified in
864 a terminal description for terminals which are run as emulations.
865 .PP
866 Use the \fBuse_env\fP function to disable all use of external environment
867 (but not including system calls) to determine the screen size.
868 Use the \fBuse_tioctl\fP function to update \fBCOLUMNS\fP or \fBLINES\fP
869 to match the screen size obtained from system calls or the terminal database.
870 .SS ESCDELAY
871 Specifies the total time, in milliseconds, for which ncurses will
872 await a character sequence, e.g., a function key.
873 The default value, 1000 milliseconds, is enough for most uses.
874 However, it is made a variable to accommodate unusual applications.
875 .PP
876 The most common instance where you may wish to change this value
877 is to work with slow hosts, e.g., running on a network.
878 If the host cannot read characters rapidly enough, it will have the same
879 effect as if the terminal did not send characters rapidly enough.
880 The library will still see a timeout.
881 .PP
882 Note that xterm mouse events are built up from character sequences
883 received from the xterm.
884 If your application makes heavy use of multiple-clicking, you may
885 wish to lengthen this default value because the timeout applies
886 to the composed multi-click event as well as the individual clicks.
887 .PP
888 In addition to the environment variable,
889 this implementation provides a global variable with the same name.
890 Portable applications should not rely upon the presence of ESCDELAY
891 in either form,
892 but setting the environment variable rather than the global variable
893 does not create problems when compiling an application.
894 .SS HOME
895 Tells \fBncurses\fP where your home directory is.
896 That is where it may read and write auxiliary terminal descriptions:
897 .NS
898 $HOME/.termcap
899 $HOME/.terminfo
900 .NE
901 .SS LINES
902 Like COLUMNS, specify the height of the screen in characters.
903 See COLUMNS for a detailed description.
904 .SS MOUSE_BUTTONS_123
905 This applies only to the OS/2 EMX port.
906 It specifies the order of buttons on the mouse.
907 OS/2 numbers a 3-button mouse inconsistently from other
908 platforms:
909 .NS
910 1 = left
911 .br
912 2 = right
913 .br
914 3 = middle.
915 .NE
916 .PP
917 This variable lets you customize the mouse.
918 The variable must be three numeric digits 1\-3 in any order, e.g., 123 or 321.
919 If it is not specified, \fBncurses\fP uses 132.
920 .SS NCURSES_ASSUMED_COLORS
921 Override the compiled-in assumption that the
922 terminal's default colors are white-on-black
923 (see \fBdefault_colors\fP(3X)).
924 You may set the foreground and background color values with this environment
925 variable by proving a 2-element list: foreground,background.
926 For example, to tell ncurses to not assume anything
927 about the colors, set this to "\-1,\-1".
928 To make it green-on-black, set it to "2,0".
929 Any positive value from zero to the terminfo \fBmax_colors\fP value is allowed.
930 .SS NCURSES_CONSOLE2
931 This applies only to the MinGW port of ncurses.
932 .PP
933 The \fBConsole2\fP program's handling of the Microsoft Console API call
934 \fBCreateConsoleScreenBuffer\fP is defective.
935 Applications which use this will hang.
936 However, it is possible to simulate the action of this call by
937 mapping coordinates,
938 explicitly saving and restoring the original screen contents.
939 Setting the environment variable \fBNCGDB\fP has the same effect.
940 .SS NCURSES_GPM_TERMS
941 This applies only to ncurses configured to use the GPM interface.
942 .PP
943 If present,
944 the environment variable is a list of one or more terminal names
945 against which the \fBTERM\fP environment variable is matched.
946 Setting it to an empty value disables the GPM interface;
947 using the built-in support for xterm, etc.
948 .PP
949 If the environment variable is absent,
950 ncurses will attempt to open GPM if \fBTERM\fP contains \*(``linux\*(''.
951 .SS NCURSES_NO_HARD_TABS
952 \fBNcurses\fP may use tabs as part of the cursor movement optimization.
953 In some cases,
954 your terminal driver may not handle these properly.
955 Set this environment variable to disable the feature.
956 You can also adjust your \fBstty\fP(1) settings to avoid the problem.
957 .SS NCURSES_NO_MAGIC_COOKIE
958 Some terminals use a magic-cookie feature which requires special handling
959 to make highlighting and other video attributes display properly.
960 You can suppress the highlighting entirely for these terminals by
961 setting this environment variable.
962 .SS NCURSES_NO_PADDING
963 Most of the terminal descriptions in the terminfo database are written
964 for real \*(``hardware\*('' terminals.
965 Many people use terminal emulators
966 which run in a windowing environment and use curses-based applications.
967 Terminal emulators can duplicate
968 all of the important aspects of a hardware terminal, but they do not
969 have the same limitations.
970 The chief limitation of a hardware terminal from the standpoint
971 of your application is the management of dataflow, i.e., timing.
972 Unless a hardware terminal is interfaced into a terminal concentrator
973 (which does flow control),
974 it (or your application) must manage dataflow, preventing overruns.
975 The cheapest solution (no hardware cost)
976 is for your program to do this by pausing after
977 operations that the terminal does slowly, such as clearing the display.
978 .PP
979 As a result, many terminal descriptions (including the vt100)
980 have delay times embedded.
981 You may wish to use these descriptions,
982 but not want to pay the performance penalty.
983 .PP
984 Set the NCURSES_NO_PADDING environment variable to disable all but mandatory
985 padding.
986 Mandatory padding is used as a part of special control
987 sequences such as \fBflash\fP.
988 .SS NCURSES_NO_SETBUF
989 This setting is obsolete.
990 Before changes
991 .RS 3
992 .bP
993 started with 5.9 patch 20120825
994 and
995 .bP
996 continued
997 though 5.9 patch 20130126
998 .RE
999 .PP
1000 \fBncurses\fP enabled buffered output during terminal initialization.
1001 This was done (as in SVr4 curses) for performance reasons.
1002 For testing purposes, both of \fBncurses\fP and certain applications,
1003 this feature was made optional.
1004 Setting the NCURSES_NO_SETBUF variable
1005 disabled output buffering, leaving the output in the original (usually
1006 line buffered) mode.
1007 .PP
1008 In the current implementation,
1009 ncurses performs its own buffering and does not require this workaround.
1010 It does not modify the buffering of the standard output.
1011 .PP
1012 The reason for the change was to make the behavior for interrupts and
1013 other signals more robust.
1014 One drawback is that certain nonconventional programs would mix
1015 ordinary stdio calls with ncurses calls and (usually) work.
1016 This is no longer possible since ncurses is not using
1017 the buffered standard output but its own output (to the same file descriptor).
1018 As a special case, the low-level calls such as \fBputp\fP still use the
1019 standard output.
1020 But high-level curses calls do not.
1021 .SS NCURSES_NO_UTF8_ACS
1022 During initialization, the \fBncurses\fP library
1023 checks for special cases where VT100 line-drawing (and the corresponding
1024 alternate character set capabilities) described in the terminfo are known
1025 to be missing.
1026 Specifically, when running in a UTF\-8 locale,
1027 the Linux console emulator and the GNU screen program ignore these.
1028 Ncurses checks the \fBTERM\fP environment variable for these.
1029 For other special cases, you should set this environment variable.
1030 Doing this tells ncurses to use Unicode values which correspond to
1031 the VT100 line-drawing glyphs.
1032 That works for the special cases cited,
1033 and is likely to work for terminal emulators.
1034 .PP
1035 When setting this variable, you should set it to a nonzero value.
1036 Setting it to zero (or to a nonnumber)
1037 disables the special check for \*(``linux\*('' and \*(``screen\*(''.
1038 .PP
1039 As an alternative to the environment variable,
1040 ncurses checks for an extended terminfo capability \fBU8\fP.
1041 This is a numeric capability which can be compiled using \fB@TIC@\ \-x\fP.
1042 For example
1043 .RS 3
1044 .ft \*(CW
1045 .sp
1046 .nf
1047 # linux console, if patched to provide working
1048 # VT100 shift-in/shift-out, with corresponding font.
1049 linux-vt100|linux console with VT100 line-graphics,
1050         U8#0, use=linux,
1051 .sp
1052 # uxterm with vt100Graphics resource set to false
1053 xterm-utf8|xterm relying on UTF-8 line-graphics,
1054         U8#1, use=xterm,
1055 .fi
1056 .ft R
1057 .RE
1058 .PP
1059 The name \*(``U8\*('' is chosen to be two characters,
1060 to permit it to be used by applications that use ncurses'
1061 termcap interface.
1062 .SS NCURSES_TRACE
1063 During initialization, the \fBncurses\fP debugging library
1064 checks the NCURSES_TRACE environment variable.
1065 If it is defined, to a numeric value, \fBncurses\fP calls the \fBtrace\fP
1066 function, using that value as the argument.
1067 .PP
1068 The argument values, which are defined in \fBcurses.h\fP, provide several
1069 types of information.
1070 When running with traces enabled, your application will write the
1071 file \fBtrace\fP to the current directory.
1072 .PP
1073 See \fBcurs_trace\fP(3X) for more information.
1074 .SS TERM
1075 Denotes your terminal type.
1076 Each terminal type is distinct, though many are similar.
1077 .PP
1078 \fBTERM\fP is commonly set by terminal emulators to help
1079 applications find a workable terminal description.
1080 Some of those choose a popular approximation, e.g.,
1081 \*(``ansi\*('', \*(``vt100\*('', \*(``xterm\*('' rather than an exact fit.
1082 Not infrequently, your application will have problems with that approach,
1083 e.g., incorrect function-key definitions.
1084 .PP
1085 If you set \fBTERM\fP in your environment,
1086 it has no effect on the operation of the terminal emulator.
1087 It only affects the way applications work within the terminal.
1088 Likewise, as a general rule (\fBxterm\fP(1) being a rare exception),
1089 terminal emulators which allow you to
1090 specify \fBTERM\fP as a parameter or configuration value do
1091 not change their behavior to match that setting.
1092 .SS TERMCAP
1093 If the \fBncurses\fP library has been configured with \fItermcap\fP
1094 support, \fBncurses\fP will check for a terminal's description in
1095 termcap form if it is not available in the terminfo database.
1096 .PP
1097 The \fBTERMCAP\fP environment variable contains
1098 either a terminal description (with newlines stripped out),
1099 or a file name telling where the information denoted by
1100 the \fBTERM\fP environment variable exists.
1101 In either case, setting it directs \fBncurses\fP to ignore
1102 the usual place for this information, e.g., /etc/termcap.
1103 .SS TERMINFO
1104 \fBncurses\fP can be configured to read from multiple terminal databases.
1105 The \fBTERMINFO\fP variable overrides the location for
1106 the default terminal database.
1107 Terminal descriptions (in terminal format) are stored in terminal databases:
1108 .bP
1109 Normally these are stored in a directory tree,
1110 using subdirectories named by the first letter of the terminal names therein.
1111 .IP
1112 This is the scheme used in System V, which legacy Unix systems use,
1113 and the \fBTERMINFO\fP variable is used by \fIcurses\fP applications on those
1114 systems to override the default location of the terminal database.
1115 .bP
1116 If \fBncurses\fP is built to use hashed databases,
1117 then each entry in this list may be the path of a hashed database file, e.g.,
1118 .NS
1119 /usr/share/terminfo.db
1120 .NE
1121 .IP
1122 rather than
1123 .NS
1124 /usr/share/terminfo/
1125 .NE
1126 .IP
1127 The hashed database uses less disk-space and is a little faster than the
1128 directory tree.
1129 However,
1130 some applications assume the existence of the directory tree,
1131 reading it directly
1132 rather than using the terminfo library calls.
1133 .bP
1134 If \fBncurses\fP is built with a support for reading termcap files
1135 directly, then an entry in this list may be the path of a termcap file.
1136 .bP
1137 If the \fBTERMINFO\fP variable begins with
1138 \*(``hex:\*('' or \*(``b64:\*('',
1139 \fBncurses\fP uses the remainder of that variable as a compiled terminal
1140 description.
1141 You might produce the base64 format using \fBinfocmp\fP(1M):
1142 .NS
1143 TERMINFO="$(infocmp -0 -Q2 -q)"
1144 export TERMINFO
1145 .NE
1146 .IP
1147 The compiled description is used if it corresponds to the terminal identified
1148 by the \fBTERM\fP variable.
1149 .PP
1150 Setting \fBTERMINFO\fP is the simplest,
1151 but not the only way to set location of the default terminal database.
1152 The complete list of database locations in order follows:
1153 .RS 3
1154 .bP
1155 the last terminal database to which \fBncurses\fP wrote,
1156 if any, is searched first
1157 .bP
1158 the location specified by the TERMINFO environment variable
1159 .bP
1160 $HOME/.terminfo
1161 .bP
1162 locations listed in the TERMINFO_DIRS environment variable
1163 .bP
1164 one or more locations whose names are configured and compiled into the
1165 ncurses library, i.e.,
1166 .RS 3
1167 .bP
1168 @TERMINFO_DIRS@ (corresponding to the TERMINFO_DIRS variable)
1169 .bP
1170 @TERMINFO@ (corresponding to the TERMINFO variable)
1171 .RE
1172 .RE
1173 .SS TERMINFO_DIRS
1174 Specifies a list of locations to search for terminal descriptions.
1175 Each location in the list is a terminal database as described in
1176 the section on the \fBTERMINFO\fP variable.
1177 The list is separated by colons (i.e., ":") on Unix, semicolons on OS/2 EMX.
1178 .PP
1179 There is no corresponding feature in System V terminfo;
1180 it is an extension developed for \fBncurses\fP.
1181 .SS TERMPATH
1182 If \fBTERMCAP\fP does not hold a file name then \fBncurses\fP checks
1183 the \fBTERMPATH\fP environment variable.
1184 This is a list of filenames separated by spaces or colons (i.e., ":") on Unix,
1185 semicolons on OS/2 EMX.
1186 .PP
1187 If the \fBTERMPATH\fP environment variable is not set,
1188 \fBncurses\fP looks in the files
1189 .NS
1190 /etc/termcap, /usr/share/misc/termcap and $HOME/.termcap,
1191 .NE
1192 .PP
1193 in that order.
1194 .PP
1195 The library may be configured to disregard the following variables when the
1196 current user is the superuser (root), or if the application uses setuid or
1197 setgid permissions:
1198 .NS
1199 $TERMINFO, $TERMINFO_DIRS, $TERMPATH, as well as $HOME.
1200 .NE
1201 .SH ALTERNATE CONFIGURATIONS
1202 Several different configurations are possible,
1203 depending on the configure script options used when building \fBncurses\fP.
1204 There are a few main options whose effects are visible to the applications
1205 developer using \fBncurses\fP:
1206 .TP 5
1207 \-\-disable\-overwrite
1208 The standard include for \fBncurses\fP is as noted in \fBSYNOPSIS\fP:
1209 .NS
1210 \fB#include <curses.h>\fP
1211 .NE
1212 .IP
1213 This option is used to avoid filename conflicts when \fBncurses\fP
1214 is not the main implementation of curses of the computer.
1215 If \fBncurses\fP is installed disabling overwrite, it puts its headers in
1216 a subdirectory, e.g.,
1217 .NS
1218 \fB#include <ncurses/curses.h>\fP
1219 .NE
1220 .IP
1221 It also omits a symbolic link which would allow you to use \fB\-lcurses\fP
1222 to build executables.
1223 .TP 5
1224 \-\-enable\-widec
1225 The configure script renames the library and
1226 (if the \fB\-\-disable\-overwrite\fP option is used)
1227 puts the header files in a different subdirectory.
1228 All of the library names have a \*(``w\*('' appended to them,
1229 i.e., instead of
1230 .NS
1231 \fB\-lncurses\fP
1232 .NE
1233 .IP
1234 you link with
1235 .NS
1236 \fB\-lncursesw\fP
1237 .NE
1238 .IP
1239 You must also enable the wide-character features in the header file
1240 when compiling for the wide-character library
1241 to use the extended (wide-character) functions.
1242 The symbol which enables these features has changed since XSI Curses, Issue 4:
1243 .RS
1244 .bP
1245 Originally, the wide-character feature required the symbol
1246 \fB_XOPEN_SOURCE_EXTENDED\fP
1247 but that was only valid for XPG4 (1996).
1248 .bP
1249 Later, that was deemed conflicting with \fB_XOPEN_SOURCE\fP defined to 500.
1250 .bP
1251 As of mid-2018,
1252 none of the features in this implementation require a \fB_XOPEN_SOURCE\fP
1253 feature greater than 600.
1254 However, X/Open Curses, Issue 7 (2009) recommends defining it to 700.
1255 .bP
1256 Alternatively, you can enable the feature by defining \fBNCURSES_WIDECHAR\fP
1257 with the caveat that some other header file than \fBcurses.h\fP
1258 may require a specific value for \fB_XOPEN_SOURCE\fP
1259 (or a system-specific symbol).
1260 .RE
1261 .IP
1262 The \fBcurses.h\fP file which is installed for the wide-character
1263 library is designed to be compatible with the normal library's header.
1264 Only the size of the \fBWINDOW\fP structure differs, and very few
1265 applications require more than a pointer to \fBWINDOW\fPs.
1266 .IP
1267 If the headers are installed allowing overwrite,
1268 the wide-character library's headers should be installed last,
1269 to allow applications to be built using either library
1270 from the same set of headers.
1271 .TP 5
1272 \-\-with\-pthread
1273 The configure script renames the library.
1274 All of the library names have a \*(``t\*('' appended to them
1275 (before any \*(``w\*('' added by \fB\-\-enable\-widec\fP).
1276 .IP
1277 The global variables such as \fBLINES\fP are replaced by macros to
1278 allow read-only access.
1279 At the same time, setter-functions are provided to set these values.
1280 Some applications (very few) may require changes to work with this convention.
1281 .TP 5
1282 \-\-with\-shared
1283 .TP
1284 \-\-with\-normal
1285 .TP
1286 \-\-with\-debug
1287 .TP
1288 \-\-with\-profile
1289 The shared and normal (static) library names differ by their suffixes,
1290 e.g., \fBlibncurses.so\fP and \fBlibncurses.a\fP.
1291 The debug and profiling libraries add a \*(``_g\*(''
1292 and a \*(``_p\*('' to the root names respectively,
1293 e.g., \fBlibncurses_g.a\fP and \fBlibncurses_p.a\fP.
1294 .TP 5
1295 \-\-with\-termlib
1296 Low-level functions which do not depend upon whether the library
1297 supports wide-characters, are provided in the tinfo library.
1298 .IP
1299 By doing this, it is possible to share the tinfo library between
1300 wide/normal configurations as well as reduce the size of the library
1301 when only low-level functions are needed.
1302 .IP
1303 Those functions are described in these pages:
1304 .RS
1305 .bP
1306 \fBcurs_extend\fP(3X) \- miscellaneous curses extensions
1307 .bP
1308 \fBcurs_inopts\fP(3X) \- \fBcurses\fP input options
1309 .bP
1310 \fBcurs_kernel\fP(3X) \- low-level \fBcurses\fP routines
1311 .bP
1312 \fBcurs_termattrs\fP(3X) \- \fBcurses\fP environment query routines
1313 .bP
1314 \fBcurs_termcap\fP(3X) \- \fBcurses\fP emulation of termcap
1315 .bP
1316 \fBcurs_terminfo\fP(3X) \- \fBcurses\fP interfaces to terminfo database
1317 .bP
1318 \fBcurs_util\fP(3X) \- miscellaneous \fBcurses\fP utility routines
1319 .RE
1320 .TP 5
1321 \-\-with\-trace
1322 The \fBtrace\fP function normally resides in the debug library,
1323 but it is sometimes useful to configure this in the shared library.
1324 Configure scripts should check for the function's existence rather
1325 than assuming it is always in the debug library.
1326 .SH FILES
1327 .TP 5
1328 @DATADIR@/tabset
1329 directory containing initialization files for the terminal capability database
1330 @TERMINFO@
1331 terminal capability database
1332 .SH SEE ALSO
1333 \fBterminfo\fP(\*n) and related pages whose names begin
1334 \*(``curs_\*('' for detailed routine descriptions.
1335 .br
1336 \fBcurs_variables\fP(3X)
1337 .br
1338 \fBuser_caps\fP(5) for user-defined capabilities
1339 .SH EXTENSIONS
1340 The \fBncurses\fP library can be compiled with an option (\fB\-DUSE_GETCAP\fP)
1341 that falls back to the old-style /etc/termcap file if the terminal setup code
1342 cannot find a terminfo entry corresponding to \fBTERM\fP.
1343 Use of this feature
1344 is not recommended, as it essentially includes an entire termcap compiler in
1345 the \fBncurses\fP startup code, at significant cost in core and startup cycles.
1346 .PP
1347 The \fBncurses\fP library includes facilities for capturing mouse events on
1348 certain terminals (including xterm).
1349 See the \fBcurs_mouse\fP(3X)
1350 manual page for details.
1351 .PP
1352 The \fBncurses\fP library includes facilities for responding to window
1353 resizing events, e.g., when running in an xterm.
1354 See the \fBresizeterm\fP(3X)
1355 and \fBwresize\fP(3X) manual pages for details.
1356 In addition, the library may be configured with a \fBSIGWINCH\fP handler.
1357 .PP
1358 The \fBncurses\fP library extends the fixed set of function key capabilities
1359 of terminals by allowing the application designer to define additional
1360 key sequences at runtime.
1361 See the \fBdefine_key\fP(3X)
1362 \fBkey_defined\fP(3X),
1363 and \fBkeyok\fP(3X) manual pages for details.
1364 .PP
1365 The \fBncurses\fP library can exploit the capabilities of terminals which
1366 implement the ISO\-6429 SGR 39 and SGR 49 controls, which allow an application
1367 to reset the terminal to its original foreground and background colors.
1368 From the users' perspective, the application is able to draw colored
1369 text on a background whose color is set independently, providing better
1370 control over color contrasts.
1371 See the \fBdefault_colors\fP(3X) manual page for details.
1372 .PP
1373 The \fBncurses\fP library includes a function for directing application output
1374 to a printer attached to the terminal device.
1375 See the \fBcurs_print\fP(3X) manual page for details.
1376 .SH PORTABILITY
1377 The \fBncurses\fP library is intended to be BASE-level conformant with XSI
1378 Curses.
1379 The EXTENDED XSI Curses functionality
1380 (including color support) is supported.
1381 .PP
1382 A small number of local differences (that is, individual differences between
1383 the XSI Curses and \fBncurses\fP calls) are described in \fBPORTABILITY\fP
1384 sections of the library man pages.
1385 .SS Error checking
1386 In many cases, X/Open Curses is vague about error conditions,
1387 omitting some of the SVr4 documentation.
1388 .PP
1389 Unlike other implementations, this one checks parameters such as pointers
1390 to WINDOW structures to ensure they are not null.
1391 The main reason for providing this behavior is to guard against programmer
1392 error.
1393 The standard interface does not provide a way for the library
1394 to tell an application which of several possible errors were detected.
1395 Relying on this (or some other) extension will adversely affect the
1396 portability of curses applications.
1397 .SS Extensions versus portability
1398 Most of the extensions provided by ncurses have not been standardized.
1399 Some have been incorporated into other implementations, such as
1400 PDCurses or NetBSD curses.
1401 Here are a few to consider:
1402 .bP
1403 The routine \fBhas_key\fP is not part of XPG4, nor is it present in SVr4.
1404 See the \fBcurs_getch\fP(3X) manual page for details.
1405 .bP
1406 The routine \fBslk_attr\fP is not part of XPG4, nor is it present in SVr4.
1407 See the \fBcurs_slk\fP(3X) manual page for details.
1408 .bP
1409 The routines \fBgetmouse\fP, \fBmousemask\fP, \fBungetmouse\fP,
1410 \fBmouseinterval\fP, and \fBwenclose\fP relating to mouse interfacing are not
1411 part of XPG4, nor are they present in SVr4.
1412 See the \fBcurs_mouse\fP(3X) manual page for details.
1413 .bP
1414 The routine \fBmcprint\fP was not present in any previous curses implementation.
1415 See the \fBcurs_print\fP(3X) manual page for details.
1416 .bP
1417 The routine \fBwresize\fP is not part of XPG4, nor is it present in SVr4.
1418 See the \fBwresize\fP(3X) manual page for details.
1419 .bP
1420 The WINDOW structure's internal details can be hidden from application
1421 programs.
1422 See \fBcurs_opaque\fP(3X) for the discussion of \fBis_scrollok\fP, etc.
1423 .bP
1424 This implementation can be configured to provide rudimentary support
1425 for multi-threaded applications.
1426 See \fBcurs_threads\fP(3X) for details.
1427 .bP
1428 This implementation can also be configured to provide a set of functions which
1429 improve the ability to manage multiple screens.
1430 See \fBcurs_sp_funcs\fP(3X) for details.
1431 .SS Padding differences
1432 In historic curses versions, delays embedded in the capabilities \fBcr\fP,
1433 \fBind\fP, \fBcub1\fP, \fBff\fP and \fBtab\fP activated corresponding delay
1434 bits in the UNIX tty driver.
1435 In this implementation, all padding is done by sending NUL bytes.
1436 This method is slightly more expensive, but narrows the interface
1437 to the UNIX kernel significantly and increases the package's portability
1438 correspondingly.
1439 .SS Header files
1440 The header file \fB<curses.h>\fP automatically includes the header files
1441 \fB<stdio.h>\fP and \fB<unctrl.h>\fP.
1442 .PP
1443 X/Open Curses has more to say,
1444 but does not finish the story:
1445 .RS 4
1446 .PP
1447 The inclusion of <curses.h> may make visible all symbols
1448 from the headers <stdio.h>, <term.h>, <termios.h>, and <wchar.h>.
1449 .RE
1450 .PP
1451 Here is a more complete story:
1452 .bP
1453 Starting with BSD curses, all implementations have included <stdio.h>.
1454 .IP
1455 BSD curses included <curses.h> and <unctrl.h> from an internal header
1456 "curses.ext" ("ext" was a short name for \fIexterns\fP).
1457 .IP
1458 BSD curses used <stdio.h> internally (for \fBprintw\fP and \fBscanw\fP),
1459 but nothing in <curses.h> itself relied upon <stdio.h>.
1460 .bP
1461 SVr2 curses added \fBnewterm\fP(3X), which relies upon <stdio.h>.
1462 That is, the function prototype uses \fBFILE\fP.
1463 .IP
1464 SVr4 curses added \fBputwin\fP and \fBgetwin\fP, which also use <stdio.h>.
1465 .IP
1466 X/Open Curses documents all three of these functions.
1467 .IP
1468 SVr4 curses and X/Open Curses do not require the developer to
1469 include <stdio.h> before including <curses.h>.
1470 Both document curses showing <curses.h> as the only required header.
1471 .IP
1472 As a result, standard <curses.h> will always include <stdio.h>.
1473 .bP
1474 X/Open Curses is inconsistent with respect to SVr4 regarding <unctrl.h>.
1475 .IP
1476 As noted in \fBcurs_util\fP(3X), ncurses includes <unctrl.h> from
1477 <curses.h> (like SVr4).
1478 .bP
1479 X/Open's comments about <term.h> and <termios.h> may refer to HP-UX and AIX:
1480 .IP
1481 HP-UX curses includes <term.h> from <curses.h>
1482 to declare \fBsetupterm\fP in curses.h,
1483 but ncurses (and Solaris curses) do not.
1484 .IP
1485 AIX curses includes <term.h> and <termios.h>.
1486 Again, ncurses (and Solaris curses) do not.
1487 .bP
1488 X/Open says that <curses.h> \fImay\fP include <term.h>,
1489 but there is no requirement that it do that.
1490 .IP
1491 Some programs use functions declared in both <curses.h> and <term.h>,
1492 and must include both headers in the same module.
1493 Very old versions of AIX curses required including <curses.h>
1494 before including <term.h>.
1495 .IP
1496 Because ncurses header files include the headers needed to
1497 define datatypes used in the headers,
1498 ncurses header files can be included in any order.
1499 But for portability, you should include <curses.h> before <term.h>.
1500 .bP
1501 X/Open Curses says \fI"may make visible"\fP
1502 because including a header file does not necessarily make all symbols
1503 in it visible (there are ifdef's to consider).
1504 .IP
1505 For instance, in ncurses <wchar.h> \fImay\fP be included if
1506 the proper symbol is defined, and if ncurses is configured for
1507 wide-character support.
1508 If the header is included, its symbols may be made visible.
1509 That depends on the value used for \fB_XOPEN_SOURCE\fP
1510 feature test macro.
1511 .bP
1512 X/Open Curses documents one required header,
1513 in a special case: <stdarg.h> before <curses.h> to prototype
1514 the \fBvw_printw\fP and \fBvw_scanw\fP functions
1515 (as well as the obsolete
1516 the \fBvwprintw\fP and \fBvwscanw\fP functions).
1517 Each of those uses a \fBva_list\fP parameter.
1518 .IP
1519 The two obsolete functions were introduced in SVr3.
1520 The other functions were introduced in X/Open Curses.
1521 In between, SVr4 curses provided for the possibility that
1522 an application might include either <varargs.h> or <stdarg.h>.
1523 Initially, that was done by using \fBvoid*\fP for the \fBva_list\fP
1524 parameter.
1525 Later, a special type (defined in <stdio.h>) was introduced,
1526 to allow for compiler type-checking.
1527 That special type is always available,
1528 because <stdio.h> is always included by <curses.h>.
1529 .IP
1530 None of the X/Open Curses implementations require an application
1531 to include <stdarg.h> before <curses.h> because they either
1532 have allowed for a special type, or (like ncurses) include <stdarg.h>
1533 directly to provide a portable interface.
1534 .SH NOTES
1535 If standard output from a \fBncurses\fP program is re-directed to something
1536 which is not a tty, screen updates will be directed to standard error.
1537 This was an undocumented feature of AT&T System V Release 3 curses.
1538 .SH AUTHORS
1539 Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.
1540 Based on \fIpcurses\fP by Pavel Curtis.