blob: dacd3b0f4d84bdf5d98b3d04d1d387f8451d82ae [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -04002.\" Copyright 2018-2023,2024 Thomas E. Dickey *
3.\" Copyright 1998-2010,2015 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05304.\" *
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.\"
micky3879b9f5e72025-07-08 18:04:53 -040030.\" $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"
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053032.SH NAME
micky3879b9f5e72025-07-08 18:04:53 -040033\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
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053045.SH SYNOPSIS
micky3879b9f5e72025-07-08 18:04:53 -040046.nf
47\fB#include <curses.h>
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053048.PP
micky3879b9f5e72025-07-08 18:04:53 -040049\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
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053061.SH DESCRIPTION
Steve Kondikae271bc2015-11-15 02:50:53 +010062.SS baudrate
micky3879b9f5e72025-07-08 18:04:53 -040063The \fBbaudrate\fP routine returns the output speed of the terminal.
64The
65number returned is in bits per second, for example \fB9600\fP, and is an
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053066integer.
micky3879b9f5e72025-07-08 18:04:53 -040067.SS "erasechar, erasewchar"
68The \fBerasechar\fP routine returns the user's current erase character.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053069.PP
micky3879b9f5e72025-07-08 18:04:53 -040070The \fBerasewchar\fP routine stores the current erase character
71in the location referenced by \fIwc\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053072If no erase character has been defined, the routine fails
micky3879b9f5e72025-07-08 18:04:53 -040073and the location referenced by \fIwc\fP is not changed.
74.SS "has_ic, has_il"
75The \fBhas_ic\fP routine is true if the terminal has insert- and delete-
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053076character capabilities.
77.PP
micky3879b9f5e72025-07-08 18:04:53 -040078The \fBhas_il\fP routine is true if the terminal has insert- and delete-line
79capabilities, or can simulate them using scrolling regions.
80This might
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053081be used to determine if it would be appropriate to turn on physical
micky3879b9f5e72025-07-08 18:04:53 -040082scrolling using \fBscrollok\fP(3X).
83.SS "killchar, killwchar"
84The \fBkillchar\fP routine returns the user's current line kill character.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053085.PP
micky3879b9f5e72025-07-08 18:04:53 -040086The \fBkillwchar\fP routine stores the current line-kill character
87in the location referenced by \fIwc\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053088If no line-kill character has been defined,
micky3879b9f5e72025-07-08 18:04:53 -040089the routine fails and the location referenced by \fIwc\fP is not changed.
Steve Kondikae271bc2015-11-15 02:50:53 +010090.SS longname
micky3879b9f5e72025-07-08 18:04:53 -040091The \fBlongname\fP routine returns a pointer to a static area
92containing a verbose description of the current terminal.
93The maximum
94length of a verbose description is 128 characters.
95It is defined only
96after the call to \fBinitscr\fP or \fBnewterm\fP. The area is
97overwritten 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
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530100terminals.
micky3879b9f5e72025-07-08 18:04:53 -0400101.SS "termattrs, term_attrs"
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530102If a given terminal does not support a video attribute that an
micky3879b9f5e72025-07-08 18:04:53 -0400103application program is trying to use, \fBcurses\fP may substitute a
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530104different video attribute for it.
micky3879b9f5e72025-07-08 18:04:53 -0400105The \fBtermattrs\fP and \fBterm_attrs\fP functions
106return a logical \fBOR\fP of all video attributes supported by the
107terminal using \fBA_\fP and \fBWA_\fP constants respectively.
108This information is useful when a \fBcurses\fP program
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530109needs complete control over the appearance of the screen.
Steve Kondikae271bc2015-11-15 02:50:53 +0100110.SS termname
micky3879b9f5e72025-07-08 18:04:53 -0400111The \fBtermname\fP routine returns the terminal name used by \fBsetupterm\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530112.SH RETURN VALUE
micky3879b9f5e72025-07-08 18:04:53 -0400113\fBlongname\fP and \fBtermname\fP return \fBNULL\fP on error.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530114.PP
micky3879b9f5e72025-07-08 18:04:53 -0400115Routines 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
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530117completion.
118.SH NOTES
micky3879b9f5e72025-07-08 18:04:53 -0400119Note that \fBtermattrs\fP may be a macro.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530120.SH PORTABILITY
micky3879b9f5e72025-07-08 18:04:53 -0400121X/Open Curses, Issue 4 describes these functions.
122It changes the
123return type of \fBtermattrs\fP to the new type \fBattr_t\fP.
124Most versions of curses truncate the result returned by \fBtermname\fP to
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053012514 characters.
126.SH SEE ALSO
micky3879b9f5e72025-07-08 18:04:53 -0400127\fB\%curses\fP(3X),
128\fB\%curs_initscr\fP(3X),
129\fB\%curs_outopts\fP(3X)