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