]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_termattrs.3x
ncurses 6.0 - patch 20160604
[ncurses.git] / man / curs_termattrs.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2010,2015 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.13 2015/07/21 00:03:34 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.  The
71 number returned is in bits per second, for example \fB9600\fR, and is an
72 integer.
73 .SS erasechar, erasewchar
74 .PP
75 The \fBerasechar\fR routine returns the user's current erase character.
76 .PP
77 The \fBerasewchar\fR routine stores the current erase character
78 in the location referenced by \fIch\fR.
79 If no erase character has been defined, the routine fails
80 and the location referenced by \fIch\fR is not changed.
81 .SS has_is, has_il
82 .PP
83 The \fBhas_ic\fR routine is true if the terminal has insert- and delete-
84 character capabilities.
85 .PP
86 The \fBhas_il\fR routine is true if the terminal has insert- and delete-line
87 capabilities, or can simulate them using scrolling regions.  This might
88 be used to determine if it would be appropriate to turn on physical
89 scrolling using \fBscrollok\fR.
90 .SS killchar, killwchar
91 .PP
92 The \fBkillchar\fR routine returns the user's current line kill character.
93 .PP
94 The \fBkillwchar\fR routine stores the current line-kill character
95 in the location referenced by \fIch\fR.
96 If no line-kill character has been defined,
97 the routine fails and the location referenced by \fIch\fR is not changed.
98 .SS longname
99 .PP
100 The \fBlongname\fR routine returns a pointer to a static area
101 containing a verbose description of the current terminal.  The maximum
102 length of a verbose description is 128 characters.  It is defined only
103 after the call to \fBinitscr\fR or \fBnewterm\fR.  The area is
104 overwritten by each call to \fBnewterm\fR and is not restored by
105 \fBset_term\fR, so the value should be saved between calls to
106 \fBnewterm\fR if \fBlongname\fR is going to be used with multiple
107 terminals.
108 .SS termattrs, term_attrs
109 .PP
110 If a given terminal does not support a video attribute that an
111 application program is trying to use, \fBcurses\fR may substitute a
112 different video attribute for it.
113 The \fBtermattrs\fR and \fBterm_attrs\fR functions
114 return a logical \fBOR\fR of all video attributes supported by the
115 terminal using \fIA_\fR and \fIWA_\fR constants respectively.
116 This information is useful when a \fBcurses\fR program
117 needs complete control over the appearance of the screen.
118 .SS termname
119 .PP
120 The \fBtermname\fR routine returns the terminal name used by \fBsetupterm\fR.
121 .SH RETURN VALUE
122 \fBlongname\fR and \fBtermname\fR return \fBNULL\fR on error.
123 .PP
124 Routines that return an integer return \fBERR\fR upon failure and \fBOK\fR
125 (SVr4 only specifies "an integer value other than \fBERR\fR") upon successful
126 completion.
127 .SH NOTES
128 Note that \fBtermattrs\fR may be a macro.
129 .SH PORTABILITY
130 The XSI Curses standard, Issue 4 describes these functions.  It changes the
131 return type of \fBtermattrs\fR to the new type \fBattr_t\fR.
132 Most versions of curses truncate the result returned by \fBtermname\fR to
133 14 characters.
134 .SH SEE ALSO
135 \fBcurses\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_outopts\fR(3X)