fwide

Sets the stream orientation, either byte or wide.

Library:LibC
Classification:ANSI
Service:Characters and Strings

Syntax

  #include <wchar.h> 
   
  int  fwide (
     struct _iobuf   *fp,
     int              mode);
  

Parameters

fp

(IN) Points to the stream.

mode

(IN) Specifies the mode of the stream:

  • If less than 0, attempts to make the stream byte-oriented.
  • If greater than 0, attempts to make the stream wide-oriented.
  • If 0, returns the mode of the stream.

Return Values

Returns a value greater than zero if, after the call, the stream has wide orientation, a value less than zero if the stream has byte-orientation, or zero if the stream has no orientation. If the orientation has already been set, this function does not change it.

No value is reserved to indicate an error. If you want to check for error conditions, you must set errno to 0 before calling this function. If an error occurs, the function sets errno to the following:

Decimal

Constant

Description

4

EBADF

The file descriptor is not a valid file descriptor open for writing.

See Also

putwc