1curs_scr_dump(3X)                                            curs_scr_dump(3X)
2
3
4

NAME

6       scr_dump, scr_restore, scr_init, scr_set - read (write) a curses screen
7       from (to) a file
8

SYNOPSIS

10       #include <curses.h>
11
12       int scr_dump(const char *filename);
13       int scr_restore(const char *filename);
14       int scr_init(const char *filename);
15       int scr_set(const char *filename);
16

DESCRIPTION

18       The scr_dump routine dumps the current contents of the  virtual  screen
19       to the file filename.
20
21       The  scr_restore  routine  sets  the  virtual screen to the contents of
22       filename, which must have been written using scr_dump.  The  next  call
23       to doupdate restores the screen to the way it looked in the dump file.
24
25       The scr_init routine reads in the contents of filename and uses them to
26       initialize the curses data structures about what the terminal currently
27       has on its screen.  If the data is determined to be valid, curses bases
28       its next update of the screen on this information rather than  clearing
29       the  screen  and starting from scratch.  scr_init is used after initscr
30       or a system call to share the screen with  another  process  which  has
31       done  a  scr_dump  after its endwin(3X) call.  The data is declared in‐
32       valid if the terminfo capabilities rmcup and nrrmc exist; also  if  the
33       terminal has been written to since the preceding scr_dump call.
34
35       The  scr_set  routine is a combination of scr_restore and scr_init.  It
36       tells the program that the information in filename is what is currently
37       on the screen, and also what the program wants on the screen.  This can
38       be thought of as a screen inheritance function.
39
40       To read (write) a window from (to) a file, use the  getwin  and  putwin
41       routines [see curs_util(3X)].
42

RETURN VALUE

44       All routines return the integer ERR upon failure and OK upon success.
45
46       X/Open  defines no error conditions.  In this implementation, each will
47       return an error if the file cannot be opened.
48

NOTES

50       Note that scr_init, scr_set, and scr_restore may be macros.
51

PORTABILITY

53       The XSI Curses standard, Issue 4, describes these functions (adding the
54       const qualifiers).
55
56       The SVr4 docs merely say under scr_init that the dump data is also con‐
57       sidered invalid "if the time-stamp of the tty is old" but do not define
58       "old".
59

SEE ALSO

61       curses(3X),    curs_initscr(3X),    curs_refresh(3X),    curs_util(3X),
62       scr_dump(5), system(3)
63
64
65
66                                                             curs_scr_dump(3X)
Impressum