1 .\" $NetBSD: terminfo.3,v 1.8 2011/10/04 11:01:14 roy Exp $
3 .\" Copyright (c) 2009, 2011 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.
45 .Nd terminal independent operation routines
52 .Vt TERMINAL *cur_term ;
54 .Fn setupterm "const char *name" "int fildes" "int *errret"
56 .Fn set_curterm "TERMINAL *nterm"
58 .Fn del_curterm "TERMINAL *oterm"
64 .Fn tigetnum "const char *id"
66 .Fn tigetflag "const char *id"
68 .Fn tigetstr "const char *id"
70 .Fn tparm "const char *cm" "long p1" "long p2" "long p3" "long p4" "long p5" "long p6" "long p7" "long p8" "long p9"
72 .Fn tputs "const char *cp" "int affcnt" "int (*outc)(int)"
74 .Fn putp "const char *cp"
76 .Fn ti_setupterm "TERMINAL **" "const char *name" "int fildes" "int *error"
78 .Fn ti_getflag "const TERMINAL *" "const char *id"
80 .Fn ti_getnum "const TERMINAL *" "const char *id"
82 .Fn ti_getstr "const TERMINAL *" "const char *id"
84 .Fn tiparm "const char *cm" "..."
86 .Fn ti_tiparm "TERMINAL *" "const char *cm" "..."
88 .Fn ti_puts "const TERMINAL *term" "const char *str" "int affcnt" "int (*outc)(int, void *)"
90 .Fn ti_putp "const TERMINAL *term" "const char *str"
92 These functions extract and use capabilities from a terminal capability
94 .Pa /usr/share/misc/terminfo ,
95 the format of which is described in
97 These are low level routines;
100 for a higher level package.
104 function extracts the entry for terminal
115 then it is replaced by the environment variable
119 function returns 0 on success and \-1 on error.
123 database could not be opened,
124 0 if the terminal could not be found in the database, and
129 function sets the variable
135 boolean, numeric and string variables use the values from
147 function frees space pointed to by
152 function returns the name of
156 function returns the description of
161 function gets the boolean value of capability
163 returning \-1 if it is not a valid capability.
166 function gets the numeric value of the capability
168 returning \-2 if it is not a valid capability.
171 function returns the string value of the capability
173 returning (char *)-1 if it is not a valid capability.
177 function returns a string decoded from
184 Some capabilities require string parameters and only platforms that can fit
190 The string encoding and parameter application is described in
195 function applies padding information to the string
198 gives the number of lines affected by the operation,
199 or 1 if this is not applicable;
201 is a function which is called by each character in turn.
202 The external variable
204 controls how many padding characters are sent in relation to the terminal
208 function calls tputs(str, 1, putchar).
211 always goes to stdout.
212 .Ss NetBSD Extensions To Terminfo
215 function allows variadic parameters instead of 9 fixed longs.
216 Numeric parameters must be integers (int) instead of longs.
217 String parameters can be used even if the platform cannot fit a
224 functions correspond to the standard
226 functions but take an additional
228 parameter so that the terminal can be specified instead of assuming
230 These functions use private variables to the
232 instead of the global variables, such as
241 .An Roy Marples Aq roy@NetBSD.org