TERMDEF(3,L) AIX Technical Reference TERMDEF(3,L)
-------------------------------------------------------------------------------
termdef
PURPOSE
Queries terminal characteristics.
LIBRARY
Standard C Library (libc.a)
SYNTAX
char *termdef (fildes, c)
int fildes;
char c;
DESCRIPTION
The termdef subroutine returns a pointer to a null-terminated static character
string that identifies a characteristic of the terminal that is open on the
file descriptor specified by the fildes parameter. The c parameter specifies
the characteristic that is to be queried. termdef determines this information
by performing the following actions:
1. It queries the terminal device, using the Query HFT Device command, which
is discussed on page hft-28.
2. If the query fails, then termdef uses the value of an environment
variable.
3. If the environment variable is not set, then termdef returns the default
value specified in the following table.
The following list shows the valid request types and the corresponding
environment variables that are used if the Query HFT Device command fails:
Environment Default
c Variable Value Description
t TERM ""ibm5151"" The terminal type
l LINES NULL The number of lines or rows, based on the
current font
c COLUMNS NULL The number of character columns, based on the
current font.
Note: When fildes identifies an asynchronous terminal, the Query HFT Device
command always fails and the environment variable is always checked.
The TERM variable is automatically set each time you log in. LINES and
COLUMNS need to be set only if:
Processed November 7, 1990 TERMDEF(3,L) 1
TERMDEF(3,L) AIX Technical Reference TERMDEF(3,L)
o You are using an asynchronous terminal and want to override the
lines and cols settings in the terminfo data base, or
o Your asynchronous terminal has an unusual number of lines or columns
and you are running an application that uses termdef, but not
terminfo.
This is true because the terminfo initialization subroutine, setupterm,
calls termdef to determine the number of lines and columns on the
display. If termdef cannot supply this information, then setupterm uses
the values in the terminfo data base.
RELATED INFORMATION
"Terminfo Level Subroutines," "terminfo," and "Query HFT Device Command."
The display and termdef commands in AIX Operating System Commands Reference.
Processed November 7, 1990 TERMDEF(3,L) 2