blob: 6aee63f487ed2ae0596ced4180069bbc79b3fe2c [file] [log] [blame]
Steve Kondikae271bc2015-11-15 02:50:53 +01001.\"***************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -04002.\" Copyright 2019-2023,2024 Thomas E. Dickey *
3.\" Copyright 2010-2015,2017 Free Software Foundation, Inc. *
Steve Kondikae271bc2015-11-15 02:50:53 +01004.\" *
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.\"
micky3879b9f5e72025-07-08 18:04:53 -040030.\" $Id: term_variables.3x,v 1.36 2024/03/16 15:35:01 tom Exp $
31.TH term_variables 3X 2024-03-16 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "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.
Steve Kondikae271bc2015-11-15 02:50:53 +010043.SH NAME
micky3879b9f5e72025-07-08 18:04:53 -040044\fB\%SP\fP,
45\fB\%acs_map\fP,
46\fB\%boolcodes\fP,
47\fB\%boolfnames\fP,
48\fB\%boolnames\fP,
49\fB\%cur_term\fP,
50\fB\%numcodes\fP,
51\fB\%numfnames\fP,
52\fB\%numnames\fP,
53\fB\%strcodes\fP,
54\fB\%strfnames\fP,
55\fB\%strnames\fP,
56\fB\%ttytype\fP \-
57\fIterminfo\fR global variables
Steve Kondikae271bc2015-11-15 02:50:53 +010058.SH SYNOPSIS
59.nf
micky3879b9f5e72025-07-08 18:04:53 -040060\fB#include <curses.h>
61\fB#include <term.h>
Steve Kondikae271bc2015-11-15 02:50:53 +010062.PP
micky3879b9f5e72025-07-08 18:04:53 -040063\fBchtype acs_map[];
64.PP
65\fBSCREEN * SP;
66.PP
67\fBTERMINAL * cur_term;
68.PP
69\fBchar ttytype[];
70.PP
71\fBNCURSES_CONST char * const boolcodes[];
72\fBNCURSES_CONST char * const boolfnames[];
73\fBNCURSES_CONST char * const boolnames[];
74.PP
75\fBNCURSES_CONST char * const numcodes[];
76\fBNCURSES_CONST char * const numfnames[];
77\fBNCURSES_CONST char * const numnames[];
78.PP
79\fBNCURSES_CONST char * const strcodes[];
80\fBNCURSES_CONST char * const strfnames[];
81\fBNCURSES_CONST char * const strnames[];
Steve Kondikae271bc2015-11-15 02:50:53 +010082.fi
83.SH DESCRIPTION
84This page summarizes variables provided by the \fBcurses\fP library's
85low-level terminfo interface.
86A more complete description is given in the \fBcurs_terminfo\fP(3X) manual page.
87.PP
88Depending on the configuration, these may be actual variables,
micky3879b9f5e72025-07-08 18:04:53 -040089or macros (see \fBcurs_threads\fP(3X))
Steve Kondikae271bc2015-11-15 02:50:53 +010090which provide read-only access to \fIcurses\fP's state.
91In either case, applications should treat them as read-only to avoid
92confusing the library.
micky3879b9f5e72025-07-08 18:04:53 -040093.SS "Alternate Character Set Mapping"
Steve Kondikae271bc2015-11-15 02:50:53 +010094After initializing the curses or terminfo interfaces,
95the \fBacs_map\fP array holds information used to translate cells
96with the \fBA_ALTCHARSET\fP video attribute into line-drawing characters.
97.PP
98The encoding of the information in this array has changed periodically.
micky3879b9f5e72025-07-08 18:04:53 -040099Application developers need only know that it is used for the \*(``ACS_\*(''
Steve Kondikae271bc2015-11-15 02:50:53 +0100100constants in <curses.h>.
101.PP
102The comparable data for the wide-character library is a private variable.
micky3879b9f5e72025-07-08 18:04:53 -0400103.SS "Current Terminal Data"
Steve Kondikae271bc2015-11-15 02:50:53 +0100104After initializing the curses or terminfo interfaces,
105the \fBcur_term\fP contains data describing the current terminal.
106This variable is also set as a side-effect of \fBset_term\fP(3X)
107and \fBdelscreen\fP(3X).
108.PP
109It is possible to save a value of \fBcur_term\fP for subsequent
110use as a parameter to \fBset_term\fP, for switching between screens.
111Alternatively, one can save the return value from \fBnewterm\fP
micky3879b9f5e72025-07-08 18:04:53 -0400112or \fBsetupterm\fP(3X) to reuse in \fBset_term\fP.
113.SS "\fIterminfo\fP Lookup Tables"
Steve Kondikae271bc2015-11-15 02:50:53 +0100114The \fB@TIC@\fP(1) and \fB@INFOCMP@\fP(1) programs use lookup tables for
115the long and short names of terminfo capabilities,
116as well as the corresponding names for termcap capabilities.
117These are available to other applications,
118although the hash-tables used by
119the terminfo and termcap functions are not available.
120.PP
micky3879b9f5e72025-07-08 18:04:53 -0400121The long terminfo capability names use a \*(``f\*('' (eff) in their names:
Steve Kondikae271bc2015-11-15 02:50:53 +0100122\fBboolfnames\fP,
123\fBnumfnames\fP, and
124\fBstrfnames\fP.
125.PP
126These are the short names for terminfo capabilities:
127\fBboolnames\fP,
128\fBnumnames\fP, and
129\fBstrnames\fP.
130.PP
131These are the corresponding names used for termcap descriptions:
132\fBboolcodes\fP,
133\fBnumcodes\fP, and
134\fBstrcodes\fP.
135.\"
micky3879b9f5e72025-07-08 18:04:53 -0400136.SS "Terminal Type"
137A terminal description begins with one or more terminal names
138separated by \*(``|\*('' (vertical bars).
Steve Kondikae271bc2015-11-15 02:50:53 +0100139On initialization of the curses or terminfo interfaces,
micky3879b9f5e72025-07-08 18:04:53 -0400140\fBsetupterm\fP(3X) copies the terminal names to the array \fBttytype\fP.
Steve Kondikae271bc2015-11-15 02:50:53 +0100141.\"
micky3879b9f5e72025-07-08 18:04:53 -0400142.SS "\fIterminfo\fP Names"
Steve Kondikae271bc2015-11-15 02:50:53 +0100143In addition to the variables, \fB<term.h>\fP also defines a symbol for each
144terminfo capability \fIlong name\fP.
145These are in terms of the symbol \fBCUR\fP,
146which is defined
147.PP
micky3879b9f5e72025-07-08 18:04:53 -0400148.EX
149#define CUR ((TERMTYPE *)(cur_term))\->
150.EE
Steve Kondikae271bc2015-11-15 02:50:53 +0100151.PP
152These symbols provide a faster method of accessing terminfo capabilities
micky3879b9f5e72025-07-08 18:04:53 -0400153than using \fBtigetstr\fP(3X), etc.
154.PP
155The actual definition of \fBCUR\fP depends upon the implementation,
156but each terminfo library provides these long names defined to point
157into the current terminal description loaded into memory.
Steve Kondikae271bc2015-11-15 02:50:53 +0100158.\"
159.SH NOTES
160The low-level terminfo interface is initialized using
micky3879b9f5e72025-07-08 18:04:53 -0400161\fB\%setupterm\fP(3X).
Steve Kondikae271bc2015-11-15 02:50:53 +0100162The upper-level curses interface uses the low-level terminfo interface,
163internally.
164.\"
165.SH PORTABILITY
166X/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,
168since other comparable low-level information is omitted by X/Open).
169.PP
170Other implementations may have comparable variables.
171Some implementations provide the variables in their libraries,
172but omit them from the header files.
173.PP
174All implementations which provide terminfo interfaces add definitions
175as described in the \fBTerminfo Names\fP section.
176Most, but not all, base the definition upon the \fBcur_term\fP variable.
177.SH SEE ALSO
micky3879b9f5e72025-07-08 18:04:53 -0400178\fB\%curses\fP(3X),
179\fB\%curs_terminfo\fP(3X),
180\fB\%curs_threads\fP(3X),
181\fB\%terminfo\fP(5)