diff options
Diffstat (limited to 'man3/printf.3')
| -rw-r--r-- | man3/printf.3 | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/man3/printf.3 b/man3/printf.3 index 3f5d1bc6a7..94da81e82f 100644 --- a/man3/printf.3 +++ b/man3/printf.3 @@ -178,11 +178,11 @@ and an optional The arguments must correspond properly (after type promotion) with the conversion specifier. By default, the arguments are used in the order -given, where each `*' and each conversion specifier asks for the next +given, where each \(aq*\(aq and each conversion specifier asks for the next argument (and it is an error if insufficiently many arguments are given). One can also specify explicitly which argument is taken, -at each place where an argument is required, by writing `%m$' instead -of `%' and `*m$' instead of `*', where the decimal integer m denotes +at each place where an argument is required, by writing "%m$" instead +of \(aq%\(aq and "*m$" instead of \(aq*\(aq, where the decimal integer m denotes the position in the argument list of the desired argument, indexed starting from 1. Thus, @@ -204,35 +204,35 @@ printf("%2$*1$d", width, num); are equivalent. The second style allows repeated references to the same argument. -The C99 standard does not include the style using `$', +The C99 standard does not include the style using \(aq$\(aq, which comes from the Single Unix Specification. If the style using -`$' is used, it must be used throughout for all conversions taking an +\(aq$\(aq is used, it must be used throughout for all conversions taking an argument and all width and precision arguments, but it may be mixed -with `%%' formats which do not consume an argument. +with "%%" formats which do not consume an argument. There may be no -gaps in the numbers of arguments specified using `$'; for example, if +gaps in the numbers of arguments specified using \(aq$\(aq; for example, if arguments 1 and 3 are specified, argument 2 must also be specified somewhere in the format string. -For some numeric conversions a radix character (`decimal point') or +For some numeric conversions a radix character ("decimal point") or thousands' grouping character is used. The actual character used depends on the .B LC_NUMERIC part of the locale. The POSIX locale -uses `.' as radix character, and does not have a grouping character. +uses \(aq.\(aq as radix character, and does not have a grouping character. Thus, .in +4n .nf - printf("%'.2f", 1234567.89); + printf("%\(aq.2f", 1234567.89); .fi .in -results in `1234567.89' in the POSIX locale, in `1234567,89' in the -nl_NL locale, and in `1.234.567,89' in the da_DK locale. +results in "1234567.89" in the POSIX locale, in "1234567,89" in the +nl_NL locale, and in "1.234.567,89" in the da_DK locale. .SS "The flag characters" The character % is followed by zero or more of the following flags: .TP @@ -246,7 +246,7 @@ For .B x and .B X -conversions, a non-zero result has the string `0x' (or `0X' for +conversions, a non-zero result has the string "0x" (or "0X" for .B X conversions) prepended to it. For @@ -323,7 +323,7 @@ overrides a .B \&0 if both are given. .TP -.B ' ' +.B \(aq \(aq (a space) A blank should be left before a positive number (or empty string) produced by a signed conversion. .TP @@ -338,7 +338,7 @@ overrides a space if both are used. The five flag characters above are defined in the C standard. The SUSv2 specifies one further flag character. .TP -.B ' +.B \(aq For decimal conversion .RB ( i , .BR d , @@ -353,7 +353,7 @@ Note that many versions of .BR gcc (1) cannot parse this option and will issue a warning. SUSv2 does not -include %'F. +include \fI%\(aqF\fP. .PP glibc 2.2 adds one further flag character. .TP @@ -364,7 +364,7 @@ For decimal integer conversion .BR u ) the output uses the locale's alternative output digits, if any. For example, since glibc 2.2.3 this will give Arabic-Indic digits -in the Persian (`fa_IR') locale. +in the Persian ("fa_IR") locale. .\" outdigits keyword in locale file .SS "The field width" An optional decimal digit string (with non-zero first digit) specifying @@ -372,25 +372,25 @@ a minimum field width. If the converted value has fewer characters than the field width, it will be padded with spaces on the left (or right, if the left-adjustment flag has been given). -Instead of a decimal digit string one may write `*' or `*m$' -(for some decimal integer m) to specify that the field width -is given in the next argument, or in the m-th argument, respectively, +Instead of a decimal digit string one may write "*" or "*m$" +(for some decimal integer \fIm\fP) to specify that the field width +is given in the next argument, or in the \fIm\fP-th argument, respectively, which must be of type .IR int . -A negative field width is taken as a `\-' flag followed by a +A negative field width is taken as a \(aq\-\(aq flag followed by a positive field width. In no case does a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field is expanded to contain the conversion result. .SS "The precision" -An optional precision, in the form of a period (`\&.') followed by an +An optional precision, in the form of a period (\(aq.\(aq) followed by an optional decimal digit string. -Instead of a decimal digit string one may write `*' or `*m$' +Instead of a decimal digit string one may write "*" or "*m$" (for some decimal integer m) to specify that the precision is given in the next argument, or in the m-th argument, respectively, which must be of type .IR int . -If the precision is given as just `.', or the precision is negative, +If the precision is given as just \(aq.\(aq, or the precision is negative, the precision is taken to be zero. This gives the minimum number of digits to appear for .BR d , @@ -419,7 +419,7 @@ and .B S conversions. .SS "The length modifier" -Here, `integer conversion' stands for +Here, "integer conversion" stands for .BR d , .BR i , .BR o , @@ -499,7 +499,7 @@ argument. (C99 allows %LF, but SUSv2 does not.) .TP .B q -(`quad'. 4.4BSD and Linux libc5 only. +("quad". 4.4BSD and Linux libc5 only. Don't use.) This is a synonym for .BR ll . @@ -631,10 +631,10 @@ If a decimal point appears, at least one digit appears before it. .B F and says that character string representations for infinity and NaN may be made available. -The C99 standard specifies `[\-]inf' or `[\-]infinity' -for infinity, and a string starting with `nan' for NaN, in the case of +The C99 standard specifies "[\-]inf" or "[\-]infinity" +for infinity, and a string starting with "nan" for NaN, in the case of .B f -conversion, and `[\-]INF' or `[\-]INFINITY' or `NAN*' in the case of +conversion, and "[\-]INF" or "[\-]INFINITY" or "NAN*" in the case of .B F conversion.) .TP @@ -713,7 +713,7 @@ modifier is present: The argument is expected to be a pointer to an array of character type (pointer to a string). Characters from the array are written up to (but not -including) a terminating null byte ('\\0'); +including) a terminating null byte (\(aq\\0\(aq); if a precision is specified, no more than the number specified are written. If a precision is given, no null byte need be present; @@ -781,10 +781,10 @@ Print output of No argument is required. .TP .B % -A `%' is written. +A \(aq%\(aq is written. No argument is converted. The complete conversion -specification is `%%'. +specification is \(aq%%\(aq. .SH "CONFORMING TO" The .BR fprintf (), @@ -823,7 +823,7 @@ support for %D disappeared.) No locale-dependent radix character, no thousands' separator, no NaN or infinity, no %m$ and *m$. .PP -Linux libc5 knows about the five C standard flags and the ' flag, +Linux libc5 knows about the five C standard flags and the \(aq flag, locale, %m$ and *m$. It knows about the length modifiers h,l,L,Z,q, but accepts L and q both for \fIlong double\fP and for \fIlong long int\fP (this is a bug). @@ -936,7 +936,7 @@ fprintf(stdout, "pi = %.5f\en", 4 * atan(1.0)); .fi .in .PP -To print a date and time in the form `Sunday, July 3, 10:02', +To print a date and time in the form "Sunday, July 3, 10:02", where .I weekday and @@ -974,7 +974,7 @@ With the value: .fi .in -one might obtain `Sonntag, 3. Juli, 10:02'. +one might obtain "Sonntag, 3. Juli, 10:02". .PP To allocate a sufficiently large string and print into it (code correct for both glibc 2.0 and glibc 2.1): |
