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