-.DT
-.nf
-.ta .5i 1.5i
- \s-1%% outputs `%'
- %\fI[[\fP:\fI]flags][width[.precision]][\fPdoxXs\fI]\fP
- as in \fBprintf\fP, flags are [-+#] and space
- %c print pop() gives %c
-
- %p[1-9] push \fIi\fP'th parm
- %P[a-z] set dynamic variable [a-z] to pop()
- %g[a-z] get dynamic variable [a-z] and push it
- %P[A-Z] set static variable [a-z] to pop()
- %g[A-Z] get static variable [a-z] and push it
- %'\fIc\fP' char constant \fIc\fP
- %{\fInn\fP} integer constant \fInn\fP
- %l push strlen(pop)
-
- %+ %- %* %/ %m
- arithmetic (%m is mod): push(pop() op pop())
- %& %| %^ bit operations: push(pop() op pop())
- %= %> %< logical operations: push(pop() op pop())
- %A, %O logical and & or operations (for conditionals)
- %! %~ unary operations push(op pop())
- %i add 1 to first two parms (for ANSI terminals)
-
- %? expr %t thenpart %e elsepart %;
- if-then-else, %e elsepart is optional.
- else-if's are possible a la Algol 68:
- %? c\d1\u %t b\d1\u %e c\d2\u %t b\d2\u %e c\d3\u %t b\d3\u %e c\d4\u %t b\d4\u %e %;
-\s+1 c\di\u are conditions, b\di\u are bodies.
-.fi
+.TP 5
+\fB%%\fP
+outputs \*(``%\*(''
+.TP
+\fB%\fP\fI[[\fP:\fI]flags][width[.precision]][\fP\fBdoxXs\fP\fI]\fP
+as in \fBprintf\fP(3), flags are \fI[\-+#]\fP and \fIspace\fP.
+Use a \*(``:\*('' to allow the next character to be a \*(``\-\*('' flag,
+avoiding interpreting \*(``%\-\*('' as an operator.
+.TP
+\f(CW%c\fP
+print \fIpop()\fP like %c in \fBprintf\fP
+.TP
+\fB%s\fP
+print \fIpop()\fP like %s in \fBprintf\fP
+.TP
+\fB%p\fP\fI[1\-9]\fP
+push \fIi\fP'th parameter
+.TP
+\fB%P\fP\fI[a\-z]\fP
+set dynamic variable \fI[a\-z]\fP to \fIpop()\fP
+.TP
+\fB%g\fP\fI[a\-z]/\fP
+get dynamic variable \fI[a\-z]\fP and push it
+.TP
+\fB%P\fP\fI[A\-Z]\fP
+set static variable \fI[a\-z]\fP to \fIpop()\fP
+.TP
+\fB%g\fP\fI[A\-Z]\fP
+get static variable \fI[a\-z]\fP and push it
+.IP
+The terms \*(``static\*('' and \*(``dynamic\*('' are misleading.
+Historically, these are simply two different sets of variables,
+whose values are not reset between calls to \fBtparm\fP(3X).
+However, that fact is not documented in other implementations.
+Relying on it will adversely impact portability to other implementations:
+.RS
+.bP
+SVr4 curses stores the \fIstatic\fP variables in the \fBTERMINAL\fP
+structure (declared in \fBterm.h\fP), and the \fIdynamic variables\fP
+on the stack in the \fBtparm\fP function.
+The former are zeroed automatically when the \fBsetupterm\fP function
+allocates the data.
+The latter are set only by a \fB%P\fP operator.
+A \fB%g\fP for a given variable without first setting it with \fB%P\fP
+will give unpredictable results.
+.bP
+Solaris XPG4 curses does not distinguish between \fIdynamic\fP and
+\fIstatic\fP variables.
+They are the same.
+Like SVr4 curses, XPG4 curses does not initialize these explicitly.
+.bP
+Before version 6.3, ncurses stores both \fIdynamic\fP and \fIstatic\fP
+variables in persistent storage, initialized to zeros.
+.bP
+Beginning with version 6.3, ncurses stores \fIstatic\fP and \fIdynamic\fP
+variables in the same manner as SVr4.
+Unlike other implementations, ncurses zeros dynamic variables
+before the first \fB%g\fP or \fB%P\fP operator.
+.RE
+.TP
+\fB%'\fP\fIc\fP\fB'\fP
+char constant \fIc\fP
+.TP
+\fB%{\fP\fInn\fP\fB}\fP
+integer constant \fInn\fP
+.TP
+\fB%l\fP
+push strlen(pop)
+.TP
+\fB%+\fP, \fB%\-\fP, \fB%*\fP, \fB%/\fP, \fB%m\fP
+arithmetic (%m is \fImod\fP): \fIpush(pop() op pop())\fP
+.TP
+\fB%&\fP, \fB%|\fP, \fB%^\fP
+bit operations (AND, OR and exclusive-OR): \fIpush(pop() op pop())\fP
+.TP
+\fB%=\fP, \fB%>\fP, \fB%<\fP
+logical operations: \fIpush(pop() op pop())\fP
+.TP
+\fB%A\fP, \fB%O\fP
+logical AND and OR operations (for conditionals)
+.TP
+\fB%!\fP, \fB%~\fP
+unary operations (logical and bit complement): \fIpush(op pop())\fP
+.TP
+\fB%i\fP
+add 1 to first two parameters (for ANSI terminals)
+.TP
+\fB%?\fP \fIexpr\fP \fB%t\fP \fIthenpart\fP \fB%e\fP \fIelsepart\fP \fB%;\fP
+This forms an if-then-else.
+The \fB%e\fP \fIelsepart\fP is optional.
+Usually the \fB%?\fP \fIexpr\fP part pushes a value onto the stack,
+and \fB%t\fP pops it from the stack, testing if it is nonzero (true).
+If it is zero (false), control passes to the \fB%e\fP (else) part.
+.IP
+It is possible to form else-if's a la Algol 68:
+.RS
+\fB%?\fP c\d1\u \fB%t\fP b\d1\u \fB%e\fP c\d2\u \fB%t\fP b\d2\u \fB%e\fP c\d3\u \fB%t\fP b\d3\u \fB%e\fP c\d4\u \fB%t\fP b\d4\u \fB%e\fP \fB%;\fP
+.RE
+.IP
+where c\di\u are conditions, b\di\u are bodies.
+.IP
+Use the \fB\-f\fP option of \fB@TIC@\fP or \fB@INFOCMP@\fP to see
+the structure of if-then-else's.
+Some strings, e.g., \fBsgr\fP can be very complicated when written
+on one line.
+The \fB\-f\fP option splits the string into lines with the parts indented.