Standards / Extensions | C or C++ | Dependencies |
---|---|---|
ISO C Amendment |
both | z/OS® V1R7 |
#define _MSE_PROTOS
#include <stdio.h>
#include <wchar.h>
int fwscanf(FILE *__restrict__ stream,
const wchar_t *__restrict__ format, ... );
int swscanf(const wchar_t * __restrict__ wcs,
const wchar_t * __restrict__ format, …);
int wscanf(const wchar_t *__restrict__ format, ... );
#define _OPEN_SYS_UNLOCKED_EXT 1
#include <wchar.h>
int fwscanf_unlocked(FILE *__restrict__ stream,
const wchar_t *__restrict__ format, ... );
int wscanf_unlocked(const wchar_t *__restrict__ format, ... );
#define _XOPEN_SOURCE
#define _MSE_PROTOS
#include <wchar.h>
int swscanf(const wchar_t *wcs, const wchar_t *format, …);
The fwscanf(), swscanf(), and wscanf() functions are equivalent to fscanf(), scanf(), and sscanf() respectively, except for the following:
fwscanf_unlocked() family is functionally equivalent to fwscanf() family with the exception that they are not thread-safe. These functions can safely be used in a multithreaded application if and only if they are called while the invoking thread owns the (FILE*) object, as is the case after a successful call to either the flockfile() or ftrylockfile() function.
Special behavior for XPG4 and swscanf(): If you define any feature test macro specifying XPG4 behavior before the statement in your program source file to include the wchar header, then you must also define the _MSE_PROTOS feature test macro to make the declaration of the swscanf() function in the wchar header available when you compile your program. Please see Table 1 for a list of XPG4 and other feature test macros.
If successful, they either return the number of input items assigned, which can be fewer than provided for, or 0 in the event of an early matching failure. If an input failure occurs before any conversion, EOF is returned.