Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1 | .\"*************************************************************************** |
| 2 | .\" Copyright (c) 2010,2013 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: curs_variables.3x,v 1.6 2013/12/21 18:41:32 tom Exp $ |
| 30 | .TH curs_variables 3X "" |
| 31 | .de bP |
| 32 | .IP \(bu 4 |
| 33 | .. |
| 34 | .ds n 5 |
| 35 | .na |
| 36 | .hy 0 |
| 37 | .SH NAME |
| 38 | \fBCOLORS\fR, |
| 39 | \fBCOLOR_PAIRS\fR, |
| 40 | \fBCOLS\fR, |
| 41 | \fBESCDELAY\fR, |
| 42 | \fBLINES\fR, |
| 43 | \fBTABSIZE\fR, |
| 44 | \fBcurscr\fR, |
| 45 | \fBnewscr\fR, |
| 46 | \fBstdscr\fR |
| 47 | \- \fBcurses\fR global variables |
| 48 | .ad |
| 49 | .hy |
| 50 | .SH SYNOPSIS |
| 51 | .nf |
| 52 | \fB#include <curses.h>\fR |
| 53 | .PP |
| 54 | \fBint COLOR_PAIRS;\fR |
| 55 | .br |
| 56 | \fBint COLORS;\fR |
| 57 | .br |
| 58 | \fBint COLS;\fR |
| 59 | .br |
| 60 | \fBint ESCDELAY;\fR |
| 61 | .br |
| 62 | \fBint LINES;\fR |
| 63 | .br |
| 64 | \fBint TABSIZE;\fR |
| 65 | .br |
| 66 | \fBWINDOW * curscr;\fR |
| 67 | .br |
| 68 | \fBWINDOW * newscr;\fR |
| 69 | .br |
| 70 | \fBWINDOW * stdscr;\fR |
| 71 | .fi |
| 72 | .SH DESCRIPTION |
| 73 | This page summarizes variables provided by the \fBcurses\fP library. |
| 74 | A more complete description is given in the \fBcurses\fP(3X) manual page. |
| 75 | .PP |
| 76 | Depending on the configuration, these may be actual variables, |
| 77 | or macros (see \fBcurs_threads\fR(3X) and \fBcurs_opaque\fR(3X)) |
| 78 | which provide read-only access to \fIcurses\fP's state. |
| 79 | In either case, applications should treat them as read-only to avoid |
| 80 | confusing the library. |
| 81 | .SS COLOR_PAIRS |
| 82 | After initializing curses, this variable contains the number of color pairs |
| 83 | which the terminal can support. |
| 84 | Usually the number of color pairs will be the product \fBCOLORS\fP*\fBCOLORS\fP, |
| 85 | however this is not always true: |
| 86 | .bP |
| 87 | a few terminals use HLS colors, which do not follow this rule |
| 88 | .bP |
| 89 | terminals supporting a large number of colors are limited by the number |
| 90 | of color pairs that can be represented in a \fIsigned short\fP value. |
| 91 | .SS COLORS |
| 92 | After initializing curses, this variable contains the number of colors |
| 93 | which the terminal can support. |
| 94 | .SS COLS |
| 95 | After initializing curses, this variable contains the width of the screen, |
| 96 | i.e., the number of columns. |
| 97 | .SS ESCDELAY |
| 98 | This variable holds the number of milliseconds to wait after reading an |
| 99 | escape character, |
| 100 | to distinguish between an individual escape character entered on the |
| 101 | keyboard from escape sequences sent by cursor- and function-keys |
| 102 | (see curses(3X). |
| 103 | .SS LINES |
| 104 | After initializing curses, this variable contains the height of the screen, |
| 105 | i.e., the number of lines. |
| 106 | .SS TABSIZE |
| 107 | This variable holds the number of columns used by the \fIcurses\fP library |
| 108 | when converting a tab character to spaces as it adds the tab to a window |
| 109 | (see curs_addch(3X). |
| 110 | .SS The Current Screen |
| 111 | This implementation of curses uses a special window \fBcurscr\fP to |
| 112 | record its updates to the terminal screen. |
| 113 | .SS The New Screen |
| 114 | This implementation of curses uses a special window \fBnewscr\fP to |
| 115 | hold updates to the terminal screen before applying them to \fBcurscr\fP. |
| 116 | .SS The Standard Screen |
| 117 | Upon initializing curses, |
| 118 | a default window called \fBstdscr\fP, |
| 119 | which is the size of the terminal screen, is created. |
| 120 | Many curses functions use this window. |
| 121 | .SH NOTES |
| 122 | The curses library is initialized using either \fBinitscr\fR(3X), |
| 123 | or \fBnewterm\fR(3X). |
| 124 | .PP |
| 125 | If \fBcurses\fP is configured to use separate curses/terminfo libraries, |
| 126 | most of these variables reside in the curses library. |
| 127 | .SH PORTABILITY |
| 128 | ESCDELAY and TABSIZE are extensions, |
| 129 | not provided in most other implementations of curses. |
| 130 | .SH SEE ALSO |
| 131 | \fBcurses\fR(3X), |
| 132 | \fBcurs_opaque\fR(3X), |
| 133 | \fBcurs_terminfo\fR(3X), |
| 134 | \fBcurs_threads\fR(3X), |
| 135 | \fBterm_variables\fR(3X), |
| 136 | \fBterminfo\fR(\*n). |