]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_termcap.3x
ncurses 5.0
[ncurses.git] / man / curs_termcap.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 1998 Free Software Foundation, Inc.                        *
3 .\"                                                                          *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
5 .\" copy of this software and associated documentation files (the            *
6 .\" "Software"), to deal in the Software without restriction, including      *
7 .\" without limitation the rights to use, copy, modify, merge, publish,      *
8 .\" distribute, distribute with modifications, sublicense, and/or sell       *
9 .\" copies of the Software, and to permit persons to whom the Software is    *
10 .\" furnished to do so, subject to the following conditions:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22 .\"                                                                          *
23 .\" Except as contained in this notice, the name(s) of the above copyright   *
24 .\" holders shall not be used in advertising or otherwise to promote the     *
25 .\" sale, use or other dealings in this Software without prior written       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: curs_termcap.3x,v 1.12 1999/09/05 01:02:07 tom Exp $
30 .TH curs_termcap 3X ""
31 .ds n 5
32 .SH NAME
33 \fBtgetent\fR, \fBtgetflag\fR, \fBtgetnum\fR,
34 \fBtgetstr\fR, \fBtgoto\fR, \fBtputs\fR - direct \fBcurses\fR
35 interface to the terminfo capability database
36 .SH SYNOPSIS
37 \fB#include <curses.h>\fR
38 .br
39 \fB#include <term.h>\fR
40 .br
41 \fBint tgetent(const char *bp, char *name);\fR
42 .br
43 \fBint tgetflag(const char *id);\fR
44 .br
45 \fBint tgetnum(const char *id);\fR
46 .br
47 \fBchar *tgetstr(const char *id, char **area);\fR
48 .br
49 \fBchar *tgoto(const char *cap, int col, int row);\fR
50 .br
51 \fBint tputs(const char *str, int affcnt, int (*putc)(int));\fR
52 .br
53 .SH DESCRIPTION
54 These routines are included as a conversion aid for programs that use
55 the \fItermcap\fR library.  Their parameters are the same and the
56 routines are emulated using the \fIterminfo\fR database.  Thus, they
57 can only be used to query the capabilities of entries for which a
58 terminfo entry has been compiled.
59
60 The \fBtgetent\fR routine loads the entry for \fIname\fR.
61 It returns 1 on success, 0 if there is no such entry, and -1 if the
62 terminfo database could not be found.
63 The emulation ignores the buffer pointer \fIbp\fR.
64
65 The \fBtgetflag\fR routine gets the boolean entry for \fIid\fR,
66 or zero if it is not available.
67
68 The \fBtgetnum\fR routine gets the numeric entry for \fIid\fR,
69 or -1 if it is not available.
70
71 The \fBtgetstr\fR routine returns the string entry for \fIid\fR,
72 or zero if it is not available.
73 Use \fBtputs\fR to output the returned string.
74 The return value will also be copied to the buffer pointed to by \fIarea\fR,
75 and the \fIarea\fR value will be updated to point past the null ending
76 this value.
77
78 The \fBtgoto\fR routine instantiates the parameters into the given capability.
79 The output from this routine is to be passed to \fBtputs\fR.
80
81 The \fBtputs\fR routine is described on the \fBcurs_terminfo\fR(3X) manual
82 page.  It can retrieve capabilities by either termcap or terminfo name.
83
84 .SH RETURN VALUE
85 Except where explicitly noted,
86 routines that return an integer return \fBERR\fR upon failure and \fBOK\fR
87 (SVr4 only specifies "an integer value other than \fBERR\fR") upon successful
88 completion.
89
90 Routines that return pointers return \fBNULL\fR on error.
91 .SH BUGS
92 If you call \fBtgetstr\fR to fetch \fBca\fR or any other parameterized string,
93 be aware that it will be returned in terminfo notation, not the older and
94 not-quite-compatible termcap notation.  This won't cause problems if all
95 you do with it is call \fBtgoto\fR or \fBtparm\fR, which both expand
96 terminfo-style.
97
98 Because terminfo conventions for representing padding in string capabilities
99 differ from termcap's, \fBtputs("50");\fR will put out a literal "50" rather
100 than busy-waiting for 50 milliseconds.  Cope with it.
101 .SH PORTABILITY
102 The XSI Curses standard, Issue 4 describes these functions.  However, they
103 are marked TO BE WITHDRAWN and may be removed in future versions.
104
105 Neither the XSI Curses standard nor the SVr4 man pages documented the return
106 values of \fBtgetent\fR correctly, though all three were in fact returned ever
107 since SVr1.
108 .SH SEE ALSO
109 \fBcurses\fR(3X), \fBterminfo\fR(\*n), \fBputc\fR(3S).
110 .\"#
111 .\"# The following sets edit modes for GNU EMACS
112 .\"# Local Variables:
113 .\"# mode:nroff
114 .\"# fill-column:79
115 .\"# End: