| 1 |
.\"*************************************************************************** |
| 2 |
.\" Copyright 2018-2024,2025 Thomas E. Dickey * |
| 3 |
.\" Copyright 1999-2010,2016 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 |
.\" Author: Thomas E. Dickey 1999-on |
| 31 |
.\" |
| 32 |
.\" $Id: curs_extend.3x,v 1.67 2025/11/12 00:46:51 tom Exp $ |
| 33 |
.TH extensions 3NCURSES 2025-11-11 "ncurses 6.6" "Library calls" |
| 34 |
.ie \n(.g \{\ |
| 35 |
.ds `` \(lq |
| 36 |
.ds '' \(rq |
| 37 |
.\} |
| 38 |
.el \{\ |
| 39 |
.ie t .ds `` `` |
| 40 |
.el .ds `` "" |
| 41 |
.ie t .ds '' '' |
| 42 |
.el .ds '' "" |
| 43 |
.\} |
| 44 |
.SH NAME |
| 45 |
\fB\%curses_version\fP, |
| 46 |
\fB\%use_extended_names\fP \- |
| 47 |
miscellaneous \fIncurses\fR extensions |
| 48 |
.SH SYNOPSIS |
| 49 |
.nf |
| 50 |
\fB#include <curses.h> |
| 51 |
.PP |
| 52 |
\fBconst char * curses_version(void); |
| 53 |
\fBint use_extended_names(bool \fIbf\fP); |
| 54 |
.fi |
| 55 |
.SH DESCRIPTION |
| 56 |
These |
| 57 |
.I \%ncurses |
| 58 |
extensions to the |
| 59 |
.I curses |
| 60 |
library do not fit easily into other functional categories. |
| 61 |
.SS curses_version |
| 62 |
.B \%curses_version |
| 63 |
returns a pointer to a string containing the library's name |
| 64 |
and version number, |
| 65 |
including its patch level, |
| 66 |
for example |
| 67 |
\*(``ncurses 6.5.20240720\*(''. |
| 68 |
.SS use_extended_names |
| 69 |
.B \%use_extended_names |
| 70 |
configures whether the library recognizes |
| 71 |
user-defined or nonstandard |
| 72 |
.I \%term\%info |
| 73 |
capability names that may be compiled into terminal type descriptions |
| 74 |
via the \fB\%terminfo\fP(3NCURSES) or \fB\%termcap\fP(3NCURSES) interfaces. |
| 75 |
Normally these names are available for use, |
| 76 |
since the essential decision |
| 77 |
is made through use of \fB\%tic\fP(1)'s |
| 78 |
.B \-x |
| 79 |
option to include such extensions in terminal type descriptions. |
| 80 |
.B \%use_extended_names(FALSE) |
| 81 |
prevents |
| 82 |
.I \%ncurses |
| 83 |
from recognizing these capabilities |
| 84 |
to ensure compatibility with other implementations of |
| 85 |
.IR curses . |
| 86 |
.SH RETURN VALUE |
| 87 |
.B \%curses_version |
| 88 |
returns a constant string. |
| 89 |
.PP |
| 90 |
.B \%use_extended_names |
| 91 |
returns the previous state of extended capability name recognition, |
| 92 |
allowing you to save this property and restore it. |
| 93 |
.SH NOTES |
| 94 |
The pointer returned by |
| 95 |
.B \%curses_version |
| 96 |
corresponds to statically allocated memory; |
| 97 |
do not attempt to \fIfree\fP(3) it. |
| 98 |
.SH EXTENSIONS |
| 99 |
These functions are |
| 100 |
.I \%ncurses |
| 101 |
extensions, |
| 102 |
and are not found in SVr4 |
| 103 |
.IR curses , |
| 104 |
4.4BSD |
| 105 |
.IR curses , |
| 106 |
or any other previous |
| 107 |
.I curses |
| 108 |
implementation. |
| 109 |
.SH PORTABILITY |
| 110 |
Applications employing |
| 111 |
.I \%ncurses |
| 112 |
extensions should condition their use on the visibility of the |
| 113 |
.B \%NCURSES_VERSION |
| 114 |
preprocessor macro. |
| 115 |
.PP |
| 116 |
NetBSD 9 added a |
| 117 |
.I \%curses_version |
| 118 |
function |
| 119 |
that intentionally returns a string devoid of version information. |
| 120 |
.\" See https://mail-index.netbsd.org/tech-userlevel/2019/08/27/\ |
| 121 |
.\" msg012068.html and follow-up messages. |
| 122 |
.SH AUTHORS |
| 123 |
Thomas Dickey |
| 124 |
.SH SEE ALSO |
| 125 |
.I \%ncurses |
| 126 |
offers several other extensions to the X/Open Curses API. |
| 127 |
.PP |
| 128 |
\fB\%getch\fP(3NCURSES), |
| 129 |
\fB\%inopts\fP(3NCURSES), |
| 130 |
\fB\%mouse\fP(3NCURSES), |
| 131 |
\fB\%print\fP(3NCURSES), |
| 132 |
\fB\%util\fP(3NCURSES), |
| 133 |
\fB\%default_colors\fP(3NCURSES), |
| 134 |
\fB\%define_key\fP(3NCURSES), |
| 135 |
\fB\%keybound\fP(3NCURSES), |
| 136 |
\fB\%keyok\fP(3NCURSES), |
| 137 |
\fB\%new_pair\fP(3NCURSES), |
| 138 |
\fB\%resizeterm\fP(3NCURSES), |
| 139 |
\fB\%wresize\fP(3NCURSES) |