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