blob: 1df0a1d3f394812f31101f448500893683291726 [file] [log] [blame]
Steve Kondikae271bc2015-11-15 02:50:53 +01001'\" t
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05302.\"***************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -04003.\" Copyright 2018-2023,2024 Thomas E. Dickey *
4.\" Copyright 1998-2015,2017 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05305.\" *
6.\" Permission is hereby granted, free of charge, to any person obtaining a *
7.\" copy of this software and associated documentation files (the *
8.\" "Software"), to deal in the Software without restriction, including *
9.\" without limitation the rights to use, copy, modify, merge, publish, *
10.\" distribute, distribute with modifications, sublicense, and/or sell *
11.\" copies of the Software, and to permit persons to whom the Software is *
12.\" furnished to do so, subject to the following conditions: *
13.\" *
14.\" The above copyright notice and this permission notice shall be included *
15.\" in all copies or substantial portions of the Software. *
16.\" *
17.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
18.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
19.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
20.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
21.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
22.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
23.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
24.\" *
25.\" Except as contained in this notice, the name(s) of the above copyright *
26.\" holders shall not be used in advertising or otherwise to promote the *
27.\" sale, use or other dealings in this Software without prior written *
28.\" authorization. *
29.\"***************************************************************************
30.\"
micky3879b9f5e72025-07-08 18:04:53 -040031.\" $Id: curs_util.3x,v 1.101 2024/04/20 21:20:07 tom Exp $
32.TH curs_util 3X 2024-04-20 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
33.ie \n(.g \{\
34.ds `` \(lq
35.ds '' \(rq
36.\}
37.el \{\
38.ie t .ds `` ``
39.el .ds `` ""
40.ie t .ds '' ''
41.el .ds '' ""
42.\}
43.
Steve Kondikae271bc2015-11-15 02:50:53 +010044.de bP
micky3879b9f5e72025-07-08 18:04:53 -040045.ie n .IP \(bu 4
46.el .IP \(bu 2
Steve Kondikae271bc2015-11-15 02:50:53 +010047..
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053048.SH NAME
micky3879b9f5e72025-07-08 18:04:53 -040049\fB\%delay_output\fP,
50\fB\%filter\fP,
51\fB\%flushinp\fP,
52\fB\%getwin\fP,
53\fB\%key_name\fP,
54\fB\%keyname\fP,
55\fB\%nofilter\fP,
56\fB\%putwin\fP,
57\fB\%unctrl\fP,
58\fB\%use_env\fP,
59\fB\%use_tioctl\fP,
60\fB\%wunctrl\fP \-
61miscellaneous \fIcurses\fR utility routines
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053062.SH SYNOPSIS
micky3879b9f5e72025-07-08 18:04:53 -040063.nf
64\fB#include <curses.h>
65.PP
66\fBconst char *unctrl(chtype \fIch\fP);
67\fBwchar_t *wunctrl(cchar_t *\fIwch\fP);
68.PP
69\fBconst char *keyname(int \fIc\fP);
70\fBconst char *key_name(wchar_t \fIwc\fP);
71.PP
72\fBvoid filter(void);
73.PP
74\fBvoid use_env(bool \fIf\fP);
75.PP
76\fBint putwin(WINDOW *\fIwin\fP, FILE *\fIfilep\fP);
77\fBWINDOW *getwin(FILE *\fIfilep\fP);
78.PP
79\fBint delay_output(int \fIms\fP);
80\fBint flushinp(void);
81.PP
82\fI/* extensions */
83\fBvoid nofilter(void);
84\fBvoid use_tioctl(bool \fIf\fP);
85.fi
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053086.SH DESCRIPTION
Steve Kondikae271bc2015-11-15 02:50:53 +010087.SS unctrl
micky3879b9f5e72025-07-08 18:04:53 -040088The \fBunctrl\fP routine returns a character string which is a printable
89representation of the character \fIch\fP:
Steve Kondikae271bc2015-11-15 02:50:53 +010090.bP
91Printable characters are displayed as themselves,
92e.g., a one-character string containing the key.
93.bP
micky3879b9f5e72025-07-08 18:04:53 -040094Control characters are displayed in the \fB^\fIX\fR notation.
95.bP
96Printing characters are displayed as is.
Steve Kondikae271bc2015-11-15 02:50:53 +010097.bP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053098DEL (character 127) is displayed as \fB^?\fP.
Steve Kondikae271bc2015-11-15 02:50:53 +010099.bP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530100Values above 128 are either meta characters
101(if the screen has not been initialized,
micky3879b9f5e72025-07-08 18:04:53 -0400102or if \fBmeta\fP(3X) has been called with a \fBTRUE\fP parameter),
103shown in the \fBM\-\fIX\fR notation,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530104or are displayed as themselves.
105In the latter case, the values may not be printable;
106this follows the X/Open specification.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530107.PP
micky3879b9f5e72025-07-08 18:04:53 -0400108The corresponding \fBwunctrl\fP returns a printable representation of
109a complex character \fIwch\fP.
110.PP
111In both \fBunctrl\fP and \fBwunctrl\fP the attributes and color associated
112with the character parameter are ignored.
113.SS "keyname, key_name"
114The \fBkeyname\fP routine returns a character string
115corresponding to the key \fIc\fP.
116Key codes are different from character codes.
117.bP
118Key codes below 256 are characters.
119They are displayed using \fBunctrl\fP.
120.bP
121Values above 256 may be the codes for function keys.
122The function key name is displayed.
123.bP
124Otherwise (if there is no corresponding name and the key is not a character)
125the function returns null, to denote an error.
126X/Open also lists an \*(``UNKNOWN KEY\*('' return value,
127which some implementations return rather than null.
128.LP
129The corresponding \fBkey_name\fP returns
130a multibyte character string corresponding
131to the wide-character value \fIw\fP.
132The two functions (\fBkeyname\fP and \fBkey_name\fP)
133do not return the same set of strings:
134.bP
135\fBkeyname\fP returns null where \fBkey_name\fP would display a meta character.
136.bP
137\fBkey_name\fP does not return the name of a function key.
138.SS "filter, nofilter"
139The \fBfilter\fP routine, if used, must be called before \fBinitscr\fP or
140\fBnewterm\fP are called.
141Calling \fBfilter\fP causes these changes in initialization:
142.bP
143\fBLINES\fP is set to 1;
144.bP
145the capabilities
146\fBclear\fP,
147\fBcud1\fP,
148\fBcud\fP,
149\fBcup\fP,
150\fBcuu1\fP,
151\fBcuu\fP,
152\fBvpa\fP
153are disabled;
154.bP
155the capability \fBed\fP is disabled if \fBbce\fP is set;
156.bP
157and the \fBhome\fP string is set to the value of \fBcr\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530158.PP
159The \fBnofilter\fP routine cancels the effect of a preceding \fBfilter\fP
160call.
161That allows the caller to initialize a screen on a different device,
162using a different value of \fB$TERM\fP.
163The limitation arises because the \fBfilter\fP routine modifies the
164in-memory copy of the terminal information.
Steve Kondikae271bc2015-11-15 02:50:53 +0100165.SS use_env
micky3879b9f5e72025-07-08 18:04:53 -0400166The \fBuse_env\fP routine, if used,
167should be called before \fBinitscr\fP or
168\fBnewterm\fP are called
Steve Kondikae271bc2015-11-15 02:50:53 +0100169(because those compute the screen size).
micky3879b9f5e72025-07-08 18:04:53 -0400170It modifies the way \fI\%ncurses\fP treats environment variables
Steve Kondikae271bc2015-11-15 02:50:53 +0100171when determining the screen size.
172.bP
micky3879b9f5e72025-07-08 18:04:53 -0400173Normally \fI\%ncurses\fP looks first at the terminal database for the
174screen size.
Steve Kondikae271bc2015-11-15 02:50:53 +0100175.IP
176If \fBuse_env\fP was called with \fBFALSE\fP for parameter,
177it stops here unless
micky3879b9f5e72025-07-08 18:04:53 -0400178\fBuse_tioctl\fP was also called with \fBTRUE\fP for parameter.
Steve Kondikae271bc2015-11-15 02:50:53 +0100179.bP
180Then it asks for the screen size via operating system calls.
181If successful,
182it overrides the values from the terminal database.
183.bP
184Finally (unless \fBuse_env\fP was called with \fBFALSE\fP parameter),
micky3879b9f5e72025-07-08 18:04:53 -0400185\fI\%ncurses\fP examines the \fILINES\fP or \fI\%COLUMNS\fP environment
186variables,
Steve Kondikae271bc2015-11-15 02:50:53 +0100187using a value in those to override the results
188from the operating system or terminal database.
189.IP
micky3879b9f5e72025-07-08 18:04:53 -0400190\fI\%curses\fP also updates the screen size in response to
191\fBSIGWINCH\fP,
192unless overridden by the \fILINES\fP or \fI\%COLUMNS\fP environment
193variables,
Steve Kondikae271bc2015-11-15 02:50:53 +0100194.SS use_tioctl
micky3879b9f5e72025-07-08 18:04:53 -0400195The \fBuse_tioctl\fP routine, if used,
196should be called before \fBinitscr\fP or \fBnewterm\fP are called
Steve Kondikae271bc2015-11-15 02:50:53 +0100197(because those compute the screen size).
micky3879b9f5e72025-07-08 18:04:53 -0400198After \fBuse_tioctl\fP is called with \fBTRUE\fP as an argument,
199\fI\%ncurses\fP modifies the last step in its computation
200of screen size as follows:
Steve Kondikae271bc2015-11-15 02:50:53 +0100201.bP
micky3879b9f5e72025-07-08 18:04:53 -0400202checks if the \fILINES\fP and \fI\%COLUMNS\fP environment variables
Steve Kondikae271bc2015-11-15 02:50:53 +0100203are set to a number greater than zero.
204.bP
micky3879b9f5e72025-07-08 18:04:53 -0400205for each, \fI\%ncurses\fP updates the corresponding environment variable
Steve Kondikae271bc2015-11-15 02:50:53 +0100206with the value that it has obtained via operating system call
207or from the terminal database.
208.bP
micky3879b9f5e72025-07-08 18:04:53 -0400209\fI\%ncurses\fP re-fetches the value of the environment variables so
210that it is still the environment variables which set the screen size.
Steve Kondikae271bc2015-11-15 02:50:53 +0100211.PP
micky3879b9f5e72025-07-08 18:04:53 -0400212The \fB\%use_env\fP and \fB\%use_tioctl\fP routines combine as follows.
213.IP
Steve Kondikae271bc2015-11-15 02:50:53 +0100214.TS
micky3879b9f5e72025-07-08 18:04:53 -0400215lB lB lB
216lB lB lx.
217use_env use_tioctl Summary
218_
219TRUE FALSE T{
Steve Kondikae271bc2015-11-15 02:50:53 +0100220This is the default behavior.
micky3879b9f5e72025-07-08 18:04:53 -0400221\fI\%ncurses\fP uses operating system calls
222unless overridden by \fILINES\fP or \fI\%COLUMNS\fP environment
223variables;
224default.
Steve Kondikae271bc2015-11-15 02:50:53 +0100225T}
micky3879b9f5e72025-07-08 18:04:53 -0400226TRUE TRUE T{
227\fI\%ncurses\fP updates \fILINES\fP and \fI\%COLUMNS\fP based on
228operating system calls.
Steve Kondikae271bc2015-11-15 02:50:53 +0100229T}
micky3879b9f5e72025-07-08 18:04:53 -0400230FALSE TRUE T{
231\fI\%ncurses\fP ignores \fILINES\fP and \fI\%COLUMNS\fP,
232using operating system calls to obtain size.
Steve Kondikae271bc2015-11-15 02:50:53 +0100233T}
234.TE
micky3879b9f5e72025-07-08 18:04:53 -0400235.SS "putwin, getwin"
236The \fBputwin\fP routine writes all data associated
237with window (or pad) \fIwin\fP into
238the file to which \fIfilep\fP points.
Steve Kondikae271bc2015-11-15 02:50:53 +0100239This information can be later retrieved
micky3879b9f5e72025-07-08 18:04:53 -0400240using the \fBgetwin\fP function.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530241.PP
micky3879b9f5e72025-07-08 18:04:53 -0400242The \fBgetwin\fP routine reads window related data stored in the file by
243\fBputwin\fP.
Steve Kondikae271bc2015-11-15 02:50:53 +0100244The routine then creates and initializes a new window using that
245data.
246It returns a pointer to the new window.
247There are a few caveats:
248.bP
micky3879b9f5e72025-07-08 18:04:53 -0400249the data written is a copy of the \fI\%WINDOW\fP structure,
Steve Kondikae271bc2015-11-15 02:50:53 +0100250and its associated character cells.
micky3879b9f5e72025-07-08 18:04:53 -0400251The format differs between the wide-character (\fI\%ncursesw\fP) and
252non-wide (\fI\%ncurses\fP) libraries.
Steve Kondikae271bc2015-11-15 02:50:53 +0100253You can transfer data between the two, however.
254.bP
255the retrieved window is always created as a top-level window (or pad),
256rather than a subwindow.
257.bP
258the window's character cells contain the color pair \fIvalue\fP,
259but not the actual color \fInumbers\fP.
260If cells in the retrieved window use color pairs which have not been
261created in the application using \fBinit_pair\fP,
262they will not be colored when the window is refreshed.
263.SS delay_output
micky3879b9f5e72025-07-08 18:04:53 -0400264The \fBdelay_output\fP routine inserts an \fIms\fP millisecond pause
Steve Kondikae271bc2015-11-15 02:50:53 +0100265in output.
micky3879b9f5e72025-07-08 18:04:53 -0400266Employ this function judiciously when terminal output uses padding,
267because \fI\%ncurses\fP transmits null characters
268(consuming CPU and I/O resources)
269instead of sleeping and requesting resumption from the operating system.
270Padding is used unless:
271.bP
272the terminal description has \fBnpc\fP (\fBno_pad_char\fP) capability, or
273.bP
274the environment variable \fB\%NCURSES_NO_PADDING\fP is set.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530275.PP
micky3879b9f5e72025-07-08 18:04:53 -0400276If padding is not in use,
277\fI\%ncurses\fP uses \fBnapms\fP to perform the delay.
278If the value of \fIms\fP exceeds 30,000
279(thirty seconds),
280it is capped at that value.
281.SS flushinp
282The \fBflushinp\fP routine throws away any typeahead that has been typed by the
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530283user and has not yet been read by the program.
284.SH RETURN VALUE
micky3879b9f5e72025-07-08 18:04:53 -0400285Except for \fBflushinp\fP, routines that return an integer return \fBERR\fP
286upon failure and \fBOK\fP (SVr4 specifies only "an integer value other than
287\fBERR\fP") upon successful completion.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530288.PP
micky3879b9f5e72025-07-08 18:04:53 -0400289Routines that return pointers return \fBNULL\fP on error.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530290.PP
micky3879b9f5e72025-07-08 18:04:53 -0400291X/Open Curses does not specify any error conditions.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530292In this implementation
293.RS 3
294.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400295\fBflushinp\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530296returns an error if the terminal was not initialized.
297.TP 5
298\fBputwin\fP
299returns an error if the associated \fBfwrite\fP calls return an error.
300.RE
301.SH PORTABILITY
Steve Kondikae271bc2015-11-15 02:50:53 +0100302.SS filter
micky3879b9f5e72025-07-08 18:04:53 -0400303The SVr4 documentation describes the action of \fBfilter\fP only in the vaguest
Steve Kondikae271bc2015-11-15 02:50:53 +0100304terms.
micky3879b9f5e72025-07-08 18:04:53 -0400305The description here is adapted from X/Open Curses (which
306erroneously fails to describe the disabling of \fBcuu\fP).
307.SS "delay_output padding"
308The limitation to 30 seconds
309and the use of \fBnapms\fP
310differ from other implementations.
311.bP
312SVr4 curses does not delay if no padding character is available.
313.bP
314NetBSD curses uses \fBnapms\fP when no padding character is available,
315but does not take timing into account when using the padding character.
Steve Kondikae271bc2015-11-15 02:50:53 +0100316.PP
micky3879b9f5e72025-07-08 18:04:53 -0400317Neither limits the delay.
318.SS keyname
Steve Kondikae271bc2015-11-15 02:50:53 +0100319The \fBkeyname\fP function may return the names of user-defined
320string capabilities which are defined in the terminfo entry via the \fB\-x\fP
321option of \fB@TIC@\fP.
322This implementation automatically assigns at run-time keycodes to
micky3879b9f5e72025-07-08 18:04:53 -0400323user-defined strings which begin with \*(``k\*(''.
Steve Kondikae271bc2015-11-15 02:50:53 +0100324The keycodes start at KEY_MAX, but are not guaranteed to be
325the same value for different runs because user-defined codes are
326merged from all terminal descriptions which have been loaded.
micky3879b9f5e72025-07-08 18:04:53 -0400327The \fBuse_extended_names\fP(3X) function controls whether this data is
Steve Kondikae271bc2015-11-15 02:50:53 +0100328loaded when the terminal description is read by the library.
micky3879b9f5e72025-07-08 18:04:53 -0400329.SS "nofilter, use_tioctl"
330The \fBnofilter\fP and \fBuse_tioctl\fP routines are specific to
331\fI\%ncurses\fP.
Steve Kondikae271bc2015-11-15 02:50:53 +0100332They were not supported on Version 7, BSD or System V implementations.
micky3879b9f5e72025-07-08 18:04:53 -0400333It is recommended that any code depending on \fI\%ncurses\fP extensions
334be conditioned using \fBNCURSES_VERSION\fP.
335.SS "putwin/getwin file-format"
Steve Kondikae271bc2015-11-15 02:50:53 +0100336The \fBputwin\fP and \fBgetwin\fP functions have several issues with
337portability:
338.bP
339The files written and read by these functions
340use an implementation-specific format.
341Although the format is an obvious target for standardization,
342it has been overlooked.
343.IP
344Interestingly enough, according to the copyright dates in Solaris source,
345the functions (along with \fBscr_init\fP, etc.) originated with
346the University of California, Berkeley (in 1982)
347and were later (in 1988) incorporated into SVr4.
348Oddly, there are no such functions in the 4.3BSD curses sources.
349.bP
micky3879b9f5e72025-07-08 18:04:53 -0400350Most implementations simply dump the binary \fI\%WINDOW\fP structure
351to the file.
352These include SVr4 curses, NetBSD and PDCurses,
353as well as older \fI\%ncurses\fP versions.
354This implementation
355(as well as the X/Open variant of Solaris curses, dated 1995)
Steve Kondikae271bc2015-11-15 02:50:53 +0100356uses textual dumps.
357.IP
358The implementations which use binary dumps use block-I/O
359(the \fBfwrite\fP and \fBfread\fP functions).
360Those that use textual dumps use buffered-I/O.
361A few applications may happen to write extra data in the file using
362these functions.
363Doing that can run into problems mixing block- and buffered-I/O.
364This implementation reduces the problem on writes by flushing the output.
365However, reading from a file written using mixed schemes may not be successful.
micky3879b9f5e72025-07-08 18:04:53 -0400366.SS "unctrl, wunctrl"
367X/Open Curses, Issue 4 describes these functions.
368It states that \fBunctrl\fP and \fBwunctrl\fP will return a null pointer if
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530369unsuccessful, but does not define any error conditions.
370This implementation checks for three cases:
Steve Kondikae271bc2015-11-15 02:50:53 +0100371.bP
372the parameter is a 7-bit US\-ASCII code.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530373This is the case that X/Open Curses documented.
Steve Kondikae271bc2015-11-15 02:50:53 +0100374.bP
375the parameter is in the range 128\-159, i.e., a C1 control code.
micky3879b9f5e72025-07-08 18:04:53 -0400376If \fBuse_legacy_coding\fP(3X) has been called with a \fB2\fP parameter,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530377\fBunctrl\fP returns the parameter, i.e., a one-character string with
378the parameter as the first character.
Steve Kondikae271bc2015-11-15 02:50:53 +0100379Otherwise, it returns \*(``~@\*('', \*(``~A\*('', etc.,
380analogous to \*(``^@\*('', \*(``^A\*('', C0 controls.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530381.IP
382X/Open Curses does not document whether \fBunctrl\fP can be called before
383initializing curses.
384This implementation permits that,
Steve Kondikae271bc2015-11-15 02:50:53 +0100385and returns the \*(``~@\*('', etc., values in that case.
386.bP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530387parameter values outside the 0 to 255 range.
388\fBunctrl\fP returns a null pointer.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530389.PP
micky3879b9f5e72025-07-08 18:04:53 -0400390The strings returned by \fBunctrl\fP in this implementation are determined
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530391at compile time,
micky3879b9f5e72025-07-08 18:04:53 -0400392showing C1 controls from the upper-128 codes
393with a \*(``~\*('' prefix rather than \*(``^\*(''.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530394Other implementations have different conventions.
micky3879b9f5e72025-07-08 18:04:53 -0400395For example, they may show both sets of control characters with \*(``^\*('',
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530396and strip the parameter to 7 bits.
397Or they may ignore C1 controls and treat all of the upper-128 codes as
398printable.
399This implementation uses 8 bits but does not modify the string to reflect
400locale.
micky3879b9f5e72025-07-08 18:04:53 -0400401The \fBuse_legacy_coding\fP(3X) function allows the caller to
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530402change the output of \fBunctrl\fP.
403.PP
micky3879b9f5e72025-07-08 18:04:53 -0400404Likewise, the \fBmeta\fP(3X) function allows the caller to change the
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530405output of \fBkeyname\fP, i.e.,
micky3879b9f5e72025-07-08 18:04:53 -0400406it determines whether to use the \*(``M\-\*('' prefix
Steve Kondikae271bc2015-11-15 02:50:53 +0100407for \*(``meta\*('' keys (codes in the range 128 to 255).
micky3879b9f5e72025-07-08 18:04:53 -0400408Both \fBuse_legacy_coding\fP(3X) and \fBmeta\fP(3X) succeed only after
Steve Kondikae271bc2015-11-15 02:50:53 +0100409curses is initialized.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530410X/Open Curses does not document the treatment of codes 128 to 159.
Steve Kondikae271bc2015-11-15 02:50:53 +0100411When treating them as \*(``meta\*('' keys
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530412(or if \fBkeyname\fP is called before initializing curses),
Steve Kondikae271bc2015-11-15 02:50:53 +0100413this implementation returns strings \*(``M\-^@\*('', \*(``M\-^A\*('', etc.
micky3879b9f5e72025-07-08 18:04:53 -0400414.PP
415X/Open Curses documents \fBunctrl\fP as declared in \fB<unctrl.h>\fP,
416which \fI\%ncurses\fP does.
417However, \fI\%ncurses\fP' \fB<curses.h>\fP includes \fB<unctrl.h>\fP,
418matching the behavior of SVr4 curses.
419Other implementations may not do that.
420.SS "use_env, use_tioctl"
421If \fI\%ncurses\fP is configured to provide the sp-functions extension,
422the state of \fBuse_env\fP and \fBuse_tioctl\fP may be updated before
423creating each \fIscreen\fP rather than once only
424(\fBcurs_sp_funcs\fP(3X)).
425This feature of \fBuse_env\fP
426is not provided by other implementations of curses.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530427.SH SEE ALSO
micky3879b9f5e72025-07-08 18:04:53 -0400428\fB\%curses\fP(3X),
429\fB\%curs_initscr\fP(3X),
430\fB\%curs_inopts\fP(3X),
431\fB\%curs_kernel\fP(3X),
432\fB\%curs_scr_dump\fP(3X),
433\fB\%curs_sp_funcs\fP(3X),
434\fB\%curs_variables\fP(3X),
435\fB\%legacy_coding\fP(3X)