]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/term_variables.3x
ncurses 6.4 - patch 20230909
[ncurses.git] / man / term_variables.3x
1 .\"***************************************************************************
2 .\" Copyright 2019-2022,2023 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: term_variables.3x,v 1.23 2023/09/09 17:06:25 tom Exp $
31 .TH term_variables 3X 2023-09-09 "ncurses 6.4" "Library calls"
32 .ds n 5
33 .ie \n(.g .ds `` \(lq
34 .el       .ds `` ``
35 .ie \n(.g .ds '' \(rq
36 .el       .ds '' ''
37 .ie n .ds CW R
38 .el   \{
39 .ie \n(.g .ds CW CR
40 .el       .ds CW CW
41 .\}
42 .na
43 .hy 0
44 .SH NAME
45 \fBSP\fP,
46 \fBacs_map\fP,
47 \fBboolcodes\fP,
48 \fBboolfnames\fP,
49 \fBboolnames\fP,
50 \fBcur_term\fP,
51 \fBnumcodes\fP,
52 \fBnumfnames\fP,
53 \fBnumnames\fP,
54 \fBstrcodes\fP,
55 \fBstrfnames\fP,
56 \fBstrnames\fP,
57 \fBttytype\fP
58 \- \fBcurses\fP terminfo global variables
59 .ad
60 .hy
61 .SH SYNOPSIS
62 .nf
63 \fB#include <curses.h>\fP
64 .br
65 \fB#include <term.h>\fP
66 .PP
67 \fBchtype acs_map[];\fP
68 .sp
69 \fBSCREEN * SP;\fP
70 .sp
71 \fBTERMINAL * cur_term;\fP
72 .sp
73 \fBchar ttytype[];\fP
74 .sp
75 \fBNCURSES_CONST char * const boolcodes[];\fP
76 .br
77 \fBNCURSES_CONST char * const boolfnames[];\fP
78 .br
79 \fBNCURSES_CONST char * const boolnames[];\fP
80 .sp
81 \fBNCURSES_CONST char * const numcodes[];\fP
82 .br
83 \fBNCURSES_CONST char * const numfnames[];\fP
84 .br
85 \fBNCURSES_CONST char * const numnames[];\fP
86 .sp
87 \fBNCURSES_CONST char * const strcodes[];\fP
88 .br
89 \fBNCURSES_CONST char * const strfnames[];\fP
90 .br
91 \fBNCURSES_CONST char * const strnames[];\fP
92 .br
93 .fi
94 .SH DESCRIPTION
95 This page summarizes variables provided by the \fBcurses\fP library's
96 low-level terminfo interface.
97 A more complete description is given in the \fBcurs_terminfo\fP(3X) manual page.
98 .PP
99 Depending on the configuration, these may be actual variables,
100 or macros (see \fBcurs_threads\fP(3X))
101 which provide read-only access to \fIcurses\fP's state.
102 In either case, applications should treat them as read-only to avoid
103 confusing the library.
104 .SS Alternate Character Set Mapping
105 After initializing the curses or terminfo interfaces,
106 the \fBacs_map\fP array holds information used to translate cells
107 with the \fBA_ALTCHARSET\fP video attribute into line-drawing characters.
108 .PP
109 The encoding of the information in this array has changed periodically.
110 Application developers need only know that it is used for the \*(``ACS_\*(''
111 constants in <curses.h>.
112 .PP
113 The comparable data for the wide-character library is a private variable.
114 .SS Current Terminal Data
115 After initializing the curses or terminfo interfaces,
116 the \fBcur_term\fP contains data describing the current terminal.
117 This variable is also set as a side-effect of \fBset_term\fP(3X)
118 and \fBdelscreen\fP(3X).
119 .PP
120 It is possible to save a value of \fBcur_term\fP for subsequent
121 use as a parameter to \fBset_term\fP, for switching between screens.
122 Alternatively, one can save the return value from \fBnewterm\fP
123 or \fBsetupterm\fP(3X) to reuse in \fBset_term\fP.
124 .SS Terminfo Lookup Tables
125 The \fB@TIC@\fP(1) and \fB@INFOCMP@\fP(1) programs use lookup tables for
126 the long and short names of terminfo capabilities,
127 as well as the corresponding names for termcap capabilities.
128 These are available to other applications,
129 although the hash-tables used by
130 the terminfo and termcap functions are not available.
131 .PP
132 The long terminfo capability names use a \*(``f\*('' (eff) in their names:
133 \fBboolfnames\fP,
134 \fBnumfnames\fP, and
135 \fBstrfnames\fP.
136 .PP
137 These are the short names for terminfo capabilities:
138 \fBboolnames\fP,
139 \fBnumnames\fP, and
140 \fBstrnames\fP.
141 .PP
142 These are the corresponding names used for termcap descriptions:
143 \fBboolcodes\fP,
144 \fBnumcodes\fP, and
145 \fBstrcodes\fP.
146 .\"
147 .SS Terminal Type
148 A terminal description begins with one or more terminal names
149 separated by \*(``|\*('' (vertical bars).
150 On initialization of the curses or terminfo interfaces,
151 \fBsetupterm\fP(3X) copies the terminal names to the array \fBttytype\fP.
152 .\"
153 .SS Terminfo Names
154 In addition to the variables, \fB<term.h>\fP also defines a symbol for each
155 terminfo capability \fIlong name\fP.
156 These are in terms of the symbol \fBCUR\fP,
157 which is defined
158 .PP
159 .nf
160 .ft \*(CW
161 #define CUR ((TERMTYPE *)(cur_term))->
162 .fi
163 .ft R
164 .PP
165 These symbols provide a faster method of accessing terminfo capabilities
166 than using \fBtigetstr\fP(3X), etc.
167 .PP
168 The actual definition of \fBCUR\fP depends upon the implementation,
169 but each terminfo library provides these long names defined to point
170 into the current terminal description loaded into memory.
171 .\"
172 .SH NOTES
173 The low-level terminfo interface is initialized using
174 .hy 0
175 \fBsetupterm\fP(3X).
176 .hy
177 The upper-level curses interface uses the low-level terminfo interface,
178 internally.
179 .\"
180 .SH PORTABILITY
181 X/Open Curses does not describe any of these except for \fBcur_term\fP.
182 (The inclusion of \fBcur_term\fP appears to be an oversight,
183 since other comparable low-level information is omitted by X/Open).
184 .PP
185 Other implementations may have comparable variables.
186 Some implementations provide the variables in their libraries,
187 but omit them from the header files.
188 .PP
189 All implementations which provide terminfo interfaces add definitions
190 as described in the \fBTerminfo Names\fP section.
191 Most, but not all, base the definition upon the \fBcur_term\fP variable.
192 .SH SEE ALSO
193 .hy 0
194 \fBcurses\fP(3X),
195 \fBcurs_terminfo\fP(3X),
196 \fBcurs_threads\fP(3X),
197 \fBterminfo\fP(\*n).
198 .hy