]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_variables.3x
ncurses 6.1 - patch 20180127
[ncurses.git] / man / curs_variables.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 2010-2015,2017 Free Software Foundation, Inc.              *
3 .\"                                                                          *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
5 .\" copy of this software and associated documentation files (the            *
6 .\" "Software"), to deal in the Software without restriction, including      *
7 .\" without limitation the rights to use, copy, modify, merge, publish,      *
8 .\" distribute, distribute with modifications, sublicense, and/or sell       *
9 .\" copies of the Software, and to permit persons to whom the Software is    *
10 .\" furnished to do so, subject to the following conditions:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22 .\"                                                                          *
23 .\" Except as contained in this notice, the name(s) of the above copyright   *
24 .\" holders shall not be used in advertising or otherwise to promote the     *
25 .\" sale, use or other dealings in this Software without prior written       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: curs_variables.3x,v 1.9 2017/11/18 23:56:00 tom Exp $
30 .TH curs_variables 3X ""
31 .de bP
32 .ie n  .IP \(bu 4
33 .el    .IP \(bu 2
34 ..
35 .ds n 5
36 .na
37 .hy 0
38 .SH NAME
39 \fBCOLORS\fR,
40 \fBCOLOR_PAIRS\fR,
41 \fBCOLS\fR,
42 \fBESCDELAY\fR,
43 \fBLINES\fR,
44 \fBTABSIZE\fR,
45 \fBcurscr\fR,
46 \fBnewscr\fR,
47 \fBstdscr\fR
48 \- \fBcurses\fR global variables
49 .ad
50 .hy
51 .SH SYNOPSIS
52 .nf
53 \fB#include <curses.h>\fR
54 .PP
55 \fBint COLOR_PAIRS;\fR
56 .br
57 \fBint COLORS;\fR
58 .br
59 \fBint COLS;\fR
60 .br
61 \fBint ESCDELAY;\fR
62 .br
63 \fBint LINES;\fR
64 .br
65 \fBint TABSIZE;\fR
66 .br
67 \fBWINDOW * curscr;\fR
68 .br
69 \fBWINDOW * newscr;\fR
70 .br
71 \fBWINDOW * stdscr;\fR
72 .fi
73 .SH DESCRIPTION
74 This page summarizes variables provided by the \fBcurses\fP library.
75 A more complete description is given in the \fBcurses\fP(3X) manual page.
76 .PP
77 Depending on the configuration, these may be actual variables,
78 or macros (see \fBcurs_threads\fR(3X) and \fBcurs_opaque\fR(3X))
79 which provide read-only access to \fIcurses\fP's state.
80 In either case, applications should treat them as read-only to avoid
81 confusing the library.
82 .SS COLOR_PAIRS
83 After initializing curses, this variable contains the number of color pairs
84 which the terminal can support.
85 Usually the number of color pairs will be the product \fBCOLORS\fP*\fBCOLORS\fP,
86 however this is not always true:
87 .bP
88 a few terminals use HLS colors, which do not follow this rule
89 .bP
90 terminals supporting a large number of colors are limited by the number
91 of color pairs that can be represented in a \fIsigned short\fP value.
92 .SS COLORS
93 After initializing curses, this variable contains the number of colors
94 which the terminal can support.
95 .SS COLS
96 After initializing curses, this variable contains the width of the screen,
97 i.e., the number of columns.
98 .SS ESCDELAY
99 This variable holds the number of milliseconds to wait after reading an
100 escape character,
101 to distinguish between an individual escape character entered on the
102 keyboard from escape sequences sent by cursor- and function-keys
103 (see curses(3X).
104 .SS LINES
105 After initializing curses, this variable contains the height of the screen,
106 i.e., the number of lines.
107 .SS TABSIZE
108 This variable holds the number of columns used by the \fIcurses\fP library
109 when converting a tab character to spaces as it adds the tab to a window
110 (see curs_addch(3X).
111 .SS The Current Screen
112 This implementation of curses uses a special window \fBcurscr\fP to
113 record its updates to the terminal screen.
114 .SS The New Screen
115 This implementation of curses uses a special window \fBnewscr\fP to
116 hold updates to the terminal screen before applying them to \fBcurscr\fP.
117 .SS The Standard Screen
118 Upon initializing curses,
119 a default window called \fBstdscr\fP,
120 which is the size of the terminal screen, is created.
121 Many curses functions use this window.
122 .SH NOTES
123 The curses library is initialized using either \fBinitscr\fR(3X),
124 or \fBnewterm\fR(3X).
125 .PP
126 If \fBcurses\fP is configured to use separate curses/terminfo libraries,
127 most of these variables reside in the curses library.
128 .SH PORTABILITY
129 ESCDELAY and TABSIZE are extensions,
130 not provided in most other implementations of curses.
131 .PP
132 ESCDELAY is an extension in AIX curses:
133 .bP
134 In AIX, the units for ESCDELAY are \fIfifths\fP of a millisecond.
135 .bP
136 The default value for AIX's ESCDELAY is 0.1 seconds.
137 .bP
138 AIX also enforces a limit of 10,000 seconds for ESCDELAY;
139 this implementation currently has no upper limit.
140 .PP
141 This implementation has long used ESCDELAY with units of milliseconds,
142 making it impossible to be completely compatible with AIX.
143 Likewise, most users have either decided to override the value,
144 or rely upon its default value.
145 .SH SEE ALSO
146 \fBcurses\fR(3X),
147 \fBcurs_opaque\fR(3X),
148 \fBcurs_terminfo\fR(3X),
149 \fBcurs_threads\fR(3X),
150 \fBterm_variables\fR(3X),
151 \fBterminfo\fR(\*n).