]> git.saurik.com Git - apple/libc.git/blob - stdio/FreeBSD/scanf.3.patch
Libc-498.1.5.tar.gz
[apple/libc.git] / stdio / FreeBSD / scanf.3.patch
1 --- scanf.3.orig 2007-04-08 18:49:37.000000000 -0700
2 +++ scanf.3 2007-04-08 20:14:03.000000000 -0700
3 @@ -40,35 +40,55 @@
4 .Dt SCANF 3
5 .Os
6 .Sh NAME
7 -.Nm scanf ,
8 .Nm fscanf ,
9 +.Nm scanf ,
10 .Nm sscanf ,
11 +.Nm vfscanf ,
12 .Nm vscanf ,
13 -.Nm vsscanf ,
14 -.Nm vfscanf
15 +.Nm vsscanf
16 .Nd input format conversion
17 .Sh LIBRARY
18 .Lb libc
19 .Sh SYNOPSIS
20 .In stdio.h
21 .Ft int
22 -.Fn scanf "const char * restrict format" ...
23 +.Fo fscanf
24 +.Fa "FILE *restrict stream"
25 +.Fa "const char *restrict format" ...
26 +.Fc
27 .Ft int
28 -.Fn fscanf "FILE * restrict stream" "const char * restrict format" ...
29 +.Fo scanf
30 +.Fa "const char *restrict format" ...
31 +.Fc
32 .Ft int
33 -.Fn sscanf "const char * restrict str" "const char * restrict format" ...
34 +.Fo sscanf
35 +.Fa "const char *restrict s"
36 +.Fa "const char *restrict format" ...
37 +.Fc
38 .In stdarg.h
39 +.In stdio.h
40 .Ft int
41 -.Fn vscanf "const char * restrict format" "va_list ap"
42 +.Fo vfscanf
43 +.Fa "FILE *restrict stream"
44 +.Fa "const char *restrict format"
45 +.Fa "va_list arg"
46 +.Fc
47 .Ft int
48 -.Fn vsscanf "const char * restrict str" "const char * restrict format" "va_list ap"
49 +.Fo vscanf
50 +.Fa "const char *restrict format"
51 +.Fa "va_list arg"
52 +.Fc
53 .Ft int
54 -.Fn vfscanf "FILE * restrict stream" "const char * restrict format" "va_list ap"
55 +.Fo vsscanf
56 +.Fa "const char *restrict s"
57 +.Fa "const char *restrict format"
58 +.Fa "va_list arg"
59 +.Fc
60 .Sh DESCRIPTION
61 The
62 .Fn scanf
63 family of functions scans input according to a
64 -.Fa format
65 +.Fa format ,
66 as described below.
67 This format may contain
68 .Em conversion specifiers ;
69 @@ -87,7 +107,8 @@
70 and
71 .Fn sscanf
72 reads its input from the character string pointed to by
73 -.Fa str .
74 +.Fa s .
75 +.Pp
76 The
77 .Fn vfscanf
78 function
79 @@ -108,7 +129,8 @@
80 .Fn vprintf
81 and
82 .Fn vsprintf
83 -functions respectively.
84 +functions, respectively.
85 +.Pp
86 Each successive
87 .Em pointer
88 argument must correspond properly with
89 @@ -132,10 +154,16 @@
90 when an input character does not match such a format character.
91 Scanning also stops
92 when an input conversion cannot be made (see below).
93 +.Pp
94 +Extended locale versions of these functions are documented in
95 +.Xr scanf_l 3 .
96 +See
97 +.Xr xlocale 3
98 +for more information.
99 .Sh CONVERSIONS
100 Following the
101 .Cm %
102 -character introducing a conversion
103 +character introducing a conversion,
104 there may be a number of
105 .Em flag
106 characters, as follows:
107 @@ -440,13 +468,10 @@
108 causes an immediate return of
109 .Dv EOF .
110 .Sh RETURN VALUES
111 -These
112 -functions
113 -return
114 -the number of input items assigned, which can be fewer than provided
115 -for, or even zero, in the event of a matching failure.
116 -Zero
117 -indicates that, while there was input available,
118 +These functions return the number of input items assigned.
119 +This can be fewer than provided for, or even zero,
120 +in the event of a matching failure.
121 +Zero indicates that, although there was input available,
122 no conversions were assigned;
123 typically this is due to an invalid input character,
124 such as an alphabetic character for a
125 @@ -463,6 +488,7 @@
126 .Xr getc 3 ,
127 .Xr mbrtowc 3 ,
128 .Xr printf 3 ,
129 +.Xr scanf_l 3 ,
130 .Xr strtod 3 ,
131 .Xr strtol 3 ,
132 .Xr strtoul 3 ,
133 @@ -473,7 +499,7 @@
134 .Fn scanf ,
135 .Fn sscanf ,
136 .Fn vfscanf ,
137 -.Fn vscanf
138 +.Fn vscanf ,
139 and
140 .Fn vsscanf
141 conform to