scr_dump.3x (2010 09)

s
scr_dump(3X) scr_dump(3X)
(ENHANCED CURSES)
NAME
scr_dump, scr_init, scr_restore, scr_set — screen file input/output functions
SYNOPSIS
#include <curses.h>
int scr_dump(const char *filename);
int scr_init(const char *filename);
int scr_restore(const char *filename);
int scr_set(const char *filename);
DESCRIPTION
The scr_dump() function writes the current contents of the virtual screen to the file named by filename
in an unspecified format.
The
scr_restore()
function sets the virtual screen to the contents of the file named by filename,
which must have been written using
scr_dump()
. The next refresh operation restores the screen to the
way it looked in the dump file.
The
scr_init() function reads the contents of the file named by filename and uses them to initialise
the Curses data structures to what the terminal currently has on its screen. The next refresh operation
bases any updates on this information, unless either of the following conditions is true:
The terminal has been written to since the virtual screen was dumped to filename
The terminfo capabilities
rmcup and nrrmc are defined for the current terminal.
The
scr_set() function is a combination of scr_restore()
and scr_init(). It tells the program
that the information in the file named by filename is what is currently on the screen, and also what the
program wants on the screen. This can be thought of as a screen inheritance function.
RETURN VALUE
On successful completion, these functions return OK. Otherwise, they return ERR.
ERRORS
No errors are defined.
APPLICATION USAGE
The
scr_init() function is called after initscr() or a system() call to share the screen with
another process that has done a scr_dump() after its endwin() call.
To read a window from a file, call
getwin(); to write a window to a file, call
putwin().
SEE ALSO
delscreen(3X), doupdate(3X), endwin(3X), getwin(3X), open(2), read(2), write(2) (in the X/Open System
Interfaces and Headers, Issue 4, Version 2 specification), <curses.h>.
CHANGE HISTORY
First released in X/Open Curses, Issue 4.
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)