]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_termattrs.3x
ncurses 6.1 - patch 20190720
[ncurses.git] / man / curs_termattrs.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2015,2018 Free Software Foundation, Inc.              *
3 .\"                                                                          *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
5 .\" copy of this software and associated documentation files (the            *
6 .\" "Software"), to deal in the Software without restriction, including      *
7 .\" without limitation the rights to use, copy, modify, merge, publish,      *
8 .\" distribute, distribute with modifications, sublicense, and/or sell       *
9 .\" copies of the Software, and to permit persons to whom the Software is    *
10 .\" furnished to do so, subject to the following conditions:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22 .\"                                                                          *
23 .\" Except as contained in this notice, the name(s) of the above copyright   *
24 .\" holders shall not be used in advertising or otherwise to promote the     *
25 .\" sale, use or other dealings in this Software without prior written       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: curs_termattrs.3x,v 1.14 2018/07/28 21:34:06 tom Exp $
30 .TH curs_termattrs 3X ""
31 .SH NAME
32 \fBbaudrate\fR,
33 \fBerasechar\fR,
34 \fBerasewchar\fR,
35 \fBhas_ic\fR,
36 \fBhas_il\fR,
37 \fBkillchar\fR,
38 \fBkillwchar\fR,
39 \fBlongname\fR,
40 \fBterm_attrs\fR,
41 \fBtermattrs\fR,
42 \fBtermname\fR \- \fBcurses\fR environment query routines
43 .SH SYNOPSIS
44 \fB#include <curses.h>\fR
45 .PP
46 \fBint baudrate(void);\fR
47 .br
48 \fBchar erasechar(void);\fR
49 .br
50 \fBint erasewchar(wchar_t *\fR\fIch\fR\fB);\fR
51 .br
52 \fBbool has_ic(void);\fR
53 .br
54 \fBbool has_il(void);\fR
55 .br
56 \fBchar killchar(void);\fR
57 .br
58 \fBint killwchar(wchar_t *\fR\fIch\fR\fB);\fR
59 .br
60 \fBchar *longname(void);\fR
61 .br
62 \fBattr_t term_attrs(void);\fR
63 .br
64 \fBchtype termattrs(void);\fR
65 .br
66 \fBchar *termname(void);\fR
67 .br
68 .SH DESCRIPTION
69 .SS baudrate
70 The \fBbaudrate\fR routine returns the output speed of the terminal.
71 The
72 number returned is in bits per second, for example \fB9600\fR, and is an
73 integer.
74 .SS erasechar, erasewchar
75 .PP
76 The \fBerasechar\fR routine returns the user's current erase character.
77 .PP
78 The \fBerasewchar\fR routine stores the current erase character
79 in the location referenced by \fIch\fR.
80 If no erase character has been defined, the routine fails
81 and the location referenced by \fIch\fR is not changed.
82 .SS has_is, has_il
83 .PP
84 The \fBhas_ic\fR routine is true if the terminal has insert- and delete-
85 character capabilities.
86 .PP
87 The \fBhas_il\fR 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\fR.
92 .SS killchar, killwchar
93 .PP
94 The \fBkillchar\fR routine returns the user's current line kill character.
95 .PP
96 The \fBkillwchar\fR routine stores the current line-kill character
97 in the location referenced by \fIch\fR.
98 If no line-kill character has been defined,
99 the routine fails and the location referenced by \fIch\fR is not changed.
100 .SS longname
101 .PP
102 The \fBlongname\fR routine returns a pointer to a static area
103 containing a verbose description of the current terminal.
104 The maximum
105 length of a verbose description is 128 characters.
106 It is defined only
107 after the call to \fBinitscr\fR or \fBnewterm\fR.  The area is
108 overwritten by each call to \fBnewterm\fR and is not restored by
109 \fBset_term\fR, so the value should be saved between calls to
110 \fBnewterm\fR if \fBlongname\fR is going to be used with multiple
111 terminals.
112 .SS termattrs, term_attrs
113 .PP
114 If a given terminal does not support a video attribute that an
115 application program is trying to use, \fBcurses\fR may substitute a
116 different video attribute for it.
117 The \fBtermattrs\fR and \fBterm_attrs\fR functions
118 return a logical \fBOR\fR of all video attributes supported by the
119 terminal using \fIA_\fR and \fIWA_\fR constants respectively.
120 This information is useful when a \fBcurses\fR program
121 needs complete control over the appearance of the screen.
122 .SS termname
123 .PP
124 The \fBtermname\fR routine returns the terminal name used by \fBsetupterm\fR.
125 .SH RETURN VALUE
126 \fBlongname\fR and \fBtermname\fR return \fBNULL\fR on error.
127 .PP
128 Routines that return an integer return \fBERR\fR upon failure and \fBOK\fR
129 (SVr4 only specifies "an integer value other than \fBERR\fR") upon successful
130 completion.
131 .SH NOTES
132 Note that \fBtermattrs\fR may be a macro.
133 .SH PORTABILITY
134 The XSI Curses standard, Issue 4 describes these functions.
135 It changes the
136 return type of \fBtermattrs\fR to the new type \fBattr_t\fR.
137 Most versions of curses truncate the result returned by \fBtermname\fR to
138 14 characters.
139 .SH SEE ALSO
140 \fBcurses\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_outopts\fR(3X)