Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1 | .\"*************************************************************************** |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2 | .\" Copyright 2019-2023,2024 Thomas E. Dickey * |
| 3 | .\" Copyright 2010-2015,2017 Free Software Foundation, Inc. * |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 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 | .\" |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 30 | .\" $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 Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 43 | .SH NAME |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 44 | \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 Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 58 | .SH SYNOPSIS |
| 59 | .nf |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 60 | \fB#include <curses.h> |
| 61 | \fB#include <term.h> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 62 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 63 | \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 Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 82 | .fi |
| 83 | .SH DESCRIPTION |
| 84 | This page summarizes variables provided by the \fBcurses\fP library's |
| 85 | low-level terminfo interface. |
| 86 | A more complete description is given in the \fBcurs_terminfo\fP(3X) manual page. |
| 87 | .PP |
| 88 | Depending on the configuration, these may be actual variables, |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 89 | or macros (see \fBcurs_threads\fP(3X)) |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 90 | which provide read-only access to \fIcurses\fP's state. |
| 91 | In either case, applications should treat them as read-only to avoid |
| 92 | confusing the library. |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 93 | .SS "Alternate Character Set Mapping" |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 94 | After initializing the curses or terminfo interfaces, |
| 95 | the \fBacs_map\fP array holds information used to translate cells |
| 96 | with the \fBA_ALTCHARSET\fP video attribute into line-drawing characters. |
| 97 | .PP |
| 98 | The encoding of the information in this array has changed periodically. |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 99 | Application developers need only know that it is used for the \*(``ACS_\*('' |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 100 | constants in <curses.h>. |
| 101 | .PP |
| 102 | The comparable data for the wide-character library is a private variable. |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 103 | .SS "Current Terminal Data" |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 104 | After initializing the curses or terminfo interfaces, |
| 105 | the \fBcur_term\fP contains data describing the current terminal. |
| 106 | This variable is also set as a side-effect of \fBset_term\fP(3X) |
| 107 | and \fBdelscreen\fP(3X). |
| 108 | .PP |
| 109 | It is possible to save a value of \fBcur_term\fP for subsequent |
| 110 | use as a parameter to \fBset_term\fP, for switching between screens. |
| 111 | Alternatively, one can save the return value from \fBnewterm\fP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 112 | or \fBsetupterm\fP(3X) to reuse in \fBset_term\fP. |
| 113 | .SS "\fIterminfo\fP Lookup Tables" |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 114 | The \fB@TIC@\fP(1) and \fB@INFOCMP@\fP(1) programs use lookup tables for |
| 115 | the long and short names of terminfo capabilities, |
| 116 | as well as the corresponding names for termcap capabilities. |
| 117 | These are available to other applications, |
| 118 | although the hash-tables used by |
| 119 | the terminfo and termcap functions are not available. |
| 120 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 121 | The long terminfo capability names use a \*(``f\*('' (eff) in their names: |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 122 | \fBboolfnames\fP, |
| 123 | \fBnumfnames\fP, and |
| 124 | \fBstrfnames\fP. |
| 125 | .PP |
| 126 | These are the short names for terminfo capabilities: |
| 127 | \fBboolnames\fP, |
| 128 | \fBnumnames\fP, and |
| 129 | \fBstrnames\fP. |
| 130 | .PP |
| 131 | These are the corresponding names used for termcap descriptions: |
| 132 | \fBboolcodes\fP, |
| 133 | \fBnumcodes\fP, and |
| 134 | \fBstrcodes\fP. |
| 135 | .\" |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 136 | .SS "Terminal Type" |
| 137 | A terminal description begins with one or more terminal names |
| 138 | separated by \*(``|\*('' (vertical bars). |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 139 | On initialization of the curses or terminfo interfaces, |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 140 | \fBsetupterm\fP(3X) copies the terminal names to the array \fBttytype\fP. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 141 | .\" |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 142 | .SS "\fIterminfo\fP Names" |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 143 | In addition to the variables, \fB<term.h>\fP also defines a symbol for each |
| 144 | terminfo capability \fIlong name\fP. |
| 145 | These are in terms of the symbol \fBCUR\fP, |
| 146 | which is defined |
| 147 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 148 | .EX |
| 149 | #define CUR ((TERMTYPE *)(cur_term))\-> |
| 150 | .EE |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 151 | .PP |
| 152 | These symbols provide a faster method of accessing terminfo capabilities |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 153 | than using \fBtigetstr\fP(3X), etc. |
| 154 | .PP |
| 155 | The actual definition of \fBCUR\fP depends upon the implementation, |
| 156 | but each terminfo library provides these long names defined to point |
| 157 | into the current terminal description loaded into memory. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 158 | .\" |
| 159 | .SH NOTES |
| 160 | The low-level terminfo interface is initialized using |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 161 | \fB\%setupterm\fP(3X). |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 162 | The upper-level curses interface uses the low-level terminfo interface, |
| 163 | internally. |
| 164 | .\" |
| 165 | .SH PORTABILITY |
| 166 | X/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, |
| 168 | since other comparable low-level information is omitted by X/Open). |
| 169 | .PP |
| 170 | Other implementations may have comparable variables. |
| 171 | Some implementations provide the variables in their libraries, |
| 172 | but omit them from the header files. |
| 173 | .PP |
| 174 | All implementations which provide terminfo interfaces add definitions |
| 175 | as described in the \fBTerminfo Names\fP section. |
| 176 | Most, but not all, base the definition upon the \fBcur_term\fP variable. |
| 177 | .SH SEE ALSO |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 178 | \fB\%curses\fP(3X), |
| 179 | \fB\%curs_terminfo\fP(3X), |
| 180 | \fB\%curs_threads\fP(3X), |
| 181 | \fB\%terminfo\fP(5) |