summaryrefslogtreecommitdiff
path: root/lib/libcurses/curs_initscr.3
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2010-01-12 23:22:15 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2010-01-12 23:22:15 +0000
commit6ee254699bf787d78835419be2b3241fb037d444 (patch)
tree07fe67dab517e4990f344fe2c00e65cef4d25b81 /lib/libcurses/curs_initscr.3
parent0b62f5dc36fc7203a74cdc812c4234ae188fdfd2 (diff)
Update to ncurses 5.7, with local changes reapplied.
This is around eight years worth of changes (previously we were around ncurses 5.2), too many to list - many bug fixes and also a few new functions. A major bump for libcurses, libpanel, libform and libmenu. ok deraadt
Diffstat (limited to 'lib/libcurses/curs_initscr.3')
-rw-r--r--lib/libcurses/curs_initscr.334
1 files changed, 21 insertions, 13 deletions
diff --git a/lib/libcurses/curs_initscr.3 b/lib/libcurses/curs_initscr.3
index fb57f12a83e..61de6f22c00 100644
--- a/lib/libcurses/curs_initscr.3
+++ b/lib/libcurses/curs_initscr.3
@@ -1,7 +1,7 @@
-.\" $OpenBSD: curs_initscr.3,v 1.8 2003/05/12 11:06:49 jmc Exp $
+.\" $OpenBSD: curs_initscr.3,v 1.9 2010/01/12 23:21:59 nicm Exp $
.\"
.\"***************************************************************************
-.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+.\" Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" copy of this software and associated documentation files (the *
@@ -28,8 +28,10 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: curs_initscr.3x,v 1.10 2000/07/08 12:47:39 tom Exp $
+.\" $Id: curs_initscr.3,v 1.9 2010/01/12 23:21:59 nicm Exp $
.TH curs_initscr 3 ""
+.na
+.hy 0
.SH NAME
\fBinitscr\fR,
\fBnewterm\fR,
@@ -37,16 +39,18 @@
\fBisendwin\fR,
\fBset_term\fR,
\fBdelscreen\fR - \fBcurses\fR screen initialization and manipulation routines
+.ad
+.hy
.SH SYNOPSIS
\fB#include <curses.h>\fR
-
+.sp
\fBWINDOW *initscr(void);\fR
.br
\fBint endwin(void);\fR
.br
\fBbool isendwin(void);\fR
.br
-\fBSCREEN *newterm(const char *type, FILE *outfd, FILE *infd);\fR
+\fBSCREEN *newterm(char *type, FILE *outfd, FILE *infd);\fR
.br
\fBSCREEN *set_term(SCREEN *new);\fR
.br
@@ -58,13 +62,13 @@ initializing a program. A few special routines sometimes need to be
called before it; these are \fBslk_init\fR, \fBfilter\fR, \fBripoffline\fR,
\fBuse_env\fR. For multiple-terminal applications, \fBnewterm\fR may be
called before \fBinitscr\fR.
-
+.PP
The initscr code determines the terminal type and initializes all \fBcurses\fR
data structures. \fBinitscr\fR also causes the first call to \fBrefresh\fR to
clear the screen. If errors occur, \fBinitscr\fR writes an appropriate error
message to standard error and exits; otherwise, a pointer is returned to
\fBstdscr\fR.
-
+.PP
A program that outputs to more than one terminal should use the \fBnewterm\fR
routine for each terminal instead of \fBinitscr\fR. A program that needs to
inspect capabilities, so it can continue to run in a line-oriented mode if the
@@ -78,23 +82,23 @@ is \fBNULL\fR, \fB$TERM\fR will be used). The program must also call
\fBendwin\fR for each terminal being used before exiting from \fBcurses\fR.
If \fBnewterm\fR is called more than once for the same terminal, the first
terminal referred to must be the last one for which \fBendwin\fR is called.
-
+.PP
A program should always call \fBendwin\fR before exiting or escaping from
\fBcurses\fR mode temporarily. This routine restores tty modes, moves the
cursor to the lower left-hand corner of the screen and resets the terminal into
the proper non-visual mode. Calling \fBrefresh\fR or \fBdoupdate\fR after a
temporary escape causes the program to resume visual mode.
-
+.PP
The \fBisendwin\fR routine returns \fBTRUE\fR if \fBendwin\fR has been
called without any subsequent calls to \fBwrefresh\fR, and \fBFALSE\fR
otherwise.
-
+.PP
The \fBset_term\fR routine is used to switch between different
terminals. The screen reference \fBnew\fR becomes the new current
terminal. The previous terminal is returned by the routine. This is
the only routine which manipulates \fBSCREEN\fR pointers; all other
routines affect only the current terminal.
-
+.PP
The \fBdelscreen\fR routine frees storage associated with the
\fBSCREEN\fR data structure. The \fBendwin\fR routine does not do
this, so \fBdelscreen\fR should be called after \fBendwin\fR if a
@@ -102,15 +106,19 @@ particular \fBSCREEN\fR is no longer needed.
.SH RETURN VALUE
\fBendwin\fR returns the integer \fBERR\fR upon failure and \fBOK\fR
upon successful completion.
-
+.PP
Routines that return pointers always return \fBNULL\fR on error.
+.PP
+X/Open defines no error conditions.
+In this implementation
+\fBendwin\fP returns an error if the terminal was not initialized.
.SH NOTES
Note that \fBinitscr\fR and \fBnewterm\fR may be macros.
.SH PORTABILITY
These functions are described in the XSI Curses standard, Issue 4. It
specifies that portable applications must not call \fBinitscr\fR more than
once.
-
+.PP
Old versions of curses, e.g., BSD 4.4, may have returned a null pointer
from \fBinitscr\fR when an error is detected, rather than exiting.
It is safe but redundant to check the return value of \fBinitscr\fR