#include <ttyio.h> #include <stdio.h> ret = _ttyio(term,action);
"_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.
VIP function code mode is used when you want to intercept input from special keys on some varieties of synchronous VIP terminals (e.g. Questars). This mode can only be used with input terminals; it cannot be used with output terminals.
When you press a function key on an appropriate synchronous terminal, it transmits one or two characters, but these are not usually directed along the normal input stream. Such keys are "invisible" to the program when you are working in normal mode.
If you use "_ttyio" to turn on VIP function code mode, the library's input routines will deliver such codes to your program in the normal input stream. The character(s) transmitted by the special key will be preceded by the ESC character. For example, if the key sends the character X, the input stream will contain the two characters ESC X. If the key sends the two characters X and Y, the input stream will contain ESC X ESC Y.
expl nsc lib _viphdr
Copyright © 1996, Thinkage Ltd.