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