Next: viprintf, Previous: vfwprintf, Up: Stdio [Contents][Index]

### 4.73 `vfwscanf`, `vwscanf`, `vswscanf`—scan and format argument list from wide character input

Synopsis

    #include <stdio.h>
    #include <stdarg.h>
    int vwscanf(const wchar_t *__restrict fmt, va_list list);
    int vfwscanf(FILE *__restrict fp,
        const wchar_t *__restrict fmt, va_list list);
    int vswscanf(const wchar_t *__restrict str,
        const wchar_t *__restrict fmt, va_list list);

    int _vwscanf(struct _reent *reent, const wchar_t *fmt,
        va_list list);
    int _vfwscanf(struct _reent *reent, FILE *fp,
        const wchar_t *fmt, va_list list);
    int _vswscanf(struct _reent *reent, const wchar_t *str,
        const wchar_t *fmt, va_list list);

Description
`vwscanf`, `vfwscanf`, and `vswscanf` are (respectively) variants of `wscanf`, `fwscanf`, and `swscanf`. They differ only in allowing their caller to pass the variable argument list as a `va_list` object (initialized by `va_start`) rather than directly accepting a variable number of arguments.

Returns
The return values are consistent with the corresponding functions: `vwscanf` returns the number of input fields successfully scanned, converted, and stored; the return value does not include scanned fields which were not stored.

If `vwscanf` attempts to read at end-of-file, the return value is `EOF`.

If no fields were stored, the return value is `0`.

The routines `_vwscanf`, `_vfwscanf`, and `_vswscanf` are reentrant versions which take an additional first parameter which points to the reentrancy structure.

Portability
C99, POSIX-1.2008