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