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