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