.\"***************************************************************************
-.\" Copyright 2018-2021,2022 Thomas E. Dickey *
+.\" Copyright 2018-2023,2024 Thomas E. Dickey *
.\" Copyright 1998-2010,2016 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: curs_clear.3x,v 1.28 2022/11/26 16:23:47 tom Exp $
-.TH curs_clear 3X 2022-11-26 "ncurses 6.4" "Library calls"
-.na
-.hy 0
+.\" $Id: curs_clear.3x,v 1.50 2024/05/25 20:10:58 tom Exp $
+.TH curs_clear 3X 2024-05-25 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
+.ie \n(.g \{\
+.ds `` \(lq
+.ds '' \(rq
+.\}
+.el \{\
+.ie t .ds `` ``
+.el .ds `` ""
+.ie t .ds '' ''
+.el .ds '' ""
+.\}
+.
.de bP
.ie n .IP \(bu 4
.el .IP \(bu 2
..
.SH NAME
-\fBerase\fP,
-\fBwerase\fP,
-\fBclear\fP,
-\fBwclear\fP,
-\fBclrtobot\fP,
-\fBwclrtobot\fP,
-\fBclrtoeol\fP,
-\fBwclrtoeol\fP \- clear all or part of a \fBcurses\fP window
-.ad
-.hy
+\fB\%erase\fP,
+\fB\%werase\fP,
+\fB\%clear\fP,
+\fB\%wclear\fP,
+\fB\%clrtobot\fP,
+\fB\%wclrtobot\fP,
+\fB\%clrtoeol\fP,
+\fB\%wclrtoeol\fP \-
+clear all or part of a \fIcurses\fR window
.SH SYNOPSIS
-\fB#include <curses.h>\fP
-.sp
-\fBint erase(void);\fP
-.br
-\fBint werase(WINDOW *\fIwin\fB);\fR
-.sp
-\fBint clear(void);\fP
-.br
-\fBint wclear(WINDOW *\fIwin\fB);\fR
-.sp
-\fBint clrtobot(void);\fP
-.br
-\fBint wclrtobot(WINDOW *\fIwin\fB);\fR
-.sp
-\fBint clrtoeol(void);\fP
-.br
-\fBint wclrtoeol(WINDOW *\fIwin\fB);\fR
-.br
+.nf
+\fB#include <curses.h>
+.PP
+\fBint erase(void);
+\fBint werase(WINDOW *\fIwin\fP);
+.PP
+\fBint clear(void);
+\fBint wclear(WINDOW *\fIwin\fP);
+.PP
+\fBint clrtobot(void);
+\fBint wclrtobot(WINDOW *\fIwin\fP);
+.PP
+\fBint clrtoeol(void);
+\fBint wclrtoeol(WINDOW *\fIwin\fP);
+.fi
.SH DESCRIPTION
-.SS erase/werase
+.SS "erase, werase"
The \fBerase\fP and \fBwerase\fP routines copy blanks to every
position in the window, clearing the screen.
.PP
Blanks created by erasure have the current background rendition (as set
by \fBwbkgdset\fP(3X)) merged into them.
-.SS clear/wclear
-.PP
+.SS "clear, wclear"
The \fBclear\fP and \fBwclear\fP routines are like \fBerase\fP and
\fBwerase\fP, but they also call \fBclearok\fP(3X), so that the screen is
cleared completely on the next call to \fBwrefresh\fP for that window
and repainted from scratch.
-.SS clrtobot/wclrtobot
-.PP
+.SS "clrtobot, wclrtobot"
The \fBclrtobot\fP and \fBwclrtobot\fP routines erase from the cursor to the
end of screen.
That is, they erase all lines below the cursor in the window.
Also, the current line to the right of the cursor, inclusive, is erased.
-.SS clrtoeol/wclrtoeol
-.PP
+.SS "clrtoeol, wclrtoeol"
The \fBclrtoeol\fP and \fBwclrtoeol\fP routines erase the current line
to the right of the cursor, inclusive, to the end of the current line.
.SH RETURN VALUE
X/Open defines no error conditions.
In this implementation,
.bP
-functions using a window pointer parameter return an error if it is null
+functions using a window pointer parameter return
+.B ERR
+if it is null
.bP
\fBwclrtoeol\fP returns an error
if the cursor position is about to wrap.
Note that \fBerase\fP, \fBwerase\fP, \fBclear\fP, \fBwclear\fP,
\fBclrtobot\fP, and \fBclrtoeol\fP may be macros.
.SH PORTABILITY
-These functions are described in the XSI Curses standard, Issue 4.
-The
-standard specifies that they return \fBERR\fP on failure, but specifies no
-error conditions.
+These functions are described in X/Open Curses, Issue 4.
.PP
-The SVr4.0 manual says that these functions could
-return "a non-negative integer if \fBimmedok\fP(3X) is set",
+The SVr4.0 manual says that these functions could return
+\*(``or a non-negative integer if \fB\%immedok\fP is set\*('',
referring to the return-value of \fBwrefresh\fP.
In that implementation, \fBwrefresh\fP would return a count of
the number of characters written to the terminal.
ability to do the equivalent of \fBclearok(..., 1)\fP by saying
\fBtouchwin(stdscr)\fP or \fBclear(stdscr)\fP.
This will not work under
-ncurses.
+\fI\%ncurses\fP.
.PP
This implementation, and others such as Solaris,
sets the current position to 0,0 after erasing
If you do not want to clear the screen during the next \fBwrefresh\fP,
use \fBwerase\fP instead.
.SH SEE ALSO
-\fBcurses\fP(3X),
-\fBcurs_outopts\fP(3X),
-\fBcurs_refresh\fP(3X),
-\fBcurs_variables\fP(3X)
+\fB\%curses\fP(3X),
+\fB\%curs_outopts\fP(3X),
+\fB\%curs_refresh\fP(3X),
+\fB\%curs_variables\fP(3X)