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 per-
forming the following actions:
1. It queries the terminal device, using the Query HFT
Device command, which is discussed on page 4-60.
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 envi-
ronment variable is always checked. The TERM variable is
automatically set each time you log in. LINES and
COLUMNS need to be set only if:
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 subrou-
tine, 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
In this book: "Terminfo Level Subroutines," "terminfo,"
and "Query HFT Device Command."
The display and termdef commands in AIX Operating System
Commands Reference.