#--------------------------------------------------------------
#
# Special magic entries. 
#
# These entries are processed and cached in different tables.
# They are not used in magic match.	
#
#       !!!!!! don't edit the first 3 fields !!!!!!!
#
#   ==Ascii Files==
# <ascii>  description  index   large_xpm[,small_xpm]:color:cmd_to_open[,cmd]+:::
#	
<ascii>	 C-program	   1        dot_c.xpm,dot_c_s.xpm:purple2::$edit,@view:::C-program
<ascii>	 C++-program	   2        c++.xpm,dot_c_s.xpm:purple3::$edit,@view:::C++-program
<ascii>	 Fortran-program   3        dot_f.xpm,dot_f_s.xpm:green4::$edit,@view:::Fortran-program
<ascii>	 Make-command      4        makefile.xpm,makefile_s.xpm:darkred:b:$edit,@view,$make:::Make-command
<ascii>	 PL1-program       5        program.xpm:::$edit,@view:::PL1-program
<ascii>	 Assembler-program 6        program.xpm:::$edit,@view:::Assembler-program
<ascii>	 English-text      7        dot_a.xpm,dot_a_s.xpm:::$edit,@view:::English-text
<ascii>	 Pascal-program    8        dot_p.xpm,dot_p_s.xpm:cyan4::$edit,@view:::Pascal-program
<ascii>	 Mail-text         9        mail.xpm,mail_s.xpm:SeaGreen::$edit,@view,$readmail:::Mail-text
<ascii>	 News-text         10       news.xpm:orange::$edit,@view:::News-text
<ascii>	 Troff-text        11       columns.xpm:deepPink1:i:$edit,@view,$formattroff:::Troff-text
<ascii>	 tex-text          12       tex.xpm:blue::$texView,$texPrint,$tex,$edit:::TeX document text
<ascii>	 latex-text        13       tex.xpm:blue::$latexView,$latexPrint,$latex,$edit:::TeX document text
<ascii>	 Generic-ascii     14       dot_a.xpm,dot_a_s.xpm:::$edit,@view:::Generic-ascii

#
#  ==System and Special Files==
#
<system>  directory        1       dir.xpm,dir_s.xpm:red:b:@openFolder,@openFolderNew,$diskUsage,$tarUp:::dir
<system>  char-special     2       cspecial.xpm,special_s.xpm:deepskyblue:bi::::char-special
<system>  block-special    3       bspecial.xpm,special_s.xpm:deepskyblue:bi::::block-special
<system>  fifo-pipe        4       pipe.xpm,pipe_s.xpm:deepskyblue:bi::::fifo-pipe
<system>  socket           5       socket.xpm,socket_s.xpm:sienna1:bi::::socket
<system>  exec-only        6       exe_only.xpm:IndianRed2:i::::exec-only
<system>  write-only       7       wri_only.xpm:IndianRed2:i::::write-only
<system>  e-w-only         8       wri_exe.xpm:IndianRed2:i::::e-w-only
<system>  empty            9       box_empty.xpm,box_empty_s.xpm:gray60:i::::empty
<system>  generic-data     10      binary.xpm,binary_s.xpm:::::generic-data
<system>  symbolic-linkd   11      lnkdir.xpm,lnkdir_s.xpm:SpringGreen4:bi:@openFolder,@openFolderNew:::symbolic-link
<system>  symbolic-linkf   12      link.xpm:SpringGreen4:bi:@followLink:::symbolic-link
<system>  bad-link         13      link_bad.xpm:SpringGreen4:bi::::bad-link
<system>  unknown          14      unknown.xpm::::::unknown


#------------------------------------------------------------------------------
# animation:  file(1) magic for animation/movie formats
#
# animation formats
# MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8)
# FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com)

# MPEG animation format
0	string		\000\000\001\263	movie.xpm:magenta::$playMovie::::MPEG file

# FLI animation format
4	leshort		0xAF11			movie.xpm:magenta::$playMovie::::FLI file
>6	leshort		x			movie.xpm:magenta::$playMovie::::- %d frames,
>8	leshort		x			movie.xpm:magenta::$playMovie::::width=%d pixels,
>10	leshort		x			movie.xpm:magenta::$playMovie::::height=%d pixels,
>12	leshort		x			movie.xpm:magenta::$playMovie::::depth=%d,
>16	leshort		x			movie.xpm:magenta::$playMovie::::ticks/frame=%d
# FLC animation format
4	leshort		0xAF12			movie.xpm:magenta::$playMovie::::FLC file
>6	leshort		x			movie.xpm:magenta::$playMovie::::- %d frames
>8	leshort		x			movie.xpm:magenta::$playMovie::::width=%d pixels,
>10	leshort		x			movie.xpm:magenta::$playMovie::::height=%d pixels,
>12	leshort		x			movie.xpm:magenta::$playMovie::::depth=%d,
>16	leshort		x			movie.xpm:magenta::$playMovie::::ticks/frame=%d

# SGI and Apple formats
0	string		MOVI		movie.xpm:magenta::$playMovie::::Silicon Graphics movie file
4	string		moov		movie.xpm:magenta::$playMovie::::Apple QuickTime movie file (moov)
4	string		mdat		movie.xpm:magenta::$playMovie::::Apple QuickTime movie file (mdat)

#------------------------------------------------------------------------------
# apple:  file(1) magic for Apple II file formats
#
0	string		FiLeStArTfIlEsTaRt	apple_a.xpm:::$edit,@view:::binscii (apple ][) text
0	string		\x0aGL			apple_bin.xpm::::::Binary II (apple ][) data
0	string		\x76\xff		apple_bin.xpm::::::Squeezed (apple ][) data
0	string		SIT!			apple_a.xpm:::$edit,@view:::StuffIt (macintosh) text
0	string		NuFile			apple_bin.xpm::::::NuFile archive (apple ][) data
0	string		N\xf5F\xe9l\xe5		apple_bin.xpm::::::NuFile archive (apple ][) data
#------------------------------------------------------------------------------
# archive:  file(1) magic for archive formats (see also "msdos" for self-
#           extracting compressed archives)
#
# cpio, ar, arc, arj, hpack, lha/lharc, rar, squish, uc2, zip, zoo, etc.
# pre-POSIX "tar" archives are handled in the C code.

# POSIX tar archives
257	string		ustar\0		tar.xpm,tar_s.xpm:brown:b:$tarContents,$untar::::POSIX tar archive
257	string		ustar\040\040\0	tar.xpm,tar_s.xpm:brown:b:$tarContents,$untar::::POSIX tar archive
# cpio archives
#
# Yes, the top two "cpio archive" formats *are* supposed to just be "short".
# The idea is to indicate archives produced on machines with the same
# byte order as the machine running "file" with "cpio archive", and
# to indicate archives produced on machines with the opposite byte order
# from the machine running "file" with "byte-swapped cpio archive".
#
# The SVR4 "cpio(4)" hints that there are additional formats, but they
# are defined as "short"s; I think all the new formats are
# character-header formats and thus are strings, not numbers.
0	short		070707		cpio.xpm:brown:b:$cpioContents,$extractCpio::::cpio archive
0	short		0143561		cpio.xpm:brown:b:$cpioContents,$extractCpio::::byte-swapped cpio archive
0	string		070707		cpio.xpm:brown:b:$cpioContents,$extractCpio::::ASCII cpio archive (pre-SVR4 or odc)
0	string		070701		cpio.xpm:brown:b:$cpioContents,$extractCpio::::ASCII cpio archive (SVR4 w no CRC)
0	string		070702		cpio.xpm:brown:b:$cpioContents,$extractCpio::::ASCII cpio archive (SVR4 with CRC)

#
# XXX - why are there multiple <ar> thingies?  Note that 0x213c6172 is
# "!<ar", so, for new-style (4.xBSD/SVR2andup) archives, we have:
#
0	string		!<arch>		ar.xpm:brown:b:$arContents::::current ar archive
0	string		\<ar>		ar.xpm:brown:b:$arContents::::System V Release 1 ar archive
0	string		=<ar>		ar.xpm:brown:b:$arContents::::archive
#
#------------------------------------------------------------------------------
# asterix:  file(1) magic for Aster*x; SunOS 5.5.1 gave the 4-character
# strings as "long" - we assume they're just strings:
# From: guy@netapp.com (Guy Harris)
#
0	string		*STA		word_processor.xpm:::::::Aster*x
>7	string		WORD		word_processor.xpm:::::::Words Document
>7	string		GRAP		bargraph.xpm:::::::Graphic
>7	string		SPRE		spreadsheet.xpm:::::::Spreadsheet
>7	string		MACR		word_processor.xpm:::::::Macro
0	string		2278		word_processor.xpm:::::::Aster*x Version 2
>29	byte		0x36		word_processor.xpm:::::::Words Document
>29	byte		0x35		bargraph.xpm:::::::Graphic
>29	byte		0x32		spreadsheet.xpm:::::::Spreadsheet
>29	byte		0x38		word_processor.xpm:::::::Macro

#------------------------------------------------------------------------------
# audio:  file(1) magic for sound formats (see also "iff")
#
# Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
# and others
#

# Sun/NeXT audio data
0	string		.snd		sound_sun.xpm:hotPink::$playAudio:::Sun/NeXT audio data:

# DEC systems (e.g. DECstation 5000) use a variant of the Sun/NeXT format
# that uses little-endian encoding and has a different magic number
0	lelong		0x0064732E	sound_dec.xpm:hotPink::$playAudio:::DEC audio data:

# Microsoft WAVE format (*.wav)
0	string		RIFF		sound_ms.xpm:hotPink::$playAudio:::Microsoft RIFF

# Real Audio (Magic .ra\0375)
0	belong		0x2e7261fd	sound3.xpm:hotPink::$playAudio:::realaudio sound file

#------------------------------------------------------------------------------
# commands:  file(1) magic for various shells and interpreters
#
0	string		#!/bin/sh		sh_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::C-shell script text
0	string		#!\ /bin/sh		sh_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Bourne shell script text
0	string		#!/bin/csh		csh_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::C shell script text
0	string		#!\ /bin/csh		csh_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::C shell script text
# korn shell magic, sent by George Wu, gwu@clyde.att.com
0	string		#!/bin/ksh		ksh_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Korn shell script text
0	string		#!\ /bin/ksh		ksh_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Korn shell script text
0	string	 	#!/bin/tcsh		tcsh_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Tenex C shell script text
0	string	 	#!\ /bin/tcsh		tcsh_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Tenex C shell script text
0	string		#!/usr/local/tcsh	tcsh_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Tenex C shell script text
0	string	 	#!\ /usr/local/tcsh	tcsh_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Tenex C shell script text
0	string		#!/usr/local/bin/tcsh	tcsh_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Tenex C shell script text
0	string		#!\ /usr/local/bin/tcsh	tcsh_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Tenex C shell script text
#
# zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson)
0	string		#!/usr/local/bin/zsh	zsh_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Paul Falstad's zsh
0	string		#!\ /usr/local/bin/zsh	zsh_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Paul Falstad's zsh
0	string		#!/usr/local/bin/ash	ash_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Neil Brown's ash
0	string		#!\ /usr/local/bin/ash	ash_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Neil Brown's ash
0	string		#!/usr/local/bin/ae	ae_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Neil Brown's ae
0	string		#!\ /usr/local/bin/ae	ae_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Neil Brown's ae
0	string		#!/bin/nawk		nawk.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::new awk script text
0	string		#!\ /bin/nawk		nawk.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::new awk script text
0	string		#!/usr/bin/nawk		nawk.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::new awk script text
0	string		#!\ /usr/bin/nawk	nawk.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::new awk script text
0	string		#!/usr/local/bin/nawk	nawk.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::new awk script text
0	string		#!\ /usr/local/bin/nawk	nawk.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::new awk script text
0	string		#!/bin/gawk		gawk.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::GNU awk script text
0	string		#!\ /bin/gawk		gawk.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::GNU awk script text
0	string		#!/usr/bin/gawk		gawk.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::GNU awk script text
0	string		#!\ /usr/bin/gawk	gawk.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::GNU awk script text
0	string		#!/usr/local/bin/gawk	gawk.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::GNU awk script text
0	string		#!\ /usr/local/bin/gawk	gawk.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::GNU awk script text
#
0	string		#!/bin/awk		awk.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::awk commands text
0	string		#!\ /bin/awk		awk.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::awk commands text
0	string		#!/usr/bin/awk		awk.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::awk commands text
0	string		#!\ /usr/bin/awk	awk.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::awk commands text
0	string		BEGIN			awk.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::awk commands text

# For Larry Wall's perl language.  The ``eval'' line recognizes an
# outrageously clever hack for USG systems.
#				Keith Waclena <keith@cerberus.uchicago.edu>
0	string		#!/bin/perl			perl.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::perl commands text
0	string		#!\ /bin/perl			perl.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::perl commands text
0	string		eval\ "exec\ /bin/perl		perl.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::perl commands text
0	string		#!/usr/bin/perl			perl.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::perl commands text
0	string		#!\ /usr/bin/perl		perl.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::perl commands text
0	string		eval\ "exec\ /usr/bin/perl	perl.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::perl commands text
0	string		#!/usr/local/bin/perl		perl.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::perl commands text
0	string		#!\ /usr/local/bin/perl		perl.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::perl commands text
0	string		eval\ "exec\ /usr/local/bin/perl perl.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::perl commands text

# AT&T Bell Labs' Plan 9 shell
0	string		#!/bin/rc	rc.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Plan 9 rc shell script text
0	string		#!\ /bin/rc	rc.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Plan 9 rc shell script text

# bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de)
0	string		#!/bin/bash	bash_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Bourne-Again shell script text
0	string		#!\ /bin/bash	bash_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Bourne-Again shell script text
0	string		#!/usr/local/bin/bash	bash_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Bash script text
0	string		#!\ /usr/local/bin/bash bash_script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::Bash script text

# generic shell magic
0	string		#!\ /			script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::a
>3	string		>\0			script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::%s script text
0	string		#!/			script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::a
>2	string		>\0			script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::%s script text
0	string		#!\ 			script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::commands text
>3	string		>\0			script.xpm,script_s.xpm:red3:b:$edit,@view,$exec:::for %s
#------------------------------------------------------------------------------
# standard unix compress
0	string		\037\235	compressed.xpm:cyan4:i:$uncompress:::compress'd data

# gzip (GNU zip, not to be confused with Info-ZIP or PKWARE zip archiver)
0       string          \037\213        zip.xpm:cyan4:i:$ungzip:::gzip compressed data

#------------------------------------------------------------------------------
# diff:  file(1) magic for diff(1) output
#
0	string		diff\ 	        diff.xpm::i:@view:::'diff' output text
0	string		***\ 		diff.xpm::i:@view:::'diff' output text
0	string		Only\ in\ 	diff.xpm::i:@view:::'diff' output text
0	string		Common\ subdirectories:\ 	diff.xpm::i:@view:::'diff' output text

#------------------------------------------------------------------------------
# elf:  file(1) magic for ELF executables
#
# We have to check the byte order flag to see what byte order all the
# other stuff in the header is in.
#
# MIPS RS3000 may also be for MIPS RS2000.
# What're the correct byte orders for the nCUBE and the Fujitsu VPP500?
#
# updated by Daniel Quinlan (quinlan@yggdrasil.com)
0	string		\177ELF		elf.xpm:red4:b::::ELF
>4	byte		0		elf.xpm:red4:b::::invalid class
>4	byte		1		elf.xpm:red4:b::::32-bit
>4	byte		2		elf.xpm:red4:b::::64-bit
>5	byte		0		elf.xpm:red4:b::::invalid byte order
>5	byte		1		elf.xpm:red4:b::::LSB
>>16	leshort		0		elf.xpm:red4:b::::no file type,
>>16	leshort		1		elf.xpm:red4:b::::relocatable,
>>16	leshort		2		elfexec.xpm,elfexec_s.xpm:red2:b:$exec:::executable,
>>16	leshort		3		elf.xpm:red4:b::::shared object,
#------------------------------------------------------------------------------
# fonts:  file(1) magic for font data
#
0	string		FONT		font1.xpm:darkcyan:i:$edit,@view:::ASCII vfont text
0	short		0436		font1.xpm:darkcyan:i:$edit,@view:::Berkeley vfont data
0	short		017001		font1.xpm:darkcyan:i:$edit,@view:::byte-swapped Berkeley vfont data

# PostScript fonts (must precede "printer" entries), quinlan@yggdrasil.com
0	string		%!PS-AdobeFont-1.0	font.xpm:darkcyan:i:$edit,@view:::PostScript Type 1 font text
6	string		%!PS-AdobeFont-1.0	font.xpm:darkcyan:i:$edit,@view:::PostScript Type 1 font program data

# X11 font files in SNF (Server Natural Format) format
0	belong		00000004		fontX.xpm:darkcyan:i:$edit,@view:::X11 SNF font data, MSB first
0	lelong		00000004		fontX.xpm:darkcyan:i:$edit,@view:::X11 SNF font data, LSB first

# X11 Bitmap Distribution Format, from Daniel Quinlan (quinlan@yggdrasil.com)
0	string		STARTFONT\040		fontX.xpm:darkcyan:i:$edit,@view:::X11 BDF font text

# X11 fonts, from Daniel Quinlan (quinlan@yggdrasil.com)
# PCF must come before SGI additions ("MIPSEL MIPS-II COFF" collides)
0	string		\001fcp			fontX.xpm:darkcyan:i:$edit,@view:::X11 Portable Compiled Font data
0	string		D1.0\015		fontX.xpm:darkcyan:i:$edit,@view:::X11 Speedo font data

#------------------------------------------------------------------------------
# images:  file(1) magic for image formats (see also "iff")
#
# originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
# additions by janl@ifi.uio.no as well as others. Jan also suggested
# merging several one- and two-line files into here.
#
# little magic: PCX (first byte is 0x0a)
# no magic: Targa

# PBMPLUS images
# The next byte following the magic is always whitespace.
0	string		P1		pbm.xpm,xbm.xpm:::$viewImage,$edit,@setroot,@scaleSetroot:::PBM image text
0	string		P2		pgm.xpm,xbm.xpm:::$viewImage,$edit,@setroot,@scaleSetroot:::PGM image text
0	string		P3		ppm.xpm,xpm.xpm:::$viewImage,$edit,@setroot,@scaleSetroot:::PPM image text
0	string		P4		pbm.xpm,xbm.xpm:::$viewImage,@setroot,@scaleSetroot:::PBM "rawbits" image data
0	string		P5		pgm.xpm,xbm.xpm:::$viewImage,@setroot,@scaleSetroot:::PGM "rawbits" image data
0	string		P6		ppm.xpm,xpm.xpm:::$viewImage,@setroot,@scaleSetroot:::PPM "rawbits" image data

# NIFF (Navy Interchange File Format, a modification of TIFF) images
0	string		IIN1		tiff.xpm,xpm.xpm:::$viewImage,@setroot,@scaleSetroot:::NIFF image data

# Tag Image File Format, from Daniel Quinlan (quinlan@yggdrasil.com)
# The second word of TIFF files is the TIFF version number, 42, which has
# never changed.  The TIFF specification recommends testing for it.
0	string		MM\x00\x2a	ppm.xpm,xpm.xpm:::$viewImage,@setroot,@scaleSetroot:::TIFF image, big-endian
0	string		II\x2a\x00	ppm.xpm,xpm.xpm:::$viewImage,@setroot,@scaleSetroot:::TIFF image, little-endian

# PNG [Portable Network Graphics, or "PNG's Not GIF"] images
# (Greg Roelofs, newt@uchicago.edu)
#
# 137 P N G \r \n ^Z \n [4-byte length] H E A D [HEAD data] [HEAD crc] ...
#
0	string		\x89PNG		picture.xpm,prism.xpm:::$viewImage,@setroot,@scaleSetroot:::PNG image data,

# GIF
0	string		GIF8		gif.xpm,gif_s.xpm:darkmagenta::$viewImage,@setroot,@scaleSetroot:::GIF image data

# ITC (CMU WM) raster files.  It is essentially a byte-reversed Sun raster,
# 1 plane, no encoding.
0	string		\361\0\100\273	picture.xpm,prism.xpm:::$viewImage,@setroot,@scaleSetroot:::CMU window manager ...

# Magick Image File Format
0	string		id=ImageMagick	picture.xpm,prism.xpm:::$viewImage,@setroot,@scaleSetroot:::MIFF image data

# Artisan
0	long		1123028772	picture.xpm,prism.xpm:::$viewImage,@setroot,@scaleSetroot:::Artisan image data

# FIG (Facility for Interactive Generation of figures), an object-based format
0	string		#FIG		fig.xpm,xbm.xpm:blue3::$viewFig:::FIG image text

# PHIGS
0	string		ARF_BEGARF		picture.xpm,prism.xpm:::$viewImage,@setroot,@scaleSetroot:::PHIGS clear text archive
0	string		@(#)SunPHIGS		picture.xpm,prism.xpm:::$viewImage,@setroot,@scaleSetroot:::SunPHIGS
# version number follows, in the form m.n

# GKS (Graphics Kernel System)
0	string		GKSM		picture.xpm,prism.xpm:::$viewImage,@setroot,@scaleSetroot:::GKS Metafile

# CGM image files
0	string		BEGMF		clear text Computer Graphics Metafile
# XXX - questionable magic
0	beshort&0xffe0	0x0020		binary Computer Graphics Metafile
0	beshort		0x3020		character Computer Graphics Metafile

# JPEG images
# SunOS 5.5.1 had
#
#	0	string		\377\330\377\340	JPEG file
#	0	string		\377\330\377\356	JPG file
#
# both of which turn into "JPEG image data" here.
#
0	beshort		0xffd8		jpeg.xpm,jpeg_s.xpm:::$viewImage,@setroot,@scaleSetroot:::JPEG image data
# HSI is Handmade Software's proprietary JPEG encoding scheme
0	string		hsi1		jepg.xpm,jpeg_s.xpm:::$viewImage,@setroot,@scaleSetroot:::JPEG image data, HSI proprietary

# PC bitmaps (OS/2, Windoze BMP files)  (Greg Roelofs, newt@uchicago.edu)
0	string		BM		picture.xpm,xbm.xpm:::$viewImage,@setroot,@scaleSetroot:::PC bitmap data
0	string		IC		picture.xpm,xbm.xpm:::$viewImage,@setroot,@scaleSetroot:::PC icon data
0	string		PI		picture.xpm,xbm.xpm:::$viewImage,@setroot,@scaleSetroot:::PC pointer image data
0	string		CI		picture.xpm,xbm.xpm:::$viewImage,@setroot,@scaleSetroot:::PC color icon data
0	string		CP		picture.xpm,xbm.xpm:::$viewImage,@setroot,@scaleSetroot:::PC color pointer image data
# Conflicts with other entries [BABYL]

# XPM icons (Greg Roelofs, newt@uchicago.edu)
# note possible collision with C/REXX entry in c-lang; currently commented out
0	string		/*\ XPM\ */	XPM.xpm,xpm.xpm:::$viewImage,@setroot,@scaleSetroot,$edit:::X pixmap image text

# Utah Raster Toolkit RLE images (janl@ifi.uio.no)
0	leshort		0xcc52		rle.xpm,gif_s.xpm:::$viewImage,@setroot,@scaleSetroot:::RLE image data,

# Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
0	belong		0x59a66a95	ras.xpm,gif_s.xpm:::$viewImage,@setroot,@scaleSetroot:::Sun raster image data

# SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
# file://sgi.com/graphics/SGIIMAGESPEC
0	beshort		474		rgb.xpm,gif_s.xpm:::$viewImage,@setroot,@scaleSetroot:::SGI image data

0	string		IT01		picture.xpm,xbm.xpm:::$viewImage,@setroot,@scaleSetroot:::FIT image data
#
0	string		IT02		picture.xpm,xbm.xpm:::$viewImage,@setroot,@scaleSetroot:::FIT image data
#
2048	string		PCD_IPI		picture.xpm,xbm.xpm:::$viewImage,@setroot,@scaleSetroot:::Kodak Photo CD image pack file
0	string		PCD_OPA		picture.xpm,xbm.xpm:::$viewImage,@setroot,@scaleSetroot:::Kodak Photo CD overview pack file

# FITS format.  Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
# FITS is the Flexible Image Transport System, the de facto standard for
# data and image transfer, storage, etc., for the astronomical community.
# (FITS floating point formats are big-endian.)
0	string	SIMPLE\ \ =	picture.xpm,xbm.xpm:::$viewImage,@setroot,@scaleSetroot:::FITS image data

# From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image
# stuff.
#
0	beshort		0x1010		picture.xpm,xbm.xpm:::$viewImage,@setroot,@scaleSetroot:::PEX Binary Archive

# pbm:  file(1) magic for Portable Bitmap files
#
# XXX - byte order?
#
0	short	0x2a17	   pbm.xpm,xbm.xpm:::$viewImage,@setroot,@scaleSetroot:::"compact bitmap" format (Poskanzer)


#------------------------------------------------------------
# Java ByteCode
# From Larry Schwimmer (schwim@cs.stanford.edu)
0	belong		0xcafebabe     java_byte.xpm::::::
>4	belong		0x0003002d     java_byte.xpm::::::Java bytecode

#------------------------------------------------------------------------------
# lex:  file(1) magic for lex
#
#	derived empirically, your offsets may vary!
53	string		yyprevious	lex.xpm:::$edit,@view:::(from lex)

# C program text from GNU flex, from Daniel Quinlan <quinlan@yggdrasil.com>
21	string		generated\ by\ flex	lex.xpm:::$edit,@view:::C program text (from flex)
# lex description file, from Daniel Quinlan <quinlan@yggdrasil.com>
0	string		%{		lex.xpm:::$edit,@view,$lex:::lex description text

#------------------------------------------------------------------------------
# linux:  file(1) magic for Linux files
#
# Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>
# The following basic Linux magic is useful for reference, but using
# "long" magic is a better practice in order to avoid collisions.
#
0	lelong		0x00640107	penguin.xpm,penguin_s.xpm:maroon1:b::::Linux/i386 impure executable (OMAGIC)
0	lelong		0x00640108	penguin.xpm,penguin_s.xpm:maroon1:b::::Linux/i386 pure executable (NMAGIC)
0	lelong		0x0064010b	penguin.xpm,penguin_s.xpm:maroon1:b::::Linux/i386 demand-paged executable (ZMAGIC)
0	lelong		0x006400cc	penguin.xpm,penguin_s.xpm:maroon1:b::::Linux/i386 demand-paged executable (QMAGIC)

#
0	string		\007\001\000	penguin.xpm,penguin_s.xpm:maroon1:b::::Linux/i386 object file
# message catalogs, from Mitchum DSouza <m.dsouza@mrc-apu.cam.ac.uk>
0	string		*nazgul*	penguin.xpm,penguin_s.xpm:maroon1:b::::Linux compiled message catalog
# core dump file, from Bill Reynolds <bill@goshawk.lanl.gov>
216	lelong		0421		core.xpm,core_s.xpm:maroon1:b::::Linux/i386 core file
#
# LILO boot/chain loaders, from Daniel Quinlan <quinlan@yggdrasil.com>
# this can be overridden by the DOS executable (COM) entry
2	string		LILO		lilo.xpm,penguin_s.xpm:maroon1:b::::Linux/i386 LILO boot/chain loader
#
# ECOFF magic for OSF/1 and Linux (only tested under Linux though)
#
#	from Erik Troan (ewt@redhat.com) examining od dumps, so this
#		could be wrong
#      updated by David Mosberger (davidm@azstarnet.com) based on
#      GNU BFD and MIPS info found below.
#
0	leshort		0x0183		ECOFF alpha
# linux Kernel images version 1.3.80 - ?
# from Axel Kohlmeyer <akohlmey@rincewind.chemie.uni-ulm.de>
0       belong          0xb8c0078e      linux.xpm,penguin_s.xpm:maroon1:b::::Linux/x86 kernel image,
#

#------------------------------------------------------------------------------
# lisp:  file(1) magic for lisp programs
#
# various lisp types, from Daniel Quinlan (quinlan@yggdrasil.com)
0	string	;;			dot_el.xpm:purple2::$edit,@view:::Lisp/Scheme program text
# Emacs 18 - this is always correct, but not very magical.
0	string	\012(			dot_elc.xpm:purple2:::::byte-compiled Emacs-Lisp program data
# Emacs 19
0	string	;ELC\023\000\000\000	dot_elc.xpm:purple2:::::byte-compiled Emacs-Lisp program data

#------------------------------------------------------------------------------
# msdos:  file(1) magic for MS-DOS files
#

# .BAT files (Daniel Quinlan, quinlan@yggdrasil.com)
0	string	@echo\ off	dosF.xpm:::$edit,@view:::MS-DOS batch file text
# .EXE formats (Greg Roelofs, newt@uchicago.edu)
#
0	string	MZ		dosF.xpm::::::MS-DOS executable (EXE)
# miscellaneous formats
0	string		LZ	dosF.xpm::::::MS-DOS executable (built-in)

# Popular applications
2080	string	Microsoft\ Word\ 6.0\ Document	word_processor.xpm::::::
#
0	belong	0x31be0000	  word_processor.xpm::::::Microsoft Word Document
#
2080	string	Microsoft\ Excel\ 5.0\ Worksheet	%s
#
0	belong	0x00001a00	Lotus 1-2-3
#
0	belong	0x00000200 	Lotus 1-2-3

#------------------------------------------------------------------------------
# pdf:  file(1) magic for Portable Document Format
#

0	string		%PDF-		pdf.xpm:purple3::$viewPDF:::



#------------------------------------------------------------------------------
# pgp:  file(1) magic for Pretty Good Privacy
#
0       beshort         0x9900                  pgpkey.xpm::i::::PGP key public ring
0       beshort         0x9501                  pgpkey.xpm::i::::PGP key security ring
0       beshort         0x9500                  pgpkey.xpm::i::::PGP key security ring
0	beshort		0xa600			pgpkey.xpm::i::::PGP encrypted data
0       string          -----BEGIN\040PGP       pgpkey.xpm::i::::PGP armored data
>15     string          PUBLIC\040KEY\040BLOCK- pgpkey.xpm::i::::public key block
>15     string          MESSAGE-                pgpkey.xpm::i::::message
>15     string          SIGNED\040MESSAGE-      pgpkey.xpm::i::::signed message
>15     string          PGP\040SIGNATURE-       pgpkey.xpm::i::::signature

#------------------------------------------------------------------------------
# pkgadd:  file(1) magic for SysV R4 PKG Datastreams
#
0       string          #\ PaCkAgE\ DaTaStReAm  pkg Datastream (SVR4)

#------------------------------------------------------------------------------
# printer:  file(1) magic for printer-formatted files
#

# PostScript, updated by Daniel Quinlan (quinlan@yggdrasil.com)
0	string		%!		postscript.xpm,postscript_s.xpm:::$viewPS,$printPS:::PostScript document text

# Some PCs have the annoying habit of adding a ^D as a document separator
0	string		\004%!		postscript.xpm,postscript_s.xpm:::$viewPS,$printps:::PostScript document text

# HP Printer Job Language
0	string		\033%-12345X@PJL	HP Printer Job Language data
>15	string		\ ENTER\ LANGUAGE\ =
>31	string		PostScript		PostScript

# HP Printer Control Language, Daniel Quinlan (quinlan@yggdrasil.com)
0	string		\033E\033	HP PCL printer data

#------------------------------------------------------------------------------
# sgml:  file(1) magic for Standard Generalized Markup Language

# HyperText Markup Language (HTML) is an SGML document type,
# from Daniel Quinlan (quinlan@yggdrasil.com)
0	string		\<!DOCTYPE\ HTML  html.xpm,html_s.xpm:blue:i:@send2Netscape,$edit,@view:::HTML doc
0	string		\<!DOCTYPE\ html  html.xpm,html_s.xpm:blue:i:@send2Netscape,$edit,@view:::HTML doc
0	string		\<!doctype\ html  html.xpm,html_s.xpm:blue:i:@send2Netscape,$edit,@view:::HTML doc
0	string		\<!doctype\ HTML  html.xpm,html_s.xpm:blue:i:@send2Netscape,$edit,@view:::HTML doc
0	string		\<HEAD		  html.xpm,html_s.xpm:blue:i:@send2Netscape,$edit,@view:::HTML doc
0	string		\<head		  html.xpm,html_s.xpm:blue:i:@send2Netscape,$edit,@view:::HTML doc
0	string		\<TITLE		  html.xpm,html_s.xpm:blue:i:@send2Netscape,$edit,@view:::HTML doc
0	string		\<title		  html.xpm,html_s.xpm:blue:i:@send2Netscape,$edit,@view:::HTML doc
0	string		\<html		  html.xpm,html_s.xpm:blue:i:@send2Netscape,$edit,@view:::HTML doc
0	string		\<HTML		  html.xpm,html_s.xpm:blue:i:@send2Netscape,$edit,@view:::HTML doc

# SGML, mostly from rph@sq
0	string		\<!DOCTYPE	exported SGML document text
0	string		\<!doctype	exported SGML document text
0	string		\<!SUBDOC	exported SGML subdocument text
0	string		\<!subdoc	exported SGML subdocument text
0	string		\<!--		exported SGML document text

#------------------------------------------------------------------------------
# sniffer:  file(1) magic for packet captured files
#
# (We call them "tcpdump capture file(s)" for now, as "tcpdump" is
# the main program that uses that format, but there's also "tcpview",
# and there may be others in the future.)
#
0	ubelong		0xa1b2c3d4	tcpdump capture file (big-endian)
>4	beshort		x		- version %d
>6	beshort		x		\b.%d
>20	belong		0		(No link-layer encapsulation
>20	belong		1		(Ethernet
>20	belong		2		(3Mb Ethernet
>20	belong		3		(AX.25
>20	belong		4		(ProNet
>20	belong		5		(Chaos
>20	belong		6		(IEEE 802.x network
>20	belong		7		(ARCnet
>20	belong		8		(SLIP
>20	belong		9		(PPP
>20	belong		10		(FDDI
>20	belong		11		(RFC 1483 ATM
>16	belong		x		\b, capture length %d)
0	ulelong		0xa1b2c3d4	tcpdump capture file (little-endian)
>4	leshort		x		- version %d
>6	leshort		x		\b.%d
>20	lelong		0		(No link-layer encapsulation
>20	lelong		1		(Ethernet
>20	lelong		2		(3Mb Ethernet
>20	lelong		3		(AX.25
>20	lelong		4		(ProNet
>20	lelong		5		(Chaos
>20	lelong		6		(IEEE 802.x network
>20	lelong		7		(ARCnet
>20	lelong		8		(SLIP
>20	lelong		9		(PPP
>20	lelong		10		(FDDI
>20	lelong		11		(RFC 1483 ATM
>16	lelong		x		\b, capture length %d)

#------------------------------------------------------------------------------
# tex:  file(1) magic for TeX files
#
# From <conklin@talisman.kaleida.com>

# Although we may know the offset of certain text fields in TeX DVI
# and font files, we can't use them reliably because they are not
# zero terminated. [but we do anyway, christos]
0	string		\367\002	dvi.xpm:blue::$viewDVI,$printDVI:::TeX DVI File
#
0	string		\367\203	TeX generic font data
0	string		\367\131	TeX packed font data
>3	string		>\0		(%s)
0	string		\367\312	TeX virtual font data
0	string		This\ is\ TeX,	TeX transcript text
0	string		This\ is\ METAFONT,	METAFONT transcript text

# There is no way to detect TeX Font Metric (*.tfm) files without
# breaking them apart and reading the data.  The following patterns
# match most *.tfm files generated by METAFONT or afm2tfm.
2	string		\000\021	TeX font metric data
>33	string		>\0		(%s)
2	string		\000\022	TeX font metric data
>33	string		>\0		(%s)

# Texinfo and GNU Info, from Daniel Quinlan (quinlan@yggdrasil.com)
0	string		\\input\ texinfo	Texinfo source text
0	string		This\ is\ Info\ file	GNU Info text

# TeX documents, from Daniel Quinlan (quinlan@yggdrasil.com)
0	string		\\input		tex.xpm:blue::$texView,$edit,$tex,$texPrint:::TeX document text
0	string		\\section	tex.xpm:blue::$latexView,$edit,$latex,$latexPrint:::LaTeX document text
0	string		\\setlength	tex.xpm:blue::$latexView,$edit,$latex,$latexPrint:::LaTeX document text
0	string		\\documentstyle	tex.xpm:blue::$latexView,$edit,$latex,$latexPrint:::LaTeX document text
0	string		\\chapter	tex.xpm:blue::$latexView,$edit,$latex,$latexPrint:::LaTeX document text

#------------------------------------------------------------------------------
# tex:  file(1) magic for TeX files
#
# From <conklin@talisman.kaleida.com>

# Although we may know the offset of certain text fields in TeX DVI
# and font files, we can't use them reliably because they are not
# zero terminated. [but we do anyway, christos]
0	string		\367\002	dvi.xpm:blue::$viewDvi,$printDVI:::TeX DVI File
#
0	string		\367\203	TeX generic font data
0	string		\367\131	TeX packed font data
>3	string		>\0		(%s)
0	string		\367\312	TeX virtual font data
0	string		This\ is\ TeX,	TeX transcript text
0	string		This\ is\ METAFONT,	METAFONT transcript text

# There is no way to detect TeX Font Metric (*.tfm) files without
# breaking them apart and reading the data.  The following patterns
# match most *.tfm files generated by METAFONT or afm2tfm.
2	string		\000\021	TeX font metric data
>33	string		>\0		(%s)
2	string		\000\022	TeX font metric data
>33	string		>\0		(%s)

# Texinfo and GNU Info, from Daniel Quinlan (quinlan@yggdrasil.com)
0	string		\\input\ texinfo	Texinfo source text
0	string		This\ is\ Info\ file	GNU Info text

# TeX documents, from Daniel Quinlan (quinlan@yggdrasil.com)
0	string		\\input		tex.xpm:blue::$tex:::TeX document text
0	string		\\section	tex.xpm:blue::$latex:::LaTeX document text
0	string		\\setlength	tex.xpm:blue::$latex:::LaTeX document text
0	string		\\documentstyle	tex.xpm:blue::$latex:::LaTeX document text
0	string		\\chapter	tex.xpm:blue::$latex:::LaTeX document text

#------------------------------------------------------------------------------
# timezone:  file(1) magic for timezone data
#
# from Daniel Quinlan (quinlan@yggdrasil.com)
# this should work on Linux, SunOS, and maybe others
0	string	\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0	timezone data
0	string	\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0	timezone data
0	string  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\0	timezone data
0	string	\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0	timezone data
0	string	\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0	timezone data
0	string	\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0	timezone data

#------------------------------------------------------------------------------
# troff:  file(1) magic for *roff
#
# updated by Daniel Quinlan (quinlan@yggdrasil.com)

# troff input
0	string		.\\"		troff or preprocessor input text
0	string		'\\"		troff or preprocessor input text
0	string		'.\\"		troff or preprocessor input text
0	string		\\"		troff or preprocessor input text

# ditroff intermediate output text
0	string		x\ T		ditroff text
>4	string		cat		for the C/A/T phototypesetter
>4	string		ps		for PostScript
>4	string		dvi		for DVI
>4	string		ascii		for ASCII
>4	string		lj4		for LaserJet 4
>4	string		latin1		for ISO 8859-1 (Latin 1)
>4	string		X75		for xditview at 75dpi
>>7	string		-12		(12pt)
>4	string		X100		for xditview at 100dpi
>>8	string		-12		(12pt)

# output data formats
0	string		\100\357	very old (C/A/T) troff output data

#------------------------------------------------------------------------------
# uuencode:  file(1) magic for ASCII-encoded files
#

# GRR:  the first line of xxencoded files is identical to that in uuencoded
# files, but the first character in most subsequent lines is 'h' instead of
# 'M'.  (xxencoding uses lowercase letters in place of most of uuencode's
# punctuation and survives BITNET gateways better.)  If regular expressions
# were supported, this entry could possibly be split into two with
# "begin\040\.\*\012M" or "begin\040\.\*\012h" (where \. and \* are REs).
0       string          begin\040       uu.xpm:red::$uudecode::::uuencoded or xxencoded text

# btoa(1) is an alternative to uuencode that requires less space.
0	string		xbtoa\ Begin	btoa'd text

# ship(1) is another, much cooler alternative to uuencode.
# Greg Roelofs, newt@uchicago.edu
0	string		$\012ship	ship'd binary text

# bencode(8) is used to encode compressed news batches (Bnews/Cnews only?)
# Greg Roelofs, newt@uchicago.edu
0	string	Decode\ the\ following\ with\ bdeco	bencoded News text

# BinHex is the Macintosh ASCII-encoded file format (see also "apple")
# Daniel Quinlan, quinlan@yggdrasil.com
11	string	must\ be\ converted\ with\ BinHex	BinHex binary text
>41	string	x					\b, version %.3s

# GRR:  is MIME BASE64 encoding handled somewhere?

#------------------------------------------------------------------------------
# ZIP archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
0	string		PK\003\004	zip.xpm,zip_s.xpm:purple2::$unzip,$edit:::Zip archive data
