Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | .\"*************************************************************************** |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2 | .\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 3 | .\" * |
| 4 | .\" Permission is hereby granted, free of charge, to any person obtaining a * |
| 5 | .\" copy of this software and associated documentation files (the * |
| 6 | .\" "Software"), to deal in the Software without restriction, including * |
| 7 | .\" without limitation the rights to use, copy, modify, merge, publish, * |
| 8 | .\" distribute, distribute with modifications, sublicense, and/or sell * |
| 9 | .\" copies of the Software, and to permit persons to whom the Software is * |
| 10 | .\" furnished to do so, subject to the following conditions: * |
| 11 | .\" * |
| 12 | .\" The above copyright notice and this permission notice shall be included * |
| 13 | .\" in all copies or substantial portions of the Software. * |
| 14 | .\" * |
| 15 | .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * |
| 16 | .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * |
| 17 | .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * |
| 18 | .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * |
| 19 | .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * |
| 20 | .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * |
| 21 | .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * |
| 22 | .\" * |
| 23 | .\" Except as contained in this notice, the name(s) of the above copyright * |
| 24 | .\" holders shall not be used in advertising or otherwise to promote the * |
| 25 | .\" sale, use or other dealings in this Software without prior written * |
| 26 | .\" authorization. * |
| 27 | .\"*************************************************************************** |
| 28 | .\" |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 29 | .\" $Id: curs_scr_dump.3x,v 1.9 2010/12/04 18:40:45 tom Exp $ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 30 | .TH curs_scr_dump 3X "" |
| 31 | .na |
| 32 | .hy 0 |
| 33 | .SH NAME |
| 34 | \fBscr_dump\fR, |
| 35 | \fBscr_restore\fR, |
| 36 | \fBscr_init\fR, |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 37 | \fBscr_set\fR \- read (write) a \fBcurses\fR screen from (to) a file |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 38 | .ad |
| 39 | .hy |
| 40 | .SH SYNOPSIS |
| 41 | \fB#include <curses.h>\fR |
| 42 | .sp |
| 43 | \fBint scr_dump(const char *filename);\fR |
| 44 | .br |
| 45 | \fBint scr_restore(const char *filename);\fR |
| 46 | .br |
| 47 | \fBint scr_init(const char *filename);\fR |
| 48 | .br |
| 49 | \fBint scr_set(const char *filename);\fR |
| 50 | .br |
| 51 | .SH DESCRIPTION |
| 52 | The \fBscr_dump\fR routine dumps the current contents of the virtual screen |
| 53 | to the file \fIfilename\fR. |
| 54 | .PP |
| 55 | The \fBscr_restore\fR routine sets the virtual screen to the contents |
| 56 | of \fIfilename\fR, which must have been written using \fBscr_dump\fR. The next |
| 57 | call to \fBdoupdate\fR restores the screen to the way it looked in the dump |
| 58 | file. |
| 59 | .PP |
| 60 | The \fBscr_init\fR routine reads in the contents of \fIfilename\fR and uses |
| 61 | them to initialize the \fBcurses\fR data structures about what the terminal |
| 62 | currently has on its screen. If the data is determined to be valid, |
| 63 | \fBcurses\fR bases its next update of the screen on this information rather |
| 64 | than clearing the screen and starting from scratch. \fBscr_init\fR is used |
| 65 | after \fBinitscr\fR or a \fBsystem\fR call to share |
| 66 | the screen with another process which has done a \fBscr_dump\fR after its |
| 67 | \fBendwin\fR call. The data is declared invalid if the terminfo capabilities |
| 68 | \fBrmcup\fR and \fBnrrmc\fR exist; also if the terminal has been written to |
| 69 | since the preceding \fBscr_dump\fR call. |
| 70 | .PP |
| 71 | The \fBscr_set\fR routine is a combination of \fBscr_restore\fR and |
| 72 | \fBscr_init\fR. It tells the program that the information in \fIfilename\fR is |
| 73 | what is currently on the screen, and also what the program wants on the screen. |
| 74 | This can be thought of as a screen inheritance function. |
| 75 | .PP |
| 76 | To read (write) a window from (to) a file, use the \fBgetwin\fR and |
| 77 | \fBputwin\fR routines [see \fBcurs_util\fR(3X)]. |
| 78 | .SH RETURN VALUE |
| 79 | All routines return the integer \fBERR\fR upon failure and \fBOK\fR |
| 80 | upon success. |
| 81 | .PP |
| 82 | X/Open defines no error conditions. |
| 83 | In this implementation, |
| 84 | each will return an error if the file cannot be opened. |
| 85 | .SH NOTES |
| 86 | Note that \fBscr_init\fR, \fBscr_set\fR, and \fBscr_restore\fR may be macros. |
| 87 | .SH PORTABILITY |
| 88 | The XSI Curses standard, Issue 4, describes these functions (adding the const |
| 89 | qualifiers). |
| 90 | .PP |
| 91 | The SVr4 docs merely say under \fBscr_init\fR that the dump data is also |
| 92 | considered invalid "if the time-stamp of the tty is old" but do not define |
| 93 | "old". |
| 94 | .SH SEE ALSO |
| 95 | \fBcurses\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_refresh\fR(3X), |
| 96 | \fBcurs_util\fR(3X), \fBsystem\fR(3) |