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

RETURN VALUE

49       All routines return the integer ERR upon failure and OK upon success.
50
51       X/Open defines no error conditions.  In this implementation, each  will
52       return an error if the file cannot be opened.
53

NOTES

55       Note that scr_init, scr_set, and scr_restore may be macros.
56

PORTABILITY

58       The XSI Curses standard, Issue 4, describes these functions (adding the
59       const qualifiers).
60
61       The SVr4 docs merely say under scr_init that the dump data is also con‐
62       sidered invalid "if the time-stamp of the tty is old" but do not define
63       “old”.
64

SEE ALSO

66       curses(3X),    curs_initscr(3X),    curs_refresh(3X),    curs_util(3X),
67       scr_dump(5), system(3)
68
69
70
71                                                             curs_scr_dump(3X)
Impressum