xref: /netbsd-src/lib/libcurses/curses_clear.3 (revision 43fda370f58c9bb955a15befad02cfa5feeea03d)
1.\"	$NetBSD: curses_clear.3,v 1.4 2019/01/11 06:14:39 dholland Exp $
2.\"
3.\" Copyright (c) 2002
4.\"	Brett Lymn (blymn@NetBSD.org, brett_lymn@yahoo.com.au)
5.\"
6.\" This code is donated to the NetBSD Foundation by the Author.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
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
18.\"    permission.
19.\"
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
30.\" SUCH DAMAGE.
31.\"
32.\"
33.Dd January 11, 2019
34.Dt CURSES_CLEAR 3
35.Os
36.Sh NAME
37.Nm curses_clear ,
38.Nm clear ,
39.Nm wclear ,
40.Nm clearok ,
41.Nm clrtobot ,
42.Nm clrtoeol ,
43.Nm erase ,
44.Nm werase ,
45.Nm wclrtobot ,
46.Nm wclrtoeol
47.Nd curses clear window routines
48.Sh LIBRARY
49.Lb libcurses
50.Sh SYNOPSIS
51.In curses.h
52.Ft int
53.Fn clear "void"
54.Ft int
55.Fn clearok "WINDOW *win" "bool flag"
56.Ft int
57.Fn clrtobot "void"
58.Ft int
59.Fn clrtoeol "void"
60.Ft int
61.Fn erase "void"
62.Ft int
63.Fn wclear "WINDOW *win"
64.Ft int
65.Fn werase "WINDOW *win"
66.Ft int
67.Fn wclrtobot "WINDOW *win"
68.Ft int
69.Fn wclrtoeol "WINDOW *win"
70.Sh DESCRIPTION
71These functions clear all or part of
72.Dv stdscr
73or of the specified window.
74.Pp
75The
76.Fn clear
77and
78.Fn erase
79functions erase all characters on
80.Dv stdscr .
81These differ in that
82.Fn clear
83uses
84.Fn clearok
85to force a complete redraw on the next refresh, and
86.Fn erase
87does not.
88.Fn wclear
89and
90.Fn werase
91perform the same function as
92.Fn clear
93and
94.Fn erase ,
95respectively, excepting that the specified window is cleared.
96.Pp
97By setting
98.Fa flag
99to
100.Dv TRUE ,
101the
102.Fn clearok
103function is used to force the next call to
104.Fn wrefresh
105to clear and completely redraw the window given in
106.Fa win .
107.Pp
108The function
109.Fn clrtobot
110will clear
111.Dv stdscr
112from the current row to the bottom of the screen.
113.Fn clrtoeol
114will clear
115.Dv stdscr
116from the current column position to the end of the line.
117.Fn wclrtobot
118and
119.Fn wclrtoeol
120are the same as
121.Fn clrtobot
122and
123.Fn clrtoeol ,
124respectively, excepting the window specified is operated on instead of
125.Dv stdscr .
126.Sh RETURN VALUES
127Functions returning pointers will return
128.Dv NULL
129if an error is detected.
130The functions that return an int will return one of the following
131values:
132.Pp
133.Bl -tag -width ERR -compact
134.It Er OK
135The function completed successfully.
136.It Er ERR
137An error occurred in the function.
138.El
139.Sh SEE ALSO
140.Xr curses_refresh 3
141.Sh STANDARDS
142The
143.Nx
144Curses library complies with the X/Open Curses specification, part of the
145Single Unix Specification.
146.Sh HISTORY
147The Curses package appeared in
148.Bx 4.0 .
149