blob: df3e79c1ffee19f058139d8f76a98eabdc0a3190 [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
Steve Kondikae271bc2015-11-15 02:50:53 +01002.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05303.\" *
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.\"
Steve Kondikae271bc2015-11-15 02:50:53 +010029.\" $Id: curs_scr_dump.3x,v 1.9 2010/12/04 18:40:45 tom Exp $
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053030.TH curs_scr_dump 3X ""
31.na
32.hy 0
33.SH NAME
34\fBscr_dump\fR,
35\fBscr_restore\fR,
36\fBscr_init\fR,
Steve Kondikae271bc2015-11-15 02:50:53 +010037\fBscr_set\fR \- read (write) a \fBcurses\fR screen from (to) a file
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053038.ad
39.hy
40.SH SYNOPSIS
41\fB#include <curses.h>\fR
42.sp
43\fBint scr_dump(const char *filename);\fR
44.br
45\fBint scr_restore(const char *filename);\fR
46.br
47\fBint scr_init(const char *filename);\fR
48.br
49\fBint scr_set(const char *filename);\fR
50.br
51.SH DESCRIPTION
52The \fBscr_dump\fR routine dumps the current contents of the virtual screen
53to the file \fIfilename\fR.
54.PP
55The \fBscr_restore\fR routine sets the virtual screen to the contents
56of \fIfilename\fR, which must have been written using \fBscr_dump\fR. The next
57call to \fBdoupdate\fR restores the screen to the way it looked in the dump
58file.
59.PP
60The \fBscr_init\fR routine reads in the contents of \fIfilename\fR and uses
61them to initialize the \fBcurses\fR data structures about what the terminal
62currently 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
64than clearing the screen and starting from scratch. \fBscr_init\fR is used
65after \fBinitscr\fR or a \fBsystem\fR call to share
66the 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
69since the preceding \fBscr_dump\fR call.
70.PP
71The \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
73what is currently on the screen, and also what the program wants on the screen.
74This can be thought of as a screen inheritance function.
75.PP
76To read (write) a window from (to) a file, use the \fBgetwin\fR and
77\fBputwin\fR routines [see \fBcurs_util\fR(3X)].
78.SH RETURN VALUE
79All routines return the integer \fBERR\fR upon failure and \fBOK\fR
80upon success.
81.PP
82X/Open defines no error conditions.
83In this implementation,
84each will return an error if the file cannot be opened.
85.SH NOTES
86Note that \fBscr_init\fR, \fBscr_set\fR, and \fBscr_restore\fR may be macros.
87.SH PORTABILITY
88The XSI Curses standard, Issue 4, describes these functions (adding the const
89qualifiers).
90.PP
91The SVr4 docs merely say under \fBscr_init\fR that the dump data is also
92considered invalid "if the time-stamp of the tty is old" but do not define
93"old".
94.SH SEE ALSO
95\fBcurses\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_refresh\fR(3X),
96\fBcurs_util\fR(3X), \fBsystem\fR(3)