FSETTEXT(3)

NAME
fsettext, fsetbinary - set the newline translation mode for a stdio stream.

SYNOPSIS
#include <stdio.h>

void fsettext (FILE *fp);
void fsetbinary (FILE *fp);

DESCRIPTION
The FILE struct for each stdio stream contains information as to whether or not newline translation (carrige return to linefeed and back) will occur for that stream. This translation mode is set when the stream is opened by passing (or not passing) the "b" flag modifier to fopen(3), fdopen(3), or freopen(3).

The stdio streams that are already open upon entry into the main routine (stdin, stdout, and stderr) by default do newline translations. The fsetbinary macro allows these translations to be disabled. The fsettext macro allows these translations to be reenabled. These macros are not necessary and should not be used for any other stream pointers, other than as described in the funopen(3) manual page.

These macros must be used before any I/O is performed on the associated stream. If I/O has already been performed, the results are undefined.

STANDARDS
fsetbinary and fsettext are non-standard routines, and should not be used for programs intended to be ported to other platforms.

SEE ALSO
fflush(3), fopen(3), stdio(3)