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