2 <BODY BGCOLOR="#99ccbb" TEXT="#000000" LINK="#4060b0" VLINK="#000080" ALINK="#ff4040">
4 <STRONG>tgetent</STRONG>, <STRONG>tgetflag</STRONG>, <STRONG>tgetnum</STRONG>, <STRONG>tgetstr</STRONG>, <STRONG>tgoto</STRONG>, <STRONG>tputs</STRONG> - direct
5 <STRONG>curses</STRONG> interface to the terminfo capability database
10 <STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
11 <STRONG>#include</STRONG> <STRONG><term.h></STRONG>
12 <STRONG>int</STRONG> <STRONG>tgetent(const</STRONG> <STRONG>char</STRONG> <STRONG>*bp,</STRONG> <STRONG>char</STRONG> <STRONG>*name);</STRONG>
13 <STRONG>int</STRONG> <STRONG>tgetflag(const</STRONG> <STRONG>char</STRONG> <STRONG>*id);</STRONG>
14 <STRONG>int</STRONG> <STRONG>tgetnum(const</STRONG> <STRONG>char</STRONG> <STRONG>*id);</STRONG>
15 <STRONG>char</STRONG> <STRONG>*tgetstr(const</STRONG> <STRONG>char</STRONG> <STRONG>*id,</STRONG> <STRONG>char</STRONG> <STRONG>**area);</STRONG>
16 <STRONG>char</STRONG> <STRONG>*tgoto(const</STRONG> <STRONG>char</STRONG> <STRONG>*cap,</STRONG> <STRONG>int</STRONG> <STRONG>col,</STRONG> <STRONG>int</STRONG> <STRONG>row);</STRONG>
17 <STRONG>int</STRONG> <STRONG>tputs(const</STRONG> <STRONG>char</STRONG> <STRONG>*str,</STRONG> <STRONG>int</STRONG> <STRONG>affcnt,</STRONG> <STRONG>int</STRONG> <STRONG>(*putc)(int));</STRONG>
21 <H2>DESCRIPTION</H2><PRE>
22 These routines are included as a conversion aid for pro-
23 grams that use the <EM>termcap</EM> library. Their parameters are
24 the same and the routines are emulated using the <EM>terminfo</EM>
25 database. Thus, they can only be used to query the capa-
26 bilities of entries for which a terminfo entry has been
29 The <STRONG>tgetent</STRONG> routine loads the entry for <EM>name</EM>. It returns
30 1 on success, 0 if there is no such entry, and -1 if the
31 terminfo database could not be found. The emulation
32 ignores the buffer pointer <EM>bp</EM>.
34 The <STRONG>tgetflag</STRONG> routine gets the boolean entry for <EM>id</EM>.
36 The <STRONG>tgetnum</STRONG> routine gets the numeric entry for <EM>id</EM>.
38 The <STRONG>tgetstr</STRONG> routine returns the string entry for <EM>id</EM>. Use
39 <STRONG>tputs</STRONG> to output the returned string.
41 The <STRONG>tgoto</STRONG> routine instantiates the parameters into the
42 given capability. The output from this routine is to be
43 passed to <STRONG>tputs</STRONG>.
45 The <STRONG>tputs</STRONG> routine is described on the <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3X)</A></STRONG>
46 manual page. It can retrieve capabilities by either term-
52 <H2>RETURN VALUE</H2><PRE>
53 Except where explicitly noted, routines that return an
54 integer return <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> (SVr4 only speci-
55 fies "an integer value other than <STRONG>ERR</STRONG>") upon successful
58 Routines that return pointers return <STRONG>NULL</STRONG> on error.
63 If you call <STRONG>tgetstr</STRONG> to fetch <STRONG>ca</STRONG> or any other parameterized
64 notation. This won't cause problems if all you do with it
65 is call <STRONG>tgoto</STRONG> or <STRONG>tparm</STRONG>, which both expand terminfo-style.
67 Because terminfo conventions for representing padding in
68 string capabilities differ from termcap's, <STRONG>tputs("50");</STRONG>
69 will put out a literal "50" rather than busy-waiting for
70 50 milliseconds. Cope with it.
74 <H2>PORTABILITY</H2><PRE>
75 The XSI Curses standard, Issue 4 describes these func-
76 tions. However, they are marked TO BE WITHDRAWN and may
77 be removed in future versions.
79 Neither the XSI Curses standard nor the SVr4 man pages
80 documented the return values of <STRONG>tgetent</STRONG> correctly, though
81 all three were in fact returned ever since SVr1.
85 <H2>SEE ALSO</H2><PRE>
86 <STRONG><A HREF="ncurses.3x.html">curses(3X)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>, <STRONG><A HREF="putc.3s.html">putc(3S)</A></STRONG>.