]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/curs_termcap.3x.html
ncurses 5.1
[ncurses.git] / doc / html / man / curs_termcap.3x.html
1 <HTML>
2 <BODY>
3 <PRE>
4 <!-- Manpage converted by man2html 3.0.1 -->
5
6 </PRE>
7 <H2>NAME</H2><PRE>
8        <B>tgetent</B>, <B>tgetflag</B>, <B>tgetnum</B>, <B>tgetstr</B>, <B>tgoto</B>, <B>tputs</B> - direct
9        <B>curses</B> interface to the terminfo capability database
10
11
12 </PRE>
13 <H2>SYNOPSIS</H2><PRE>
14        <B>#include</B> <B>&lt;curses.h&gt;</B>
15        <B>#include</B> <B>&lt;term.h&gt;</B>
16        <B>int</B> <B>tgetent(const</B> <B>char</B> <B>*bp,</B> <B>char</B> <B>*name);</B>
17        <B>int</B> <B>tgetflag(const</B> <B>char</B> <B>*id);</B>
18        <B>int</B> <B>tgetnum(const</B> <B>char</B> <B>*id);</B>
19        <B>char</B> <B>*tgetstr(const</B> <B>char</B> <B>*id,</B> <B>char</B> <B>**area);</B>
20        <B>char</B> <B>*tgoto(const</B> <B>char</B> <B>*cap,</B> <B>int</B> <B>col,</B> <B>int</B> <B>row);</B>
21        <B>int</B> <B>tputs(const</B> <B>char</B> <B>*str,</B> <B>int</B> <B>affcnt,</B> <B>int</B> <B>(*putc)(int));</B>
22
23
24 </PRE>
25 <H2>DESCRIPTION</H2><PRE>
26        These routines are included as a conversion aid  for  pro-
27        grams  that use the <I>termcap</I> library.  Their parameters are
28        the same and the routines are emulated using the  <I>terminfo</I>
29        database.   Thus, they can only be used to query the capa-
30        bilities of entries for which a terminfo  entry  has  been
31        compiled.
32
33        The  <B>tgetent</B> routine loads the entry for <I>name</I>.  It returns
34        1 on success, 0 if there is no such entry, and -1  if  the
35        terminfo  database  could  not  be  found.   The emulation
36        ignores the buffer pointer <I>bp</I>.
37
38        The <B>tgetflag</B> routine gets the boolean  entry  for  <I>id</I>,  or
39        zero if it is not available.
40
41        The  <B>tgetnum</B>  routine gets the numeric entry for <I>id</I>, or -1
42        if it is not available.
43
44        The <B>tgetstr</B> routine returns the string entry  for  <I>id</I>,  or
45        zero  if  it  is  not  available.  Use <B>tputs</B> to output the
46        returned string.  The return value will also be copied  to
47        the  buffer pointed to by <I>area</I>, and the <I>area</I> value will be
48        updated to point past the null ending this value.
49
50        The <B>tgoto</B> routine instantiates  the  parameters  into  the
51        given  capability.   The output from this routine is to be
52        passed to <B>tputs</B>.
53
54        The <B>tputs</B> routine is described  on  the  <B><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></B>
55        manual page.  It can retrieve capabilities by either term-
56        cap or terminfo name.
57
58
59
60 </PRE>
61 <H2>RETURN VALUE</H2><PRE>
62        Except where explicitly noted,  routines  that  return  an
63        integer  return  <B>ERR</B> upon failure and <B>OK</B> (SVr4 only speci-
64        fies "an integer value other than  <B>ERR</B>")  upon  successful
65        completion.
66
67        Routines that return pointers return <B>NULL</B> on error.
68
69
70 </PRE>
71 <H2>BUGS</H2><PRE>
72        If you call <B>tgetstr</B> to fetch <B>ca</B> or any other parameterized
73        string, be aware that it  will  be  returned  in  terminfo
74        notation,  not  the older and not-quite-compatible termcap
75        notation.  This won't cause problems if all you do with it
76        is  call <B>tgoto</B> or <B>tparm</B>, which both expand terminfo-style.
77
78        Because terminfo conventions for representing  padding  in
79        string  capabilities  differ  from termcap's, <B>tputs("50");</B>
80        will put out a literal "50" rather than  busy-waiting  for
81        50 milliseconds.  Cope with it.
82
83
84 </PRE>
85 <H2>PORTABILITY</H2><PRE>
86        The  XSI  Curses  standard,  Issue 4 describes these func-
87        tions.  However, they are marked TO BE WITHDRAWN  and  may
88        be removed in future versions.
89
90        Neither  the  XSI  Curses  standard nor the SVr4 man pages
91        documented the return values of <B>tgetent</B> correctly,  though
92        all three were in fact returned ever since SVr1.
93
94
95 </PRE>
96 <H2>SEE ALSO</H2><PRE>
97        <B><A HREF="ncurses.3x.html">curses(3x)</A></B>, <B><A HREF="terminfo.5.html">terminfo(5)</A></B>, <B><A HREF="putc.3S.html">putc(3S)</A></B>.
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127 </PRE>
128 <HR>
129 <ADDRESS>
130 Man(1) output converted with
131 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
132 </ADDRESS>
133 </BODY>
134 </HTML>