]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - man/curs_terminfo.3x
ncurses 6.4 - patch 20230923
[ncurses.git] / man / curs_terminfo.3x
index bd418951454c91881acd26a07e59534e731a4e43..90aef061a51d897a8c051e9e78c497db2ee3743a 100644 (file)
@@ -28,8 +28,8 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_terminfo.3x,v 1.99 2023/09/16 23:37:03 tom Exp $
-.TH curs_terminfo 3X 2023-09-16 "ncurses 6.4" "Library calls"
+.\" $Id: curs_terminfo.3x,v 1.108 2023/09/23 23:38:10 tom Exp $
+.TH curs_terminfo 3X 2023-09-23 "ncurses 6.4" "Library calls"
 .ie \n(.g .ds `` \(lq
 .el       .ds `` ``
 .ie \n(.g .ds '' \(rq
@@ -63,9 +63,9 @@
 .nf
 \fB#include <curses.h>\fP
 \fB#include <term.h>\fP
-.sp
+.PP
 \fBTERMINAL *cur_term;\fP
-.sp
+.PP
 \fBconst char * const boolnames[];\fP
 \fBconst char * const boolcodes[];\fP
 \fBconst char * const boolfnames[];\fP
 \fBconst char * const strnames[];\fP
 \fBconst char * const strcodes[];\fP
 \fBconst char * const strfnames[];\fP
-.sp
+.PP
 \fBint setupterm(const char *\fIterm\fB, int \fIfiledes\fB, int *\fIerrret\fB);\fR
-.br
 \fBTERMINAL *set_curterm(TERMINAL *\fInterm\fB);\fR
-.br
 \fBint del_curterm(TERMINAL *\fIoterm\fB);\fR
-.br
 \fBint restartterm(const char *\fIterm\fB, int \fIfiledes\fB, int *\fIerrret\fB);\fR
-.sp
+.PP
 \fBchar *tparm(const char *\fIstr\fB, ...);\fR
-.br
        \fIor\fP
-.br
 \fBchar *tparm(const char *\fIstr\fB, long \fIp1 ... \fBlong \fIp9\fB);\fR
-.sp
+.PP
 \fBint tputs(const char *\fIstr\fB, int \fIaffcnt\fB, int (*\fIputc\fB)(int));\fR
-.br
 \fBint putp(const char *\fIstr\fB);\fR
-.sp
+.PP
 \fBint vidputs(chtype \fIattrs\fB, int (*\fIputc\fB)(int));\fR
-.br
 \fBint vidattr(chtype \fIattrs\fB);\fR
-.br
 \fBint vid_puts(attr_t \fIattrs\fB, short \fIpair\fB, void *\fIopts\fB, int (*\fIputc\fB)(int));\fR
-.br
 \fBint vid_attr(attr_t \fIattrs\fB, short \fIpair\fB, void *\fIopts\fB);\fR
-.sp
+.PP
 \fBint mvcur(int \fIoldrow\fB, int \fIoldcol\fB, int \fInewrow\fR, int \fInewcol\fB);\fR
-.sp
+.PP
 \fBint tigetflag(const char *\fIcapname\fB);\fR
-.br
 \fBint tigetnum(const char *\fIcapname\fB);\fR
-.br
 \fBchar *tigetstr(const char *\fIcapname\fB);\fR
-.sp
+.PP
 \fBchar *tiparm(const char *\fIstr\fB, ...);\fR
-.sp
-/* extensions */
-.br
+.PP
+\fI/* extensions */\fP
 \fBchar *tiparm_s(int \fIexpected\fB, int \fImask\fB, const char *\fIstr\fB, ...);\fR
-.br
 \fBint tiscan_s(int *\fIexpected\fB, int *\fImask\fB, const char *\fIstr\fB);\fR
-.br
 .fi
 .SH DESCRIPTION
 These low-level routines must be called by programs that have to deal
-directly with the \fBterminfo\fP database to handle certain terminal
+directly with the \fIterminfo\fP database to handle certain terminal
 capabilities, such as programming function keys.
 For all other
-functionality, \fBcurses\fP routines are more suitable and their use is
+functionality, \fIcurses\fP routines are more suitable and their use is
 recommended.
 .PP
 None of these functions use (or are aware of) multibyte character strings
@@ -219,30 +205,30 @@ If \fBERR\fP is returned, examine \fIerrret\fP:
 .RS
 .TP 5
 .B 1
-means that the terminal is hardcopy, cannot be used for curses applications.
+means that the terminal is hardcopy, cannot be used for \fIcurses\fP applications.
 .IP
-\fBsetupterm\fP determines if the entry is a hardcopy type by
+\fB\%setupterm\fP determines if the entry is a hardcopy type by
 checking the \fBhc\fP (\fBhardcopy\fP) capability.
 .TP 5
 .B 0
 means that the terminal could not be found,
 or that it is a generic type,
-having too little information for curses applications to run.
+having too little information for \fIcurses\fP applications to run.
 .IP
-\fBsetupterm\fP determines if the entry is a generic type by
-checking the \fBgn\fP (\fBgeneric_type\fP) capability.
+\fB\%setupterm\fP determines if the entry is a generic type by
+checking the \fBgn\fP (\fB\%generic_type\fP) capability.
 .TP 5
 .B \-1
-means that the \fBterminfo\fP database could not be found.
+means that the \fIterminfo\fP database could not be found.
 .RE
 .IP
 If \fIerrret\fP is
-null, \fBsetupterm\fP prints an error message upon finding an error
+null, \fB\%setupterm\fP prints an error message upon finding an error
 and exits.
 Thus, the simplest call is:
-.sp
-      \fBsetupterm((char *)0, 1, (int *)0);\fP,
-.sp
+.IP
+\fBsetupterm((char *)0, 1, (int *)0);\fP,
+.PP
 which uses all the defaults and sends the output to \fBstdout\fP.
 .RE
 .\" ***************************************************************************
@@ -380,7 +366,7 @@ the output stream parameter of \fBnewterm\fP(3X).
 .PP
 While \fBputp\fP and \fBmvcur\fP are low-level functions which
 do not use the high-level curses state,
-they are declared in \fB<curses.h>\fP because SystemV did this
+they are declared in \fB\%<curses.h>\fP because System\ V did this
 (see \fIHISTORY\fP).
 .\" ***************************************************************************
 .SS Terminal Capability Functions
@@ -421,20 +407,20 @@ if it is canceled or absent from the terminal description.
 .SS Terminal Capability Names
 These null-terminated arrays contain
 .bP
-the short terminfo names (\*(``codes\*(''),
+the short \fIterminfo\fP names (\*(``codes\*(''),
 .bP
-the \fBtermcap\fP names (\*(``names\*(''), and
+the \fItermcap\fP names (\*(``names\*(''), and
 .bP
-the long terminfo names (\*(``fnames\*('')
+the long \fIterminfo\fP names (\*(``fnames\*('')
+.PP
+for each of the predefined \fIterminfo\fP variables:
 .PP
-for each of the predefined \fBterminfo\fP variables:
-.sp
 .RS
+.nf
 \fBconst char *boolnames[]\fP, \fB*boolcodes[]\fP, \fB*boolfnames[]\fP
-.br
 \fBconst char *numnames[]\fP, \fB*numcodes[]\fP, \fB*numfnames[]\fP
-.br
 \fBconst char *strnames[]\fP, \fB*strcodes[]\fP, \fB*strfnames[]\fP
+.fi
 .RE
 .\" ***************************************************************************
 .SS Releasing Memory
@@ -442,9 +428,9 @@ Each successful call to \fBsetupterm\fP allocates memory to hold the terminal
 description.
 As a side-effect, it sets \fBcur_term\fP to point to this memory.
 If an application calls
-.sp
-        \fBdel_curterm(cur_term);\fP
-.sp
+.IP
+\fBdel_curterm(cur_term);\fP
+.PP
 the memory will be freed.
 .PP
 The formatting functions \fBtparm\fP and \fBtiparm\fP extend the storage
@@ -520,10 +506,10 @@ In SVr4, those are found in \fB<curses.h>\fP,
 but except for \fBsetterm\fP, are likewise macros.
 The one function, \fBsetterm\fP, is mentioned in the manual page.
 The manual page notes that the \fBsetterm\fP routine
-was replaced by \fBsetupterm\fP, stating that the call:
-.sp
-      \fBsetupterm(\fIterm\fB, 1, (int *)0)\fR
-.sp
+was replaced by \fB\%setupterm\fP, stating that the call
+.IP
+\fBsetupterm(\fIterm\fB, 1, (int *)0)\fR
+.PP
 provides the same functionality as \fBsetterm(\fIterm\fB)\fR,
 and is not recommended for new programs.
 This implementation provides each of those symbols
@@ -531,11 +517,12 @@ as macros for BSD compatibility,
 .\" ***************************************************************************
 .SH HISTORY
 SVr2 introduced the terminfo feature.
-Its programming manual mentioned these low-level functions:
+Its programming manual mentioned the following low-level functions.
 .PP
 .TS
-l l.
-\fBFunction\fP \fBDescription\fP
+lB lB
+lB lx.
+Function       Description
 _
 fixterm        restore tty to \*(``in curses\*('' state
 gettmode       establish current tty modes
@@ -558,15 +545,15 @@ T}
 .TE
 .PP
 The programming manual also mentioned
-functions provided for termcap compatibility
-(commenting that they \*(``may go away at a later date\*(''):
+functions provided for \fItermcap\fP compatibility
+(commenting that they \*(``may go away at a later date\*('').
 .PP
 .TS
-l l
-_ _
-l l.
-\fBFunction\fP \fBDescription\fP
-tgetent        look up termcap entry for given \fIname\fP
+lB lB
+lB lx.
+Function       Description
+_
+tgetent        look up \fItermcap\fP entry for given \fIname\fP
 tgetflag       get boolean entry for given \fIid\fP
 tgetnum        get numeric entry for given \fIid\fP
 tgetstr        get string entry for given \fIid\fP
@@ -581,29 +568,30 @@ Early terminfo programs obtained capability values from the
 .PP
 SVr3 extended terminfo by adding functions to retrieve capability values
 (like the termcap interface),
-and reusing tgoto and tputs:
+and reusing \fBtgoto\fP and \fBtputs\fP:
 .PP
 .TS
-l l
-_ _
-l l.
-\fBFunction\fP \fBDescription\fP
+lB lB
+lB lx.
+Function       Description
+_
 tigetflag      get boolean entry for given \fIid\fP
 tigetnum       get numeric entry for given \fIid\fP
 tigetstr       get string entry for given \fIid\fP
 .TE
 .PP
-SVr3 also replaced several of the SVr2 terminfo functions
-which had no counterpart in the termcap interface,
-documenting them as obsolete:
+SVr3 also replaced several of the SVr2 \fIterminfo\fP functions
+which had no counterpart in the \fItermcap\fP interface,
+documenting them as obsolete.
+.PP
 .TS
-l l
-_ _
-l l.
-\fBFunction\fP \fBReplaced by\fP
+lB lB
+l  lx.
+Function       Replaced by
+_
 crmode cbreak
 fixterm        reset_prog_mode
-gettmode       N/A
+gettmode       \fIn/a\fP
 nocrmode       nocbreak
 resetterm      reset_shell_mode
 saveterm       def_prog_mode
@@ -629,7 +617,7 @@ though the variables were provided in SVr2.
 .PP
 SVr4 added the \fBvid_attr\fP and \fBvid_puts\fP functions.
 .PP
-There are other low-level functions declared in the curses header files
+There are other low-level functions declared in the \fIcurses\fP header files
 on Unix systems,
 but none were documented.
 The functions marked \*(``obsolete\*('' remained in use
@@ -686,7 +674,7 @@ On the other hand, \fIwritable strings\fP are an obsolescent feature.
 .IP
 As an extension, this implementation can be configured to change the
 function prototypes to use the \fBconst\fP keyword.
-The ncurses ABI 6 enables this feature by default.
+The \fIncurses\fP ABI 6 enables this feature by default.
 .bP
 X/Open Curses prototypes \fBtparm\fP with a fixed number of parameters,
 rather than a variable argument list.