TERMCAP(3) 1990 TERMCAP(3) NNAAMMEE tgetent, tgetnum, tgetflag, tgetstr, tgoto, tputs - terminal independent operation routines SSYYNNOOPPSSIISS cchhaarr PPCC;; cchhaarr **BBCC;; cchhaarr **UUPP;; sshhoorrtt oossppeeeedd;; ttggeetteenntt((bbpp,, nnaammee)) cchhaarr **bbpp,, **nnaammee;; ttggeettnnuumm((iidd)) cchhaarr **iidd;; ttggeettffllaagg((iidd)) cchhaarr **iidd;; cchhaarr ** ttggeettssttrr((iidd,, aarreeaa)) cchhaarr **iidd,, ****aarreeaa;; cchhaarr ** ttggoottoo((ccmm,, ddeessttccooll,, ddeessttlliinnee)) cchhaarr **ccmm;; ttppuuttss((ccpp,, aaffffccnntt,, oouuttcc)) rreeggiisstteerr cchhaarr **ccpp;; iinntt aaffffccnntt;; iinntt ((**oouuttcc))(());; DDEESSCCRRIIPPTTIIOONN These functions extract and use capabilities from a terminal capability data base, usually /usr/share/misc/termcap, the format of which is described in _t_e_r_m_c_a_p(5). These are low level routines; see _c_u_r_s_e_s(3X) for a higher level package. _T_g_e_t_e_n_t extracts the entry for terminal _n_a_m_e into the buffer at _b_p. _B_p should be a character buffer of size 1024 and must be retained through all subsequent calls to _t_g_e_t_n_u_m, _t_g_e_t_- _f_l_a_g, and _t_g_e_t_s_t_r. _T_g_e_t_e_n_t returns -1 if none of the termcap 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 environment 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 termcap file. If it does begin with a slash, the string is used as a path name of the termcap file to search. If TERMCAP does not begin with a slash and _n_a_m_e is different from TERM, _t_g_e_t_e_n_t searches the files $HOME/.termcap and Printed 7/27/90 June 1 TERMCAP(3) 1990 TERMCAP(3) /usr/share/misc/termcap, in that order, unless the environ- ment 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 requested 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 _t_g_e_t_e_n_t, as well as help debug new terminal descriptions or make one for your terminal if you can't write the file /usr/share/misc/termcap. _T_g_e_t_n_u_m gets the numeric value of capability _i_d, returning -1 if is not given for the terminal. _T_g_e_t_f_l_a_g returns 1 if the specified capability is present in the terminal's entry, 0 if it is not. _T_g_e_t_s_t_r returns the string value of the capability _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 _t_e_r_m_c_a_p(5), except for cursor addressing and padding information. _T_g_e_t_s_t_r returns NULL if the capa- bility was not found. _T_g_o_t_o 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 UUPP (from the uupp capability) and BBCC (if bbcc is given rather than bbss) if necessary to avoid placing \\nn, ^^DD or ^^@@ in the returned string. (Programs which call tgoto should be sure to turn off the XTABS bit(s), since _t_g_o_t_o 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 _t_g_o_t_o returns "OOPS". _T_p_u_t_s decodes the leading padding information of the string _c_p; _a_f_f_c_n_t gives the number of lines affected by the opera- tion, 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 output speed of the ter- minal as encoded by _s_t_t_y(3). The external variable PPCC should contain a pad character to be used (from the ppcc capa- bility) if a null (^^@@) is inappropriate. FFIILLEESS /usr/lib/libtermcap.a -ltermcap library (also known as -ltermlib) /usr/share/misc/termcapstandard terminal capability data base $HOME/.termcap user's terminal capability data base SSEEEE AALLSSOO ex(1), curses(3), termcap(5) Printed 7/27/90 June 2