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
13   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
14
15       fwide():
16           _XOPEN_SOURCE >= 500 || _ISOC99_SOURCE ||
17           _ISOC95_SOURCE /* Since glibc 2.12 */ ||
18           _POSIX_C_SOURCE >= 200112L;
19           or cc -std=c99
20

DESCRIPTION

22       When mode is zero, the fwide() function determines the current orienta‐
23       tion of stream.  It returns a positive value if stream is  wide-charac‐
24       ter  oriented, that is, if wide-character I/O is permitted but char I/O
25       is disallowed.  It returns a negative value if stream is byte oriented,
26       i.e.,  if  char  I/O is permitted but wide-character I/O is disallowed.
27       It returns zero if stream has no orientation yet; in this case the next
28       I/O operation might change the orientation (to byte oriented if it is a
29       char I/O operation, or to wide-character oriented if it is a wide-char‐
30       acter I/O operation).
31
32       Once  a  stream  has  an orientation, it cannot be changed and persists
33       until the stream is closed.
34
35       When mode is nonzero,  the  fwide()  function  first  attempts  to  set
36       stream's  orientation  (to  wide-character  oriented if mode is greater
37       than 0, or to byte oriented if mode is less than 0).  It then returns a
38       value denoting the current orientation, as above.
39

RETURN VALUE

41       The  fwide()  function returns the stream's orientation, after possibly
42       changing it.  A positive return value means wide-character oriented.  A
43       negative  return  value  means  byte  oriented.  A return value of zero
44       means undecided.
45

CONFORMING TO

47       C99, POSIX.1-2001.
48

NOTES

50       Wide-character output to  a  byte  oriented  stream  can  be  performed
51       through the fprintf(3) function with the %lc and %ls directives.
52
53       Char  oriented  output  to a wide-character oriented stream can be per‐
54       formed through the fwprintf(3) function with the %c and %s directives.
55

SEE ALSO

57       fprintf(3), fwprintf(3)
58

COLOPHON

60       This page is part of release 3.53 of the Linux  man-pages  project.   A
61       description  of  the project, and information about reporting bugs, can
62       be found at http://www.kernel.org/doc/man-pages/.
63
64
65
66GNU                               2011-09-17                          FWIDE(3)
Impressum