printfs.gml

来自「开放源码的编译器open watcom 1.6.0版的源代码」· GML 代码 · 共 464 行 · 第 1/2 页

GML
464
字号
.id intmax_t
or
.id uintmax_t
argument.
.bull
"j" causes an "n" (converted length assignment) operation to assign the
converted length to an object of type
.id intmax_t.
.bull
.ix 'size_t'
"z" causes a "b", "d", "i", "o", "u", "x" or "X" (integer) conversion to
process a
.id size_t
or the corresponding signed integer type argument.
.bull
"z" causes an "n" (converted length assignment) operation to assign the
converted length to an object of signed integer type corresponding to
.id size_t.
.bull
.ix 'ptrdiff_t'
"t" causes a "b", "d", "i", "o", "u", "x" or "X" (integer) conversion to
process a
.id ptrdiff_t
or the corresponding unsigned integer type argument.
.bull
"t" causes an "n" (converted length assignment) operation to assign the
converted length to an object of type
.id ptrdiff_t.
.bull
.ix '__int64'
"I64" causes a "b", "d", "i", "o", "u", "x" or "X" (integer) conversion
to process an
.id __int64
or
.id unsigned __int64
argument (e.g., %I64d).
.bull
.ix 'long double'
"L" causes an "e", "E", "f", "F", "g", "G" (double) conversion to process a
.id long double
argument.
.if &farfnc ne 0 .do begin
.bull
"W" causes the pointer associated with "n", "p", "s" conversions to
be treated as a far pointer.
.bull
"N" causes the pointer associated with "n", "p", "s" conversions to
be treated as a near pointer.
.do end
.endbull
.np
The valid conversion type specifiers are:
.begnote $setptnt 3
.note b
An argument of type
.id int
is converted to an unsigned binary notation and written to the output
stream.
The default precision is 1, but if more digits are required, leading
zeros are added.
.note c
An argument of type
.id int
is converted to a value of type
.id char
and the corresponding ASCII character code is written to the output
stream.
.note C
An argument of type
.id wchar_t
is converted to a multibyte character and written to the output stream.
.note d, i
An argument of type
.id int
is converted to a signed decimal notation and written to the output
stream.
The default precision is 1, but if more digits are required, leading
zeros are added.
.note e, E
An argument of type
.id double
is converted to a decimal notation in the form
.mono &lbrkt.&minus.&rbrkt.d.ddde&lbrkt.+|&minus.&rbrkt.ddd
similar to FORTRAN exponential (E) notation.
The leading sign appears (subject to the format control flags) only if
the argument is negative.
If the argument is non-zero, the digit before the decimal-point character
is non-zero.
The precision is used as the number of digits following the
decimal-point character.
If the precision is not specified, a default precision of six is used.
If the precision is 0, the decimal-point character is suppressed.
The value is rounded to the appropriate number of digits.
For "E" conversions, the exponent begins with the character "E" rather
than "e".
The exponent sign and a three-digit number
(that indicates the power of ten
by which the decimal fraction is multiplied) are always produced.
.note f, F
An argument of type
.id double
is converted to a decimal notation in the form
.mono &lbrkt.&minus.&rbrkt.ddd.ddd
similar to FORTRAN fixed-point (F) notation.
The leading sign appears (subject to the format control flags) only if
the argument is negative.
The precision is used as the number of digits following the
decimal-point character.
If the precision is not specified, a default precision of six is used.
If the precision is 0, the decimal-point character is suppressed,
otherwise, at least one digit is produced before the decimal-point
character.
The value is rounded to the appropriate number of digits.
.note g, G
An argument of type
.id double
is converted using either the "f" or "e" (or "F" or "E", for a "G" conversion)
style of conversion depending on the value of the argument.
In either case, the precision specifies the number of significant digits
that are contained in the result.
"e" style conversion is used only if the exponent from such a conversion
would be less than &minus.4 or greater than the precision.
Trailing zeros are removed from the result and a decimal-point character
only appears if it is followed by a digit.
.note n
The number of characters that have been written to the output stream is
assigned to the integer pointed to by the argument.
No output is produced.
.note o
An argument of type
.id int
is converted to an unsigned octal notation and written to the output
stream.
The default precision is 1, but if more digits are required, leading
zeros are added.
.note p, P
An argument of type
.id void *
is converted to a value of type
.id int
and the value is formatted as for a hexadecimal ("x") conversion.
.note s
Characters from the string specified by an argument of type
.id char *
or
.id wchar_t *
.ct , up to,
but not including the terminating null character ('\0'), are written
to the output stream.
If a precision is specified, no more than that many characters (bytes)
are written (e.g., %.7s)

.if &'length(&wfunc.) ne 0 .do begin
.np
For &func, this specifier refers to an ASCII character string unless
the "l" or "w" modifiers are used to indicate a wide character string.
.np
For &wfunc, this specifier refers to a wide character string unless
the "h" modifier is used to indicate an ASCII character string.
.do end

.if &'length(&ufunc.) ne 0 .do begin
.np
For &func, this specifier refers to an ASCII character string unless
the "l" or "w" modifiers are used to indicate a 16-bit Unicode
character string.
.np
For &ufunc, this specifier refers to a 16-bit Unicode character string
unless the "h" modifier is used to indicate an ASCII character string.
.do end

.note S
Characters from the string specified by an argument of type
.id wchar_t *
.ct , up to,
but not including the terminating null wide character (L'\0'), are
converted to multibyte characters and written to the output stream.
If a precision is specified, no more than that many characters (bytes)
are written (e.g., %.7S)
.note u
An argument of type
.id int
is converted to an unsigned decimal notation and written to the output
stream.
The default precision is 1, but if more digits are required, leading
zeros are added.
.note x, X
An argument of type
.id int
is converted to an unsigned hexadecimal notation and written to the
output stream.
The default precision is 1, but if more digits are required, leading
zeros are added.
Hexadecimal notation uses the digits "0" through "9"
and the characters "a" through "f" or "A" through "F"
for "x" or "X" conversions respectively, as the hexadecimal digits.
Subject to the alternate-form control flag, "0x" or "0X" is prepended
to the output.
.endnote
.np
Any other conversion type specifier character, including another percent
character (%), is written to the output stream with no special
interpretation.
.np
The arguments must correspond with the conversion type specifiers, left
to right in the string; otherwise, indeterminate results will occur.
.np
.ix '_finite'
.ix 'infinity'
.ix 'NaN'
If the value corresponding to a floating-point specifier is infinity, or
not a number (NaN), then the output will be "inf" or "-inf" for infinity,
and "nan" or "-nan" for NaN's. If the conversion specifier is an uppercase
character (ie. "E", "F", or "G"), the output will be uppercase as well
("INF", "NAN"), otherwise the output will be lowercase as noted above.
.np
The pointer size specification ("N" or "W") is only effective on platforms
that use a segmented memory model, although it is always recognized.
.np
For example, a specifier of the form
.id "%8.*f"
will define a field to be at least 8 characters wide, and will get the
next argument for the precision to be used in the conversion.
.oldtext end
.if &farfnc eq 0 .do begin
.class ANSI (except for b and I64 specifiers)
.do end
.el .do begin
.class ANSI (except for N, W pointer size modifiers and b, I64 specifiers)
.do end
.system

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?