HP-UX Reference (11i v2 07/12) - 3 Library Functions A-M (vol 6)

f
fwscanf(3C) fwscanf(3C)
s Matches a sequence of non white-space wide-characters. If no
l (ell) qualifier is present,
characters from the input field are converted as if by repeated calls to the
wcrtomb()
function, with the conversion state described by an mbstate_t object initialized to zero
before the first wide-character is converted. The corresponding argument must be a
pointer to a character array large enough to accept the sequence and the terminating null
character, which will be added automatically.
Otherwise, the corresponding argument must be a pointer to an array of wchar_t large enough to accept
the sequence and the terminating null wide-character, which will be added automatically.
[ Matches a non-empty sequence of wide-characters from a set of expected wide-characters
(the scanset). If no l (ell) qualifier is present, wide-characters from the input field are con-
verted as if by repeated calls to the
wcrtomb() function, with the conversion state
described by an mbstate_t object initialized to zero before the first wide-character is con-
verted. The corresponding argument must be a pointer to a character array large enough
to accept the sequence and the terminating null character, which will be added automati-
cally.
If an
l (ell) qualifier is present, the corresponding argument must be a pointer to an array of wchar_t large
enough to accept the sequence and the terminating null wide-character, which will be added automatically.
The conversion specification includes all subsequent wide characters in the format string up to and includ-
ing the matching right square bracket ( ]). The wide-characters between the square brackets (the scanlist)
comprise the scanset, unless the wide-character after the left square bracket is a circumflex (
ˆ), in which
case the scanset contains all wide-characters that do not appear in the scanlist between the circumflex and
the right square bracket. If the conversion specification begins with
[] or [ˆ], the right square bracket is
included in the scanlist and the next right square bracket is the matching right square bracket that ends
the conversion specification; otherwise the first right square bracket is the one that ends the conversion
specification. If a
- is in the scanlist and is not the first wide-character, nor the second where the first
wide-character is a ˆ
, nor the last wide-character, the behavior is implementation-dependent.
c Matches a sequence of wide-characters of the number specified by the field width (1 if no
field width is present in the conversion specification). If no
l (ell) qualifier is present,
wide-characters from the input field are converted as if by repeated calls to the
wcrtomb() function, with the conversion state described by an mbstate_t object initial-
ized to zero before the first wide-character is converted. The corresponding argument must
be a pointer to a character array large enough to accept the sequence. No null character is
added. Otherwise, the corresponding argument must be a pointer to an array of wchar_t
large enough to accept the sequence. No null wide-character is added.
p Matches an implementation-dependent set of sequences, which must be the same as the set
of sequences that is produced by the %p conversion of the corresponding
fwprintf()
functions. The corresponding argument must be a pointer to a pointer to void. If the input
item is a value converted earlier during the same program execution, the pointer that
results will compare equal to that value; otherwise the behavior of the %p conversion is
undefined.
n No input is consumed. The corresponding argument must be a pointer to the integer into
which is to be written the number of wide-characters read from the input so far by this call
to the fwscanf() functions. Execution of a %n conversion specification does not incre-
ment the assignment count returned at the completion of execution of the function.
C Same as lc.
S Same as ls.
% Matches a sigle %; no conversion or assignment occurs. The complete conversion
specification must be %%.
If a conversion specification is invalid, the behavior is undefined.
The conversion characters E, G and X are also valid and behave the same as, respectively, e, g and x
.
If end-of-file is encountered during input, conversion is terminated. If end-of-file occurs before any wide-
characters matching the current conversion specification (except for
%n) have been read (other than leading
white-space, where permitted), execution of the current conversion specification terminates with an input
failure. Otherwise, unless execution of the current conversion specification is terminated with a matching
failure, execution of the following conversion specification (if any) is terminated with an input failure.
458 Hewlett-Packard Company 3 HP-UX 11i Version 2: December 2007 Update