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