1 .\" $NetBSD: terminfo.3,v 1.4 2010/02/04 09:12:56 wiz Exp $
3 .\" Copyright (c) 2009 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
43 .Nd terminal independent operation routines
50 .Vt TERMINAL *cur_term ;
52 .Fn setupterm "const char *name" "int fildes" "int *errret"
54 .Fn set_curterm "TERMINAL *term"
56 .Fn del_curterm "TERMINAL *term"
58 .Fn tigetnum "const char *id"
60 .Fn tigetflag "const char *id"
62 .Fn tigetstr "const char *id"
64 .Fn tparm "const char *cm" "long p1" "long p2" "long p3" "long p4" "long p5" "long p6" "long p7" "long p8" "long p9"
66 .Fn tputs "const char *cp" "int affcnt" "int (*outc)(int)"
68 .Fn putp "const char *cp"
70 .Fn ti_setupterm "TERMINAL **" "const char *name" "int fildes" "int *error"
72 .Fn ti_getflag "const TERMINAL *" "const char *id"
74 .Fn ti_getnum "const TERMINAL *" "const char *id"
76 .Fn ti_getstr "const TERMINAL *" "const char *id"
78 .Fn t_parm "const TERMINAL *" "const char *cm" "long p1" "long p2" "long p3" "long p4" "long p5" "long p6" "long p7" "long p8" "long p9"
80 .Fn t_parm "const char *cm" "..."
82 .Fn t_vparm "TERMINAL *" "const char *cm" "..."
84 .Fn ti_puts "const TERMINAL *term" "const char *str" "int affcnt" "int (*outc)(int, void *)"
86 .Fn ti_putp "const TERMINAL *term" "const char *str"
88 These functions extract and use capabilities from a terminal capability
90 .Pa /usr/share/misc/terminfo ,
91 the format of which is described in
93 These are low level routines;
96 for a higher level package.
100 function extracts the entry for terminal
111 then it is replaced by the environment variable
115 function returns 0 on success and \-1 on error.
119 database could not be opened,
120 0 if the terminal could not be found in the database, and
125 function sets the variable
131 boolean, numeric and string variables use the values from
143 function frees space pointed to by
148 function gets the boolean value of capability
150 returning \-1 if it is not a valid capability.
153 function gets the numeric value of the capability
155 returning \-2 if it is not a valid capability.
158 function returns the string value of the capability
160 returning (char *)-1 if it is not a valid capability.
164 function returns a string decoded from
171 Some capabilities require string parameters and only platforms that can fit
177 The string encoding and parameter application is described in
182 function applies padding information to the string
185 gives the number of lines affected by the operation,
186 or 1 if this is not applicable;
188 is a function which is called by each character in turn.
189 The external variable
191 controls how many padding characters are sent in relation to the terminal
195 function calls tputs(str, 1, putchar).
198 always goes to stdout.
199 .Ss NetBSD Extensions To Terminfo
202 function allows variadic parameters instead of 9 fixed longs.
203 Numeric parameters must be longs.
204 String parameters can be used even if the platform cannot fit a
211 functions correspond to the standard
213 functions but take an additional
215 parameter so that the terminal can be specified instead of assuming
217 These functions use private variables to the
219 instead of the global variables, such as
228 .An Roy Marples Aq roy@NetBSD.org