1FWIDE(3)                   Linux Programmer's Manual                  FWIDE(3)
2
3
4

NAME

6       fwide - set and determine the orientation of a FILE stream
7

SYNOPSIS

9       #include <wchar.h>
10
11       int fwide(FILE *stream, int mode);
12

DESCRIPTION

14       When mode is zero, the fwide() function determines the current orienta‐
15       tion of stream. It returns a value > 0 if stream is wide-character ori‐
16       ented,  i.e.  if wide character I/O is permitted but char I/O is disal‐
17       lowed. It returns a value < 0 if stream is byte oriented, i.e. if  char
18       I/O  is permitted but wide character I/O is disallowed. It returns zero
19       if stream has no orientation yet; in this case the next  I/O  operation
20       might  change  the  orientation  (to  byte oriented if it is a char I/O
21       operation, or to wide-character oriented if it is a wide character  I/O
22       operation).
23
24       Once  a  stream  has  an orientation, it cannot be changed and persists
25       until the stream is closed.
26
27       When mode is non-zero, the  fwide()  function  first  attempts  to  set
28       stream's  orientation  (to  wide-character  oriented if mode > 0, or to
29       byte oriented if mode < 0). It then returns a value denoting  the  cur‐
30       rent orientation, as above.
31

RETURN VALUE

33       The  fwide()  function returns the stream's orientation, after possibly
34       changing it. A return value > 0 means wide-character oriented. A return
35       value < 0 means byte oriented. A return value of zero means undecided.
36

CONFORMING TO

38       C99, POSIX.1-2001.
39

SEE ALSO

41       fprintf(3), fwprintf(3)
42

NOTES

44       Wide-character  output  to  a  byte  oriented  stream  can be performed
45       through the fprintf() function with the %lc and %ls directives.
46
47       Char oriented output to a wide-character oriented stream  can  be  per‐
48       formed through the fwprintf() function with the %c and %s directives.
49
50
51
52GNU                               1999-11-17                          FWIDE(3)
Impressum