Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

orientation(5) [hpux man page]

orientation(5)							File Formats Manual						    orientation(5)

NAME
orientation - the orientation of a stream DESCRIPTION
The orientation of a stream is a property of a object that is handled as a input/output stream. It is useful when the input/output model assumes that characters are handled as wide-characters within an application and stored as multi-byte characters in files, and that all the wide-character input/output functions begin executing with the stream positioned at the boundary between two multi-byte characters. After a stream is associated with a file, but before any operations are performed on the stream, the stream is without orientation. If a wide-character input or output function is applied to a stream without orientation, the stream becomes wide-oriented implicitly. Likewise, if a byte input or output operation is applied to a stream without orientation, the stream becomes byte-oriented implicitly. Only the function can alter the orientation of a stream explicitly when the stream is without orientation. Just after a stream is associated with a pipe by the function, the stream is byte-oriented. After the stream becomes byte-oriented or wide-oriented, the orientation of a stream will be fixed and can not be changed until the stream is closed. The following functions are wide-character input/output functions. The following functions are byte input/output functions. EXAMPLES
To read characters from a stream when the orientation of the stream is unknown : WARNINGS
If byte input/output functions are applied to a wide-oriented stream or wide-character input/output functions are applied to a byte-ori- ented stream, the behavior is undefined. AUTHOR
The functionality of the orientation of a stream was developed by HP and Mitsubishi Electric Corporation. SEE ALSO
fgetws(3C), fopen(3S), fread(3S), fwide(3C), fwprintf(3C), fwscanf(3C), getc(3S), gets(3S), getwc(3C), popen(3S), printf(3S), putc(3S), puts(3S), putwc(3C), putws(3C), scanf(3S), ungetc(3S), ungetwc(3C). orientation(5)

Check Out this Related Man Page

FWIDE(3)						     Linux Programmer's Manual							  FWIDE(3)

NAME
fwide - set and determine the orientation of a FILE stream SYNOPSIS
#include <wchar.h> int fwide(FILE *stream, int mode); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): fwide(): _XOPEN_SOURCE >= 500 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L DESCRIPTION
When mode is zero, the fwide() function determines the current orientation of stream. It returns a positive value if stream is wide-char- acter oriented, that is, if wide-character I/O is permitted but char I/O is disallowed. It returns a negative value if stream is byte ori- ented--that is, if char I/O is permitted but wide-character I/O is disallowed. It returns zero if stream has no orientation yet; in this case the next I/O operation might change the orientation (to byte oriented if it is a char I/O operation, or to wide-character oriented if it is a wide-character I/O operation). Once a stream has an orientation, it cannot be changed and persists until the stream is closed. When mode is nonzero, the fwide() function first attempts to set stream's orientation (to wide-character oriented if mode is greater than 0, or to byte oriented if mode is less than 0). It then returns a value denoting the current orientation, as above. RETURN VALUE
The fwide() function returns the stream's orientation, after possibly changing it. A positive return value means wide-character oriented. A negative return value means byte oriented. A return value of zero means undecided. CONFORMING TO
POSIX.1-2001, POSIX.1-2008, C99. NOTES
Wide-character output to a byte oriented stream can be performed through the fprintf(3) function with the %lc and %ls directives. Char oriented output to a wide-character oriented stream can be performed through the fwprintf(3) function with the %c and %s directives. SEE ALSO
fprintf(3), fwprintf(3) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. GNU
2016-03-15 FWIDE(3)
Man Page