1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
.\" $OpenBSD: curs_scr_dmp.3,v 1.4 1997/12/14 23:15:42 millert Exp $
.TH curs_scr_dump 3 ""
.SH NAME
\fBscr_dump\fR, \fBscr_restore\fR,
\fBscr_init\fR, \fBscr_set\fR - read (write) a \fBcurses\fR screen
from (to) a file
.SH SYNOPSIS
\fB#include <curses.h>\fR
\fBint scr_dump(const char *filename);\fR
.br
\fBint scr_restore(const char *filename);\fR
.br
\fBint scr_init(const char *filename);\fR
.br
\fBint scr_set(const char *filename);\fR
.br
.SH DESCRIPTION
The \fBscr_dump\fR routine dumps the current contents of the virtual screen
to the file \fIfilename\fR.
The \fBscr_restore\fR routine sets the virtual screen to the contents
of \fIfilename\fR, which must have been written using \fBscr_dump\fR. The next
call to \fBdoupdate\fR restores the screen to the way it looked in the dump
file.
The \fBscr_init\fR routine reads in the contents of \fIfilename\fR and uses
them to initialize the \fBcurses\fR data structures about what the terminal
currently has on its screen. If the data is determined to be valid,
\fBcurses\fR bases its next update of the screen on this information rather
than clearing the screen and starting from scratch. \fBscr_init\fR is used
after \fBinitscr\fR or a \fBsystem\fR [see \fBsystem\fR(BA_LIB)] call to share
the screen with another process which has done a \fBscr_dump\fR after its
\fBendwin\fR call. The data is declared invalid if the terminfo capabilities
\fBrmcup\fR and \fBnrrmc\fR exist; also if the terminal has been written to
since the preceding \fBscr_dump\fR call.
The \fBscr_set\fR routine is a combination of \fBscr_restore\fR and
\fBscr_init\fR. It tells the program that the information in \fIfilename\fR is
what is currently on the screen, and also what the program wants on the screen.
This can be thought of as a screen inheritance function.
To read (write) a window from (to) a file, use the \fBgetwin\fR and
\fBputwin\fR routines [see \fBcurs_util\fR(3)].
.SH RETURN VALUE
All routines return the integer \fBERR\fR upon failure and \fBOK\fR
upon success.
.SH NOTES
Note that \fBscr_init\fR, \fBscr_set\fR, and \fBscr_restore\fR may be macros.
.SH PORTABILITY
The XSI Curses standard, Issue 4, describes these functions (adding the const
qualifiers).
The SVr4 docs merely say under \fBscr_init\fR that the dump data is also
considered invalid "if the time-stamp of the tty is old" but don't define
"old".
.SH SEE ALSO
\fBcurses\fR(3), \fBcurs_initscr\fR(3), \fBcurs_refresh\fR(3),
\fBcurs_util\fR(3), \fBsystem\fR(3)
.\"#
.\"# The following sets edit modes for GNU EMACS
.\"# Local Variables:
.\"# mode:nroff
.\"# fill-column:79
.\"# End:
|