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