- which are not constrained to the size of the screen and whose contents
- need not be completely displayed. See <STRONG><A HREF="curs_pad.3x.html">curs_pad(3x)</A></STRONG> for more
- information.
-
- In addition to drawing characters on the screen, video attributes and
- colors may be supported, causing the characters to show up in such
- modes as underlined, in reverse video, or in color on terminals that
- support such display enhancements. Line drawing characters may be
- specified to be output. On input, <STRONG>curses</STRONG> is also able to translate
- arrow and function keys that transmit escape sequences into single
- values. The video attributes, line drawing characters, and input
- values use names, defined in <STRONG><curses.h></STRONG>, such as <STRONG>A_REVERSE</STRONG>, <STRONG>ACS_HLINE</STRONG>,
- and <STRONG>KEY_LEFT</STRONG>.
-
-
-</PRE><H3><a name="h3-Environment-variables">Environment variables</a></H3><PRE>
- If the environment variables <EM>LINES</EM> and <EM>COLUMNS</EM> are set, or if the
- program is executing in a window environment, line and column
- information in the environment will override information read by
- <EM>terminfo</EM>. This would affect a program running in an AT&T 630 layer,
- for example, where the size of a screen is changeable (see
- <STRONG>ENVIRONMENT</STRONG>).
-
- If the environment variable <EM>TERMINFO</EM> is defined, any program using
- <STRONG>curses</STRONG> checks for a local terminal definition before checking in the
- standard place. For example, if <EM>TERM</EM> is set to <STRONG>att4424</STRONG>, then the
- compiled terminal definition is found in
-
- <STRONG>/usr/share/terminfo/a/att4424</STRONG>.
-
- (The <STRONG>a</STRONG> is copied from the first letter of <STRONG>att4424</STRONG> to avoid creation of
- huge directories.) However, if <EM>TERMINFO</EM> is set to <STRONG>$HOME/myterms</STRONG>,
- <STRONG>curses</STRONG> first checks
-
- <STRONG>$HOME/myterms/a/att4424</STRONG>,
-
- and if that fails, it then checks
-
- <STRONG>/usr/share/terminfo/a/att4424</STRONG>.
-
- This is useful for developing experimental definitions or when write
- permission in <STRONG>/usr/share/terminfo</STRONG> is not available.
-
- The integer variables <STRONG>LINES</STRONG> and <STRONG>COLS</STRONG> are defined in <STRONG><curses.h></STRONG> and will
- be filled in by <STRONG>initscr</STRONG> with the size of the screen. The constants
- <STRONG>TRUE</STRONG> and <STRONG>FALSE</STRONG> have the values <STRONG>1</STRONG> and <STRONG>0</STRONG>, respectively.
-
- The <STRONG>curses</STRONG> routines also define the <STRONG>WINDOW</STRONG> <STRONG>*</STRONG> variable <STRONG>curscr</STRONG> which is
- used for certain low-level operations like clearing and redrawing a
- screen containing garbage. The <STRONG>curscr</STRONG> can be used in only a few
- routines.
-
-
-</PRE><H3><a name="h3-Routine-and-Argument-Names">Routine and Argument Names</a></H3><PRE>
- Many <STRONG>curses</STRONG> routines have two or more versions. The routines prefixed
- with <EM>w</EM> require a window argument. The routines prefixed with <EM>p</EM> require
- a pad argument. Those without a prefix generally use <STRONG>stdscr</STRONG>.
-
- The routines prefixed with <STRONG>mv</STRONG> require a <EM>y</EM> and <EM>x</EM> coordinate to move to
- before performing the appropriate action. The <STRONG>mv</STRONG> routines imply a call
- to <STRONG>move</STRONG> before the call to the other routine. The coordinate <EM>y</EM> always
- refers to the row (of the window), and <EM>x</EM> always refers to the column.
- The upper left-hand corner is always (0,0), not (1,1).
-
- The routines prefixed with <STRONG>mvw</STRONG> take both a window argument and <EM>x</EM> and <EM>y</EM>
- coordinates. The window argument is always specified before the
- coordinates.
-
- In each case, <EM>win</EM> is the window affected, and <EM>pad</EM> is the pad affected;
- <EM>win</EM> and <EM>pad</EM> are always pointers to type <STRONG>WINDOW</STRONG>.
-
- Option setting routines require a Boolean flag <EM>bf</EM> with the value <STRONG>TRUE</STRONG>
- or <STRONG>FALSE</STRONG>; <EM>bf</EM> is always of type <STRONG>bool</STRONG>. Most of the data types used in
- the library routines, such as <STRONG>WINDOW</STRONG>, <STRONG>SCREEN</STRONG>, <STRONG>bool</STRONG>, and <STRONG>chtype</STRONG> are
- defined in <STRONG><curses.h></STRONG>. Types used for the terminfo routines such as
- <STRONG>TERMINAL</STRONG> are defined in <STRONG><term.h></STRONG>.
-
- This manual page describes functions which may appear in any
- configuration of the library. There are two common configurations of
- the library:
-
- <EM>ncurses</EM>
- the "normal" library, which handles 8-bit characters. The
- normal (8-bit) library stores characters combined with
- attributes in <STRONG>chtype</STRONG> data.
-
- Attributes alone (no corresponding character) may be stored in
- <STRONG>chtype</STRONG> or the equivalent <STRONG>attr_t</STRONG> data. In either case, the data
- is stored in something like an integer.
-
- Each cell (row and column) in a <STRONG>WINDOW</STRONG> is stored as a <STRONG>chtype</STRONG>.
-
- <EM>ncursesw</EM>
- the so-called "wide" library, which handles multibyte
- characters (see the section on <STRONG>ALTERNATE</STRONG> <STRONG>CONFIGURATIONS</STRONG>). The
- "wide" library includes all of the calls from the "normal"
- library. It adds about one third more calls using data types
- which store multibyte characters:
-
- <STRONG>cchar_t</STRONG>
- corresponds to <STRONG>chtype</STRONG>. However it is a structure, because
- more data is stored than can fit into an integer. The
- characters are large enough to require a full integer
- value - and there may be more than one character per cell.
- The video attributes and color are stored in separate
- fields of the structure.
-
- Each cell (row and column) in a <STRONG>WINDOW</STRONG> is stored as a
- <STRONG>cchar_t</STRONG>.
-
- The <STRONG><A HREF="curs_getcchar.3x.html">setcchar(3x)</A></STRONG> and <STRONG><A HREF="curs_getcchar.3x.html">getcchar(3x)</A></STRONG> functions store and
- retrieve the data from a <STRONG>cchar_t</STRONG> structure.
-
- <STRONG>wchar_t</STRONG>
- stores a "wide" character. Like <STRONG>chtype</STRONG>, this may be an
- integer.
-
- <STRONG>wint_t</STRONG>
- stores a <STRONG>wchar_t</STRONG> or <STRONG>WEOF</STRONG> - not the same, though both may
- have the same size.
-
- The "wide" library provides new functions which are analogous
- to functions in the "normal" library. There is a naming
- convention which relates many of the normal/wide variants: a
- "_w" is inserted into the name. For example, <STRONG>waddch</STRONG> becomes
- <STRONG>wadd_wch</STRONG>.
-
-
-</PRE><H3><a name="h3-Routine-Name-Index">Routine Name Index</a></H3><PRE>
- The following table lists the <STRONG>curses</STRONG> routines provided in the "normal"
- and "wide" libraries and the names of the manual pages on which they
- are described. Routines flagged with "*" are ncurses-specific, not
- described by XPG4 or present in SVr4.
-
- <STRONG>curses</STRONG> Routine Name Manual Page Name
+ that are not constrained to the size of the terminal screen and whose
+ contents need not be completely displayed. See <STRONG><A HREF="curs_pad.3x.html">curs_pad(3x)</A></STRONG>.
+
+ In addition to drawing characters on the screen, rendering attributes
+ and colors may be supported, causing the characters to show up in such
+ modes as underlined, in reverse video, or in color on terminals that
+ support such display enhancements. See <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>.
+
+ <EM>curses</EM> predefines symbols for a small set of line graphics characters,
+ corresponding to the VT100 line drawing set. See <STRONG><A HREF="curs_addch.3x.html">waddch(3x)</A></STRONG> and
+ <STRONG><A HREF="curs_add_wch.3x.html">wadd_wch(3x)</A></STRONG>.
+
+ <EM>curses</EM> is implemented using the operating system's terminal driver;
+ keystroke events are not received as scan codes but as byte sequences.
+ Graphical keycaps (alphanumeric and punctuation keys, and the space)
+ appear as-is. Everything else, including the tab, enter/return,
+ keypad, arrow, and function keys, appears as a control character or a
+ multibyte <EM>escape</EM> <EM>sequence.</EM> <EM>curses</EM> translates these into unique <EM>key</EM>
+ <EM>codes.</EM> See <STRONG><A HREF="curs_getch.3x.html">getch(3x)</A></STRONG>.
+
+
+</PRE><H3><a name="h3-Effects-of-GUIs-and-Environment-Variables">Effects of GUIs and Environment Variables</a></H3><PRE>
+ The selection of an approprate value of <EM>TERM</EM> in the process environment
+ is essential to correct <EM>curses</EM> and <EM>terminfo</EM> library operation. A well-
+ configured system selects a correct <EM>TERM</EM> value automatically; <STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>
+ may assist with troubleshooting exotic situations.
+
+ If the environment variables <EM>LINES</EM> and <EM>COLUMNS</EM> are set, or if the
+ <EM>curses</EM> program is executing in a graphical windowing environment, the
+ information obtained thence overrides that obtained by <EM>terminfo</EM>. An
+ <EM>ncurses</EM> extension supports resizable terminals; see <STRONG><A HREF="wresize.3x.html">wresize(3x)</A></STRONG>.
+
+ If the environment variable <EM>TERMINFO</EM> is defined, a <EM>curses</EM> program
+ checks first for a terminal type description in the location it
+ identifies. <EM>TERMINFO</EM> is useful for developing experimental type
+ descriptions or when write permission to <EM>/usr/share/terminfo</EM> is not
+ available.
+
+ See section "ENVIRONMENT" below.
+
+
+</PRE><H3><a name="h3-Naming-Conventions">Naming Conventions</a></H3><PRE>
+ Many <EM>curses</EM> functions have two or more versions. Those prefixed with
+ "w" require a window argument. Four functions prefixed with "p"
+ require a pad argument. Those without a prefix generally operate on
+ <STRONG>stdscr</STRONG>.
+
+ In function synopses, <EM>ncurses</EM> man pages apply the following names to
+ parameters.
+
+ <EM>bf</EM> <EM>bool</EM> (<STRONG>TRUE</STRONG> or <STRONG>FALSE</STRONG>)
+ <EM>win</EM> pointer to <EM>WINDOW</EM>
+ <EM>pad</EM> pointer to <EM>WINDOW</EM> that is a pad
+
+
+</PRE><H3><a name="h3-Wide-and-Non-wide-Character-Configurations">Wide and Non-wide Character Configurations</a></H3><PRE>
+ This manual page describes functions that appear in any configuration
+ of the library. There are two common configurations; see section
+ "ALTERNATE CONFIGURATIONS" below.
+
+ <EM>ncurses</EM> is the library in its "non-wide" configuration, handling only
+ eight-bit characters. It stores a character combined with
+ attributes in a <EM>chtype</EM> datum.
+
+ Attributes alone (with no corresponding character) can be
+ stored in variables of <EM>chtype</EM> or <EM>attr</EM><STRONG>_</STRONG><EM>t</EM> type. In either
+ case, they are represented as an integral bit mask.
+
+ Each cell of a <EM>WINDOW</EM> is stored as a <EM>chtype.</EM>
+
+ <EM>ncursesw</EM> is the library in its "wide" configuration, which handles
+ character encodings requiring a larger data type than <EM>char</EM> (a
+ byte-sized type) can represent. It adds about one third more
+ calls using additional data types that can store such
+ <EM>multibyte</EM> characters.
+
+ <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> corresponds to the non-wide configuration's <EM>chtype.</EM>
+ It always a structure type, because it stores more
+ data than can fit into an integer. A character code
+ may be larger than can fit in a C <EM>char,</EM> and moreover
+ more than one character may occupy a cell (as with
+ accent marks and other diacritics). Each character
+ is of type <EM>wchar</EM><STRONG>_</STRONG><EM>t;</EM> a complex character contains one
+ spacing character and zero or more non-spacing
+ characters (see below). Attributes and color data
+ are stored in separate fields of the structure, not
+ combined as in <EM>chtype.</EM>
+
+ Each cell (row and column) <EM>WINDOW</EM> is stored as a
+ <EM>cchar</EM><STRONG>_</STRONG><EM>t.</EM>
+
+ The <STRONG><A HREF="curs_getcchar.3x.html">setcchar(3x)</A></STRONG> and <STRONG><A HREF="curs_getcchar.3x.html">getcchar(3x)</A></STRONG> functions store and
+ retrieve the data from a <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> structure. The wide library
+ API of <EM>ncurses</EM> depends on two data types standardized by ISO
+ C95.
+
+ <EM>wchar</EM><STRONG>_</STRONG><EM>t</EM> stores a wide character. Like <EM>chtype,</EM> this may be
+ an integer. Depending on the character encoding, a
+ wide character may be <EM>spacing,</EM> meaning that it
+ occupies a character cell by itself and typically
+ accompanies cursor advancement on input, or
+ <EM>combining,</EM> meaning that it occupies the same cell as
+ a spacing character, is often regarded as a
+ "modifier" of the base glyph with which it combines,
+ and typically does not advance the cursor on input.
+
+ <EM>wint</EM><STRONG>_</STRONG><EM>t</EM> can store a <EM>wchar</EM><STRONG>_</STRONG><EM>t</EM> or the constant <STRONG>WEOF</STRONG>,
+ analogously to the <EM>int</EM>-sized character manipulation
+ functions of ISO C and their constant <STRONG>EOF</STRONG>.
+
+ The wide library provides additional functions that
+ complement those in the non-wide library where the size of
+ the underlying character type is significant. A somewhat
+ regular naming convention relates many of the wide variants
+ to their non-wide counterparts; where a non-wide function
+ name contains "ch" or "str", prefix it with "_w" to obtain
+ the wide counterpart. For example, <STRONG>waddch</STRONG> becomes <STRONG>wadd_wch</STRONG>.
+
+ This convention is inapplicable to some non-wide function
+ names, so other transformations are used for the wide
+ configuration: in the window background management functions,
+ "bkgd" becomes "bkgrnd"; the window border-drawing and
+ -clearing functions are suffixed with "_set".
+
+
+</PRE><H3><a name="h3-Function-Name-Index">Function Name Index</a></H3><PRE>
+ The following table lists the <EM>curses</EM> functions provided in the non-wide
+ and wide APIs and the corresponding man pages that describe them.
+ Those flagged with "*" are <EM>ncurses</EM>-specific, neither described by
+ X/Open Curses nor present in SVr4.
+
+ <STRONG><EM>curses</EM></STRONG> Function Name Man Page