home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
gnu
/
man
/
cat3
/
termcap.0
< prev
next >
Wrap
Text File
|
1993-12-07
|
6KB
|
133 lines
TERMCAP(3) UNIX Programmer's Manual TERMCAP(3)
NNAAMMEE
ttggeetteenntt, ttggeettnnuumm, ttggeettffllaagg, ttggeettssttrr, ttggoottoo, ttppuuttss - terminal independent
operation routines
SSYYNNOOPPSSIISS
_c_h_a_r _P_C_;
_c_h_a_r _*_B_C_;
_c_h_a_r _*_U_P_;
_s_h_o_r_t _o_s_p_e_e_d_;
ttggeetteenntt(_c_h_a_r _*_b_p, _c_h_a_r _*_n_a_m_e)
ttggeettnnuumm(_c_h_a_r _*_i_d)
ttggeettffllaagg(_c_h_a_r _*_i_d)
_c_h_a_r _*
ttggeettssttrr(_c_h_a_r _*_i_d, _c_h_a_r _*_a_r_e_a)
_c_h_a_r _*
ttggoottoo(_c_h_a_r _*_c_m, _d_e_s_t_c_o_l, _d_e_s_t_l_i_n_e)
ttppuuttss(_r_e_g_i_s_t_e_r _c_h_a_r _*_c_p, _i_n_t _a_f_f_c_n_t, _i_n_t _(_*_o_u_t_c_)_(_))
DDEESSCCRRIIPPTTIIOONN
These functions extract and use capabilities from a terminal capability
data base, usually _/_u_s_r_/_s_h_a_r_e_/_m_i_s_c_/_t_e_r_m_c_a_p, the format of which is de
scribed in termcap(5). These are low level routines; see curses(3) for a
higher level package.
The ttggeetteenntt() function extracts the entry for terminal _n_a_m_e into the
buffer at _b_p. The _b_p argument should be a character buffer of size 1024
and must be retained through all subsequent calls to ttggeettnnuumm(),
ttggeettffllaagg(), and ttggeettssttrr(). The ttggeetteenntt() function returns -1 if none of
the tteerrmmccaapp data base files could be opened, 0 if the terminal name given
does not have an entry, and 1 if all goes well. It will look in the en
vironment for a TERMCAP variable. If found, and the value does not begin
with a slash, and the terminal type _n_a_m_e is the same as the environment
string TERM, the TERMCAP string is used instead of reading a tteerrmmccaapp
file. If it does begin with a slash, the string is used as a path name
of the tteerrmmccaapp file to search. If TERMCAP does not begin with a slash
and _n_a_m_e is different from TERM, ttggeetteenntt() searches the files
_$_H_O_M_E_/_._t_e_r_m_c_a_p and _/_u_s_r_/_s_h_a_r_e_/_m_i_s_c_/_t_e_r_m_c_a_p, in that order, unless the en
vironment variable TERMPATH exists, in which case it specifies a list of
file pathnames (separated by spaces or colons) to be searched instead.
Whenever multiple files are searched and a ttcc field occurs in the re
quested entry, the entry it names must be found in the same file or one
of the succeeding files. This can speed up entry into programs that call
ttggeetteenntt(), as well as help debug new terminal descriptions or make one
for your terminal if you can't write the file _/_u_s_r_/_s_h_a_r_e_/_m_i_s_c_/_t_e_r_m_c_a_p.
The ttggeettnnuumm() function gets the numeric value of capability _i_d, returning
-1 if is not given for the terminal. The ttggeettffllaagg() function returns 1
if the specified capability is present in the terminal's entry, 0 if it
is not. The ttggeettssttrr() function returns the string value of the capabili
ty _i_d, places it in the buffer at _a_r_e_a, and advances the _a_r_e_a pointer.
It decodes the abbreviations for this field described in termcap(5), ex
cept for cursor addressing and padding information. The ttggeettssttrr() func
tion returns NULL if the capability was not found.
The ttggoottoo() function returns a cursor addressing string decoded from _c_m
to go to column _d_e_s_t_c_o_l in line _d_e_s_t_l_i_n_e. It uses the external variables
_U_P (from the uupp capability) and _B_C (if bbcc is given rather than bbss) if
necessary to avoid placing \\nn, ^^DD or ^^@@ in the returned string. (Pro
grams which call ttggoottoo() should be sure to turn off the XTABS bit(s),
since ttggoottoo() may now output a tab. Note that programs using termcap
should in general turn off XTABS anyway since some terminals use control
I for other functions, such as nondestructive space.) If a %% sequence is
given which is not understood, then ttggoottoo() returns (OOPS).
The ttppuuttss() function decodes the leading padding information of the
string _c_p; _a_f_f_c_n_t gives the number of lines affected by the operation, or
1 if this is not applicable, _o_u_t_c is a routine which is called with each
character in turn. The external variable _o_s_p_e_e_d should contain the out
put speed of the terminal as encoded by stty(3). The external variable
_P_C should contain a pad character to be used (from the capability) if a
null (^^@@) is inappropriate.
FFIILLEESS
/usr/lib/libtermcap.a --ll _l_t_e_r_m_c_a_p library (also known as --ll _l_t_e_r_m_l_i_b)
/usr/share/misc/termcap standard terminal capability data base
$HOME/.termcap user's terminal capability data base
SSEEEE AALLSSOO
ex(1), curses(3), termcap(5)
HHIISSTTOORRYY
The ttggeetteenntt functions appeared in 4.0BSD.
4th Berkeley Distribution April 19, 1991 2