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

RETURN VALUE

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

NOTES

59       Note that scr_init, scr_set, and scr_restore may be macros.
60

PORTABILITY

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

SEE ALSO

70       curses(3X),    curs_initscr(3X),    curs_refresh(3X),    curs_util(3X),
71       scr_dump(5), system(3)
72
73
74
75                                                             curs_scr_dump(3X)
Impressum