head	1.4;
access;
symbols
	netbsd-11-0-RC4:1.4
	netbsd-11-0-RC3:1.4
	netbsd-11-0-RC2:1.4
	netbsd-11-0-RC1:1.4
	perseant-exfatfs-base-20250801:1.4
	netbsd-11:1.4.0.4
	netbsd-11-base:1.4
	netbsd-10-1-RELEASE:1.3
	perseant-exfatfs-base-20240630:1.4
	perseant-exfatfs:1.4.0.2
	perseant-exfatfs-base:1.4
	netbsd-8-3-RELEASE:1.1.1.6
	netbsd-9-4-RELEASE:1.1.1.9
	netbsd-10-0-RELEASE:1.3
	netbsd-10-0-RC6:1.3
	netbsd-10-0-RC5:1.3
	netbsd-10-0-RC4:1.3
	netbsd-10-0-RC3:1.3
	netbsd-10-0-RC2:1.3
	netbsd-10-0-RC1:1.3
	FILE5_45:1.1.1.14
	netbsd-10:1.3.0.2
	netbsd-10-base:1.3
	FILE5_43:1.1.1.13
	netbsd-9-3-RELEASE:1.1.1.9
	cjep_sun2x-base1:1.2
	cjep_sun2x:1.2.0.4
	cjep_sun2x-base:1.2
	cjep_staticlib_x-base1:1.2
	netbsd-9-2-RELEASE:1.1.1.9
	cjep_staticlib_x:1.2.0.2
	cjep_staticlib_x-base:1.2
	FILE5_40:1.1.1.12
	netbsd-9-1-RELEASE:1.1.1.9
	FILE5_39:1.1.1.11
	phil-wifi-20200421:1.1.1.10
	phil-wifi-20200411:1.1.1.10
	is-mlppp:1.1.1.10.0.2
	is-mlppp-base:1.1.1.10
	phil-wifi-20200406:1.1.1.10
	netbsd-8-2-RELEASE:1.1.1.6
	netbsd-9-0-RELEASE:1.1.1.9
	netbsd-9-0-RC2:1.1.1.9
	FILE5_38:1.1.1.10
	netbsd-9-0-RC1:1.1.1.9
	phil-wifi-20191119:1.1.1.9
	netbsd-9:1.1.1.9.0.2
	netbsd-9-base:1.1.1.9
	phil-wifi-20190609:1.1.1.9
	netbsd-8-1-RELEASE:1.1.1.6
	FILE5_37:1.1.1.9
	netbsd-8-1-RC1:1.1.1.6
	pgoyette-compat-merge-20190127:1.1.1.7.2.1
	pgoyette-compat-20190127:1.1.1.8
	pgoyette-compat-20190118:1.1.1.8
	pgoyette-compat-1226:1.1.1.8
	pgoyette-compat-1126:1.1.1.8
	pgoyette-compat-1020:1.1.1.8
	FILE5_35:1.1.1.8
	pgoyette-compat-0930:1.1.1.7
	pgoyette-compat-0906:1.1.1.7
	netbsd-7-2-RELEASE:1.1.1.5
	pgoyette-compat-0728:1.1.1.7
	netbsd-8-0-RELEASE:1.1.1.6
	phil-wifi:1.1.1.7.0.4
	phil-wifi-base:1.1.1.7
	pgoyette-compat-0625:1.1.1.7
	netbsd-8-0-RC2:1.1.1.6
	pgoyette-compat-0521:1.1.1.7
	pgoyette-compat-0502:1.1.1.7
	pgoyette-compat-0422:1.1.1.7
	netbsd-8-0-RC1:1.1.1.6
	FILE5_33:1.1.1.7
	pgoyette-compat-0415:1.1.1.7
	pgoyette-compat-0407:1.1.1.7
	pgoyette-compat-0330:1.1.1.7
	pgoyette-compat-0322:1.1.1.7
	pgoyette-compat-0315:1.1.1.7
	netbsd-7-1-2-RELEASE:1.1.1.5
	pgoyette-compat:1.1.1.7.0.2
	pgoyette-compat-base:1.1.1.7
	netbsd-7-1-1-RELEASE:1.1.1.5
	matt-nb8-mediatek:1.1.1.6.0.6
	matt-nb8-mediatek-base:1.1.1.6
	FILE5_32:1.1.1.7
	perseant-stdc-iso10646:1.1.1.6.0.4
	perseant-stdc-iso10646-base:1.1.1.6
	netbsd-8:1.1.1.6.0.2
	netbsd-8-base:1.1.1.6
	FILE5_31:1.1.1.6
	prg-localcount2-base3:1.1.1.5
	prg-localcount2-base2:1.1.1.5
	prg-localcount2-base1:1.1.1.5
	prg-localcount2:1.1.1.5.0.14
	prg-localcount2-base:1.1.1.5
	pgoyette-localcount-20170426:1.1.1.5
	bouyer-socketcan-base1:1.1.1.5
	pgoyette-localcount-20170320:1.1.1.5
	netbsd-7-1:1.1.1.5.0.12
	netbsd-7-1-RELEASE:1.1.1.5
	netbsd-7-1-RC2:1.1.1.5
	FILE5_30:1.1.1.5
	netbsd-7-nhusb-base-20170116:1.1.1.5
	bouyer-socketcan:1.1.1.5.0.10
	bouyer-socketcan-base:1.1.1.5
	pgoyette-localcount-20170107:1.1.1.5
	netbsd-7-1-RC1:1.1.1.5
	pgoyette-localcount-20161104:1.1.1.5
	netbsd-7-0-2-RELEASE:1.1.1.5
	localcount-20160914:1.1.1.5
	netbsd-7-nhusb:1.1.1.5.0.8
	netbsd-7-nhusb-base:1.1.1.5
	pgoyette-localcount-20160806:1.1.1.5
	pgoyette-localcount-20160726:1.1.1.5
	pgoyette-localcount:1.1.1.5.0.6
	pgoyette-localcount-base:1.1.1.5
	netbsd-7-0-1-RELEASE:1.1.1.5
	netbsd-7-0:1.1.1.5.0.4
	netbsd-7-0-RELEASE:1.1.1.5
	netbsd-7-0-RC3:1.1.1.5
	netbsd-7-0-RC2:1.1.1.5
	netbsd-7-0-RC1:1.1.1.5
	FILE5_22:1.1.1.5
	FILE5_20:1.1.1.5
	netbsd-6-0-6-RELEASE:1.1.1.2.6.1
	netbsd-6-1-5-RELEASE:1.1.1.2.6.1
	netbsd-7:1.1.1.5.0.2
	netbsd-7-base:1.1.1.5
	FILE5_19:1.1.1.5
	yamt-pagecache-base9:1.1.1.4
	yamt-pagecache-tag8:1.1.1.2.4.1
	netbsd-6-1-4-RELEASE:1.1.1.2.6.1
	netbsd-6-0-5-RELEASE:1.1.1.2.6.1
	tls-earlyentropy:1.1.1.4.0.2
	tls-earlyentropy-base:1.1.1.5
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.4
	riastradh-drm2-base3:1.1.1.4
	netbsd-6-1-3-RELEASE:1.1.1.2.6.1
	netbsd-6-0-4-RELEASE:1.1.1.2.6.1
	FILE5_16:1.1.1.4
	netbsd-6-1-2-RELEASE:1.1.1.2.6.1
	netbsd-6-0-3-RELEASE:1.1.1.2.6.1
	netbsd-6-1-1-RELEASE:1.1.1.2.6.1
	riastradh-drm2-base2:1.1.1.3
	riastradh-drm2-base1:1.1.1.3
	riastradh-drm2:1.1.1.3.0.4
	riastradh-drm2-base:1.1.1.3
	netbsd-6-1:1.1.1.2.6.1.0.6
	netbsd-6-0-2-RELEASE:1.1.1.2.6.1
	netbsd-6-1-RELEASE:1.1.1.2.6.1
	khorben-n900:1.1.1.3.0.8
	netbsd-6-1-RC4:1.1.1.2.6.1
	netbsd-6-1-RC3:1.1.1.2.6.1
	agc-symver:1.1.1.3.0.6
	agc-symver-base:1.1.1.3
	FILE5_14:1.1.1.3
	netbsd-6-1-RC2:1.1.1.2.6.1
	netbsd-6-1-RC1:1.1.1.2.6.1
	yamt-pagecache-base8:1.1.1.3
	FILE_5_12:1.1.1.3
	netbsd-6-0-1-RELEASE:1.1.1.2.6.1
	yamt-pagecache-base7:1.1.1.3
	matt-nb6-plus-nbase:1.1.1.2.6.1
	yamt-pagecache-base6:1.1.1.3
	netbsd-6-0:1.1.1.2.6.1.0.4
	netbsd-6-0-RELEASE:1.1.1.2.6.1
	netbsd-6-0-RC2:1.1.1.2.6.1
	tls-maxphys:1.1.1.3.0.2
	tls-maxphys-base:1.1.1.5
	matt-nb6-plus:1.1.1.2.6.1.0.2
	matt-nb6-plus-base:1.1.1.2.6.1
	netbsd-6-0-RC1:1.1.1.2.6.1
	yamt-pagecache-base5:1.1.1.3
	yamt-pagecache-base4:1.1.1.3
	FILE5_11:1.1.1.3
	netbsd-6:1.1.1.2.0.6
	netbsd-6-base:1.1.1.2
	yamt-pagecache-base3:1.1.1.2
	yamt-pagecache-base2:1.1.1.2
	yamt-pagecache:1.1.1.2.0.4
	yamt-pagecache-base:1.1.1.2
	FILE5_09:1.1.1.2
	cherry-xenmp:1.1.1.2.0.2
	cherry-xenmp-base:1.1.1.2
	FILE5_07:1.1.1.2
	bouyer-quota2-nbase:1.1.1.1
	bouyer-quota2:1.1.1.1.0.4
	bouyer-quota2-base:1.1.1.1
	matt-mips64-premerge-20101231:1.1.1.1
	matt-premerge-20091211:1.1.1.1
	jym-xensuspend-base:1.1.1.1
	jym-xensuspend:1.1.1.1.0.2
	jym-xensuspend-nbase:1.1.1.1
	FILE5_03:1.1.1.1
	CHRISTOS:1.1.1;
locks; strict;
comment	@# @;


1.4
date	2023.08.18.19.00.10;	author christos;	state Exp;
branches;
next	1.3;
commitid	MBLVQLzqzmQ7IiBE;

1.3
date	2022.09.24.20.21.46;	author christos;	state Exp;
branches;
next	1.2;
commitid	zJ5LoIcubBSIH9VD;

1.2
date	2021.04.09.19.11.41;	author christos;	state Exp;
branches;
next	1.1;
commitid	hKe2GL3vw8SVrEOC;

1.1
date	2009.05.08.16.35.07;	author christos;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2009.05.08.16.35.07;	author christos;	state Exp;
branches
	1.1.1.1.2.1;
next	1.1.1.2;

1.1.1.2
date	2011.05.12.20.46.58;	author christos;	state Exp;
branches
	1.1.1.2.4.1
	1.1.1.2.6.1;
next	1.1.1.3;

1.1.1.3
date	2012.02.22.17.48.30;	author christos;	state Exp;
branches
	1.1.1.3.2.1;
next	1.1.1.4;

1.1.1.4
date	2013.12.01.19.28.18;	author christos;	state Exp;
branches
	1.1.1.4.2.1;
next	1.1.1.5;
commitid	RVQIxe3FpM3lSsfx;

1.1.1.5
date	2014.06.13.01.48.24;	author christos;	state Exp;
branches;
next	1.1.1.6;
commitid	jtTYsE5FmJU6MiEx;

1.1.1.6
date	2017.05.24.23.59.57;	author christos;	state Exp;
branches;
next	1.1.1.7;
commitid	WbyOU2LBE5qOyHSz;

1.1.1.7
date	2017.09.08.13.22.42;	author christos;	state Exp;
branches
	1.1.1.7.2.1
	1.1.1.7.4.1;
next	1.1.1.8;
commitid	Hp7DmePhD4aVAo6A;

1.1.1.8
date	2018.10.18.23.54.09;	author christos;	state Exp;
branches;
next	1.1.1.9;
commitid	e8WctwerBeEm4vWA;

1.1.1.9
date	2019.05.22.17.19.57;	author christos;	state Exp;
branches;
next	1.1.1.10;
commitid	VXeNRYYruN1MWdoB;

1.1.1.10
date	2019.12.17.02.23.53;	author christos;	state Exp;
branches;
next	1.1.1.11;
commitid	vqYTz60fS9PNg0PB;

1.1.1.11
date	2020.06.15.00.18.48;	author christos;	state Exp;
branches;
next	1.1.1.12;
commitid	HMbuXSjPojU5LfcC;

1.1.1.12
date	2021.04.09.18.58.01;	author christos;	state Exp;
branches;
next	1.1.1.13;
commitid	W9ddLLbSkHHinEOC;

1.1.1.13
date	2022.09.24.20.07.53;	author christos;	state Exp;
branches;
next	1.1.1.14;
commitid	Nf6F9kcpc0EPC9VD;

1.1.1.14
date	2023.08.18.18.36.50;	author christos;	state Exp;
branches;
next	;
commitid	IX26ghc1E2S0AiBE;

1.1.1.1.2.1
date	2009.05.08.16.35.07;	author jym;	state dead;
branches;
next	1.1.1.1.2.2;

1.1.1.1.2.2
date	2009.05.13.18.51.55;	author jym;	state Exp;
branches;
next	;

1.1.1.2.4.1
date	2012.04.17.00.03.08;	author yamt;	state Exp;
branches;
next	1.1.1.2.4.2;

1.1.1.2.4.2
date	2014.05.22.15.44.59;	author yamt;	state Exp;
branches;
next	;
commitid	tYJXbWAuFvTh7yBx;

1.1.1.2.6.1
date	2012.03.07.23.18.25;	author riz;	state Exp;
branches;
next	;

1.1.1.3.2.1
date	2014.08.19.23.46.47;	author tls;	state Exp;
branches;
next	;
commitid	jTnpym9Qu0o4R1Nx;

1.1.1.4.2.1
date	2014.08.10.07.07.10;	author tls;	state Exp;
branches;
next	;
commitid	b1wUlsZGswrdGMLx;

1.1.1.7.2.1
date	2018.10.20.06.58.20;	author pgoyette;	state Exp;
branches;
next	;
commitid	mTSoqZEZ4arHnFWA;

1.1.1.7.4.1
date	2019.06.10.21.44.46;	author christos;	state Exp;
branches;
next	1.1.1.7.4.2;
commitid	jtc8rnCzWiEEHGqB;

1.1.1.7.4.2
date	2020.04.08.14.04.04;	author martin;	state Exp;
branches;
next	;
commitid	Qli2aW9E74UFuA3C;


desc
@@


1.4
log
@merge conflicts between file-5.43 and file-5.45
@
text
@
#------------------------------------------------------------------------------
# $File: cad,v 1.31 2022/12/09 15:36:23 christos Exp $
# autocad:  file(1) magic for cad files
#

# Microstation DGN/CIT Files (www.bentley.com)
# Last updated July 29, 2005 by Lester Hightower
# DGN is the default file extension of Microstation/Intergraph CAD files.
# CIT is the proprietary raster format (similar to TIFF) used to attach
# raster underlays to Microstation DGN (vector) drawings.
#
# http://www.wotsit.org/search.asp
# https://filext.com/detaillist.php?extdetail=DGN
# https://filext.com/detaillist.php?extdetail=CIT
#
# https://www.bentley.com/products/default.cfm?objectid=97F351F5-9C35-4E5E-89C2
# 3F86C928&method=display&p_objectid=97F351F5-9C35-4E5E-89C280A93F86C928
# https://www.bentley.com/products/default.cfm?objectid=A5C2FD43-3AC9-4C71-B682
# 721C479F&method=display&p_objectid=A5C2FD43-3AC9-4C71-B682C7BE721C479F
# 
# URL:		https://en.wikipedia.org/wiki/MicroStation
# reference:	http://dgnlib.maptools.org/dgn.html
#		http://dgnlib.maptools.org/dl/ref18.pdf
# Update:	Joerg Jenderek
# Note: verfied by command like `dgndump seed2d_b.dgn`
# test for level 8 and type 5 or 9
0	beshort&0x3F73	0x0801
# level of element like 8
#>0	ubyte&0x3F	x			\b, level %u
#>0	ubyte		&0x80			\b, complex
#>0	ubyte		&0x40			\b, reserved
# type of element 9~TCB 8~Digitizer setup 5~Group Data Elements
#>1	ubyte&0x7F	x			\b, type %u
# words to follow in element: 17H~CEL library 2FEh~DGN 9FEh,DFEh~CIT
#>2	uleshort	x			\b, words %#4.4x to follow
# test for 3 reserved 0 bytes in CIT or "conversion" in ViewInfo structure (DGN CEL)
#>508	ubelong		x			\b, RESERVED %8.8x
>508	ubelong&0xFFffFF00	=0
# test for level 8 and type 9 for INGR raster image
>>0	beshort		0x0809
# test for length of 1st element is multiple of blocks a 512 bytes
>>>2	ubyte		0xfe
>>>>0 	use		ingr-image
# test for DGN or CEL by jump words (uleshort) forward to next element
>(2.s*2)	ulong		x
# 2nd element type: 8~Digitizer~DesiGNfile 1~library cell header other~CIT
#>>&1		ubyte&0x7F	x		\b, 2nd type %u
# DGN
>>&1		ubyte&0x7F	8
>>>2		uleshort	=0x02FE		Bentley/Intergraph Microstation CAD drawing
!:mime		application/x-bentley-dgn
!:ext		dgn
# The 0x40 bit of this byte is 1 if the file is 3D, otherwise 0
>>>>1214	ubyte  		&0x40		3D
>>>>1214	ubyte  		^0x40		2D
# 2 chars for name of subunits like ft FT in IN mu m mm '\0 '\040
>>>>1120	string		x		\b, units %-.2s
# 2 chars for name of master unit like IN in ML SU tn th TH HU mm "\0 "\040 \0\0
>>>>1122	string		>\0		%-.2s
#>>>>1120	ubelong		x		\b, units %#8.8x
# element range low,high x y z like xlow=0 08010000h 01080000h
#>>>>4		ubelong	  	!0		\b, xlow %8.8x
#>>>>8		ubelong	  	!0		\b, ylow %8.8x
#>>>>12		ubelong	  	!0		\b, zlow %8.8x
#>>>>16		ubelong	  	!0		\b, xhigh %8.8x
#>>>>20		ubelong	  	!0		\b, yhigh %8.8x
#>>>>24		ubelong	  	!0		\b, zhigh %8.8x
# graphic group number; all other elements in that group have same non-0 number
#>>>>28		leshort		x		\b, grphgrp %#4.4x
# words to optional attribute linkage
#>>>>30		ubyte		x		\b, attindx \%o
#>>>>31		ubyte		x		\b\%o
# >>30	string	\026\105			DGNFile
# >>30	string	\034\105			DGNFile
# >>30	string	\073\107			DGNFile
# >>30	string	\073\110			DGNFile
# >>30	string	\106\107			DGNFile
# >>30	string	\110\103			DGNFile
# >>30	string	\120\104			DGNFile
# >>30	string	\172\104			DGNFile
# >>30	string	\172\105			DGNFile
# >>30	string	\172\106			DGNFile
# >>30	string	\234\106			DGNFile
# >>30	string	\273\105			DGNFile
# >>30	string	\306\106			DGNFile
# >>30	string	\310\104			DGNFile
# >>30	string	\341\104			DGNFile
# >>30	string	\372\103			DGNFile
# >>30	string	\372\104			DGNFile
# >>30	string	\372\106			DGNFile
# >>30	string	\376\103			DGNFile
# elements properties indicator
#>>>>32		uleshort	!0		\b, properties %#4.4x
# class 0~Primary
#>>>>>32		uleshort&0x000F	!0		\b, class %#4.4x
# Symbology
#>>>>>34		uleshort	x		\b, Symbology %#4.4x
# test for 2nd element type 1~library cell header
>>&1		ubyte&0x7F	1
# test for 1st element with level 8 and type 5 for cell library
>>>0		beshort		0x0805		Bentley/Intergraph Microstation CAD cell library
!:mime		application/x-bentley-cel
!:ext		cel
#
# URL:		http://fileformats.archiveteam.org/wiki/Intergraph_Raster
# reference:	https://web.archive.org/web/20140903185431/
#		http://oreilly.com/www/centers/gff/formats/ingr/index.htm
# note:		verfied by command like `nconvert -fullinfo LONGLAT.CIT`
# display information for intergraph raster bitmap
0	name	ingr-image
# in 5.37 "Microstation CITFile" "Bentley/Intergraph MicroStation CIT raster CAD"
# DataTypeCode indicates format, depth of the pixel data and used compression 
>4	uleshort	x			Intergraph raster image
>>4	uleshort	0x0009			\b, Run-Length Encoded 1-bit
!:mime	image/x-intergraph-rle
!:ext	rel
>>4	uleshort	0x0018			\b, CCITT Group 4 1-bit
!:mime	image/x-intergraph-cit
!:ext	cit
>>4	uleshort	27			\b, Adaptive RLE RGB
!:mime	image/x-intergraph-rgb
!:ext	rgb
>>4	default		x
>>>4	uleshort	x			\b, Type %u
!:mime	image/x-intergraph
# TODO:
#>4	uleshort	0			\b, no data
# ...
#>4	uleshort	0x0045			\b, Continuous Tone CMKY (Uncompressed)
# ApplicationType: 0~generic raster image 3~drawing, scanning
# 8~I/IMAGE and MicroStation Imager 9~ModelView
>6	uleshort	!0			\b, ApplicationType %u
#>6	uleshort	x			\b, ApplicationType %u
# XViewOrigin; Raster grid data X origin
#>8	ulequad		!0			\b, XViewOrigin %llx
# PixelsPerLine is the number of pixels in a scan line of bitmapp
>184	ulelong		x			\b, %u x
# NumberOfLines is height of the raster data in scanlines
>188	ulelong		x			%u
# DeviceResolution; resolution of scanning device
# positive indicates number of micros between lines; negative indicates DPI
#>192	leshort		x			\b, DeviceResolution %d
# ScanlineOrient indicates the origin and the orientation of the scan lines
#>194	ubyte		x			\b, ScanlineOrient %x
>194	ubyte		x			\b, orientation
>194	ubyte		&0x01			right
>194	ubyte		^0x01			left
>194	ubyte		&0x02			down
>194	ubyte		^0x02			top
>194	ubyte		&0x04			horizontal
>194	ubyte		^0x04			vertical
# ScannableFlag; Scanline indexing method used
#>195	ubyte		!0			\b, ScannableFlag %#x
# RotationAngle; Rotation angle of raster data
#>196	ubequad		!0			\b, RotationAngle %#llx
# SkewAngle; Skew angle of raster data
#>204	ubequad		!0			\b, SkewAngle %llx
# DataTypeModifier; Additional raster data format info
#>212	uleshort	!0			\b, DataTypeModifier %#4.4x
# DesignFile[66]; Name of the design file
>214	string		>\0			\b, DesignFile %-.66s
# DatabaseFile[66]; Name of the database file
>280	string		>\0			\b, DatabaseFile %-.66s
# ParentGridFile[66]; Name of parent grid file
>346	string		>\0			\b, ParentGridFile %-.66s
# FileDescription[80]; Text description of file and contents
>412	string		>\0			\b, FileDescription %-.80s
# MinValue
#>492	ubequad		!0			\b, MinValue %#llx
# MaxValue
#>500	ubequad		!0			\b, MaxValue %#llx
# Reserved[3]; Unused (always 0)
#>508	ubelong&0xFFffFF00	x		\b, RESERVED %8.8x
# GridFileVersion; Grid File Version like 2 3
#>511	ubyte		x			\b, GridFileVersion %x

# AutoCAD
# Merge of the different contributions and updates from https://en.wikipedia.org/wiki/Dwg
# and https://www.iana.org/assignments/media-types/image/vnd.dwg
0	string	MC0.0	DWG AutoDesk AutoCAD Release 1.0
!:mime image/vnd.dwg
0	string	AC1.2	DWG AutoDesk AutoCAD Release 1.2
!:mime image/vnd.dwg
0	string	AC1.3	DWG AutoDesk AutoCAD Release 1.3
!:mime image/vnd.dwg
0	string	AC1.40	DWG AutoDesk AutoCAD Release 1.40
!:mime image/vnd.dwg
0	string	AC1.50	DWG AutoDesk AutoCAD Release 2.05
!:mime image/vnd.dwg
0	string	AC2.10	DWG AutoDesk AutoCAD Release 2.10
!:mime image/vnd.dwg
0	string	AC2.21	DWG AutoDesk AutoCAD Release 2.21
!:mime image/vnd.dwg
0	string	AC2.22	DWG AutoDesk AutoCAD Release 2.22
!:mime image/vnd.dwg
0	string	AC1001	DWG AutoDesk AutoCAD Release 2.22
!:mime image/vnd.dwg
0	string	AC1002	DWG AutoDesk AutoCAD Release 2.50
!:mime image/vnd.dwg
0	string	AC1003	DWG AutoDesk AutoCAD Release 2.60
!:mime image/vnd.dwg
0	string	AC1004	DWG AutoDesk AutoCAD Release 9
!:mime image/vnd.dwg
0	string	AC1006	DWG AutoDesk AutoCAD Release 10
!:mime image/vnd.dwg
0	string	AC1009	DWG AutoDesk AutoCAD Release 11/12
!:mime image/vnd.dwg
# AutoCAD DWG versions R13/R14 (www.autodesk.com)
# Written December 01, 2003 by Lester Hightower
# Based on the DWG File Format Specifications at http://www.opendwg.org/
# AutoCad, from Nahuel Greco
# AutoCAD DWG versions R12/R13/R14 (www.autodesk.com)
0	string	AC1012	DWG AutoDesk AutoCAD Release 13
!:mime image/vnd.dwg
0	string	AC1013	DWG AutoDesk AutoCAD Release 13c3
!:mime image/vnd.dwg
0	string	AC1014	DWG AutoDesk AutoCAD Release 14
!:mime image/vnd.dwg
0	string	AC1015	DWG AutoDesk AutoCAD 2000
!:mime image/vnd.dwg

# A new version of AutoCAD DWG
# Sergey Zaykov (mail_of_sergey@@mail.ru, sergey_zaikov@@rambler.ru,
# ICQ 358572321)
# From various sources like:
# https://autodesk.blogs.com/between_the_lines/autocad-release-history.html
0	string	AC1018	DWG AutoDesk AutoCAD 2004/2005/2006
!:mime image/vnd.dwg
0	string	AC1021	DWG AutoDesk AutoCAD 2007/2008/2009
!:mime image/vnd.dwg
0	string	AC1024	DWG AutoDesk AutoCAD 2010/2011/2012
!:mime image/vnd.dwg
0	string	AC1027	DWG AutoDesk AutoCAD 2013-2017
!:mime image/vnd.dwg

# From GNU LibreDWG
0	string	AC1032	DWG AutoDesk AutoCAD 2018/2019/2020
!:mime image/vnd.dwg
0	string	AC1035	DWG AutoDesk AutoCAD 2021
!:mime image/vnd.dwg

# KOMPAS 2D drawing from ASCON
# This is KOMPAS 2D drawing or fragment of drawing but is not detailed nor
# gathered nor specification
# ASCON https://ascon.net/main/ in English,
#	https://ascon.ru/ main site in Russian
# Extension is CDW for drawing and FRW for fragment of drawing
# Sergey Zaykov (mail_of_sergey@@mail.ru, sergey_zaikov@@rambler.ru,
# ICQ 358572321, https://vkontakte.ru/id16076543)
# From:
# https://sd.ascon.ru/otrs/customer.pl?Action=CustomerFAQ&CategoryID=4&ItemID=292
# (in russian) and my experiments
0	string	KF
>2	belong	0x4E00000C	Kompas drawing 12.0 SP1
>2	belong	0x4D00000C	Kompas drawing 12.0
>2	belong	0x3200000B	Kompas drawing 11.0 SP1
>2	belong	0x3100000B	Kompas drawing 11.0
>2	belong	0x2310000A	Kompas drawing 10.0 SP1
>2	belong	0x2110000A	Kompas drawing 10.0
>2	belong	0x08000009	Kompas drawing 9.0 SP1
>2	belong	0x05000009	Kompas drawing 9.0
>2	belong	0x33010008	Kompas drawing 8+
>2	belong	0x1A000008	Kompas drawing 8.0
>2	belong	0x2C010107	Kompas drawing 7+
>2	belong	0x05000007	Kompas drawing 7.0
>2	belong	0x32000006	Kompas drawing 6+
>2	belong	0x09000006	Kompas drawing 6.0
>2	belong	0x5C009005	Kompas drawing 5.11R03
>2	belong	0x54009005	Kompas drawing 5.11R02
>2	belong	0x51009005	Kompas drawing 5.11R01
>2	belong	0x22009005	Kompas drawing 5.10R03
>2	belong	0x22009005	Kompas drawing 5.10R02 mar
>2	belong	0x21009005	Kompas drawing 5.10R02 febr
>2	belong	0x19009005	Kompas drawing 5.10R01
>2	belong	0xF4008005	Kompas drawing 5.9R01.003
>2	belong	0x1C008005	Kompas drawing 5.9R01.002
>2	belong	0x11008005	Kompas drawing 5.8R01.003

# CAD: file(1) magic for computer aided design files
# Phillip Griffith <phillip dot griffith at gmail dot com>
# AutoCAD magic taken from the Open Design Alliance's OpenDWG specifications.
#

# 3DS (3d Studio files)
0	leshort		0x4d4d
>6	leshort		0x2
>>8	lelong		0xa
>>>16	leshort		0x3d3d	3D Studio model
# Beat sgi MMV
!:strength +20
!:mime	image/x-3ds
!:ext 3ds

# MegaCAD 2D/3D drawing (.prt)
# https://megacad.de/
# From: Markus Heidelberg <markus.heidelberg@@web.de>
0	string	MegaCad23\0	MegaCAD 2D/3D drawing

# Hoops CAD files
# https://docs.techsoft3d.com/visualize/3df/latest/build/general/hsf/\
# HSF_architecture.html
# Stephane Charette <stephane.charette@@gmail.com>
0	string	;;\040HSF\040V		OpenHSF (Hoops Stream Format)
>7	regex/9 V[.0-9]{4,5}\040	%s
!:ext hsf

# AutoCAD Drawing Exchange Format
# Update:	Joerg Jenderek
# URL:		http://fileformats.archiveteam.org/wiki/DXF
#		https://en.wikipedia.org/wiki/AutoCAD_DXF
# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/d/
#		dxf-var0.trid.xml dxf-var0u.trid.xml dxf-var2.trid.xml dxf-var2u.trid.xml
# Note:		called "AutoCAD Drawing eXchange Format" by TrID and
#		"Drawing Interchange File Format (ASCII)" by DROID
# GRR: some samples does not match 1st test like: abydos.dxf
0	regex		\^[\ \t]*0\r?\000$
>1	regex		\^[\ \t]*SECTION\r?$
>>2	regex		\^[\ \t]*2\r?$
# GRR: some samples without HEADER section like: airplan2.dxf
>>>3	regex		\^[\ \t]*HEADER\r?$	AutoCAD Drawing Exchange Format
#!:mime	application/x-dxf
!:mime	image/vnd.dxf
!:ext	dxf
# DROID PUID fmt/64	fmt-64-signature-id-99.dxf
>>>>&1	search/8192	MC0.0			\b, 1.0
# DROID PUID fmt/65	fmt-65-signature-id-100.dxf
>>>>&1	search/8192	AC1.2			\b, 1.2
# DROID PUID fmt/66	fmt-66-signature-id-101.dxf
>>>>&1	search/8192	AC1.3			\b, 1.3
# DROID PUID fmt/67	fmt-67-signature-id-102.dxf
>>>>&1	search/8192	AC1.40			\b, 1.4
# DROID PUID fmt/68	fmt-68-signature-id-103.dxf
>>>>&1	search/8192	AC1.50			\b, 2.0
# DROID PUID fmt/69	fmt-69-signature-id-104.dxf
>>>>&1	search/8192	AC2.10			\b, 2.1
# DROID PUID fmt/70	fmt-70-signature-id-105.dxf
>>>>&1	search/8192	AC2.21			\b, 2.2
# DROID PUID fmt/71	fmt-71-signature-id-106.dxf
>>>>&1	search/8192	AC1002			\b, 2.5
# DROID PUID fmt/72	fmt-72-signature-id-107.dxf
>>>>&1	search/8192	AC1003			\b, 2.6
# DROID PUID fmt/73	fmt-73-signature-id-108.dxf
>>>>&1	search/8192	AC1004			\b, R9
>>>>&1	search/8192	AC1006			\b, R10
# http://cd.textfiles.com/amigaenv/DXF/OBJEKTE/LASTMINUTE/apple.dxf
#>>>>&1	search/8192	AC1008			\b, Rfoo
>>>>&1	search/8192	AC1009			\b, R11/R12
>>>>&1	search/8192	AC1012			\b, R13
>>>>&1	search/8192	AC1013			\b, R13c3
>>>>&1	search/8192	AC1014			\b, R14
>>>>&1	search/8192	AC1015			\b, version 2000
>>>>&1	search/8192	AC1018			\b, version 2004
>>>>&1	search/8192	AC1021			\b, version 2007
>>>>&1	search/8192	AC1024			\b, version 2010
>>>>&1	search/8192	AC1027			\b, version 2013
>>>>&1	search/8192	AC1032			\b, version 2018
>>>>&1	search/8192	AC1035			\b, version 2021

# The Sketchup 3D model format https://www.sketchup.com/
0	string	\xff\xfe\xff\x0e\x53\x00\x6b\x00\x65\x00\x74\x00\x63\x00\x68\x00\x55\x00\x70\x00\x20\x00\x4d\x00\x6f\x00\x64\x00\x65\x00\x6c\x00	SketchUp Model
!:mime application/vnd.sketchup.skp
!:ext skp

4	regex/b	P[0-9][0-9]\\.[0-9][0-9][0-9][0-9]\\.[0-9][0-9][0-9][0-9]\\.[0-9]	NAXOS CAD System file from version %s
!:strength +40

# glTF (GL Transmission Format) - by the Khronos Group
# Reference: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#glb-file-format-specification
0	string		glTF		glTF binary model
>4	ulelong		x		\b, version %d
>8	ulelong		x		\b, length %d bytes
!:mime	model/gltf-binary
!:ext	glb

# FBX (FilmBoX) - by Kaydara/Autodesk
# Reference: https://code.blender.org/2013/08/fbx-binary-file-format-specification
0	string	Kaydara\ FBX\ Binary\ \ \0	Kaydara FBX model,
>&2	ulelong	x	version %d
!:ext	fbx

# PLY (Polygon File Format/Stanford Triangle Format) - by Greg Turk
# Reference: https://web.archive.org/web/20161204152348/http://www.dcs.ed.ac.uk/teaching/cs4/www/graphics/Web/ply.html
0	string	ply\n          	PLY model,
!:ext	ply
>4	string	format\ ascii\ 	ASCII,
>>&0	regex/6	[0-9.]+        	version %s
>4	string	format\ binary  	binary,
>>&0	string	_little_endian\ 	little endian,
>>>&0	regex/6	[0-9.]+         	version %s
>>&0	string	_big_endian\ 	big endian,
>>>&0	regex/6	[0-9.]+      	version %s

# VRML (Virtual Reality Modeling Language) - by the Web3D Consortium
# From:      Michel Briand <michelbriand@@free.fr>
# Reference: https://www.web3d.org/standards
0	string/w	#VRML\ V1.0\ ascii	VRML 1 file
!:mime	model/vrml
!:ext	wrl
0	string/w	#VRML\ V2.0\ utf8	ISO/IEC 14772 VRML 97 file
!:mime	model/vrml
!:ext	wrl
# X3D, VRML encoded
0	string	#X3D	X3D (Extensible 3D) model, VRML format
>4	string	V
>>5	regex/6	[0-9.]+	\b, version %s
!:mime	model/x3d+vrml
!:ext	x3dv

## XML-based 3D CAD Formats
# From: Michel Briand <michelbriand@@free.fr>, Oliver Galvin <odg@@riseup.net>
0	string/w        \<?xml\ version=
!:strength + 5
# X3D (Extensible 3D)
# Schema:    https://www.web3d.org/specifications/x3d-3.2.dtd
# MIME Type: https://www.iana.org/assignments/media-types/model/x3d+xml
# Example:   https://www.web3d.org/x3d/content/examples/Basic/course/CreateX3DFromStringRandomSpheres.x3d
>20	search/1000/w   \<!DOCTYPE\ X3D         X3D (Extensible 3D) model, XML document
!:mime	model/x3d+xml
!:ext	x3d
# COLLADA (COLLAborative Design Activity) - by the Khronos Group
# Schema:    http://www.collada.org/2005/11/COLLADASchema
# Reference: https://www.khronos.org/collada
>20	search/1000/w	\<COLLADA	COLLADA model, XML document
!:mime	model/vnd.collada+xml
!:ext	dae
# 3MF (3D Manufacturing Format) - by the 3MF Consortium
# Schema:    http://schemas.microsoft.com/3dmanufacturing/core/2015/02
# Reference: https://3mf.io/specification
>20	search/1000/w	xmlns="http://schemas.microsoft.com/3dmanufacturing	3MF (3D Manufacturing Format) model, XML document
!:mime	model/3mf
!:ext	3mf
# AMF (Additive Manufacturing File)
# Reference: https://www.astm.org/Standards/ISOASTM52915.htm
>20	search/1000/w	\<amf	AMF (Additive Manufacturing Format) model, XML document
!:mime	application/x-amf
!:ext	amf
@


1.3
log
@merge changes between 5.40 and 5.43
@
text
@d3 1
a3 1
# $File: cad,v 1.30 2022/09/20 20:11:57 christos Exp $
d309 8
d320 1
d322 2
a323 1
!:mime	application/x-dxf
d325 20
d346 2
@


1.2
log
@merge local changes between 5.39 and 5.40 and add magic entries from HEAD.
@
text
@d3 1
a3 1
# $File: cad,v 1.26 2021/04/08 22:50:22 christos Exp $
d36 1
a36 1
#>2	uleshort	x			\b, words 0x%4.4x to follow
d61 1
a61 1
#>>>>1120	ubelong		x		\b, units 0x%8.8x
d70 1
a70 1
#>>>>28		leshort		x		\b, grphgrp 0x%4.4x
d94 1
a94 1
#>>>>32		uleshort	!0		\b, properties 0x%4.4x
d96 1
a96 1
#>>>>>32		uleshort&0x000F	!0		\b, class 0x%4.4x
d98 1
a98 1
#>>>>>34		uleshort	x		\b, Symbology 0x%4.4x
d154 1
a154 1
#>195	ubyte		!0			\b, ScannableFlag 0x%x
d156 1
a156 1
#>196	ubequad		!0			\b, RotationAngle 0x%llx
d160 1
a160 1
#>212	uleshort	!0			\b, DataTypeModifier 0x%4.4x
d170 1
a170 1
#>492	ubequad		!0			\b, MinValue 0x%llx
d172 1
a172 1
#>500	ubequad		!0			\b, MaxValue 0x%llx
d290 2
d304 2
a305 2
0	string	;;\020HSF\020V		OpenHSF (Hoops Stream Format)
>7	regex/9 V[.0-9]{4,5}\020	%s
d336 5
a340 5
# glTF (GL Transmission Format). The specification is at
# https://github.com/KhronosGroup/glTF
0	string		glTF		glTF binary asset
>4	lelong		x		\b, version %d
>8	lelong		x		\b, length %d bytes.
d342 64
@


1.1
log
@Initial revision
@
text
@d3 1
a6 7
# AutoCAD DWG versions R13/R14 (www.autodesk.com)
# Written December 01, 2003 by Lester Hightower
# Based on the DWG File Format Specifications at http://www.opendwg.org/
0	string	       \101\103\061\060\061		   AutoCAD
>5	string	       \062\000\000\000\000		   DWG ver. R13
>5	string	       \064\000\000\000\000		   DWG ver. R14

d12 1
a12 1
# 
d14 2
a15 2
# http://filext.com/detaillist.php?extdetail=DGN
# http://filext.com/detaillist.php?extdetail=CIT
d17 1
a17 1
# http://www.bentley.com/products/default.cfm?objectid=97F351F5-9C35-4E5E-89C2
d19 1
a19 1
# http://www.bentley.com/products/default.cfm?objectid=A5C2FD43-3AC9-4C71-B682
d21 156
a176 23
0	string	\010\011\376			Microstation
>3	string	\002
>>30	string	\026\105			DGNFile
>>30	string	\034\105			DGNFile
>>30	string	\073\107			DGNFile
>>30	string	\073\110			DGNFile
>>30	string	\106\107			DGNFile
>>30	string	\110\103			DGNFile
>>30	string	\120\104			DGNFile
>>30	string	\172\104			DGNFile
>>30	string	\172\105			DGNFile
>>30	string	\172\106			DGNFile
>>30	string	\234\106			DGNFile
>>30	string	\273\105			DGNFile
>>30	string	\306\106			DGNFile
>>30	string	\310\104			DGNFile
>>30	string	\341\104			DGNFile
>>30	string	\372\103			DGNFile
>>30	string	\372\104			DGNFile
>>30	string	\372\106			DGNFile
>>30	string	\376\103			DGNFile
>4	string	\030\000\000			CITFile
>4	string	\030\000\003			CITFile
d178 34
d214 65
a278 3
0	string AC1012	AutoCad (release 12)
0	string AC1013	AutoCad (release 13)
0	string AC1014	AutoCad (release 14)
d284 56
a339 9
0	belong	0x08051700	Bentley/Intergraph MicroStation DGN cell library
0	belong	0x0809fe02	Bentley/Intergraph MicroStation DGN vector CAD
0	belong	0xc809fe02	Bentley/Intergraph MicroStation DGN vector CAD
0	beshort	0x0809		Bentley/Intergraph MicroStation
>0x02	byte	0xfe
>>0x04	beshort	0x1800		CIT raster CAD
0	string	AC1012		AutoDesk AutoCAD R13
0	string	AC1014		AutoDesk AutoCAD R14 
0	string	AC1015		AutoDesk AutoCAD R2000
@


1.1.1.1
log
@from ftp.astron.com
@
text
@@


1.1.1.2
log
@from ftp.astron.com.
- many security related fixes
- no MAXPATHLEN limits
- fixed missing text specification on ascii magic
- new ``pascal'' style string formats
- whitespace comparison fix
- more magic
@
text
@a2 1
# $File: cad,v 1.10 2010/12/25 14:33:43 christos Exp $
d53 3
a55 48
0	string	AC1012		DWG AutoDesk AutoCad (release 12)
0	string	AC1013		DWG AutoDesk AutoCad (release 13)
0	string	AC1014		DWG AutoDesk AutoCad (release 14)
# A new version of AutoCAD DWG
# Sergey Zaykov (mail_of_sergey@@mail.ru, sergey_zaikov@@rambler.ru,
# ICQ 358572321)
# From various sources like:
# http://autodesk.blogs.com/between_the_lines/autocad-release-history.html
0	string	AC1018 		DWG AutoDesk AutoCAD 2004/2005/2006
0	string	AC1021 		DWG AutoDesk AutoCAD 2007/2008/2009
0	string	AC1024 		DWG AutoDesk AutoCAD 2010/2011

# KOMPAS 2D drawing from ASCON 
# This is KOMPAS 2D drawing or fragment of drawing but is not detailed nor
# gathered nor specification
# ASCON http://ascon.net/main/ in English,
#	http://ascon.ru/ main site in Russian
# Extension is CDW for drawing and FRW for fragment of drawing 
# Sergey Zaykov (mail_of_sergey@@mail.ru, sergey_zaikov@@rambler.ru,
# ICQ 358572321, http://vkontakte.ru/id16076543)
# From:
# http://sd.ascon.ru/otrs/customer.pl?Action=CustomerFAQ&CategoryID=4&ItemID=292
# (in russian) and my experiments
0	string	KF
>2	belong	0x4E00000C	Kompas drawing 12.0 SP1 
>2	belong	0x4D00000C	Kompas drawing 12.0 
>2	belong	0x3200000B	Kompas drawing 11.0 SP1 
>2	belong	0x3100000B	Kompas drawing 11.0 
>2	belong	0x2310000A	Kompas drawing 10.0 SP1 
>2	belong	0x2110000A	Kompas drawing 10.0 
>2	belong	0x08000009	Kompas drawing 9.0 SP1 
>2	belong	0x05000009	Kompas drawing 9.0 
>2	belong	0x33010008	Kompas drawing 8+ 
>2	belong	0x1A000008	Kompas drawing 8.0 
>2	belong	0x2C010107	Kompas drawing 7+ 
>2	belong	0x05000007	Kompas drawing 7.0 
>2	belong	0x32000006	Kompas drawing 6+ 
>2	belong	0x09000006	Kompas drawing 6.0 
>2	belong	0x5C009005	Kompas drawing 5.11R03 
>2	belong	0x54009005	Kompas drawing 5.11R02 
>2	belong	0x51009005	Kompas drawing 5.11R01 
>2	belong	0x22009005	Kompas drawing 5.10R03 
>2	belong	0x22009005	Kompas drawing 5.10R02 mar 
>2	belong	0x21009005	Kompas drawing 5.10R02 febr 
>2	belong	0x19009005	Kompas drawing 5.10R01 
>2	belong	0xF4008005	Kompas drawing 5.9R01.003 
>2	belong	0x1C008005	Kompas drawing 5.9R01.002 
>2	belong	0x11008005	Kompas drawing 5.8R01.003 
@


1.1.1.2.4.1
log
@sync with head
@
text
@d3 1
a3 1
# $File: cad,v 1.11 2011/12/08 12:12:46 rrt Exp $
a115 3

# 3DS (3d Studio files) Conflicts with diff output 0x3d '='
#16	beshort		0x3d3d		image/x-3ds
@


1.1.1.2.4.2
log
@sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")
@
text
@d3 1
a3 1
# $File: cad,v 1.12 2013/07/04 15:24:37 christos Exp $
d7 7
a51 34
# AutoCAD 
# Merge of the different contributions and updates from http://en.wikipedia.org/wiki/Dwg
# and http://www.iana.org/assignments/media-types/image/vnd.dwg
0	string	MC0.0	DWG AutoDesk AutoCAD Release 1.0
!:mime image/vnd.dwg
0	string	AC1.2	DWG AutoDesk AutoCAD Release 1.2
!:mime image/vnd.dwg
0	string	AC1.3	DWG AutoDesk AutoCAD Release 1.3
!:mime image/vnd.dwg
0	string	AC1.40	DWG AutoDesk AutoCAD Release 1.40
!:mime image/vnd.dwg
0	string	AC1.50	DWG AutoDesk AutoCAD Release 2.05
!:mime image/vnd.dwg
0	string	AC2.10	DWG AutoDesk AutoCAD Release 2.10
!:mime image/vnd.dwg
0	string	AC2.21	DWG AutoDesk AutoCAD Release 2.21
!:mime image/vnd.dwg
0	string	AC2.22	DWG AutoDesk AutoCAD Release 2.22
!:mime image/vnd.dwg
0	string	AC1001	DWG AutoDesk AutoCAD Release 2.22
!:mime image/vnd.dwg
0	string	AC1002	DWG AutoDesk AutoCAD Release 2.50
!:mime image/vnd.dwg
0	string	AC1003	DWG AutoDesk AutoCAD Release 2.60
!:mime image/vnd.dwg
0	string	AC1004	DWG AutoDesk AutoCAD Release 9
!:mime image/vnd.dwg
0	string	AC1006	DWG AutoDesk AutoCAD Release 10
!:mime image/vnd.dwg
0	string	AC1009	DWG AutoDesk AutoCAD Release 11/12
!:mime image/vnd.dwg
# AutoCAD DWG versions R13/R14 (www.autodesk.com)
# Written December 01, 2003 by Lester Hightower
# Based on the DWG File Format Specifications at http://www.opendwg.org/
d54 3
a56 7
0	string	AC1012	DWG AutoDesk AutoCAD Release 13
!:mime image/vnd.dwg
0	string	AC1014	DWG AutoDesk AutoCAD Release 14
!:mime image/vnd.dwg
0	string	AC1015	DWG AutoDesk AutoCAD 2000/2002
!:mime image/vnd.dwg

d62 3
a64 8
0	string	AC1018	DWG AutoDesk AutoCAD 2004/2005/2006
!:mime image/vnd.dwg
0	string	AC1021	DWG AutoDesk AutoCAD 2007/2008/2009
!:mime image/vnd.dwg
0	string	AC1024	DWG AutoDesk AutoCAD 2010/2011/2012
!:mime image/vnd.dwg
0	string	AC1027	DWG AutoDesk AutoCAD 2013/2014
!:mime image/vnd.dwg
d113 3
@


1.1.1.2.6.1
log
@Pull up following revision(s) (requested by christos in ticket #30):
	Update file to 5.11 (CDF security fixes)
@
text
@d3 1
a3 1
# $File: cad,v 1.11 2011/12/08 12:12:46 rrt Exp $
a115 3

# 3DS (3d Studio files) Conflicts with diff output 0x3d '='
#16	beshort		0x3d3d		image/x-3ds
@


1.1.1.3
log
@from ftp.astron.com, CDF security fixes
@
text
@d3 1
a3 1
# $File: cad,v 1.11 2011/12/08 12:12:46 rrt Exp $
a115 3

# 3DS (3d Studio files) Conflicts with diff output 0x3d '='
#16	beshort		0x3d3d		image/x-3ds
@


1.1.1.3.2.1
log
@Rebase to HEAD as of a few days ago.
@
text
@d3 1
a3 1
# $File: cad,v 1.13 2014/03/23 18:05:38 christos Exp $
d7 7
a51 34
# AutoCAD 
# Merge of the different contributions and updates from http://en.wikipedia.org/wiki/Dwg
# and http://www.iana.org/assignments/media-types/image/vnd.dwg
0	string	MC0.0	DWG AutoDesk AutoCAD Release 1.0
!:mime image/vnd.dwg
0	string	AC1.2	DWG AutoDesk AutoCAD Release 1.2
!:mime image/vnd.dwg
0	string	AC1.3	DWG AutoDesk AutoCAD Release 1.3
!:mime image/vnd.dwg
0	string	AC1.40	DWG AutoDesk AutoCAD Release 1.40
!:mime image/vnd.dwg
0	string	AC1.50	DWG AutoDesk AutoCAD Release 2.05
!:mime image/vnd.dwg
0	string	AC2.10	DWG AutoDesk AutoCAD Release 2.10
!:mime image/vnd.dwg
0	string	AC2.21	DWG AutoDesk AutoCAD Release 2.21
!:mime image/vnd.dwg
0	string	AC2.22	DWG AutoDesk AutoCAD Release 2.22
!:mime image/vnd.dwg
0	string	AC1001	DWG AutoDesk AutoCAD Release 2.22
!:mime image/vnd.dwg
0	string	AC1002	DWG AutoDesk AutoCAD Release 2.50
!:mime image/vnd.dwg
0	string	AC1003	DWG AutoDesk AutoCAD Release 2.60
!:mime image/vnd.dwg
0	string	AC1004	DWG AutoDesk AutoCAD Release 9
!:mime image/vnd.dwg
0	string	AC1006	DWG AutoDesk AutoCAD Release 10
!:mime image/vnd.dwg
0	string	AC1009	DWG AutoDesk AutoCAD Release 11/12
!:mime image/vnd.dwg
# AutoCAD DWG versions R13/R14 (www.autodesk.com)
# Written December 01, 2003 by Lester Hightower
# Based on the DWG File Format Specifications at http://www.opendwg.org/
d54 3
a56 7
0	string	AC1012	DWG AutoDesk AutoCAD Release 13
!:mime image/vnd.dwg
0	string	AC1014	DWG AutoDesk AutoCAD Release 14
!:mime image/vnd.dwg
0	string	AC1015	DWG AutoDesk AutoCAD 2000/2002
!:mime image/vnd.dwg

d62 3
a64 8
0	string	AC1018	DWG AutoDesk AutoCAD 2004/2005/2006
!:mime image/vnd.dwg
0	string	AC1021	DWG AutoDesk AutoCAD 2007/2008/2009
!:mime image/vnd.dwg
0	string	AC1024	DWG AutoDesk AutoCAD 2010/2011/2012
!:mime image/vnd.dwg
0	string	AC1027	DWG AutoDesk AutoCAD 2013/2014
!:mime image/vnd.dwg
d113 3
a118 5

# MegaCAD 2D/3D drawing (.prt)
# http://megacad.de/
# From: Markus Heidelberg <markus.heidelberg@@web.de>
0	string	MegaCad23\0	MegaCAD 2D/3D drawing
@


1.1.1.4
log
@from ftp.astron.com, this is a bug fix release:
       * always leave magic file loaded, don't unload for magic_check, etc.
       * fix default encoding to binary instead of unknown which broke recently
       * handle empty and one byte files, less specially so that
         --mime-encoding does not break completely.
       * fix erroneous non-zero exit code from non-existant file and message
       * add CDF MSI file detection (Guy Helmer)
@
text
@d3 1
a3 1
# $File: cad,v 1.12 2013/07/04 15:24:37 christos Exp $
d7 7
a51 34
# AutoCAD 
# Merge of the different contributions and updates from http://en.wikipedia.org/wiki/Dwg
# and http://www.iana.org/assignments/media-types/image/vnd.dwg
0	string	MC0.0	DWG AutoDesk AutoCAD Release 1.0
!:mime image/vnd.dwg
0	string	AC1.2	DWG AutoDesk AutoCAD Release 1.2
!:mime image/vnd.dwg
0	string	AC1.3	DWG AutoDesk AutoCAD Release 1.3
!:mime image/vnd.dwg
0	string	AC1.40	DWG AutoDesk AutoCAD Release 1.40
!:mime image/vnd.dwg
0	string	AC1.50	DWG AutoDesk AutoCAD Release 2.05
!:mime image/vnd.dwg
0	string	AC2.10	DWG AutoDesk AutoCAD Release 2.10
!:mime image/vnd.dwg
0	string	AC2.21	DWG AutoDesk AutoCAD Release 2.21
!:mime image/vnd.dwg
0	string	AC2.22	DWG AutoDesk AutoCAD Release 2.22
!:mime image/vnd.dwg
0	string	AC1001	DWG AutoDesk AutoCAD Release 2.22
!:mime image/vnd.dwg
0	string	AC1002	DWG AutoDesk AutoCAD Release 2.50
!:mime image/vnd.dwg
0	string	AC1003	DWG AutoDesk AutoCAD Release 2.60
!:mime image/vnd.dwg
0	string	AC1004	DWG AutoDesk AutoCAD Release 9
!:mime image/vnd.dwg
0	string	AC1006	DWG AutoDesk AutoCAD Release 10
!:mime image/vnd.dwg
0	string	AC1009	DWG AutoDesk AutoCAD Release 11/12
!:mime image/vnd.dwg
# AutoCAD DWG versions R13/R14 (www.autodesk.com)
# Written December 01, 2003 by Lester Hightower
# Based on the DWG File Format Specifications at http://www.opendwg.org/
d54 3
a56 7
0	string	AC1012	DWG AutoDesk AutoCAD Release 13
!:mime image/vnd.dwg
0	string	AC1014	DWG AutoDesk AutoCAD Release 14
!:mime image/vnd.dwg
0	string	AC1015	DWG AutoDesk AutoCAD 2000/2002
!:mime image/vnd.dwg

d62 3
a64 8
0	string	AC1018	DWG AutoDesk AutoCAD 2004/2005/2006
!:mime image/vnd.dwg
0	string	AC1021	DWG AutoDesk AutoCAD 2007/2008/2009
!:mime image/vnd.dwg
0	string	AC1024	DWG AutoDesk AutoCAD 2010/2011/2012
!:mime image/vnd.dwg
0	string	AC1027	DWG AutoDesk AutoCAD 2013/2014
!:mime image/vnd.dwg
d113 3
@


1.1.1.4.2.1
log
@Rebase.
@
text
@d3 1
a3 1
# $File: cad,v 1.13 2014/03/23 18:05:38 christos Exp $
a151 5

# MegaCAD 2D/3D drawing (.prt)
# http://megacad.de/
# From: Markus Heidelberg <markus.heidelberg@@web.de>
0	string	MegaCad23\0	MegaCAD 2D/3D drawing
@


1.1.1.5
log
@import file-5.19

2014-06-09   9:04  Christos Zoulas <christos@@zoulas.com>

	* Misc buffer overruns and missing buffer size tests in cdf parsing
	  (Francisco Alonso, Jan Kaluza)

2014-06-02  14:50  Christos Zoulas <christos@@zoulas.com>

	* Enforce limit of 8K on regex searches that have no limits
	* Allow the l modifier for regex to mean line count. Default
	  to byte count. If line count is specified, assume a max
	  of 80 characters per line to limit the byte count.
	* Don't allow conversions to be used for dates, allowing
	  the mask field to be used as an offset.

2014-05-30  12:51  Christos Zoulas <christos@@zoulas.com>

	* Make the range operator limit the length of the
	  regex search.

2014-05-14  19:23  Christos Zoulas <christos@@zoulas.com>

	* PR/347: Windows fixes
	* PR/352: Hangul word processor recognition
	* PR/354: Encoding irregularities in text files

2014-05-06  6:12  Christos Zoulas <christos@@zoulas.com>

	* Fix uninitialized title in CDF files (Jan Kaluza)

2014-05-04  14:55  Christos Zoulas <christos@@zoulas.com>

	* PR/351: Fix compilation of empty files

2014-04-30  17:39  Christos Zoulas <christos@@zoulas.com>

	* Fix integer formats: We don't specify 'l' or
	  'h' and 'hh' specifiers anymore, only 'll' for
	  quads and nothing for the rest. This is so that
	  magic writing is simpler.

2014-04-01  15:25  Christos Zoulas <christos@@zoulas.com>

	* PR/341: Jan Kaluza, fix memory leak
	* PR/342: Jan Kaluza, fix out of bounds read

2014-03-28  15:25  Christos Zoulas <christos@@zoulas.com>

	* Fix issue with long formats not matching fmtcheck
@
text
@d3 1
a3 1
# $File: cad,v 1.13 2014/03/23 18:05:38 christos Exp $
a151 5

# MegaCAD 2D/3D drawing (.prt)
# http://megacad.de/
# From: Markus Heidelberg <markus.heidelberg@@web.de>
0	string	MegaCad23\0	MegaCAD 2D/3D drawing
@


1.1.1.6
log
@Import file-5.31; mostly oss-fuzz found bugs.
@
text
@d3 1
a3 1
# $File: cad,v 1.14 2017/03/17 21:35:28 christos Exp $
d12 1
a12 1
#
d45 1
a45 1
# AutoCAD
d102 1
a102 1
# KOMPAS 2D drawing from ASCON
d107 1
a107 1
# Extension is CDW for drawing and FRW for fragment of drawing
d114 24
a137 24
>2	belong	0x4E00000C	Kompas drawing 12.0 SP1
>2	belong	0x4D00000C	Kompas drawing 12.0
>2	belong	0x3200000B	Kompas drawing 11.0 SP1
>2	belong	0x3100000B	Kompas drawing 11.0
>2	belong	0x2310000A	Kompas drawing 10.0 SP1
>2	belong	0x2110000A	Kompas drawing 10.0
>2	belong	0x08000009	Kompas drawing 9.0 SP1
>2	belong	0x05000009	Kompas drawing 9.0
>2	belong	0x33010008	Kompas drawing 8+
>2	belong	0x1A000008	Kompas drawing 8.0
>2	belong	0x2C010107	Kompas drawing 7+
>2	belong	0x05000007	Kompas drawing 7.0
>2	belong	0x32000006	Kompas drawing 6+
>2	belong	0x09000006	Kompas drawing 6.0
>2	belong	0x5C009005	Kompas drawing 5.11R03
>2	belong	0x54009005	Kompas drawing 5.11R02
>2	belong	0x51009005	Kompas drawing 5.11R01
>2	belong	0x22009005	Kompas drawing 5.10R03
>2	belong	0x22009005	Kompas drawing 5.10R02 mar
>2	belong	0x21009005	Kompas drawing 5.10R02 febr
>2	belong	0x19009005	Kompas drawing 5.10R01
>2	belong	0xF4008005	Kompas drawing 5.9R01.003
>2	belong	0x1C008005	Kompas drawing 5.9R01.002
>2	belong	0x11008005	Kompas drawing 5.8R01.003
@


1.1.1.7
log
@2017-09-02  11:53  Christos Zoulas <christos@@zoulas.com>

	* release 5.32

2017-08-28  16:37  Christos Zoulas <christos@@zoulas.com>

	* Always reset state in {file,buffer}_apprentice (Krzysztof Wilczynski)

2017-08-27  03:55  Christos Zoulas <christos@@zoulas.com>

	* Fix always true condition (Thomas Jarosch)

2017-05-24  17:30  Christos Zoulas <christos@@zoulas.com>

	* pickier parsing of numeric values in magic files.

2017-05-23  17:55  Christos Zoulas <christos@@zoulas.com>

	* PR/615 add magic_getflags()

2017-05-23  13:55  Christos Zoulas <christos@@zoulas.com>

	* release 5.31

2017-03-17  20:32  Christos Zoulas <christos@@zoulas.com>

	* remove trailing spaces from magic files
	* refactor is_tar
	* better bounds checks for cdf
@
text
@d3 1
a3 1
# $File: cad,v 1.15 2017/06/24 15:24:56 christos Exp $
d150 2
a151 7
# 3DS (3d Studio files)
0	leshort		0x4d4d
>6	leshort		0x2
>>8	lelong		0xa
>>>16	leshort		0x3d3d	3D Studio model
!:mime	image/x-3ds
!:extension 3ds
@


1.1.1.7.4.1
log
@Sync with HEAD
@
text
@d3 1
a3 1
# $File: cad,v 1.19 2019/04/19 00:42:27 christos Exp $
d14 2
a15 2
# https://filext.com/detaillist.php?extdetail=DGN
# https://filext.com/detaillist.php?extdetail=CIT
d17 1
a17 1
# https://www.bentley.com/products/default.cfm?objectid=97F351F5-9C35-4E5E-89C2
d19 1
a19 1
# https://www.bentley.com/products/default.cfm?objectid=A5C2FD43-3AC9-4C71-B682
d46 2
a47 2
# Merge of the different contributions and updates from https://en.wikipedia.org/wiki/Dwg
# and https://www.iana.org/assignments/media-types/image/vnd.dwg
d92 1
a92 1
# https://autodesk.blogs.com/between_the_lines/autocad-release-history.html
d105 2
a106 2
# ASCON https://ascon.net/main/ in English,
#	https://ascon.ru/ main site in Russian
d109 1
a109 1
# ICQ 358572321, https://vkontakte.ru/id16076543)
d111 1
a111 1
# https://sd.ascon.ru/otrs/customer.pl?Action=CustomerFAQ&CategoryID=4&ItemID=292
d156 1
a156 1
!:ext 3ds
d159 1
a159 1
# https://megacad.de/
a161 29

# Hoops CAD files
# https://docs.techsoft3d.com/visualize/3df/latest/build/general/hsf/\
# HSF_architecture.html
# Stephane Charette <stephane.charette@@gmail.com>
0	string	;;\020HSF\020V		OpenHSF (Hoops Stream Format)
>7	regex/9 V[.0-9]{4,5}\020	%s
!:ext hsf

# AutoCAD Drawing Exchange Format
0	regex		\^[\ \t]*0\r?\000$
>1	regex		\^[\ \t]*SECTION\r?$
>>2	regex		\^[\ \t]*2\r?$
>>>3	regex		\^[\ \t]*HEADER\r?$	AutoCAD Drawing Exchange Format
!:mime	application/x-dxf
!:ext	dxf
>>>>&1	search/8192	AC1006			\b, R10
>>>>&1	search/8192	AC1009			\b, R11/R12
>>>>&1	search/8192	AC1012			\b, R13
>>>>&1	search/8192	AC1014			\b, R14
>>>>&1	search/8192	AC1015			\b, version 2000
>>>>&1	search/8192	AC1018			\b, version 2004
>>>>&1	search/8192	AC1021			\b, version 2007
>>>>&1	search/8192	AC1024			\b, version 2010

# The Sketchup 3D model format https://www.sketchup.com/
0	string	\xff\xfe\xff\x0e\x53\x00\x6b\x00\x65\x00\x74\x00\x63\x00\x68\x00\x55\x00\x70\x00\x20\x00\x4d\x00\x6f\x00\x64\x00\x65\x00\x6c\x00	SketchUp Model
!:mime application/vnd.sketchup.skp
!:ext skp
@


1.1.1.7.4.2
log
@Merge changes from current as of 20200406
@
text
@d3 1
a3 1
# $File: cad,v 1.20 2019/08/10 13:34:17 christos Exp $
d21 23
a43 156
# 
# URL:		https://en.wikipedia.org/wiki/MicroStation
# reference:	http://dgnlib.maptools.org/dgn.html
#		http://dgnlib.maptools.org/dl/ref18.pdf
# Update:	Joerg Jenderek
# Note: verfied by command like `dgndump seed2d_b.dgn`
# test for level 8 and type 5 or 9
0	beshort&0x3F73	0x0801
# level of element like 8
#>0	ubyte&0x3F	x			\b, level %u
#>0	ubyte		&0x80			\b, complex
#>0	ubyte		&0x40			\b, reserved
# type of element 9~TCB 8~Digitizer setup 5~Group Data Elements
#>1	ubyte&0x7F	x			\b, type %u
# words to follow in element: 17H~CEL libray 2FEh~DGN 9FEh,DFEh~CIT
#>2	uleshort	x			\b, words 0x%4.4x to follow
# test for 3 reserved 0 bytes in CIT or "conversion" in ViewInfo structure (DGN CEL)
#>508	ubelong		x			\b, RESERVED %8.8x
>508	ubelong&0xFFffFF00	=0
# test for level 8 and type 9 for INGR raster image
>>0	beshort		0x0809
# test for length of 1st element is multiple of blocks a 512 bytes
>>>2	ubyte		0xfe
>>>>0 	use		ingr-image
# test for DGN or CEL by jump words (uleshort) forward to next element
>(2.s*2)	ulong		x
# 2nd element type: 8~Digitizer~DesiGNfile 1~library cell header other~CIT
#>>&1		ubyte&0x7F	x		\b, 2nd type %u
# DGN
>>&1		ubyte&0x7F	8
>>>2		uleshort	=0x02FE		Bentley/Intergraph Microstation CAD drawing
!:mime		application/x-bentley-dgn
!:ext		dgn
# The 0x40 bit of this byte is 1 if the file is 3D, otherwise 0
>>>>1214	ubyte  		&0x40		3D
>>>>1214	ubyte  		^0x40		2D
# 2 chars for name of subunits like ft FT in IN mu m mm '\0 '\040
>>>>1120	string		x		\b, units %-.2s
# 2 chars for name of master unit like IN in ML SU tn th TH HU mm "\0 "\040 \0\0
>>>>1122	string		>\0		%-.2s
#>>>>1120	ubelong		x		\b, units 0x%8.8x
# element range low,high x y z like xlow=0 08010000h 01080000h
#>>>>4		ubelong	  	!0		\b, xlow %8.8x
#>>>>8		ubelong	  	!0		\b, ylow %8.8x
#>>>>12		ubelong	  	!0		\b, zlow %8.8x
#>>>>16		ubelong	  	!0		\b, xhigh %8.8x
#>>>>20		ubelong	  	!0		\b, yhigh %8.8x
#>>>>24		ubelong	  	!0		\b, zhigh %8.8x
# graphic group number; all other elements in that group have same non-0 number
#>>>>28		leshort		x		\b, grphgrp 0x%4.4x
# words to optional attribute linkage
#>>>>30		ubyte		x		\b, attindx \%o
#>>>>31		ubyte		x		\b\%o
# >>30	string	\026\105			DGNFile
# >>30	string	\034\105			DGNFile
# >>30	string	\073\107			DGNFile
# >>30	string	\073\110			DGNFile
# >>30	string	\106\107			DGNFile
# >>30	string	\110\103			DGNFile
# >>30	string	\120\104			DGNFile
# >>30	string	\172\104			DGNFile
# >>30	string	\172\105			DGNFile
# >>30	string	\172\106			DGNFile
# >>30	string	\234\106			DGNFile
# >>30	string	\273\105			DGNFile
# >>30	string	\306\106			DGNFile
# >>30	string	\310\104			DGNFile
# >>30	string	\341\104			DGNFile
# >>30	string	\372\103			DGNFile
# >>30	string	\372\104			DGNFile
# >>30	string	\372\106			DGNFile
# >>30	string	\376\103			DGNFile
# elements properties indicator
#>>>>32		uleshort	!0		\b, properties 0x%4.4x
# class 0~Primary
#>>>>>32		uleshort&0x000F	!0		\b, class 0x%4.4x
# Symbology
#>>>>>34		uleshort	x		\b, Symbology 0x%4.4x
# test for 2nd element type 1~library cell header
>>&1		ubyte&0x7F	1
# test for 1st element with level 8 and type 5 for cell library
>>>0		beshort		0x0805		Bentley/Intergraph Microstation CAD cell library
!:mime		application/x-bentley-cel
!:ext		cel
#
# URL:		http://fileformats.archiveteam.org/wiki/Intergraph_Raster
# reference:	https://web.archive.org/web/20140903185431/
#		http://oreilly.com/www/centers/gff/formats/ingr/index.htm
# note:		verfied by command like `nconvert -fullinfo LONGLAT.CIT`
# display information for intergraph raster bitmap
0	name	ingr-image
# in 5.37 "Microstation CITFile" "Bentley/Intergraph MicroStation CIT raster CAD"
# DataTypeCode indicates format, depth of the pixel data and used compression 
>4	uleshort	x			Intergraph raster image
>>4	uleshort	0x0009			\b, Run-Length Encoded 1-bit
!:mime	image/x-intergraph-rle
!:ext	rel
>>4	uleshort	0x0018			\b, CCITT Group 4 1-bit
!:mime	image/x-intergraph-cit
!:ext	cit
>>4	uleshort	27			\b, Adaptive RLE RGB
!:mime	image/x-intergraph-rgb
!:ext	rgb
>>4	default		x
>>>4	uleshort	x			\b, Type %u
!:mime	image/x-intergraph
# TODO:
#>4	uleshort	0			\b, no data
# ...
#>4	uleshort	0x0045			\b, Continuous Tone CMKY (Uncompressed)
# ApplicationType: 0~generic raster image 3~drawing, scanning
# 8~I/IMAGE and MicroStation Imager 9~ModelView
>6	uleshort	!0			\b, ApplicationType %u
#>6	uleshort	x			\b, ApplicationType %u
# XViewOrigin; Raster grid data X origin
#>8	ulequad		!0			\b, XViewOrigin %llx
# PixelsPerLine is the number of pixels in a scan line of bitmapp
>184	ulelong		x			\b, %u x
# NumberOfLines is height of the raster data in scanlines
>188	ulelong		x			%u
# DeviceResolution; resolution of scanning device
# positive indicates number of micros between lines; negative indicates DPI
#>192	leshort		x			\b, DeviceResolution %d
# ScanlineOrient indicates the origin and the orientation of the scan lines
#>194	ubyte		x			\b, ScanlineOrient %x
>194	ubyte		x			\b, orientation
>194	ubyte		&0x01			right
>194	ubyte		^0x01			left
>194	ubyte		&0x02			down
>194	ubyte		^0x02			top
>194	ubyte		&0x04			horizontal
>194	ubyte		^0x04			vertical
# ScannableFlag; Scanline indexing method used
#>195	ubyte		!0			\b, ScannableFlag 0x%x
# RotationAngle; Rotation angle of raster data
#>196	ubequad		!0			\b, RotationAngle 0x%llx
# SkewAngle; Skew angle of raster data
#>204	ubequad		!0			\b, SkewAngle %llx
# DataTypeModifier; Additional raster data format info
#>212	uleshort	!0			\b, DataTypeModifier 0x%4.4x
# DesignFile[66]; Name of the design file
>214	string		>\0			\b, DesignFile %-.66s
# DatabaseFile[66]; Name of the database file
>280	string		>\0			\b, DatabaseFile %-.66s
# ParentGridFile[66]; Name of parent grid file
>346	string		>\0			\b, ParentGridFile %-.66s
# FileDescription[80]; Text description of file and contents
>412	string		>\0			\b, FileDescription %-.80s
# MinValue
#>492	ubequad		!0			\b, MinValue 0x%llx
# MaxValue
#>500	ubequad		!0			\b, MaxValue 0x%llx
# Reserved[3]; Unused (always 0)
#>508	ubelong&0xFFffFF00	x		\b, RESERVED %8.8x
# GridFileVersion; Grid File Version like 2 3
#>511	ubyte		x			\b, GridFileVersion %x
d143 6
@


1.1.1.7.2.1
log
@Sync with head
@
text
@d3 1
a3 1
# $File: cad,v 1.18 2018/08/02 06:23:27 christos Exp $
d156 1
a156 1
!:ext 3ds
a161 29

# Hoops CAD files
# https://docs.techsoft3d.com/visualize/3df/latest/build/general/hsf/\
# HSF_architecture.html
# Stephane Charette <stephane.charette@@gmail.com>
0	string	;;\020HSF\020V		OpenHSF (Hoops Stream Format)
>7	regex/9 V[.0-9]{4,5}\020	%s
!:ext hsf

# AutoCAD Drawing Exchange Format
0	regex		\^[\ \t]*0\r?\000$
>1	regex		\^[\ \t]*SECTION\r?$
>>2	regex		\^[\ \t]*2\r?$
>>>3	regex		\^[\ \t]*HEADER\r?$	AutoCAD Drawing Exchange Format
!:mime	application/x-dxf
!:ext	dxf
>>>>&1	search/8192	AC1006			\b, R10
>>>>&1	search/8192	AC1009			\b, R11/R12
>>>>&1	search/8192	AC1012			\b, R13
>>>>&1	search/8192	AC1014			\b, R14
>>>>&1	search/8192	AC1015			\b, version 2000
>>>>&1	search/8192	AC1018			\b, version 2004
>>>>&1	search/8192	AC1021			\b, version 2007
>>>>&1	search/8192	AC1024			\b, version 2010

# The Sketchup 3D model format https://www.sketchup.com/
0	string	\xff\xfe\xff\x0e\x53\x00\x6b\x00\x65\x00\x74\x00\x63\x00\x68\x00\x55\x00\x70\x00\x20\x00\x4d\x00\x6f\x00\x64\x00\x65\x00\x6c\x00	SketchUp Model
!:mime application/vnd.sketchup.skp
!:ext skp
@


1.1.1.8
log
@2018-10-18  19:32  Christos Zoulas <christos@@zoulas.com>

	* release 5.35

2018-09-10  20:38  Christos Zoulas <christos@@zoulas.com>

	* Add FreeBSD ELF core file support (John Baldwin)

2018-08-20  18:40  Christos Zoulas <christos@@zoulas.com>

	* PR/30: Allow all parameter values to be set (don't treat 0 specially)
	* handle default annotations on the softmagic match instead at the
	  end.

2018-07-25  10:17  Christos Zoulas <christos@@zoulas.com>

	* PR/23: Recognize JSON files

2018-07-25  10:17  Christos Zoulas <christos@@zoulas.com>

	* PR/18: file --mime-encoding should not print mime-type

2018-07-25   8:50  Christos Zoulas <christos@@zoulas.com>

	* release 5.34

2018-06-22  16:38  Christos Zoulas <christos@@zoulas.com>

	* Add Quad indirect offsets

2018-05-24  14:10  Christos Zoulas <christos@@zoulas.com>

	* Enable parsing of ELF dynamic sections to handle PIE better
@
text
@d3 1
a3 1
# $File: cad,v 1.18 2018/08/02 06:23:27 christos Exp $
d156 1
a156 1
!:ext 3ds
a161 29

# Hoops CAD files
# https://docs.techsoft3d.com/visualize/3df/latest/build/general/hsf/\
# HSF_architecture.html
# Stephane Charette <stephane.charette@@gmail.com>
0	string	;;\020HSF\020V		OpenHSF (Hoops Stream Format)
>7	regex/9 V[.0-9]{4,5}\020	%s
!:ext hsf

# AutoCAD Drawing Exchange Format
0	regex		\^[\ \t]*0\r?\000$
>1	regex		\^[\ \t]*SECTION\r?$
>>2	regex		\^[\ \t]*2\r?$
>>>3	regex		\^[\ \t]*HEADER\r?$	AutoCAD Drawing Exchange Format
!:mime	application/x-dxf
!:ext	dxf
>>>>&1	search/8192	AC1006			\b, R10
>>>>&1	search/8192	AC1009			\b, R11/R12
>>>>&1	search/8192	AC1012			\b, R13
>>>>&1	search/8192	AC1014			\b, R14
>>>>&1	search/8192	AC1015			\b, version 2000
>>>>&1	search/8192	AC1018			\b, version 2004
>>>>&1	search/8192	AC1021			\b, version 2007
>>>>&1	search/8192	AC1024			\b, version 2010

# The Sketchup 3D model format https://www.sketchup.com/
0	string	\xff\xfe\xff\x0e\x53\x00\x6b\x00\x65\x00\x74\x00\x63\x00\x68\x00\x55\x00\x70\x00\x20\x00\x4d\x00\x6f\x00\x64\x00\x65\x00\x6c\x00	SketchUp Model
!:mime application/vnd.sketchup.skp
!:ext skp
@


1.1.1.9
log
@2019-05-14  22:26  Christos Zoulas <christos@@zoulas.com>

	* release 5.37

2019-05-09  22:27  Christos Zoulas <christos@@zoulas.com>

	* Make sure that continuation separators are printed
	  with -k within softmagic

2019-05-06  22:27  Christos Zoulas <christos@@zoulas.com>

	* Change SIGPIPE saving and restoring during compression to use
	  sigaction(2) instead of signal(3) and cache it. (Denys Vlasenko)
	* Cache stat(2) calls more to reduce number of calls (Denys Vlasenko)

2019-05-06  17:25  Christos Zoulas <christos@@zoulas.com>

	* PR/77: Handle --mime-type and -k correctly.

2019-05-03  15:26  Christos Zoulas <christos@@zoulas.com>

	* Switch decompression code to use vfork() because
	  tools like rpmdiff and rpmbuild call libmagic
	  with large process footprints (Denys Vlasenko)

2019-04-07  14:05  Christos Zoulas <christos@@zoulas.com>

	* PR/75: --enable-zlib, did not work.

2019-02-27  11:54  Christos Zoulas <christos@@zoulas.com>

	* Improve regex efficiency (Michael Schroeder) by:
		1. Prefixing regex searches with regular search
		   for keywords where possible
		2. Using memmem(3) where available
@
text
@d3 1
a3 1
# $File: cad,v 1.19 2019/04/19 00:42:27 christos Exp $
d14 2
a15 2
# https://filext.com/detaillist.php?extdetail=DGN
# https://filext.com/detaillist.php?extdetail=CIT
d17 1
a17 1
# https://www.bentley.com/products/default.cfm?objectid=97F351F5-9C35-4E5E-89C2
d19 1
a19 1
# https://www.bentley.com/products/default.cfm?objectid=A5C2FD43-3AC9-4C71-B682
d46 2
a47 2
# Merge of the different contributions and updates from https://en.wikipedia.org/wiki/Dwg
# and https://www.iana.org/assignments/media-types/image/vnd.dwg
d92 1
a92 1
# https://autodesk.blogs.com/between_the_lines/autocad-release-history.html
d105 2
a106 2
# ASCON https://ascon.net/main/ in English,
#	https://ascon.ru/ main site in Russian
d109 1
a109 1
# ICQ 358572321, https://vkontakte.ru/id16076543)
d111 1
a111 1
# https://sd.ascon.ru/otrs/customer.pl?Action=CustomerFAQ&CategoryID=4&ItemID=292
d159 1
a159 1
# https://megacad.de/
@


1.1.1.10
log
@Import 5.38:
	- Always accept -S (no sandbox) even if we don't support sandboxing
	- More syscalls elided for sandboxiing
	- For ELF dynamic means having an interpreter not just PT_DYNAMIC
	- Check for large ELF session header offset
	- When saving and restoring a locale, keep the locale name in our
	  own storage.
	- Add a flag to disable CSV file detection.
	- Don't pass NULL/0 to memset to appease sanitizers.
	- Avoid spurious prints when looks for extensions or apple strings
	  in fsmagic.
	- Add builtin decompressors for xz and and bzip.
	- Add a limit for the number of CDF elements.
	- More checks for overflow in CDF.
@
text
@d3 1
a3 1
# $File: cad,v 1.20 2019/08/10 13:34:17 christos Exp $
d21 23
a43 156
# 
# URL:		https://en.wikipedia.org/wiki/MicroStation
# reference:	http://dgnlib.maptools.org/dgn.html
#		http://dgnlib.maptools.org/dl/ref18.pdf
# Update:	Joerg Jenderek
# Note: verfied by command like `dgndump seed2d_b.dgn`
# test for level 8 and type 5 or 9
0	beshort&0x3F73	0x0801
# level of element like 8
#>0	ubyte&0x3F	x			\b, level %u
#>0	ubyte		&0x80			\b, complex
#>0	ubyte		&0x40			\b, reserved
# type of element 9~TCB 8~Digitizer setup 5~Group Data Elements
#>1	ubyte&0x7F	x			\b, type %u
# words to follow in element: 17H~CEL libray 2FEh~DGN 9FEh,DFEh~CIT
#>2	uleshort	x			\b, words 0x%4.4x to follow
# test for 3 reserved 0 bytes in CIT or "conversion" in ViewInfo structure (DGN CEL)
#>508	ubelong		x			\b, RESERVED %8.8x
>508	ubelong&0xFFffFF00	=0
# test for level 8 and type 9 for INGR raster image
>>0	beshort		0x0809
# test for length of 1st element is multiple of blocks a 512 bytes
>>>2	ubyte		0xfe
>>>>0 	use		ingr-image
# test for DGN or CEL by jump words (uleshort) forward to next element
>(2.s*2)	ulong		x
# 2nd element type: 8~Digitizer~DesiGNfile 1~library cell header other~CIT
#>>&1		ubyte&0x7F	x		\b, 2nd type %u
# DGN
>>&1		ubyte&0x7F	8
>>>2		uleshort	=0x02FE		Bentley/Intergraph Microstation CAD drawing
!:mime		application/x-bentley-dgn
!:ext		dgn
# The 0x40 bit of this byte is 1 if the file is 3D, otherwise 0
>>>>1214	ubyte  		&0x40		3D
>>>>1214	ubyte  		^0x40		2D
# 2 chars for name of subunits like ft FT in IN mu m mm '\0 '\040
>>>>1120	string		x		\b, units %-.2s
# 2 chars for name of master unit like IN in ML SU tn th TH HU mm "\0 "\040 \0\0
>>>>1122	string		>\0		%-.2s
#>>>>1120	ubelong		x		\b, units 0x%8.8x
# element range low,high x y z like xlow=0 08010000h 01080000h
#>>>>4		ubelong	  	!0		\b, xlow %8.8x
#>>>>8		ubelong	  	!0		\b, ylow %8.8x
#>>>>12		ubelong	  	!0		\b, zlow %8.8x
#>>>>16		ubelong	  	!0		\b, xhigh %8.8x
#>>>>20		ubelong	  	!0		\b, yhigh %8.8x
#>>>>24		ubelong	  	!0		\b, zhigh %8.8x
# graphic group number; all other elements in that group have same non-0 number
#>>>>28		leshort		x		\b, grphgrp 0x%4.4x
# words to optional attribute linkage
#>>>>30		ubyte		x		\b, attindx \%o
#>>>>31		ubyte		x		\b\%o
# >>30	string	\026\105			DGNFile
# >>30	string	\034\105			DGNFile
# >>30	string	\073\107			DGNFile
# >>30	string	\073\110			DGNFile
# >>30	string	\106\107			DGNFile
# >>30	string	\110\103			DGNFile
# >>30	string	\120\104			DGNFile
# >>30	string	\172\104			DGNFile
# >>30	string	\172\105			DGNFile
# >>30	string	\172\106			DGNFile
# >>30	string	\234\106			DGNFile
# >>30	string	\273\105			DGNFile
# >>30	string	\306\106			DGNFile
# >>30	string	\310\104			DGNFile
# >>30	string	\341\104			DGNFile
# >>30	string	\372\103			DGNFile
# >>30	string	\372\104			DGNFile
# >>30	string	\372\106			DGNFile
# >>30	string	\376\103			DGNFile
# elements properties indicator
#>>>>32		uleshort	!0		\b, properties 0x%4.4x
# class 0~Primary
#>>>>>32		uleshort&0x000F	!0		\b, class 0x%4.4x
# Symbology
#>>>>>34		uleshort	x		\b, Symbology 0x%4.4x
# test for 2nd element type 1~library cell header
>>&1		ubyte&0x7F	1
# test for 1st element with level 8 and type 5 for cell library
>>>0		beshort		0x0805		Bentley/Intergraph Microstation CAD cell library
!:mime		application/x-bentley-cel
!:ext		cel
#
# URL:		http://fileformats.archiveteam.org/wiki/Intergraph_Raster
# reference:	https://web.archive.org/web/20140903185431/
#		http://oreilly.com/www/centers/gff/formats/ingr/index.htm
# note:		verfied by command like `nconvert -fullinfo LONGLAT.CIT`
# display information for intergraph raster bitmap
0	name	ingr-image
# in 5.37 "Microstation CITFile" "Bentley/Intergraph MicroStation CIT raster CAD"
# DataTypeCode indicates format, depth of the pixel data and used compression 
>4	uleshort	x			Intergraph raster image
>>4	uleshort	0x0009			\b, Run-Length Encoded 1-bit
!:mime	image/x-intergraph-rle
!:ext	rel
>>4	uleshort	0x0018			\b, CCITT Group 4 1-bit
!:mime	image/x-intergraph-cit
!:ext	cit
>>4	uleshort	27			\b, Adaptive RLE RGB
!:mime	image/x-intergraph-rgb
!:ext	rgb
>>4	default		x
>>>4	uleshort	x			\b, Type %u
!:mime	image/x-intergraph
# TODO:
#>4	uleshort	0			\b, no data
# ...
#>4	uleshort	0x0045			\b, Continuous Tone CMKY (Uncompressed)
# ApplicationType: 0~generic raster image 3~drawing, scanning
# 8~I/IMAGE and MicroStation Imager 9~ModelView
>6	uleshort	!0			\b, ApplicationType %u
#>6	uleshort	x			\b, ApplicationType %u
# XViewOrigin; Raster grid data X origin
#>8	ulequad		!0			\b, XViewOrigin %llx
# PixelsPerLine is the number of pixels in a scan line of bitmapp
>184	ulelong		x			\b, %u x
# NumberOfLines is height of the raster data in scanlines
>188	ulelong		x			%u
# DeviceResolution; resolution of scanning device
# positive indicates number of micros between lines; negative indicates DPI
#>192	leshort		x			\b, DeviceResolution %d
# ScanlineOrient indicates the origin and the orientation of the scan lines
#>194	ubyte		x			\b, ScanlineOrient %x
>194	ubyte		x			\b, orientation
>194	ubyte		&0x01			right
>194	ubyte		^0x01			left
>194	ubyte		&0x02			down
>194	ubyte		^0x02			top
>194	ubyte		&0x04			horizontal
>194	ubyte		^0x04			vertical
# ScannableFlag; Scanline indexing method used
#>195	ubyte		!0			\b, ScannableFlag 0x%x
# RotationAngle; Rotation angle of raster data
#>196	ubequad		!0			\b, RotationAngle 0x%llx
# SkewAngle; Skew angle of raster data
#>204	ubequad		!0			\b, SkewAngle %llx
# DataTypeModifier; Additional raster data format info
#>212	uleshort	!0			\b, DataTypeModifier 0x%4.4x
# DesignFile[66]; Name of the design file
>214	string		>\0			\b, DesignFile %-.66s
# DatabaseFile[66]; Name of the database file
>280	string		>\0			\b, DatabaseFile %-.66s
# ParentGridFile[66]; Name of parent grid file
>346	string		>\0			\b, ParentGridFile %-.66s
# FileDescription[80]; Text description of file and contents
>412	string		>\0			\b, FileDescription %-.80s
# MinValue
#>492	ubequad		!0			\b, MinValue 0x%llx
# MaxValue
#>500	ubequad		!0			\b, MaxValue 0x%llx
# Reserved[3]; Unused (always 0)
#>508	ubelong&0xFFffFF00	x		\b, RESERVED %8.8x
# GridFileVersion; Grid File Version like 2 3
#>511	ubyte		x			\b, GridFileVersion %x
d143 6
@


1.1.1.11
log
@Import 5.39:

   * Remove unused subtype_mime (Steve Grubb)
   * Remove unused check in okstat (Steve Grubb)
   * Fix mime-type in elf binaries by making sure $x is set
   * Fix indirect negative offsets broken by OFFNEGATIVE
   * Fix GUID equality check
   * PR/165: Handle empty array and strings in JSON
   * PR/162: Add --exclude-quiet
   * Fix memory leak in ascmagic (Steve Grubb)
   * Fix string comparison length with ignore whitespace
   * Fix mingwin 64 compilation
   * PR/159: whitelist getpid needed for file_pipe2file()
   * Indicate negative offsets with a flag OFFNEGATIVE
     so that -0 works.
   * Introduce "offset" magic type that can be used to
     detect the file size, and bail on short files.
   * document DER better in the magic man page.
   * fix memory leaks (SonarQube)
   * rewrite confusing loops (SonarQube)
   * fix bogus test (SonarQube)
   * pass a sized buffer to file_fmttime() (SonarQube)
   * Don't allow * in printf formats, or the code itself (Christoph Biedl)
   * Introduce a printf output size checker to avoid DoS attacks
   * Avoid memory leak on error (oss-fuzz)
   * Check length of string on DER before derefercing and add new types
   * Add missing DER string (oss-fuzz)
   * Add missing DER types, and debugging
   * PR/140: Avoid abort with hand-crafted magic file (gockelhahn)
   * PR/139:  Avoid DoS in printf with hand-crafted magic file (gockelhahn)
   * PR/138: Avoid crash with hand-crafted magic file (gockelhahn)
   * PR/136: Fix static build by adding a libmagic.pc (Fabrice Fontaine)
   * add guid support native support via the "guid" type.
@
text
@d3 1
a3 1
# $File: cad,v 1.23 2020/05/30 23:58:07 christos Exp $
d232 1
a232 5
0	string	AC1027	DWG AutoDesk AutoCAD 2013-2017
!:mime image/vnd.dwg

# From GNU LibreDWG
0	string	AC1032	DWG AutoDesk AutoCAD 2018/2019
a317 3

4	regex/b	P[0-9][0-9]\\.[0-9][0-9][0-9][0-9]\\.[0-9][0-9][0-9][0-9]\\.[0-9]	NAXOS CAD System file from version %s
!:strength +40
@


1.1.1.12
log
@2021-03-30  20:21  Christos Zoulas <christos@@zoulas.com>

	* release 5.40

2021-02-05  16:31  Christos Zoulas <christos@@zoulas.com>

	* PR/234: Add limit to the number of bytes to scan for encoding
	* PR/230: Fix /T (trim flag) for regex

2021-02-01  12:31  Christos Zoulas <christos@@zoulas.com>
	* PR/77: Trim trailing separator.

2020-12-17  15:44  Christos Zoulas <christos@@zoulas.com>

	* PR/211: Convert system read errors from corrupt ELF
	  files into human readable error messages

2020-12-08  16:24  Christos Zoulas <christos@@zoulas.com>

	* fix multithreaded decompression file descriptor issue
	  by using close-on-exec (Denys Vlasenko)

2020-06-27  11:58  Christos Zoulas <christos@@zoulas.com>

	* Exclude surrogate pairs from utf-8 detection (Michael Liu)

2020-06-25  12:53  Christos Zoulas <christos@@zoulas.com>

	* Include # to the list of ignored format chars (Werner Fink)
@
text
@d3 1
a3 1
# $File: cad,v 1.25 2021/02/23 00:51:10 christos Exp $
d35 1
a35 1
# words to follow in element: 17H~CEL library 2FEh~DGN 9FEh,DFEh~CIT
a215 2
0	string	AC1013	DWG AutoDesk AutoCAD Release 13c3
!:mime image/vnd.dwg
d218 1
a218 1
0	string	AC1015	DWG AutoDesk AutoCAD 2000
d236 1
a236 3
0	string	AC1032	DWG AutoDesk AutoCAD 2018/2019/2020
!:mime image/vnd.dwg
0	string	AC1035	DWG AutoDesk AutoCAD 2021
a311 1
>>>>&1	search/8192	AC1013			\b, R13c3
a316 3
>>>>&1	search/8192	AC1027			\b, version 2013
>>>>&1	search/8192	AC1032			\b, version 2018
>>>>&1	search/8192	AC1035			\b, version 2021
@


1.1.1.13
log
@Import file-5.43+; last was file-5.40

2022-09-20  17:12  Christos Zoulas <christos@@zoulas.com>

	* fixed various clustefuzz issues

2022-09-19  15:54  Christos Zoulas <christos@@zoulas.com>

	* Fix error detection for decompression code (Vincent Mihalkovic)

2022-09-15  13:50  Christos Zoulas <christos@@zoulas.com>

	* Add MAGIC_NO_COMPRESS_FORK and use it to produce a more
	  meaningful error message if we are sandboxing.

2022-09-15  10:45  Christos Zoulas <christos@@zoulas.com>

	* Add built-in lzip decompression support (Michal Gorny)

2022-09-14  10:35  Christos Zoulas <christos@@zoulas.com>

	* Add built-in zstd decompression support (Martin Rodriguez Reboredo)

2022-09-13  14:55  Christos Zoulas <christos@@zoulas.com>

	* release 5.43

2022-09-10   9:17  Christos Zoulas <christos@@zoulas.com>

	* Add octal indirect magic (Michal Gorny)

2022-08-17  11:43  Christos Zoulas <christos@@zoulas.com>

	* PR/374: avoid infinite loop in non-wide code (piru)
	* PR/373: Obey MAGIC_CONTINUE with multiple magic files (vismarli)

2022-07-26  11:10  Christos Zoulas <christos@@zoulas.com>

	* Fix bug with large flist (Florian Weimer)

2022-07-07  13:21  Christos Zoulas <christos@@zoulas.com>

        * PR/364: Detect non-nul-terminated core filenames from QEMU
	  (mam-ableton)

2022-07-04  15:45  Christos Zoulas <christos@@zoulas.com>

	* PR/359: Add support for http://ndjson.org/ (darose)
	* PR/362: Fix wide printing (ro-ee)
	* PR/358: Fix width for -f - (jpalus)
	* PR/356: Fix JSON constant parsing (davewhite)

2022-06-10   9:40  Christos Zoulas <christos@@zoulas.com>

	* release 5.42

2022-05-31  14:50   Christos Zoulas <christos@@zoulas.com>

	* PR/348: add missing cases to prevent file from aborting on
	  random magic files.

2022-05-27  21:05   Christos Zoulas <christos@@zoulas.com>

	* PR/351: octalify filenames when not raw before printing.

2022-04-18  17:51   Christos Zoulas <christos@@zoulas.com>

	* fix regex cacheing bug (Dirk Mueller)
	* merge file_regcomp and file_regerror() to simplify the code
	  and reduce memory requirements for storing regexes (Dirk Mueller)

2022-03-19  12:56   Christos Zoulas <christos@@zoulas.com>

	* cache regex (Dirk Mueller)
	* detect filesystem full by flushing output (Dirk Mueller)

2021-11-19  12:36   Christos Zoulas <christos@@zoulas.com>

	* implement running decompressor programs using
	  posix_spawnp(2) instead of vfork(2)

2021-10-24  11:51   Christos Zoulas <christos@@zoulas.com>

	* Add support for msdos dates and times

2021-10-20   9:55   Christos Zoulas <christos@@zoulas.com>

	* use the system byte swapping functions if available (Werner Fink)

2021-10-18  11:57  Christos Zoulas <christos@@zoulas.com>

	* release 5.41

2021-09-23  03:51  Christos Zoulas <christos@@zoulas.com>

	* Avinash Sonawane: Fix tzname detection

2021-09-03  09:17  Christos Zoulas <christos@@zoulas.com>

	* Fix relationship tests with "search" magic, don't short circuit
	  logic

2021-07-13  01:06  Christos Zoulas <christos@@zoulas.com>

	* Fix memory leak in compile mode

2021-07-01  03:51  Christos Zoulas <christos@@zoulas.com>

	* PR/272: kiefermat: Only set returnval = 1 when we printed something
	  (in all cases print or !print). This simplifies the logic and fixes
	  the issue in the PR with -k and --mime-type there was no continuation
	  printed before the default case.

2021-06-30  13:07  Christos Zoulas <christos@@zoulas.com>

	* PR/270: Don't translate unprintable characters in %s magic formats
	  when -r
	* PR/269: Avoid undefined behavior with clang (adding offset to NULL)

2021-05-09  18:38  Christos Zoulas <christos@@zoulas.com>

	* Add a new flag (f) that requires that the match is a full word,
	   not a partial word match.
	* Add varint types (unused)

2021-04-19  17:17  Christos Zoulas <christos@@zoulas.com>

	* PR/256: mutableVoid: If the file is less than 3 bytes, use the file
	  length to determine type
	* PR/259: aleksandr.v.novichkov: mime printing through indirect magic
	  is not taken into account, use match directly so that it does.

2021-04-04  17:02  Christos Zoulas <christos@@zoulas.com>

	* count the total bytes found not the total byte positions
	  in order to determine encoding (Anatol Belski)
@
text
@d3 1
a3 1
# $File: cad,v 1.30 2022/09/20 20:11:57 christos Exp $
d36 1
a36 1
#>2	uleshort	x			\b, words %#4.4x to follow
d61 1
a61 1
#>>>>1120	ubelong		x		\b, units %#8.8x
d70 1
a70 1
#>>>>28		leshort		x		\b, grphgrp %#4.4x
d94 1
a94 1
#>>>>32		uleshort	!0		\b, properties %#4.4x
d96 1
a96 1
#>>>>>32		uleshort&0x000F	!0		\b, class %#4.4x
d98 1
a98 1
#>>>>>34		uleshort	x		\b, Symbology %#4.4x
d154 1
a154 1
#>195	ubyte		!0			\b, ScannableFlag %#x
d156 1
a156 1
#>196	ubequad		!0			\b, RotationAngle %#llx
d160 1
a160 1
#>212	uleshort	!0			\b, DataTypeModifier %#4.4x
d170 1
a170 1
#>492	ubequad		!0			\b, MinValue %#llx
d172 1
a172 1
#>500	ubequad		!0			\b, MaxValue %#llx
a289 2
# Beat sgi MMV
!:strength +20
d302 2
a303 2
0	string	;;\040HSF\040V		OpenHSF (Hoops Stream Format)
>7	regex/9 V[.0-9]{4,5}\040	%s
a332 71

# glTF (GL Transmission Format) - by the Khronos Group
# Reference: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#glb-file-format-specification
0	string		glTF		glTF binary model
>4	ulelong		x		\b, version %d
>8	ulelong		x		\b, length %d bytes
!:mime	model/gltf-binary
!:ext	glb

# FBX (FilmBoX) - by Kaydara/Autodesk
# Reference: https://code.blender.org/2013/08/fbx-binary-file-format-specification
0	string	Kaydara\ FBX\ Binary\ \ \0	Kaydara FBX model,
>&2	ulelong	x	version %d
!:ext	fbx

# PLY (Polygon File Format/Stanford Triangle Format) - by Greg Turk
# Reference: https://web.archive.org/web/20161204152348/http://www.dcs.ed.ac.uk/teaching/cs4/www/graphics/Web/ply.html
0	string	ply\n          	PLY model,
!:ext	ply
>4	string	format\ ascii\ 	ASCII,
>>&0	regex/6	[0-9.]+        	version %s
>4	string	format\ binary  	binary,
>>&0	string	_little_endian\ 	little endian,
>>>&0	regex/6	[0-9.]+         	version %s
>>&0	string	_big_endian\ 	big endian,
>>>&0	regex/6	[0-9.]+      	version %s

# VRML (Virtual Reality Modeling Language) - by the Web3D Consortium
# From:      Michel Briand <michelbriand@@free.fr>
# Reference: https://www.web3d.org/standards
0	string/w	#VRML\ V1.0\ ascii	VRML 1 file
!:mime	model/vrml
!:ext	wrl
0	string/w	#VRML\ V2.0\ utf8	ISO/IEC 14772 VRML 97 file
!:mime	model/vrml
!:ext	wrl
# X3D, VRML encoded
0	string	#X3D	X3D (Extensible 3D) model, VRML format
>4	string	V
>>5	regex/6	[0-9.]+	\b, version %s
!:mime	model/x3d+vrml
!:ext	x3dv

## XML-based 3D CAD Formats
# From: Michel Briand <michelbriand@@free.fr>, Oliver Galvin <odg@@riseup.net>
0	string/w        \<?xml\ version=
!:strength + 5
# X3D (Extensible 3D)
# Schema:    https://www.web3d.org/specifications/x3d-3.2.dtd
# MIME Type: https://www.iana.org/assignments/media-types/model/x3d+xml
# Example:   https://www.web3d.org/x3d/content/examples/Basic/course/CreateX3DFromStringRandomSpheres.x3d
>20	search/1000/w   \<!DOCTYPE\ X3D         X3D (Extensible 3D) model, XML document
!:mime	model/x3d+xml
!:ext	x3d
# COLLADA (COLLAborative Design Activity) - by the Khronos Group
# Schema:    http://www.collada.org/2005/11/COLLADASchema
# Reference: https://www.khronos.org/collada
>20	search/1000/w	\<COLLADA	COLLADA model, XML document
!:mime	model/vnd.collada+xml
!:ext	dae
# 3MF (3D Manufacturing Format) - by the 3MF Consortium
# Schema:    http://schemas.microsoft.com/3dmanufacturing/core/2015/02
# Reference: https://3mf.io/specification
>20	search/1000/w	xmlns="http://schemas.microsoft.com/3dmanufacturing	3MF (3D Manufacturing Format) model, XML document
!:mime	model/3mf
!:ext	3mf
# AMF (Additive Manufacturing File)
# Reference: https://www.astm.org/Standards/ISOASTM52915.htm
>20	search/1000/w	\<amf	AMF (Additive Manufacturing Format) model, XML document
!:mime	application/x-amf
!:ext	amf
@


1.1.1.14
log
@Update to file-5.45 (Last was file-5.44)

2023-07-27  15:45  Christos Zoulas <christos@@zoulas.com>

	* release 5.45

2023-07-17  11:53  Christos Zoulas <christos@@zoulas.com>

	* PR/465: psrok1: Avoid muslc asctime_r crash

2023-05-21  13:05  Christos Zoulas <christos@@zoulas.com>

	* add SIMH tape format support

2023-02-09  12:50  Christos Zoulas <christos@@zoulas.com>

	* bump the max size of the elf section notes to be read to 128K
	  and make it configurable

2023-01-08   1:08  Christos Zoulas <christos@@zoulas.com>

	* PR/415: Fix decompression with program returning empty

2022-12-26   1:47  Christos Zoulas <christos@@zoulas.com>

	* PR/408: fix -p with seccomp
	* PR/412: fix MinGW compilation
@
text
@d3 1
a3 1
# $File: cad,v 1.31 2022/12/09 15:36:23 christos Exp $
a308 8
# Update:	Joerg Jenderek
# URL:		http://fileformats.archiveteam.org/wiki/DXF
#		https://en.wikipedia.org/wiki/AutoCAD_DXF
# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/d/
#		dxf-var0.trid.xml dxf-var0u.trid.xml dxf-var2.trid.xml dxf-var2u.trid.xml
# Note:		called "AutoCAD Drawing eXchange Format" by TrID and
#		"Drawing Interchange File Format (ASCII)" by DROID
# GRR: some samples does not match 1st test like: abydos.dxf
a311 1
# GRR: some samples without HEADER section like: airplan2.dxf
d313 1
a313 2
#!:mime	application/x-dxf
!:mime	image/vnd.dxf
a314 20
# DROID PUID fmt/64	fmt-64-signature-id-99.dxf
>>>>&1	search/8192	MC0.0			\b, 1.0
# DROID PUID fmt/65	fmt-65-signature-id-100.dxf
>>>>&1	search/8192	AC1.2			\b, 1.2
# DROID PUID fmt/66	fmt-66-signature-id-101.dxf
>>>>&1	search/8192	AC1.3			\b, 1.3
# DROID PUID fmt/67	fmt-67-signature-id-102.dxf
>>>>&1	search/8192	AC1.40			\b, 1.4
# DROID PUID fmt/68	fmt-68-signature-id-103.dxf
>>>>&1	search/8192	AC1.50			\b, 2.0
# DROID PUID fmt/69	fmt-69-signature-id-104.dxf
>>>>&1	search/8192	AC2.10			\b, 2.1
# DROID PUID fmt/70	fmt-70-signature-id-105.dxf
>>>>&1	search/8192	AC2.21			\b, 2.2
# DROID PUID fmt/71	fmt-71-signature-id-106.dxf
>>>>&1	search/8192	AC1002			\b, 2.5
# DROID PUID fmt/72	fmt-72-signature-id-107.dxf
>>>>&1	search/8192	AC1003			\b, 2.6
# DROID PUID fmt/73	fmt-73-signature-id-108.dxf
>>>>&1	search/8192	AC1004			\b, R9
a315 2
# http://cd.textfiles.com/amigaenv/DXF/OBJEKTE/LASTMINUTE/apple.dxf
#>>>>&1	search/8192	AC1008			\b, Rfoo
@


1.1.1.1.2.1
log
@file cad was added on branch jym-xensuspend on 2009-05-13 18:51:55 +0000
@
text
@d1 69
@


1.1.1.1.2.2
log
@Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
@
text
@a0 69

#------------------------------------------------------------------------------
# autocad:  file(1) magic for cad files
#

# AutoCAD DWG versions R13/R14 (www.autodesk.com)
# Written December 01, 2003 by Lester Hightower
# Based on the DWG File Format Specifications at http://www.opendwg.org/
0	string	       \101\103\061\060\061		   AutoCAD
>5	string	       \062\000\000\000\000		   DWG ver. R13
>5	string	       \064\000\000\000\000		   DWG ver. R14

# Microstation DGN/CIT Files (www.bentley.com)
# Last updated July 29, 2005 by Lester Hightower
# DGN is the default file extension of Microstation/Intergraph CAD files.
# CIT is the proprietary raster format (similar to TIFF) used to attach
# raster underlays to Microstation DGN (vector) drawings.
# 
# http://www.wotsit.org/search.asp
# http://filext.com/detaillist.php?extdetail=DGN
# http://filext.com/detaillist.php?extdetail=CIT
#
# http://www.bentley.com/products/default.cfm?objectid=97F351F5-9C35-4E5E-89C2
# 3F86C928&method=display&p_objectid=97F351F5-9C35-4E5E-89C280A93F86C928
# http://www.bentley.com/products/default.cfm?objectid=A5C2FD43-3AC9-4C71-B682
# 721C479F&method=display&p_objectid=A5C2FD43-3AC9-4C71-B682C7BE721C479F
0	string	\010\011\376			Microstation
>3	string	\002
>>30	string	\026\105			DGNFile
>>30	string	\034\105			DGNFile
>>30	string	\073\107			DGNFile
>>30	string	\073\110			DGNFile
>>30	string	\106\107			DGNFile
>>30	string	\110\103			DGNFile
>>30	string	\120\104			DGNFile
>>30	string	\172\104			DGNFile
>>30	string	\172\105			DGNFile
>>30	string	\172\106			DGNFile
>>30	string	\234\106			DGNFile
>>30	string	\273\105			DGNFile
>>30	string	\306\106			DGNFile
>>30	string	\310\104			DGNFile
>>30	string	\341\104			DGNFile
>>30	string	\372\103			DGNFile
>>30	string	\372\104			DGNFile
>>30	string	\372\106			DGNFile
>>30	string	\376\103			DGNFile
>4	string	\030\000\000			CITFile
>4	string	\030\000\003			CITFile

# AutoCad, from Nahuel Greco
# AutoCAD DWG versions R12/R13/R14 (www.autodesk.com)
0	string AC1012	AutoCad (release 12)
0	string AC1013	AutoCad (release 13)
0	string AC1014	AutoCad (release 14)

# CAD: file(1) magic for computer aided design files
# Phillip Griffith <phillip dot griffith at gmail dot com>
# AutoCAD magic taken from the Open Design Alliance's OpenDWG specifications.
#
0	belong	0x08051700	Bentley/Intergraph MicroStation DGN cell library
0	belong	0x0809fe02	Bentley/Intergraph MicroStation DGN vector CAD
0	belong	0xc809fe02	Bentley/Intergraph MicroStation DGN vector CAD
0	beshort	0x0809		Bentley/Intergraph MicroStation
>0x02	byte	0xfe
>>0x04	beshort	0x1800		CIT raster CAD
0	string	AC1012		AutoDesk AutoCAD R13
0	string	AC1014		AutoDesk AutoCAD R14 
0	string	AC1015		AutoDesk AutoCAD R2000
@


