-one of type attr_t for the attributes and one of short for
-the color_pair number.
-The \fBvid_attr\fR and \fBvid_puts\fR routines
-are designed to use the attribute constants with the \fIWA_\fR prefix.
-The opts argument is reserved for future use.
-Currently, applications must provide a null pointer for that argument.
-.PP
-The \fBmvcur\fR routine provides low-level cursor motion. It takes
-effect immediately (rather than at the next refresh).
-.PP
-The \fBtigetflag\fR, \fBtigetnum\fR and \fBtigetstr\fR routines return
-the value of the capability corresponding to the \fBterminfo\fR
-\fIcapname\fR passed to them, such as \fBxenl\fR.
-.PP
-The \fBtigetflag\fR routine returns the value \fB-1\fR if
-\fIcapname\fR is not a boolean capability,
-or \fB0\fR if it is canceled or absent from the terminal description.
-.PP
-The \fBtigetnum\fR routine returns the value \fB-2\fR if
-\fIcapname\fR is not a numeric capability,
-or \fB-1\fR if it is canceled or absent from the terminal description.
-.PP
-The \fBtigetstr\fR routine returns the value \fB(char *)-1\fR
-if \fIcapname\fR is not a string capability,
-or \fB0\fR if it is canceled or absent from the terminal description.
-.PP
-The \fIcapname\fR for each capability is given in the table column entitled
-\fIcapname\fR code in the capabilities section of \fBterminfo\fR(\*n).
-
-\fBchar *boolnames\fR, \fB*boolcodes\fR, \fB*boolfnames\fR
-
-\fBchar *numnames\fR, \fB*numcodes\fR, \fB*numfnames\fR
-
-\fBchar *strnames\fR, \fB*strcodes\fR, \fB*strfnames\fR
-
-These null-terminated arrays contain the \fIcapnames\fR, the
-\fBtermcap\fR codes, and the full C names, for each of the
-\fBterminfo\fR variables.
+.bP
+\fIattrs\fP of type \fBattr_t\fP for the attributes and
+.bP
+\fIpair\fP of type \fBshort\fP for the color-pair number.
+.PP
+The \fBvid_attr\fP and \fBvid_puts\fP routines
+are designed to use the attribute constants with the \fBWA_\fP prefix.
+.PP
+X/Open Curses reserves the \fIopts\fP argument for future use,
+saying that applications must provide a null pointer for that argument.
+As an extension,
+this implementation allows \fIopts\fP to be used as a pointer to \fBint\fP,
+which overrides the \fIpair\fP (\fBshort\fP) argument.
+.PP
+The \fBmvcur\fP routine provides low-level cursor motion.
+It takes effect immediately (rather than at the next refresh).
+.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
+(see \fIHISTORY\fP).
+.\" ***************************************************************************
+.SS Terminal Capability Functions
+.PP
+The \fBtigetflag\fP, \fBtigetnum\fP and \fBtigetstr\fP routines return
+the value of the capability corresponding to the \fBterminfo\fP
+\fIcapname\fP passed to them, such as \fBxenl\fP.
+The \fIcapname\fP for each capability is given in the table column entitled
+\fIcapname\fP code in the capabilities section of \fBterminfo\fP(\*n).
+.PP
+These routines return special values to denote errors.
+.PP
+The \fBtigetflag\fP routine returns
+.TP
+\fB\-1\fP
+if \fIcapname\fP is not a boolean capability,
+or
+.TP
+\fB0\fP
+if it is canceled or absent from the terminal description.
+.PP
+The \fBtigetnum\fP routine returns
+.TP
+\fB\-2\fP
+if \fIcapname\fP is not a numeric capability, or
+.TP
+\fB\-1\fP
+if it is canceled or absent from the terminal description.
+.PP
+The \fBtigetstr\fP routine returns
+.TP
+\fB(char *)\-1\fP
+if \fIcapname\fP is not a string capability,
+or
+.TP
+\fB0\fP
+if it is canceled or absent from the terminal description.
+.\" ***************************************************************************
+.SS Terminal Capability Names
+.PP
+These null-terminated arrays contain
+.bP
+the short terminfo names (\*(``codes\*(''),
+.bP
+the \fBtermcap\fP names (\*(``names\*(''), and
+.bP
+the long terminfo names (\*(``fnames\*('')
+.PP
+for each of the predefined \fBterminfo\fP variables:
+.sp
+.RS
+\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
+.RE
+.\" ***************************************************************************
+.SS Releasing Memory
+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
+the memory will be freed.
+.PP
+The formatting functions \fBtparm\fP and \fBtiparm\fP extend the storage
+allocated by \fBsetupterm\fP:
+.bP
+the \*(``static\*('' terminfo variables [a-z].
+Before ncurses 6.3, those were shared by all screens.
+With ncurses 6.3, those are allocated per screen.
+See \fBterminfo\fP(\*n) for details.
+.bP
+to improve performance, ncurses 6.3 caches the result of analyzing terminfo
+strings for their parameter types.
+That is stored as a binary tree referenced from the \fBTERMINAL\fP structure.
+.PP
+The higher-level \fBinitscr\fP and \fBnewterm\fP functions use \fBsetupterm\fP.
+Normally they do not free this memory, but it is possible to do that using
+the \fBdelscreen\fP(3X) function.
+.\" ***************************************************************************