xref: /freebsd/contrib/file/magic/Magdir/mathematica (revision b6cee71de37d56e36dbc118e2d9b03e7cece5709)
1*b6cee71dSXin LI
2*b6cee71dSXin LI#------------------------------------------------------------------------------
3*b6cee71dSXin LI# $File: mathematica,v 1.7 2009/09/19 16:28:10 christos Exp $
4*b6cee71dSXin LI# mathematica:  file(1) magic for mathematica files
5*b6cee71dSXin LI# "H. Nanosecond" <aldomel@ix.netcom.com>
6*b6cee71dSXin LI# Mathematica a multi-purpose math program
7*b6cee71dSXin LI# versions 2.2 and 3.0
8*b6cee71dSXin LI
9*b6cee71dSXin LI#mathematica .mb
10*b6cee71dSXin LI0	string	\064\024\012\000\035\000\000\000	Mathematica version 2 notebook
11*b6cee71dSXin LI0	string	\064\024\011\000\035\000\000\000	Mathematica version 2 notebook
12*b6cee71dSXin LI
13*b6cee71dSXin LI# .ma
14*b6cee71dSXin LI# multiple possibilites:
15*b6cee71dSXin LI
16*b6cee71dSXin LI0	string	(*^\n\n::[\011frontEndVersion\ =\ 	Mathematica notebook
17*b6cee71dSXin LI#>41	string	>\0	%s
18*b6cee71dSXin LI
19*b6cee71dSXin LI#0	string	(*^\n\n::[\011palette	Mathematica notebook version 2.x
20*b6cee71dSXin LI
21*b6cee71dSXin LI#0	string	(*^\n\n::[\011Information	Mathematica notebook version 2.x
22*b6cee71dSXin LI#>675	string	>\0	%s #doesn't work well
23*b6cee71dSXin LI
24*b6cee71dSXin LI# there may be 'cr' instread of 'nl' in some does this matter?
25*b6cee71dSXin LI
26*b6cee71dSXin LI# generic:
27*b6cee71dSXin LI0	string	(*^\r\r::[\011	Mathematica notebook version 2.x
28*b6cee71dSXin LI0	string	(*^\r\n\r\n::[\011	Mathematica notebook version 2.x
29*b6cee71dSXin LI0	string	(*^\015			Mathematica notebook version 2.x
30*b6cee71dSXin LI0	string	(*^\n\r\n\r::[\011	Mathematica notebook version 2.x
31*b6cee71dSXin LI0	string	(*^\r::[\011	Mathematica notebook version 2.x
32*b6cee71dSXin LI0	string	(*^\r\n::[\011	Mathematica notebook version 2.x
33*b6cee71dSXin LI0	string	(*^\n\n::[\011	Mathematica notebook version 2.x
34*b6cee71dSXin LI0	string	(*^\n::[\011	Mathematica notebook version 2.x
35*b6cee71dSXin LI
36*b6cee71dSXin LI
37*b6cee71dSXin LI# Mathematica .mx files
38*b6cee71dSXin LI
39*b6cee71dSXin LI#0	string	(*This\ is\ a\ Mathematica\ binary\ dump\ file.\ It\ can\ be\ loaded\ with\ Get.*)	Mathematica binary file
40*b6cee71dSXin LI0	string	(*This\ is\ a\ Mathematica\ binary\ 	Mathematica binary file
41*b6cee71dSXin LI#>71	string \000\010\010\010\010\000\000\000\000\000\000\010\100\010\000\000\000
42*b6cee71dSXin LI# >71... is optional
43*b6cee71dSXin LI>88	string	>\0	from %s
44*b6cee71dSXin LI
45*b6cee71dSXin LI
46*b6cee71dSXin LI# Mathematica files PBF:
47*b6cee71dSXin LI# 115 115 101 120 102 106 000 001 000 000 000 203 000 001 000
48*b6cee71dSXin LI0	string	MMAPBF\000\001\000\000\000\203\000\001\000	Mathematica PBF (fonts I think)
49*b6cee71dSXin LI
50*b6cee71dSXin LI# .ml files  These are menu resources I think
51*b6cee71dSXin LI# these start with "[0-9][0-9][0-9]\ A~[0-9][0-9][0-9]\
52*b6cee71dSXin LI# how to put that into a magic rule?
53*b6cee71dSXin LI4	string	\ A~	MAthematica .ml file
54*b6cee71dSXin LI
55*b6cee71dSXin LI# .nb files
56*b6cee71dSXin LI#too long 0	string	(***********************************************************************\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Mathematica-Compatible Notebook	Mathematica 3.0 notebook
57*b6cee71dSXin LI0	string	(***********************	Mathematica 3.0 notebook
58*b6cee71dSXin LI
59*b6cee71dSXin LI# other (* matches it is a comment start in these langs
60*b6cee71dSXin LI# GRR: Too weak; also matches other languages e.g. ML
61*b6cee71dSXin LI#0	string	(*	Mathematica, or Pascal, Modula-2 or 3 code text
62*b6cee71dSXin LI
63*b6cee71dSXin LI#########################
64*b6cee71dSXin LI# MatLab v5
65*b6cee71dSXin LI0       string  MATLAB  Matlab v5 mat-file
66*b6cee71dSXin LI>126    short   0x494d  (big endian)
67*b6cee71dSXin LI>>124   beshort x       version 0x%04x
68*b6cee71dSXin LI>126    short   0x4d49  (little endian)
69*b6cee71dSXin LI>>124   leshort x       version 0x%04x
70*b6cee71dSXin LI
71