blob: e19459fa39b70c509a03c120c56b6adfad0cf10b [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
Steve Kondikae271bc2015-11-15 02:50:53 +01002.\" Copyright (c) 1998-2010,2015 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05303.\" *
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.\"
Steve Kondikae271bc2015-11-15 02:50:53 +010029.\" $Id: curs_termattrs.3x,v 1.13 2015/07/21 00:03:34 tom Exp $
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053030.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,
Steve Kondikae271bc2015-11-15 02:50:53 +010042\fBtermname\fR \- \fBcurses\fR environment query routines
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053043.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
Steve Kondikae271bc2015-11-15 02:50:53 +010069.SS baudrate
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053070The \fBbaudrate\fR routine returns the output speed of the terminal. The
71number returned is in bits per second, for example \fB9600\fR, and is an
72integer.
Steve Kondikae271bc2015-11-15 02:50:53 +010073.SS erasechar, erasewchar
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053074.PP
75The \fBerasechar\fR routine returns the user's current erase character.
76.PP
77The \fBerasewchar\fR routine stores the current erase character
78in the location referenced by \fIch\fR.
79If no erase character has been defined, the routine fails
80and the location referenced by \fIch\fR is not changed.
Steve Kondikae271bc2015-11-15 02:50:53 +010081.SS has_is, has_il
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053082.PP
83The \fBhas_ic\fR routine is true if the terminal has insert- and delete-
84character capabilities.
85.PP
86The \fBhas_il\fR routine is true if the terminal has insert- and delete-line
87capabilities, or can simulate them using scrolling regions. This might
88be used to determine if it would be appropriate to turn on physical
89scrolling using \fBscrollok\fR.
Steve Kondikae271bc2015-11-15 02:50:53 +010090.SS killchar, killwchar
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053091.PP
92The \fBkillchar\fR routine returns the user's current line kill character.
93.PP
94The \fBkillwchar\fR routine stores the current line-kill character
95in the location referenced by \fIch\fR.
96If no line-kill character has been defined,
97the routine fails and the location referenced by \fIch\fR is not changed.
Steve Kondikae271bc2015-11-15 02:50:53 +010098.SS longname
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053099.PP
100The \fBlongname\fR routine returns a pointer to a static area
101containing a verbose description of the current terminal. The maximum
102length of a verbose description is 128 characters. It is defined only
103after the call to \fBinitscr\fR or \fBnewterm\fR. The area is
104overwritten 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
107terminals.
Steve Kondikae271bc2015-11-15 02:50:53 +0100108.SS termattrs, term_attrs
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530109.PP
110If a given terminal does not support a video attribute that an
111application program is trying to use, \fBcurses\fR may substitute a
112different video attribute for it.
113The \fBtermattrs\fR and \fBterm_attrs\fR functions
114return a logical \fBOR\fR of all video attributes supported by the
115terminal using \fIA_\fR and \fIWA_\fR constants respectively.
116This information is useful when a \fBcurses\fR program
117needs complete control over the appearance of the screen.
Steve Kondikae271bc2015-11-15 02:50:53 +0100118.SS termname
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530119.PP
120The \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
124Routines 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
126completion.
127.SH NOTES
128Note that \fBtermattrs\fR may be a macro.
129.SH PORTABILITY
130The XSI Curses standard, Issue 4 describes these functions. It changes the
131return type of \fBtermattrs\fR to the new type \fBattr_t\fR.
132Most versions of curses truncate the result returned by \fBtermname\fR to
13314 characters.
134.SH SEE ALSO
135\fBcurses\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_outopts\fR(3X)