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