'\"macro stdmacro
.if n .pH g3x.curs_scr_dmp @(#)curs_scr_dmp	40.3 of 12/15/89
.\" Copyright 1989 AT&T
.\" ident	"@(#)svid_ti:ti_lib/curs_scr_dmp	1.3"
.nr X
.if \nX=0 .ds x} curs_scr_dump 3X "" "\&"
.if \nX=1 .ds x} curs_scr_dump 3X ""
.if \nX=2 .ds x} curs_scr_dump 3X "" "\&"
.if \nX=3 .ds x} curs_scr_dump "" "" "\&"
.TH \*(x}
.SH NAME
\f4curs_scr_dump\f2: \f4 scr_dump\f1, \f4scr_restore\f1, \f4scr_init\f1, \f4scr_set\f1 \- read (write) a \f4curses\fP screen from (to) a file
.SH SYNOPSIS
.nf
.ft 4
#include <curses.h>
.sp
int scr_dump(char *filename);
.sp .5
int scr_restore(char *filename);
.sp .5
int scr_init(char *filename);
.sp .5
int scr_set(char *filename);
.ft 1
.fi
.SH DESCRIPTION
With the \f4scr_dump\f1 routine,
the current contents of the virtual screen are written to the file
\f2filename\f1.\f1
.P
With the \f4scr_restore\f1 routine,
the virtual screen is set to the contents of
\f2filename\f1,
which must have been written using
\f4scr_dump\f1.
The next call to
\f4doupdate\f1
restores the screen to the way it looked in the dump file.
.P
With the \f4scr_init\f1 routine,
the contents of \f2filename\f1
are read in and used to initialize the
\f4curses\fP
data structures about what the
terminal currently has on its screen.
If the data is determined to be valid,
\f4curses\fP
bases its next update of
the screen on this information rather than clearing the screen and
starting from scratch.
\f4scr_init\f1
is used after
\f4initscr\f1
or a \f4system\f1 [see system(BA_LIB)]
call to share the screen with another process which has done a
\f4scr_dump\f1 after its \f4endwin\f1 call.
The data is declared invalid if the time-stamp of
the tty is old or the terminfo capabilities \f4rmcup\f1 and
\f4nrrmc\fP exist.
.PP
The \f4scr_set\fP routine is a combination of \f4scr_restore\fP
and \f4scr_init\fP.
It tells the program that the information in \f2filename\fP 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.
.PP
To read (write) a window from (to) a file, use the \f4getwin\fP and
\f4putwin\fP routines [see curs_util(3X)].
.SH RETURN VALUE
All routines return the integer \f4ERR\f1 upon
failure and \f4OK\f1
upon success.
.SH NOTES
.P
The header file \f4<curses.h>\f1 automatically includes the header files
\f4<stdio.h>\f1 and \f4<unctrl.h>\f1.
.PP
Note that \f4scr_init\fP, \f4scr_set\fP, and
\f4scr_restore\fP may be macros.
.SH SEE ALSO
.na
\f4curses\fP(3X),
\f4curs_initscr\fP(3X),
\f4curs_refresh\fP(3X),
\f4curs_util\fP(3X),
\f4system\fP(3S).
.ad
