_TTYIO - change terminal processing.

Usage:

#include <ttyio.h>
#include <stdio.h>
ret = _ttyio(term,action);

Where:

FILE *term;
is associated with a terminal.
int action;
is a symbol telling how you want to change the terminal handling. Possible symbols are defined in <ttyio.h>. They are:
TY_sraw
sets (turns on) "raw" mode. Raw mode is described below.
TY_rraw
resets (turns off) raw mode.
int ret;
is -1 if "_ttyio" believes it has failed to set the mode you requested. Otherwise "ret" is 0. Note that "_ttyio" cannot always tell whether or not it was successful; therefore -1 is a definite failure, but 0 is not a sure success.

Description:

"_ttyio" changes the way the library handles I/O on a terminal.

Setting raw mode on an input terminal tells the library not to convert carriage returns ('\r') into new-lines ('\n'). In addition, the ASCII FS (CTRL-\) will not be recognized as end of file.

For VIP terminals transmitting multiple lines, raw mode also prevents stripping of carriage returns in the embedded carriage return/line feed sequences. It also prevents the library from echoing the missing carriage return on the last line of VIP input.

Setting raw mode on an output terminal stops the library from converting new-lines ('\n') into carriage return/linefeeds ('\r\n'), and also prevents normal pending linefeed processing.

The only time you'll need raw mode for a terminal is in special applications for VIP terminals. If you set raw mode on an input terminal, it is usually desirable to set raw mode on the corresponding output terminal, and vice versa.

Copyright © 1996, Thinkage Ltd.