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