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