]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/ncurses.3x
ncurses 6.5 - patch 20240601
[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.221 2024/06/01 22:29:08 tom Exp $
32 .TH ncurses 3X 2024-06-01 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "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 .\" Add supplementary paragraph tag on its own line after TP.
50 .\" Adapted from TQ (which would produce mandoc warnings).
51 .de tQ
52 .  br
53 .  ns
54 .  TP
55 ..
56 .
57 .SH NAME
58 \fB\%ncurses\fP \-
59 character-cell terminal interface with optimized output
60 .SH SYNOPSIS
61 .nf
62 \fB#include <curses.h>
63 .fi
64 .SH DESCRIPTION
65 The \*(``new curses\*('' library offers the programmer a
66 terminal-independent means of reading keyboard and mouse input and
67 updating character-cell terminals with output optimized to minimize
68 screen updates.
69 .I \%ncurses
70 replaces the
71 .I curses
72 libraries from
73 System V Release 4 Unix (\*(``SVr4\*('')
74 and
75 4.4BSD Unix,
76 the development of which ceased in the 1990s.
77 This document describes
78 .I \%ncurses
79 version @NCURSES_MAJOR@.@NCURSES_MINOR@
80 (patch @NCURSES_PATCH@).
81 .PP
82 .I \%ncurses
83 permits control of the terminal screen's contents;
84 abstraction and subdivision thereof with
85 .I windows
86 and
87 .IR pads ;
88 acquisition of keyboard and mouse events;
89 control of terminal input and output options;
90 selection of color and rendering attributes
91 (such as bold or underline);
92 the definition and use of
93 .I "soft label"
94 keys;
95 access to the
96 .I \%term\%info
97 terminal capability database;
98 a
99 .I termcap
100 compatibility interface;
101 and an abstraction of the system's API for manipulating the terminal
102 (such as \fI\%termios\fP(3)).
103 .PP
104 .I \%ncurses
105 implements the interface described by X/Open Curses Issue\ 7.
106 In many behavioral details not standardized by X/Open,
107 .I \%ncurses
108 emulates the
109 .I curses
110 library of SVr4 and provides numerous useful extensions.
111 .PP
112 .I \%ncurses
113 man pages employ several sections to clarify matters of usage and
114 interoperability with other
115 .I curses
116 implementations.
117 .bP
118 \*(``NOTES\*('' describes issues and caveats of which any user of the
119 .I \%ncurses
120 API should be aware,
121 such as limitations on the size of an underlying integral type or the
122 availability of a preprocessor macro exclusive of a function definition
123 (which prevents its address from being taken).
124 This section also describes implementation details that will be
125 significant to the programmer but which are not standardized.
126 .bP
127 \*(``EXTENSIONS\*('' presents
128 .I \%ncurses
129 innovations beyond the X/Open Curses standard and/or the SVr4
130 .I curses
131 implementation.
132 They are termed
133 .I extensions
134 to indicate that they cannot be implemented solely by using the library
135 API,
136 but require access to the library's internal state.
137 .bP
138 \*(``PORTABILITY\*('' discusses matters
139 (beyond the exercise of extensions)
140 that should be considered when writing to a
141 .I curses
142 standard,
143 or for multiple implementations.
144 .bP
145 \*(``HISTORY\*('' examines points of detail in
146 .I \%ncurses
147 and other
148 .I curses
149 implementations over the decades of their development,
150 particularly where precedent or inertia have frustrated better design
151 (and,
152 in a few cases,
153 where such inertia has been overcome).
154 .PP
155 A
156 .I curses
157 application must be linked with the library;
158 use the
159 .B \-lncurses
160 option to your compiler or linker.
161 A debugging version of the library may be available;
162 if so,
163 link with it using
164 .BR \-lncurses_g .
165 (Your system integrator may have installed these libraries such that you
166 can use the options
167 .B \-lcurses
168 and
169 .BR \-lcurses_g ,
170 respectively.)
171 The
172 .I \%ncurses_g
173 library generates trace logs
174 (in a file called
175 .I \%trace
176 in the current directory)
177 that describe
178 .I \%ncurses
179 actions.
180 See section \*(``ALTERNATE CONFIGURATIONS\*('' below.
181 .SS "Application Structure"
182 A
183 .I curses
184 application uses information from the system locale;
185 \fI\%setlocale\fP(3) prepares it for
186 .I curses
187 library calls.
188 .PP
189 .RS 4
190 .EX
191 setlocale(LC_ALL, "");
192 .EE
193 .RE
194 .PP
195 If the locale is not thus initialized,
196 the library assumes that characters are printable as in ISO\ 8859-1,
197 to work with certain legacy programs.
198 You should initialize the locale;
199 do not expect consistent behavior from the library when the locale has
200 not been set up.
201 .PP
202 \fB\%initscr\fP(3X) or \fB\%newterm\fP(3X)
203 must be called to initialize
204 .I curses
205 before use of any functions that deal with windows and screens.
206 .PP
207 To get character-at-a-time input without echoing\(emmost interactive,
208 screen-oriented programs want this\(emuse the following sequence.
209 .PP
210 .RS 4
211 .EX
212 initscr(); cbreak(); noecho();
213 .EE
214 .RE
215 .PP
216 Most applications would perform further setup as follows.
217 .PP
218 .RS 4
219 .EX
220 noqiflush();
221 keypad(stdscr, TRUE);
222 .EE
223 .RE
224 .PP
225 A
226 .I curses
227 program then often enters an event loop of some sort.
228 Call \fB\%endwin\fP(3X) before exiting.
229 .SS Overview
230 A
231 .I curses
232 library abstracts the terminal screen by representing all or part of it
233 as a
234 .I \%WINDOW
235 data structure.
236 A
237 .I window
238 is a rectangular grid of character cells,
239 addressed by row and column coordinates
240 .RI ( y ,
241 .IR x ),
242 with the upper left corner as (0, 0).
243 A window called
244 .BR \%stdscr ,
245 the same size as the terminal screen,
246 is always available.
247 Create others with \fB\%newwin\fP(3X).
248 .PP
249 A
250 .I curses
251 library does not manage overlapping windows
252 (but see below).
253 You can either use
254 .B \%stdscr
255 to manage one screen-filling window,
256 or tile the screen into non-overlapping windows and not use
257 .B \%stdscr
258 at all.
259 Mixing the two approaches will result in unpredictable and undesired
260 effects.
261 .PP
262 Functions permit manipulation of a window and the
263 .I cursor
264 identifying the cell within it at which the next output operation will
265 occur.
266 Among those,
267 the most basic are \fB\%move\fP(3X) and \fB\%addch\fP(3X):
268 these place the cursor within and write a character to
269 .BR \%stdscr ,
270 respectively.
271 .PP
272 Frequent changes to the terminal screen can cause unpleasant flicker or
273 inefficient use of the communication channel to the device,
274 so as a rule the library does not update it automatically.
275 Therefore,
276 after using
277 .I curses
278 functions to accumulate a set of desired updates that make sense to
279 present together,
280 call \fB\%refresh\fP(3X) to tell the library to make the user's screen
281 look like \fBstdscr\fP.
282 The library
283 .\" X/Open Curses Issue 7 assumes some optimization will be done, but
284 .\" does not mandate it in any way.
285 .I optimizes
286 its output by computing a minimal volume of operations to mutate the
287 screen from its state at the previous refresh to the new one.
288 Effective optimization demands accurate information about the terminal
289 device:
290 the management of such information is the province of the
291 \fB\%terminfo\fP(3X) API,
292 a feature of every standard
293 .I curses
294 implementation.
295 .PP
296 Special windows called
297 .I pads
298 may also be manipulated.
299 These are not constrained to the size of the terminal screen and their
300 contents need not be completely displayed.
301 See \fB\%curs_pad\fP(3X).
302 .PP
303 Many terminals support configuration of character cell foreground and
304 background colors as well as
305 .IR attributes ","
306 which cause characters to render in such modes as
307 boldfaced,
308 underlined,
309 or in reverse video.
310 See \fB\%curs_attr\fP(3X).
311 .PP
312 .I curses
313 predefines constants for a small set of forms-drawing graphics
314 corresponding to the DEC Alternate Character Set (ACS),
315 a feature of VT100 and other terminals.
316 See \fB\%addch\fP(3X).
317 .PP
318 .I curses
319 is implemented using the operating system's terminal driver;
320 key events are received not as scan codes but as byte sequences.
321 Graphical keycaps
322 (alphanumeric and punctuation keys,
323 and the space)
324 appear as-is.
325 Everything else,
326 including the tab,
327 enter/return,
328 keypad,
329 arrow,
330 and function keys,
331 appears as a control character or a multibyte
332 .I "escape sequence."
333 .I curses
334 can translate the latter into unique
335 .I "key codes."
336 See \fB\%keypad\fP(3X) and \fB\%getch\fP(3X).
337 .PP
338 .I \%ncurses
339 provides reimplementations of the SVr4 \fBpanel\fP(3X), \fBform\fP(3X),
340 and \fBmenu\fP(3X) libraries;
341 they permit overlapping windows and ease construction of user interfaces
342 with
343 .IR curses .
344 .SS "Initialization"
345 The selection of an appropriate value of
346 .I TERM
347 in the process environment is essential to correct
348 .I curses
349 and
350 .I \%term\%info
351 library operation.
352 A well-configured system selects a correct
353 .I TERM
354 value automatically;
355 \fB\%tset\fP(1) may assist with troubleshooting exotic situations.
356 .PP
357 If you change the terminal type,
358 export the shell's
359 .I TERM
360 variable,
361 then run \fB\%tset\fP(1) or the
362 .RB \*(`` "@TPUT@ init" \*(''
363 command.
364 See subsection \*(``Tabs and Initialization\*('' of \fB\%terminfo\fP(5).
365 .PP
366 If the environment variables
367 .I \%LINES
368 and
369 .I \%COLUMNS
370 are set,
371 or if the
372 .I curses
373 program is executing in a graphical windowing environment,
374 the information obtained thence overrides that obtained by
375 .IR \%term\%info .
376 An
377 .I \%ncurses
378 extension supports resizable terminals;
379 see \fB\%wresize\fP(3X).
380 .PP
381 If the environment variable
382 .I \%TERMINFO
383 is defined,
384 a
385 .I curses
386 program checks first for a terminal type description in the location it
387 identifies.
388 .I \%TERMINFO
389 is useful for developing type descriptions or when write permission to
390 .I \%@TERMINFO@
391 is not available.
392 .PP
393 See section \*(``ENVIRONMENT\*('' below.
394 .SS "Naming Conventions"
395 .I curses
396 offers many functions in variant forms using a regular set of
397 alternatives to the name of an elemental one.
398 Those prefixed with \*(``w\*('' require a
399 .I \%WINDOW
400 pointer argument;
401 those with a \*(``mv\*('' prefix first perform cursor movement using
402 \fB\%wmove\fP(3X);
403 a \*(``mvw\*('' prefix indicates both.
404 The \*(``w\*('' function is typically the elemental one;
405 the removal of this prefix usually indicates operation on
406 .BR \%stdscr .
407 .PP
408 Four functions prefixed with \*(``p\*('' require a pad argument.
409 .PP
410 In function synopses,
411 .I \%ncurses
412 man pages apply the following names to parameters.
413 We introduce the character types in the next subsection.
414 .PP
415 .TS
416 center;
417 Li L.
418 bf      a \fIbool\fP (\fBTRUE\fP or \fBFALSE\fP)
419 c       a \fIchar\fP or \fIint\fP
420 ch      a \fIchtype\fP
421 wc      a \fIwchar_t\fP or \fIwint_t\fP
422 wch     a \fIcchar_t\fP
423 win     pointer to a \fIWINDOW\fP
424 pad     pointer to a \fIWINDOW\fP that is a pad
425 .TE
426 .SS "Wide and Non-wide Character Configurations"
427 This man page primarily surveys functions that appear in any
428 configuration of the library.
429 There are two common configurations;
430 see section \*(``ALTERNATE CONFIGURATIONS\*('' below.
431 .TP 10 \" "ncursesw" + 2n
432 .I \%ncurses
433 is the library in its \*(``non-wide\*('' configuration,
434 handling only eight-bit characters.
435 It stores a character combined with attributes and a color pair in a
436 .I \%chtype
437 datum,
438 which is often an alias of
439 .IR int .
440 A string of
441 .I curses
442 characters is similar to a C
443 .I char
444 string;
445 a
446 .I chtype
447 string ends with an integral
448 .BR 0 ","
449 the null
450 .I curses
451 character.
452 .IP
453 Attributes and a color pair selection
454 (with no corresponding character)
455 can be stored in variables of
456 .I \%chtype
457 or
458 .I \%attr_t
459 type.
460 In either case,
461 they are accessed via an integral bit mask.
462 .IP
463 Each cell of a
464 .I \%WINDOW
465 is stored as a
466 .IR \%chtype .
467 .TP 10
468 .I \%ncursesw
469 is the library in its \*(``wide\*('' configuration,
470 which handles character encodings requiring a larger data type than
471 .I \%char
472 (a byte-sized type)
473 can represent.
474 It provides additional functions that complement those in
475 the non-wide library where the size of the underlying character type is
476 significant.
477 A somewhat regular naming convention relates many of the wide variants
478 to their non-wide counterparts;
479 where a non-wide function name contains \*(``ch\*('' or \*(``str\*('',
480 prefix it with \*(``_w\*('' to obtain the wide counterpart.
481 For example,
482 \fB\%waddch\fP becomes \fB\%wadd_wch\fP.
483 (Exceptions that add only \*(``w\*('' comprise
484 .BR \%addwstr ,
485 .BR \%inwstr ,
486 and their variants.)
487 .IP
488 This convention is inapplicable to some non-wide function names,
489 so other transformations are used for the wide configuration:
490 the window background management function \*(``bkgd\*('' becomes
491 \*(``bkgrnd\*('';
492 the window border-drawing and -clearing functions are suffixed with
493 \*(``_set\*('';
494 and character attribute manipulation functions like
495 \*(``attron\*('' become \*(``attr_on\*(''.
496 .RS 10 \" same as foregoing tag width
497 .TP 9 \" "cchar_t" + 2n
498 .I \%cchar_t
499 corresponds to the non-wide configuration's
500 .IR \%chtype .
501 It is a structure type
502 because it requires more storage than fits into a standard scalar type.
503 A character code may not be representable as a
504 .IR \%char ,
505 and moreover more than one character may occupy a cell
506 (as with accent marks and other diacritics).
507 Each character is of type
508 .IR \%wchar_t ;
509 a complex character contains one spacing character and zero or more
510 non-spacing characters
511 (see below).
512 A string of complex characters ends with a
513 .I \%cchar_t
514 whose
515 .I \%wchar_t
516 member is the null wide character.
517 Attributes and a color pair selection are stored in separate fields of
518 the structure,
519 not combined into an integer as in
520 .IR \%chtype .
521 .PP
522 Each cell of a
523 .I \%WINDOW
524 is stored as a
525 .IR \%cchar_t .
526 .PP
527 \fB\%setcchar\fP(3X) and \fB\%getcchar\fP(3X)
528 store and retrieve
529 .I \%cchar_t
530 data.
531 The wide library API of
532 .I \%ncurses
533 depends on two data types standardized by ISO C95.
534 .TP 9
535 .I \%wchar_t
536 stores a wide character.
537 Like
538 .IR \%chtype ,
539 it may be an alias of
540 .IR int .
541 Depending on the character encoding,
542 a wide character may be
543 .IR spacing ,
544 meaning that it occupies a character cell by itself and typically
545 accompanies cursor advancement,
546 or
547 .IR non-spacing ,
548 meaning that it occupies the same cell as a spacing character,
549 is often regarded as a \*(``modifier\*('' of the base glyph with which
550 it combines,
551 and typically does not advance the cursor.
552 .TP 9
553 .I \%wint_t
554 can store a
555 .I \%wchar_t
556 or the constant
557 .BR \%WEOF ,
558 analogously to the
559 .IR int -sized
560 character manipulation functions of ISO C and its constant
561 .BR \%EOF .
562 .RE
563 .\"
564 .SS "Function Name Index"
565 The following table lists the
566 .I curses
567 functions provided in the non-wide and wide APIs and the corresponding
568 man pages that describe them.
569 Those flagged with \*(``*\*(''
570 are
571 .IR \%ncurses "-specific,"
572 neither described by X/Open Curses nor present in SVr4.
573 .PP
574 .TS
575 center tab(/);
576 l l .
577 \f(BIcurses\fP Function Name/Man Page
578 _
579 COLOR_PAIR/\fBcurs_color\fP(3X)
580 PAIR_NUMBER/\fBcurs_color\fP(3X)
581 add_wch/\fBcurs_add_wch\fP(3X)
582 add_wchnstr/\fBcurs_add_wchstr\fP(3X)
583 add_wchstr/\fBcurs_add_wchstr\fP(3X)
584 addch/\fBcurs_addch\fP(3X)
585 addchnstr/\fBcurs_addchstr\fP(3X)
586 addchstr/\fBcurs_addchstr\fP(3X)
587 addnstr/\fBcurs_addstr\fP(3X)
588 addnwstr/\fBcurs_addwstr\fP(3X)
589 addstr/\fBcurs_addstr\fP(3X)
590 addwstr/\fBcurs_addwstr\fP(3X)
591 alloc_pair/\fBnew_pair\fP(3X)*
592 assume_default_colors/\fBdefault_colors\fP(3X)*
593 attr_get/\fBcurs_attr\fP(3X)
594 attr_off/\fBcurs_attr\fP(3X)
595 attr_on/\fBcurs_attr\fP(3X)
596 attr_set/\fBcurs_attr\fP(3X)
597 attroff/\fBcurs_attr\fP(3X)
598 attron/\fBcurs_attr\fP(3X)
599 attrset/\fBcurs_attr\fP(3X)
600 baudrate/\fBcurs_termattrs\fP(3X)
601 beep/\fBcurs_beep\fP(3X)
602 bkgd/\fBcurs_bkgd\fP(3X)
603 bkgdset/\fBcurs_bkgd\fP(3X)
604 bkgrnd/\fBcurs_bkgrnd\fP(3X)
605 bkgrndset/\fBcurs_bkgrnd\fP(3X)
606 border/\fBcurs_border\fP(3X)
607 border_set/\fBcurs_border_set\fP(3X)
608 box/\fBcurs_border\fP(3X)
609 box_set/\fBcurs_border_set\fP(3X)
610 can_change_color/\fBcurs_color\fP(3X)
611 cbreak/\fBcurs_inopts\fP(3X)
612 chgat/\fBcurs_attr\fP(3X)
613 clear/\fBcurs_clear\fP(3X)
614 clearok/\fBcurs_outopts\fP(3X)
615 clrtobot/\fBcurs_clear\fP(3X)
616 clrtoeol/\fBcurs_clear\fP(3X)
617 color_content/\fBcurs_color\fP(3X)
618 color_set/\fBcurs_attr\fP(3X)
619 copywin/\fBcurs_overlay\fP(3X)
620 curs_set/\fBcurs_kernel\fP(3X)
621 curses_trace/\fBcurs_trace\fP(3X)*
622 curses_version/\fBcurs_extend\fP(3X)*
623 def_prog_mode/\fBcurs_kernel\fP(3X)
624 def_shell_mode/\fBcurs_kernel\fP(3X)
625 define_key/\fBdefine_key\fP(3X)*
626 del_curterm/\fBcurs_terminfo\fP(3X)
627 delay_output/\fBcurs_util\fP(3X)
628 delch/\fBcurs_delch\fP(3X)
629 deleteln/\fBcurs_deleteln\fP(3X)
630 delscreen/\fBcurs_initscr\fP(3X)
631 delwin/\fBcurs_window\fP(3X)
632 derwin/\fBcurs_window\fP(3X)
633 doupdate/\fBcurs_refresh\fP(3X)
634 dupwin/\fBcurs_window\fP(3X)
635 echo/\fBcurs_inopts\fP(3X)
636 echo_wchar/\fBcurs_add_wch\fP(3X)
637 echochar/\fBcurs_addch\fP(3X)
638 endwin/\fBcurs_initscr\fP(3X)
639 erase/\fBcurs_clear\fP(3X)
640 erasechar/\fBcurs_termattrs\fP(3X)
641 erasewchar/\fBcurs_termattrs\fP(3X)
642 exit_curses/\fBcurs_memleaks\fP(3X)*
643 exit_terminfo/\fBcurs_memleaks\fP(3X)*
644 extended_color_content/\fBcurs_color\fP(3X)*
645 extended_pair_content/\fBcurs_color\fP(3X)*
646 extended_slk_color/\fBcurs_slk\fP(3X)*
647 filter/\fBcurs_util\fP(3X)
648 find_pair/\fBnew_pair\fP(3X)*
649 flash/\fBcurs_beep\fP(3X)
650 flushinp/\fBcurs_util\fP(3X)
651 free_pair/\fBnew_pair\fP(3X)*
652 get_escdelay/\fBcurs_threads\fP(3X)*
653 get_wch/\fBcurs_get_wch\fP(3X)
654 get_wstr/\fBcurs_get_wstr\fP(3X)
655 getattrs/\fBcurs_attr\fP(3X)
656 getbegx/\fBcurs_legacy\fP(3X)*
657 getbegy/\fBcurs_legacy\fP(3X)*
658 getbegyx/\fBcurs_getyx\fP(3X)
659 getbkgd/\fBcurs_bkgd\fP(3X)
660 getbkgrnd/\fBcurs_bkgrnd\fP(3X)
661 getcchar/\fBcurs_getcchar\fP(3X)
662 getch/\fBcurs_getch\fP(3X)
663 getcurx/\fBcurs_legacy\fP(3X)*
664 getcury/\fBcurs_legacy\fP(3X)*
665 getmaxx/\fBcurs_legacy\fP(3X)*
666 getmaxy/\fBcurs_legacy\fP(3X)*
667 getmaxyx/\fBcurs_getyx\fP(3X)
668 getmouse/\fBcurs_mouse\fP(3X)*
669 getn_wstr/\fBcurs_get_wstr\fP(3X)
670 getnstr/\fBcurs_getstr\fP(3X)
671 getparx/\fBcurs_legacy\fP(3X)*
672 getpary/\fBcurs_legacy\fP(3X)*
673 getparyx/\fBcurs_getyx\fP(3X)
674 getstr/\fBcurs_getstr\fP(3X)
675 getsyx/\fBcurs_kernel\fP(3X)
676 getwin/\fBcurs_util\fP(3X)
677 getyx/\fBcurs_getyx\fP(3X)
678 halfdelay/\fBcurs_inopts\fP(3X)
679 has_colors/\fBcurs_color\fP(3X)
680 has_ic/\fBcurs_termattrs\fP(3X)
681 has_il/\fBcurs_termattrs\fP(3X)
682 has_key/\fBcurs_getch\fP(3X)*
683 has_mouse/\fBcurs_mouse\fP(3X)*
684 hline/\fBcurs_border\fP(3X)
685 hline_set/\fBcurs_border_set\fP(3X)
686 idcok/\fBcurs_outopts\fP(3X)
687 idlok/\fBcurs_outopts\fP(3X)
688 immedok/\fBcurs_outopts\fP(3X)
689 in_wch/\fBcurs_in_wch\fP(3X)
690 in_wchnstr/\fBcurs_in_wchstr\fP(3X)
691 in_wchstr/\fBcurs_in_wchstr\fP(3X)
692 inch/\fBcurs_inch\fP(3X)
693 inchnstr/\fBcurs_inchstr\fP(3X)
694 inchstr/\fBcurs_inchstr\fP(3X)
695 init_color/\fBcurs_color\fP(3X)
696 init_extended_color/\fBcurs_color\fP(3X)*
697 init_extended_pair/\fBcurs_color\fP(3X)*
698 init_pair/\fBcurs_color\fP(3X)
699 initscr/\fBcurs_initscr\fP(3X)
700 innstr/\fBcurs_instr\fP(3X)
701 innwstr/\fBcurs_inwstr\fP(3X)
702 ins_nwstr/\fBcurs_ins_wstr\fP(3X)
703 ins_wch/\fBcurs_ins_wch\fP(3X)
704 ins_wstr/\fBcurs_ins_wstr\fP(3X)
705 insch/\fBcurs_insch\fP(3X)
706 insdelln/\fBcurs_deleteln\fP(3X)
707 insertln/\fBcurs_deleteln\fP(3X)
708 insnstr/\fBcurs_insstr\fP(3X)
709 insstr/\fBcurs_insstr\fP(3X)
710 instr/\fBcurs_instr\fP(3X)
711 intrflush/\fBcurs_inopts\fP(3X)
712 inwstr/\fBcurs_inwstr\fP(3X)
713 is_cbreak/\fBcurs_inopts\fP(3X)*
714 is_cleared/\fBcurs_opaque\fP(3X)*
715 is_echo/\fBcurs_inopts\fP(3X)*
716 is_idcok/\fBcurs_opaque\fP(3X)*
717 is_idlok/\fBcurs_opaque\fP(3X)*
718 is_immedok/\fBcurs_opaque\fP(3X)*
719 is_keypad/\fBcurs_opaque\fP(3X)*
720 is_leaveok/\fBcurs_opaque\fP(3X)*
721 is_linetouched/\fBcurs_touch\fP(3X)
722 is_nl/\fBcurs_inopts\fP(3X)*
723 is_nodelay/\fBcurs_opaque\fP(3X)*
724 is_notimeout/\fBcurs_opaque\fP(3X)*
725 is_pad/\fBcurs_opaque\fP(3X)*
726 is_raw/\fBcurs_inopts\fP(3X)*
727 is_scrollok/\fBcurs_opaque\fP(3X)*
728 is_subwin/\fBcurs_opaque\fP(3X)*
729 is_syncok/\fBcurs_opaque\fP(3X)*
730 is_term_resized/\fBresizeterm\fP(3X)*
731 is_wintouched/\fBcurs_touch\fP(3X)
732 isendwin/\fBcurs_initscr\fP(3X)
733 key_defined/\fBkey_defined\fP(3X)*
734 key_name/\fBcurs_util\fP(3X)
735 keybound/\fBkeybound\fP(3X)*
736 keyname/\fBcurs_util\fP(3X)
737 keyok/\fBkeyok\fP(3X)*
738 keypad/\fBcurs_inopts\fP(3X)
739 killchar/\fBcurs_termattrs\fP(3X)
740 killwchar/\fBcurs_termattrs\fP(3X)
741 leaveok/\fBcurs_outopts\fP(3X)
742 longname/\fBcurs_termattrs\fP(3X)
743 mcprint/\fBcurs_print\fP(3X)*
744 meta/\fBcurs_inopts\fP(3X)
745 mouse_trafo/\fBcurs_mouse\fP(3X)*
746 mouseinterval/\fBcurs_mouse\fP(3X)*
747 mousemask/\fBcurs_mouse\fP(3X)*
748 move/\fBcurs_move\fP(3X)
749 mvadd_wch/\fBcurs_add_wch\fP(3X)
750 mvadd_wchnstr/\fBcurs_add_wchstr\fP(3X)
751 mvadd_wchstr/\fBcurs_add_wchstr\fP(3X)
752 mvaddch/\fBcurs_addch\fP(3X)
753 mvaddchnstr/\fBcurs_addchstr\fP(3X)
754 mvaddchstr/\fBcurs_addchstr\fP(3X)
755 mvaddnstr/\fBcurs_addstr\fP(3X)
756 mvaddnwstr/\fBcurs_addwstr\fP(3X)
757 mvaddstr/\fBcurs_addstr\fP(3X)
758 mvaddwstr/\fBcurs_addwstr\fP(3X)
759 mvchgat/\fBcurs_attr\fP(3X)
760 mvcur/\fBcurs_kernel\fP(3X)
761 mvdelch/\fBcurs_delch\fP(3X)
762 mvderwin/\fBcurs_window\fP(3X)
763 mvget_wch/\fBcurs_get_wch\fP(3X)
764 mvget_wstr/\fBcurs_get_wstr\fP(3X)
765 mvgetch/\fBcurs_getch\fP(3X)
766 mvgetn_wstr/\fBcurs_get_wstr\fP(3X)
767 mvgetnstr/\fBcurs_getstr\fP(3X)
768 mvgetstr/\fBcurs_getstr\fP(3X)
769 mvhline/\fBcurs_border\fP(3X)
770 mvhline_set/\fBcurs_border_set\fP(3X)
771 mvin_wch/\fBcurs_in_wch\fP(3X)
772 mvin_wchnstr/\fBcurs_in_wchstr\fP(3X)
773 mvin_wchstr/\fBcurs_in_wchstr\fP(3X)
774 mvinch/\fBcurs_inch\fP(3X)
775 mvinchnstr/\fBcurs_inchstr\fP(3X)
776 mvinchstr/\fBcurs_inchstr\fP(3X)
777 mvinnstr/\fBcurs_instr\fP(3X)
778 mvinnwstr/\fBcurs_inwstr\fP(3X)
779 mvins_nwstr/\fBcurs_ins_wstr\fP(3X)
780 mvins_wch/\fBcurs_ins_wch\fP(3X)
781 mvins_wstr/\fBcurs_ins_wstr\fP(3X)
782 mvinsch/\fBcurs_insch\fP(3X)
783 mvinsnstr/\fBcurs_insstr\fP(3X)
784 mvinsstr/\fBcurs_insstr\fP(3X)
785 mvinstr/\fBcurs_instr\fP(3X)
786 mvinwstr/\fBcurs_inwstr\fP(3X)
787 mvprintw/\fBcurs_printw\fP(3X)
788 mvscanw/\fBcurs_scanw\fP(3X)
789 mvvline/\fBcurs_border\fP(3X)
790 mvvline_set/\fBcurs_border_set\fP(3X)
791 mvwadd_wch/\fBcurs_add_wch\fP(3X)
792 mvwadd_wchnstr/\fBcurs_add_wchstr\fP(3X)
793 mvwadd_wchstr/\fBcurs_add_wchstr\fP(3X)
794 mvwaddch/\fBcurs_addch\fP(3X)
795 mvwaddchnstr/\fBcurs_addchstr\fP(3X)
796 mvwaddchstr/\fBcurs_addchstr\fP(3X)
797 mvwaddnstr/\fBcurs_addstr\fP(3X)
798 mvwaddnwstr/\fBcurs_addwstr\fP(3X)
799 mvwaddstr/\fBcurs_addstr\fP(3X)
800 mvwaddwstr/\fBcurs_addwstr\fP(3X)
801 mvwchgat/\fBcurs_attr\fP(3X)
802 mvwdelch/\fBcurs_delch\fP(3X)
803 mvwget_wch/\fBcurs_get_wch\fP(3X)
804 mvwget_wstr/\fBcurs_get_wstr\fP(3X)
805 mvwgetch/\fBcurs_getch\fP(3X)
806 mvwgetn_wstr/\fBcurs_get_wstr\fP(3X)
807 mvwgetnstr/\fBcurs_getstr\fP(3X)
808 mvwgetstr/\fBcurs_getstr\fP(3X)
809 mvwhline/\fBcurs_border\fP(3X)
810 mvwhline_set/\fBcurs_border_set\fP(3X)
811 mvwin/\fBcurs_window\fP(3X)
812 mvwin_wch/\fBcurs_in_wch\fP(3X)
813 mvwin_wchnstr/\fBcurs_in_wchstr\fP(3X)
814 mvwin_wchstr/\fBcurs_in_wchstr\fP(3X)
815 mvwinch/\fBcurs_inch\fP(3X)
816 mvwinchnstr/\fBcurs_inchstr\fP(3X)
817 mvwinchstr/\fBcurs_inchstr\fP(3X)
818 mvwinnstr/\fBcurs_instr\fP(3X)
819 mvwinnwstr/\fBcurs_inwstr\fP(3X)
820 mvwins_nwstr/\fBcurs_ins_wstr\fP(3X)
821 mvwins_wch/\fBcurs_ins_wch\fP(3X)
822 mvwins_wstr/\fBcurs_ins_wstr\fP(3X)
823 mvwinsch/\fBcurs_insch\fP(3X)
824 mvwinsnstr/\fBcurs_insstr\fP(3X)
825 mvwinsstr/\fBcurs_insstr\fP(3X)
826 mvwinstr/\fBcurs_instr\fP(3X)
827 mvwinwstr/\fBcurs_inwstr\fP(3X)
828 mvwprintw/\fBcurs_printw\fP(3X)
829 mvwscanw/\fBcurs_scanw\fP(3X)
830 mvwvline/\fBcurs_border\fP(3X)
831 mvwvline_set/\fBcurs_border_set\fP(3X)
832 napms/\fBcurs_kernel\fP(3X)
833 newpad/\fBcurs_pad\fP(3X)
834 newterm/\fBcurs_initscr\fP(3X)
835 newwin/\fBcurs_window\fP(3X)
836 nl/\fBcurs_inopts\fP(3X)
837 nocbreak/\fBcurs_inopts\fP(3X)
838 nodelay/\fBcurs_inopts\fP(3X)
839 noecho/\fBcurs_inopts\fP(3X)
840 nofilter/\fBcurs_util\fP(3X)*
841 nonl/\fBcurs_inopts\fP(3X)
842 noqiflush/\fBcurs_inopts\fP(3X)
843 noraw/\fBcurs_inopts\fP(3X)
844 notimeout/\fBcurs_inopts\fP(3X)
845 overlay/\fBcurs_overlay\fP(3X)
846 overwrite/\fBcurs_overlay\fP(3X)
847 pair_content/\fBcurs_color\fP(3X)
848 pecho_wchar/\fBcurs_pad\fP(3X)
849 pechochar/\fBcurs_pad\fP(3X)
850 pnoutrefresh/\fBcurs_pad\fP(3X)
851 prefresh/\fBcurs_pad\fP(3X)
852 printw/\fBcurs_printw\fP(3X)
853 putp/\fBcurs_terminfo\fP(3X)
854 putwin/\fBcurs_util\fP(3X)
855 qiflush/\fBcurs_inopts\fP(3X)
856 raw/\fBcurs_inopts\fP(3X)
857 redrawwin/\fBcurs_refresh\fP(3X)
858 refresh/\fBcurs_refresh\fP(3X)
859 reset_color_pairs/\fBcurs_color\fP(3X)*
860 reset_prog_mode/\fBcurs_kernel\fP(3X)
861 reset_shell_mode/\fBcurs_kernel\fP(3X)
862 resetty/\fBcurs_kernel\fP(3X)
863 resize_term/\fBresizeterm\fP(3X)*
864 resizeterm/\fBresizeterm\fP(3X)*
865 restartterm/\fBcurs_terminfo\fP(3X)
866 ripoffline/\fBcurs_kernel\fP(3X)
867 savetty/\fBcurs_kernel\fP(3X)
868 scanw/\fBcurs_scanw\fP(3X)
869 scr_dump/\fBcurs_scr_dump\fP(3X)
870 scr_init/\fBcurs_scr_dump\fP(3X)
871 scr_restore/\fBcurs_scr_dump\fP(3X)
872 scr_set/\fBcurs_scr_dump\fP(3X)
873 scrl/\fBcurs_scroll\fP(3X)
874 scroll/\fBcurs_scroll\fP(3X)
875 scrollok/\fBcurs_outopts\fP(3X)
876 set_curterm/\fBcurs_terminfo\fP(3X)
877 set_escdelay/\fBcurs_threads\fP(3X)*
878 set_tabsize/\fBcurs_threads\fP(3X)*
879 set_term/\fBcurs_initscr\fP(3X)
880 setcchar/\fBcurs_getcchar\fP(3X)
881 setscrreg/\fBcurs_outopts\fP(3X)
882 setsyx/\fBcurs_kernel\fP(3X)
883 setupterm/\fBcurs_terminfo\fP(3X)
884 slk_attr/\fBcurs_slk\fP(3X)*
885 slk_attr_off/\fBcurs_slk\fP(3X)
886 slk_attr_on/\fBcurs_slk\fP(3X)
887 slk_attr_set/\fBcurs_slk\fP(3X)
888 slk_attroff/\fBcurs_slk\fP(3X)
889 slk_attron/\fBcurs_slk\fP(3X)
890 slk_attrset/\fBcurs_slk\fP(3X)
891 slk_clear/\fBcurs_slk\fP(3X)
892 slk_color/\fBcurs_slk\fP(3X)
893 slk_init/\fBcurs_slk\fP(3X)
894 slk_label/\fBcurs_slk\fP(3X)
895 slk_noutrefresh/\fBcurs_slk\fP(3X)
896 slk_refresh/\fBcurs_slk\fP(3X)
897 slk_restore/\fBcurs_slk\fP(3X)
898 slk_set/\fBcurs_slk\fP(3X)
899 slk_touch/\fBcurs_slk\fP(3X)
900 slk_wset/\fBcurs_slk\fP(3X)
901 standend/\fBcurs_attr\fP(3X)
902 standout/\fBcurs_attr\fP(3X)
903 start_color/\fBcurs_color\fP(3X)
904 subpad/\fBcurs_pad\fP(3X)
905 subwin/\fBcurs_window\fP(3X)
906 syncok/\fBcurs_window\fP(3X)
907 term_attrs/\fBcurs_termattrs\fP(3X)
908 termattrs/\fBcurs_termattrs\fP(3X)
909 termname/\fBcurs_termattrs\fP(3X)
910 tgetent/\fBcurs_termcap\fP(3X)
911 tgetflag/\fBcurs_termcap\fP(3X)
912 tgetnum/\fBcurs_termcap\fP(3X)
913 tgetstr/\fBcurs_termcap\fP(3X)
914 tgoto/\fBcurs_termcap\fP(3X)
915 tigetflag/\fBcurs_terminfo\fP(3X)
916 tigetnum/\fBcurs_terminfo\fP(3X)
917 tigetstr/\fBcurs_terminfo\fP(3X)
918 timeout/\fBcurs_inopts\fP(3X)
919 tiparm/\fBcurs_terminfo\fP(3X)
920 tiparm_s/\fBcurs_terminfo\fP(3X)*
921 tiscan_s/\fBcurs_terminfo\fP(3X)*
922 touchline/\fBcurs_touch\fP(3X)
923 touchwin/\fBcurs_touch\fP(3X)
924 tparm/\fBcurs_terminfo\fP(3X)
925 tputs/\fBcurs_termcap\fP(3X)
926 tputs/\fBcurs_terminfo\fP(3X)
927 trace/\fBcurs_trace\fP(3X)*
928 typeahead/\fBcurs_inopts\fP(3X)
929 unctrl/\fBcurs_util\fP(3X)
930 unget_wch/\fBcurs_get_wch\fP(3X)
931 ungetch/\fBcurs_getch\fP(3X)
932 ungetmouse/\fBcurs_mouse\fP(3X)*
933 untouchwin/\fBcurs_touch\fP(3X)
934 use_default_colors/\fBdefault_colors\fP(3X)*
935 use_env/\fBcurs_util\fP(3X)
936 use_extended_names/\fBcurs_extend\fP(3X)*
937 use_legacy_coding/\fBlegacy_coding\fP(3X)*
938 use_screen/\fBcurs_threads\fP(3X)*
939 use_tioctl/\fBcurs_util\fP(3X)*
940 use_window/\fBcurs_threads\fP(3X)*
941 vid_attr/\fBcurs_terminfo\fP(3X)
942 vid_puts/\fBcurs_terminfo\fP(3X)
943 vidattr/\fBcurs_terminfo\fP(3X)
944 vidputs/\fBcurs_terminfo\fP(3X)
945 vline/\fBcurs_border\fP(3X)
946 vline_set/\fBcurs_border_set\fP(3X)
947 vw_printw/\fBcurs_printw\fP(3X)
948 vw_scanw/\fBcurs_scanw\fP(3X)
949 vwprintw/\fBcurs_printw\fP(3X)
950 vwscanw/\fBcurs_scanw\fP(3X)
951 wadd_wch/\fBcurs_add_wch\fP(3X)
952 wadd_wchnstr/\fBcurs_add_wchstr\fP(3X)
953 wadd_wchstr/\fBcurs_add_wchstr\fP(3X)
954 waddch/\fBcurs_addch\fP(3X)
955 waddchnstr/\fBcurs_addchstr\fP(3X)
956 waddchstr/\fBcurs_addchstr\fP(3X)
957 waddnstr/\fBcurs_addstr\fP(3X)
958 waddnwstr/\fBcurs_addwstr\fP(3X)
959 waddstr/\fBcurs_addstr\fP(3X)
960 waddwstr/\fBcurs_addwstr\fP(3X)
961 wattr_get/\fBcurs_attr\fP(3X)
962 wattr_off/\fBcurs_attr\fP(3X)
963 wattr_on/\fBcurs_attr\fP(3X)
964 wattr_set/\fBcurs_attr\fP(3X)
965 wattroff/\fBcurs_attr\fP(3X)
966 wattron/\fBcurs_attr\fP(3X)
967 wattrset/\fBcurs_attr\fP(3X)
968 wbkgd/\fBcurs_bkgd\fP(3X)
969 wbkgdset/\fBcurs_bkgd\fP(3X)
970 wbkgrnd/\fBcurs_bkgrnd\fP(3X)
971 wbkgrndset/\fBcurs_bkgrnd\fP(3X)
972 wborder/\fBcurs_border\fP(3X)
973 wborder_set/\fBcurs_border_set\fP(3X)
974 wchgat/\fBcurs_attr\fP(3X)
975 wclear/\fBcurs_clear\fP(3X)
976 wclrtobot/\fBcurs_clear\fP(3X)
977 wclrtoeol/\fBcurs_clear\fP(3X)
978 wcolor_set/\fBcurs_attr\fP(3X)
979 wcursyncup/\fBcurs_window\fP(3X)
980 wdelch/\fBcurs_delch\fP(3X)
981 wdeleteln/\fBcurs_deleteln\fP(3X)
982 wecho_wchar/\fBcurs_add_wch\fP(3X)
983 wechochar/\fBcurs_addch\fP(3X)
984 wenclose/\fBcurs_mouse\fP(3X)*
985 werase/\fBcurs_clear\fP(3X)
986 wget_wch/\fBcurs_get_wch\fP(3X)
987 wget_wstr/\fBcurs_get_wstr\fP(3X)
988 wgetbkgrnd/\fBcurs_bkgrnd\fP(3X)
989 wgetch/\fBcurs_getch\fP(3X)
990 wgetdelay/\fBcurs_opaque\fP(3X)*
991 wgetn_wstr/\fBcurs_get_wstr\fP(3X)
992 wgetnstr/\fBcurs_getstr\fP(3X)
993 wgetparent/\fBcurs_opaque\fP(3X)*
994 wgetscrreg/\fBcurs_opaque\fP(3X)*
995 wgetstr/\fBcurs_getstr\fP(3X)
996 whline/\fBcurs_border\fP(3X)
997 whline_set/\fBcurs_border_set\fP(3X)
998 win_wch/\fBcurs_in_wch\fP(3X)
999 win_wchnstr/\fBcurs_in_wchstr\fP(3X)
1000 win_wchstr/\fBcurs_in_wchstr\fP(3X)
1001 winch/\fBcurs_inch\fP(3X)
1002 winchnstr/\fBcurs_inchstr\fP(3X)
1003 winchstr/\fBcurs_inchstr\fP(3X)
1004 winnstr/\fBcurs_instr\fP(3X)
1005 winnwstr/\fBcurs_inwstr\fP(3X)
1006 wins_nwstr/\fBcurs_ins_wstr\fP(3X)
1007 wins_wch/\fBcurs_ins_wch\fP(3X)
1008 wins_wstr/\fBcurs_ins_wstr\fP(3X)
1009 winsch/\fBcurs_insch\fP(3X)
1010 winsdelln/\fBcurs_deleteln\fP(3X)
1011 winsertln/\fBcurs_deleteln\fP(3X)
1012 winsnstr/\fBcurs_insstr\fP(3X)
1013 winsstr/\fBcurs_insstr\fP(3X)
1014 winstr/\fBcurs_instr\fP(3X)
1015 winwstr/\fBcurs_inwstr\fP(3X)
1016 wmouse_trafo/\fBcurs_mouse\fP(3X)*
1017 wmove/\fBcurs_move\fP(3X)
1018 wnoutrefresh/\fBcurs_refresh\fP(3X)
1019 wprintw/\fBcurs_printw\fP(3X)
1020 wredrawln/\fBcurs_refresh\fP(3X)
1021 wrefresh/\fBcurs_refresh\fP(3X)
1022 wresize/\fBwresize\fP(3X)*
1023 wscanw/\fBcurs_scanw\fP(3X)
1024 wscrl/\fBcurs_scroll\fP(3X)
1025 wsetscrreg/\fBcurs_outopts\fP(3X)
1026 wstandend/\fBcurs_attr\fP(3X)
1027 wstandout/\fBcurs_attr\fP(3X)
1028 wsyncdown/\fBcurs_window\fP(3X)
1029 wsyncup/\fBcurs_window\fP(3X)
1030 wtimeout/\fBcurs_inopts\fP(3X)
1031 wtouchln/\fBcurs_touch\fP(3X)
1032 wunctrl/\fBcurs_util\fP(3X)
1033 wvline/\fBcurs_border\fP(3X)
1034 wvline_set/\fBcurs_border_set\fP(3X)
1035 .TE
1036 .PP
1037 .IR \%ncurses 's
1038 .I "screen-pointer extension"
1039 adds additional functions corresponding to many of the above,
1040 each with an \*(``_sp\*('' suffix;
1041 see \fBcurs_sp_funcs\fP(3X).
1042 .PP
1043 The availability of some extensions is configurable when
1044 .I \%ncurses
1045 is compiled;
1046 see sections \*(``ALTERNATE CONFIGURATIONS\*('' and \*(``EXTENSIONS\*(''
1047 below.
1048 .SH RETURN VALUE
1049 Unless otherwise noted,
1050 functions that return integers return the constants
1051 .B OK
1052 on success and
1053 .B ERR
1054 on failure;
1055 see \fB\%curs_variables\fP(3X).
1056 Functions that return pointers return
1057 .B NULL
1058 on failure.
1059 Typically,
1060 .I \%ncurses
1061 treats a null pointer passed as a function parameter as a failure.
1062 Functions prefixed with \*(``mv\*('' first perform cursor movement and
1063 fail if the position
1064 .RI ( y ,
1065 .IR x )
1066 is outside the window boundaries.
1067 .SH ENVIRONMENT
1068 The following symbols from the process environment customize the
1069 runtime behavior of
1070 .I \%ncurses
1071 applications.
1072 The library may be configured to disregard the variables
1073 .IR \%TERMINFO ,
1074 .IR \%TERMINFO_DIRS ,
1075 .IR \%TERMPATH ,
1076 and
1077 .IR HOME ,
1078 if the user is the superuser (root),
1079 or the application uses \fI\%setuid\fP(2) or \fI\%setgid\fP(2).
1080 .SS "\fIBAUDRATE\fP"
1081 The debugging library checks this variable when the application has
1082 redirected output to a file.
1083 Its integral value is used for the baud rate.
1084 If that value is absent or invalid,
1085 .I \%ncurses
1086 uses 9600.
1087 This feature allows developers to construct repeatable test cases
1088 that take into account optimization decisions that depend on baud rate.
1089 .SS "\fICC\fP (command character)"
1090 When set,
1091 the
1092 .B \%command_character
1093 .RB \%( cmdch )
1094 capability value of loaded
1095 .I \%term\%info
1096 entries changes to the value of this variable.
1097 Very few
1098 .I \%term\%info
1099 entries provide this feature.
1100 .PP
1101 Because this name is also used in development environments to store the
1102 C compiler's name,
1103 .I \%ncurses
1104 ignores its value if it is not one character in length.
1105 .SS "\fICOLUMNS\fP"
1106 This variable specifies the width of the screen in characters.
1107 Applications running in a windowing environment usually are able to
1108 obtain the width of the window in which they are executing.
1109 If
1110 .I \%COLUMNS
1111 is not defined and the terminal's screen size is not available from the
1112 terminal driver,
1113 .I \%ncurses
1114 uses the size specified by the
1115 .B \%columns
1116 .RB \%( cols )
1117 capability of the terminal type's entry in the
1118 .I \%term\%info
1119 database,
1120 if any.
1121 .PP
1122 It is important that your application use the correct screen size.
1123 Automatic detection thereof is not always possible because an
1124 application may be running on a host that does not honor NAWS
1125 (Negotiations About Window Size)
1126 or as a different user ID than the owner of the terminal device file.
1127 Setting
1128 .I \%COLUMNS
1129 and/or
1130 .I \%LINES
1131 overrides the library's use of the screen size obtained from the
1132 operating system.
1133 .PP
1134 The
1135 .I \%COLUMNS
1136 and
1137 .I \%LINES
1138 variables may be specified independently.
1139 .I \%ncurses
1140 enforces an upper limit of 512 on each when reading the value.
1141 This property is useful to circumvent misfeatures of legacy terminal
1142 type descriptions;
1143 \fI\%xterm\fP(1) descriptions specifying 65 lines were once notorious.
1144 For best results,
1145 avoid specifying
1146 .B cols
1147 and
1148 .B lines
1149 capability codes in
1150 .I \%term\%info
1151 descriptions of terminal emulators.
1152 .PP
1153 \fBuse_env\fP(3X) can disable use of the process environment
1154 in determining the screen size.
1155 \fBuse_tioctl\fP(3X) can update
1156 .I \%COLUMNS
1157 and
1158 .I \%LINES
1159 to match the screen size obtained from system calls or the terminal
1160 database.
1161 .SS "\fIESCDELAY\fP"
1162 For
1163 .I curses
1164 to distinguish the ESC character resulting from a user's press of the
1165 \*(``Escape\*('' key on the input device from one beginning an
1166 .I "escape sequence"
1167 (as commonly produced by function keys),
1168 it waits after receiving the escape character to see if further
1169 characters are available on the input stream within a short interval.
1170 A global variable
1171 .B \%ESCDELAY
1172 stores this interval in milliseconds.
1173 The default value of 1000
1174 (one second)
1175 is adequate for most uses.
1176 This environment variable overrides it;
1177 .I \%ncurses
1178 enforces an upper limit of 30,000
1179 (30 seconds)
1180 when reading the value.
1181 .PP
1182 The most common instance where you may wish to change this value
1183 is to work with a remote host over a slow communication channel.
1184 If the host running a
1185 .I curses
1186 application does not receive the characters of an escape sequence in a
1187 timely manner,
1188 the library can interpret them as multiple key stroke events.
1189 .PP
1190 \fI\%xterm\fP(1) mouse events are a form of escape sequence;
1191 therefore,
1192 if your application makes heavy use of multiple-clicking,
1193 you may wish to lengthen the default value because the delay applies
1194 to the composite multi-click event as well as the individual clicks.
1195 .PP
1196 Portable applications should not rely upon the presence of
1197 .B \%ESCDELAY
1198 in either form,
1199 but setting the environment variable rather than the global variable
1200 does not create problems when compiling an application.
1201 .PP
1202 If \fB\%keypad\fP(3X) is disabled for the
1203 .I curses
1204 window receiving input,
1205 a program must disambiguate escape sequences itself.
1206 .SS "\fIHOME\fP"
1207 .I \%ncurses
1208 may read and write auxiliary terminal descriptions in
1209 .I \%.termcap
1210 and
1211 .I \%.terminfo
1212 files in the user's home directory.
1213 .SS "\fILINES\fP"
1214 This counterpart to
1215 .I \%COLUMNS
1216 specifies the height of the screen in characters.
1217 The corresponding
1218 .I \%term\%info
1219 capability and code is
1220 .BR \%lines .
1221 See the description of the
1222 .I \%COLUMNS
1223 variable above.
1224 .SS "\fIMOUSE_BUTTONS_123\fP"
1225 (OS/2 EMX port only)
1226 OS/2 numbers a three-button mouse inconsistently with other platforms,
1227 such that 1 is the left button,
1228 2 the right,
1229 and 3 the middle.
1230 This variable customizes the mouse button numbering.
1231 Its value must be three digits 1\-3 in any order.
1232 By default,
1233 .I \%ncurses
1234 assumes a numbering of \*(``132\*(''.
1235 .SS "\fINCURSES_ASSUMED_COLORS\fP"
1236 If set,
1237 this variable overrides the
1238 .I \%ncurses
1239 library's compiled-in assumption that the terminal's default colors are
1240 white on black;
1241 see \fB\%default_colors\fP(3X).
1242 Set the foreground and background color values with this environment
1243 variable by assigning it two integer values separated by a comma,
1244 indicating foregound and background color numbers,
1245 respectively.
1246 .PP
1247 For example,
1248 to tell
1249 .I \%ncurses
1250 not to assume anything about the colors,
1251 use a value of \*(``\-1,\-1\*(''.
1252 To make the default color scheme green on black,
1253 use \*(``2,0\*(''.
1254 .I \%ncurses
1255 accepts integral values from \-1 up to the value of the
1256 .I \%term\%info
1257 .B \%max_colors
1258 .RB ( colors )
1259 capability.
1260 .SS "\fINCURSES_CONSOLE2\fP"
1261 (MinGW port only)
1262 The
1263 .I \%Console2
1264 .\" https://www.hanselman.com/blog/console2-a-better-windows-command-prompt
1265 program defectively handles the Microsoft Console API call
1266 .IR \%Create\%Console\%Screen\%Buffer .
1267 Applications that use it will hang.
1268 However,
1269 it is possible to simulate the action of this call by mapping
1270 coordinates,
1271 explicitly saving and restoring the original screen contents.
1272 Setting the environment variable
1273 .I \%NCGDB
1274 has the same effect.
1275 .SS "\fINCURSES_GPM_TERMS\fP"
1276 (Linux only)
1277 When
1278 .I \%ncurses
1279 is configured to use the GPM interface,
1280 this variable may list one or more terminal type names,
1281 delimited by vertical bars
1282 .RB ( | )
1283 or colons
1284 .RB ( : ),
1285 against which the
1286 .I TERM
1287 variable
1288 (see below)
1289 is matched.
1290 An empty value disables the GPM interface,
1291 using
1292 .IR \%ncurses 's
1293 built-in support for \fI\%xterm\fP(1) mouse protocols instead.
1294 If the variable is absent,
1295 .I \%ncurses
1296 attempts to open GPM if
1297 .I TERM
1298 contains \*(``linux\*(''.
1299 .SS "\fINCURSES_NO_HARD_TABS\fP"
1300 .I \%ncurses
1301 may use tab characters in cursor movement optimization.
1302 In some cases,
1303 your terminal driver may not handle them properly.
1304 Set this environment variable to any value to disable the feature.
1305 You can also adjust your \fI\%stty\fP(1) settings to avoid the problem.
1306 .SS "\fINCURSES_NO_MAGIC_COOKIE\fP"
1307 Many terminals store video attributes as a property of a character cell,
1308 as
1309 .I curses
1310 does.
1311 Historically,
1312 some recorded changes in video attributes as data that logically
1313 .I occupies
1314 character cells on the display,
1315 switching attributes on or off,
1316 similarly to tags in a markup language;
1317 these are termed \*(``magic cookies\*('',
1318 and must be subsequently overprinted.
1319 If the
1320 .I \%term\%info
1321 entry for your terminal type does not adequately describe its handling
1322 of magic cookies,
1323 set this variable to any value to instruct
1324 .I \%ncurses
1325 to disable attributes entirely.
1326 .SS "\fINCURSES_NO_PADDING\fP"
1327 Most terminal type descriptions in the
1328 .I \%term\%info
1329 database detail hardware devices.
1330 Many people use
1331 .IR curses -based
1332 applications in terminal emulator programs that run in a windowing
1333 environment.
1334 These programs can duplicate all of the important features of a hardware
1335 terminal,
1336 but often lack their limitations.
1337 Chief among these absent drawbacks is the problem of data flow
1338 management;
1339 that is,
1340 limiting the speed of communication to what the hardware could handle.
1341 Unless a hardware terminal is interfaced into a terminal concentrator
1342 (which does flow control),
1343 an application must manage flow itself to prevent overruns and data
1344 loss.
1345 .PP
1346 A solution that comes at no hardware cost is for an application to pause
1347 after directing a terminal to execute an operation that it performs
1348 slowly,
1349 such as clearing the display.
1350 Many terminal type descriptions,
1351 including that for the VT100,
1352 embed delay specifications in capabilities.
1353 You may wish to use these terminal descriptions without paying the
1354 performance penalty.
1355 Set
1356 .I \%NCURSES_NO_PADDING
1357 to any value to disable all but mandatory padding.
1358 Mandatory padding is used by such terminal capabilities as
1359 .B \%flash_screen
1360 .RB ( flash ).
1361 .SS "\fINCURSES_NO_SETBUF\fP"
1362 (Obsolete)
1363 Prior to internal changes developed in
1364 .I \%ncurses
1365 5.9
1366 (patches 20120825 through 20130126),
1367 the library used \fI\%setbuf\fP(3) to enable fully buffered output when
1368 initializing the terminal.
1369 This was done,
1370 as in SVr4
1371 .IR curses ,
1372 to increase performance.
1373 For testing purposes,
1374 both of
1375 .I \%ncurses
1376 and of certain applications,
1377 this feature was made optional.
1378 Setting this variable disabled output buffering,
1379 leaving the output stream in the original
1380 (usually line-buffered)
1381 mode.
1382 .PP
1383 Nowadays,
1384 .I \%ncurses
1385 performs its own buffering and does not require this workaround;
1386 it does not modify the buffering of the standard output stream.
1387 This approach makes signal handling,
1388 as for interrupts,
1389 more robust.
1390 A drawback is that certain unconventional programs mixed
1391 \fI\%stdio\fP(3) calls with
1392 .I \%ncurses
1393 calls and (usually)
1394 got the behavior they expected.
1395 This is no longer the case;
1396 .I \%ncurses
1397 does not write to the standard output file descriptor through a
1398 .IR stdio -buffered
1399 stream.
1400 .PP
1401 As a special case,
1402 low-level API calls such as \fB\%putp\fP(3X) still use the
1403 standard output stream.
1404 High-level
1405 .I curses
1406 calls such as \fB\%printw\fP(3X) do not.
1407 .SS "\fINCURSES_NO_UTF8_ACS\fP"
1408 At initialization,
1409 .I \%ncurses
1410 inspects the
1411 .I TERM
1412 environment variable for special cases where VT100 forms-drawing
1413 characters
1414 (and the corresponding alternate character set
1415 .I \%term\%info
1416 capabilities)
1417 are known to be unsupported by terminal types that otherwise claim VT100
1418 compatibility.
1419 Specifically,
1420 when running in a UTF-8 locale,
1421 the Linux virtual console device and the GNU \fI\%screen\fP(1)
1422 program ignore them.
1423 Set this variable to a nonzero value to instruct
1424 .I \%ncurses
1425 that the terminal's ACS support is broken;
1426 the library then outputs Unicode code points that correspond to the
1427 forms-drawing
1428 characters.
1429 Set it to zero
1430 (or a non-integer)
1431 to disable the special check for terminal type names matching
1432 \*(``linux\*('' or \*(``screen\*('',
1433 directing
1434 .I \%ncurses
1435 to assume that the ACS feature works if the terminal type description
1436 advertises it.
1437 .PP
1438 As an alternative to use of this variable,
1439 .I \%ncurses
1440 checks for an extended
1441 .I \%term\%info
1442 numeric capability \fBU8\fP
1443 that can be compiled using
1444 .RB \*(`` "@TIC@ \-x" \*(''.
1445 Examples follow.
1446 .PP
1447 .RS 3
1448 .EX
1449 # linux console, if patched to provide working
1450 # VT100 shift\-in/shift\-out, with corresponding font.
1451 linux\-vt100|linux console with VT100 line\-graphics,
1452         U8#0, use=linux,
1453 \&
1454 # uxterm with vt100Graphics resource set to false
1455 xterm\-utf8|xterm relying on UTF\-8 line\-graphics,
1456         U8#1, use=xterm,
1457 .EE
1458 .RE
1459 .PP
1460 The two-character name \*(``U8\*('' was chosen to permit its use via
1461 .IR \%ncurses 's
1462 .I termcap
1463 interface.
1464 .SS "\fINCURSES_TRACE\fP"
1465 At initialization,
1466 .I \%ncurses
1467 (in its debugging configuration)
1468 checks for this variable's presence.
1469 If defined with an integral value,
1470 the library calls \fB\%curses_trace\fP(3X) with that value as the
1471 argument.
1472 .SS "\fITERM\fP"
1473 The
1474 .I TERM
1475 variable denotes the terminal type.
1476 Each is distinct,
1477 though many are similar.
1478 It is commonly set by terminal emulators to help applications find a
1479 workable terminal description.
1480 Some choose a popular approximation such as \*(``ansi\*('',
1481 \*(``vt100\*('', or \*(``xterm\*('' rather than an exact fit to their
1482 capabilities.
1483 Not infrequently,
1484 an application will have problems with that approach;
1485 for example,
1486 a key stroke may not operate correctly,
1487 or produce no effect but seeming garbage characters on the screen.
1488 .PP
1489 Setting
1490 .I TERM
1491 has no effect on hardware operation;
1492 it affects the way applications communicate with the terminal.
1493 Likewise,
1494 as a general rule
1495 (\fIxterm\fP(1) being a rare exception),
1496 terminal emulators that allow you to specify
1497 .I TERM
1498 as a parameter or configuration value do not change their behavior to
1499 match that setting.
1500 .SS "\fITERMCAP\fP"
1501 If
1502 .I \%ncurses
1503 is configured with
1504 .I termcap
1505 support,
1506 it checks for a terminal type description in
1507 .I termcap
1508 format if one in
1509 .I \%term\%info
1510 format is not available.
1511 Setting this variable directs
1512 .I \%ncurses
1513 to ignore the usual
1514 .I termcap
1515 database location,
1516 .IR \%/etc/termcap ;
1517 see
1518 .I \%TERMPATH
1519 below.
1520 .I \%TERMCAP
1521 should contain either a terminal description
1522 (with newlines stripped out),
1523 or a file name indicating where the information required by the
1524 .I TERM
1525 environment variable is stored.
1526 .SS "\fITERMINFO\fP"
1527 .I \%ncurses
1528 can be configured to read terminal type description databases in various
1529 locations using different formats.
1530 This variable overrides the default location.
1531 .bP
1532 Descriptions in
1533 .I \%term\%info
1534 format are normally stored in a directory tree using subdirectories
1535 named by the common first letters of the terminal types named therein.
1536 This is the scheme used in System\ V.
1537 .bP
1538 If
1539 .I \%ncurses
1540 is configured to use hashed databases,
1541 then
1542 .I \%TERM\%INFO
1543 may name its location,
1544 such as
1545 .IR \%/usr/share/terminfo.db ,
1546 rather than
1547 .IR \%/usr/share/terminfo/ .
1548 .PP
1549 The hashed database uses less disk space and is a little faster than the
1550 directory tree.
1551 However,
1552 some applications assume the existence of the directory tree,
1553 and read it directly
1554 rather than using the
1555 .I \%term\%info
1556 API.
1557 .bP
1558 If
1559 .I \%ncurses
1560 is configured with
1561 .I termcap
1562 support,
1563 this variable may contain the location of a
1564 .I \%termcap
1565 file.
1566 .bP
1567 If the value of
1568 .I \%TERM\%INFO
1569 begins with \*(``hex:\*('' or \*(``b64:\*('',
1570 .I \%ncurses
1571 uses the remainder of the value as a compiled
1572 .I \%term\%info
1573 description.
1574 You might produce the base64 format using \fB\%infocmp\fP(1M).
1575 .RS 4
1576 .IP
1577 .EX
1578 TERMINFO=$(infocmp \-0 \-Q2 \-q)
1579 export TERMINFO
1580 .EE
1581 .RE
1582 .IP
1583 The compiled description is used only if it corresponds to the terminal
1584 type identified by
1585 .IR TERM .
1586 .PP
1587 Setting
1588 .I \%TERM\%INFO
1589 is the simplest,
1590 but not the only,
1591 way to direct
1592 .I \%ncurses
1593 to a terminal database.
1594 The search path is as follows.
1595 .bP
1596 the last terminal database to which the running
1597 .I \%ncurses
1598 application wrote,
1599 if any
1600 .bP
1601 the location specified by the
1602 .I \%TERM\%INFO
1603 environment variable
1604 .bP
1605 .I $HOME/.terminfo
1606 .bP
1607 locations listed in the
1608 .I \%TERMINFO_DIRS
1609 environment variable
1610 .ds td \" empty
1611 .if !'@TERMINFO_DIRS@'no default value' .as td @TERMINFO_DIRS@
1612 .if !'@TERMINFO@\*(td'' \{\
1613 .bP
1614 location(s) configured and compiled into
1615 .I \%ncurses
1616 .RS
1617 .if !'\*(td'' \{\
1618 .bP
1619 .I \%@TERMINFO_DIRS@
1620 .\}
1621 .if !'@TERMINFO'' .if !'\*(td'@TERMINFO@' \{\
1622 .bP
1623 .I \%@TERMINFO@
1624 .\}
1625 .\}
1626 .RE
1627 .SS "\fITERMINFO_DIRS\fP"
1628 This variable specifies a list of locations,
1629 akin to
1630 .IR PATH ,
1631 in which
1632 .I \%ncurses
1633 searches for the terminal type descriptions described by
1634 .I \%TERMINFO
1635 above.
1636 The list items are separated by colons on Unix
1637 and semicolons on OS/2 EMX.
1638 System\ V
1639 .I \%term\%info
1640 lacks a corresponding feature;
1641 .I \%TERMINFO_DIRS
1642 is an
1643 .I \%ncurses
1644 extension.
1645 .SS "\fITERMPATH\fP"
1646 If
1647 .I \%TERMCAP
1648 does not hold a terminal type description or file name,
1649 then
1650 .I \%ncurses
1651 checks the contents of
1652 .IR \%TERMPATH ,
1653 a list of locations,
1654 akin to
1655 .IR PATH ,
1656 in which it searches for
1657 .I termcap
1658 terminal type descriptions.
1659 The list items are separated by colons on Unix
1660 and semicolons on OS/2 EMX.
1661 .PP
1662 If both
1663 .I \%TERMCAP
1664 and
1665 .I \%TERMPATH
1666 are unset or invalid,
1667 .I \%ncurses
1668 searches for the files
1669 .IR \%/etc/termcap ,
1670 .IR \%/usr/share/misc/termcap ,
1671 and
1672 .IR \%$HOME/.termcap ,
1673 in that order.
1674 .SH "ALTERNATE CONFIGURATIONS"
1675 Many different
1676 .I \%ncurses
1677 configurations are possible,
1678 determined by the options given to the
1679 .I \%configure
1680 script when building the library.
1681 Run the script with the
1682 .B \-\-help
1683 option to peruse them all.
1684 A few are of particular significance to the application developer
1685 employing
1686 .IR \%ncurses .
1687 .TP 5
1688 .B \-\-disable\-overwrite
1689 The standard C preprocessor inclusion for the
1690 .I curses
1691 library is as follows.
1692 .RS 5
1693 .PP
1694 .RS 4
1695 .EX
1696 .\" The dummy character prevents undesired rewriting of the next line on
1697 .\" installation of the man page.
1698 \fB#\&include <curses.h>\fP
1699 .EE
1700 .RE
1701 .PP
1702 This option is used to avoid file name conflicts between
1703 .I \%ncurses
1704 and an existing
1705 .I curses
1706 installation on the system.
1707 If
1708 .I \%ncurses
1709 is installed disabling overwrite,
1710 it puts its header files in a subdirectory.
1711 Here is an example.
1712 .PP
1713 .RS 4
1714 .EX
1715 .\" The dummy character prevents undesired rewriting of the next line on
1716 .\" installation of the man page.
1717 \fB#\&include <ncurses/curses.h>\fP
1718 .EE
1719 .RE
1720 .PP
1721 Installation also omits a symbolic link that would cause the compiler's
1722 .B \-lcurses
1723 option to link object files with
1724 .I \%ncurses
1725 instead of the system
1726 .I curses
1727 library.
1728 .PP
1729 The directory used by this configuration of
1730 .I \%ncurses
1731 is shown in section \*(``SYNOPSIS\*('' above.
1732 .RE
1733 .TP 5
1734 .B \-\-enable\-widec
1735 The configure script renames the library and
1736 (if the \fB\-\-disable\-overwrite\fP option is used)
1737 puts the header files in a different subdirectory.
1738 All of the library names have a \*(``w\*('' appended to them,
1739 i.e., instead of
1740 .RS 5
1741 .PP
1742 .RS 4
1743 .EX
1744 \fB\-lncurses\fP
1745 .EE
1746 .RE
1747 .PP
1748 you link with
1749 .PP
1750 .RS 4
1751 .EX
1752 \fB\-lncursesw\fP
1753 .EE
1754 .RE
1755 .PP
1756 You must also enable the wide-character features in the header file
1757 when compiling for the wide-character library
1758 to use the extended (wide-character) functions.
1759 The symbol which enables these features has changed
1760 since X/Open Curses, Issue 4:
1761 .bP
1762 Originally, the wide-character feature required the symbol
1763 \fB_XOPEN_SOURCE_EXTENDED\fP
1764 but that was only valid for XPG4 (1996).
1765 .bP
1766 Later, that was deemed conflicting with \fB_XOPEN_SOURCE\fP defined to 500.
1767 .bP
1768 As of mid-2018,
1769 none of the features in this implementation require a \fB_XOPEN_SOURCE\fP
1770 feature greater than 600.
1771 However, X/Open Curses, Issue 7 (2009) recommends defining it to 700.
1772 .bP
1773 Alternatively, you can enable the feature by defining \fBNCURSES_WIDECHAR\fP
1774 with the caveat that some other header file than \fBcurses.h\fP
1775 may require a specific value for \fB_XOPEN_SOURCE\fP
1776 (or a system-specific symbol).
1777 .PP
1778 The \fI\%curses.h\fP header file installed for the wide-character
1779 library is designed to be compatible with the non-wide library's header.
1780 Only the size of the \fI\%WINDOW\fP structure differs;
1781 few applications require more than pointers to \fI\%WINDOW\fPs.
1782 .PP
1783 If the headers are installed allowing overwrite,
1784 the wide-character library's headers should be installed last,
1785 to allow applications to be built using either library
1786 from the same set of headers.
1787 .RE
1788 .TP 5
1789 .B \-\-with\-pthread
1790 The configure script renames the library.
1791 All of the library names have a \*(``t\*('' appended to them
1792 (before any \*(``w\*('' added by \fB\-\-enable\-widec\fP).
1793 .IP
1794 The global variables such as \fBLINES\fP are replaced by macros to
1795 allow read-only access.
1796 At the same time, setter-functions are provided to set these values.
1797 Some applications (very few) may require changes to work with this convention.
1798 .TP 5
1799 .B \-\-with\-shared
1800 .tQ
1801 .B \-\-with\-normal
1802 .tQ
1803 .B \-\-with\-debug
1804 .tQ
1805 .B \-\-with\-profile
1806 The shared and normal (static) library names differ by their suffixes,
1807 e.g., \fBlibncurses.so\fP and \fBlibncurses.a\fP.
1808 The debug and profiling libraries add a \*(``_g\*(''
1809 and a \*(``_p\*('' to the root names respectively,
1810 e.g., \fBlibncurses_g.a\fP and \fBlibncurses_p.a\fP.
1811 .TP 5
1812 .B \-\-with\-termlib
1813 Low-level functions which do not depend upon whether the library
1814 supports wide-characters, are provided in the tinfo library.
1815 .IP
1816 By doing this, it is possible to share the tinfo library between
1817 wide/normal configurations as well as reduce the size of the library
1818 when only low-level functions are needed.
1819 .IP
1820 Those functions are described in these pages:
1821 .RS
1822 .bP
1823 \fB\%curs_extend\fP(3X) \- miscellaneous \fIcurses\fP extensions
1824 .bP
1825 \fB\%curs_inopts\fP(3X) \- \fIcurses\fP input options
1826 .bP
1827 \fB\%curs_kernel\fP(3X) \- low-level \fIcurses\fP routines
1828 .bP
1829 \fB\%curs_termattrs\fP(3X) \- \fIcurses\fP environment query routines
1830 .bP
1831 \fB\%curs_termcap\fP(3X) \- \fIcurses\fP emulation of \fItermcap\fP
1832 .bP
1833 \fB\%curs_terminfo\fP(3X) \- \fIcurses\fP interface to \fIterminfo\fP
1834 database
1835 .bP
1836 \fB\%curs_util\fP(3X) \- miscellaneous \fIcurses\fP utility routines
1837 .RE
1838 .TP 5
1839 .B \-\-with\-trace
1840 The \fBtrace\fP function normally resides in the debug library,
1841 but it is sometimes useful to configure this in the shared library.
1842 Configure scripts should check for the function's existence rather
1843 than assuming it is always in the debug library.
1844 .SH FILES
1845 .TP
1846 .I @DATADIR@/tabset
1847 tab stop initialization database
1848 .TP
1849 .I @TERMINFO@
1850 compiled terminal capability database
1851 .SH NOTES
1852 X/Open Curses permits most functions it specifies to be made available
1853 as macros as well.
1854 .\" See X/Open Curses Issue 4, Version 2, pp. 227-234.
1855 .\" See X/Open Curses Issue 7, pp. 311-318.
1856 \fI\%ncurses\fP does so
1857 .bP
1858 for functions that return values via their parameters,
1859 .bP
1860 to support obsolete features,
1861 .bP
1862 to reuse functions
1863 (for example,
1864 those that move the cursor before another operation),
1865 and
1866 .bP
1867 in a few special cases.
1868 .PP
1869 If the standard output file descriptor of an
1870 .I \%ncurses
1871 program is redirected to something that is not a terminal device,
1872 the library writes screen updates to the standard error file descriptor.
1873 This was an undocumented feature of SVr3
1874 .IR curses .
1875 .PP
1876 See subsection \*(``Header Files\*('' below regarding symbols exposed by
1877 inclusion of \fI\%curses.h\fP.
1878 .SH EXTENSIONS
1879 .I \%ncurses
1880 enables an application to capture mouse events on certain terminals,
1881 including \fI\%xterm\fP(1);
1882 see \fB\%curs_mouse\fP(3X).
1883 .PP
1884 .I \%ncurses
1885 provides a means of responding to window resizing events,
1886 as when running in a GUI terminal emulator application such as
1887 .IR \%xterm ;
1888 see \fB\%resizeterm\fP(3X) and \fB\%wresize\fP(3X).
1889 .PP
1890 .I \%ncurses
1891 allows an application to query the terminal for the presence of a wide
1892 variety of special keys;
1893 see \fB\%has_key\fP(3X).
1894 .PP
1895 .I \%ncurses
1896 extends the fixed set of function key capabilities specified by X/Open
1897 Curses by allowing the application programmer to define additional key
1898 events at runtime;
1899 see
1900 \fB\%define_key\fP(3X),
1901 \fB\%key_defined\fP(3X),
1902 \fB\%keybound\fP(3X),
1903 and
1904 \fB\%keyok\fP(3X).
1905 .PP
1906 .I \%ncurses
1907 can exploit the capabilities of terminals implementing ISO\ 6429/ECMA-48
1908 SGR\ 39 and SGR\ 49 sequences,
1909 which allow an application to reset the terminal to its original
1910 foreground and background colors.
1911 From a user's perspective,
1912 the application is able to draw colored text on a background whose color
1913 is set independently,
1914 providing better control over color contrasts.
1915 See \fB\%default_colors\fP(3X).
1916 .PP
1917 An
1918 .I \%ncurses
1919 application can eschew knowledge of
1920 .I \%WINDOW
1921 structure internals,
1922 instead using accessor functions such as
1923 \fB\%is_scrollok\fP(3X).
1924 .PP
1925 .I \%ncurses
1926 enables an application to direct its output to a printer attached to the
1927 terminal device;
1928 see \fB\%curs_print\fP(3X).
1929 .PP
1930 .I \%ncurses
1931 offers \fB\%slk_attr\fP(3X) as a counterpart of \fB\%attr_get\fP(3X) for
1932 soft-label key lines,
1933 and \fB\%extended_slk_color\fP(3X) as a form of \fB\%slk_color\fP(3X)
1934 that can gather color information from them when many colors are
1935 supported.
1936 .PP
1937 .I \%ncurses
1938 permits modification of \fB\%unctrl\fP(3X)'s behavior;
1939 see \fB\%use_legacy_coding\fP(3X).
1940 .PP
1941 Rudimentary support for multi-threaded applications may be available;
1942 see \fBcurs_threads\fP(3X).
1943 .PP
1944 Functions that ease the management of multiple screens can be exposed;
1945 see \fBcurs_sp_funcs\fP(3X).
1946 .PP
1947 To aid applications to debug their memory usage,
1948 .I \%ncurses
1949 optionally offers functions to more aggressively free memory it
1950 dynamically allocates itself;
1951 see \fBcurs_memleaks\fP(3X).
1952 .PP
1953 The library facilitates auditing and troubleshooting of its behavior;
1954 see \fBcurs_trace\fP(3X).
1955 .PP
1956 Compiling
1957 .I \%ncurses
1958 with the option
1959 .B \%\-DUSE_GETCAP
1960 causes it to fall back to reading
1961 .I \%/etc/termcap
1962 if the terminal setup code cannot find a
1963 .I \%term\%info
1964 entry corresponding to
1965 .IR TERM .
1966 Use of this feature is not recommended,
1967 as it essentially includes an entire
1968 .I termcap
1969 compiler in the
1970 .I \%ncurses
1971 startup code,
1972 at a cost in memory usage and application launch latency.
1973 .PP
1974 .I \%PDCurses
1975 and NetBSD
1976 .I curses
1977 incorporate some
1978 .I \%ncurses
1979 extensions.
1980 Individual man pages indicate where this is the case.
1981 .SH PORTABILITY
1982 X/Open Curses defines two levels of conformance,
1983 \*(``base\*('' and \*(``enhanced\*(''.
1984 The latter includes several additional features,
1985 such as wide-character and color support.
1986 .I \%ncurses
1987 intends base-level conformance with X/Open Curses,
1988 and supports all features of its enhanced level
1989 except the \fB\%untic\fP utility.
1990 .PP
1991 Differences between X/Open Curses and
1992 .I \%ncurses
1993 are documented in the \*(``PORTABILITY\*('' sections of applicable man
1994 pages.
1995 .SS "Error Checking"
1996 In many cases, X/Open Curses is vague about error conditions,
1997 omitting some of the SVr4 documentation.
1998 .PP
1999 Unlike other implementations,
2000 .I \%ncurses
2001 checks pointer parameters,
2002 such as those to
2003 .I \%WINDOW
2004 structures,
2005 to ensure that they are not null.
2006 This is done primarily to guard against programmer error.
2007 The standard interface does not provide a way for the library
2008 to tell an application which of several possible errors occurred.
2009 An application that relies on
2010 .I \%ncurses
2011 to check its function parameters for validity limits its portability and
2012 robustness.
2013 .SS "Padding Differences"
2014 In historical
2015 .I curses
2016 implementations,
2017 delays embedded in the
2018 .I \%term\%info
2019 capabilities
2020 .B \%carriage_return
2021 .RB ( cr ),
2022 .B \%scroll_forward
2023 .RB ( ind ),
2024 .B \%cursor_left
2025 .RB ( cub1 ),
2026 .B \%form_feed
2027 .RB ( ff ),
2028 and
2029 .B \%tab
2030 .RB ( ht )
2031 activated corresponding delay bits in the Unix terminal driver.
2032 .I \%ncurses
2033 performs all padding by sending NUL bytes to the device.
2034 This method is slightly more expensive,
2035 but narrows the interface to the Unix kernel significantly and
2036 correspondingly increases the package's portability.
2037 .SS "Header Files"
2038 The header file
2039 .I \%curses.h
2040 itself includes the header files
2041 .I \%stdio.h
2042 and
2043 .IR \%unctrl.h .
2044 .PP
2045 X/Open Curses has more to say,
2046 .RS 4
2047 .PP
2048 The inclusion of
2049 .I \%curses.h
2050 may make visible all symbols from the headers
2051 .IR \%stdio.h ,
2052 .IR \%term.h ,
2053 .IR \%termios.h ,
2054 and
2055 .IR \%wchar.h .
2056 .RE
2057 .PP
2058 but does not finish the story.
2059 A more complete account follows.
2060 .bP
2061 The first
2062 .IR curses ","
2063 in 4BSD,
2064 provided a
2065 .I \%curses.h
2066 file.
2067 .IP
2068 BSD
2069 .I curses
2070 code included
2071 .I \%curses.h
2072 and
2073 .I \%unctrl.h
2074 from an internal header file
2075 .IR \%curses.ext ,
2076 where
2077 \*(``ext\*('' abbreviated \*(``externs\*(''.
2078 .IP
2079 The implementations of
2080 .I \%printw
2081 and
2082 .I \%scanw
2083 used undocumented internal functions of the standard I/O library
2084 .RI ( _doprnt
2085 and
2086 .IR _doscan ),
2087 but nothing in
2088 .I \%curses.h
2089 itself relied upon
2090 .IR \%stdio.h .
2091 .bP
2092 SVr2
2093 .I curses
2094 added
2095 .IR \%newterm ,
2096 which relies upon
2097 .I \%stdio.h
2098 because its function prototype employs the
2099 .I FILE
2100 type.
2101 .IP
2102 SVr4
2103 .I curses
2104 added
2105 .I \%putwin
2106 and
2107 .IR \%getwin ,
2108 which also use
2109 .IR \%stdio.h .
2110 .IP
2111 X/Open Curses specifies all three of these functions.
2112 .IP
2113 SVr4
2114 .I curses
2115 and X/Open Curses do not require the developer to include
2116 .I \%stdio.h
2117 before
2118 .IR \%curses.h .
2119 Both document use of
2120 .I curses
2121 as requiring only
2122 .IR \%curses.h .
2123 .IP
2124 As a result,
2125 standard
2126 .I \%curses.h
2127 always includes
2128 .IR \%stdio.h .
2129 .bP
2130 X/Open Curses and SVr4
2131 .I curses
2132 are inconsistent with respect to
2133 .IR \%unctrl.h .
2134 .IP
2135 As noted in \fBcurs_util\fP(3X),
2136 .I \%ncurses
2137 includes
2138 .I \%unctrl.h
2139 from
2140 .I \%curses.h
2141 (as SVr4 does).
2142 .bP
2143 X/Open Curses's comments about
2144 .I \%term.h
2145 and
2146 .I \%termios.h
2147 may refer to HP-UX and AIX.
2148 .IP
2149 HP-UX
2150 .I curses
2151 includes
2152 .I \%term.h
2153 from
2154 .I \%curses.h
2155 to declare
2156 .I \%setupterm
2157 in
2158 .IR \%curses.h ,
2159 but
2160 .I \%ncurses
2161 and Solaris
2162 .I curses
2163 do not.
2164 .IP
2165 AIX
2166 .I curses
2167 includes
2168 .I \%term.h
2169 and
2170 .IR \%termios.h .
2171 Again,
2172 .I \%ncurses
2173 and Solaris
2174 .I curses
2175 do not.
2176 .bP
2177 X/Open Curses says that
2178 .I \%curses.h
2179 .B may
2180 include
2181 .IR \%term.h ,
2182 but does not require it to do so.
2183 .IP
2184 Some programs use functions declared in both
2185 .I \%curses.h
2186 and
2187 .IR \%term.h ,
2188 and must include both header files in the same module.
2189 Very old versions of AIX
2190 .I curses
2191 required inclusion of
2192 .I \%curses.h
2193 before
2194 .IR \%term.h .
2195 .IP
2196 The header files supplied by
2197 .I \%ncurses
2198 include the standard library headers required for its declarations,
2199 so
2200 .IR \%ncurses 's
2201 own header files can be included in any order.
2202 But for portability,
2203 you should include
2204 .I \%curses.h
2205 before
2206 .IR \%term.h .
2207 .bP
2208 X/Open Curses says \*(``may make visible\*('' because including a header
2209 file does not necessarily make visible all of the symbols in it
2210 (consider
2211 .B \%#ifdef
2212 and similar).
2213 .IP
2214 For instance,
2215 .IR \%ncurses 's
2216 .I \%curses.h
2217 .B may \" bold to contrast with preceding italic
2218 include
2219 .I \%wchar.h
2220 if the proper symbol is defined,
2221 and if
2222 .I \%ncurses
2223 is configured for wide-character support.
2224 If
2225 .I \%wchar.h
2226 is included,
2227 its symbols
2228 .B may \" bold for consistency in this paragraph
2229 be made visible depending on the value of the
2230 .B _XOPEN_SOURCE
2231 feature test macro.
2232 .bP
2233 X/Open Curses mandates an application's inclusion of one standard C
2234 library header in a special case:
2235 .I \%stdarg.h
2236 before
2237 .I \%curses.h
2238 to prototype the functions
2239 .I \%vw_printw
2240 and
2241 .I \%vw_scanw
2242 (as well as the obsolete
2243 .I \%vwprintw
2244 and
2245 .IR \%vwscanw ).
2246 Each of these takes a variadic argument list,
2247 a
2248 .I \%va_list
2249 parameter,
2250 like that of \fI\%printf\fP(3).
2251 .IP
2252 SVr3
2253 .I curses
2254 introduced
2255 the two obsolete functions,
2256 and X/Open Curses the others.
2257 In between,
2258 SVr4
2259 .I curses
2260 provided for the possibility that an application might include either
2261 .I \%varargs.h
2262 or
2263 .IR \%stdarg.h .
2264 These represented contrasting approaches to handling variadic
2265 argument lists.
2266 The older interface,
2267 .IR \%varargs.h ,
2268 used a pointer to
2269 .I char \" V7, 32V, System III, 3BSD
2270 for variadic functions'
2271 .I \%va_list
2272 parameter.
2273 Later,
2274 the list acquired its own standard data type,
2275 .IR \%va_list ,
2276 defined in
2277 .IR \%stdarg.h ,
2278 empowering the compiler to check the types of a function call's actual
2279 parameters against the formal ones declared in its prototype.
2280 .IP
2281 No conforming implementations of X/Open Curses require an application
2282 to include
2283 .I \%stdarg.h
2284 before
2285 .I \%curses.h
2286 because they either have allowed for a special type,
2287 or,
2288 like
2289 .IR \%ncurses ,
2290 they include
2291 .I \%stdarg.h
2292 themselves to provide a portable interface.
2293 .SH AUTHORS
2294 Zeyd M. Ben-Halim,
2295 Eric S. Raymond,
2296 Thomas E. Dickey.
2297 Based on
2298 .I \%pcurses
2299 by Pavel Curtis.
2300 .SH SEE ALSO
2301 \fB\%curs_variables\fP(3X),
2302 \fB\%terminfo\fP(5),
2303 \fB\%user_caps\fP(5)