blob: 99b6786bca482b5a1ec3dfe6caafd84e7810acef [file] [log] [blame]
micky3879b9f5e72025-07-08 18:04:53 -04001<!--
Steve Kondikae271bc2015-11-15 02:50:53 +01002 ****************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -04003 * Copyright 2019-2023,2024 Thomas E. Dickey *
4 * Copyright 2010-2015,2017 Free Software Foundation, Inc. *
Steve Kondikae271bc2015-11-15 02:50:53 +01005 * *
6 * Permission is hereby granted, free of charge, to any person obtaining a *
7 * copy of this software and associated documentation files (the *
8 * "Software"), to deal in the Software without restriction, including *
9 * without limitation the rights to use, copy, modify, merge, publish, *
10 * distribute, distribute with modifications, sublicense, and/or sell *
11 * copies of the Software, and to permit persons to whom the Software is *
12 * furnished to do so, subject to the following conditions: *
13 * *
14 * The above copyright notice and this permission notice shall be included *
15 * in all copies or substantial portions of the Software. *
16 * *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
20 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
21 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
22 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
23 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
24 * *
25 * Except as contained in this notice, the name(s) of the above copyright *
26 * holders shall not be used in advertising or otherwise to promote the *
27 * sale, use or other dealings in this Software without prior written *
28 * authorization. *
29 ****************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -040030 * @Id: term_variables.3x,v 1.36 2024/03/16 15:35:01 tom Exp @
Steve Kondikae271bc2015-11-15 02:50:53 +010031-->
32<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
33<HTML>
34<HEAD>
35<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
micky3879b9f5e72025-07-08 18:04:53 -040036<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
37<TITLE>term_variables 3x 2024-03-16 ncurses 6.5 Library calls</TITLE>
38<link rel="author" href="mailto:bug-ncurses@gnu.org">
39
Steve Kondikae271bc2015-11-15 02:50:53 +010040</HEAD>
41<BODY>
micky3879b9f5e72025-07-08 18:04:53 -040042<H1 class="no-header">term_variables 3x 2024-03-16 ncurses 6.5 Library calls</H1>
Steve Kondikae271bc2015-11-15 02:50:53 +010043<PRE>
micky3879b9f5e72025-07-08 18:04:53 -040044<STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG> Library calls <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>
Steve Kondikae271bc2015-11-15 02:50:53 +010045
46
47
48
micky3879b9f5e72025-07-08 18:04:53 -040049</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
50 <STRONG>SP</STRONG>, <STRONG>acs_map</STRONG>, <STRONG>boolcodes</STRONG>, <STRONG>boolfnames</STRONG>, <STRONG>boolnames</STRONG>, <STRONG>cur_term</STRONG>, <STRONG>numcodes</STRONG>,
51 <STRONG>numfnames</STRONG>, <STRONG>numnames</STRONG>, <STRONG>strcodes</STRONG>, <STRONG>strfnames</STRONG>, <STRONG>strnames</STRONG>, <STRONG>ttytype</STRONG> - <EM>terminfo</EM>
52 global variables
Steve Kondikae271bc2015-11-15 02:50:53 +010053
54
micky3879b9f5e72025-07-08 18:04:53 -040055</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
Steve Kondikae271bc2015-11-15 02:50:53 +010056 <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
57 <STRONG>#include</STRONG> <STRONG>&lt;term.h&gt;</STRONG>
58
59 <STRONG>chtype</STRONG> <STRONG>acs_map[];</STRONG>
60
micky3879b9f5e72025-07-08 18:04:53 -040061 <STRONG>SCREEN</STRONG> <STRONG>*</STRONG> <STRONG>SP;</STRONG>
62
Steve Kondikae271bc2015-11-15 02:50:53 +010063 <STRONG>TERMINAL</STRONG> <STRONG>*</STRONG> <STRONG>cur_term;</STRONG>
64
65 <STRONG>char</STRONG> <STRONG>ttytype[];</STRONG>
66
micky3879b9f5e72025-07-08 18:04:53 -040067 <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>boolcodes[];</STRONG>
68 <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>boolfnames[];</STRONG>
69 <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>boolnames[];</STRONG>
Steve Kondikae271bc2015-11-15 02:50:53 +010070
micky3879b9f5e72025-07-08 18:04:53 -040071 <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>numcodes[];</STRONG>
72 <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>numfnames[];</STRONG>
73 <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>numnames[];</STRONG>
Steve Kondikae271bc2015-11-15 02:50:53 +010074
micky3879b9f5e72025-07-08 18:04:53 -040075 <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>strcodes[];</STRONG>
76 <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>strfnames[];</STRONG>
77 <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>strnames[];</STRONG>
Steve Kondikae271bc2015-11-15 02:50:53 +010078
79
micky3879b9f5e72025-07-08 18:04:53 -040080</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
81 This page summarizes variables provided by the <STRONG>curses</STRONG> library's low-
82 level terminfo interface. A more complete description is given in the
83 <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG> manual page.
Steve Kondikae271bc2015-11-15 02:50:53 +010084
micky3879b9f5e72025-07-08 18:04:53 -040085 Depending on the configuration, these may be actual variables, or
86 macros (see <STRONG><A HREF="curs_threads.3x.html">curs_threads(3x)</A></STRONG>) which provide read-only access to
87 <EM>curses</EM>'s state. In either case, applications should treat them as
88 read-only to avoid confusing the library.
Steve Kondikae271bc2015-11-15 02:50:53 +010089
90
micky3879b9f5e72025-07-08 18:04:53 -040091</PRE><H3><a name="h3-Alternate-Character-Set-Mapping">Alternate Character Set Mapping</a></H3><PRE>
92 After initializing the curses or terminfo interfaces, the <STRONG>acs_map</STRONG> array
93 holds information used to translate cells with the <STRONG>A_ALTCHARSET</STRONG> video
94 attribute into line-drawing characters.
Steve Kondikae271bc2015-11-15 02:50:53 +010095
micky3879b9f5e72025-07-08 18:04:53 -040096 The encoding of the information in this array has changed periodically.
97 Application developers need only know that it is used for the "ACS_"
98 constants in &lt;curses.h&gt;.
Steve Kondikae271bc2015-11-15 02:50:53 +010099
micky3879b9f5e72025-07-08 18:04:53 -0400100 The comparable data for the wide-character library is a private
Steve Kondikae271bc2015-11-15 02:50:53 +0100101 variable.
102
103
micky3879b9f5e72025-07-08 18:04:53 -0400104</PRE><H3><a name="h3-Current-Terminal-Data">Current Terminal Data</a></H3><PRE>
105 After initializing the curses or terminfo interfaces, the <STRONG>cur_term</STRONG>
106 contains data describing the current terminal. This variable is also
107 set as a side-effect of <STRONG><A HREF="curs_initscr.3x.html">set_term(3x)</A></STRONG> and <STRONG><A HREF="curs_initscr.3x.html">delscreen(3x)</A></STRONG>.
108
109 It is possible to save a value of <STRONG>cur_term</STRONG> for subsequent use as a
110 parameter to <STRONG>set_term</STRONG>, for switching between screens. Alternatively,
111 one can save the return value from <STRONG>newterm</STRONG> or <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG> to reuse in
112 <STRONG>set_term</STRONG>.
113
114
115</PRE><H3><a name="h3-terminfo-Lookup-Tables"><EM>terminfo</EM> Lookup Tables</a></H3><PRE>
116 The <STRONG><A HREF="tic.1m.html">tic(1)</A></STRONG> and <STRONG><A HREF="infocmp.1m.html">infocmp(1)</A></STRONG> programs use lookup tables for the long and
117 short names of terminfo capabilities, as well as the corresponding
118 names for termcap capabilities. These are available to other
119 applications, although the hash-tables used by the terminfo and termcap
120 functions are not available.
121
122 The long terminfo capability names use a "f" (eff) in their names:
123 <STRONG>boolfnames</STRONG>, <STRONG>numfnames</STRONG>, and <STRONG>strfnames</STRONG>.
124
125 These are the short names for terminfo capabilities: <STRONG>boolnames</STRONG>,
126 <STRONG>numnames</STRONG>, and <STRONG>strnames</STRONG>.
127
128 These are the corresponding names used for termcap descriptions:
129 <STRONG>boolcodes</STRONG>, <STRONG>numcodes</STRONG>, and <STRONG>strcodes</STRONG>.
130
131
132</PRE><H3><a name="h3-Terminal-Type">Terminal Type</a></H3><PRE>
133 A terminal description begins with one or more terminal names separated
134 by "|" (vertical bars). On initialization of the curses or terminfo
135 interfaces, <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG> copies the terminal names to the array
136 <STRONG>ttytype</STRONG>.
137
138
139</PRE><H3><a name="h3-terminfo-Names"><EM>terminfo</EM> Names</a></H3><PRE>
140 In addition to the variables, <STRONG>&lt;term.h&gt;</STRONG> also defines a symbol for each
141 terminfo capability <EM>long</EM> <EM>name</EM>. These are in terms of the symbol <STRONG>CUR</STRONG>,
142 which is defined
143
144 #define CUR ((TERMTYPE *)(cur_term))-&gt;
145
146 These symbols provide a faster method of accessing terminfo
147 capabilities than using <STRONG><A HREF="curs_terminfo.3x.html">tigetstr(3x)</A></STRONG>, etc.
148
149 The actual definition of <STRONG>CUR</STRONG> depends upon the implementation, but each
150 terminfo library provides these long names defined to point into the
151 current terminal description loaded into memory.
152
153
154</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
155 The low-level terminfo interface is initialized using <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG>.
156 The upper-level curses interface uses the low-level terminfo interface,
157 internally.
158
159
160</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
161 X/Open Curses does not describe any of these except for <STRONG>cur_term</STRONG>. (The
162 inclusion of <STRONG>cur_term</STRONG> appears to be an oversight, since other
163 comparable low-level information is omitted by X/Open).
164
165 Other implementations may have comparable variables. Some
166 implementations provide the variables in their libraries, but omit them
167 from the header files.
168
169 All implementations which provide terminfo interfaces add definitions
170 as described in the <STRONG>Terminfo</STRONG> <STRONG>Names</STRONG> section. Most, but not all, base
171 the definition upon the <STRONG>cur_term</STRONG> variable.
172
173
174</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
175 <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>, <STRONG><A HREF="curs_threads.3x.html">curs_threads(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
Steve Kondikae271bc2015-11-15 02:50:53 +0100176
177
178
micky3879b9f5e72025-07-08 18:04:53 -0400179ncurses 6.5 2024-03-16 <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>
Steve Kondikae271bc2015-11-15 02:50:53 +0100180</PRE>
181<div class="nav">
182<ul>
183<li><a href="#h2-NAME">NAME</a></li>
184<li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
185<li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
186<ul>
187<li><a href="#h3-Alternate-Character-Set-Mapping">Alternate Character Set Mapping</a></li>
188<li><a href="#h3-Current-Terminal-Data">Current Terminal Data</a></li>
micky3879b9f5e72025-07-08 18:04:53 -0400189<li><a href="#h3-terminfo-Lookup-Tables">terminfo Lookup Tables</a></li>
Steve Kondikae271bc2015-11-15 02:50:53 +0100190<li><a href="#h3-Terminal-Type">Terminal Type</a></li>
micky3879b9f5e72025-07-08 18:04:53 -0400191<li><a href="#h3-terminfo-Names">terminfo Names</a></li>
Steve Kondikae271bc2015-11-15 02:50:53 +0100192</ul>
193</li>
194<li><a href="#h2-NOTES">NOTES</a></li>
195<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
196<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
197</ul>
198</div>
199</BODY>
200</HTML>