1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
3 ****************************************************************************
4 * Copyright (c) 1998-2007,2010 Free Software Foundation, Inc. *
6 * Permission is hereby granted, free of charge, to any person obtaining a *
7 * copy of this software and associated documentation files (the *
8 * "Software"), to deal in the Software without restriction, including *
9 * without limitation the rights to use, copy, modify, merge, publish, *
10 * distribute, distribute with modifications, sublicense, and/or sell *
11 * copies of the Software, and to permit persons to whom the Software is *
12 * furnished to do so, subject to the following conditions: *
14 * The above copyright notice and this permission notice shall be included *
15 * in all copies or substantial portions of the Software. *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
20 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
21 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
22 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
23 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
25 * Except as contained in this notice, the name(s) of the above copyright *
26 * holders shall not be used in advertising or otherwise to promote the *
27 * sale, use or other dealings in this Software without prior written *
29 ****************************************************************************
30 * @Id: curs_termattrs.3x,v 1.12 2010/12/04 18:40:45 tom Exp @
34 <TITLE>curs_termattrs 3x</TITLE>
35 <link rev=made href="mailto:bug-ncurses@gnu.org">
36 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
39 <H1>curs_termattrs 3x</H1>
42 <!-- Manpage converted by man2html 3.0.1 -->
43 <STRONG><A HREF="curs_termattrs.3x.html">curs_termattrs(3x)</A></STRONG> <STRONG><A HREF="curs_termattrs.3x.html">curs_termattrs(3x)</A></STRONG>
50 <STRONG>baudrate</STRONG>, <STRONG>erasechar</STRONG>, <STRONG>erasewchar</STRONG>, <STRONG>has_ic</STRONG>, <STRONG>has_il</STRONG>, <STRONG>killchar</STRONG>,
51 <STRONG>killwchar</STRONG>, <STRONG>longname</STRONG>, <STRONG>term_attrs</STRONG>, <STRONG>termattrs</STRONG>, <STRONG>termname</STRONG> -
52 <STRONG>curses</STRONG> environment query routines
56 <H2>SYNOPSIS</H2><PRE>
57 <STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
59 <STRONG>int</STRONG> <STRONG>baudrate(void);</STRONG>
60 <STRONG>char</STRONG> <STRONG>erasechar(void);</STRONG>
61 <STRONG>int</STRONG> <STRONG>erasewchar(wchar_t</STRONG> <STRONG>*</STRONG><EM>ch</EM><STRONG>);</STRONG>
62 <STRONG>bool</STRONG> <STRONG>has_ic(void);</STRONG>
63 <STRONG>bool</STRONG> <STRONG>has_il(void);</STRONG>
64 <STRONG>char</STRONG> <STRONG>killchar(void);</STRONG>
65 <STRONG>int</STRONG> <STRONG>killwchar(wchar_t</STRONG> <STRONG>*</STRONG><EM>ch</EM><STRONG>);</STRONG>
66 <STRONG>char</STRONG> <STRONG>*longname(void);</STRONG>
67 <STRONG>attr_t</STRONG> <STRONG>term_attrs(void);</STRONG>
68 <STRONG>chtype</STRONG> <STRONG>termattrs(void);</STRONG>
69 <STRONG>char</STRONG> <STRONG>*termname(void);</STRONG>
73 <H2>DESCRIPTION</H2><PRE>
74 The <STRONG>baudrate</STRONG> routine returns the output speed of the ter-
75 minal. The number returned is in bits per second, for
76 example <STRONG>9600</STRONG>, and is an integer.
78 The <STRONG>erasechar</STRONG> routine returns the user's current erase
81 The <STRONG>erasewchar</STRONG> routine stores the current erase character
82 in the location referenced by <EM>ch</EM>. If no erase character
83 has been defined, the routine fails and the location ref-
84 erenced by <EM>ch</EM> is not changed.
86 The <STRONG>has_ic</STRONG> routine is true if the terminal has insert- and
87 delete- character capabilities.
89 The <STRONG>has_il</STRONG> routine is true if the terminal has insert- and
90 delete-line capabilities, or can simulate them using
91 scrolling regions. This might be used to determine if it
92 would be appropriate to turn on physical scrolling using
93 <STRONG>scrollok</STRONG>.
95 The <STRONG>killchar</STRONG> routine returns the user's current line kill
98 The <STRONG>killwchar</STRONG> routine stores the current line-kill charac-
99 ter in the location referenced by <EM>ch</EM>. If no line-kill
100 character has been defined, the routine fails and the
101 location referenced by <EM>ch</EM> is not changed.
103 The <STRONG>longname</STRONG> routine returns a pointer to a static area
104 containing a verbose description of the current terminal.
105 The maximum length of a verbose description is 128 charac-
106 ters. It is defined only after the call to <STRONG>initscr</STRONG> or
107 <STRONG>newterm</STRONG>. The area is overwritten by each call to <STRONG>newterm</STRONG>
108 and is not restored by <STRONG>set_term</STRONG>, so the value should be
109 saved between calls to <STRONG>newterm</STRONG> if <STRONG>longname</STRONG> is going to be
110 used with multiple terminals.
112 If a given terminal does not support a video attribute
113 that an application program is trying to use, <STRONG>curses</STRONG> may
114 substitute a different video attribute for it. The <STRONG>ter-</STRONG>
115 <STRONG>mattrs</STRONG> and <STRONG>term_attrs</STRONG> functions return a logical <STRONG>OR</STRONG> of all
116 video attributes supported by the terminal using <EM>A</EM><STRONG>_</STRONG> and
117 <EM>WA</EM><STRONG>_</STRONG> constants respectively. This information is useful
118 when a <STRONG>curses</STRONG> program needs complete control over the
119 appearance of the screen.
121 The <STRONG>termname</STRONG> routine returns the terminal name used by
122 <STRONG>setupterm</STRONG>.
126 <H2>RETURN VALUE</H2><PRE>
127 <STRONG>longname</STRONG> and <STRONG>termname</STRONG> return <STRONG>NULL</STRONG> on error.
129 Routines that return an integer return <STRONG>ERR</STRONG> upon failure
130 and <STRONG>OK</STRONG> (SVr4 only specifies "an integer value other than
131 <STRONG>ERR</STRONG>") upon successful completion.
136 Note that <STRONG>termattrs</STRONG> may be a macro.
140 <H2>PORTABILITY</H2><PRE>
141 The XSI Curses standard, Issue 4 describes these func-
142 tions. It changes the return type of <STRONG>termattrs</STRONG> to the new
143 type <STRONG>attr_t</STRONG>. Most versions of curses truncate the result
144 returned by <STRONG>termname</STRONG> to 14 characters.
148 <H2>SEE ALSO</H2><PRE>
149 <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>
153 <STRONG><A HREF="curs_termattrs.3x.html">curs_termattrs(3x)</A></STRONG>
156 Man(1) output converted with <a href="http://invisible-island.net/scripts/readme.html#others_scripts">man2html</a>