]> ncurses.scripts.mit.edu Git - ncurses.git/blob - misc/magic
ncurses 6.1 - patch 20180203
[ncurses.git] / misc / magic
1 # $Id: magic,v 1.2 2018/01/05 01:42:08 tom Exp $
2 ##############################################################################
3 # Copyright (c) 2015-2017,2018 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 "Software"), #
7 # to deal in the Software without restriction, including without limitation  #
8 # the rights to use, copy, modify, merge, publish, distribute, distribute    #
9 # with modifications, sublicense, and/or sell copies of the Software, and to #
10 # permit persons to whom the Software is furnished to do so, subject to the  #
11 # following conditions:                                                      #
12 #                                                                            #
13 # The above copyright notice and this permission notice shall be included in #
14 # all copies or substantial portions of the Software.                        #
15 #                                                                            #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
19 # THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
21 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
22 # 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 sale, #
26 # use or other dealings in this Software without prior written               #
27 # authorization.                                                             #
28 ##############################################################################
29 # for reference, from file 5.30:
30 #------------------------------------------------------------------------------
31 # @File: terminfo,v 1.7 2016/03/17 21:02:29 christos Exp @
32 # terminfo:  file(1) magic for terminfo
33 #
34 # URL: https://invisible-island.net/ncurses/man/term.5.html
35 # URL: https://invisible-island.net/ncurses/man/scr_dump.5.html
36 #
37 # Workaround for Targa image type by Joerg Jenderek
38 # GRR: line below too general as it catches also
39 # Targa image type 1 with 26 long identification field
40 # and HELP.DSK
41 0       string          \032\001
42 # 5th character of terminal name list, but not Targa image pixel size (15 16 24 32)
43 >16     ubyte           >32
44 # namelist, if more than 1 separated by "|" like "st|stterm| simpleterm 0.4.1"
45 >>12    regex           \^[a-zA-Z0-9][a-zA-Z0-9.][^|]*  Compiled terminfo entry "%-s"
46 !:mime  application/x-terminfo
47 # no extension
48 #!:ext
49 #
50 #------------------------------------------------------------------------------
51 # The following was added for ncurses6 development:
52 #------------------------------------------------------------------------------
53 #
54 0       string          \036\002
55 # imitate the legacy compiled-format, to get the entry-name printed
56 >16     ubyte           >32
57 # namelist, if more than 1 separated by "|" like "st|stterm| simpleterm 0.4.1"
58 >>12    regex           \^[a-zA-Z0-9][a-zA-Z0-9.][^|]*  Compiled 32-bit terminfo entry "%-s"
59 !:mime  application/x-terminfo2
60 #
61 # While the compiled terminfo uses little-endian format irregardless of
62 # platform, SystemV screen dumps do not.  They came later, and that detail was
63 # overlooked.
64 #
65 # AIX and HPUX use the SVr4 big-endian format
66 # Solaris uses the SVr3 formats (sparc and x86 differ endian-ness)
67 0       beshort         0433            SVr2 curses screen image, big-endian
68 0       beshort         0434            SVr3 curses screen image, big-endian
69 0       beshort         0435            SVr4 curses screen image, big-endian
70 #
71 0       leshort         0433            SVr2 curses screen image, little-endian
72 0       leshort         0434            SVr3 curses screen image, little-endian
73 0       leshort         0435            SVr4 curses screen image, little-endian
74 #
75 # Rather than SVr4, Solaris "xcurses" writes this header:
76 0       regex           \^MAX=[0-9]+,[0-9]+$
77 >1      regex           \^BEG=[0-9]+,[0-9]+$
78 >2      regex           \^SCROLL=[0-9]+,[0-9]+$
79 >3      regex           \^VMIN=[0-9]+$
80 >4      regex           \^VTIME=[0-9]+$
81 >5      regex           \^FLAGS=0x[[:xdigit:]]+$
82 >6      regex           \^FG=[0-9],[0-9]+$
83 >7      regex           \^BG=[0-9]+,[0-9]+,     Solaris xcurses screen image
84 #
85 # ncurses5 (and before) did not use a magic number, making screen dumps "data".
86 # ncurses6 (2015) uses this format, ignoring byte-order
87 0       string  \210\210\210\210ncurses ncurses6 screen image
88 #
89 # PDCurses added this in 2005
90 0       string          PDC\001         PDCurses screen image