Update ncurses to version 5.4.
[dragonfly.git] / lib / libncurses / man / curs_scr_dump.3
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2000,2003 Free Software Foundation, Inc.              *
3 .\"                                                                          *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
5 .\" copy of this software and associated documentation files (the            *
6 .\" "Software"), to deal in the Software without restriction, including      *
7 .\" without limitation the rights to use, copy, modify, merge, publish,      *
8 .\" distribute, distribute with modifications, sublicense, and/or sell       *
9 .\" copies of the Software, and to permit persons to whom the Software is    *
10 .\" furnished to do so, subject to the following conditions:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22 .\"                                                                          *
23 .\" Except as contained in this notice, the name(s) of the above copyright   *
24 .\" holders shall not be used in advertising or otherwise to promote the     *
25 .\" sale, use or other dealings in this Software without prior written       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: curs_scr_dump.3x,v 1.3 2003/10/25 20:34:06 tom Exp $
30 .\" $DragonFly: src/lib/libncurses/man/curs_scr_dump.3,v 1.1 2005/03/12 19:13:54 eirikn Exp $
31 .TH curs_scr_dump 3X ""
32 .SH NAME
33 \fBscr_dump\fR,
34 \fBscr_restore\fR,
35 \fBscr_init\fR,
36 \fBscr_set\fR - read (write) a \fBcurses\fR screen from (to) a file
37 .SH SYNOPSIS
38 \fB#include <curses.h>\fR
39
40 \fBint scr_dump(const char *filename);\fR
41 .br
42 \fBint scr_restore(const char *filename);\fR
43 .br
44 \fBint scr_init(const char *filename);\fR
45 .br
46 \fBint scr_set(const char *filename);\fR
47 .br
48 .SH DESCRIPTION
49 The \fBscr_dump\fR routine dumps the current contents of the virtual screen
50 to the file \fIfilename\fR.
51
52 The \fBscr_restore\fR routine sets the virtual screen to the contents
53 of \fIfilename\fR, which must have been written using \fBscr_dump\fR.  The next
54 call to \fBdoupdate\fR restores the screen to the way it looked in the dump
55 file.
56
57 The \fBscr_init\fR routine reads in the contents of \fIfilename\fR and uses
58 them to initialize the \fBcurses\fR data structures about what the terminal
59 currently has on its screen.  If the data is determined to be valid,
60 \fBcurses\fR bases its next update of the screen on this information rather
61 than clearing the screen and starting from scratch.  \fBscr_init\fR is used
62 after \fBinitscr\fR or a \fBsystem\fR call to share
63 the screen with another process which has done a \fBscr_dump\fR after its
64 \fBendwin\fR call.  The data is declared invalid if the terminfo capabilities
65 \fBrmcup\fR and \fBnrrmc\fR exist; also if the terminal has been written to
66 since the preceding \fBscr_dump\fR call.
67
68 The \fBscr_set\fR routine is a combination of \fBscr_restore\fR and
69 \fBscr_init\fR.  It tells the program that the information in \fIfilename\fR is
70 what is currently on the screen, and also what the program wants on the screen.
71 This can be thought of as a screen inheritance function.
72
73 To read (write) a window from (to) a file, use the \fBgetwin\fR and
74 \fBputwin\fR routines [see \fBcurs_util\fR(3X)].
75 .SH RETURN VALUE
76 All routines return the integer \fBERR\fR upon failure and \fBOK\fR
77 upon success.
78 .SH NOTES
79 Note that \fBscr_init\fR, \fBscr_set\fR, and \fBscr_restore\fR may be macros.
80 .SH PORTABILITY
81 The XSI Curses standard, Issue 4, describes these functions (adding the const
82 qualifiers).
83
84 The SVr4 docs merely say under \fBscr_init\fR that the dump data is also
85 considered invalid "if the time-stamp of the tty is old" but don't define
86 "old".
87 .SH SEE ALSO
88 \fBcurses\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_refresh\fR(3X),
89 \fBcurs_util\fR(3X), \fBsystem\fR(3S)
90 .\"#
91 .\"# The following sets edit modes for GNU EMACS
92 .\"# Local Variables:
93 .\"# mode:nroff
94 .\"# fill-column:79
95 .\"# End: