]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_termcap.3x
77e340e22eaab041763285b979ccef36e3312540
[ncurses.git] / man / curs_termcap.3x
1 .TH curs_termcap 3X ""
2 .ds n 5
3 .SH NAME
4 \fBtgetent\fR, \fBtgetflag\fR, \fBtgetnum\fR,
5 \fBtgetstr\fR, \fBtgoto\fR, \fBtputs\fR - direct \fBcurses\fR
6 interface to the terminfo capability database
7 .SH SYNOPSIS
8 \fB#include <curses.h>\fR
9 .br
10 \fB#include <term.h>\fR
11 .br
12 \fBint tgetent(const char *bp, char *name);\fR
13 .br
14 \fBint tgetflag(const char *id);\fR
15 .br
16 \fBint tgetnum(const char *id);\fR
17 .br
18 \fBchar *tgetstr(const char *id, char **area);\fR
19 .br
20 \fBchar *tgoto(const char *cap, int col, int row);\fR
21 .br
22 \fBint tputs(const char *str, int affcnt, int (*putc)(int));\fR
23 .br
24 .SH DESCRIPTION
25 These routines are included as a conversion aid for programs that use
26 the \fItermcap\fR library.  Their parameters are the same and the
27 routines are emulated using the \fIterminfo\fR database.  Thus, they
28 can only be used to query the capabilities of entries for which a
29 terminfo entry has been compiled.
30
31 The \fBtgetent\fR routine loads the entry for \fIname\fR.
32 It returns 1 on success, 0 if there is no such entry, and -1 if the
33 terminfo database could not be found.
34 The emulation ignores the buffer pointer \fIbp\fR.
35
36 The \fBtgetflag\fR routine gets the boolean entry for \fIid\fR.
37
38 The \fBtgetnum\fR routine gets the numeric entry for \fIid\fR.
39
40 The \fBtgetstr\fR routine returns the string entry for \fIid\fR.  Use
41 \fBtputs\fR to output the returned string.
42
43 The \fBtgoto\fR routine instantiates the parameters into the given capability.
44 The output from this routine is to be passed to \fBtputs\fR.
45
46 The \fBtputs\fR routine is described on the \fBcurs_terminfo\fR(3X) manual
47 page.  It can retrieve capabilities by either termcap or terminfo name.
48
49 .SH RETURN VALUE
50 Except where explicitly noted,
51 routines that return an integer return \fBERR\fR upon failure and \fBOK\fR
52 (SVr4 only specifies "an integer value other than \fBERR\fR") upon successful
53 completion.
54
55 Routines that return pointers return \fBNULL\fR on error.
56 .SH BUGS
57 If you call \fBtgetstr\fR to fetch \fBca\fR or any other parameterized string,
58 be aware that it will be returned in terminfo notation, not the older and
59 not-quite-compatible termcap notation.  This won't cause problems if all
60 you do with it is call \fBtgoto\fR or \fBtparm\fR, which both expand
61 terminfo-style.
62
63 Because terminfo conventions for representing padding in string capabilities
64 differ from termcap's, \fBtputs("50");\fR will put out a literal "50" rather
65 than busy-waiting for 50 milliseconds.  Cope with it.
66 .SH PORTABILITY
67 The XSI Curses standard, Issue 4 describes these functions.  However, they
68 are marked TO BE WITHDRAWN and may be removed in future versions.
69
70 Neither the XSI Curses standard nor the SVr4 man pages documented the return
71 values of \fBtgetent\fR correctly, though all three were in fact returned ever
72 since SVr1.
73 .SH SEE ALSO
74 \fBcurses\fR(3X), \fBterminfo\fR(\*n), \fBputc\fR(3S).
75 .\"#
76 .\"# The following sets edit modes for GNU EMACS
77 .\"# Local Variables:
78 .\"# mode:nroff
79 .\"# fill-column:79
80 .\"# End: