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