wscanf.3 (c879ae3536e6d92b8d96c8965c5b05fcb9541520) wscanf.3 (1f4ff8506a801b76186abcb5690294b81ca2b754)
1.\" Copyright (c) 1990, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
1.\" Copyright (c) 1990, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
16.\" 3. All advertising materials mentioning features or use of this software
17.\" must display the following acknowledgement:
18.\" This product includes software developed by the University of
19.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)scanf.3 8.2 (Berkeley) 12/11/93
20.\" 4. Neither the name of the University nor the names of its contributors
21.\" may be used to endorse or promote products derived from this software
22.\" without specific prior written permission.
23.\"
24.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE.
35.\"
36.\" @(#)scanf.3 8.2 (Berkeley) 12/11/93
33.\" FreeBSD: src/lib/libc/stdio/scanf.3,v 1.24 2003/06/28 09:03:25 das Exp
37.\" FreeBSD: src/lib/libc/stdio/scanf.3,v 1.17 2002/05/30 09:53:47 ru Exp
34.\" $FreeBSD$
35.\"
38.\" $FreeBSD$
39.\"
36.Dd July 5, 2003
40.Dd September 22, 2002
37.Dt WSCANF 3
38.Os
39.Sh NAME
40.Nm wscanf ,
41.Nm fwscanf ,
42.Nm swscanf ,
43.Nm vwscanf ,
44.Nm vswscanf ,

--- 28 unchanged lines hidden (view full) ---

73the results from such conversions, if any,
74are stored through the
75.Em pointer
76arguments.
77The
78.Fn wscanf
79function
80reads input from the standard input stream
41.Dt WSCANF 3
42.Os
43.Sh NAME
44.Nm wscanf ,
45.Nm fwscanf ,
46.Nm swscanf ,
47.Nm vwscanf ,
48.Nm vswscanf ,

--- 28 unchanged lines hidden (view full) ---

77the results from such conversions, if any,
78are stored through the
79.Em pointer
80arguments.
81The
82.Fn wscanf
83function
84reads input from the standard input stream
81.Dv stdin ,
85.Em stdin ,
82.Fn fwscanf
83reads input from the stream pointer
84.Fa stream ,
85and
86.Fn swscanf
87reads its input from the wide character string pointed to by
88.Fa str .
89The

--- 75 unchanged lines hidden (view full) ---

165.Cm dioux
166or
167.Cm n
168and the next pointer is a pointer to a
169.Vt "long int"
170(rather than
171.Vt int ) ,
172that the conversion will be one of
86.Fn fwscanf
87reads input from the stream pointer
88.Fa stream ,
89and
90.Fn swscanf
91reads its input from the wide character string pointed to by
92.Fa str .
93The

--- 75 unchanged lines hidden (view full) ---

169.Cm dioux
170or
171.Cm n
172and the next pointer is a pointer to a
173.Vt "long int"
174(rather than
175.Vt int ) ,
176that the conversion will be one of
173.Cm a , e , f ,
174or
175.Cm g
177.Cm aefg
176and the next pointer is a pointer to
177.Vt double
178(rather than
179.Vt float ) ,
180or that the conversion will be one of
181.Cm c
182or
183.Cm s

--- 7 unchanged lines hidden (view full) ---

191or
192.Cm n
193and the next pointer is a pointer to a
194.Vt "long long int"
195(rather than
196.Vt int ) .
197.It Cm L
198Indicates that the conversion will be one of
178and the next pointer is a pointer to
179.Vt double
180(rather than
181.Vt float ) ,
182or that the conversion will be one of
183.Cm c
184or
185.Cm s

--- 7 unchanged lines hidden (view full) ---

193or
194.Cm n
195and the next pointer is a pointer to a
196.Vt "long long int"
197(rather than
198.Vt int ) .
199.It Cm L
200Indicates that the conversion will be one of
199.Cm a , e , f ,
201.Cm aef
200or
201.Cm g
202and the next pointer is a pointer to
203.Vt "long double" .
202or
203.Cm g
204and the next pointer is a pointer to
205.Vt "long double" .
206(This type is not implemented; although the argument is
207required to be a pointer to
208.Vt "long double" ,
209no additional precision is used in the conversion.)
204.It Cm j
205Indicates that the conversion will be one of
206.Cm dioux
207or
208.Cm n
209and the next pointer is a pointer to a
210.Vt intmax_t
211(rather than

--- 80 unchanged lines hidden (view full) ---

292.It Cm u
293Matches an optionally signed decimal integer;
294the next pointer must be a pointer to
295.Vt "unsigned int" .
296.It Cm x , X
297Matches an optionally signed hexadecimal integer;
298the next pointer must be a pointer to
299.Vt "unsigned int" .
210.It Cm j
211Indicates that the conversion will be one of
212.Cm dioux
213or
214.Cm n
215and the next pointer is a pointer to a
216.Vt intmax_t
217(rather than

--- 80 unchanged lines hidden (view full) ---

298.It Cm u
299Matches an optionally signed decimal integer;
300the next pointer must be a pointer to
301.Vt "unsigned int" .
302.It Cm x , X
303Matches an optionally signed hexadecimal integer;
304the next pointer must be a pointer to
305.Vt "unsigned int" .
300.It Cm a , A , e , E , f , F , g , G
301Matches a floating-point number in the style of
302.Xr wcstod 3 .
303The next pointer must be a pointer to
304.Vt float
305(unless
306.Cm l
307or
308.Cm L
309is specified.)
306.It Cm e , E , f , F , g , G
307Matches an optionally signed floating-point number;
308the next pointer must be a pointer to
309.Vt float .
310.It Cm a , A
311Matches a hexadecimal number represented in the style
312.Sm off
313.Oo \- Oc Li 0x Ar h Li \&. Ar hhh Cm p Oo \\*[Pm] Oc Ar d .
314.Sm on
315This is an exact conversion of the sign, exponent, mantissa internal
316floating point representation; the
317.Sm off
318.Oo \- Oc Li 0x Ar h Li \&. Ar hhh
319.Sm on
320portion represents exactly the mantissa; only denormalized
321mantissas have a zero value to the left of the hexadecimal
322point.
323The
324.Cm p
325is a literal character
326.Ql p ;
327the exponent is preceded by a positive or negative sign
328and is represented in decimal.
310.It Cm s
311Matches a sequence of non-white-space wide characters;
312the next pointer must be a pointer to
313.Vt char ,
314and the array must be large enough to accept the multibyte representation
315of all the sequence and the
316terminating
317.Dv NUL

--- 19 unchanged lines hidden (view full) ---

337and there must be enough room for the multibyte representation
338of all the characters
339(no terminating
340.Dv NUL
341is added).
342The usual skip of leading white space is suppressed.
343To skip white space first, use an explicit space in the format.
344.Pp
329.It Cm s
330Matches a sequence of non-white-space wide characters;
331the next pointer must be a pointer to
332.Vt char ,
333and the array must be large enough to accept the multibyte representation
334of all the sequence and the
335terminating
336.Dv NUL

--- 19 unchanged lines hidden (view full) ---

356and there must be enough room for the multibyte representation
357of all the characters
358(no terminating
359.Dv NUL
360is added).
361The usual skip of leading white space is suppressed.
362To skip white space first, use an explicit space in the format.
363.Pp
345If an
346.Cm l
347qualifier is present, the next pointer must be a pointer to
348.Vt wchar_t ,
364If an
365.Cm l
366qualifier is present, the next pointer must be a pointer to
367.Vt wchar_t ,
349into which the input will be placed.
350.It Cm C
351The same as
352.Cm lc .
353.It Cm \&[
354Matches a nonempty sequence of characters from the specified set
355of accepted characters;
356the next pointer must be a pointer to

--- 22 unchanged lines hidden (view full) ---

379make it the first character after the open bracket
380or the circumflex;
381any other position will end the set.
382To include a hyphen in the set,
383make it the last character before the final close bracket;
384some implementations of
385.Fn wscanf
386use
368into which the input will be placed.
369.It Cm C
370The same as
371.Cm lc .
372.It Cm \&[
373Matches a nonempty sequence of characters from the specified set
374of accepted characters;
375the next pointer must be a pointer to

--- 22 unchanged lines hidden (view full) ---

398make it the first character after the open bracket
399or the circumflex;
400any other position will end the set.
401To include a hyphen in the set,
402make it the last character before the final close bracket;
403some implementations of
404.Fn wscanf
405use
387.Dq Li A-Z
406.Dq A-Z
388to represent the range of characters between
407to represent the range of characters between
389.Ql A
408.Dq A
390and
409and
391.Ql Z .
410.Dq Z .
392The string ends with the appearance of a character not in the
393(or, with a circumflex, in) set
394or when the field width runs out.
395.Pp
396If an
397.Cm l
398qualifier is present, the next pointer must be a pointer to
399.Vt wchar_t ,

--- 45 unchanged lines hidden (view full) ---

445.Dv EOF
446is returned if an input failure occurs before any conversion such as an
447end-of-file occurs.
448If an error or end-of-file occurs after conversion
449has begun,
450the number of conversions which were successfully completed is returned.
451.Sh SEE ALSO
452.Xr fgetwc 3 ,
411The string ends with the appearance of a character not in the
412(or, with a circumflex, in) set
413or when the field width runs out.
414.Pp
415If an
416.Cm l
417qualifier is present, the next pointer must be a pointer to
418.Vt wchar_t ,

--- 45 unchanged lines hidden (view full) ---

464.Dv EOF
465is returned if an input failure occurs before any conversion such as an
466end-of-file occurs.
467If an error or end-of-file occurs after conversion
468has begun,
469the number of conversions which were successfully completed is returned.
470.Sh SEE ALSO
471.Xr fgetwc 3 ,
453.Xr scanf 3 ,
454.Xr wcrtomb 3 ,
455.Xr wcstod 3 ,
456.Xr wcstol 3 ,
457.Xr wcstoul 3 ,
458.Xr wprintf 3
459.Sh STANDARDS
460The
461.Fn fwscanf ,

--- 6 unchanged lines hidden (view full) ---

468functions
469conform to
470.St -isoC-99 .
471.Sh BUGS
472In addition to the bugs documented in
473.Xr scanf 3 ,
474.Fn wscanf
475does not support the
472.Xr wcrtomb 3 ,
473.Xr wcstod 3 ,
474.Xr wcstol 3 ,
475.Xr wcstoul 3 ,
476.Xr wprintf 3
477.Sh STANDARDS
478The
479.Fn fwscanf ,

--- 6 unchanged lines hidden (view full) ---

486functions
487conform to
488.St -isoC-99 .
489.Sh BUGS
490In addition to the bugs documented in
491.Xr scanf 3 ,
492.Fn wscanf
493does not support the
476.Dq Li A-Z
494.Dq A-Z
477notation for specifying character ranges with the character
478class conversion
479.Pq Sq Cm %[ .
495notation for specifying character ranges with the character
496class conversion
497.Pq Sq Cm %[ .