macintosh revision 68349
1
2#------------------------------------------------------------------------------
3# macintosh description
4#
5# BinHex is the Macintosh ASCII-encoded file format (see also "apple")
6# Daniel Quinlan, quinlan@yggdrasil.com
711	string	must\ be\ converted\ with\ BinHex	BinHex binary text
8>41	string	x					\b, version %.3s
9
10# Stuffit archives are the de facto standard of compression for Macintosh
11# files obtained from most archives. (franklsm@tuns.ca)
120	string		SIT!			StuffIt Archive (data)
13>2	string		x			: %s
140	string		SITD			StuffIt Deluxe (data)
15>2	string		x			: %s
160	string		Seg			StuffIt Deluxe Segment (data)
17>2	string		x			: %s
18
19# Macintosh Applications and Installation binaries (franklsm@tuns.ca)
200	string		APPL			Macintosh Application (data)
21>2	string		x			\b: %s
22
23# Macintosh System files (franklsm@tuns.ca)
240	string		zsys			Macintosh System File (data)
250	string		FNDR			Macintosh Finder (data)
260	string		libr			Macintosh Library (data)
27>2	string		x			: %s
280	string		shlb			Macintosh Shared Library (data)
29>2	string		x			: %s
300	string		cdev			Macintosh Control Panel (data)
31>2	string		x			: %s
320	string		INIT			Macintosh Extension (data)
33>2	string		x			: %s
340	string		FFIL			Macintosh Truetype Font (data)
35>2	string		x			: %s
360	string		LWFN			Macintosh Postscript Font (data)
37>2	string		x			: %s
38
39# Additional Macintosh Files (franklsm@tuns.ca)
400	string		PACT			Macintosh Compact Pro Archive (data)
41>2	string		x			: %s
420	string		ttro			Macintosh TeachText File (data)
43>2	string		x			: %s
440	string		TEXT			Macintosh TeachText File (data)
45>2	string		x			: %s
460	string		PDF			Macintosh PDF File (data)
47>2	string		x			: %s
48
49# MacBinary format (Eric Fischer, enf@pobox.com)
50#
51# Unfortunately MacBinary doesn't really have a magic number prior
52# to the MacBinary III format.  The checksum is really the way to
53# do it, but the magic file format isn't up to the challenge.
54#
55# 0	byte		0
56# 1	byte				# filename length
57# 2	string				# filename
58# 65    string				# file type
59# 69	string				# file creator
60# 73	byte				# Finder flags
61# 74	byte		0
62# 75	beshort				# vertical posn in window
63# 77	beshort				# horiz posn in window
64# 79	beshort				# window or folder ID
65# 81    byte				# protected?
66# 82	byte		0
67# 83	belong				# length of data segment
68# 87	belong				# length of resource segment
69# 91	belong				# file creation date
70# 95	belong				# file modification date
71# 99	beshort				# length of comment after resource
72# 101	byte				# new Finder flags
73# 102	string		mBIN		# (only in MacBinary III)
74# 106	byte				# char. code of file name
75# 107	byte				# still more Finder flags
76# 116	belong				# total file length
77# 120	beshort				# length of add'l header
78# 122	byte		129		# for MacBinary II
79# 122	byte		130		# for MacBinary III
80# 123	byte		129		# minimum version that can read fmt
81# 124	beshort				# checksum
82#
83# This attempts to use the version numbers as a magic number, requiring
84# that the first one be 0x80, 0x81, 0x82, or 0x83, and that the second
85# be 0x81.  This works for the files I have, but maybe not for everyone's.
86
87122	beshort&0xFCFF	0x8081		Macintosh MacBinary data
88
89# MacBinary I doesn't have the version number field at all, but MacBinary II
90# has been in use since 1987 so I hope there aren't many really old files
91# floating around that this will miss.  The original spec calls for using
92# the nulls in 0, 74, and 82 as the magic number.
93#
94# Another possibility, that would also work for MacBinary I, is to use
95# the assumption that 65-72 will all be ASCII (0x20-0x7F), that 73 will
96# have bits 1 (changed), 2 (busy), 3 (bozo), and 6 (invisible) unset,
97# and that 74 will be 0.  So something like
98# 
99# 71 	belong&0x80804EFF 0x00000000 	Macintosh MacBinary data
100# 
101# >73	byte&0x01	0x01		\b, inited
102# >73	byte&0x02	0x02		\b, changed
103# >73	byte&0x04	0x04		\b, busy
104# >73	byte&0x08	0x08		\b, bozo
105# >73	byte&0x10	0x10		\b, system
106# >73	byte&0x10	0x20		\b, bundle
107# >73	byte&0x10	0x40		\b, invisible
108# >73	byte&0x10	0x80		\b, locked
109
110>65	string		x		\b, type "%4.4s"
111
112>65	string		8BIM		(PhotoShop)
113>65	string		ALB3		(PageMaker 3)
114>65	string		ALB4		(PageMaker 4)
115>65	string		ALT3		(PageMaker 3)
116>65	string		APPL		(application)
117>65	string		AWWP		(AppleWorks word processor)
118>65	string		CIRC		(simulated circuit)
119>65	string		DRWG		(MacDraw)
120>65	string		EPSF		(Encapsulated PostScript)
121>65	string		FFIL		(font suitcase)
122>65	string		FKEY		(function key)
123>65	string		FNDR		(Macintosh Finder)
124>65	string		GIFf		(GIF image)
125>65	string		Gzip		(GNU gzip)
126>65	string		INIT		(system extension)
127>65	string		LIB\ 		(library)
128>65	string		LWFN		(PostScript font)
129>65	string		MSBC		(Microsoft BASIC)
130>65	string		PACT		(Compact Pro archive)
131>65	string		PDF\ 		(Portable Document Format)
132>65	string		PICT		(picture)
133>65	string		PNTG		(MacPaint picture)
134>65	string		PREF		(preferences)
135>65	string		PROJ		(Think C project)
136>65	string		QPRJ		(Think Pascal project)
137>65	string		SCFL		(Defender scores)
138>65	string		SCRN		(startup screen)
139>65	string		SITD		(StuffIt Deluxe)
140>65	string		SPn3		(SuperPaint)
141>65	string		STAK		(HyperCard stack)
142>65	string		Seg\ 		(StuffIt segment)
143>65	string		TARF		(Unix tar archive)
144>65	string		TEXT		(ASCII)
145>65	string		TIFF		(TIFF image)
146>65	string		TOVF		(Eudora table of contents)
147>65	string		WDBN		(Microsoft Word word processor)
148>65	string		WORD		(MacWrite word processor)
149>65	string		XLS\ 		(Microsoft Excel)
150>65	string		ZIVM		(compress (.Z))
151>65	string		ZSYS		(Pre-System 7 system file)
152>65	string		acf3		(Aldus FreeHand)
153>65	string		cdev		(control panel)
154>65	string		dfil		(Desk Acessory suitcase)
155>65	string		libr		(library)
156>65	string		nX^d		(WriteNow word processor)
157>65	string		nX^w		(WriteNow dictionary)
158>65	string		rsrc		(resource)
159>65	string		scbk		(Scrapbook)
160>65	string		shlb		(shared library)
161>65	string		ttro		(SimpleText read-only)
162>65	string		zsys		(system file)
163
164>69	string		x		\b, creator "%4.4s"
165
166# Somewhere, Apple has a repository of registered Creator IDs.  These are
167# just the ones that I happened to have files from and was able to identify.
168
169>69	string		8BIM		(Adobe Photoshop)
170>69	string		ALD3		(PageMaker 3)
171>69	string		ALD4		(PageMaker 4)
172>69	string		ALFA		(Alpha editor)
173>69	string		APLS		(Apple Scanner)
174>69	string		APSC		(Apple Scanner)
175>69	string		BRKL		(Brickles)
176>69	string		BTFT		(BitFont)
177>69	string		CCL2 		(Common Lisp 2)
178>69	string		CCL\ 		(Common Lisp)
179>69	string		CDmo		(The Talking Moose)
180>69	string		CPCT		(Compact Pro)
181>69	string		CSOm		(Eudora)
182>69	string		DMOV		(Font/DA Mover)
183>69	string		DSIM		(DigSim)
184>69	string		EDIT		(Macintosh Edit)
185>69	string		ERIK		(Macintosh Finder)
186>69	string		EXTR		(self-extracting archive)
187>69	string		Gzip		(GNU gzip)
188>69	string		KAHL		(Think C)
189>69	string		LWFU		(LaserWriter Utility)
190>69	string		LZIV		(compress)
191>69	string		MACA		(MacWrite)
192>69	string		MACS		(Macintosh operating system)
193>69	string		MAcK		(MacKnowledge terminal emulator)
194>69	string		MLND		(Defender)
195>69	string		MPNT		(MacPaint)
196>69	string		MSBB		(Microsoft BASIC (binary))
197>69	string		MSWD		(Microsoft Word)
198>69	string		NCSA		(NCSA Telnet)
199>69	string		PJMM		(Think Pascal)
200>69	string		PSAL		(Hunt the Wumpus)
201>69	string		PSI2		(Apple File Exchange)
202>69	string		R*ch		(BBEdit)
203>69	string		RMKR		(Resource Maker)
204>69	string		RSED		(Resource Editor)
205>69	string		Rich		(BBEdit)
206>69	string		SIT!		(StuffIt)
207>69	string		SPNT		(SuperPaint)
208>69	string		Unix		(NeXT Mac filesystem)
209>69	string		VIM!		(Vim editor)
210>69	string		WILD		(HyperCard)
211>69	string		XCEL		(Microsoft Excel)
212>69	string		aCa2		(Fontographer)
213>69	string		aca3		(Aldus FreeHand)
214>69	string		dosa		(Macintosh MS-DOS file system)
215>69	string		movr		(Font/DA Mover)
216>69	string		nX^n		(WriteNow)
217>69	string		pdos		(Apple ProDOS file system)
218>69	string		scbk		(Scrapbook)
219>69	string		ttxt		(SimpleText)
220>69	string		ufox		(Foreign File Access)
221
222# Just in case...
223
224102	string		mBIN		MacBinary III data with surprising version number
225