The terminal I/O package provides function calls for reading and writing to the terminal associated with an interactive program.
The screen-oriented functions (clear screen, position cursor, etc.) work only for CRTs that are supported by TAE. The types of CRT terminals supported depend upon the host system. The VAX/VMS implementation of TAE supports VT100, VT52, and any other terminal for which the installation has TERMTABLE support. UNIX implementations of TAE support any CRT described in the /etc/termcap file.
Note that the t_init function must be called once before any other t_ calls are executed. Along with determining the number of lines and columns for a CRT terminal, t_init determines the type of terminal (T_CRT, T_NOTCRT, or T_NOTTERM). Section 4.3 describes t_init in more detail.
Also note that for all cursor positioning functions, line 1, column 1 is the upper left on the screen.
CODE t_clear ()
Function return:
Argument: None
t_clear is called to clear the CRT screen. After the screen is cleared, the cursor is positioned at line 1, column 1. t_clear requires a terminal type of T_CRT (See section 4.3.).
COUNT t_highlight (string)
Function return:
Argument:
string: input/output, TEXT string[];
String to be highlighted.
t_highlight produces a new string with the necessary escape sequences for highlighting.
CODE t_init (lines, columns, type)
Function return:
Arguments:
lines: output, COUNT *lines;
Number of lines for the CRT terminal. Lines is zero if the terminal is not a CRT or if the terminal is of unknown type.
columns: output, COUNT *columns;
Number of columns for a CRT terminal. Columns is zero if the terminal is not a CRT or if the terminal is of unknown type.
type: output, CODE *type;
t_init is the initialization call for the t_ package. Lines, columns, and type are integer output arguments describing characteristics of the terminal associated with the process. t_init must be called once before any other t_ calls.
NOTE: In some cases, when the "terminal" is an X Window System terminal emulator, t_init is not appropriate. See t_pinit for an appropriate alternative.
CODE tinput (line, column, string, term)
Function return:
Arguments:
line: input, FUNINT line;
Line number, starting at 1, of initial cursor position.
column: input, FUNINT column;
Column number, starting at 1, of initial cursor position.
string: output, TEXT string[STRINGSIZ+1];
Output character string. This string does not include the terminator. String should be declared large enough to hold the longest line.
term: output, CODE *term;
The t_input reads characters from the terminal at the specified line and column. The user may terminate the line with a carriage return or an escape. t_input requires a terminal type of T_CRT.
CODE t_lclear (line, column)
Function return:
Arguments:
line: input, FUNINT line;
Line number, starting at 1, to clear.
column: input, FUNINT column;
Column number, starting at 1, to begin clearing the line.
t_lclear will clear everything to the right of and including the specified column number for the line number specified. t_lclear requires a terminal type of T_CRT.
CODE t_output (line, column, string)
Function return:
Arguments:
line: input, FUNINT line;
Line number, starting at 1, of first character position.
column: input, FUNINT column;
Column number, starting at 1, of first character position.
string: input, TEXT string[];
Character string to be written to the CRT terminal.
t_output writes a character string beginning at the specified cursor location. The characters are written exactly as contained in string--there is no automatic carriage control. If the string extends beyond the rightmost column, the results are undefined. t_output requires a terminal type of T_CRT.
CODE t_pinit (termlines, termcols, termtype)
Function return:
Arguments:
lines: output, COUNT *lines;
Number of lines for the CRT terminal. Lines is zero if the terminal is not a CRT or if the terminal is of unknown type.
columns: output, COUNT *columns;
Number of columns for a CRT terminal. Columns is zero if the terminal is not a CRT or if the terminal is of unknown type.
type: output, CODE *type;
t_pinit is used for "process initialization" of the terminal. t_pinit is identical to t_init with the exception that the terminal is not reset. This function allows a process to avoid re-initializing a terminal that has already been initialized by TAE's Monitor. t_pinit exists because initializing some terminals (e.g., the terminal emulator under the X Window System) causes the screen to clear, often an undesirable effect.
To use t_pinit in a process, place the call before all other TAE function calls, including z_init.
CODE t_pos (line, column)
Function return:
Arguments:
line: input, FUNINT line;
Line number, starting at 1, for cursor position.
column: input, FUNINT column;
Column number, starting at 1, for cursor position.
t_pos positions the CRT cursor. If line and/or column exceed the CRT's dimensions, the result is undefined. t_pos requires a terminal type of T_CRT.
CODE t_read (string, term)
Function return:
Arguments:
string: output, TEXT string[STRINGSIZ+1];
Output character string. This string does not include the terminator. String should be declared large enough to hold the longest line.
term: output, CODE *term;
t_read reads a line from the terminal. It is used for terminal input when the caller does not depend upon the terminal being a cursor addressable CRT. The user may terminate the line with a carriage return or an escape.
CODE t_write (string, cc)
Function return:
Arguments:
string: input, TEXT string[];
The string to be written to the terminal.
cc: input, FUNINT cc;
The type of carriage control desired:
t write writes a line to the terminal. It is used for terminal output when the caller does not depend upon the terminal being a cursor addressable CRT.