fwide - set and determine the orientation of a FILE stream
#include <wchar.h>
int fwide(FILE *stream, int mode);
//Returns: positive if stream is wide oriented,
// negative if stream is byte oriented,
// or 0 if stream has no orientation
根据mode值不同,fwide进行不同的任务:
- mode is negative, set byte oriented
- mode is positive, set wide oriented
- mode is 0 , will not set orientation, but will return a value identifying the stream’s orientation.
注意:
* 如果stream已经oriented,fwide将不会改变 stream‘s orientation
* 没有错误值返回。
如果stream
是不合法的将会发生的情况。我们可以采取的办法就是在调用fwide
之前清除errno的值,在fwide
之后再确定errno
的值。