scr_dump.5 (43c7dd6b597947c27cab4ebc5a67a8a3f5b7c58d) | scr_dump.5 (21817992b3314c908ab50f0bb88d2ee750b9c4ac) |
---|---|
1.\"*************************************************************************** | 1.\"*************************************************************************** |
2.\" Copyright 2018,2020 Thomas E. Dickey * | 2.\" Copyright 2018-2023,2024 Thomas E. Dickey * |
3.\" Copyright 2017 Free Software Foundation, Inc. * 4.\" * 5.\" Permission is hereby granted, free of charge, to any person obtaining a * 6.\" copy of this software and associated documentation files (the * 7.\" "Software"), to deal in the Software without restriction, including * 8.\" without limitation the rights to use, copy, modify, merge, publish, * 9.\" distribute, distribute with modifications, sublicense, and/or sell * 10.\" copies of the Software, and to permit persons to whom the Software is * --- 11 unchanged lines hidden (view full) --- 22.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 23.\" * 24.\" Except as contained in this notice, the name(s) of the above copyright * 25.\" holders shall not be used in advertising or otherwise to promote the * 26.\" sale, use or other dealings in this Software without prior written * 27.\" authorization. * 28.\"*************************************************************************** 29.\" | 3.\" Copyright 2017 Free Software Foundation, Inc. * 4.\" * 5.\" Permission is hereby granted, free of charge, to any person obtaining a * 6.\" copy of this software and associated documentation files (the * 7.\" "Software"), to deal in the Software without restriction, including * 8.\" without limitation the rights to use, copy, modify, merge, publish, * 9.\" distribute, distribute with modifications, sublicense, and/or sell * 10.\" copies of the Software, and to permit persons to whom the Software is * --- 11 unchanged lines hidden (view full) --- 22.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 23.\" * 24.\" Except as contained in this notice, the name(s) of the above copyright * 25.\" holders shall not be used in advertising or otherwise to promote the * 26.\" sale, use or other dealings in this Software without prior written * 27.\" authorization. * 28.\"*************************************************************************** 29.\" |
30.\" $Id: scr_dump.5,v 1.16 2020/02/02 23:34:34 tom Exp $ 31.TH scr_dump 5 32.ie \n(.g .ds `` \(lq 33.el .ds `` `` 34.ie \n(.g .ds '' \(rq 35.el .ds '' '' 36.de NS 37.ie n .sp 38.el .sp .5 39.ie n .in +4 40.el .in +2 41.nf 42.ft C \" Courier 43.. 44.de NE 45.fi 46.ft R 47.ie n .in -4 48.el .in -2 49.. | 30.\" $Id: scr_dump.5,v 1.46 2024/03/23 20:42:29 tom Exp $ 31.TH scr_dump 5 2024-03-23 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "File formats" 32.ie \n(.g \{\ 33.ds `` \(lq 34.ds '' \(rq 35.\} 36.el \{\ 37.ie t .ds `` `` 38.el .ds `` "" 39.ie t .ds '' '' 40.el .ds '' "" 41.\} 42. |
50.de bP 51.ie n .IP \(bu 4 52.el .IP \(bu 2 53.. 54.SH NAME | 43.de bP 44.ie n .IP \(bu 4 45.el .IP \(bu 2 46.. 47.SH NAME |
55scr_dump \- format of curses screen-dumps. 56.SH SYNOPSIS 57.B scr_dump | 48scr_dump \- 49\fIcurses\fR screen dump 50.\"SH SYNOPSIS |
58.SH DESCRIPTION | 51.SH DESCRIPTION |
59.PP | |
60The curses library provides applications with the ability to write the 61contents of a window to an external file using \fBscr_dump\fP or \fBputwin\fP, 62and read it back using \fBscr_restore\fP or \fBgetwin\fP. 63.PP 64The \fBputwin\fP and \fBgetwin\fP functions do the work; 65while \fBscr_dump\fP and \fBscr_restore\fP conveniently save and restore 66the whole screen, i.e., \fBstdscr\fP. 67.SS ncurses6 | 52The curses library provides applications with the ability to write the 53contents of a window to an external file using \fBscr_dump\fP or \fBputwin\fP, 54and read it back using \fBscr_restore\fP or \fBgetwin\fP. 55.PP 56The \fBputwin\fP and \fBgetwin\fP functions do the work; 57while \fBscr_dump\fP and \fBscr_restore\fP conveniently save and restore 58the whole screen, i.e., \fBstdscr\fP. 59.SS ncurses6 |
68.PP | |
69A longstanding implementation of screen-dump was 70revised with ncurses6 to remedy problems with the earlier approach: | 60A longstanding implementation of screen-dump was 61revised with ncurses6 to remedy problems with the earlier approach: |
71.bP | 62.IP \(bu 4 |
72A \*(``magic number\*('' is written to the beginning of the dump file, 73allowing applications (such as \fBfile\fP(1)) to recognize curses dump files. 74.IP 75Because ncurses6 uses a new format, 76that requires a new magic number 77was unused by other applications. 78This 16-bit number was unused: | 63A \*(``magic number\*('' is written to the beginning of the dump file, 64allowing applications (such as \fBfile\fP(1)) to recognize curses dump files. 65.IP 66Because ncurses6 uses a new format, 67that requires a new magic number 68was unused by other applications. 69This 16-bit number was unused: |
79.NS 800x8888 (octal \*(``\\210\\210\*('') 81.NE 82.IP | 70.RS 4 71.PP 72.RS 4 73.EX 740x8888 (octal \*(``\e210\e210\*('') 75.EE 76.RE 77.PP |
83but to be more certain, this 32-bit number was chosen: | 78but to be more certain, this 32-bit number was chosen: |
84.NS 850x88888888 (octal \*(``\\210\\210\\210\\210\*('') 86.NE 87.IP | 79.PP 80.RS 4 81.EX 820x88888888 (octal \*(``\e210\e210\e210\e210\*('') 83.EE 84.RE 85.PP |
88This is the pattern submitted to the maintainers of the \fBfile\fP program: | 86This is the pattern submitted to the maintainers of the \fBfile\fP program: |
89.NS | 87.PP 88.RS 4 89.EX |
90# 91# ncurses5 (and before) did not use a magic number, 92# making screen dumps "data". 93# 94# ncurses6 (2015) uses this format, ignoring byte-order | 90# 91# ncurses5 (and before) did not use a magic number, 92# making screen dumps "data". 93# 94# ncurses6 (2015) uses this format, ignoring byte-order |
950 string \\210\\210\\210\\210ncurses ncurses6 screen image | 950 string \e210\e210\e210\e210ncurses ncurses6 screen image |
96# | 96# |
97.NE | 97.EE 98.RE 99.RE |
98.bP 99The screen dumps are written in textual form, 100so that internal data sizes are not directly related to the dump-format, and 101enabling the library to read dumps from either narrow- or wide-character- 102configurations. 103.IP 104The \fInarrow\fP library configuration holds characters and video attributes 105in a 32-bit \fBchtype\fP, while the \fIwide-character\fP library stores 106this information in the \fBcchar_t\fP structure, which is much larger than 10732-bits. 108.bP 109It is possible to read a screen dump into a terminal with a different 110screen-size, 111because the library truncates or fills the screen as necessary. 112.bP 113The ncurses6 \fBgetwin\fP reads the legacy screen dumps from ncurses5. | 100.bP 101The screen dumps are written in textual form, 102so that internal data sizes are not directly related to the dump-format, and 103enabling the library to read dumps from either narrow- or wide-character- 104configurations. 105.IP 106The \fInarrow\fP library configuration holds characters and video attributes 107in a 32-bit \fBchtype\fP, while the \fIwide-character\fP library stores 108this information in the \fBcchar_t\fP structure, which is much larger than 10932-bits. 110.bP 111It is possible to read a screen dump into a terminal with a different 112screen-size, 113because the library truncates or fills the screen as necessary. 114.bP 115The ncurses6 \fBgetwin\fP reads the legacy screen dumps from ncurses5. |
114.SS ncurses5 (legacy) 115.PP 116The screen-dump feature was added to ncurses in June 1995. | 116.SS "ncurses5 (Legacy)" 117The screen-dump feature was added to \fI\%ncurses\fP in June 1995. |
117While there were fixes and improvements in succeeding years, 118the basic scheme was unchanged: 119.bP | 118While there were fixes and improvements in succeeding years, 119the basic scheme was unchanged: 120.bP |
120The \fBWINDOW\fP structure was written in binary form. | 121The \fI\%WINDOW\fP structure was written in binary form. |
121.bP | 122.bP |
122The \fBWINDOW\fP structure refers to lines of data, 123which were written as an array of binary data following the \fBWINDOW\fP. | 123The \fI\%WINDOW\fP structure refers to lines of data, 124which were written as an array of binary data following the \fI\%WINDOW\fP. |
124.bP 125When \fBgetwin\fP restored the window, 126it would keep track of offsets into the array of line-data | 125.bP 126When \fBgetwin\fP restored the window, 127it would keep track of offsets into the array of line-data |
127and adjust the \fBWINDOW\fP structure which was read back into memory. | 128and adjust the \fI\%WINDOW\fP structure which was read back into memory. |
128.PP | 129.PP |
129This is similar to Unix SystemV, | 130This is similar to Unix System\ V, |
130but does not write a \*(``magic number\*('' to identify the file format. 131.SH PORTABILITY | 131but does not write a \*(``magic number\*('' to identify the file format. 132.SH PORTABILITY |
132.PP 133There is no standard format for \fBputwin\fP. 134This section gives a brief description of the existing formats. 135.SS X/Open Curses 136.PP 137Refer to \fIX/Open Curses, Issue 7\fP (2009). 138.PP 139X/Open's documentation for \fIenhanced curses\fP says only: | 133There is no standard format for 134.I curses 135screen dumps. 136A brief survey of the existing implementations follows. 137.SS "X/Open Curses" 138X/Open Curses, Issue 7 specifies little. 139It says 140(boldface emphasis added) |
140.RS 3 141.PP | 141.RS 3 142.PP |
142The \fIgetwin(\ ) \fPfunction reads window-related data 143stored in the file by \fIputwin(\ )\fP. 144The function 145then creates and initializes a new window using that data. | 143\*(``[t]he \fI\%getwin()\fP function reads window-related data stored in 144the file by \fI\%putwin()\fP. 145The function then creates and initializes a new window using that data. |
146.PP | 146.PP |
147The \fIputwin(\ )\fP function writes all data associated 148with \fIwin\fP into the \fIstdio\fP stream to which \fIfilep\fP 149points, using an \fBunspecified format\fP. 150This information can be retrieved later using \fIgetwin(\ )\fP. | 147The \fI\%putwin()\fP function writes all data associated with \fIwin\fP 148into the \fI\%stdio\fP stream to which \fIfilep\fP points, 149using an \fBunspecified format\fP. 150This information can be retrieved later using \fI\%getwin()\fP.\*('' |
151.RE 152.PP 153In the mid-1990s when the X/Open Curses document was written, | 151.RE 152.PP 153In the mid-1990s when the X/Open Curses document was written, |
154there were still systems using older, less capable curses libraries 155(aside from the BSD curses library which was not relevant to X/Open 156because it did not meet the criteria for \fIbase curses\fP). 157The document explained the term \*(``enhanced\*('' as follows: 158.RS 3 159.bP 160Shading is used to identify \fIX/Open Enhanced Curses\fP material, 161relating to interfaces included to provide enhanced capabilities 162for applications originally written to be compiled on systems 163based on the UNIX operating system. 164Therefore, the features described may not be present on systems 165that conform to \fBXPG4 or to earlier XPG releases\fP. 166The relevant reference pages may provide additional 167or more specific portability warnings about use of the material. 168.RE | 154there were still System\ V systems using older, 155less capable 156.I curses 157libraries. 158BSD 159.I curses 160was not relevant to X/Open because it did not meet the criteria 161for base-level conformance; 162see \fB\%ncurses\fP(3X). 163.SS "System V" 164System\ V 165.I curses 166identified the file format by writing a \*(``magic number\*('' at the 167beginning of the dump. 168The \fI\%WINDOW\fP data and the lines of text follow, all in binary form. |
169.PP | 169.PP |
170In the foregoing, emphasis was added to \fBunspecified format\fP 171and to \fBXPG4 or to earlier XPG releases\fP, 172for clarity. 173.SS Unix SystemV | 170Solaris 171.I curses 172has the following definitions. |
174.PP | 173.PP |
175Unix SystemV curses identified the file format by writing a 176\*(``magic number\*('' at the beginning of the dump. 177The \fBWINDOW\fP data and the lines of text follow, all in binary form. 178.PP 179The Solaris curses source has these definitions: 180.NS | 174.RS 4 175.EX |
181/* terminfo magic number */ 182#define MAGNUM 0432 183 184/* curses screen dump magic number */ 185#define SVR2_DUMP_MAGIC_NUMBER 0433 186#define SVR3_DUMP_MAGIC_NUMBER 0434 | 176/* terminfo magic number */ 177#define MAGNUM 0432 178 179/* curses screen dump magic number */ 180#define SVR2_DUMP_MAGIC_NUMBER 0433 181#define SVR3_DUMP_MAGIC_NUMBER 0434 |
187.NE | 182.EE 183.RE |
188.PP 189That is, the feature was likely introduced in SVr2 (1984), 190and improved in SVr3 (1987). | 184.PP 185That is, the feature was likely introduced in SVr2 (1984), 186and improved in SVr3 (1987). |
191The Solaris curses source has no magic number for SVr4 (1989). 192Other operating systems (AIX and HPUX) use a magic number which would 193correspond to this definition: 194.NS | 187Solaris 188.I curses 189has no magic number for SVr4 (1989). 190Other System\ V operating systems 191(AIX and HP-UX) 192use a magic number that would correspond to the following. 193.PP 194.RS 4 195.EX |
195/* curses screen dump magic number */ 196#define SVR4_DUMP_MAGIC_NUMBER 0435 | 196/* curses screen dump magic number */ 197#define SVR4_DUMP_MAGIC_NUMBER 0435 |
197.NE | 198.EE 199.RE |
198.PP 199That octal number in bytes is 001, 035. | 200.PP 201That octal number in bytes is 001, 035. |
200Because most Unix vendors use big-endian hardware, 201the magic number is written with the high-order byte first, e.g., 202.NS 203\001\035 204.NE | 202Because most Unix vendors at the time used big-endian hardware, 203the magic number is written with the high-order byte first. |
205.PP | 204.PP |
206After the magic number, the \fBWINDOW\fP structure and line-data are 207written in binary format. 208While the magic number used by the Unix systems can be seen using \fBod\fP(1), 209none of the Unix systems documents the format used for screen-dumps. | 205.RS 4 206.EX 207\e001\e035 208.EE 209.RE |
210.PP | 210.PP |
211The Unix systems do not use identical formats. 212While collecting information for for this manual page, 213the \fIsavescreen\fP test-program 214produced dumps of different size 215(all on 64-bit hardware, on 40x80 screens): | 211After the magic number, 212the \fI\%WINDOW\fP structure and line data are written in binary format. 213While the magic number used by these systems can be observed with 214\fIod\fP(1), 215none of them documents the format used for screen dumps. 216.PP 217Nor do they use an identical format, 218even with the System\ V family. 219The 220.I \%ncurses 221.I \%savescreen 222test program was used to collect information for this manual page. 223It produced dumps of different size 224(all on 64-bit hardware, 225on 40x80 screens): |
216.bP 217AIX (51817 bytes) 218.bP | 226.bP 227AIX (51817 bytes) 228.bP |
219HPUX (90093 bytes) | 229HP-UX (90093 bytes) |
220.bP 221Solaris 10 (13273 bytes) 222.bP | 230.bP 231Solaris 10 (13273 bytes) 232.bP |
223ncurses5 (12888 bytes) | 233\fI\%ncurses\fP5 (12888 bytes) |
224.SS Solaris | 234.SS Solaris |
225.PP 226As noted above, Solaris curses has no magic number corresponding 227to SVr4 curses. 228This is odd since Solaris was the first operating system 229to pass the SVr4 guidelines. 230Solaris has two versions of curses: | 235As noted above, 236Solaris 237.I curses 238has no magic number corresponding to SVr4 239.IR curses . 240This is odd, 241since Solaris was the first operating system to meet the SVr4 242guidelines. 243Solaris furthermore supplies two versions of 244.IR curses . |
231.bP | 245.bP |
232The default curses library uses the SVr3 magic number. | 246The default 247.I curses 248library uses the SVr3 magic number. |
233.bP | 249.bP |
234There is an alternate curses library in \fB/usr/xpg4\fP. 235This uses a textual format with no magic number. | 250An alternate 251.I curses 252library 253(which we term 254.I \%xcurses), 255available in 256.IR /usr/xpg4 , 257uses a textual format with no magic number. |
236.IP | 258.IP |
237According to the copyright notice, the \fIxpg4\fP Solaris curses library was 238developed by MKS (Mortice Kern Systems) from 1990 to 1995. | 259According to its copyright notice, 260this 261.I \%xcurses 262library was developed by MKS 263(Mortice Kern Systems) from 1990 to 1995. |
239.IP | 264.IP |
240Like ncurses6, there is a file-header with parameters. 241Unlike ncurses6, the contents of the window are written piecemeal, 242with coordinates and attributes for each chunk of text rather 243than writing the whole window from top to bottom. | 265Like ncurses6, 266it includes a header with parameters. 267Unlike ncurses6, 268the contents of the window are written piecemeal, 269with coordinates and attributes for each chunk of text rather than 270writing the whole window from top to bottom. |
244.SS PDCurses | 271.SS PDCurses |
245.PP 246PDCurses added support for screen dumps in version 2.7 (2005). 247Like Unix SystemV and ncurses5, 248it writes the \fBWINDOW\fP structure in binary, | 272.I \%PDCurses 273added support for screen dumps in version 2.7 (2005). 274Like System\ V and ncurses5, 275it writes the \fI\%WINDOW\fP structure in binary, |
249but begins the file with its three-byte identifier \*(``PDC\*('', | 276but begins the file with its three-byte identifier \*(``PDC\*('', |
250followed by a one-byte version, 251e.g., 252.NS 253 \*(``PDC\\001\*('' 254.NE | 277followed by a single-byte version number. 278.PP 279.RS 4 280.EX 281 \*(``PDC\e001\*('' 282.EE 283.RE |
255.SS NetBSD | 284.SS NetBSD |
285As of April 2017, 286NetBSD 287.I curses 288does not support \fB\%scr_dump\fP and \fB\%scr_restore\fP 289(or \fB\%scr_init\fP, 290\fB\%scr_set\fP), 291although it has \fB\%putwin\fP and \fB\%getwin\fP. |
|
256.PP | 292.PP |
257As of April 2017, NetBSD curses does 258not support \fBscr_dump\fP and \fBscr_restore\fP 259(or \fBscr_init\fP, \fBscr_set\fP), 260although it has \fBputwin\fP and \fBgetwin\fP. 261.PP 262Like ncurses5, NetBSD \fBputwin\fP does not identify its dumps with a 263useful magic number. | 293Like ncurses5, 294NetBSD \fB\%putwin\fP does not identify its dumps with a useful magic 295number. |
264It writes 265.bP | 296It writes 297.bP |
266the curses shared library major and minor versions 267as the first two bytes (e.g., 7 and 1), | 298the 299.I curses 300shared library major and minor versions as the first two bytes 301(for example, 3027 and 1), |
268.bP | 303.bP |
269followed by a binary dump of the \fBWINDOW\fP, | 304followed by a binary dump of the \fI\%WINDOW\fP, |
270.bP | 305.bP |
271some data for wide-characters referenced by the \fBWINDOW\fP structure, and | 306some data for wide characters referenced by the \fI\%WINDOW\fP 307structure, 308and |
272.bP | 309.bP |
273finally, lines as done by other implementations. 274.SH EXAMPLE 275.PP | 310finally, 311lines as done by other implementations. 312.SH EXAMPLES |
276Given a simple program which writes text to the screen 277(and for the sake of example, limiting the screen-size to 10x20): | 313Given a simple program which writes text to the screen 314(and for the sake of example, limiting the screen-size to 10x20): |
278.NS | 315.PP 316.RS 4 317.EX |
279#include <curses.h> 280 281int 282main(void) 283{ 284 putenv("LINES=10"); 285 putenv("COLUMNS=20"); 286 initscr(); --- 8 unchanged lines hidden (view full) --- 295 attroff(A_BOLD); 296 attrset(A_REVERSE | COLOR_PAIR(2)); 297 addstr("World!"); 298 refresh(); 299 scr_dump("foo.out"); 300 endwin(); 301 return 0; 302} | 318#include <curses.h> 319 320int 321main(void) 322{ 323 putenv("LINES=10"); 324 putenv("COLUMNS=20"); 325 initscr(); --- 8 unchanged lines hidden (view full) --- 334 attroff(A_BOLD); 335 attrset(A_REVERSE | COLOR_PAIR(2)); 336 addstr("World!"); 337 refresh(); 338 scr_dump("foo.out"); 339 endwin(); 340 return 0; 341} |
303.NE | 342.EE 343.RE |
304.PP 305When run using ncurses6, the output looks like this: | 344.PP 345When run using ncurses6, the output looks like this: |
306.NS 307\\210\\210\\210\\210ncurses 6.0.20170415 | 346.PP 347.RS 4 348.EX 349\e210\e210\e210\e210ncurses 6.0.20170415 |
308_cury=5 309_curx=11 310_maxy=9 311_maxx=19 312_flags=14 | 350_cury=5 351_curx=11 352_maxy=9 353_maxx=19 354_flags=14 |
313_attrs=\\{REVERSE|C2} | 355_attrs=\e{REVERSE|C2} |
314flag=_idcok 315_delay=-1 316_regbottom=9 | 356flag=_idcok 357_delay=-1 358_regbottom=9 |
317_bkgrnd=\\{NORMAL|C1}\\s | 359_bkgrnd=\e{NORMAL|C1}\es |
318rows: | 360rows: |
3191:\\{NORMAL|C1}\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s 3202:\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s 3213:\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s 3224:\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s 3235:\\s\\s\\s\\s\\s\\{BOLD}Hello\\{NORMAL}\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s 3246:\\s\\s\\s\\s\\s\\{REVERSE|C2}World!\\{NORMAL|C1}\\s\\s\\s\\s\\s\\s\\s\\s\\s 3257:\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s 3268:\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s 3279:\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s 32810:\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s\\s 329.NE | 3611:\e{NORMAL|C1}\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es 3622:\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es 3633:\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es 3644:\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es 3655:\es\es\es\es\es\e{BOLD}Hello\e{NORMAL}\es\es\es\es\es\es\es\es\es\es 3666:\es\es\es\es\es\e{REVERSE|C2}World!\e{NORMAL|C1}\es\es\es\es\es\es\es\es\es 3677:\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es 3688:\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es 3699:\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es 37010:\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es\es 371.EE 372.RE |
330.PP 331The first four octal escapes are actually nonprinting characters, 332while the remainder of the file is printable text. 333You may notice: 334.bP 335The actual color pair values are not written to the file. 336.bP | 373.PP 374The first four octal escapes are actually nonprinting characters, 375while the remainder of the file is printable text. 376You may notice: 377.bP 378The actual color pair values are not written to the file. 379.bP |
337All characters are shown in printable form; spaces are \*(``\\s\*('' to | 380All characters are shown in printable form; spaces are \*(``\es\*('' to |
338ensure they are not overlooked. 339.bP | 381ensure they are not overlooked. 382.bP |
340Attributes are written in escaped curly braces, e.g., \*(``\\{BOLD}\*('', 341and may include a color-pair (C1 or C2 in this example). | 383Attributes are written in escaped curly braces, e.g., \*(``\e{BOLD}\*('', 384and may include a color pair (C1 or C2 in this example). |
342.bP 343The parameters in the header are written out only if they are nonzero. 344When reading back, order does not matter. 345.ne 10 346.PP 347Running the same program with Solaris \fIxpg4\fP curses gives this dump: | 385.bP 386The parameters in the header are written out only if they are nonzero. 387When reading back, order does not matter. 388.ne 10 389.PP 390Running the same program with Solaris \fIxpg4\fP curses gives this dump: |
348.NS | 391.PP 392.RS 4 393.EX |
349MAX=10,20 350BEG=0,0 351SCROLL=0,10 352VMIN=1 353VTIME=0 354FLAGS=0x1000 355FG=0,0 | 394MAX=10,20 395BEG=0,0 396SCROLL=0,10 397VMIN=1 398VTIME=0 399FLAGS=0x1000 400FG=0,0 |
356BG=0,0, | 401BG=0,0, |
3570,0,0,1, | 4020,0,0,1, |
3580,19,0,0, | 4030,19,0,0, |
3591,0,0,1, | 4041,0,0,1, |
3601,19,0,0, | 4051,19,0,0, |
3612,0,0,1, | 4062,0,0,1, |
3622,19,0,0, | 4072,19,0,0, |
3633,0,0,1, | 4083,0,0,1, |
3643,19,0,0, | 4093,19,0,0, |
3654,0,0,1, 3664,5,0x20,0,Hello 3674,10,0,1, | 4104,0,0,1, 4114,5,0x20,0,Hello 4124,10,0,1, |
3684,19,0,0, | 4134,19,0,0, |
3695,0,0,1, 3705,5,0x4,2,World! 3715,11,0,1, | 4145,0,0,1, 4155,5,0x4,2,World! 4165,11,0,1, |
3725,19,0,0, | 4175,19,0,0, |
3736,0,0,1, | 4186,0,0,1, |
3746,19,0,0, | 4196,19,0,0, |
3757,0,0,1, | 4207,0,0,1, |
3767,19,0,0, | 4217,19,0,0, |
3778,0,0,1, | 4228,0,0,1, |
3788,19,0,0, | 4238,19,0,0, |
3799,0,0,1, | 4249,0,0,1, |
3809,19,0,0, | 4259,19,0,0, |
381CUR=11,5 | 426CUR=11,5 |
382.NE | 427.EE 428.RE |
383.PP 384Solaris \fBgetwin\fP requires that all parameters are present, and 385in the same order. 386The \fIxpg4\fP curses library does not know about the \fBbce\fP 387(back color erase) capability, and does not color the window background. 388.ne 10 389.PP 390On the other hand, the SVr4 curses library does know about the background color. 391However, its screen dumps are in binary. | 429.PP 430Solaris \fBgetwin\fP requires that all parameters are present, and 431in the same order. 432The \fIxpg4\fP curses library does not know about the \fBbce\fP 433(back color erase) capability, and does not color the window background. 434.ne 10 435.PP 436On the other hand, the SVr4 curses library does know about the background color. 437However, its screen dumps are in binary. |
392Here is the corresponding dump (using \*(``od -t x1\*(''): 393.NS | 438Here is the corresponding dump (using \*(``od \-t x1\*(''): 439.PP 440.RS 4 441.EX |
3940000000 1c 01 c3 d6 f3 58 05 00 0b 00 0a 00 14 00 00 00 3950000020 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 3960000040 00 00 b8 1a 06 08 cc 1a 06 08 00 00 09 00 10 00 3970000060 00 00 00 80 00 00 20 00 00 00 ff ff ff ff 00 00 3980000100 ff ff ff ff 00 00 00 00 20 80 00 00 20 80 00 00 3990000120 20 80 00 00 20 80 00 00 20 80 00 00 20 80 00 00 400* 4010000620 20 80 00 00 20 80 00 00 20 80 00 00 48 80 00 04 --- 6 unchanged lines hidden (view full) --- 4080001020 20 80 00 00 20 80 00 00 20 80 00 00 20 80 00 00 409* 4100001540 20 80 00 00 20 80 00 00 00 00 f6 d1 01 00 f6 d1 4110001560 08 00 00 00 40 00 00 00 00 00 00 00 00 00 00 07 4120001600 00 04 00 01 00 01 00 00 00 01 00 00 00 00 00 00 4130001620 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 414* 4150002371 | 4420000000 1c 01 c3 d6 f3 58 05 00 0b 00 0a 00 14 00 00 00 4430000020 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 4440000040 00 00 b8 1a 06 08 cc 1a 06 08 00 00 09 00 10 00 4450000060 00 00 00 80 00 00 20 00 00 00 ff ff ff ff 00 00 4460000100 ff ff ff ff 00 00 00 00 20 80 00 00 20 80 00 00 4470000120 20 80 00 00 20 80 00 00 20 80 00 00 20 80 00 00 448* 4490000620 20 80 00 00 20 80 00 00 20 80 00 00 48 80 00 04 --- 6 unchanged lines hidden (view full) --- 4560001020 20 80 00 00 20 80 00 00 20 80 00 00 20 80 00 00 457* 4580001540 20 80 00 00 20 80 00 00 00 00 f6 d1 01 00 f6 d1 4590001560 08 00 00 00 40 00 00 00 00 00 00 00 00 00 00 07 4600001600 00 04 00 01 00 01 00 00 00 01 00 00 00 00 00 00 4610001620 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 462* 4630002371 |
416.NE 417.SH SEE ALSO 418.PP 419\fBcurs_scr_dump\fR(3X), 420\fBcurs_util\fR(3X). | 464.EE 465.RE |
421.SH AUTHORS | 466.SH AUTHORS |
422.PP | |
423Thomas E. Dickey 424.br | 467Thomas E. Dickey 468.br |
425extended screen-dump format for ncurses 6.0 (2015) | 469extended screen-dump format for \fI\%ncurses\fP 6.0 (2015) |
426.sp 427Eric S. Raymond 428.br | 470.sp 471Eric S. Raymond 472.br |
429screen dump feature in ncurses 1.9.2d (1995) | 473screen dump feature in \fI\%ncurses\fP 1.9.2d (1995) 474.SH SEE ALSO 475\fB\%curs_scr_dump\fP(3X), 476\fB\%curs_util\fP(3X) |