]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_variables.3x
fffad7149ecf29c0d251ea244c56869b8f23480a
[ncurses.git] / man / curs_variables.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 2010-2018,2019 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.12 2019/02/16 23:43:23 tom Exp $
30 .TH curs_variables 3X ""
31 .ie \n(.g .ds `` \(lq
32 .el       .ds `` ``
33 .ie \n(.g .ds '' \(rq
34 .el       .ds '' ''
35 .de bP
36 .ie n  .IP \(bu 4
37 .el    .IP \(bu 2
38 ..
39 .ds n 5
40 .na
41 .hy 0
42 .SH NAME
43 \fBCOLORS\fR,
44 \fBCOLOR_PAIRS\fR,
45 \fBCOLS\fR,
46 \fBESCDELAY\fR,
47 \fBLINES\fR,
48 \fBTABSIZE\fR,
49 \fBcurscr\fR,
50 \fBnewscr\fR,
51 \fBstdscr\fR
52 \- \fBcurses\fR global variables
53 .ad
54 .hy
55 .SH SYNOPSIS
56 .nf
57 \fB#include <curses.h>\fR
58 .PP
59 \fBint COLOR_PAIRS;\fR
60 .br
61 \fBint COLORS;\fR
62 .br
63 \fBint COLS;\fR
64 .br
65 \fBint ESCDELAY;\fR
66 .br
67 \fBint LINES;\fR
68 .br
69 \fBint TABSIZE;\fR
70 .br
71 \fBWINDOW * curscr;\fR
72 .br
73 \fBWINDOW * newscr;\fR
74 .br
75 \fBWINDOW * stdscr;\fR
76 .fi
77 .SH DESCRIPTION
78 This page summarizes variables provided by the \fBcurses\fP library.
79 A more complete description is given in the \fBcurses\fP(3X) manual page.
80 .PP
81 Depending on the configuration, these may be actual variables,
82 or macros (see \fBcurs_threads\fR(3X) and \fBcurs_opaque\fR(3X))
83 which provide read-only access to \fIcurses\fP's state.
84 In either case, applications should treat them as read-only to avoid
85 confusing the library.
86 .SS COLOR_PAIRS
87 After initializing curses, this variable contains the number of color pairs
88 which the terminal can support.
89 Usually the number of color pairs will be the product \fBCOLORS\fP*\fBCOLORS\fP,
90 however this is not always true:
91 .bP
92 a few terminals use HLS colors, which do not follow this rule
93 .bP
94 terminals supporting a large number of colors are limited by the number
95 of color pairs that can be represented in a \fIsigned short\fP value.
96 .SS COLORS
97 After initializing curses, this variable contains the number of colors
98 which the terminal can support.
99 .SS COLS
100 After initializing curses, this variable contains the width of the screen,
101 i.e., the number of columns.
102 .SS ESCDELAY
103 This variable holds the number of milliseconds to wait after reading an
104 escape character,
105 to distinguish between an individual escape character entered on the
106 keyboard from escape sequences sent by cursor- and function-keys
107 (see curses(3X)).
108 .SS LINES
109 After initializing curses, this variable contains the height of the screen,
110 i.e., the number of lines.
111 .SS TABSIZE
112 This variable holds the number of columns used by the \fIcurses\fP library
113 when converting a tab character to spaces as it adds the tab to a window
114 (see curs_addch(3X).
115 .SS The Current Screen
116 This implementation of curses uses a special window \fBcurscr\fP to
117 record its updates to the terminal screen.
118 .PP
119 This is referred to as the \*(``physical screen\*('' in the
120 \fBcurs_refresh\fR(3X) and
121 \fBcurs_outopts\fR(3X) manual pages.
122 .SS The New Screen
123 This implementation of curses uses a special window \fBnewscr\fP to
124 hold updates to the terminal screen before applying them to \fBcurscr\fP.
125 .PP
126 This is referred to as the \*(``virtual screen\*('' in the
127 \fBcurs_kernel\fR(3X),
128 \fBcurs_refresh\fR(3X) and
129 \fBcurs_outopts\fR(3X) manual pages.
130 .SS The Standard Screen
131 Upon initializing curses,
132 a default window called \fBstdscr\fP,
133 which is the size of the terminal screen, is created.
134 Many curses functions use this window.
135 .SH NOTES
136 The curses library is initialized using either \fBinitscr\fR(3X),
137 or \fBnewterm\fR(3X).
138 .PP
139 If \fBcurses\fP is configured to use separate curses/terminfo libraries,
140 most of these variables reside in the curses library.
141 .SH PORTABILITY
142 \fBTABSIZE\fP is a feature of SVr4 curses
143 which is not documented by X/Open curses.
144 .bP
145 In SVr4 curses, \fBTABSIZE\fP is initially set from the terminal description's
146 \fBinit_tabs\fP capability.
147 After that, it can be altered by the applications using SVr4 curses.
148 .IP
149 SVr4 curses uses the current value of \fBTABSIZE\fP to
150 compute the position of tabstops for updating both
151 the virtual screen with \fBaddch\fP(3X) as well as
152 the physical screen with \fBmvcur\fP(3X).
153 .bP
154 This implementation uses the current value of \fBTABSIZE\fP only for
155 updating the virtual screen.
156 It uses the terminal description's \fBinit_tabs\fP capability for
157 computing tab stops on the physical screen.
158 .bP
159 Other implementations differ.
160 For instance, NetBSD curses allows \fBTABSIZE\fP to be set through
161 an environment variable.
162 This implementation does not.
163 .PP
164 \fBESCDELAY\fP is an extension in AIX curses:
165 .bP
166 In AIX, the units for \fBESCDELAY\fP are \fIfifths\fP of a millisecond.
167 .bP
168 The default value for AIX's \fBESCDELAY\fP is 0.1 seconds.
169 .bP
170 AIX also enforces a limit of 10,000 seconds for \fBESCDELAY\fP;
171 this implementation currently has no upper limit.
172 .PP
173 This implementation has long used \fBESCDELAY\fP with units of milliseconds,
174 making it impossible to be completely compatible with AIX.
175 Likewise, most users have either decided to override the value,
176 or rely upon its default value.
177 .SH SEE ALSO
178 \fBcurses\fR(3X),
179 \fBcurs_opaque\fR(3X),
180 \fBcurs_terminfo\fR(3X),
181 \fBcurs_threads\fR(3X),
182 \fBterm_variables\fR(3X),
183 \fBterminfo\fR(\*n).