]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - man/ncurses.3x
ncurses 6.4 - patch 20231007
[ncurses.git] / man / ncurses.3x
index ecb0170a18c2c475c87cca62622c621d654cf920..170b50c8833f119155545ebbbcb9ef76a5014738 100644 (file)
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: ncurses.3x,v 1.177 2023/09/30 21:38:11 tom Exp $
-.TH ncurses 3X 2023-09-30 "ncurses 6.4" "Library calls"
-.ie \n(.g .ds `` \(lq
-.el       .ds `` ``
-.ie \n(.g .ds '' \(rq
-.el       .ds '' ''
-.ie n .ds CW R
-.el   \{
-.ie \n(.g .ds CW CR
-.el       .ds CW CW
+.\" $Id: ncurses.3x,v 1.178 2023/10/07 22:17:08 tom Exp $
+.TH ncurses 3X 2023-10-07 "ncurses 6.4" "Library calls"
+.ie \n(.g \{\
+.ds `` \(lq
+.ds '' \(rq
+.\}
+.el \{\
+.ie t .ds `` ``
+.el   .ds `` ""
+.ie t .ds '' ''
+.el   .ds '' ""
 .\}
 .de bP
 .ie n  .IP \(bu 4
 .el    .IP \(bu 2
 ..
-.de NS
-.ie n  .sp
-.el    .sp .5
-.ie n  .in +4
-.el    .in +2
-.nf
-.ft \*(CW
-..
-.de NE
-.fi
-.ft R
-.ie n  .in -4
-.el    .in -2
-..
+.
 .ds n 5
 .ds d @TERMINFO@
 .SH NAME
 \fB\%ncurses\fP \-
 character-cell terminal interface with optimized output
 .SH SYNOPSIS
-\fB#include <curses.h>\fP
+.nf
+\fB#include <curses.h>
+.fi
 .SH DESCRIPTION
 The \fBncurses\fP library routines give the user a terminal-independent method
 of updating character screens with reasonable optimization.
@@ -106,9 +96,12 @@ and access to low-level terminal-manipulation routines.
 .SS Initialization
 The library uses the locale which the calling program has initialized.
 That is normally done with \fBsetlocale\fP(3):
-.NS
+.PP
+.RS 4
+.EX
 \fBsetlocale(LC_ALL, "");\fP
-.NE
+.EE
+.RE
 .PP
 If the locale is not initialized,
 the library assumes that characters are printable as in ISO\-8859\-1,
@@ -125,15 +118,21 @@ The routine \fBendwin\fP(3X) must be called before exiting.
 To get character-at-a-time input without echoing (most
 interactive, screen oriented programs want this), the following
 sequence should be used:
-.NS
+.PP
+.RS 4
+.EX
 \fBinitscr(); cbreak(); noecho();\fP
-.NE
+.EE
+.RE
 .PP
 Most programs would additionally use the sequence:
-.NS
+.PP
+.RS 4
+.EX
 \fBintrflush(stdscr, FALSE);\fP
 \fBkeypad(stdscr, TRUE);\fP
-.NE
+.EE
+.RE
 .PP
 Before a \fBcurses\fP program is run, the tab stops of the terminal
 should be set and its initialization strings, if defined, must be output.
@@ -203,21 +202,30 @@ If the environment variable \fBTERMINFO\fP is defined, any program using
 standard place.
 For example, if \fBTERM\fP is set to \fBatt4424\fP, then the
 compiled terminal definition is found in
-.NS
+.PP
+.RS 4
+.EX
 \fB\*d/a/att4424\fP.
-.NE
+.EE
+.RE
 .PP
 (The \fBa\fP is copied from the first letter of \fBatt4424\fP to avoid
 creation of huge directories.)  However, if \fBTERMINFO\fP is set to
 \fB$HOME/myterms\fP, \fBcurses\fP first checks
-.NS
+.PP
+.RS 4
+.EX
 \fB$HOME/myterms/a/att4424\fP,
-.NE
+.EE
+.RE
 .PP
 and if that fails, it then checks
-.NS
+.PP
+.RS 4
+.EX
 \fB\*d/a/att4424\fP.
-.NE
+.EE
+.RE
 .PP
 This is useful for developing experimental definitions or when write
 permission in \fB\*d\fP is not available.
@@ -894,10 +902,13 @@ does not create problems when compiling an application.
 .SS HOME
 Tells \fBncurses\fP where your home directory is.
 That is where it may read and write auxiliary terminal descriptions:
-.NS
+.PP
+.RS 4
+.EX
 $HOME/.termcap
 $HOME/.terminfo
-.NE
+.EE
+.RE
 .SS LINES
 Like COLUMNS, specify the height of the screen in characters.
 See COLUMNS for a detailed description.
@@ -906,13 +917,14 @@ This applies only to the OS/2 EMX port.
 It specifies the order of buttons on the mouse.
 OS/2 numbers a 3-button mouse inconsistently from other
 platforms:
-.NS
+.PP
+.RS 4
+.EX
 1 = left
-.br
 2 = right
-.br
 3 = middle.
-.NE
+.EE
+.RE
 .PP
 This variable lets you customize the mouse.
 The variable must be three numeric digits 1\-3 in any order, e.g., 123 or 321.
@@ -1040,20 +1052,18 @@ As an alternative to the environment variable,
 ncurses checks for an extended terminfo capability \fBU8\fP.
 This is a numeric capability which can be compiled using \fB@TIC@\ \-x\fP.
 For example
+.PP
 .RS 3
-.ft \*(CW
-.sp
-.nf
+.EX
 # linux console, if patched to provide working
-# VT100 shift-in/shift-out, with corresponding font.
-linux-vt100|linux console with VT100 line-graphics,
+# VT100 shift\-in/shift\-out, with corresponding font.
+linux\-vt100|linux console with VT100 line\-graphics,
         U8#0, use=linux,
-.sp
+
 # uxterm with vt100Graphics resource set to false
-xterm-utf8|xterm relying on UTF-8 line-graphics,
+xterm\-utf8|xterm relying on UTF\-8 line\-graphics,
         U8#1, use=xterm,
-.fi
-.ft R
+.EE
 .RE
 .PP
 The name \*(``U8\*('' is chosen to be two characters,
@@ -1112,40 +1122,53 @@ using subdirectories named by the first letter of the terminal names therein.
 This is the scheme used in System V, which legacy Unix systems use,
 and the \fBTERMINFO\fP variable is used by \fIcurses\fP applications on those
 systems to override the default location of the terminal database.
-.bP
+.IP \(bu 4
 If \fBncurses\fP is built to use hashed databases,
 then each entry in this list may be the path of a hashed database file, e.g.,
-.NS
+.RS 4
+.PP
+.RS 4
+.EX
 /usr/share/terminfo.db
-.NE
-.IP
+.EE
+.RE
+.PP
 rather than
-.NS
+.PP
+.RS 4
+.EX
 /usr/share/terminfo/
-.NE
-.IP
+.EE
+.RE
+.PP
 The hashed database uses less disk-space and is a little faster than the
 directory tree.
 However,
 some applications assume the existence of the directory tree,
 reading it directly
 rather than using the terminfo library calls.
+.RE
 .bP
 If \fBncurses\fP is built with a support for reading termcap files
 directly, then an entry in this list may be the path of a termcap file.
-.bP
+.IP \(bu 4
 If the \fBTERMINFO\fP variable begins with
 \*(``hex:\*('' or \*(``b64:\*('',
 \fBncurses\fP uses the remainder of that variable as a compiled terminal
 description.
 You might produce the base64 format using \fBinfocmp\fP(1M):
-.NS
-TERMINFO="$(infocmp -0 -Q2 -q)"
+.RS 4
+.PP
+.RS 4
+.EX
+TERMINFO="$(infocmp \-0 \-Q2 \-q)"
 export TERMINFO
-.NE
-.IP
+.EE
+.RE
+.PP
 The compiled description is used if it corresponds to the terminal identified
 by the \fBTERM\fP variable.
+.RE
 .PP
 Setting \fBTERMINFO\fP is the simplest,
 but not the only way to set location of the default terminal database.
@@ -1186,18 +1209,24 @@ semicolons on OS/2 EMX.
 .PP
 If the \fBTERMPATH\fP environment variable is not set,
 \fBncurses\fP looks in the files
-.NS
+.PP
+.RS 4
+.EX
 /etc/termcap, /usr/share/misc/termcap and $HOME/.termcap,
-.NE
+.EE
+.RE
 .PP
 in that order.
 .PP
 The library may be configured to disregard the following variables when the
 current user is the superuser (root), or if the application uses setuid or
 setgid permissions:
-.NS
+.PP
+.RS 4
+.EX
 $TERMINFO, $TERMINFO_DIRS, $TERMPATH, as well as $HOME.
-.NE
+.EE
+.RE
 .SH ALTERNATE CONFIGURATIONS
 Several different configurations are possible,
 depending on the configure script options used when building \fBncurses\fP.
@@ -1206,20 +1235,28 @@ developer using \fBncurses\fP:
 .TP 5
 \-\-disable\-overwrite
 The standard include for \fBncurses\fP is as noted in \fBSYNOPSIS\fP:
-.NS
+.RS 5
+.PP
+.RS 4
+.EX
 \fB#include <curses.h>\fP
-.NE
-.IP
+.EE
+.RE
+.PP
 This option is used to avoid filename conflicts when \fBncurses\fP
 is not the main implementation of curses of the computer.
 If \fBncurses\fP is installed disabling overwrite, it puts its headers in
 a subdirectory, e.g.,
-.NS
+.PP
+.RS 4
+.EX
 \fB#include <ncurses/curses.h>\fP
-.NE
-.IP
+.EE
+.RE
+.PP
 It also omits a symbolic link which would allow you to use \fB\-lcurses\fP
 to build executables.
+.RE
 .TP 5
 \-\-enable\-widec
 The configure script renames the library and
@@ -1227,20 +1264,26 @@ The configure script renames the library and
 puts the header files in a different subdirectory.
 All of the library names have a \*(``w\*('' appended to them,
 i.e., instead of
-.NS
+.RS 5
+.PP
+.RS 4
+.EX
 \fB\-lncurses\fP
-.NE
-.IP
+.EE
+.RE
+.PP
 you link with
-.NS
+.PP
+.RS 4
+.EX
 \fB\-lncursesw\fP
-.NE
-.IP
+.EE
+.RE
+.PP
 You must also enable the wide-character features in the header file
 when compiling for the wide-character library
 to use the extended (wide-character) functions.
 The symbol which enables these features has changed since XSI Curses, Issue 4:
-.RS
 .bP
 Originally, the wide-character feature required the symbol
 \fB_XOPEN_SOURCE_EXTENDED\fP
@@ -1257,17 +1300,17 @@ Alternatively, you can enable the feature by defining \fBNCURSES_WIDECHAR\fP
 with the caveat that some other header file than \fBcurses.h\fP
 may require a specific value for \fB_XOPEN_SOURCE\fP
 (or a system-specific symbol).
-.RE
-.IP
+.PP
 The \fBcurses.h\fP file which is installed for the wide-character
 library is designed to be compatible with the normal library's header.
 Only the size of the \fBWINDOW\fP structure differs, and very few
 applications require more than a pointer to \fBWINDOW\fPs.
-.IP
+.PP
 If the headers are installed allowing overwrite,
 the wide-character library's headers should be installed last,
 to allow applications to be built using either library
 from the same set of headers.
+.RE
 .TP 5
 \-\-with\-pthread
 The configure script renames the library.