Copyright 2018-2023,2024 Thomas E. Dickey *
Copyright 2010-2015,2017 Free Software Foundation, Inc. *
*
Permission is hereby granted, free of charge, to any person obtaining a *
copy of this software and associated documentation files (the *
"Software"), to deal in the Software without restriction, including *
without limitation the rights to use, copy, modify, merge, publish, *
distribute, distribute with modifications, sublicense, and/or sell *
copies of the Software, and to permit persons to whom the Software is *
furnished to do so, subject to the following conditions: *
*
The above copyright notice and this permission notice shall be included *
in all copies or substantial portions of the Software. *
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
*
Except as contained in this notice, the name(s) of the above copyright *
holders shall not be used in advertising or otherwise to promote the *
sale, use or other dealings in this Software without prior written *
authorization. *
***************************************************************************
$Id: curs_variables.3x,v 1.47 2024/04/13 22:37:35 tom Exp $
#include <curses.h>/* data types */ typedef /* .\|.\|. */ bool; typedef /* .\|.\|. */ chtype; typedef /* .\|.\|. */ cchar_t; typedef /* .\|.\|. */ attr_t; typedef /* .\|.\|. */ SCREEN; typedef /* .\|.\|. */ WINDOW;
/* constants */ const bool TRUE; const bool FALSE;
const /* .\|.\|. */ ERR; const /* .\|.\|. */ OK;
/* variables */ int COLORS; int COLOR_PAIRS; int COLS; int LINES; WINDOW * curscr; WINDOW * stdscr;
/* extensions */ int ESCDELAY; int TABSIZE; WINDOW * newscr;
Depending on \%ncurses's build-time configuration, the variables may instead be macros (see \%curs_threads(3X) and \%curs_opaque(3X)) that provide read-only access to the library's state. In either case, applications should treat them as read-only to avoid confusing the library.
\%ncurses' configure script attempts to discover the data type used by the system's C and C++ compilers, to reuse for the curses bool.
\%ncurses collects pending updates to the terminal screen in a window named \%newscr. This object is referred to as the \*(``virtual screen\*('' in the \%curs_kernel(3X), \%curs_refresh(3X), and \%curs_outopts(3X). When the screen is refreshed, curses determines a minimal set of updates using the terminal's capabilities to make \%curscr look like \%newscr.
Once curses is initialized, it creates a window named \%stdscr. It is the same size as the terminal screen and is the default window used by routines that do not take a parameter identifying one. Many curses functions use this window.
If \%keypad(3X) is disabled for the curses window receiving input, a program must disambiguate escape sequences itself.
If \%ncurses is configured to provide separate curses and \%tinfo libraries, most of these variables reside in the former.
X/Open Curses describes \%curscr only as \*(``an internal data
structure\*('';
SVr4 gave more details,
noting its use \*(``for certain low-level operations like clearing and
redrawing a screen containing garbage\*(''.
SVID 4, Volume 3, p. 408
Neither specified its interaction with the rest of the interface beyond
use as an argument to \%clearok(3X) and \%wrefresh(3X).
\%newscr is a feature of SVr4 curses. When refreshing the screen, it is used as a working area for combining the standard window \%stdscr with any others the application may have created with \%newwin(3X). When the update of \%newscr is complete, curses modifies \%curscr to match \%newscr.
\%TABSIZE is a feature of SVr4 curses. .bP SVr4 initially sets \%TABSIZE from the terminal description's \%init_tabs capability. After that, it can be altered by applications using SVr4 curses. .bP SVr4 curses uses the value of \%TABSIZE to compute the position of tab stops when updating both the virtual screen with \%addch(3X) and the physical screen with \%mvcur(3X). .bP \%ncurses uses the value of \%TABSIZE only to update the virtual screen. It uses the terminal description's \*(``it\*('' (\%init_tabs) capability for computing hardware tabs (that is, tab stops on the physical screen). .bP Other implementations differ. For instance, NetBSD curses allows \%TABSIZE to be set through an environment variable. \%ncurses does not.
NetBSD curses does not support hardware tabs; it uses the \%init_tabs capability and the \%TABSIZE variable only for updating the virtual screen.\%ESCDELAY is a feature of AIX curses. .bP In AIX, the units for \%ESCDELAY are fifths of milliseconds. .bP The default value for AIX's \%ESCDELAY equals 0.1 seconds. .bP AIX also enforces a limit of 10,000 seconds for \%ESCDELAY; \%ncurses does not enforce any upper limit.
\%ncurses has long used \%ESCDELAY with units of milliseconds, making it impossible to be completely compatible with AIX. Consequently, most users have decided either to override the value, or to rely upon its default.
[UAX #29] \*(``Unicode Standard Annex #29: Unicode Text Segmentation\*(''; \%<https://\*:unicode\*:.org/\*:reports/\*:tr29/>