Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | .\"*************************************************************************** |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2 | .\" Copyright 2018-2023,2024 Thomas E. Dickey * |
| 3 | .\" Copyright 1998-2010,2015 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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 | .\" |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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" |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 32 | .SH NAME |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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 |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 45 | .SH SYNOPSIS |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 46 | .nf |
| 47 | \fB#include <curses.h> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 48 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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 |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 61 | .SH DESCRIPTION |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 62 | .SS baudrate |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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 |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 66 | integer. |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 67 | .SS "erasechar, erasewchar" |
| 68 | The \fBerasechar\fP routine returns the user's current erase character. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 69 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 70 | The \fBerasewchar\fP routine stores the current erase character |
| 71 | in the location referenced by \fIwc\fP. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 72 | If no erase character has been defined, the routine fails |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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- |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 76 | character capabilities. |
| 77 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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 |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 81 | be used to determine if it would be appropriate to turn on physical |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 82 | scrolling using \fBscrollok\fP(3X). |
| 83 | .SS "killchar, killwchar" |
| 84 | The \fBkillchar\fP routine returns the user's current line kill character. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 85 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 86 | The \fBkillwchar\fP routine stores the current line-kill character |
| 87 | in the location referenced by \fIwc\fP. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 88 | If no line-kill character has been defined, |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 89 | the routine fails and the location referenced by \fIwc\fP is not changed. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 90 | .SS longname |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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 |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 100 | terminals. |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 101 | .SS "termattrs, term_attrs" |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 102 | If a given terminal does not support a video attribute that an |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 103 | application program is trying to use, \fBcurses\fP may substitute a |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 104 | different video attribute for it. |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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 |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 109 | needs complete control over the appearance of the screen. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 110 | .SS termname |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 111 | The \fBtermname\fP routine returns the terminal name used by \fBsetupterm\fP. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 112 | .SH RETURN VALUE |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 113 | \fBlongname\fP and \fBtermname\fP return \fBNULL\fP on error. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 114 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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 |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 117 | completion. |
| 118 | .SH NOTES |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 119 | Note that \fBtermattrs\fP may be a macro. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 120 | .SH PORTABILITY |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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 |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 125 | 14 characters. |
| 126 | .SH SEE ALSO |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 127 | \fB\%curses\fP(3X), |
| 128 | \fB\%curs_initscr\fP(3X), |
| 129 | \fB\%curs_outopts\fP(3X) |