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