]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_scr_dump.3x
ncurses 6.1 - patch 20190309
[ncurses.git] / man / curs_scr_dump.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2017,2018 Free Software Foundation, Inc.              *
3 .\"                                                                          *
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 .\"
29 .\" $Id: curs_scr_dump.3x,v 1.13 2018/07/28 22:50:26 tom Exp $
30 .TH curs_scr_dump 3X ""
31 .de bP
32 .ie n  .IP \(bu 4
33 .el    .IP \(bu 2
34 ..
35 .na
36 .hy 0
37 .SH NAME
38 \fBscr_dump\fR,
39 \fBscr_restore\fR,
40 \fBscr_init\fR,
41 \fBscr_set\fR \- read (write) a \fBcurses\fR screen from (to) a file
42 .ad
43 .hy
44 .SH SYNOPSIS
45 \fB#include <curses.h>\fR
46 .sp
47 \fBint scr_dump(const char *filename);\fR
48 .br
49 \fBint scr_restore(const char *filename);\fR
50 .br
51 \fBint scr_init(const char *filename);\fR
52 .br
53 \fBint scr_set(const char *filename);\fR
54 .br
55 .SH DESCRIPTION
56 The \fBscr_dump\fR routine dumps the current contents
57 of the \fIvirtual screen\fP
58 to the file \fIfilename\fR.
59 .PP
60 The \fBscr_restore\fR routine sets the \fIvirtual screen\fP to the contents
61 of \fIfilename\fR, which must have been written using \fBscr_dump\fR.
62 The next call to \fBdoupdate\fR restores
63 the \fIphysical screen\fP to the way it looked in the dump file.
64 .PP
65 The \fBscr_init\fR routine reads in the contents of \fIfilename\fR and uses
66 them to initialize the \fBcurses\fR data structures about what the terminal
67 currently has on its screen.
68 If the data is determined to be valid,
69 \fBcurses\fR bases its next update of the screen on this information rather
70 than clearing the screen and starting from scratch.
71 \fBscr_init\fR is used
72 after \fBinitscr\fR or a \fBsystem\fR call to share
73 the screen with another process which has done a \fBscr_dump\fR after its
74 \fBendwin\fR(3X) call.
75 The data is declared invalid
76 .bP
77 if the terminfo capabilities \fBrmcup\fR and \fBnrrmc\fR exist, also
78 .bP
79 if the terminal has been written to since the preceding \fBscr_dump\fR call.
80 .PP
81 The \fBscr_set\fR routine is a combination of \fBscr_restore\fR and
82 \fBscr_init\fR.  It tells the program that the information in \fIfilename\fR is
83 what is currently on the screen, and also what the program wants on the screen.
84 This can be thought of as a screen inheritance function.
85 .PP
86 To read (write) a window from (to) a file, use the \fBgetwin\fR and
87 \fBputwin\fR routines [see \fBcurs_util\fR(3X)].
88 .SH RETURN VALUE
89 All routines return the integer \fBERR\fR upon failure and \fBOK\fR
90 upon success.
91 .PP
92 X/Open defines no error conditions.
93 In this implementation,
94 each will return an error if the file cannot be opened.
95 .SH NOTES
96 Note that \fBscr_init\fR, \fBscr_set\fR, and \fBscr_restore\fR may be macros.
97 .SH PORTABILITY
98 The XSI Curses standard, Issue 4, describes these functions (adding the const
99 qualifiers).
100 .PP
101 The SVr4 docs merely say under \fBscr_init\fR that the dump data is also
102 considered invalid "if the time-stamp of the tty is old" but do not define
103 "old".
104 .SH SEE ALSO
105 \fBcurses\fR(3X),
106 \fBcurs_initscr\fR(3X),
107 \fBcurs_refresh\fR(3X),
108 \fBcurs_util\fR(3X),
109 \fBscr_dump\fR(5),
110 \fBsystem\fR(3)