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