jcs's openbsd hax
openbsd
1.\"***************************************************************************
2.\" Copyright 2019-2022,2023 Thomas E. Dickey *
3.\" Copyright 2010-2015,2017 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.\"
30.\" $Id: term_variables.3,v 1.1 2023/10/17 09:52:08 nicm Exp $
31.TH term_variables 3 2023-07-01 "ncurses 6.4" "Library calls"
32.ds n 5
33.ie \n(.g .ds `` \(lq
34.el .ds `` ``
35.ie \n(.g .ds '' \(rq
36.el .ds '' ''
37.na
38.hy 0
39.SH NAME
40\fBSP\fP,
41\fBacs_map\fP,
42\fBboolcodes\fP,
43\fBboolfnames\fP,
44\fBboolnames\fP,
45\fBcur_term\fP,
46\fBnumcodes\fP,
47\fBnumfnames\fP,
48\fBnumnames\fP,
49\fBstrcodes\fP,
50\fBstrfnames\fP,
51\fBstrnames\fP,
52\fBttytype\fP
53\- \fBcurses\fP terminfo global variables
54.ad
55.hy
56.SH SYNOPSIS
57.nf
58\fB#include <curses.h>\fP
59.br
60\fB#include <term.h>\fP
61.PP
62\fBchtype acs_map[];\fP
63.sp
64\fBSCREEN * SP;\fP
65.sp
66\fBTERMINAL * cur_term;\fP
67.sp
68\fBchar ttytype[];\fP
69.sp
70\fBNCURSES_CONST char * const boolcodes[];\fP
71.br
72\fBNCURSES_CONST char * const boolfnames[];\fP
73.br
74\fBNCURSES_CONST char * const boolnames[];\fP
75.sp
76\fBNCURSES_CONST char * const numcodes[];\fP
77.br
78\fBNCURSES_CONST char * const numfnames[];\fP
79.br
80\fBNCURSES_CONST char * const numnames[];\fP
81.sp
82\fBNCURSES_CONST char * const strcodes[];\fP
83.br
84\fBNCURSES_CONST char * const strfnames[];\fP
85.br
86\fBNCURSES_CONST char * const strnames[];\fP
87.br
88.fi
89.SH DESCRIPTION
90This page summarizes variables provided by the \fBcurses\fP library's
91low-level terminfo interface.
92A more complete description is given in the \fBterminfo\fP(3) manual page.
93.PP
94Depending on the configuration, these may be actual variables,
95or macros (see \fBcurs_threads\fP(3))
96which provide read-only access to \fIcurses\fP's state.
97In either case, applications should treat them as read-only to avoid
98confusing the library.
99.SS Alternate Character Set Mapping
100After initializing the curses or terminfo interfaces,
101the \fBacs_map\fP array holds information used to translate cells
102with the \fBA_ALTCHARSET\fP video attribute into line-drawing characters.
103.PP
104The encoding of the information in this array has changed periodically.
105Application developers need only know that it is used for the \*(``ACS_\*(''
106constants in <curses.h>.
107.PP
108The comparable data for the wide-character library is a private variable.
109.SS Current Terminal Data
110After initializing the curses or terminfo interfaces,
111the \fBcur_term\fP contains data describing the current terminal.
112This variable is also set as a side-effect of \fBset_term\fP(3)
113and \fBdelscreen\fP(3).
114.PP
115It is possible to save a value of \fBcur_term\fP for subsequent
116use as a parameter to \fBset_term\fP, for switching between screens.
117Alternatively, one can save the return value from \fBnewterm\fP
118or \fBsetupterm\fP(3) to reuse in \fBset_term\fP.
119.SS Terminfo Lookup Tables
120The \fBtic\fP(1) and \fBinfocmp\fP(1) programs use lookup tables for
121the long and short names of terminfo capabilities,
122as well as the corresponding names for termcap capabilities.
123These are available to other applications,
124although the hash-tables used by
125the terminfo and termcap functions are not available.
126.PP
127The long terminfo capability names use a \*(``f\*('' (eff) in their names:
128\fBboolfnames\fP,
129\fBnumfnames\fP, and
130\fBstrfnames\fP.
131.PP
132These are the short names for terminfo capabilities:
133\fBboolnames\fP,
134\fBnumnames\fP, and
135\fBstrnames\fP.
136.PP
137These are the corresponding names used for termcap descriptions:
138\fBboolcodes\fP,
139\fBnumcodes\fP, and
140\fBstrcodes\fP.
141.\"
142.SS Terminal Type
143A terminal description begins with one or more terminal names
144separated by \*(``|\*('' (vertical bars).
145On initialization of the curses or terminfo interfaces,
146\fBsetupterm\fP(3) copies the terminal names to the array \fBttytype\fP.
147.\"
148.SS Terminfo Names
149In addition to the variables, \fB<term.h>\fP also defines a symbol for each
150terminfo capability \fIlong name\fP.
151These are in terms of the symbol \fBCUR\fP,
152which is defined
153.PP
154.nf
155.ft CW
156#define CUR ((TERMTYPE *)(cur_term))->
157.fi
158.ft R
159.PP
160These symbols provide a faster method of accessing terminfo capabilities
161than using \fBtigetstr\fP(3), etc.
162.PP
163The actual definition of \fBCUR\fP depends upon the implementation,
164but each terminfo library provides these long names defined to point
165into the current terminal description loaded into memory.
166.\"
167.SH NOTES
168The low-level terminfo interface is initialized using
169.hy 0
170\fBsetupterm\fP(3).
171.hy
172The upper-level curses interface uses the low-level terminfo interface,
173internally.
174.\"
175.SH PORTABILITY
176X/Open Curses does not describe any of these except for \fBcur_term\fP.
177(The inclusion of \fBcur_term\fP appears to be an oversight,
178since other comparable low-level information is omitted by X/Open).
179.PP
180Other implementations may have comparable variables.
181Some implementations provide the variables in their libraries,
182but omit them from the header files.
183.PP
184All implementations which provide terminfo interfaces add definitions
185as described in the \fBTerminfo Names\fP section.
186Most, but not all, base the definition upon the \fBcur_term\fP variable.
187.SH SEE ALSO
188.hy 0
189\fBcurses\fP(3),
190\fBterminfo\fP(3),
191\fBcurs_threads\fP(3),
192\fBterminfo\fP(\*n).
193.hy