X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/1f2f436a38f7ae2d39a943ad2898d8fed4ed2e58..6465356a983ac139f81d3b7913cdb548477c346c:/stdio/FreeBSD/scanf.3 diff --git a/stdio/FreeBSD/scanf.3 b/stdio/FreeBSD/scanf.3 index 5f424ff..4bf7240 100644 --- a/stdio/FreeBSD/scanf.3 +++ b/stdio/FreeBSD/scanf.3 @@ -36,35 +36,55 @@ .Dt SCANF 3 .Os .Sh NAME -.Nm scanf , .Nm fscanf , +.Nm scanf , .Nm sscanf , +.Nm vfscanf , .Nm vscanf , -.Nm vsscanf , -.Nm vfscanf +.Nm vsscanf .Nd input format conversion .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In stdio.h .Ft int -.Fn scanf "const char * restrict format" ... +.Fo fscanf +.Fa "FILE *restrict stream" +.Fa "const char *restrict format" ... +.Fc .Ft int -.Fn fscanf "FILE * restrict stream" "const char * restrict format" ... +.Fo scanf +.Fa "const char *restrict format" ... +.Fc .Ft int -.Fn sscanf "const char * restrict str" "const char * restrict format" ... +.Fo sscanf +.Fa "const char *restrict s" +.Fa "const char *restrict format" ... +.Fc .In stdarg.h +.In stdio.h .Ft int -.Fn vscanf "const char * restrict format" "va_list ap" +.Fo vfscanf +.Fa "FILE *restrict stream" +.Fa "const char *restrict format" +.Fa "va_list arg" +.Fc .Ft int -.Fn vsscanf "const char * restrict str" "const char * restrict format" "va_list ap" +.Fo vscanf +.Fa "const char *restrict format" +.Fa "va_list arg" +.Fc .Ft int -.Fn vfscanf "FILE * restrict stream" "const char * restrict format" "va_list ap" +.Fo vsscanf +.Fa "const char *restrict s" +.Fa "const char *restrict format" +.Fa "va_list arg" +.Fc .Sh DESCRIPTION The .Fn scanf family of functions scans input according to a -.Fa format +.Fa format , as described below. This format may contain .Em conversion specifiers ; @@ -83,7 +103,8 @@ reads input from the stream pointer and .Fn sscanf reads its input from the character string pointed to by -.Fa str . +.Fa s . +.Pp The .Fn vfscanf function @@ -104,7 +125,8 @@ the .Fn vprintf and .Fn vsprintf -functions respectively. +functions, respectively. +.Pp Each successive .Em pointer argument must correspond properly with @@ -128,10 +150,16 @@ Scanning stops when an input character does not match such a format character. Scanning also stops when an input conversion cannot be made (see below). +.Pp +Extended locale versions of these functions are documented in +.Xr scanf_l 3 . +See +.Xr xlocale 3 +for more information. .Sh CONVERSIONS Following the .Cm % -character introducing a conversion +character introducing a conversion, there may be a number of .Em flag characters, as follows: @@ -411,7 +439,8 @@ Matches a pointer value (as printed by in .Xr printf 3 ) ; the next pointer must be a pointer to -.Vt void . +.Vt "void *" +(or other pointer type). .It Cm n Nothing is expected; instead, the number of characters consumed thus far from the input @@ -436,13 +465,10 @@ of causes an immediate return of .Dv EOF . .Sh RETURN VALUES -These -functions -return -the number of input items assigned, which can be fewer than provided -for, or even zero, in the event of a matching failure. -Zero -indicates that, while there was input available, +These functions return the number of input items assigned. +This can be fewer than provided for, or even zero, +in the event of a matching failure. +Zero indicates that, although there was input available, no conversions were assigned; typically this is due to an invalid input character, such as an alphabetic character for a @@ -459,6 +485,7 @@ the number of conversions which were successfully completed is returned. .Xr getc 3 , .Xr mbrtowc 3 , .Xr printf 3 , +.Xr scanf_l 3 , .Xr strtod 3 , .Xr strtol 3 , .Xr strtoul 3 , @@ -469,7 +496,7 @@ The functions .Fn scanf , .Fn sscanf , .Fn vfscanf , -.Fn vscanf +.Fn vscanf , and .Fn vsscanf conform to