1*0a6a1f1dSLionel Sambuc.\" $NetBSD: termcap.3,v 1.8 2014/03/18 18:20:38 riastradh Exp $ 251e66a47SVivek Prakash.\" 351e66a47SVivek Prakash.\" Copyright (c) 2009 The NetBSD Foundation, Inc. 451e66a47SVivek Prakash.\" All rights reserved. 551e66a47SVivek Prakash.\" 651e66a47SVivek Prakash.\" This code is derived from software contributed to The NetBSD Foundation 751e66a47SVivek Prakash.\" by Roy Marples. 851e66a47SVivek Prakash.\" 951e66a47SVivek Prakash.\" Redistribution and use in source and binary forms, with or without 1051e66a47SVivek Prakash.\" modification, are permitted provided that the following conditions 1151e66a47SVivek Prakash.\" are met: 1251e66a47SVivek Prakash.\" 1. Redistributions of source code must retain the above copyright 1351e66a47SVivek Prakash.\" notice, this list of conditions and the following disclaimer. 1451e66a47SVivek Prakash.\" 2. Redistributions in binary form must reproduce the above copyright 1551e66a47SVivek Prakash.\" notice, this list of conditions and the following disclaimer in the 1651e66a47SVivek Prakash.\" documentation and/or other materials provided with the distribution. 1751e66a47SVivek Prakash.\" 1851e66a47SVivek Prakash.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 1951e66a47SVivek Prakash.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 2051e66a47SVivek Prakash.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 2151e66a47SVivek Prakash.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 2251e66a47SVivek Prakash.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2351e66a47SVivek Prakash.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2451e66a47SVivek Prakash.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2551e66a47SVivek Prakash.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2651e66a47SVivek Prakash.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2751e66a47SVivek Prakash.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2851e66a47SVivek Prakash.\" POSSIBILITY OF SUCH DAMAGE. 2951e66a47SVivek Prakash.\" 300c3ae37fSLionel Sambuc.Dd March 14, 2011 3151e66a47SVivek Prakash.Dt TERMCAP 3 3251e66a47SVivek Prakash.Os 3351e66a47SVivek Prakash.Sh NAME 3451e66a47SVivek Prakash.Nm tgetent , 3551e66a47SVivek Prakash.Nm tgetnum , 3651e66a47SVivek Prakash.Nm tgetflag , 3751e66a47SVivek Prakash.Nm tgetstr , 3851e66a47SVivek Prakash.Nm tgoto , 3951e66a47SVivek Prakash.Nm tputs 4051e66a47SVivek Prakash.Nd terminal independent operation routines 4151e66a47SVivek Prakash.Sh LIBRARY 4251e66a47SVivek Prakash.Lb libtermcap 4351e66a47SVivek Prakash.Sh SYNOPSIS 4451e66a47SVivek Prakash.In termcap.h 4551e66a47SVivek Prakash.Vt char PC ; 4651e66a47SVivek Prakash.Vt char *BC ; 4751e66a47SVivek Prakash.Vt char *UP ; 4851e66a47SVivek Prakash.Ft int 4951e66a47SVivek Prakash.Fn tgetent "char *bp" "const char *name" 5051e66a47SVivek Prakash.Ft int 5151e66a47SVivek Prakash.Fn tgetnum "const char *id" 5251e66a47SVivek Prakash.Ft int 5351e66a47SVivek Prakash.Fn tgetflag "const char *id" 5451e66a47SVivek Prakash.Ft char * 5551e66a47SVivek Prakash.Fn tgetstr "const char *id" "char **area" 5651e66a47SVivek Prakash.Ft char * 5751e66a47SVivek Prakash.Fn tgoto "const char *cm" "int destcol" "int destline" 5851e66a47SVivek Prakash.Sh DESCRIPTION 5951e66a47SVivek PrakashThese functions extract and use capabilities from a terminal capability 6051e66a47SVivek Prakashdatabase. 6151e66a47SVivek PrakashThey exist as wrappers around equivalent 6251e66a47SVivek Prakash.Xr terminfo 3 6351e66a47SVivek Prakashfunctions, which new code should use. 6451e66a47SVivek PrakashThese are low level routines; see 6551e66a47SVivek Prakash.Xr curses 3 6651e66a47SVivek Prakashfor a higher level package. 6751e66a47SVivek Prakash.Pp 6851e66a47SVivek PrakashThe 6951e66a47SVivek Prakash.Fn tgetent 7051e66a47SVivek Prakashfunction calls 7151e66a47SVivek Prakash.Fn setupterm 7251e66a47SVivek Prakashand configures 7351e66a47SVivek Prakash.Va PC , 7451e66a47SVivek Prakash.Va UP 7551e66a47SVivek Prakashand 7651e66a47SVivek Prakash.Va BC . 7751e66a47SVivek PrakashOnly 7851e66a47SVivek Prakash.Va PC 7951e66a47SVivek Prakashis actually used internally. 8051e66a47SVivek PrakashThe 8151e66a47SVivek Prakash.Fn tgetent 8251e66a47SVivek Prakashfunction returns \-1 if none of the 8351e66a47SVivek Prakash.Nm terminfo 8451e66a47SVivek Prakashdata base files could be opened, 8551e66a47SVivek Prakash0 if the terminal name given does not match an entry, 8651e66a47SVivek Prakashand 1 if all goes well. 8751e66a47SVivek PrakashThe 8851e66a47SVivek Prakash.Fa bp 8951e66a47SVivek Prakashargument is not used. 9051e66a47SVivek Prakash.Pp 9151e66a47SVivek PrakashThe 9251e66a47SVivek Prakash.Fn tgetnum 9351e66a47SVivek Prakashfunction gets the numeric value of the capability 9451e66a47SVivek Prakash.Fa id , 9551e66a47SVivek Prakashreturning \-1 if it is not given for the terminal. 9651e66a47SVivek PrakashThe 9751e66a47SVivek Prakash.Fn tgetflag 9851e66a47SVivek Prakashfunction returns 1 if the specified capability is present in the terminal's 9951e66a47SVivek Prakashentry, 0 if it is not. 10051e66a47SVivek PrakashThe 10151e66a47SVivek Prakash.Fn tgetstr 10251e66a47SVivek Prakashfunction returns the string value of the capability 10351e66a47SVivek Prakash.Fa id . 10451e66a47SVivek PrakashThis is a 10551e66a47SVivek Prakash.Xr terminfo 5 10651e66a47SVivek Prakashstring and not a 10751e66a47SVivek Prakash.Nm termcap 10851e66a47SVivek Prakashstring; 10951e66a47SVivek Prakashas such it should only be processed by 11051e66a47SVivek Prakash.Fn tgoto . 11151e66a47SVivek PrakashThe 11251e66a47SVivek Prakash.Fn tgetstr 11351e66a47SVivek Prakashfunction returns 11451e66a47SVivek Prakash.Dv NULL 11551e66a47SVivek Prakashif the capability was not found. 11651e66a47SVivek PrakashThe 11751e66a47SVivek Prakash.Fa area 11851e66a47SVivek Prakashargument is unused. 11951e66a47SVivek Prakash.Pp 12051e66a47SVivek PrakashThe 12151e66a47SVivek Prakash.Fn tgoto 12251e66a47SVivek Prakashfunction returns a cursor addressing string decoded from 12351e66a47SVivek Prakash.Fa cm 12451e66a47SVivek Prakashto go to column 12551e66a47SVivek Prakash.Fa destcol 12651e66a47SVivek Prakashin line 1270c3ae37fSLionel Sambuc.Fa destline , 1280c3ae37fSLionel Sambucor 1290c3ae37fSLionel Sambuc.Dv NULL 1300c3ae37fSLionel Sambucon error conditions such as out of memory. 1310c3ae37fSLionel SambucPlease note that 1320c3ae37fSLionel Sambuc.Fn tgoto 1330c3ae37fSLionel Sambuccan return an incomplete value on a malformed input sequence. 1340c3ae37fSLionel SambucHistorically 1350c3ae37fSLionel Sambuc.Fn tgoto 1360c3ae37fSLionel Sambucused to return 1370c3ae37fSLionel Sambuc.Dq OOPS 1380c3ae37fSLionel Sambucon those conditions, so newer programs should now be checking the return 1390c3ae37fSLionel Sambucvalue. 14051e66a47SVivek Prakash.Sh SEE ALSO 14151e66a47SVivek Prakash.Xr terminfo 3 , 14251e66a47SVivek Prakash.Xr terminfo 5 14351e66a47SVivek Prakash.Sh HISTORY 14451e66a47SVivek Prakash.Nm termcap 14551e66a47SVivek Prakashfirst appeared in 4.0BSD. 14651e66a47SVivek Prakash.Nx 1.5 14751e66a47SVivek Prakashintroduced some 14851e66a47SVivek Prakash.Nm termcap 14951e66a47SVivek Prakash.Fn t_* 15051e66a47SVivek Prakashextensions which were removed in 15151e66a47SVivek Prakash.Nx 6.0 15251e66a47SVivek Prakashwhen 15351e66a47SVivek Prakash.Xr terminfo 3 15451e66a47SVivek Prakashwas introduced. 15551e66a47SVivek Prakash.Sh AUTHORS 15684d9c625SLionel Sambuc.An Roy Marples Aq Mt roy@NetBSD.org 157