Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1 | .\"*************************************************************************** |
| 2 | .\" Copyright (c) 2011-2013,2015 Free Software Foundation, Inc. * |
| 3 | .\" * |
| 4 | .\" Permission is hereby granted, free of charge, to any person obtaining a * |
| 5 | .\" copy of this software and associated documentation files (the * |
| 6 | .\" "Software"), to deal in the Software without restriction, including * |
| 7 | .\" without limitation the rights to use, copy, modify, merge, publish, * |
| 8 | .\" distribute, distribute with modifications, sublicense, and/or sell * |
| 9 | .\" copies of the Software, and to permit persons to whom the Software is * |
| 10 | .\" furnished to do so, subject to the following conditions: * |
| 11 | .\" * |
| 12 | .\" The above copyright notice and this permission notice shall be included * |
| 13 | .\" in all copies or substantial portions of the Software. * |
| 14 | .\" * |
| 15 | .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * |
| 16 | .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * |
| 17 | .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * |
| 18 | .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * |
| 19 | .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * |
| 20 | .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * |
| 21 | .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * |
| 22 | .\" * |
| 23 | .\" Except as contained in this notice, the name(s) of the above copyright * |
| 24 | .\" holders shall not be used in advertising or otherwise to promote the * |
| 25 | .\" sale, use or other dealings in this Software without prior written * |
| 26 | .\" authorization. * |
| 27 | .\"*************************************************************************** |
| 28 | .\" |
| 29 | .\" $Id: term_variables.3x,v 1.6 2015/04/22 00:34:49 tom Exp $ |
| 30 | .TH term_variables 3X "" |
| 31 | .ds n 5 |
| 32 | .na |
| 33 | .hy 0 |
| 34 | .SH NAME |
| 35 | \fBSP\fP, |
| 36 | \fBacs_map\fP, |
| 37 | \fBboolcodes\fP, |
| 38 | \fBboolfnames\fP, |
| 39 | \fBboolnames\fP, |
| 40 | \fBcur_term\fP, |
| 41 | \fBnumcodes\fP, |
| 42 | \fBnumfnames\fP, |
| 43 | \fBnumnames\fP, |
| 44 | \fBstrcodes\fP, |
| 45 | \fBstrfnames\fP, |
| 46 | \fBstrnames\fP, |
| 47 | \fBttytype\fP |
| 48 | \- \fBcurses\fR terminfo global variables |
| 49 | .ad |
| 50 | .hy |
| 51 | .SH SYNOPSIS |
| 52 | .nf |
| 53 | \fB#include <curses.h>\fR |
| 54 | .br |
| 55 | \fB#include <term.h>\fR |
| 56 | .PP |
| 57 | \fBchtype acs_map[];\fR |
| 58 | .sp |
| 59 | \fBTERMINAL * cur_term;\fR |
| 60 | .sp |
| 61 | \fBchar ttytype[];\fR |
| 62 | .sp |
| 63 | \fBNCURSES_CONST char * const * boolcodes;\fR |
| 64 | .br |
| 65 | \fBNCURSES_CONST char * const * boolfnames;\fR |
| 66 | .br |
| 67 | \fBNCURSES_CONST char * const * boolnames;\fR |
| 68 | .sp |
| 69 | \fBNCURSES_CONST char * const * numcodes;\fR |
| 70 | .br |
| 71 | \fBNCURSES_CONST char * const * numfnames;\fR |
| 72 | .br |
| 73 | \fBNCURSES_CONST char * const * numnames;\fR |
| 74 | .sp |
| 75 | \fBNCURSES_CONST char * const * strcodes;\fR |
| 76 | .br |
| 77 | \fBNCURSES_CONST char * const * strfnames;\fR |
| 78 | .br |
| 79 | \fBNCURSES_CONST char * const * strnames;\fR |
| 80 | .br |
| 81 | .fi |
| 82 | .SH DESCRIPTION |
| 83 | This page summarizes variables provided by the \fBcurses\fP library's |
| 84 | low-level terminfo interface. |
| 85 | A more complete description is given in the \fBcurs_terminfo\fP(3X) manual page. |
| 86 | .PP |
| 87 | Depending on the configuration, these may be actual variables, |
| 88 | or macros (see \fBcurs_threads\fR(3X)) |
| 89 | which provide read-only access to \fIcurses\fP's state. |
| 90 | In either case, applications should treat them as read-only to avoid |
| 91 | confusing the library. |
| 92 | .SS Alternate Character Set Mapping |
| 93 | After initializing the curses or terminfo interfaces, |
| 94 | the \fBacs_map\fP array holds information used to translate cells |
| 95 | with the \fBA_ALTCHARSET\fP video attribute into line-drawing characters. |
| 96 | .PP |
| 97 | The encoding of the information in this array has changed periodically. |
| 98 | Application developers need only know that it is used for the "ACS_" |
| 99 | constants in <curses.h>. |
| 100 | .PP |
| 101 | The comparable data for the wide-character library is a private variable. |
| 102 | .SS Current Terminal Data |
| 103 | After initializing the curses or terminfo interfaces, |
| 104 | the \fBcur_term\fP contains data describing the current terminal. |
| 105 | This variable is also set as a side-effect of \fBset_term\fP(3X) |
| 106 | and \fBdelscreen\fP(3X). |
| 107 | .PP |
| 108 | It is possible to save a value of \fBcur_term\fP for subsequent |
| 109 | use as a parameter to \fBset_term\fP, for switching between screens. |
| 110 | Alternatively, one can save the return value from \fBnewterm\fP |
| 111 | or \fBsetupterm\fP to reuse in \fBset_term\fP. |
| 112 | .SS Terminfo Names |
| 113 | The \fB@TIC@\fP(1) and \fB@INFOCMP@\fP(1) programs use lookup tables for |
| 114 | the long and short names of terminfo capabilities, |
| 115 | as well as the corresponding names for termcap capabilities. |
| 116 | These are available to other applications, |
| 117 | although the hash-tables used by |
| 118 | the terminfo and termcap functions are not available. |
| 119 | .PP |
| 120 | The long terminfo capability names use a "l" (ell) in their names: |
| 121 | \fBboolfnames\fP, |
| 122 | \fBnumfnames\fP, and |
| 123 | \fBstrfnames\fP. |
| 124 | .PP |
| 125 | These are the short names for terminfo capabilities: |
| 126 | \fBboolnames\fP, |
| 127 | \fBnumnames\fP, and |
| 128 | \fBstrnames\fP. |
| 129 | .PP |
| 130 | These are the corresponding names used for termcap descriptions: |
| 131 | \fBboolcodes\fP, |
| 132 | \fBnumcodes\fP, and |
| 133 | \fBstrcodes\fP. |
| 134 | .\" |
| 135 | .SS Terminal Type |
| 136 | On initialization of the curses or terminfo interfaces, |
| 137 | \fBsetupterm\fP copies the terminal name to the array \fBttytype\fP. |
| 138 | .\" |
| 139 | .SS Terminfo Names |
| 140 | .PP |
| 141 | In addition to the variables, \fB<term.h>\fP also defines a symbol for each |
| 142 | terminfo capability \fIlong name\fP. |
| 143 | These are in terms of the symbol \fBCUR\fP, |
| 144 | which is defined |
| 145 | .PP |
| 146 | .nf |
| 147 | .ft CW |
| 148 | #define CUR cur_term->type. |
| 149 | .fi |
| 150 | .ft R |
| 151 | .PP |
| 152 | These symbols provide a faster method of accessing terminfo capabilities |
| 153 | than using \fBtigetstr\fR(3X), etc. |
| 154 | .\" |
| 155 | .SH NOTES |
| 156 | The low-level terminfo interface is initialized using |
| 157 | .hy 0 |
| 158 | \fBsetupterm\fR(3X). |
| 159 | .hy |
| 160 | The upper-level curses interface uses the low-level terminfo interface, |
| 161 | internally. |
| 162 | .\" |
| 163 | .SH PORTABILITY |
| 164 | X/Open Curses does not describe any of these except for \fBcur_term\fP. |
| 165 | (The inclusion of \fBcur_term\fP appears to be an oversight, |
| 166 | since other comparable low-level information is omitted by X/Open). |
| 167 | .PP |
| 168 | Other implementations may have comparable variables. |
| 169 | Some implementations provide the variables in their libraries, |
| 170 | but omit them from the header files. |
| 171 | .PP |
| 172 | All implementations which provide terminfo interfaces add definitions |
| 173 | as described in the \fBTerminfo Names\fP section. |
| 174 | Most, but not all, base the definition upon the \fBcur_term\fP variable. |
| 175 | .SH SEE ALSO |
| 176 | .hy 0 |
| 177 | \fBcurses\fR(3X), |
| 178 | \fBcurs_terminfo\fR(3X), |
| 179 | \fBcurs_threads\fR(3X), |
| 180 | \fBterminfo\fR(\*n). |
| 181 | .hy |