1curs_scr_dump(3CURSES) Curses Library Functions curs_scr_dump(3CURSES)
2
3
4
6 curs_scr_dump, scr_dump, scr_restore, scr_init, scr_set - read or write
7 a curses screen from or to a file
8
10 cc [ flag ... ] file ... -lcurses [ library ... ]
11 #include <curses.h>
12
13 int scr_dump(char *filename);
14
15
16 int scr_restore(char *filename);
17
18
19 int scr_init(char *filename);
20
21
22 int scr_set(char *filename);
23
24
26 With the scr_dump() routine, the current contents of the virtual screen
27 are written to the file filename.
28
29
30 With the scr_restore() routine, the virtual screen is set to the con‐
31 tents of filename, which must have been written using scr_dump(). The
32 next call to doupdate() restores the screen to the way it looked in the
33 dump file.
34
35
36 With the scr_init() routine, the contents of filename are read in and
37 used to initialize the curses data structures about what the terminal
38 currently has on its screen. If the data is determined to be valid,
39 curses bases its next update of the screen on this information rather
40 than clearing the screen and starting from scratch. scr_init() is used
41 after initscr() or a system(3C) call to share the screen with another
42 process which has done a scr_dump() after its endwin() call. The data
43 is declared invalid if the time-stamp of the tty is old or the terminfo
44 capabilities rmcup() and nrrmc() exist.
45
46
47 The scr_set() routine is a combination of scr_restore() and scr_init().
48 It tells the program that the information in filename is what is cur‐
49 rently on the screen, and also what the program wants on the screen.
50 This can be thought of as a screen inheritance function.
51
52
53 To read (write) a window from (to) a file, use the getwin() and
54 putwin() routines (see curs_util(3CURSES)).
55
57 All routines return the integer ERR upon failure and OK upon success.
58
60 See attributes(5) for descriptions of the following attributes:
61
62
63
64
65 ┌─────────────────────────────┬─────────────────────────────┐
66 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
67 ├─────────────────────────────┼─────────────────────────────┤
68 │MT-Level │Unsafe │
69 └─────────────────────────────┴─────────────────────────────┘
70
72 curs_initscr(3CURSES), curs_refresh(3CURSES), curs_util(3CURSES),
73 curses(3CURSES), system(3C), attributes(5)
74
76 The header <curses.h> automatically includes the headers <stdio.h> and
77 <unctrl.h>.
78
79
80 Note that scr_init(), scr_set(), and scr_restore() may be macros.
81
82
83
84SunOS 5.11 31 Dec 1996 curs_scr_dump(3CURSES)