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