1 .\" $NetBSD: curses_screen.3,v 1.15 2012/04/21 12:27:28 roy Exp $
4 .\" Brett Lymn (blymn@NetBSD.org, brett_lymn@yahoo.com.au)
6 .\" This code is donated to the NetBSD Foundation by the Author.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. The name of the Author may not be used to endorse or promote
17 .\" products derived from this software without specific prior written
20 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46 .Nd curses terminal and screen routines
52 .Fn newterm "char *type" "FILE *outfd" "FILE *infd"
54 .Fn set_term "SCREEN *screen"
56 .Fn delscreen "SCREEN *screen"
64 .Fn resizeterm "int lines" "int cols"
66 .Fn setterm "char *name"
68 .Va extern int LINES ;
72 These functions initialize terminals and screens.
76 function initialises the curses data structures and pointers ready for
84 in which case the TERM environment variable is used.
89 are the output and input file descriptors for the terminal.
92 function must only be called once per terminal.
96 function can be used to switch between the screens defined by calling
98 a pointer to the previous screen structure that was in use will be
103 will destroy the given screen and free all allocated resources.
107 will end the curses session and restore the saved terminal settings.
109 The curses session must be initialised by calling
111 which saves the current terminal state and sets up the terminal and
112 internal data structures to support the curses application.
114 function call must be, with few exceptions, the first Curses library
116 The exception to this rule is the
118 call which may be called prior to
120 The size of the curses screen is determined by checking the
124 entries for the terminal type.
125 If the environment variables
129 are set, then these will be used instead.
135 are called, the Curses library sets up signal handlers for
139 If a signal handler is already installed for
141 this will also be called when the Curses library handler is called.
145 function can be used to determine whether or not a refresh of the
146 screen has occurred since the last call to
149 The size of the screen may be changed by calling
151 with the updated number of lines and columns.
152 This will resize the curses internal data structures to accommodate the
153 changed terminal geometry.
158 windows and any of their subwindows will be resized to fit the new
160 The application must redraw the screen after a call to
165 function sets the terminal type for the current screen to the one
166 passed, initialising all the curses internal data structures with
167 information related to the named terminal.
170 argument must be a valid name or alias in the
172 database for this function to succeed.
174 Functions returning pointers will return
176 if an error is detected.
177 The functions that return an int will return one of the following
180 .Bl -tag -width ERR -compact
182 The function completed successfully.
184 An error occurred in the function.
187 .Xr curses_window 3 ,
194 Curses library complies with the X/Open Curses specification, part of the
195 Single Unix Specification.
197 The Curses package appeared in
203 extension to the Curses library and was added in