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