]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_variables.3x
ncurses 6.1 - patch 20181215
[ncurses.git] / man / curs_variables.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 2010-2017,2018 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.11 2018/07/28 22:37:10 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 ESCDELAY and TABSIZE are extensions,
143 not provided in most other implementations of curses.
144 .PP
145 ESCDELAY is an extension in AIX curses:
146 .bP
147 In AIX, the units for ESCDELAY are \fIfifths\fP of a millisecond.
148 .bP
149 The default value for AIX's ESCDELAY is 0.1 seconds.
150 .bP
151 AIX also enforces a limit of 10,000 seconds for ESCDELAY;
152 this implementation currently has no upper limit.
153 .PP
154 This implementation has long used ESCDELAY with units of milliseconds,
155 making it impossible to be completely compatible with AIX.
156 Likewise, most users have either decided to override the value,
157 or rely upon its default value.
158 .SH SEE ALSO
159 \fBcurses\fR(3X),
160 \fBcurs_opaque\fR(3X),
161 \fBcurs_terminfo\fR(3X),
162 \fBcurs_threads\fR(3X),
163 \fBterm_variables\fR(3X),
164 \fBterminfo\fR(\*n).