2 * Code created by modifying iscanf.c which has following copyright.
4 * Copyright (c) 1990 The Regents of the University of California.
7 * Redistribution and use in source and binary forms are permitted
8 * provided that the above copyright notice and this paragraph are
9 * duplicated in all such forms and that any documentation,
10 * and/or other materials related to such
11 * distribution and use acknowledge that the software was developed
12 * by the University of California, Berkeley. The name of the
13 * University may not be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22 <<viscanf>>, <<vfiscanf>>, <<vsiscanf>>---format argument list
40 int viscanf(const char *<[fmt]>, va_list <[list]>);
41 int vfiscanf(FILE *<[fp]>, const char *<[fmt]>, va_list <[list]>);
42 int vsiscanf(const char *<[str]>, const char *<[fmt]>, va_list <[list]>);
44 int _viscanf_r(struct _reent *<[reent]>, const char *<[fmt]>,
46 int _vfiscanf_r(struct _reent *<[reent]>, FILE *<[fp]>, const char *<[fmt]>,
48 int _vsiscanf_r(struct _reent *<[reent]>, const char *<[str]>,
49 const char *<[fmt]>, va_list <[list]>);
52 <<viscanf>>, <<vfiscanf>>, and <<vsiscanf>> are (respectively) variants
53 of <<iscanf>>, <<fiscanf>>, and <<siscanf>>. They differ only in
54 allowing their caller to pass the variable argument list as a
55 <<va_list>> object (initialized by <<va_start>>) rather than
56 directly accepting a variable number of arguments.
59 The return values are consistent with the corresponding functions:
60 <<viscanf>> returns the number of input fields successfully scanned,
61 converted, and stored; the return value does not include scanned
62 fields which were not stored.
64 If <<viscanf>> attempts to read at end-of-file, the return value
67 If no fields were stored, the return value is <<0>>.
69 The routines <<_viscanf_r>>, <<_vfiscanf_f>>, and <<_vsiscanf_r>> are
70 reentrant versions which take an additional first parameter which points to the
74 These are newlib extensions.
76 Supporting OS subroutines required:
88 viscanf (const char *fmt
,
91 struct _reent
*reent
= _REENT
;
93 _REENT_SMALL_CHECK_INIT (reent
);
94 return __svfiscanf_r (reent
, _stdin_r (reent
), fmt
, ap
);
97 #endif /* !_REENT_ONLY */
100 _viscanf_r (struct _reent
*ptr
,
104 _REENT_SMALL_CHECK_INIT (ptr
);
105 return __svfiscanf_r (ptr
, _stdin_r (ptr
), fmt
, ap
);