8999 SMBIOS: cleanup 32-bit specific code
[unleashed.git] / usr / src / man / man3c / fwscanf.3c
blob8111ffe3f9f1cffe69d38301dc428b4f720c3d70
1 '\" te
2 .\" Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
3 .\" Portions Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved.
4 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
7 .\"  This notice shall appear on any product containing this material.
8 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
9 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
10 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
11 .TH FWSCANF 3C "Jul 10, 2008"
12 .SH NAME
13 fwscanf, wscanf, swscanf, vfwscanf, vwscanf, vswscanf \- convert formatted
14 wide-character input
15 .SH SYNOPSIS
16 .LP
17 .nf
18 #include <stdio.h>
19 #include <wchar.h>
21 \fBint\fR \fBfwscanf\fR(\fBFILE *restrict\fR \fIstream\fR, \fBconst wchar_t *restrict\fR \fIformat\fR, \fB\fR\fI\&...\fR);
22 .fi
24 .LP
25 .nf
26 \fBint\fR \fBwscanf\fR(\fBconst wchar_t *restrict\fR \fIformat\fR, \fB\fR\fI\&...\fR);
27 .fi
29 .LP
30 .nf
31 \fBint\fR \fBswscanf\fR(\fBconst wchar_t *restrict\fR \fIs\fR, \fBconst wchar_t *restrict\fR \fIformat\fR,
32      \fB\fR\fI\&...\fR);
33 .fi
35 .LP
36 .nf
37 #include <stdarg.h>
38 #include <stdio.h>
39 #include <wchar.h>
41 \fBint\fR \fBvfwscanf\fR(\fBFILE *restrict\fR \fIstream\fR, \fBconst wchar_t *restrict\fR \fIformat\fR,
42      \fBva_list\fR \fIarg\fR);
43 .fi
45 .LP
46 .nf
47 \fBint\fR \fBvswcanf\fR(\fBconst wchar_t *restrict\fR \fIws\fR, \fBconst wchar_t *restrict\fR \fIformat\fR,
48      \fBva_list\fR \fIarg\fR);
49 .fi
51 .LP
52 .nf
53 \fBint\fR \fBvwscanf\fR(\fBconst wchar_t *restrict\fR \fIformat\fR, \fBva_list\fR \fIarg\fR);
54 .fi
56 .SH DESCRIPTION
57 .sp
58 .LP
59 The \fBfwscanf()\fR function reads from the named input \fIstream\fR.
60 .sp
61 .LP
62 The \fBwscanf()\fR function reads from the standard input stream \fBstdin\fR.
63 .sp
64 .LP
65 The \fBswscanf()\fR function reads from the wide-character string \fIs\fR.
66 .sp
67 .LP
68 The \fBvfwscanf()\fR, \fBvswscanf()\fR, and \fBvwscanf()\fR functions are
69 equivalent to the \fBfwscanf()\fR, \fBswscanf()\fR, and \fBwscanf()\fR
70 functions, respectively, except that instead of being called with a variable
71 number of arguments, they are called with an argument list as defined by the
72 <\fBstdarg.h\fR> header . These functions do not invoke the \fBva_end()\fR
73 macro. Applications using these functions should call \fBva_end\fR(\fIap\fR)
74 afterwards to clean up.
75 .sp
76 .LP
77 Each function reads wide-characters, interprets them according to a format, and
78 stores the results in its arguments. Each expects, as arguments, a control
79 wide-character string \fIformat\fR described below, and a set of \fIpointer\fR
80 arguments indicating where the converted input should be stored. The result is
81 undefined if there are insufficient arguments for the format. If the format is
82 exhausted while arguments remain, the excess arguments are evaluated but are
83 otherwise ignored.
84 .sp
85 .LP
86 Conversions can be applied to the \fIn\fRth argument after the \fIformat\fR in
87 the argument list, rather than to the next unused argument. In this case, the
88 conversion wide-character \fB%\fR (see below) is replaced by the sequence
89 \fB%\fR\fIn\fR\fB$\fR, where \fIn\fR is a decimal integer in the range [1,
90 \fBNL_ARGMAX\fR]. This feature provides for the definition of format
91 wide-character strings that select arguments in an order appropriate to
92 specific languages. In format wide-character strings containing the
93 \fB%\fR\fIn\fR\fB$\fR form of conversion specifications, it is unspecified
94 whether numbered arguments in the argument list can be referenced from the
95 format  wide-character string more than once.
96 .sp
97 .LP
98 The \fIformat\fR can contain either form of a conversion specification, that
99 is, \fB%\fR or \fB%\fR\fIn\fR\fB$\fR, but the two forms cannot normally be
100 mixed within a single \fIformat\fR wide-character string. The only exception to
101 this is that \fB%%\fR or \fB%*\fR can be mixed with the \fB%\fR\fIn\fR\fB$\fR
102 form.
105 The \fBfwscanf()\fR function in all its forms allows for detection of a
106 language-dependent radix character in the input string, encoded as a
107 wide-character value.  The  radix character is defined in the program's locale
108 (category \fBLC_NUMERIC\fR). In the POSIX locale, or in a locale where the
109 radix character is not defined, the radix character defaults to a period (.).
112 The format is a wide-character string composed of zero or more directives. Each
113 directive is composed of one of the following: one or more white-space
114 wide-characters (space, tab, newline,  vertical-tab or form-feed characters);
115 an ordinary wide-character (neither \fB%\fR nor a white-space character); or a
116 conversion specification. Each conversion specification is introduced by a
117 \fB%\fR or the sequence \fB%\fR\fIn\fR\fB$\fR after which the following appear
118 in sequence:
119 .RS +4
121 .ie t \(bu
122 .el o
123 An optional assignment-suppressing character \fB*\fR.
125 .RS +4
127 .ie t \(bu
128 .el o
129 An optional non-zero decimal integer that specifies the maximum field width.
131 .RS +4
133 .ie t \(bu
134 .el o
135 An option length modifier that specifies the size of the receiving object.
137 .RS +4
139 .ie t \(bu
140 .el o
141 A conversion specifier wide-character that specifies the type of conversion to
142 be applied. The valid conversion wide-characters are described below.
146 The \fBfwscanf()\fR functions execute each directive of the format in turn.  If
147 a directive fails, as detailed below, the function returns.  Failures are
148 described as input failures (due to the unavailability of input bytes) or
149 matching failures (due to inappropriate input).
152 A directive composed of one or more white-space wide-characters is executed by
153 reading input until no more valid input can be read, or up to the first
154 wide-character which is not a white-space  wide-character, which remains
155 unread.
158 A directive that is an ordinary wide-character is executed as follows. The next
159 wide-character is read from the input and compared with the wide-character that
160 comprises the directive; if the comparison shows that they are not equivalent,
161 the directive fails, and the differing and subsequent wide-characters remain
162 unread.
165 A directive that is a conversion specification defines a set of matching input
166 sequences, as described below for each conversion  wide-character. A conversion
167 specification is executed in the following steps:
170 Input white-space wide-characters (as specified by \fBiswspace\fR(3C)) are
171 skipped, unless the conversion specification includes a \fB[\fR, \fBc\fR, or
172 \fBn\fR conversion character.
175 An item is read from the input unless the conversion specification includes an
176 \fBn\fR conversion wide-character. The length of the item read is limited to
177 any specified maximum field width. In Solaris default mode, the input item is
178 defined as the longest sequence of input wide-characters that forms a matching
179 sequence. In some cases, \fBfwscanf()\fR might need to read several extra
180 wide-characters beyond the end of the input item to find the end of a matching
181 sequence. In C99/SUSv3 mode, the input item is defined as the longest sequence
182 of input wide-characters that is, or is a prefix of, a matching sequence. With
183 this definition, \fBfwscanf()\fR need only read at most one wide-character
184 beyond the end of the input item. Therefore, in C99/SUSv3 mode, some sequences
185 that are acceptable to \fBwcstod\fR(3C), \fBwcstol\fR(3C), and similar
186 functions are unacceptable to \fBfwscanf()\fR. In either mode, \fBfwscanf()\fR
187 attempts to push back any excess bytes read using \fBungetc\fR(3C). Assuming
188 all such attempts succeed, the first wide-character, if any, after the input
189 item remains unread. If the length of the input item is 0, the conversion
190 fails. This condition is a matching failure unless end-of-file, an encoding
191 error, or a read error prevented input from the stream, in which case it is an
192 input failure.
195 Except in the case of a \fB%\fR conversion wide-character, the input item (or,
196 in the case of a \fB%\fR\fIn\fR conversion specification, the count of input
197 wide-characters) is converted to a type appropriate to the conversion
198 wide-character. If the input item is not a matching sequence, the execution of
199 the conversion specification fails; this condition is a matching failure.
200 Unless assignment suppression was indicated by a \fB*\fR, the result of the
201 conversion is placed in the object pointed to by the first argument following
202 the \fIformat\fR argument that has not already received a conversion result if
203 the conversion specification is introduced by \fB%\fR, or in the \fIn\fRth
204 argument if introduced by the wide-character sequence \fB%\fR\fIn\fR\fB$\fR. If
205 this object does not have an appropriate type, or if the result of the
206 conversion cannot be represented in the space provided, the behavior is
207 undefined.
210 The length modifiers and their meanings are:
212 .ne 2
214 \fB\fBhh\fR\fR
216 .RS 16n
217 Specifies that a following \fBd\fR, \fBi\fR, \fBo\fR, \fBu\fR, \fBx\fR,
218 \fBX\fR, or \fBn\fR conversion specifier applies to an argument with type
219 pointer to \fBsigned char\fR or \fBunsigned char\fR.
223 .ne 2
225 \fB\fBh\fR\fR
227 .RS 16n
228 Specifies that a following \fBd\fR, \fBi\fR, \fBo\fR, \fBu\fR, \fBx\fR,
229 \fBX\fR, or \fBn\fR conversion specifier applies to an argument with type
230 pointer to \fBshort\fR or \fBunsigned short\fR.
234 .ne 2
236 \fB\fBl\fR (ell)\fR
238 .RS 16n
239 Specifies that a following \fBd\fR, \fBi\fR, \fBo\fR, \fBu\fR, \fBx\fR,
240 \fBX\fR, or \fBn\fR conversion specifier applies to an argument with type
241 pointer to \fBlong\fR or \fBunsigned long\fR; that a following \fBa\fR,
242 \fBA\fR, \fBe\fR, \fBE\fR, \fBf\fR, \fBF\fR, \fBg\fR, or \fBG\fR conversion
243 specifier applies to an argument with type pointer to \fBdouble\fR; or that a
244 following \fBc\fR, \fBs\fR, or \fB[\fR conversion specifier applies to an
245 argument with type pointer to \fBwchar_t\fR.
249 .ne 2
251 \fB\fBll\fR (ell-ell)\fR
253 .RS 16n
254 Specifies that a following \fBd\fR, \fBi\fR, \fBo\fR, \fBu\fR, \fBx\fR,
255 \fBX\fR, or \fBn\fR conversion specifier applies to an argument with type
256 pointer to \fBlong long\fR or \fBunsigned long long\fR.
260 .ne 2
262 \fB\fBj\fR\fR
264 .RS 16n
265 Specifies that a following \fBd\fR, \fBi\fR, \fBo\fR, \fBu\fR, \fBx\fR,
266 \fBX\fR, or \fBn\fR conversion specifier applies to an argument with type
267 pointer to \fBintmax_t\fR or \fBuintmax_t\fR.
271 .ne 2
273 \fB\fBz\fR\fR
275 .RS 16n
276 Specifies that a following \fBd\fR, \fBi\fR, \fBo\fR, \fBu\fR, \fBx\fR,
277 \fBX\fR, or \fBn\fR conversion specifier applies to an argument with type
278 pointer to \fBsize_t\fR or the corresponding signed integer type.
282 .ne 2
284 \fB\fBt\fR\fR
286 .RS 16n
287 Specifies that a following \fBd\fR, \fBi\fR, \fBo\fR, \fBu\fR, \fBx\fR,
288 \fBX\fR, or \fBn\fR conversion specifier applies to an argument with type
289 pointer to \fBptrdiff_t\fR or the corresponding \fBunsigned\fR type.
293 .ne 2
295 \fB\fBL\fR\fR
297 .RS 16n
298 Specifies that a following \fBa\fR, \fBA\fR, \fBe\fR, \fBE\fR, \fBf\fR,
299 \fBF\fR, \fBg\fR, or \fBG\fR conversion specifier applies to an argument with
300 type pointer to \fBlong double\fR.
305 If a length modifier appears with any conversion specifier other than as
306 specified above, the behavior is undefined.
309 The following conversion wide-characters are valid:
311 .ne 2
313 \fB\fBd\fR\fR
315 .RS 11n
316 Matches an optionally signed decimal integer, whose format is the same as
317 expected for the subject sequence of \fBwcstol\fR(3C) with the value 10 for the
318 \fIbase\fR argument. In the absence of a size modifier, the corresponding
319 argument must be a pointer to \fBint\fR.
323 .ne 2
325 \fB\fBi\fR\fR
327 .RS 11n
328 Matches an optionally signed integer, whose format is the same as expected for
329 the subject sequence of \fBwcstol\fR(3C) with 0 for the \fIbase\fR argument. In
330 the absence of a size modifier, the corresponding argument must be a pointer to
331 \fBint\fR.
335 .ne 2
337 \fB\fBo\fR\fR
339 .RS 11n
340 Matches an optionally signed octal integer, whose format is the same as
341 expected for the subject sequence of \fBwcstoul\fR(3C) with the value 8 for the
342 \fIbase\fR argument. In the absence of a size modifier, the corresponding
343 argument must be a pointer to \fBunsigned int\fR.
347 .ne 2
349 \fB\fBu\fR\fR
351 .RS 11n
352 Matches an optionally signed decimal integer, whose format is the same as
353 expected for the subject sequence of \fBwcstoul\fR(3C) with the value 10 for
354 the \fIbase\fR argument. In the absence of a size modifier, the corresponding
355 argument must be a pointer to \fBunsigned int\fR.
359 .ne 2
361 \fB\fBx\fR\fR
363 .RS 11n
364 Matches an optionally signed hexadecimal integer, whose format is the same as
365 expected for the subject sequence of \fBwcstoul\fR(3C) with the value 16 for
366 the \fIbase\fR argument. In the absence of a size modifier, the corresponding
367 argument must be a pointer to \fBunsigned int\fR.
371 .ne 2
373 \fB\fBa\fR,\fBe\fR,\fBf\fR,\fBg\fR\fR
375 .RS 11n
376 Matches an optionally signed floating-point number, whose format is the same as
377 expected for the subject sequence of \fBwcstod\fR(3C). In the absence of a size
378 modifier, the corresponding argument must be a pointer to \fBfloat\fR. The
379 \fBe\fR, \fBf\fR, and \fBg\fR specifiers match hexadecimal floating point
380 values only in C99/SUSv3 (see \fBstandards\fR(5)) mode, but the \fBa\fR
381 specifier always matches hexadecimal floating point values.
383 These conversion specifiers match any subject sequence accepted by
384 \fBstrtod\fR(3C), including the INF, INFINITY, NAN, and
385 NAN(\fIn-char-sequence\fR) forms.  The result of the conversion is the same as
386 that of calling \fBstrtod()\fR (or \fBstrtof()\fR or \fBstrtold()\fR) with the
387 matching sequence, including the raising of floating point exceptions and the
388 setting of \fBerrno\fR to \fBERANGE\fR, if applicable.
392 .ne 2
394 \fB\fBs\fR\fR
396 .RS 11n
397 Matches a sequence of non white-space wide-characters.  If no \fBl\fR (ell)
398 qualifier is present, characters from the input field are converted as if by
399 repeated calls to the \fBwcrtomb\fR(3C) function, with the conversion state
400 described by an \fBmbstate_t\fR object initialized to zero before the first
401 wide-character is converted.  The corresponding argument must be a pointer to a
402 character array large enough to accept the sequence and the terminating null
403 character, which will be added automatically.
405 Otherwise, the corresponding argument must be a pointer to an array of
406 \fBwchar_t\fR large enough to accept the sequence and the terminating null
407 wide-character, which will be added automatically.
411 .ne 2
413 \fB\fB[\fR\fR
415 .RS 11n
416 Matches a non-empty sequence of wide-characters from a set of expected
417 wide-characters (the \fIscanset\fR). If no \fBl\fR (ell) qualifier is present,
418 wide-characters from the input field are converted as if by repeated calls to
419 the \fBwcrtomb()\fR function, with the conversion state described by an
420 \fBmbstate_t\fR object initialized to zero before the first wide-character is
421 converted.  The corresponding argument must be a pointer to a character array
422 large enough to accept the sequence and the terminating null  character, which
423 will be added automatically.
425 If an \fBl\fR (ell) qualifier is present, the corresponding argument must be a
426 pointer to an array of \fBwchar_t\fR large enough to accept the sequence and
427 the terminating null  wide-character, which will be added automatically.
429 The conversion specification includes all subsequent widw characters in the
430 \fIformat\fR string up to and including the matching right square bracket
431 (\fB]\fR). The wide-characters between the square brackets (the \fIscanlist\fR)
432 comprise the scanset, unless the wide-character after the left square bracket
433 is a circumflex (\fB^\fR), in which case the scanset contains all
434 wide-characters that do not appear in the scanlist between the circumflex and
435 the right square bracket. If the conversion specification begins with
436 \fB[\|]\fR or \fB[^],\fR the right square bracket is included in the scanlist
437 and the next right square bracket is the matching right square bracket that
438 ends the conversion specification; otherwise the first right square bracket is
439 the one that ends the conversion specification. If a minus-sign (\fB\(mi\fR) is
440 in the scanlist and is not the first wide-character, nor the second where the
441 first wide-character is a \fB^\fR, nor the last wide-character, it indicates a
442 range of characters to be matched.
446 .ne 2
448 \fB\fBc\fR\fR
450 .RS 11n
451 Matches a sequence of wide-characters of the number specified by the field
452 width (1 if no field width is present in the conversion specification). If no
453 \fBl\fR (ell) qualifier is present, wide-characters from the input field are
454 converted as if by repeated calls to the \fBwcrtomb()\fR function, with the
455 conversion state described by an \fBmbstate_t\fR object initialized to zero
456 before the first wide-character is converted.  The corresponding argument must
457 be a pointer to a character array large enough to accept the sequence.  No null
458 character is added.
460 Otherwise, the corresponding argument must be a pointer to an array of
461 \fBwchar_t\fR large enough to accept the sequence.  No null wide-character is
462 added.
466 .ne 2
468 \fB\fBp\fR\fR
470 .RS 11n
471 Matches the set of sequences that is the same as the set of sequences that is
472 produced by the \fB%p\fR conversion of the corresponding \fBfwprintf\fR(3C)
473 functions. The corresponding argument must be a pointer to a pointer to
474 \fBvoid\fR. If the input item is a value converted earlier during the same
475 program execution, the pointer that results will compare equal to that value;
476 otherwise the behavior of the \fB%p\fR conversion is undefined.
480 .ne 2
482 \fB\fBn\fR\fR
484 .RS 11n
485 No input is consumed. The corresponding argument must be a pointer to the
486 integer into which is to be written the number of wide-characters read from the
487 input so far by this call to the \fBfwscanf()\fR functions. Execution of a
488 \fB%n\fR conversion specification does not increment the assignment count
489 returned at the completion of execution of the function.
493 .ne 2
495 \fB\fBC\fR\fR
497 .RS 11n
498 Same as \fBlc\fR.
502 .ne 2
504 \fB\fBS\fR\fR
506 .RS 11n
507 Same as \fBls\fR.
511 .ne 2
513 \fB\fB%\fR\fR
515 .RS 11n
516 Matches a single \fB%\fR; no conversion or assignment occurs. The complete
517 conversion specification must be \fB%%\fR.
522 If a conversion specification is invalid, the behavior is undefined.
525 The conversion characters \fBA\fR, \fBE\fR, \fBF\fR, \fBG\fR, and \fBX\fR are
526 also valid and behave the same as, respectively, \fBa\fR, \fBe\fR, \fBf\fR,
527 \fBg\fR, and \fBx\fR.
530 If end-of-file is encountered during input, conversion is terminated. If
531 end-of-file occurs before any wide-characters matching the current conversion
532 specification (except for \fB%n\fR) have been read (other than leading
533 white-space, where permitted), execution of the current conversion
534 specification terminates with an input failure.  Otherwise, unless execution of
535 the current conversion specification is terminated with a matching failure,
536 execution of the following conversion specification (if any) is terminated with
537 an input failure.
540 Reaching the end of the string in \fBswscanf()\fR is equivalent to encountering
541 end-of-file for \fBfwscanf()\fR.
544 If conversion terminates on a conflicting input, the offending input is left
545 unread in the input. Any trailing white space (including newline) is left
546 unread unless matched by a conversion specification. The success of literal
547 matches and suppressed assignments is only directly determinable via the %n
548 conversion specification.
551 The \fBfwscanf()\fR and \fBwscanf()\fR functions may mark the \fBst_atime\fR
552 field of the file associated with \fIstream\fR for update. The \fBst_atime\fR
553 field will be marked for update by the first successful execution of
554 \fBfgetc\fR(3C), \fBfgetwc\fR(3C), \fBfgets\fR(3C), \fBfgetws\fR(3C),
555 \fBfread\fR(3C), \fBgetc\fR(3C), \fBgetwc\fR(3C), \fBgetchar\fR(3C),
556 \fBgetwchar\fR(3C), \fBgets\fR(3C), \fBfscanf\fR(3C) or \fBfwscanf()\fR using
557 \fIstream\fR that returns data not supplied by a prior call to
558 \fBungetc\fR(3C).
559 .SH RETURN VALUES
562 Upon successful completion, these functions return the number of successfully
563 matched and assigned input items; this number can be 0 in the event of an early
564 matching failure.  If the input ends before the first matching failure or
565 conversion, \fBEOF\fR is returned.  If a read error occurs the error indicator
566 for the stream is set, \fBEOF\fR is returned, and \fBerrno\fR is set to
567 indicate the error.
568 .SH ERRORS
571 For the conditions under which the \fBfwscanf()\fR functions will fail and may
572 fail, refer to \fBfgetwc\fR(3C).
575 In addition, \fBfwscanf()\fR may fail if:
577 .ne 2
579 \fB\fBEILSEQ\fR\fR
581 .RS 10n
582 Input byte sequence does not form a valid character.
586 .ne 2
588 \fB\fBEINVAL\fR\fR
590 .RS 10n
591 There are insufficient arguments.
594 .SH USAGE
597 In format strings containing the \fB%\fR form of conversion specifications,
598 each argument in the argument list is used exactly once.
599 .SH EXAMPLES
601 \fBExample 1 \fR\fBwscanf()\fR example
604 The call:
607 .in +2
609 int i, n; float x; char name[50];
610 n = wscanf(L"%d%f%s", &i, &x, name);
612 .in -2
616 with the input line:
619 .in +2
621 25 54.32E\(mi1 Hamster
623 .in -2
627 will assign to \fIn\fR the value 3, to \fIi\fR the value 25, to \fIx\fR the
628 value 5.432, and \fIname\fR will contain the string Hamster.
632 The call:
635 .in +2
637 int i; float x; char name[50];
638 (void) wscanf(L"%2d%f%*d %[0123456789], &i, &x, name);
640 .in -2
644 with input:
647 .in +2
649 56789 0123 56a72
651 .in -2
655 will assign 56 to \fIi\fR, 789.0 to \fIx\fR, skip 0123, and place the string
656 56\e0 in \fIname\fR. The next call to \fBgetchar\fR(3C) will return the
657 character \fBa\fR.
659 .SH ATTRIBUTES
662 See \fBattributes\fR(5) for descriptions of the following attributes:
667 box;
668 c | c
669 l | l .
670 ATTRIBUTE TYPE  ATTRIBUTE VALUE
672 Interface Stability     Committed
674 MT-Level        MT-Safe
676 Standard        See \fBstandards\fR(5).
679 .SH SEE ALSO
682 \fBfgetc\fR(3C), \fBfgets\fR(3C), \fBfgetwc\fR(3C), \fBfgetws\fR(3C),
683 \fBfread\fR(3C), \fBfscanf\fR(3C), \fBfwprintf\fR(3C), \fBgetc\fR(3C),
684 \fBgetchar\fR(3C), \fBgets\fR(3C), \fBgetwc\fR(3C), \fBgetwchar\fR(3C),
685 \fBsetlocale\fR(3C), \fBstrtod\fR(3C), \fBwcrtomb\fR(3C), \fBwcstod\fR(3C),
686 \fBwcstol\fR(3C), \fBwcstoul\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
687 .SH NOTES
690 The behavior of the conversion specifier "%%" has changed for all of the
691 functions described on this manual page. Previously the "%%" specifier accepted
692 a "%" character from input only if there were no preceding whitespace
693 characters.  The new behavior accepts "%" even if there are preceding
694 whitespace characters. This new behavior now aligns with the description on
695 this manual page and in various standards. If the old behavior is desired, the
696 conversion specification "%*[%]" can be used.