1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. *
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: *
12 .\" The above copyright notice and this permission notice shall be included *
13 .\" in all copies or substantial portions of the Software. *
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. *
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 *
27 .\"***************************************************************************
29 .\" $Id: curs_scr_dump.3x,v 1.9 2010/12/04 18:40:45 tom Exp $
30 .TH curs_scr_dump 3 ""
37 \fBscr_set\fR \- read (write) a \fBcurses\fR screen from (to) a file
41 \fB#include <curses.h>\fR
43 \fBint scr_dump(const char *filename);\fR
45 \fBint scr_restore(const char *filename);\fR
47 \fBint scr_init(const char *filename);\fR
49 \fBint scr_set(const char *filename);\fR
52 The \fBscr_dump\fR routine dumps the current contents of the virtual screen
53 to the file \fIfilename\fR.
55 The \fBscr_restore\fR routine sets the virtual screen to the contents
56 of \fIfilename\fR, which must have been written using \fBscr_dump\fR. The next
57 call to \fBdoupdate\fR restores the screen to the way it looked in the dump
60 The \fBscr_init\fR routine reads in the contents of \fIfilename\fR and uses
61 them to initialize the \fBcurses\fR data structures about what the terminal
62 currently has on its screen. If the data is determined to be valid,
63 \fBcurses\fR bases its next update of the screen on this information rather
64 than clearing the screen and starting from scratch. \fBscr_init\fR is used
65 after \fBinitscr\fR or a \fBsystem\fR call to share
66 the screen with another process which has done a \fBscr_dump\fR after its
67 \fBendwin\fR call. The data is declared invalid if the terminfo capabilities
68 \fBrmcup\fR and \fBnrrmc\fR exist; also if the terminal has been written to
69 since the preceding \fBscr_dump\fR call.
71 The \fBscr_set\fR routine is a combination of \fBscr_restore\fR and
72 \fBscr_init\fR. It tells the program that the information in \fIfilename\fR is
73 what is currently on the screen, and also what the program wants on the screen.
74 This can be thought of as a screen inheritance function.
76 To read (write) a window from (to) a file, use the \fBgetwin\fR and
77 \fBputwin\fR routines [see \fBcurs_util\fR(3)].
79 All routines return the integer \fBERR\fR upon failure and \fBOK\fR
82 X/Open defines no error conditions.
83 In this implementation,
84 each will return an error if the file cannot be opened.
86 Note that \fBscr_init\fR, \fBscr_set\fR, and \fBscr_restore\fR may be macros.
88 The XSI Curses standard, Issue 4, describes these functions (adding the const
91 The SVr4 docs merely say under \fBscr_init\fR that the dump data is also
92 considered invalid "if the time-stamp of the tty is old" but do not define
95 \fBcurses\fR(3), \fBcurs_initscr\fR(3), \fBcurs_refresh\fR(3),
96 \fBcurs_util\fR(3), \fBsystem\fR(3)