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