.\" Copyright (c) 1992, 1993
.\" The Regents of the University of California. All rights reserved.
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" @(#)fns.doc 8.2 (Berkeley) 6/1/94
If the character is a newline
the line will be cleared to the end,
and the current \*y will be changed to the
beginning off the next line
if newline mapping is on,
or to the next line at the same x co-ordinate
will move to the beginning of the line on the window.
will be expanded into spaces
in the normal tabstop positions of
.Fn addstr "char *str" \(dg
Add the string pointed to by
on the window at the current \*y.
In this case, it will put on as much as it can.
Returns the output baud rate of the terminal.
This is a system dependent constant
.Fn box "WINDOW win" "char vert" "char hor"
Draws a box around the window using
as the character for drawing the vertical sides, and
for drawing the horizontal lines.
If scrolling is not allowed,
and the window encompasses the lower right-hand corner of the terminal,
the corners are left blank to avoid a scroll.
Set or the terminal to cbreak mode.
Resets the entire window to blanks.
this sets the clear flag,
which will cause a clear-screen sequence to be sent
This also moves the current \*y
.Fn clearok "WINDOW *scr" "int boolf" \(dg
Sets the clear flag for the screen
this will force a clear-screen to be printed on the next
or stop it from doing so if
This only works on screens,
does not alter the contents of the screen.
call will cause a clear-screen,
even if the window passed to
Wipes the window clear from the current \*y to the bottom.
This does not force a clear-screen sequence on the next refresh
Wipes the window clear from the current \*y to the end of the line.
is retained for backwards compatibility
with ealier versions of the library.
Delete the character at the current \*y.
Each character after it on the line shifts to the left,
and the last character becomes blank.
Every line below the current one will move up,
and the bottom line will become blank.
The current \*y will remain unchanged.
Deletes the window from existence.
All resources are freed for future use by
allocated window inside of it,
deleting the outer window
the subwindow is not affected,
even though this does invalidate it.
subwindows should be deleted before their
Sets the terminal to echo characters.
Finish up window routines before exit.
This restores the terminal to the state it was before
It should always be called before exiting and before the final calls to
This is especially useful for resetting tty stats
when trapping rubouts via
Erases the window to blanks without setting the clear flag.
except that it never causes a clear-screen sequence to be generated
Returns the erase character
the character used by the user to erase a single character from the input.
.Fn flushok "WINDOW *win" "int boolf"
allows you to control this.
Gets a character from the terminal and (if necessary)
Otherwise, the character gotten is returned.
has been set, then the window is left unaltered.
In order to retain control of the terminal,
it is necessary to have one of
whatever routine you call to read characters will set
and then reset to the original mode when finished.
.Fn getstr "char *str" \(dg
Get a string through the window
and put it in the location pointed to by
which is assumed to be large enough to handle it.
It sets tty modes if necessary,
to get the characters needed to fill in the string
until a newline or EOF is encountered.
The newline stripped off the string.
This is normally called by
.Fn getyx "WINDOW *win" "int y" "int x"
you do not pass the address
.Fn idlok "WINDOW *win" "int boolf"
This will eventually signal to
that it is all right to use the insert and delete line sequences
when updating the window.
Returns the character at the current position on the given window.
This does not make any changes to the window.
Initialize the screen routines.
This must be called before any of the screen routines are used.
It initializes the terminal-type data and such,
and without it none of the routines can operate.
If standard input is not a tty,
it sets the specifications to the terminal
whose name is pointed to by
If the system supports the
it is used to get the number of lines and columns for the terminal,
otherwise it is taken from the
Each character after it shifts to the right,
and the last character disappears.
Insert a line above the current one.
Every line below the current line
and the bottom line will disappear.
The current line will become blank,
and the current \*y will remain unchanged.
Returns the line kill character
the character used by the user to erase an entire line from the input.
.Fn leaveok "WINDOW *win" "int boolf" \(dg
Sets the boolean flag for leaving the cursor after the last change.
the cursor will be left after the last update on the terminal,
will be changed accordingly.
is 0 the cursor will be moved to the current \*y.
retains its value until changed by the user.
Change the current \*y of the window to
.Fn mvcur "int lasty" "int lastx" "int newy" "int newx"
Moves the terminal's cursor from
in an approximation of optimal fashion.
This routine uses the functions borrowed from
It is possible to use this optimization
without the benefit of the screen routines.
With the screen routines, this should not be called by the user.
should be used to move the cursor position,
so that the routines know what's going on.
.Fn mvprintw "int y" "int x" "const char *fmt" "..."
.Fn mvscanw "int y" "int x" "const char *fmt" "..."
.Fn mvwin "WINDOW *win" "int y" "int x"
Move the home position of the window
from its current starting coordinates
If that would put part or all of the window
off the edge of the terminal screen,
returns ERR and does not change anything.
also returns ERR if you attempt to move it off its main window.
If you move a main window,
all subwindows are moved along with it.
.Fn mvwprintw "WINDOW *win" "int y" "int x" "const char *fmt" "..."
.Fn mvwscanw "WINDOW *win" "int y" "int x" "const char *fmt" "..."
.Fn newwin "int lines" "int cols" "int begin_y" "int begin_x"
columns starting at position
.Vn begin\*_y\*,begin\*_x ). (
that dimension will be set to
.Vn "LINES \- begin\*_y" ) (
.Vn "COLS \- begin\*_x" ) (
Thus, to get a new window of dimensions
Set the terminal to nl mode,
start/stop the system from mapping
If the mapping is not done,
can do more optimization,
so it is recommended, but not required, to turn it off.
Unset the terminal from cbreak mode.
is retained for backwards compatibility
with ealier versions of the library.
Turn echoing of characters off.
Unset the terminal to from nl mode. See
Unset the terminal from raw mode. See
.Fn overlay "WINDOW *win1" "WINDOW *win2"
This is done non-destructively,
leave the contents of the space on
untouched. Note that all non-blank characters are overwritten
destructively in the overlay.
.Fn overwrite "WINDOW *win1" "WINDOW *win2"
This is done destructively,
.Fn printw "char *fmt" "..."
on the window starting at the current \*y.
to add the string on the window.
It is often advisable to use the field width options of
to avoid leaving things on the window from earlier calls.
Set the terminal to raw mode.
is a trademark of Unix System Laboratories.
this also turns off newline mapping
Synchronize the terminal screen with the desired window.
If the window is not a screen,
only that part covered by it is updated.
In this case, it will update whatever it can
without causing the scroll.
is called with the window
and repainted as it is currently.
This is very useful for allowing the redrawing of the screen
when the user has garbage dumped on his terminal.
These functions are performed automatically by
This function should not be used by the user.
saves the current tty characteristic flags. See
This function should not be used by the user.
.Fn scanw "char *fmt" "..."
It does this using consecutive calls to
Scroll the window upward one line.
This is normally not used by the user.
.Fn scrollok "WINDOW *win" "int boolf" \(dg
Set the scroll flag for the given window.
is 0, scrolling is not allowed.
This is its default setting.
End standout mode initiated by
Causes any characters added to the window
to be put in standout mode on the terminal
(if it has that capability).
.Fn subwin "WINDOW *win" "int lines" "int cols" "int begin_y" "int begin_x"
columns starting at position
.Vn begin\*_y\*,begin\*_x ) (
This means that any change made to either window
by the subwindow will be made on both windows.
.Vn begin\*_y\*,begin\*_x
are specified relative to the overall screen,
not the relative (0\*,0) of
that dimension will be set to
.Vn "LINES \- begin\*_y" ) (
.Vn "COLS \- begin\*_x" ) (
.Fn touchline "WINDOW *win" "int y" "int startx" "int endx"
This function performs a function similar to
It marks the first change for the given line
if it is before the current first change mark,
the last change mark is set to be
if it is currently less than
.Fn touchoverlap "WINDOW *win1" "WINDOW *win2"
in the area which overlaps with
.Fn touchwin "WINDOW *win"
Make it appear that the every location on the window
This is usually only needed for refreshes with overlapping windows.
will save the current tty state
and then put the process to sleep.
When the process gets restarted,
it restores the saved tty state
.Fn unctrl "char *ch" \(dg
Returns a string which is an ASCII representation of
Characters are 8 bits long.
.Fn unctrllen "char *ch" \(dg
Returns the length of the ASCII representation of
.Fn vwprintw "WINDOW *win" "const char *fmt" "va_list ap"
except that it takes both a window specification and a pointer to a variable
.Fn vwscanw "WINDOW *win" "const char *fmt" "va_list ap"
except that it takes both a window specification and a pointer to a variable
.Fn waddbytes "WINDOW *win" "char *str" "int len"
This function is the low level character output function.
are output to the current \*y position of the window specified by
\fIThe following functions differ from the standard functions only in their
specification of a window, rather than the use of the default
.Fn waddch "WINDOW *win" "char ch"
.Fn waddstr "WINDOW *win" "char *str"
.Fn wclrtobot "WINDOW *win"
.Fn wclrtoeol "WINDOW *win"
.Fn wdeleteln "WINDOW *win"
.Fn wgetstr "WINDOW *win" "char *str"
.Fn winch "WINDOW *win" \(dg
.Fn winsch "WINDOW *win" "char c"
.Fn winsertln "WINDOW *win"
.Fn wmove "WINDOW *win" "int y" int x"
.Fn wprintw "WINDOW *win" "char *fmt" "..."
.Fn wrefresh "WINDOW *win"
.Fn wscanw "WINDOW *win" "char *fmt" "..."
.Fn wstandend "WINDOW *win"
.Fn wstandout "WINDOW *win"