]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/term_variables.3x
ncurses 6.0 - patch 20170218
[ncurses.git] / man / term_variables.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 2011-2015,2017 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.8 2017/01/07 19:25:15 tom Exp $
30 .TH term_variables 3X ""
31 .ds n 5
32 .na
33 .hy 0
34 .SH NAME
35 \fBSP\fP,
36 \fBacs_map\fP,
37 \fBboolcodes\fP,
38 \fBboolfnames\fP,
39 \fBboolnames\fP,
40 \fBcur_term\fP,
41 \fBnumcodes\fP,
42 \fBnumfnames\fP,
43 \fBnumnames\fP,
44 \fBstrcodes\fP,
45 \fBstrfnames\fP,
46 \fBstrnames\fP,
47 \fBttytype\fP
48 \- \fBcurses\fR terminfo global variables
49 .ad
50 .hy
51 .SH SYNOPSIS
52 .nf
53 \fB#include <curses.h>\fR
54 .br
55 \fB#include <term.h>\fR
56 .PP
57 \fBchtype acs_map[];\fR
58 .sp
59 \fBSCREEN * SP;\fR
60 .sp
61 \fBTERMINAL * cur_term;\fR
62 .sp
63 \fBchar ttytype[];\fR
64 .sp
65 \fBNCURSES_CONST char * const * boolcodes;\fR
66 .br
67 \fBNCURSES_CONST char * const * boolfnames;\fR
68 .br
69 \fBNCURSES_CONST char * const * boolnames;\fR
70 .sp
71 \fBNCURSES_CONST char * const * numcodes;\fR
72 .br
73 \fBNCURSES_CONST char * const * numfnames;\fR
74 .br
75 \fBNCURSES_CONST char * const * numnames;\fR
76 .sp
77 \fBNCURSES_CONST char * const * strcodes;\fR
78 .br
79 \fBNCURSES_CONST char * const * strfnames;\fR
80 .br
81 \fBNCURSES_CONST char * const * strnames;\fR
82 .br
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\fR(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 Names
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 "l" (ell) 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 On initialization of the curses or terminfo interfaces,
139 \fBsetupterm\fP(3X) copies the terminal name to the array \fBttytype\fP.
140 .\"
141 .SS Terminfo Names
142 .PP
143 In addition to the variables, \fB<term.h>\fP also defines a symbol for each
144 terminfo capability \fIlong name\fP.
145 These are in terms of the symbol \fBCUR\fP,
146 which is defined
147 .PP
148 .nf
149 .ft CW
150 #define CUR cur_term->type.
151 .fi
152 .ft R
153 .PP
154 These symbols provide a faster method of accessing terminfo capabilities
155 than using \fBtigetstr\fR(3X), etc.
156 .\"
157 .SH NOTES
158 The low-level terminfo interface is initialized using
159 .hy 0
160 \fBsetupterm\fR(3X).
161 .hy
162 The upper-level curses interface uses the low-level terminfo interface,
163 internally.
164 .\"
165 .SH PORTABILITY
166 X/Open Curses does not describe any of these except for \fBcur_term\fP.
167 (The inclusion of \fBcur_term\fP appears to be an oversight,
168 since other comparable low-level information is omitted by X/Open).
169 .PP
170 Other implementations may have comparable variables.
171 Some implementations provide the variables in their libraries,
172 but omit them from the header files.
173 .PP
174 All implementations which provide terminfo interfaces add definitions
175 as described in the \fBTerminfo Names\fP section.
176 Most, but not all, base the definition upon the \fBcur_term\fP variable.
177 .SH SEE ALSO
178 .hy 0
179 \fBcurses\fR(3X),
180 \fBcurs_terminfo\fR(3X),
181 \fBcurs_threads\fR(3X),
182 \fBterminfo\fR(\*n).
183 .hy