4 <STRONG>scr_dump</STRONG>, <STRONG>scr_restore</STRONG>, <STRONG>scr_init</STRONG>, <STRONG>scr_set</STRONG> - read (write) a
5 <STRONG>curses</STRONG> screen from (to) a file
10 <STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
12 <STRONG>int</STRONG> <STRONG>scr_dump(const</STRONG> <STRONG>char</STRONG> <STRONG>*filename);</STRONG>
13 <STRONG>int</STRONG> <STRONG>scr_restore(const</STRONG> <STRONG>char</STRONG> <STRONG>*filename);</STRONG>
14 <STRONG>int</STRONG> <STRONG>scr_init(const</STRONG> <STRONG>char</STRONG> <STRONG>*filename);</STRONG>
15 <STRONG>int</STRONG> <STRONG>scr_set(const</STRONG> <STRONG>char</STRONG> <STRONG>*filename);</STRONG>
19 <H2>DESCRIPTION</H2><PRE>
20 The <STRONG>scr_dump</STRONG> routine dumps the current contents of the
21 virtual screen to the file <EM>filename</EM>.
23 The <STRONG>scr_restore</STRONG> routine sets the virtual screen to the
24 contents of <EM>filename</EM>, which must have been written using
25 <STRONG>scr_dump</STRONG>. The next call to <STRONG>doupdate</STRONG> restores the screen
26 to the way it looked in the dump file.
28 The <STRONG>scr_init</STRONG> routine reads in the contents of <EM>filename</EM> and
29 uses them to initialize the <STRONG>curses</STRONG> data structures about
30 what the terminal currently has on its screen. If the
31 data is determined to be valid, <STRONG>curses</STRONG> bases its next
32 update of the screen on this information rather than
33 clearing the screen and starting from scratch. <STRONG>scr_init</STRONG>
34 is used after <STRONG>initscr</STRONG> or a <STRONG>system</STRONG> [see <STRONG>system</STRONG>(BA_LIB)]
35 call to share the screen with another process which has
36 done a <STRONG>scr_dump</STRONG> after its <STRONG>endwin</STRONG> call. The data is
37 declared invalid if the terminfo capabilities <STRONG>rmcup</STRONG> and
38 <STRONG>nrrmc</STRONG> exist; also if the terminal has been written to
39 since the preceding <STRONG>scr_dump</STRONG> call.
41 The <STRONG>scr_set</STRONG> routine is a combination of <STRONG>scr_restore</STRONG> and
42 <STRONG>scr_init</STRONG>. It tells the program that the information in
43 <EM>filename</EM> is what is currently on the screen, and also what
44 the program wants on the screen. This can be thought of
45 as a screen inheritance function.
47 To read (write) a window from (to) a file, use the <STRONG>getwin</STRONG>
48 and <STRONG>putwin</STRONG> routines [see <STRONG><A HREF="curs_util.3x.html">curs_util(3X)</A></STRONG>].
52 <H2>RETURN VALUE</H2><PRE>
53 All routines return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG>
59 Note that <STRONG>scr_init</STRONG>, <STRONG>scr_set</STRONG>, and <STRONG>scr_restore</STRONG> may be
64 <H2>PORTABILITY</H2><PRE>
65 The XSI Curses standard, Issue 4, describes these func-
66 is also considered invalid "if the time-stamp of the tty
67 is old" but don't define "old".
71 <H2>SEE ALSO</H2><PRE>
72 <STRONG><A HREF="ncurses.3x.html">curses(3X)</A></STRONG>, <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3X)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3X)</A></STRONG>,
73 <STRONG><A HREF="curs_util.3x.html">curs_util(3X)</A></STRONG>, <STRONG><A HREF="system.3s.html">system(3S)</A></STRONG>