]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_termattrs.3x
ncurses 6.4 - patch 20230917
[ncurses.git] / man / curs_termattrs.3x
1 .\"***************************************************************************
2 .\" Copyright 2018-2022,2023 Thomas E. Dickey                                *
3 .\" Copyright 1998-2010,2015 Free Software Foundation, Inc.                  *
4 .\"                                                                          *
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:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
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.                               *
23 .\"                                                                          *
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       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" $Id: curs_termattrs.3x,v 1.28 2023/09/16 23:37:03 tom Exp $
31 .TH curs_termattrs 3X 2023-09-16 "ncurses 6.4" "Library calls"
32 .SH NAME
33 \fB\%baudrate\fP,
34 \fB\%erasechar\fP,
35 \fB\%erasewchar\fP,
36 \fB\%has_ic\fP,
37 \fB\%has_il\fP,
38 \fB\%killchar\fP,
39 \fB\%killwchar\fP,
40 \fB\%longname\fP,
41 \fB\%term_attrs\fP,
42 \fB\%termattrs\fP,
43 \fB\%termname\fP \-
44 \fIcurses\fR environment query routines
45 .SH SYNOPSIS
46 \fB#include <curses.h>\fP
47 .PP
48 \fBint baudrate(void);\fP
49 .br
50 \fBchar erasechar(void);\fP
51 .br
52 \fBint erasewchar(wchar_t *\fIch\fB);\fR
53 .br
54 \fBbool has_ic(void);\fP
55 .br
56 \fBbool has_il(void);\fP
57 .br
58 \fBchar killchar(void);\fP
59 .br
60 \fBint killwchar(wchar_t *\fIch\fB);\fR
61 .br
62 \fBchar *longname(void);\fP
63 .br
64 \fBattr_t term_attrs(void);\fP
65 .br
66 \fBchtype termattrs(void);\fP
67 .br
68 \fBchar *termname(void);\fP
69 .br
70 .SH DESCRIPTION
71 .SS baudrate
72 The \fBbaudrate\fP routine returns the output speed of the terminal.
73 The
74 number returned is in bits per second, for example \fB9600\fP, and is an
75 integer.
76 .SS erasechar, erasewchar
77 The \fBerasechar\fP routine returns the user's current erase character.
78 .PP
79 The \fBerasewchar\fP routine stores the current erase character
80 in the location referenced by \fIch\fP.
81 If no erase character has been defined, the routine fails
82 and the location referenced by \fIch\fP is not changed.
83 .SS has_is, has_il
84 The \fBhas_ic\fP routine is true if the terminal has insert- and delete-
85 character capabilities.
86 .PP
87 The \fBhas_il\fP routine is true if the terminal has insert- and delete-line
88 capabilities, or can simulate them using scrolling regions.
89 This might
90 be used to determine if it would be appropriate to turn on physical
91 scrolling using \fBscrollok\fP(3X).
92 .SS killchar, killwchar
93 The \fBkillchar\fP routine returns the user's current line kill character.
94 .PP
95 The \fBkillwchar\fP routine stores the current line-kill character
96 in the location referenced by \fIch\fP.
97 If no line-kill character has been defined,
98 the routine fails and the location referenced by \fIch\fP is not changed.
99 .SS longname
100 The \fBlongname\fP routine returns a pointer to a static area
101 containing a verbose description of the current terminal.
102 The maximum
103 length of a verbose description is 128 characters.
104 It is defined only
105 after the call to \fBinitscr\fP or \fBnewterm\fP.  The area is
106 overwritten by each call to \fBnewterm\fP and is not restored by
107 \fBset_term\fP, so the value should be saved between calls to
108 \fBnewterm\fP if \fBlongname\fP is going to be used with multiple
109 terminals.
110 .SS termattrs, term_attrs
111 If a given terminal does not support a video attribute that an
112 application program is trying to use, \fBcurses\fP may substitute a
113 different video attribute for it.
114 The \fBtermattrs\fP and \fBterm_attrs\fP functions
115 return a logical \fBOR\fP of all video attributes supported by the
116 terminal using \fBA_\fP and \fBWA_\fP constants respectively.
117 This information is useful when a \fBcurses\fP program
118 needs complete control over the appearance of the screen.
119 .SS termname
120 The \fBtermname\fP routine returns the terminal name used by \fBsetupterm\fP.
121 .SH RETURN VALUE
122 \fBlongname\fP and \fBtermname\fP return \fBNULL\fP on error.
123 .PP
124 Routines that return an integer return \fBERR\fP upon failure and \fBOK\fP
125 (SVr4 only specifies "an integer value other than \fBERR\fP") upon successful
126 completion.
127 .SH NOTES
128 Note that \fBtermattrs\fP may be a macro.
129 .SH PORTABILITY
130 The XSI Curses standard, Issue 4 describes these functions.
131 It changes the
132 return type of \fBtermattrs\fP to the new type \fBattr_t\fP.
133 Most versions of curses truncate the result returned by \fBtermname\fP to
134 14 characters.
135 .SH SEE ALSO
136 \fBcurses\fP(3X), \fBcurs_initscr\fP(3X), \fBcurs_outopts\fP(3X)