ncurses 6.1 - patch 20191130
[ncurses.git] / doc / html / man / term_variables.3x.html
1 <!-- 
2   ****************************************************************************
3   * Copyright (c) 2011-2017,2019 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   * @Id: term_variables.3x,v 1.11 2019/11/30 20:51:36 tom Exp @
30 -->
31 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
32 <HTML>
33 <HEAD>
34 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
35 <meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
36 <TITLE>term_variables 3x</TITLE>
37 <link rel="author" href="mailto:bug-ncurses@gnu.org">
38 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
39 </HEAD>
40 <BODY>
41 <H1 class="no-header">term_variables 3x</H1>
42 <PRE>
43 <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>                                          <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>
44
45
46
47
48 </PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
49        <STRONG>SP</STRONG>, <STRONG>acs_map</STRONG>, <STRONG>boolcodes</STRONG>, <STRONG>boolfnames</STRONG>, <STRONG>boolnames</STRONG>, <STRONG>cur_term</STRONG>, <STRONG>numcodes</STRONG>,
50        <STRONG>numfnames</STRONG>, <STRONG>numnames</STRONG>, <STRONG>strcodes</STRONG>, <STRONG>strfnames</STRONG>, <STRONG>strnames</STRONG>, <STRONG>ttytype</STRONG> - <STRONG>curses</STRONG>
51        terminfo global variables
52
53
54 </PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
55        <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
56        <STRONG>#include</STRONG> <STRONG>&lt;term.h&gt;</STRONG>
57
58        <STRONG>chtype</STRONG> <STRONG>acs_map[];</STRONG>
59
60        <STRONG>SCREEN</STRONG> <STRONG>*</STRONG> <STRONG>SP;</STRONG>
61
62        <STRONG>TERMINAL</STRONG> <STRONG>*</STRONG> <STRONG>cur_term;</STRONG>
63
64        <STRONG>char</STRONG> <STRONG>ttytype[];</STRONG>
65
66        <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>boolcodes[];</STRONG>
67        <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>boolfnames[];</STRONG>
68        <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>boolnames[];</STRONG>
69
70        <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>numcodes[];</STRONG>
71        <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>numfnames[];</STRONG>
72        <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>numnames[];</STRONG>
73
74        <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>strcodes[];</STRONG>
75        <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>strfnames[];</STRONG>
76        <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>strnames[];</STRONG>
77
78
79 </PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
80        This  page  summarizes  variables provided by the <STRONG>curses</STRONG> library's low-
81        level terminfo interface.  A more complete description is given in  the
82        <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG> manual page.
83
84        Depending  on  the  configuration,  these  may  be actual variables, or
85        macros (see <STRONG><A HREF="curs_threads.3x.html">curs_threads(3x)</A></STRONG>) which provide read-only access  to  <EM>curs-</EM>
86        <EM>es</EM>'s state.  In either case, applications should treat them as read-on-
87        ly to avoid confusing the library.
88
89
90 </PRE><H3><a name="h3-Alternate-Character-Set-Mapping">Alternate Character Set Mapping</a></H3><PRE>
91        After initializing the curses or terminfo interfaces, the <STRONG>acs_map</STRONG> array
92        holds  information  used to translate cells with the <STRONG>A_ALTCHARSET</STRONG> video
93        attribute into line-drawing characters.
94
95        The encoding of the information in this array has changed periodically.
96        Application  developers  need  only know that it is used for the "ACS_"
97        constants in &lt;curses.h&gt;.
98
99        The comparable data for the wide-character library is a  private  vari-
100        able.
101
102
103 </PRE><H3><a name="h3-Current-Terminal-Data">Current Terminal Data</a></H3><PRE>
104        After initializing the curses or terminfo interfaces, the <STRONG>cur_term</STRONG> con-
105        tains data describing the current terminal.  This variable is also  set
106        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>.
107
108        It  is possible to save a value of <STRONG>cur_term</STRONG> for subsequent use as a pa-
109        rameter to <STRONG>set_term</STRONG>, for switching between screens.  Alternatively, one
110        can  save  the  return  value from <STRONG>newterm</STRONG> or <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG> to reuse in
111        <STRONG>set_term</STRONG>.
112
113
114 </PRE><H3><a name="h3-Terminfo-Names">Terminfo Names</a></H3><PRE>
115        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
116        short  names  of  terminfo  capabilities,  as well as the corresponding
117        names for termcap capabilities.  These are available to other  applica-
118        tions,  although the hash-tables used by the terminfo and termcap func-
119        tions are not available.
120
121        The long terminfo capability names use a  "l"  (ell)  in  their  names:
122        <STRONG>boolfnames</STRONG>, <STRONG>numfnames</STRONG>, and <STRONG>strfnames</STRONG>.
123
124        These  are  the  short names for terminfo capabilities: <STRONG>boolnames</STRONG>, <STRONG>num-</STRONG>
125        <STRONG>names</STRONG>, and <STRONG>strnames</STRONG>.
126
127        These are the corresponding names used for termcap descriptions:  <STRONG>bool-</STRONG>
128        <STRONG>codes</STRONG>, <STRONG>numcodes</STRONG>, and <STRONG>strcodes</STRONG>.
129
130
131 </PRE><H3><a name="h3-Terminal-Type">Terminal Type</a></H3><PRE>
132        A terminal description begins with one or more terminal names separated
133        by "|" (vertical bars).  On initialization of the  curses  or  terminfo
134        interfaces,  <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG>  copies the terminal names to the array <STRONG>tty-</STRONG>
135        <STRONG>type</STRONG>.
136
137
138 </PRE><H3><a name="h3-Terminfo-Names">Terminfo Names</a></H3><PRE>
139        In addition to the variables, <STRONG>&lt;term.h&gt;</STRONG> also defines a symbol  for  each
140        terminfo  capability  <EM>long</EM> <EM>name</EM>.  These are in terms of the symbol <STRONG>CUR</STRONG>,
141        which is defined
142
143        #define CUR ((TERMTYPE *)(cur_term))-&gt;
144
145        These symbols provide a faster method of accessing  terminfo  capabili-
146        ties than using <STRONG><A HREF="curs_terminfo.3x.html">tigetstr(3x)</A></STRONG>, etc.
147
148        The  actual definition of <STRONG>CUR</STRONG> depends upon the implementation, but each
149        terminfo library provides these long names defined to  point  into  the
150        current terminal description loaded into memory.
151
152
153 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
154        The  low-level  terminfo  interface is initialized using <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG>.
155        The upper-level curses interface uses the low-level terminfo interface,
156        internally.
157
158
159 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
160        X/Open Curses does not describe any of these except for <STRONG>cur_term</STRONG>.  (The
161        inclusion of <STRONG>cur_term</STRONG> appears to be an oversight, since other  compara-
162        ble low-level information is omitted by X/Open).
163
164        Other  implementations may have comparable variables.  Some implementa-
165        tions provide the variables in their libraries, but omit them from  the
166        header files.
167
168        All  implementations  which provide terminfo interfaces add definitions
169        as described in the <STRONG>Terminfo</STRONG> <STRONG>Names</STRONG> section.  Most, but  not  all,  base
170        the definition upon the <STRONG>cur_term</STRONG> variable.
171
172
173 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
174        <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>.
175
176
177
178                                                             <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>
179 </PRE>
180 <div class="nav">
181 <ul>
182 <li><a href="#h2-NAME">NAME</a></li>
183 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
184 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
185 <ul>
186 <li><a href="#h3-Alternate-Character-Set-Mapping">Alternate Character Set Mapping</a></li>
187 <li><a href="#h3-Current-Terminal-Data">Current Terminal Data</a></li>
188 <li><a href="#h3-Terminfo-Names">Terminfo Names</a></li>
189 <li><a href="#h3-Terminal-Type">Terminal Type</a></li>
190 <li><a href="#h3-Terminfo-Names">Terminfo Names</a></li>
191 </ul>
192 </li>
193 <li><a href="#h2-NOTES">NOTES</a></li>
194 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
195 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
196 </ul>
197 </div>
198 </BODY>
199 </HTML>