Debian Codegraph @

doc/html/man/curs_termattrs.3x.html

raw
1 <!--
2 ****************************************************************************
3 * Copyright 2018-2024,2025 Thomas E. Dickey *
4 * Copyright 1998-2010,2015 Free Software Foundation, Inc. *
5 * *
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: *
13 * *
14 * The above copyright notice and this permission notice shall be included *
15 * in all copies or substantial portions of the Software. *
16 * *
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. *
24 * *
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 *
28 * authorization. *
29 ****************************************************************************
30 * @Id: curs_termattrs.3x,v 1.61 2025/08/23 22:39:20 tom Exp @
31 -->
32 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
33 <HTML>
34 <HEAD>
35 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
36 <meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
37 <TITLE>curs_termattrs 3x 2025-08-23 ncurses 6.6 Library calls</TITLE>
38 <link rel="author" href="mailto:[email protected]">
39
40 </HEAD>
41 <BODY>
42 <H1 class="no-header">curs_termattrs 3x 2025-08-23 ncurses 6.6 Library calls</H1>
43 <PRE>
44 <STRONG><A HREF="curs_termattrs.3x.html">curs_termattrs(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_termattrs.3x.html">curs_termattrs(3x)</A></STRONG>
45
46
47 </PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
48 <STRONG>baudrate</STRONG>, <STRONG>erasechar</STRONG>, <STRONG>erasewchar</STRONG>, <STRONG>has_ic</STRONG>, <STRONG>has_il</STRONG>, <STRONG>killchar</STRONG>, <STRONG>killwchar</STRONG>,
49 <STRONG>longname</STRONG>, <STRONG>term_attrs</STRONG>, <STRONG>termattrs</STRONG>, <STRONG>termname</STRONG> - get and set terminal
50 attributes with <EM>curses</EM>
51
52
53 </PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
54 <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
55
56 <STRONG>int</STRONG> <STRONG>baudrate(void);</STRONG>
57 <STRONG>char</STRONG> <STRONG>erasechar(void);</STRONG>
58 <STRONG>int</STRONG> <STRONG>erasewchar(wchar_t</STRONG> <STRONG>*</STRONG> <EM>wc</EM><STRONG>);</STRONG>
59 <STRONG>bool</STRONG> <STRONG>has_ic(void);</STRONG>
60 <STRONG>bool</STRONG> <STRONG>has_il(void);</STRONG>
61 <STRONG>char</STRONG> <STRONG>killchar(void);</STRONG>
62 <STRONG>int</STRONG> <STRONG>killwchar(wchar_t</STRONG> <STRONG>*</STRONG> <EM>wc</EM><STRONG>);</STRONG>
63 <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>longname(void);</STRONG>
64 <STRONG>attr_t</STRONG> <STRONG>term_attrs(void);</STRONG>
65 <STRONG>chtype</STRONG> <STRONG>termattrs(void);</STRONG>
66 <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>termname(void);</STRONG>
67
68
69 </PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
70
71 </PRE><H3><a name="h3-baudrate">baudrate</a></H3><PRE>
72 <STRONG>baudrate</STRONG> returns the line speed of the terminal, an integer value
73 measured in bits per second, for example <STRONG>9600</STRONG>.
74
75
76 </PRE><H3><a name="h3-erasechar_erasewchar">erasechar, erasewchar</a></H3><PRE>
77 <STRONG>erasechar</STRONG> returns the terminal's erase character.
78
79 <STRONG>erasewchar</STRONG> stores the erase character in the location referenced by <EM>wc</EM>.
80 If no erase character has been defined, it fails and the location
81 referenced by <EM>wc</EM> is not changed.
82
83
84 </PRE><H3><a name="h3-has_ic_has_il">has_ic, has_il</a></H3><PRE>
85 <STRONG>has_ic</STRONG> returns <STRONG>TRUE</STRONG> if the terminal has insert- and delete-character
86 capabilities.
87
88 <STRONG>has_il</STRONG> returns <STRONG>TRUE</STRONG> if the terminal has insert- and delete-line
89 capabilities, or can simulate them using scrolling regions. It might
90 be used to determine whether it would be appropriate to use
91 <STRONG><A HREF="scrollok.3x.html">scrollok(3x)</A></STRONG> to turn on scrolling.
92
93
94 </PRE><H3><a name="h3-killchar_killwchar">killchar, killwchar</a></H3><PRE>
95 <STRONG>killchar</STRONG> returns the terminal's line kill character.
96
97 <STRONG>killwchar</STRONG> stores the line-kill character in the location referenced by
98 <EM>wc</EM>. If no line-kill character has been defined, it fails and the
99 location referenced by <EM>wc</EM> is not changed.
100
101
102 </PRE><H3><a name="h3-longname">longname</a></H3><PRE>
103 <STRONG>longname</STRONG> returns a pointer to static storage containing a verbose
104 description of the terminal being managed by <EM>curses</EM>. The maximum
105 length of a verbose description is 128 characters. The storage is
106 populated only after <STRONG><A HREF="curs_initscr.3x.html">initscr(3x)</A></STRONG> or <STRONG><A HREF="curs_initscr.3x.html">newterm(3x)</A></STRONG> is called. This
107 storage is overwritten by each call to <STRONG>newterm</STRONG> and not restored by
108 <STRONG><A HREF="curs_initscr.3x.html">set_term(3x)</A></STRONG>, so its contents should be saved between calls to <STRONG>initscr</STRONG>
109 or <STRONG>newterm</STRONG> if <STRONG>longname</STRONG> is to be used with multiple terminals.
110
111
112 </PRE><H3><a name="h3-termattrs_term_attrs">termattrs, term_attrs</a></H3><PRE>
113 If a given terminal does not support a video attribute that an
114 application program is trying to use, <EM>curses</EM> may substitute a different
115 video attribute for it. <STRONG>termattrs</STRONG> and <STRONG>term_attrs</STRONG> return a logical "or"
116 of all video attributes supported by the terminal using <STRONG>A_</STRONG> and <STRONG>WA_</STRONG>
117 constants respectively. This information is useful when a <EM>curses</EM>
118 program needs complete control over the appearance of the screen.
119
120
121 </PRE><H3><a name="h3-termname">termname</a></H3><PRE>
122 <STRONG>termname</STRONG> returns the terminal name used by <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG>.
123
124
125 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
126 <STRONG>longname</STRONG> and <STRONG>termname</STRONG> return <EM>NULL</EM> on error.
127
128 Functions that return an integer return <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> upon
129 success.
130
131
132 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
133 <STRONG>erasewchar</STRONG>, <STRONG>killwchar</STRONG>, and <STRONG>term_attrs</STRONG> are part of <EM>ncurses</EM>'s wide-
134 character API, and are not available in its non-wide-character
135 configuration.
136
137 <STRONG>termattrs</STRONG> may be implemented as a macro.
138
139
140 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
141 X/Open Curses Issue 4 describes these functions.
142
143 SVr4 describes a successful return value only as "an integer value
144 other than <EM>ERR</EM>".
145
146 Most versions of <EM>curses</EM> truncate the string returned by <EM>termname</EM> to 14
147 characters.
148
149
150 </PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
151 4BSD (1980) introduced <EM>longname</EM>.
152
153 SVr2 (1984) added <EM>baudrate</EM>, <EM>erasechar</EM>, <EM>killchar</EM>, <EM>has</EM><STRONG>_</STRONG><EM>ic</EM>, and <EM>has</EM><STRONG>_</STRONG><EM>il</EM>.
154
155 SVr3 (1987) supplied <EM>termname</EM>. Later that year, SVr3.1 brought
156 <EM>termattrs</EM>.
157
158 X/Open Curses Issue 4 (1995) specified <EM>erasewchar</EM>, <EM>killwchar</EM>, and
159 <EM>term</EM><STRONG>_</STRONG><EM>attrs</EM>.
160
161
162 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
163 <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>
164
165 ncurses 6.6 2025-08-23 <STRONG><A HREF="curs_termattrs.3x.html">curs_termattrs(3x)</A></STRONG>
166 </PRE>
167 <div class="nav">
168 <ul>
169 <li><a href="#h2-NAME">NAME</a></li>
170 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
171 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
172 <ul>
173 <li><a href="#h3-baudrate">baudrate</a></li>
174 <li><a href="#h3-erasechar_erasewchar">erasechar, erasewchar</a></li>
175 <li><a href="#h3-has_ic_has_il">has_ic, has_il</a></li>
176 <li><a href="#h3-killchar_killwchar">killchar, killwchar</a></li>
177 <li><a href="#h3-longname">longname</a></li>
178 <li><a href="#h3-termattrs_term_attrs">termattrs, term_attrs</a></li>
179 <li><a href="#h3-termname">termname</a></li>
180 </ul>
181 </li>
182 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
183 <li><a href="#h2-NOTES">NOTES</a></li>
184 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
185 <li><a href="#h2-HISTORY">HISTORY</a></li>
186 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
187 </ul>
188 </div>
189 </BODY>
190 </HTML>