Browse Source

Import upstream version 4.12

Christos Zoulas 16 years ago
parent
commit
927e10538d
100 changed files with 31141 additions and 6501 deletions
  1. 193 0
      ChangeLog
  2. 2 7
      LEGAL.NOTICE
  3. 1 1
      MAINT
  4. 0 39
      Magdir/adventure
  5. 0 10
      Magdir/amigaos
  6. 0 170
      Magdir/animation
  7. 0 144
      Magdir/audio
  8. 0 13
      Magdir/c-lang
  9. 0 74
      Magdir/database
  10. 0 118
      Magdir/filesystems
  11. 0 12
      Magdir/gnu
  12. 0 61
      Magdir/jpeg
  13. 0 101
      Magdir/linux
  14. 0 335
      Magdir/macintosh
  15. 0 31
      Magdir/mcrypt
  16. 0 15
      Magdir/palm
  17. 0 5
      Magdir/python
  18. 0 104
      Magdir/riff
  19. 0 20
      Magdir/sgml
  20. 0 36
      Magdir/ti-8x
  21. 0 65
      Magdir/vorbis
  22. 2 79
      Makefile.am
  23. 315 410
      Makefile.in
  24. 0 167
      Makefile.std
  25. 0 0
      PORTING
  26. 16 12
      README
  27. 0 48
      acconfig.h
  28. 186 26
      acinclude.m4
  29. 4459 111
      aclocal.m4
  30. 0 1145
      apprentice.c
  31. 0 192
      compress.c
  32. 1354 0
      config.guess
  33. 155 62
      config.h.in
  34. 1460 0
      config.sub
  35. 11016 1647
      configure
  36. 54 13
      configure.in
  37. 423 0
      depcomp
  38. 32 0
      doc/Makefile.am
  39. 428 0
      doc/Makefile.in
  40. 97 45
      file.man
  41. 226 0
      doc/libmagic.man
  42. 55 34
      magic.man
  43. 0 476
      file.c
  44. 0 194
      file.h
  45. 0 251
      fsmagic.c
  46. 36 23
      install-sh
  47. 0 101
      is_tar.c
  48. 805 0
      ltcf-c.sh
  49. 2797 0
      ltconfig
  50. 5064 0
      ltmain.sh
  51. 0 0
      magic/Header
  52. 1 1
      Localstuff
  53. 32 0
      magic/Magdir/acorn
  54. 0 0
      magic/Magdir/adi
  55. 63 0
      magic/Magdir/adventure
  56. 0 0
      magic/Magdir/allegro
  57. 0 0
      magic/Magdir/alliant
  58. 0 0
      magic/Magdir/alpha
  59. 0 0
      magic/Magdir/amanda
  60. 56 0
      magic/Magdir/amigaos
  61. 656 0
      magic/Magdir/animation
  62. 0 0
      magic/Magdir/apl
  63. 28 0
      Magdir/apple
  64. 0 0
      magic/Magdir/applix
  65. 80 10
      Magdir/archive
  66. 0 0
      magic/Magdir/asterix
  67. 0 0
      magic/Magdir/att3b
  68. 411 0
      magic/Magdir/audio
  69. 12 0
      magic/Magdir/bFLT
  70. 0 0
      magic/Magdir/blender
  71. 0 0
      magic/Magdir/blit
  72. 9 0
      magic/Magdir/bout
  73. 0 0
      magic/Magdir/bsdi
  74. 24 0
      magic/Magdir/c-lang
  75. 27 0
      magic/Magdir/c64
  76. 36 0
      magic/Magdir/cad
  77. 11 0
      magic/Magdir/cddb
  78. 0 0
      magic/Magdir/chi
  79. 9 0
      magic/Magdir/chord
  80. 0 0
      magic/Magdir/cisco
  81. 0 0
      magic/Magdir/citrus
  82. 1 1
      Magdir/claris
  83. 0 0
      magic/Magdir/clipper
  84. 10 19
      Magdir/commands
  85. 21 0
      magic/Magdir/communications
  86. 51 25
      Magdir/compress
  87. 76 1
      Magdir/console
  88. 0 0
      magic/Magdir/convex
  89. 1 1
      Magdir/ctags
  90. 10 0
      magic/Magdir/dact
  91. 203 0
      magic/Magdir/database
  92. 0 0
      magic/Magdir/diamond
  93. 0 5
      Magdir/diff
  94. 0 0
      magic/Magdir/digital
  95. 57 0
      magic/Magdir/dolby
  96. 0 0
      magic/Magdir/dump
  97. 0 0
      magic/Magdir/dyadic
  98. 4 0
      Magdir/editors
  99. 76 41
      Magdir/elf
  100. 0 0
      Magdir/encore

+ 193 - 0
ChangeLog

@@ -0,0 +1,193 @@
+2004-11-24 12:39  Christos Zoulas  <christos@zoulas.com>
+
+	* Stack smash fix, and ELF more conservative reading.
+	  Jakub Bogusz <qboosh@pld-linux.org>
+
+2004-11-20 18:50  Christos Zoulas  <christos@zoulas.com>
+
+	* New FreeBSD version parsing code:
+	  Jon Noack <noackjr@alumni.rice.edu>
+
+	* Hackish support for ucs16 strings <christos@zoulas.com>
+
+2004-11-13 03:07  Christos Zoulas  <christos@zoulas.com>
+
+	* print the file name and line number in syntax errors.
+
+2004 10-12 10:50  Christos Zoulas  <christos@zoulas.com>
+
+	* Fix stack overwriting on 0 length strings: Tim Waugh
+	    <twaugh@redhat.com> Ned Ludd <solar@gentoo.org>
+
+2004-09-27 11:30  Christos Zoulas  <christos@zoulas.com>
+
+	* Remove 3rd and 4th copyright clause; approved by Ian Darwin.
+
+	* Fix small memory leaks; caught by: Tamas Sarlos 
+	    <stamas@csillag.ilab.sztaki.hu>
+
+2004-07-24 16:33  Christos Zoulas  <christos@zoulas.com>
+
+	* magic.mime update Danny Milosavljevic <danny.milo@gmx.net> 
+
+	* FreeBSD version update Oliver Eikemeier <eikemeier@fillmore-labs.com>
+
+	* utime/utimes detection Ian Lance Taylor <ian@wasabisystems.com>
+
+  	* errors reading elf magic Jakub Bogusz <qboosh@pld-linux.org>
+
+2004-04-12 10:55  Christos Zoulas  <christos@zoulas.com>
+
+	* make sure that magic formats match magic types during compilation
+
+	* fix broken sgi magic file
+
+2004-04-06 20:36  Christos Zoulas  <christos@zoulas.com>
+
+	* detect present of mbstate_t Petter Reinholdtsen <pere@hungry.com>
+
+	* magic fixes
+
+2004-03-22 15:25  Christos Zoulas  <christos@zoulas.com>
+
+	* Lots of mime fixes
+	  (Joerg Ostertag) <ostertag@rechengilde.de>
+
+	* FreeBSD ELF version handling
+	  (Edwin Groothuis) <edwin@mavetju.org>
+
+	* correct cleanup in all cases; don't just close the file.
+	  (Christos Zoulas) <christos@zoulas.com>
+
+	* add gettext message catalogue support
+	  (Michael Piefel) <piefel@debian.org>
+
+	* better printout for unreadable files
+	  (Michael Piefel) <piefel@debian.org>
+
+	* compensate for missing MAXPATHLEN
+	  (Michael Piefel) <piefel@debian.org>
+
+	* add wide character string length computation
+	  (Michael Piefel) <piefel@debian.org>
+
+	* Avoid infinite loops caused by bad elf alignments
+	  or name and description note sizes. Reported by
+	  (Mikael Magnusson) <mmikael@comhem.se>
+
+2004-03-09 13:55  Christos Zoulas  <christos@zoulas.com>
+
+	* Fix possible memory leak on error and add missing regfree
+	  (Dmitry V. Levin) <ldv@altlinux.org>
+
+2003-12-23 12:12  Christos Zoulas  <christos@zoulas.com>
+
+	* fix -k flag (Maciej W. Rozycki)
+
+2003-11-18 14:10  Christos Zoulas  <christos@zoulas.com>
+
+	* Try to give us much info as possible on corrupt elf files.
+	  (Willy Tarreau) <willy@w.ods.org>
+	* Updated python bindings (Brett Funderburg)
+	   <brettf@deepfile.com>
+
+2003-11-11 15:03  Christos Zoulas  <christos@zoulas.com>
+
+	* Include file.h first, because it includes config.h
+	  breaks largefile test macros otherwise.
+	  (Paul Eggert <eggert@CS.UCLA.EDU> via
+	   Lars Hecking <lhecking@nmrc.ie>)
+
+2003-10-14 21:39  Christos Zoulas  <christos@zoulas.com>
+
+	* Python bindings (Brett Funderburg) <brettf@deepfile.com>
+	* Don't lookup past the end of the buffer
+	  (Chad Hanson) <chanson@tcs-sec.com>
+	* Add MAGIC_ERROR and api on magic_errno()
+
+2003-10-08 12:40  Christos Zoulas  <christos@zoulas.com>
+
+	* handle error conditions from compile as fatal
+	  (Antti Kantee) <pooka@netbsd.org>
+	* handle magic filename parsing sanely
+	* more magic fixes.
+	* fix a memory leak (Illes Marton) <illes.marton@balabit.hu>
+	* describe magic file handling
+	  (Bryan Henderson) <bryanh@giraffe-data.com>
+
+2003-09-12 15:09  Christos Zoulas  <christos@zoulas.com>
+
+	* update magic files.
+	* remove largefile support from file.h; it breaks things on most OS's
+
+2003-08-10 10:25  Christos Zoulas  <christos@zoulas.com>
+
+	* fix unmapping'ing of mmaped files.
+
+2003-07-10 12:03  Christos Zoulas  <christos@zoulas.com>
+
+	* don't exit with -1 on error; always exit 1 (Marty Leisner)
+	* restore utimes code.
+
+2003-06-10 17:03  Christos Zoulas  <christos@zoulas.com>
+
+	* make sure we don't access uninitialized memory.
+	* pass lint
+	* #ifdef __cplusplus in magic.h
+
+2003-05-25 19:23  Christos Zoulas  <christos@zoulas.com>
+
+	* rename cvs magic file to revision to deal with
+	  case insensitive filesystems.
+
+2003-05-23 17:03  Christos Zoulas  <christos@zoulas.com>
+
+	* documentation fixes from Michael Piefel <piefel@debian.org>
+	* magic fixes (various)
+	* revert basename magic in .mgc name determination
+	* buffer protection in uncompress,
+	  signness issues,
+	  close files
+	  Maciej W. Rozycki <macro@ds2.pg.gda.pl
+
+2003-04-21 20:12  Christos Zoulas  <christos@zoulas.com>
+
+	* fix zsh magic
+
+2003-04-04 16:59  Christos Zoulas  <christos@zoulas.com>
+
+	* fix operand sort order in string.
+
+2003-04-02 17:30  Christos Zoulas  <christos@zoulas.com>
+
+	* cleanup namespace in magic.h
+
+2003-04-02 13:50  Christos Zoulas  <christos@zoulas.com>
+
+	* Magic additions (Alex Ott)
+	* Fix bug that broke VPATH compilation (Peter Breitenlohner)
+
+2003-03-28 16:03  Christos Zoulas  <christos@zoulas.com>
+
+	* remove packed attribute from magic struct.
+	* make the magic struct properly aligned.
+	* bump version number of compiled files to 2.
+
+2003-03-27 13:10  Christos Zoulas  <christos@zoulas.com>
+
+	* separate tar detection and run it before softmagic.
+	* fix reversed symlink test.
+	* fix version printing.
+	* make separator a string instead of a char.
+	* update manual page and sort options.
+
+2003-03-26 11:00  Christos Zoulas  <christos@zoulas.com>
+
+	* Pass lint
+	* make NULL in magic_file mean stdin
+	* Fix "-" argument to file to pass NULL to magic_file
+	* avoid pointer casts by using memcpy
+	* rename magic_buf -> magic_buffer
+	* keep only the first error
+	* manual page: new sentence, new line
+	* fix typo in api function (magic_buf -> magic_buffer)

+ 2 - 7
LEGAL.NOTICE

@@ -1,7 +1,7 @@
-$Id: LEGAL.NOTICE,v 1.11 1999/01/14 16:30:12 christos Exp $
+$Id: LEGAL.NOTICE,v 1.14 2004/09/11 19:15:56 christos Exp $
 Copyright (c) Ian F. Darwin 1986, 1987, 1989, 1990, 1991, 1992, 1994, 1995.
 Software written by Ian F. Darwin and others;
-maintained 1994-1999 Christos Zoulas.
+maintained 1994-2004 Christos Zoulas.
 
 This software is not subject to any export provision of the United States
 Department of Commerce, and may be exported to any country or planet.
@@ -15,11 +15,6 @@ are met:
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-3. All advertising materials mentioning features or use of this software
-   must display the following acknowledgement:
-   This product includes software developed by Ian F. Darwin and others.
-4. The name of the author may not be used to endorse or promote products
-   derived from this software without specific prior written permission.
  
 THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE

+ 1 - 1
MAINT

@@ -1,4 +1,4 @@
-$Id: MAINT,v 1.4 2000/04/11 02:43:51 christos Exp $
+$Id: MAINT,v 1.5 2003/03/23 04:36:37 christos Exp $
 
 Maintenance notes:
 

+ 0 - 39
Magdir/adventure

@@ -1,39 +0,0 @@
-
-#------------------------------------------------------------------------------
-# adventure: file(1) magic for Adventure game files
-#
-# from Allen Garvin <earendil@faeryland.tamu-commerce.edu>
-# Edited by Dave Chapeskie <dchapes@ddm.on.ca> Jun 28, 1998
-#
-# ALAN
-# I assume there are other, lower versions, but these are the only ones I
-# saw in the archive.
-0	beshort	0x0206	ALAN text adventure code data
->2	byte	<10	version 2.6%d
-
-# Conflicts with too much other stuff!
-# Infocom
-# (Note: to avoid false matches Z-machine version 1 and 2 are not
-# recognized since only the oldest Zork I and II used them.  Similarly
-# there are 4 Infocom games that use verion 4 that are not recognized.)
-#0	byte	3	Infocom game data (Z-machine 3,
-#>2	beshort	<0x7fff	Release %3d,
-#>26	beshort >0	Size %d*2
-#>18	string	>\0	Serial %.6s)
-#0	byte	5	Infocom game data (Z-machine 5,
-#>2	beshort	<0x7fff	Release %3d,
-#>26	beshort >0	Size %d*4
-#>18	string	>\0	Serial %.6s)
-#0	byte	6	Infocom game data (Z-machine 6,
-#>2	beshort	<0x7fff	Release %3d,
-#>26	beshort >0	Size %d*8
-#>18	string	>\0	Serial %.6s)
-#0	byte	8	Infocom game data (Z-machine 8,
-#>2	beshort	<0x7fff	Release %3d,
-#>26	beshort >0	Size %d*8
-#>18	string	>\0	Serial %.6s)
-
-# TADS (Text Adventure Development System)
-0	string	TADS	TADS game data
->13	string	>\0	(ver. %.6s,
->22	string	>\0	date %s)

+ 0 - 10
Magdir/amigaos

@@ -1,10 +0,0 @@
-#------------------------------------------------------------------------------
-# amigaos:  file(1) magic for AmigaOS binary formats:
-
-#
-# From ignatios@cs.uni-bonn.de (Ignatios Souvatzis)
-# Some formats are still missing: AmigaOS special IFF's, e.g.: FORM....CTLG
-# (the others should be separate, anyway)
-#
-0	belong		0x000003f3	AmigaOS loadseg()ble executable/binary
-0	belong		0x000003e7	AmigaOS object/library data

+ 0 - 170
Magdir/animation

@@ -1,170 +0,0 @@
-
-#------------------------------------------------------------------------------
-# animation:  file(1) magic for animation/movie formats
-#
-# animation formats
-# MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8)
-# FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com)
-
-# MPEG animation format
-0	belong		0x000001b3		MPEG video stream data
-#>4	beshort&0xfff0	x			(%d x
-#>5	beshort&0x0fff  x			%d)
-0	belong		0x000001ba		MPEG system stream data
-
-# MPEG Audio (*.mpx)
-# from dreesen@math.fu-berlin.de
-
-# XXX
-# This conflicts with the FF FE signature for UTF-16-encoded Unicode
-# text, which will be identified as an MP3 file.  I don't have any MP3s
-# so I don't know how to (or even if it's possible to) change this to
-# tell the two apart.    enf@pobox.com
-
-0       beshort         &0xfff0         MP
-# MPEG 1.0
->1      byte&0x08       =0x08           \b
-# Layer 3
->>1     byte            &0x02           \b3
->>>2    byte&0xf0       =0x10           \b,  32 kBits
->>>2    byte&0xf0       =0x20           \b,  40 kBits
->>>2    byte&0xf0       =0x30           \b,  48 kBits
->>>2    byte&0xf0       =0x40           \b,  56 kBits
->>>2    byte&0xf0       =0x50           \b,  64 kBits
->>>2    byte&0xf0       =0x60           \b,  80 kBits
->>>2    byte&0xf0       =0x70           \b,  96 kBits
->>>2    byte&0xf0       =0x80           \b, 112 kBits
->>>2    byte&0xf0       =0x90           \b, 128 kBits
->>>2    byte&0xf0       =0xA0           \b, 160 kBits
->>>2    byte&0xf0       =0xB0           \b, 192 kBits
->>>2    byte&0xf0       =0xC0           \b, 224 kBits
->>>2    byte&0xf0       =0xD0           \b, 256 kBits
->>>2    byte&0xf0       =0xE0           \b, 320 kBits
-# Layer 2
->>1     byte            &0x04           \b2
->>>2    byte&0xf0       =0x10           \b,  32 kBits
->>>2    byte&0xf0       =0x20           \b,  48 kBits
->>>2    byte&0xf0       =0x30           \b,  56 kBits
->>>2    byte&0xf0       =0x40           \b,  64 kBits
->>>2    byte&0xf0       =0x50           \b,  80 kBits
->>>2    byte&0xf0       =0x60           \b,  96 kBits
->>>2    byte&0xf0       =0x70           \b, 112 kBits
->>>2    byte&0xf0       =0x80           \b, 128 kBits
->>>2    byte&0xf0       =0x90           \b, 160 kBits
->>>2    byte&0xf0       =0xA0           \b, 192 kBits
->>>2    byte&0xf0       =0xB0           \b, 224 kBits
->>>2    byte&0xf0       =0xC0           \b, 256 kBits
->>>2    byte&0xf0       =0xD0           \b, 320 kBits
->>>2    byte&0xf0       =0xE0           \b, 384 kBits
-# freq
->>2     byte&0x0C       =0x00           \b, 44.1 kHz
->>2     byte&0x0C       =0x04           \b, 48 kHz
->>2     byte&0x0C       =0x08           \b, 32 kHz
-# MPEG 2.0
->1      byte&0x08       =0x00           \b
-# Layer 3
->>1     byte            &0x02           \b3
-# Layer 2
->>1     byte            &0x04           \b2
->>2     byte&0xf0       =0x10           \b,   8 kBits
->>2     byte&0xf0       =0x20           \b,  16 kBits
->>2     byte&0xf0       =0x30           \b,  24 kBits
->>2     byte&0xf0       =0x40           \b,  32 kBits
->>2     byte&0xf0       =0x50           \b,  40 kBits
->>2     byte&0xf0       =0x60           \b,  48 kBits
->>2     byte&0xf0       =0x70           \b,  56 kBits
->>2     byte&0xf0       =0x80           \b,  64 kBits
->>2     byte&0xf0       =0x90           \b,  80 kBits
->>2     byte&0xf0       =0xA0           \b,  96 kBits
->>2     byte&0xf0       =0xB0           \b, 112 kBits
->>2     byte&0xf0       =0xC0           \b, 128 kBits
->>2     byte&0xf0       =0xD0           \b, 144 kBits
->>2     byte&0xf0       =0xE0           \b, 160 kBits
-# freq
->>2     byte&0x0C       =0x00           \b, 22.05 kHz
->>2     byte&0x0C       =0x04           \b, 24 kHz
->>2     byte&0x0C       =0x08           \b, 16 kHz
-# misc
->3      byte&0xC0       =0x00           \b, Stereo
->3      byte&0xC0       =0x40           \b, JStereo
->3      byte&0xC0       =0x80           \b, Dual-Ch
->3      byte&0xC0       =0xC0           \b, Mono
-#>1     byte&0x01       =0x00           \b, Error Protection
-#>2     byte&0x02       =0x02           \b, Padding
-#>2     byte&0x01       =0x01           \b, Private
-#>3     byte&0x08       =0x08           \b, Copyright
-#>3     byte&0x04       =0x04           \b, Original
-#>3     byte&0x03       1               \b, Emphasis 5
-#>3     byte&0x03       3               \b, Emphasis c
-
-# FLI animation format
-4	leshort		0xAF11			FLI file
->6	leshort		x			- %d frames,
->8	leshort		x			width=%d pixels,
->10	leshort		x			height=%d pixels,
->12	leshort		x			depth=%d,
->16	leshort		x			ticks/frame=%d
-# FLC animation format
-4	leshort		0xAF12			FLC file
->6	leshort		x			- %d frames
->8	leshort		x			width=%d pixels,
->10	leshort		x			height=%d pixels,
->12	leshort		x			depth=%d,
->16	leshort		x			ticks/frame=%d
-
-# DL animation format
-# XXX - collision with most `mips' magic
-#
-# I couldn't find a real magic number for these, however, this
-# -appears- to work.  Note that it might catch other files, too, so be
-# careful!
-#
-# Note that title and author appear in the two 20-byte chunks
-# at decimal offsets 2 and 22, respectively, but they are XOR'ed with
-# 255 (hex FF)!  The DL format is really bad.
-#
-#0	byte	1	DL version 1, medium format (160x100, 4 images/screen)
-#>42	byte	x	- %d screens,
-#>43	byte	x	%d commands
-#0	byte	2	DL version 2
-#>1	byte	1	- large format (320x200,1 image/screen),
-#>1	byte	2	- medium format (160x100,4 images/screen),
-#>1	byte	>2	- unknown format,
-#>42	byte	x	%d screens,
-#>43	byte	x	%d commands
-# Based on empirical evidence, DL version 3 have several nulls following the
-# \003.  Most of them start with non-null values at hex offset 0x34 or so.
-#0	string	\3\0\0\0\0\0\0\0\0\0\0\0	DL version 3
-
-# SGI and Apple formats
-0	string		MOVI		Silicon Graphics movie file
-4	string		moov		Apple QuickTime movie file (moov)
-4	string		mdat		Apple QuickTime movie file (mdat)
-
-# iso 13818 transport stream
-#
-# from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001 (ISO 13818.1)
-# (the following is a little bit restrictive and works fine for a stream
-#  that starts with PAT properly. it won't work for stream data, that is
-#  cut from an input device data right in the middle, but this shouldn't
-#  disturb)
-# syncbyte      8 bit	0x47
-# error_ind     1 bit	-
-# payload_start 1 bit	1
-# priority      1 bit	-
-# PID          13 bit	0x0000
-# scrambling    2 bit	-
-# adaptfld_ctrl 2 bit	1 or 3
-# conti_count   4 bit	0
-0	belong&0xFF5FFF1F	0x47400010	MPEG transport stream data
->188	byte			!0x47		CORRUPTED
-
-# DIF digital video file format <mpruett@sgi.com>
-0	belong&0xffffff00	0x1f070000      DIF
->4	byte			&0x01		(DVCPRO) movie file
->4	byte			^0x01		(DV) movie file
->3	byte			&0x80		(PAL)
->3	byte			^0x80		(NTSC)
-
-# Microsoft Advanced Streaming Format (ASF) <mpruett@sgi.com>
-0	belong			0x3026b275	Microsoft ASF

+ 0 - 144
Magdir/audio

@@ -1,144 +0,0 @@
-
-#------------------------------------------------------------------------------
-# audio:  file(1) magic for sound formats (see also "iff")
-#
-# Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
-# and others
-#
-
-# Sun/NeXT audio data
-0	string		.snd		Sun/NeXT audio data:
->12	belong		1		8-bit ISDN u-law,
->12	belong		2		8-bit linear PCM [REF-PCM],
->12	belong		3		16-bit linear PCM,
->12	belong		4		24-bit linear PCM,
->12	belong		5		32-bit linear PCM,
->12	belong		6		32-bit IEEE floating point,
->12	belong		7		64-bit IEEE floating point,
->12	belong		23		8-bit ISDN u-law compressed (CCITT G.721 ADPCM voice data encoding),
->12	belong		24		compressed (8-bit G.722 ADPCM)
->12	belong		25		compressed (3-bit G.723 ADPCM),
->12	belong		26		compressed (5-bit G.723 ADPCM),
->12	belong		27		8-bit A-law,
->20	belong		1		mono,
->20	belong		2		stereo,
->20	belong		4		quad,
->16	belong		>0		%d Hz
-
-# DEC systems (e.g. DECstation 5000) use a variant of the Sun/NeXT format
-# that uses little-endian encoding and has a different magic number
-0	lelong		0x0064732E	DEC audio data:
->12	lelong		1		8-bit ISDN u-law,
->12	lelong		2		8-bit linear PCM [REF-PCM],
->12	lelong		3		16-bit linear PCM,
->12	lelong		4		24-bit linear PCM,
->12	lelong		5		32-bit linear PCM,
->12	lelong		6		32-bit IEEE floating point,
->12	lelong		7		64-bit IEEE floating point,
->12	lelong		23		8-bit ISDN u-law compressed (CCITT G.721 ADPCM voice data encoding),
->20	lelong		1		mono,
->20	lelong		2		stereo,
->20	lelong		4		quad,
->16	lelong		>0		%d Hz
-
-# Creative Labs AUDIO stuff
-0	string	MThd			Standard MIDI data
->9 	byte	>0			(format %d)
->11	byte	>1			using %d tracks
-0	string	CTMF			Creative Music (CMF) data
-0	string	SBI			SoundBlaster instrument data
-0	string	Creative\ Voice\ File	Creative Labs voice data
-# is this next line right?  it came this way...
->19	byte	0x1A
->23	byte	>0			- version %d
->22	byte	>0			\b.%d
-
-# first entry is also the string "NTRK"
-0	belong		0x4e54524b	MultiTrack sound data
->4	belong		x		- version %ld
-
-# Extended MOD format (*.emd) (Greg Roelofs, newt@uchicago.edu); NOT TESTED
-# [based on posting 940824 by "Dirk/Elastik", husberg@lehtori.cc.tut.fi]
-0	string		EMOD		Extended MOD sound data,
->4	byte&0xf0	x		version %d
->4	byte&0x0f	x		\b.%d,
->45	byte		x		%d instruments
->83	byte		0		(module)
->83	byte		1		(song)
-
-# Real Audio (Magic .ra\0375)
-0	belong		0x2e7261fd	RealAudio sound file
-0	string		.RMF		RealMedia file
-
-# MTM/669/FAR/S3M/ULT/XM format checking [Aaron Eppert, aeppert@dialin.ind.net]
-# Oct 31, 1995
-0	string		MTM		MultiTracker Module sound file
-#0	string		if		Composer 669 Module sound data
-0	string		FAR		Module sound data
-0	string		MAS_U		ULT(imate) Module sound data
-0x2c	string		SCRM		ScreamTracker III Module sound data
-0	string		Extended Module	Extended Module sound data
-
-# Gravis UltraSound patches
-# From <ache@nagual.ru>
-
-0	string		GF1PATCH110\0ID#000002\0	GUS patch
-0	string		GF1PATCH100\0ID#000002\0	Old GUS	patch
-
-#
-# Taken from loader code from mikmod version 2.14
-# by Steve McIntyre (stevem@chiark.greenend.org.uk)
-0	string	JN		extended 669 module data
-0	string	MAS_UTrack_V00
->14	string	>/0		ultratracker V1.%.1s module sound data
-0	string	UN05		MikMod UNI format module sound data
-0	string	Extended\ Module: Fasttracker II module sound data
-21	string	!SCREAM!	Screamtracker 2 module sound data
-1080	string	M.K.		4-channel Protracker module sound data
-1080	string	M!K!		4-channel Protracker module sound data
-1080	string	FLT4		4-channel Startracker module sound data
-1080	string	4CHN		4-channel Fasttracker module sound data
-1080	string	6CHN		6-channel Fasttracker module sound data
-1080	string	8CHN		8-channel Fasttracker module sound data
-1080	string	CD81		8-channel Oktalyzer module sound data
-1080	string	OKTA		8-channel Oktalyzer module sound data
-# Not good enough.
-#1082	string	CH
-#>1080	string	>/0		%.2s-channel Fasttracker "oktalyzer" module sound data
-1080	string	16CN		16-channel Taketracker module sound data
-1080	string	32CN		32-channel Taketracker module sound data
-
-# TOC sound files -Trevor Johnson <trevor@jpj.net>
-#
-0       string          TOC             TOC sound file
-
-# sidfiles <pooka@iki.fi>
-0	string		SIDPLAY\ INFOFILE	Sidplay info file
-0	string		PSID			PlaySID v2.2+ (AMIGA) sidtune
->4	beshort		>0			w/ header v%d,
->14	beshort		=1			single song,
->14	beshort		>1			%d songs,
->16	beshort		>0			default song: %d
-
-# IRCAM <mpruett@sgi.com>
-# VAX and MIPS files are little-endian; Sun and NeXT are big-endian
-0	belong		0x64a30100		IRCAM file (VAX)
-0	belong		0x64a30200		IRCAM file (Sun)
-0	belong		0x64a30300		IRCAM file (MIPS little-endian)
-0	belong		0x64a30400		IRCAM file (NeXT)
-
-# NIST SPHERE <mpruett@sgi.com>
-0	string		NIST_1A\n\ \ \ 1024\n	NIST SPHERE file
-
-# Sample Vision <mpruett@sgi.com>
-0	string		SOUND\ SAMPLE\ DATA\ 	Sample Vision file
-
-# Audio Visual Research <mpruett@sgi.com>
-0	string		2BIT			Audio Visual Research file
-
-# From Felix von Leitner <leitner@fefe.de>
-0	string		OggS	Ogg-Vorbis compressed sound file
-
-# SGI SoundTrack <mpruett@sgi.com>
-0	string		_SGI_SoundTrack		SGI SoundTrack project file
-0	string		ID3	mp3 file with ID3 2.0 tag

+ 0 - 13
Magdir/c-lang

@@ -1,13 +0,0 @@
-
-#------------------------------------------------------------------------------
-# c-lang:  file(1) magic for C programs (or REXX)
-#
-
-# XPM icons (Greg Roelofs, newt@uchicago.edu)
-# if you uncomment "/*" for C/REXX below, also uncomment this entry
-#0	string		/*\ XPM\ */	X pixmap image data
-
-# this first will upset you if you're a PL/1 shop...
-# in which case rm it; ascmagic will catch real C programs
-#0	string		/*		C or REXX program text
-0	string		//		C++ program text

+ 0 - 74
Magdir/database

@@ -1,74 +0,0 @@
-
-#------------------------------------------------------------------------------
-# database:  file(1) magic for various databases
-#
-# extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
-#
-#
-# GDBM magic numbers
-#  Will be maintained as part of the GDBM distribution in the future.
-#  <downsj@teeny.org>
-0	belong	0x13579ace	GNU dbm 1.x or ndbm database, big endian
-0	lelong	0x13579ace	GNU dbm 1.x or ndbm database, little endian
-0	string	GDBM		GNU dbm 2.x database
-#
-# Berkeley DB
-#
-# Ian Darwin's file /etc/magic files: big/little-endian version.
-#
-# Hash 1.85/1.86 databases store metadata in network byte order.
-# Btree 1.85/1.86 databases store the metadata in host byte order.
-# Hash and Btree 2.X and later databases store the metadata in host byte order.
-
-0	long	0x00061561	Berkeley DB
->8	belong	4321
->>4	belong	>2		1.86
->>4	belong	<3		1.85
->>4	belong	>0		(Hash, version %d, native byte-order)
->8	belong	1234
->>4	belong	>2		1.86
->>4	belong	<3		1.85
->>4	belong	>0		(Hash, version %d, little-endian)
-
-0	belong	0x00061561	Berkeley DB
->8	belong	4321
->>4	belong	>2		1.86
->>4	belong	<3		1.85
->>4	belong	>0		(Hash, version %d, big-endian)
->8	belong	1234
->>4	belong	>2		1.86
->>4	belong	<3		1.85
->>4	belong	>0		(Hash, version %d, native byte-order)
-
-0	long	0x00053162	Berkeley DB 1.85/1.86
->4	long	>0		(Btree, version %d, native byte-order)
-0	belong	0x00053162	Berkeley DB 1.85/1.86
->4	belong	>0		(Btree, version %d, big-endian)
-0	lelong	0x00053162	Berkeley DB 1.85/1.86
->4	lelong	>0		(Btree, version %d, little-endian)
-
-12	long	0x00061561	Berkeley DB
->16	long	>0		(Hash, version %d, native byte-order)
-12	belong	0x00061561	Berkeley DB
->16	belong	>0		(Hash, version %d, big-endian)
-12	lelong	0x00061561	Berkeley DB
->16	lelong	>0		(Hash, version %d, little-endian)
-
-12	long	0x00053162	Berkeley DB
->16	long	>0		(Btree, version %d, native byte-order)
-12	belong	0x00053162	Berkeley DB
->16	belong	>0		(Btree, version %d, big-endian)
-12	lelong	0x00053162	Berkeley DB
->16	lelong	>0		(Btree, version %d, little-endian)
-
-12	long	0x00042253	Berkeley DB
->16	long	>0		(Queue, version %d, native byte-order)
-12	belong	0x00042253	Berkeley DB
->16	belong	>0		(Queue, version %d, big-endian)
-12	lelong	0x00042253	Berkeley DB
->16	lelong	>0		(Queue, version %d, little-endian)
-#
-#
-# Round Robin Database Tool by Tobias Oetiker <oetiker@ee.ethz.ch>
-0	string	RRD		RRDTool DB
->4	string	x		version %s

+ 0 - 118
Magdir/filesystems

@@ -1,118 +0,0 @@
-
-#------------------------------------------------------------------------------
-# filesystems:  file(1) magic for different filesystems
-#
-0	string	\366\366\366\366	PC formatted floppy with no filesystem
-# Sun disk labels
-# From /usr/include/sun/dklabel.h:
-0774	beshort		0xdabe		Sun disk label
->0	string		x		'%s
->>31  	string		>\0		\b%s
->>>63  	string		>\0		\b%s
->>>>95 	string		>\0		\b%s
->0	string		x		\b'
->0734	short		>0		%d rpm,
->0736	short		>0		%d phys cys,
->0740	short		>0		%d alts/cyl,
->0746	short		>0		%d interleave,
->0750	short		>0		%d data cyls,
->0752	short		>0		%d alt cyls,
->0754	short		>0		%d heads/partition,
->0756	short		>0		%d sectors/track,
->0764	long		>0		start cyl %ld,
->0770	long		x		%ld blocks
-# Is there a boot block written 1 sector in?
->512    belong&077777777	0600407	\b, boot block present
-0x1FE	leshort	0xAA55			x86 boot sector
->2	string	OSBS			\b, OS/BS MBR
->0x8C	string	Invalid\ partition\ table	\b, MS-DOS MBR
->0	string	\0\0\0\0		\b, extended partition table
->0	leshort 0x3CEB			\b, system
->>3	string	>\0			%s
->>0x36	string	FAT			\b, %s
->>>0x39	string	12			(%s bit)
->>>0x39	string	16			(%s bit)
->0x52	string	FAT32			\b, FAT (32 bit)
->>>43	string		>NO\ NAME	label: %.11s,
->>>43	string		<NO\ NAME	label: %.11s,
->>>43	string		NO\ NAME	unlabeled,
->>>19	leshort		>0		%d sectors
->>>19	leshort		0		
->>>>32	lelong		x		%d sectors
->0x200	lelong	0x82564557		\b, BSD disklabel
-
-# Minix filesystems - Juan Cespedes <cespedes@debian.org>
-0x410	leshort		0x137f		Minix filesystem
-0x410	leshort		0x138f		Minix filesystem, 30 char names
-0x410	leshort		0x2468		Minix filesystem, version 2
-0x410	leshort		0x2478		Minix filesystem, version 2, 30 char names
-
-# romfs filesystems - Juan Cespedes <cespedes@debian.org>
-0	string		-rom1fs-\0	romfs filesystem, version 1
->8	belong	x			%d bytes,
->16	string	x			named %s.
-
-# netboot image - Juan Cespedes <cespedes@debian.org>
-0	lelong		0x1b031336L	Netboot image,
->4	lelong&0xFFFFFF00	0
->>4	lelong&0x100	0x000		mode 2
->>4	lelong&0x100	0x100		mode 3
->4	lelong&0xFFFFFF00	!0	unknown mode
-
-0x18b	string	OS/2	OS/2 Boot Manager
-
-9564	lelong		0x00011954	Unix Fast File system (little-endian),
->8404	string		x		last mounted on %s,
-#>9504	ledate		x		last checked at %s,
->8224	ledate		x		last written at %s,
->8401	byte		x		clean flag %d,
->8228	lelong		x		number of blocks %d,
->8232	lelong		x		number of data blocks %d,
->8236	lelong		x		number of cylinder groups %d,
->8240	lelong		x		block size %d,
->8244	lelong		x		fragment size %d,
->8252	lelong		x		minimum percentage of free blocks %d,
->8256	lelong		x		rotational delay %dms,
->8260	lelong		x		disk rotational speed %drps,
->8320	lelong		0		TIME optimization
->8320	lelong		1		SPACE optimization
-
-9564	belong		0x00011954	Unix Fast File system (big-endian),
->8404	string		x		last mounted on %s,
-#>9504	bedate		x		last checked at %s,
->8224	bedate		x		last written at %s,
->8401	byte		x		clean flag %d,
->8228	belong		x		number of blocks %d,
->8232	belong		x		number of data blocks %d,
->8236	belong		x		number of cylinder groups %d,
->8240	belong		x		block size %d,
->8244	belong		x		fragment size %d,
->8252	belong		x		minimum percentage of free blocks %d,
->8256	belong		x		rotational delay %dms,
->8260	belong		x		disk rotational speed %drps,
->8320	belong		0		TIME optimization
->8320	belong		1		SPACE optimization
-
-# ext2/ext3 filesystems - Andreas Dilger <adilger@turbolabs.com>
-0x438	leshort		0xEF53		Linux
->0x44c	lelong		x		rev %d
->0x43e	leshort		x		\b.%d
->0x45c	lelong		^0x0000004	ext2 filesystem data
->>0x43a	leshort		^0x0000001	(mounted or unclean)
->0x45c	lelong		&0x0000004	ext3 filesystem data
->>0x460	lelong		&0x0000004	(needs journal recovery)
->0x43a	leshort		&0x0000002	(errors)
->0x460	lelong		&0x0000001	(compressed)
-#>0x460	lelong		&0x0000002	(filetype)
-#>0x464	lelong		&0x0000001	(sparse_super)
->0x464	lelong		&0x0000002	(large files)
-
-# SGI disk labels - Nathan Scott <nathans@debian.org>
-0	belong		0x0BE5A941	SGI disk label (volume header)
-
-# SGI XFS filesystem - Nathan Scott <nathans@debian.org>
-0	belong		0x58465342	SGI XFS filesystem data
->0x4	belong		x		(blksz=3D%d,
->0x68	beshort		x		inosz=3D%d,
->0x64	beshort		^0x2004		v1 dirs)
->0x64	beshort		&0x2004		v2 dirs)

+ 0 - 12
Magdir/gnu

@@ -1,12 +0,0 @@
-#
-# GNU nlsutils message catalog file format
-#
-0	string		\336\22\4\225	GNU message catalog (little endian),
->4	lelong		x		revision %d,
->8	lelong		x		%d messages
-0	string		\225\4\22\336	GNU message catalog (big endian),
->4	belong		x		revision %d,
->8	belong		x		%d messages
-# message catalogs, from Mitchum DSouza <m.dsouza@mrc-apu.cam.ac.uk>
-0	string		*nazgul*	Nazgul style compiled message catalog
->8	lelong		>0		\b, version %ld

+ 0 - 61
Magdir/jpeg

@@ -1,61 +0,0 @@
-
-#------------------------------------------------------------------------------
-# JPEG images
-# SunOS 5.5.1 had
-#
-#	0	string		\377\330\377\340	JPEG file
-#	0	string		\377\330\377\356	JPG file
-#
-# both of which turn into "JPEG image data" here.
-#
-0	beshort		0xffd8		JPEG image data
->6	string		JFIF		\b, JFIF standard
->6	string		Exif		\b, EXIF standard
-# The following added by Erik Rossen <rossen@freesurf.ch> 1999-09-06
-# in a vain attempt to add image size reporting for JFIF.  Note that these
-# tests are not fool-proof since some perfectly valid JPEGs are currently
-# impossible to specify in magic(4) format.
-# First, a little JFIF version info:
->11	byte		x		\b %d.
->12	byte		x		\b%02d
-# Next, the resolution or aspect ratio of the image:
->13	byte		0		\b, aspect ratio
->13	byte		1		\b, resolution (DPI)
->13	byte		2		\b, resolution (DPCM)
-#>4	beshort		x		\b, segment length %d
-# Next, show thumbnail info, if it exists:
->18	byte		!0		\b, thumbnail %dx
->>19	byte		x		\b%d
-# Here things get sticky.  We can do ONE MORE marker segment with
-# indirect addressing, and that's all.  It would be great if we could
-# do pointer arithemetic like in an assembler language.  Christos?
-# And if there was some sort of looping construct to do searches, plus a few
-# named accumulators, it would be even more effective...
-# At least we can show a comment if no other segments got inserted before:
->(4.S+5)	byte		0xFE
->>(4.S+8)	string		>\0		\b, "%s"
-#>(4.S+5)	byte		0xFE		\b, comment
-#>>(4.S+6)	beshort		x		\b length=%d
-#>>(4.S+8)	string		>\0		\b, "%s"
-# Or, we can show the encoding type (I've included only the three most common)
-# and image dimensions if we are lucky and the SOFn (image segment) is here:
->(4.S+5)	byte		0xC0		\b, baseline
->>(4.S+6)	byte		x		\b, precision %d
->>(4.S+7)	beshort		x		\b, %dx
->>(4.S+9)	beshort		x		\b%d
->(4.S+5)	byte		0xC1		\b, extended sequential
->>(4.S+6)	byte		x		\b, precision %d
->>(4.S+7)	beshort		x		\b, %dx
->>(4.S+9)	beshort		x		\b%d
->(4.S+5)	byte		0xC2		\b, progressive
->>(4.S+6)	byte		x		\b, precision %d
->>(4.S+7)	beshort		x		\b, %dx
->>(4.S+9)	beshort		x		\b%d
-# I've commented-out quantisation table reporting.  I doubt anyone cares yet.
-#>(4.S+5)	byte		0xDB		\b, quantisation table
-#>>(4.S+6)	beshort		x		\b length=%d
->14	beshort		x		\b, %d x
->16	beshort		x		\b %d
-
-# HSI is Handmade Software's proprietary JPEG encoding scheme
-0	string		hsi1		JPEG image data, HSI proprietary

+ 0 - 101
Magdir/linux

@@ -1,101 +0,0 @@
-
-#------------------------------------------------------------------------------
-# linux:  file(1) magic for Linux files
-#
-# Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>
-# The following basic Linux magic is useful for reference, but using
-# "long" magic is a better practice in order to avoid collisions.
-#
-# 2	leshort		100		Linux/i386
-# >0	leshort		0407		impure executable (OMAGIC)
-# >0	leshort		0410		pure executable (NMAGIC)
-# >0	leshort		0413		demand-paged executable (ZMAGIC)
-# >0	leshort		0314		demand-paged executable (QMAGIC)
-#
-0	lelong		0x00640107	Linux/i386 impure executable (OMAGIC)
->16	lelong		0		\b, stripped
-0	lelong		0x00640108	Linux/i386 pure executable (NMAGIC)
->16	lelong		0		\b, stripped
-0	lelong		0x0064010b	Linux/i386 demand-paged executable (ZMAGIC)
->16	lelong		0		\b, stripped
-0	lelong		0x006400cc	Linux/i386 demand-paged executable (QMAGIC)
->16	lelong		0		\b, stripped
-#
-0	string		\007\001\000	Linux/i386 object file
->20	lelong		>0x1020		\b, DLL library
-# Linux-8086 stuff:
-0	string		\01\03\020\04	Linux-8086 impure executable
->28	long		!0		not stripped
-0	string		\01\03\040\04	Linux-8086 executable
->28	long		!0		not stripped
-#
-0	string		\243\206\001\0	Linux-8086 object file
-#
-0	string		\01\03\020\20	Minix-386 impure executable
->28	long		!0		not stripped
-0	string		\01\03\040\20	Minix-386 executable
->28	long		!0		not stripped
-# core dump file, from Bill Reynolds <bill@goshawk.lanl.gov>
-216	lelong		0421		Linux/i386 core file
->220	string		>\0		of '%s'
->200	lelong		>0		(signal %d)
-#
-# LILO boot/chain loaders, from Daniel Quinlan <quinlan@yggdrasil.com>
-# this can be overridden by the DOS executable (COM) entry
-2	string		LILO		Linux/i386 LILO boot/chain loader
-#
-# Debian Packages, from Peter Tobias <tobias@server.et-inf.fho-emden.de>
-0	string		0.9
->8	byte		0x0a		old Debian Binary Package
->>3	byte		>0		\b, created by dpkg 0.9%c
->>4	byte		>0		pl%c
-# PSF fonts, from H. Peter Anvin <hpa@yggdrasil.com>
-0	leshort		0x0436		Linux/i386 PC Screen Font data,
->2	byte		0		256 characters, no directory,
->2	byte		1		512 characters, no directory,
->2	byte		2		256 characters, Unicode directory,
->2	byte		3		512 characters, Unicode directory,
->3	byte		>0		8x%d
-# Linux swap file, from Daniel Quinlan <quinlan@yggdrasil.com>
-4086	string		SWAP-SPACE	Linux/i386 swap file
-# ECOFF magic for OSF/1 and Linux (only tested under Linux though)
-#
-#	from Erik Troan (ewt@redhat.com) examining od dumps, so this
-#		could be wrong
-#      updated by David Mosberger (davidm@azstarnet.com) based on
-#      GNU BFD and MIPS info found below.
-#
-0	leshort		0x0183		ECOFF alpha
->24	leshort		0407		executable
->24	leshort		0410		pure
->24	leshort		0413		demand paged
->8	long		>0		not stripped
->8	long		0		stripped
->23	leshort		>0		- version %ld.
-#
-# Linux kernel boot images, from Albert Cahalan <acahalan@cs.uml.edu>
-# and others such as Axel Kohlmeyer <akohlmey@rincewind.chemie.uni-ulm.de>
-# and Nicolás Lichtmaier <nick@debian.org>
-# All known start with: b8 c0 07 8e d8 b8 00 90 8e c0 b9 00 01 29 f6 29
-514		string	HdrS		Linux kernel
->518		leshort	>0
->>529		byte	0		zImage data,
->>529		byte	1		bzImage data,
->0x048c		byte	0x31
->>0x048c	string	x		version %s
->0x0493		byte	0x31
->>0x0493	string	x		version %s
->0x048c		byte	0x32
->>0x048c	string	x		version %s
->0x0493		byte	0x32
->>0x0493	string	x		version %s
->0x04df		byte	0x32
->>0x04df	string	x		version %s
->0x04fb		byte	0x32
->>0x04fb	string	x		version %s
-# This also matches new kernels, which were caught above by "HdrS".
-0		belong	0xb8c0078e	Linux kernel
->0x1e3		string	Loading		version 1.3.79 or older
->0x1e9		string	Loading		from prehistoric times
-# LSM entries - Nicolás Lichtmaier <nick@feedback.net.ar>
-0	string	Begin3	Linux Software Map entry text

+ 0 - 335
Magdir/macintosh

@@ -1,335 +0,0 @@
-
-#------------------------------------------------------------------------------
-# macintosh description
-#
-# BinHex is the Macintosh ASCII-encoded file format (see also "apple")
-# Daniel Quinlan, quinlan@yggdrasil.com
-11	string	must\ be\ converted\ with\ BinHex	BinHex binary text
->41	string	x					\b, version %.3s
-
-# Stuffit archives are the de facto standard of compression for Macintosh
-# files obtained from most archives. (franklsm@tuns.ca)
-0	string		SIT!			StuffIt Archive (data)
->2	string		x			: %s
-0	string		SITD			StuffIt Deluxe (data)
->2	string		x			: %s
-0	string		Seg			StuffIt Deluxe Segment (data)
->2	string		x			: %s
-
-# Macintosh Applications and Installation binaries (franklsm@tuns.ca)
-0	string		APPL			Macintosh Application (data)
->2	string		x			\b: %s
-
-# Macintosh System files (franklsm@tuns.ca)
-0	string		zsys			Macintosh System File (data)
-0	string		FNDR			Macintosh Finder (data)
-0	string		libr			Macintosh Library (data)
->2	string		x			: %s
-0	string		shlb			Macintosh Shared Library (data)
->2	string		x			: %s
-0	string		cdev			Macintosh Control Panel (data)
->2	string		x			: %s
-0	string		INIT			Macintosh Extension (data)
->2	string		x			: %s
-0	string		FFIL			Macintosh Truetype Font (data)
->2	string		x			: %s
-0	string		LWFN			Macintosh Postscript Font (data)
->2	string		x			: %s
-
-# Additional Macintosh Files (franklsm@tuns.ca)
-0	string		PACT			Macintosh Compact Pro Archive (data)
->2	string		x			: %s
-0	string		ttro			Macintosh TeachText File (data)
->2	string		x			: %s
-0	string		TEXT			Macintosh TeachText File (data)
->2	string		x			: %s
-0	string		PDF			Macintosh PDF File (data)
->2	string		x			: %s
-
-# MacBinary format (Eric Fischer, enf@pobox.com)
-#
-# Unfortunately MacBinary doesn't really have a magic number prior
-# to the MacBinary III format.  The checksum is really the way to
-# do it, but the magic file format isn't up to the challenge.
-#
-# 0	byte		0
-# 1	byte				# filename length
-# 2	string				# filename
-# 65    string				# file type
-# 69	string				# file creator
-# 73	byte				# Finder flags
-# 74	byte		0
-# 75	beshort				# vertical posn in window
-# 77	beshort				# horiz posn in window
-# 79	beshort				# window or folder ID
-# 81    byte				# protected?
-# 82	byte		0
-# 83	belong				# length of data segment
-# 87	belong				# length of resource segment
-# 91	belong				# file creation date
-# 95	belong				# file modification date
-# 99	beshort				# length of comment after resource
-# 101	byte				# new Finder flags
-# 102	string		mBIN		# (only in MacBinary III)
-# 106	byte				# char. code of file name
-# 107	byte				# still more Finder flags
-# 116	belong				# total file length
-# 120	beshort				# length of add'l header
-# 122	byte		129		# for MacBinary II
-# 122	byte		130		# for MacBinary III
-# 123	byte		129		# minimum version that can read fmt
-# 124	beshort				# checksum
-#
-# This attempts to use the version numbers as a magic number, requiring
-# that the first one be 0x80, 0x81, 0x82, or 0x83, and that the second
-# be 0x81.  This works for the files I have, but maybe not for everyone's.
-
-122	beshort&0xFCFF	0x8081		Macintosh MacBinary data
-
-# MacBinary I doesn't have the version number field at all, but MacBinary II
-# has been in use since 1987 so I hope there aren't many really old files
-# floating around that this will miss.  The original spec calls for using
-# the nulls in 0, 74, and 82 as the magic number.
-#
-# Another possibility, that would also work for MacBinary I, is to use
-# the assumption that 65-72 will all be ASCII (0x20-0x7F), that 73 will
-# have bits 1 (changed), 2 (busy), 3 (bozo), and 6 (invisible) unset,
-# and that 74 will be 0.  So something like
-# 
-# 71 	belong&0x80804EFF 0x00000000 	Macintosh MacBinary data
-# 
-# >73	byte&0x01	0x01		\b, inited
-# >73	byte&0x02	0x02		\b, changed
-# >73	byte&0x04	0x04		\b, busy
-# >73	byte&0x08	0x08		\b, bozo
-# >73	byte&0x10	0x10		\b, system
-# >73	byte&0x10	0x20		\b, bundle
-# >73	byte&0x10	0x40		\b, invisible
-# >73	byte&0x10	0x80		\b, locked
-
->65	string		x		\b, type "%4.4s"
-
->65	string		8BIM		(PhotoShop)
->65	string		ALB3		(PageMaker 3)
->65	string		ALB4		(PageMaker 4)
->65	string		ALT3		(PageMaker 3)
->65	string		APPL		(application)
->65	string		AWWP		(AppleWorks word processor)
->65	string		CIRC		(simulated circuit)
->65	string		DRWG		(MacDraw)
->65	string		EPSF		(Encapsulated PostScript)
->65	string		FFIL		(font suitcase)
->65	string		FKEY		(function key)
->65	string		FNDR		(Macintosh Finder)
->65	string		GIFf		(GIF image)
->65	string		Gzip		(GNU gzip)
->65	string		INIT		(system extension)
->65	string		LIB\ 		(library)
->65	string		LWFN		(PostScript font)
->65	string		MSBC		(Microsoft BASIC)
->65	string		PACT		(Compact Pro archive)
->65	string		PDF\ 		(Portable Document Format)
->65	string		PICT		(picture)
->65	string		PNTG		(MacPaint picture)
->65	string		PREF		(preferences)
->65	string		PROJ		(Think C project)
->65	string		QPRJ		(Think Pascal project)
->65	string		SCFL		(Defender scores)
->65	string		SCRN		(startup screen)
->65	string		SITD		(StuffIt Deluxe)
->65	string		SPn3		(SuperPaint)
->65	string		STAK		(HyperCard stack)
->65	string		Seg\ 		(StuffIt segment)
->65	string		TARF		(Unix tar archive)
->65	string		TEXT		(ASCII)
->65	string		TIFF		(TIFF image)
->65	string		TOVF		(Eudora table of contents)
->65	string		WDBN		(Microsoft Word word processor)
->65	string		WORD		(MacWrite word processor)
->65	string		XLS\ 		(Microsoft Excel)
->65	string		ZIVM		(compress (.Z))
->65	string		ZSYS		(Pre-System 7 system file)
->65	string		acf3		(Aldus FreeHand)
->65	string		cdev		(control panel)
->65	string		dfil		(Desk Acessory suitcase)
->65	string		libr		(library)
->65	string		nX^d		(WriteNow word processor)
->65	string		nX^w		(WriteNow dictionary)
->65	string		rsrc		(resource)
->65	string		scbk		(Scrapbook)
->65	string		shlb		(shared library)
->65	string		ttro		(SimpleText read-only)
->65	string		zsys		(system file)
-
->69	string		x		\b, creator "%4.4s"
-
-# Somewhere, Apple has a repository of registered Creator IDs.  These are
-# just the ones that I happened to have files from and was able to identify.
-
->69	string		8BIM		(Adobe Photoshop)
->69	string		ALD3		(PageMaker 3)
->69	string		ALD4		(PageMaker 4)
->69	string		ALFA		(Alpha editor)
->69	string		APLS		(Apple Scanner)
->69	string		APSC		(Apple Scanner)
->69	string		BRKL		(Brickles)
->69	string		BTFT		(BitFont)
->69	string		CCL2 		(Common Lisp 2)
->69	string		CCL\ 		(Common Lisp)
->69	string		CDmo		(The Talking Moose)
->69	string		CPCT		(Compact Pro)
->69	string		CSOm		(Eudora)
->69	string		DMOV		(Font/DA Mover)
->69	string		DSIM		(DigSim)
->69	string		EDIT		(Macintosh Edit)
->69	string		ERIK		(Macintosh Finder)
->69	string		EXTR		(self-extracting archive)
->69	string		Gzip		(GNU gzip)
->69	string		KAHL		(Think C)
->69	string		LWFU		(LaserWriter Utility)
->69	string		LZIV		(compress)
->69	string		MACA		(MacWrite)
->69	string		MACS		(Macintosh operating system)
->69	string		MAcK		(MacKnowledge terminal emulator)
->69	string		MLND		(Defender)
->69	string		MPNT		(MacPaint)
->69	string		MSBB		(Microsoft BASIC (binary))
->69	string		MSWD		(Microsoft Word)
->69	string		NCSA		(NCSA Telnet)
->69	string		PJMM		(Think Pascal)
->69	string		PSAL		(Hunt the Wumpus)
->69	string		PSI2		(Apple File Exchange)
->69	string		R*ch		(BBEdit)
->69	string		RMKR		(Resource Maker)
->69	string		RSED		(Resource Editor)
->69	string		Rich		(BBEdit)
->69	string		SIT!		(StuffIt)
->69	string		SPNT		(SuperPaint)
->69	string		Unix		(NeXT Mac filesystem)
->69	string		VIM!		(Vim editor)
->69	string		WILD		(HyperCard)
->69	string		XCEL		(Microsoft Excel)
->69	string		aCa2		(Fontographer)
->69	string		aca3		(Aldus FreeHand)
->69	string		dosa		(Macintosh MS-DOS file system)
->69	string		movr		(Font/DA Mover)
->69	string		nX^n		(WriteNow)
->69	string		pdos		(Apple ProDOS file system)
->69	string		scbk		(Scrapbook)
->69	string		ttxt		(SimpleText)
->69	string		ufox		(Foreign File Access)
-
-# Just in case...
-
-102	string		mBIN		MacBinary III data with surprising version number
-
-# sas magic from Bruce Foster (bef@nwu.edu)
-#
-#0	string		SAS		SAS
-#>8	string		x		%s
-0	string		SAS		SAS
->24	string		DATA		data file
->24	string		CATALOG		catalog
->24	string		INDEX		data file index
->24	string		VIEW		data view
-# spss magic for SPSS system and portable files, 
-#	 from Bruce Foster (bef@nwu.edu).
-
-0	long		0xc1e2c3c9	SPSS Portable File
->40	string 		x		%s
-
-0	string		$FL2		SPSS System File
->24	string		x		%s
-
-# Macintosh filesystem data
-# From "Tom N Harris" <telliamed@mac.com>
-# The MacOS epoch begins on 1 Jan 1904 instead of 1 Jan 1970, so these
-# entries depend on the data arithmetic added after v.35
-# There's also some Pascal strings in here, ditto...
-
-# The boot block signature, according to IM:Files, is 
-# "for HFS volumes, this field always contains the value 0x4C4B."
-# But if this is true for MFS or HFS+ volumes, I don't know.
-# Alternatively, the boot block is supposed to be zeroed if it's
-# unused, so a simply >0 should suffice.
-
-0x400	beshort			0xD2D7		Macintosh MFS data
->0	beshort			0x4C4B		(bootable)
->0x40a	beshort			&0x8000		(locked)
->0x402	beldate-0x7C25B080	x		created: %s,
->0x406	beldate-0x7C25B080	>0		last backup: %s,
->0x414	belong			x		block size: %d,
->0x412	beshort			x		number of blocks: %d,
->0x424	pstring			x		volume name: %s
-
-0x400	beshort			0x4244		Macintosh HFS data
->0	beshort			0x4C4B		(bootable)
->0x40a	beshort			&0x8000		(locked)
->0x40a	beshort			^0x0100		(mounted)
->0x40a	beshort			&0x0800		(unclean)
->0x402	beldate-0x7C25B080	x		created: %s,
->0x406	beldate-0x7C25B080	x		last modified: %s,
->0x440	beldate-0x7C25B080	>0		last backup: %s,
->0x414	belong			x		block size: %d,
->0x412	beshort			x		number of blocks: %d,
->0x424	pstring			x		volume name: %s
-#>0x480	beshort			=0x482B		Embedded HFS+ Volume:
-#>>((0x482*(0x414))+(0x41c*512))	x	\b
-# Well, this is (theoretically) how we could do this. But it occurs to
-# me that we likely don't read in a large enough chunk. I don't have any
-# HFS+ volumes to see what a typical offset would be.
-
-0x400	beshort			0x482B		Macintosh HFS Extended
->&2	beshort			x		version %d data
->0	beshort			0x4C4B		(bootable)
->&4	belong			^0x00000100	(mounted)
->&4	belong			&0x00000800	(unclean)
->&4	belong			&0x00008000	(locked)
->&8	string			x		last mounted by: '%.4s',
-# really, that should be treated as a belong and we print a string
-# based on the value. TN1150 only mentions '8.10' for "MacOS 8.1"
->&16	beldate-0x7C25B080	x		created: %s,
->&20	beldate-0x7C25B080	x		last modified: %s,
->&24	beldate-0x7C25B080	>0		last backup: %s,
->&28	beldate-0x7C25B080	>0		last checked: %s,
->&40	belong			x		block size: %d,
->&44	belong			x		number of blocks: %d,
->&48	belong			x		free blocks: %d
-
-# I don't think this is really necessary since it doesn't do much and 
-# anything with a valid driver descriptor will also have a valid
-# partition map
-#0		beshort		0x4552		Apple Device Driver data
-#>&24		beshort		=1		\b, MacOS
-
-# Is that the partition type a cstring or a pstring? Well, IM says "strings 
-# shorter than 32 bytes must be terminated with NULL" so I'll treat it as a 
-# cstring. Of course, partitions can contain more than four entries, but 
-# what're you gonna do?
-0x200		beshort		0x504D		Apple Partition data
->&2		beshort		x		block size: %d
->&48		string		x		first type: %s,
->&12		belong		x		number of blocks: %d,
->(&0x2.S)	beshort		0x504D		
->>&48		string		x		second type: %s
->>&12		belong		x		number of blocks: %d,
->>(&0x2.S)	beshort		0x504D		
->>>&48		string		x		third type: %s
->>>&12		belong		x		number of blocks: %d,
->>>(&0x2.S)	beshort		0x504D		
->>>>&48		string		x		fourth type: %s
->>>>&12		belong		x		number of blocks: %d,
-# AFAIK, only the signature is different
-0x200		beshort		0x5453		Apple Old Partition data
->&2		beshort		x		block size: %d
->&48		string		x		first type: %s,
->&12		belong		x		number of blocks: %d,
->(&0x2.S)	beshort		0x504D		
->>&48		string		x		second type: %s
->>&12		belong		x		number of blocks: %d,
->>(&0x2.S)	beshort		0x504D		
->>>&48		string		x		third type: %s
->>>&12		belong		x		number of blocks: %d,
->>>(&0x2.S)	beshort		0x504D		
->>>>&48		string		x		fourth type: %s
->>>>&12		belong		x		number of blocks: %d,

+ 0 - 31
Magdir/mcrypt

@@ -1,31 +0,0 @@
-#------------------------------------------------------------------------------
-# Mavroyanopoulos Nikos <nmav@hellug.gr>
-# mcrypt:   file(1) magic for mcrypt 2.2.x;
-0      string          \0m\2           mcrypt 2.2 encrypted data,
->3     byte            0               algorithm: blowfish-448,
->3     byte            1               algorithm: DES,
->3     byte            2               algorithm: 3DES,
->3     byte            3               algorithm: 3-WAY,
->3     byte            4               algorithm: GOST,
->3     byte            6               algorithm: SAFER-SK64,
->3     byte            7               algorithm: SAFER-SK128,
->3     byte            8               algorithm: CAST-128,
->3     byte            9               algorithm: xTEA,
->3     byte            10              algorithm: TWOFISH-128,
->3     byte            11              algorithm: RC2,
->3     byte            12              algorithm: TWOFISH-192,
->3     byte            13              algorithm: TWOFISH-256,
->3     byte            14              algorithm: blowfish-128,
->3     byte            15              algorithm: blowfish-192,
->3     byte            16              algorithm: blowfish-256,
->3     byte            100             algorithm: RC6,
->3     byte            101             algorithm: IDEA,
->4     byte            0               mode: CBC,
->4     byte            1               mode: ECB,
->4     byte            2               mode: CFB,
->4     byte            3               mode: OFB,
->4     byte            4               mode: nOFB,
->5     byte            0               keymode: 8bit
->5     byte            1               keymode: 4bit
->5     byte            2               keymode: SHA-1 hash
->5     byte            3               keymode: MD5 hash

+ 0 - 15
Magdir/palm

@@ -1,15 +0,0 @@
-
-#------------------------------------------------------------------------------
-# palm:  file(1) magic for PalmOS {.prc,.pdb}: applications, docfiles, and hacks
-#
-# Brian Lalor <blalor@hcirisc.cs.binghamton.edu>
-
-# appl
-60      belong                  0x6170706c      PalmOS application
->0      string                  >\0             "%s"
-# TEXt
-60      belong                  0x54455874      AportisDoc file
->0      string                  >\0             "%s"
-# HACK
-60      belong                  0x4841434b      HackMaster hack
->0      string                  >\0             "%s"

+ 0 - 5
Magdir/python

@@ -1,5 +0,0 @@
-# often the module starts with a multiline string
-0	string		"""	a python script text executable
-# MAGIC as specified in Python/import.c (1.5.2/1.6)
-# 20121  ( YEAR - 1995 ) + MONTH  + DAY (little endian followed by "\r\n"
-0	belong		0x994e0d0a	python compiled

+ 0 - 104
Magdir/riff

@@ -1,104 +0,0 @@
-
-#------------------------------------------------------------------------------
-# riff:  file(1) magic for RIFF format
-# See
-#
-#	http://www.seanet.com/users/matts/riffmci/riffmci.htm
-#
-# and
-#
-#	http://www.ora.com/centers/gff/formats/micriff/index.htm
-#
-# and
-#
-#	http://www.jtauber.com/music/encoding/niff/spec/
-#
-0	string		RIFF		RIFF (little-endian) data
-# RIFF Palette format
->8	string		PAL		\b, palette
->>16	leshort		x		\b, version %d
->>18	leshort		x		\b, %d entries
-# RIFF Device Independent Bitmap format
->8	string		RDIB		\b, device-independent bitmap
->>16	string		BM		
->>>30	leshort		12		\b, OS/2 1.x format
->>>>34	leshort		x		\b, %d x
->>>>36	leshort		x		%d
->>>30	leshort		64		\b, OS/2 2.x format
->>>>34	leshort		x		\b, %d x
->>>>36	leshort		x		%d
->>>30	leshort		40		\b, Windows 3.x format
->>>>34	lelong		x		\b, %d x
->>>>38	lelong		x		%d x
->>>>44	leshort		x		%d
-# RIFF MIDI format
->8	string		RMID		\b, MIDI
-# RIFF Multimedia Movie File format
->8	string		RMMP		\b, multimedia movie
-# Microsoft WAVE format (*.wav)
->8	string		WAVE		\b, WAVE audio
->>20	leshort		1		\b, Microsoft PCM
->>>34	leshort		>0		\b, %d bit
->>20	leshort		2		\b, Microsoft ADPCM
->>20	leshort		6		\b, ITU G.711 a-law
->>20	leshort		7		\b, ITU G.711 u-law
->>20	leshort		17		\b, IMA ADPCM
->>20	leshort		20		\b, ITU G.723 ADPCM (Yamaha)
->>20	leshort		49		\b, GSM 6.10
->>20	leshort		64		\b, ITU G.721 ADPCM
->>20	leshort		80		\b, MPEG
->>20	leshort		85		\b, MPEG Layer 3
->>22	leshort		=1		\b, mono
->>22	leshort		=2		\b, stereo
->>22	leshort		>2		\b, %d channels
->>24	lelong		>0		%d Hz
-# AVI == Audio Video Interleave
->8      string          AVI\            \b, AVI
-# Animated Cursor format
->8	string		ACON		\b, animated cursor
-
-#
-# XXX - some of the below may only appear in little-endian form.
-#
-# Also "MV93" appears to be for one form of Macromedia Director
-# files, and "GDMF" appears to be another multimedia format.
-#
-0	string		RIFX		RIFF (big-endian) data
-# RIFF Palette format
->8	string		PAL		\b, palette
->>16	beshort		x		\b, version %d
->>18	beshort		x		\b, %d entries
-# RIFF Device Independent Bitmap format
->8	string		RDIB		\b, device-independent bitmap
->>16	string		BM		
->>>30	beshort		12		\b, OS/2 1.x format
->>>>34	beshort		x		\b, %d x
->>>>36	beshort		x		%d
->>>30	beshort		64		\b, OS/2 2.x format
->>>>34	beshort		x		\b, %d x
->>>>36	beshort		x		%d
->>>30	beshort		40		\b, Windows 3.x format
->>>>34	belong		x		\b, %d x
->>>>38	belong		x		%d x
->>>>44	beshort		x		%d
-# RIFF MIDI format
->8	string		RMID		\b, MIDI
-# RIFF Multimedia Movie File format
->8	string		RMMP		\b, multimedia movie
-# Microsoft WAVE format (*.wav)
->8	string		WAVE		\b, WAVE audio
->>20	leshort		1		\b, Microsoft PCM
->>>34	leshort		>0		\b, %d bit
->>22	beshort		=1		\b, mono
->>22	beshort		=2		\b, stereo
->>22	beshort		>2		\b, %d channels
->>24	belong		>0		%d Hz
-# AVI == Audio Video Interleave
->8      string          AVI\            \b, AVI
-# Animated Cursor format
->8	string		ACON		\b, animated cursor
-# Notation Interchange File Format (big-endian only)
->8	string		NIFF		\b, Notation Interchange File Format
-
-# SoundFont 2 <mpruett@sgi.com>
->8	string		sfbk		SoundFont 2

+ 0 - 20
Magdir/sgml

@@ -1,20 +0,0 @@
-
-#------------------------------------------------------------------------------
-# sgml:  file(1) magic for Standard Generalized Markup Language
-# HyperText Markup Language (HTML) is an SGML document type,
-# from Daniel Quinlan (quinlan@yggdrasil.com)
-# adapted to string extenstions by Anthon van der Neut <anthon@mnt.org)
-0   string/cB	\<!doctype\ html	HTML document text
-0   string/c	\<head			HTML document text
-0   string/c	\<title			HTML document text
-0   string/c	\<html			HTML document text
-
-# Extensible markup language (XML), a subset of SGML
-# from Marc Prud'hommeaux (marc@apocalypse.org)
-0   string/c	\<?xml			XML document text
-
-
-# SGML, mostly from rph@sq
-0   string/c	\<!doctype		exported SGML document text
-0   string/c	\<!subdoc		exported SGML subdocument text
-0   string	\<!--			exported SGML document text

+ 0 - 36
Magdir/ti-8x

@@ -1,36 +0,0 @@
-# ------------------------------------------------------------------------
-# ti-8x: file(1) magic for the TI-8x and TI-92 Graphing Calculators.
-#
-# From: Ryan McGuire (rmcguire@freenet.columbus.oh.us).
-#
-# NOTE: This list is not complete.
-#
-# Magic Numbers for the TI-82
-#
-0               string          **TI82**        TI-82 Graphing Calculator
->0x000037       byte            0x0B            TI-BASIC Group/Program File.
-#
-# Magic Numbers for the TI-83
-#
-0               string          **TI83**        TI-83 Graphing Calculator
->0x000037       byte            0x0B            TI-BASIC Group/Program File.
-#
-# Magic Numbers for the TI-85
-#
-0               string          **TI85**        TI-85 Graphing Calculator
->11             string          Backup          Backup File.
->0x000032       string          ZS4             - ZShell Version 4 File.
->0x000032       string          ZS3             - ZShell Version 3 File.
->0x00000B       string          GDatabase       Graphics Database.
->0x00003B       byte            0x12            TI-BASIC Group/Program File.
-#
-# Magic Numbers for the TI-92
-#
-0               string          **TI92**        TI-92 Graphing Calculator
->0x000058       byte            0x12            TI-BASIC Group File.
->0x000012       string          Function        Function.
->0x000048       byte            0x12            TI-BASIC Program.
-# Files for the TI-80 and TI-81 are pretty rare. I'm not going to put the
-# program/group magic numbers in here because I cannot find any.
-0               string          **TI80**        TI-80 Graphing Calculator File.
-0               string          **TI81**        TI-81 Graphing Calculator File.

+ 0 - 65
Magdir/vorbis

@@ -1,65 +0,0 @@
-
-#------------------------------------------------------------------------------
-# vorbis:  file(1) magic for Ogg/Vorbis files
-#
-# From Felix von Leitner <leitner@fefe.de>
-# Extended by Beni Cherniavsky <cben@crosswinds.net>
-#
-# Most (everything but the number of channels and bitrate) is commented
-# out with `##' as it's not interesting to the average user.  The most
-# probable things advanced users would want to uncomment are probably
-# the number of comments and the encoder version.
-#
-# --- Ogg Framing ---
-0		string		OggS		Ogg data
->4		byte		!0		UNKNOWN REVISION %u
-##>4		byte		0		revision 0
->4		byte		0
-##>>14		lelong		x		(Serial %lX)
-# --- First vorbis packet - general header ---
->>28		string		\x01vorbis	\b, Vorbis audio,
->>>35		lelong		!0		UNKNOWN VERSION %lu,
-##>>>35		lelong		0		version 0,
->>>35		lelong		0
->>>>39		ubyte		1		mono,
->>>>39		ubyte		2		stereo,
->>>>39		ubyte		>2		%u channels,
->>>>40		lelong		x		%lu Hz
-# Minimal, nominal and maximal bitrates specified when encoding
->>>>48		string		<\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff	\b,
-# The above tests if at least one of these is specified:
->>>>>44		lelong		!-1
->>>>>>44	lelong		x		>%lu
->>>>>48		lelong		!-1
->>>>>>48	lelong		x		~%lu
->>>>>52		lelong		!-1
->>>>>>52	lelong		x		<%lu
->>>>>48		string		<\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff	kbps
-# -- Second vorbis header packet - the comments
->>>102		string		\x03vorbis
-# A kludge to read the vendor string.  It's a counted string, not a
-# zero-terminated one, so file(1) can't read it in a generic way.
-# libVorbis is the only one existing currently, so I detect specifically
-# it.  The interesting value is the cvs date (8 digits decimal).
-##>>>>113		string/c	Xiphophorus\ libVorbis\ I	\b, created by: Xiphophorus libVorbis I
-##>>>>>137	string		>00000000	%.8s
-# Map to beta version numbers:
-##>>>>>>137	string		<20000508	(<beta1 - prepublic)
-# The string has not changed from beta1 to 2 - they are indistinguishable.
-##>>>>>>137	string		20000508	(beta1/2)
-##>>>>>>137	string		>20000508
-##>>>>>>>137	string		<20001031	(beta2-3)
-##>>>>>>137	string		20001031	(beta3)
-##>>>>>>137	string		>20001031
-##>>>>>>>137	string		<20010225	(beta3-4)
-##>>>>>>137	string		20010225	(beta4)
-##>>>>>>137	string		>20010225
-##>>>>>>>137	string		<20010615	(beta4-RC1)
-##>>>>>>137	string		20010615	(RC1)
-##>>>>>>137	string		>20010615	(>RC1)
-# Then come the comments, again length-counted (and number-counted).
-# Some looping constructs and registers would allow reading them but now
-# it's impossible.  However we can print the number of comments present
-# (skipping by the vendor string length):
-##>>>>(109.l.113)	lelong		0		\b, no comments
-##>>>>(109.l+113)	lelong		>0		\b, %lu comments

+ 2 - 79
Makefile.am

@@ -1,83 +1,6 @@
 # don't enforce GNU packaging standards
 AUTOMAKE_OPTIONS = foreign no-dependencies
 
-bin_PROGRAMS = file
+EXTRA_DIST = LEGAL.NOTICE MAINT PORTING
 
-data_DATA = magic magic.mime magic.mgc
-
-MAGIC	 = @datadir@/magic
-CPPFLAGS = -DMAGIC='"$(MAGIC)"'
-
-if FSECT5
-man_MAGIC = magic.5
-else
-man_MAGIC = magic.4
-endif
-fsect = @fsect@
-man_MANS = file.1 $(man_MAGIC)
-
-file_SOURCES = file.c apprentice.c fsmagic.c softmagic.c ascmagic.c \
-	compress.c is_tar.c readelf.c print.c \
-	file.h names.h patchlevel.h readelf.h tar.h
-
-EXTRA_DIST = LEGAL.NOTICE MAINT PORTING Makefile.std magic2mime \
-	Localstuff Header $(magic_FRAGMENTS) file.man magic.man
-
-CLEANFILES = $(man_MANS) magic magic.mgc
-
-magic: Header Localstuff $(magic_FRAGMENTS)
-	cat $(srcdir)/Header $(srcdir)/Localstuff > $@
-	for frag in $(magic_FRAGMENTS); do \
-	  if test -f $(srcdir)/$$frag; then \
-	    f=$(srcdir)/$$frag; \
-	  else \
-	    f=$$frag; \
-	  fi; \
-          cat $$f; \
-	done >> $@
-
-magic.mgc: magic file
-	./file -C -m magic
-
-file.1:	Makefile file.man
-	@rm -f $@
-	sed -e s@__CSECTION__@1@g \
-	    -e s@__FSECTION__@${fsect}@g \
-	    -e s@__VERSION__@${VERSION}@g \
-	    -e s@__MAGIC__@${MAGIC}@g $(srcdir)/file.man > $@
-
-magic.${fsect}: Makefile magic.man
-	@rm -f $@
-	sed -e s@__CSECTION__@1@g \
-	    -e s@__FSECTION__@${fsect}@g \
-	    -e s@__VERSION__@${VERSION}@g \
-	    -e s@__MAGIC__@${MAGIC}@g $(srcdir)/magic.man > $@
-
-magic_FRAGMENTS = Magdir/adi Magdir/adventure Magdir/allegro Magdir/alliant \
-    Magdir/alpha Magdir/amanda Magdir/amigaos Magdir/animation \
-    Magdir/apl Magdir/apple Magdir/applix Magdir/archive Magdir/asterix \
-    Magdir/att3b Magdir/audio Magdir/blender Magdir/blit Magdir/bsdi \
-    Magdir/c-lang Magdir/chi Magdir/cisco Magdir/claris Magdir/clipper \
-    Magdir/commands Magdir/compress Magdir/console Magdir/convex \
-    Magdir/database Magdir/diamond Magdir/diff Magdir/digital \
-    Magdir/dump Magdir/elf Magdir/encore Magdir/epoc Magdir/filesystems \
-    Magdir/flash Magdir/fonts Magdir/frame Magdir/freebsd Magdir/fsav \
-    Magdir/gimp Magdir/gnu Magdir/grace Magdir/hp Magdir/ibm370 \
-    Magdir/ibm6000 Magdir/iff Magdir/images Magdir/intel \
-    Magdir/interleaf Magdir/island Magdir/ispell Magdir/java \
-    Magdir/jpeg Magdir/karma Magdir/lecter Magdir/lex Magdir/lif \
-    Magdir/linux Magdir/lisp Magdir/mach Magdir/macintosh Magdir/magic \
-    Magdir/mail.news Magdir/maple Magdir/mathematica Magdir/mcrypt \
-    Magdir/mime Magdir/mips Magdir/mirage Magdir/mkid Magdir/mmdf Magdir/modem \
-    Magdir/motorola Magdir/msdos Magdir/msvc Magdir/ncr Magdir/netbsd \
-    Magdir/netscape Magdir/news Magdir/octave Magdir/olf Magdir/os2 \
-    Magdir/os9 Magdir/osf1 Magdir/palm Magdir/pbm Magdir/pdf Magdir/pdp \
-    Magdir/pgp Magdir/pkgadd Magdir/plus5 Magdir/printer Magdir/project \
-    Magdir/psdbms Magdir/pyramid Magdir/python Magdir/riff Magdir/rpm \
-    Magdir/rtf Magdir/sc Magdir/sccs Magdir/sendmail Magdir/sequent \
-    Magdir/sgml Magdir/sketch Magdir/sniffer Magdir/softquad Magdir/spectrum \
-    Magdir/sun Magdir/teapot Magdir/terminfo Magdir/tex Magdir/ti-8x \
-    Magdir/timezone Magdir/troff Magdir/typeset Magdir/unknown \
-    Magdir/uuencode Magdir/varied.out Magdir/vax Magdir/vicar Magdir/visx \
-    Magdir/vms Magdir/vmware Magdir/wordperfect Magdir/xdelta Magdir/xenix \
-    Magdir/zilog Magdir/zyxel
+SUBDIRS = src magic doc python

File diff suppressed because it is too large
+ 315 - 410
Makefile.in


+ 0 - 167
Makefile.std

@@ -1,167 +0,0 @@
-# Makefile for file(1) cmd. 
-# Copyright (c) Ian F. Darwin 86/09/01 - see LEGAL.NOTICE.
-# @(#)$Id: Makefile.std,v 1.12 2001/09/03 14:44:21 christos Exp $
-#
-# This software is not subject to any license of the American Telephone
-# and Telegraph Company or of the Regents of the University of California.
-#
-# Permission is granted to anyone to use this software for any purpose on
-# any computer system, and to alter it and redistribute it freely, subject
-# to the following restrictions:
-#
-# 1. The author is not responsible for the consequences of use of this
-#    software, no matter how awful, even if they arise from flaws in it.
-#
-# 2. The origin of this software must not be misrepresented, either by
-#    explicit claim or by omission.  Since few users ever read sources,
-#    credits must appear in the documentation.
-#
-# 3. Altered versions must be plainly marked as such, and must not be
-#    misrepresented as being the original software.  Since few users
-#    ever read sources, credits must appear in the documentation.
-#
-# 4. This notice may not be removed or altered.
-#
-VERSION	= 3.37
-SHELL	= /bin/sh
-#MAGIC	= /etc/magic
-MAGIC	= /usr/local/etc/magic
-DEFS	= -DMAGIC='"$(MAGIC)"' -DBUILTIN_ELF # -Dvoid=int
-CC	= cc
-COPTS	= -O -g		# newer compilers allow both; else drop -O
-# For truly antique environments, use this for (dummy) include files:
-COPTS	= -O # -Ilocalinc
-CFLAGS	= $(COPTS) $(DEFS)
-LDFLAGS	= $(COPTS) # -Bstatic	# older gdb couldn't handle shared libs
-SHAR	= bundle
-OFILE	= /usr/bin/file		# old or distributed version, for comparison
-# Where new binary lives; typically /usr/local (BSD), /usr/lbin (USG).
-BINDIR	= /usr/local/bin
-# For installing our man pages; 
-# MANCxxx is manual section for Commands, MANFxxx is section for file formats.
-# MANxDIR is directory names; MANxEXT is the filename extention. Usual values:
-# Variable	V7		4BSD		Sys V
-# MANCDIR 	/usr/man/man1	/usr/man/man1	/usr/man/u_man/man1
-# MANFDIR 	/usr/man/man5	/usr/man/man5	/usr/man/u_man/man4
-# MANCEXT	1		1		1
-# MANFEXT	5		5		4
-# --- possible alternative for 4BSD ---
-# MANCDIR			/usr/local/man/man1
-# MANCEXT			1
-# or
-# MANCDIR			/usr/man/manl
-# MANCEXT			l
-# --- possible alternative for USG ---
-# MANCDIR			/usr/man/local/man1
-# MANCEXT			1
-
-MANCDIR	= /usr/local/man/man1
-MANCEXT	= 1
-MANFDIR	= /usr/local/man/man4
-MANFEXT	= 4
-
-# There are no system-dependant configuration options (except maybe CFLAGS).
-# Uncomment any of these that is missing from your "standard" library.
-LOCALSRCS = # localsrc/getopt.c localsrc/strtol.c \
-#		localsrc/strtok.c localsrc/strchr.c
-LOCALOBJS = # localsrc/getopt.o localsrc/strtol.o \
-#		localsrc/strtok.o localsrc/strchr.o
-# These are not compiled in unless you use -Ilocalinc, but
-# are not commented out as "make dist" &c use them.
-LOCALINC = # localinc/*.h localinc/sys/*.h
-
-SRCS = file.c apprentice.c fsmagic.c softmagic.c ascmagic.c \
-	compress.c is_tar.c readelf.c internat.c \
-	print.c $(LOCALSRCS) $(LOCALINC)
-OBJS = file.o apprentice.o fsmagic.o softmagic.o ascmagic.o \
-	compress.o is_tar.o readelf.o internat.o \
-	print.o $(LOCALOBJS)
-HDRS = file.h names.h patchlevel.h readelf.h tar.h
-
-AUTOSRC=configure configure.in install-sh config.h.in Makefile.in
-ALLSRC = LEGAL.NOTICE README MAINT PORTING $(SRCS) $(HDRS) \
-	 Makefile.std file.man magic.man magic2mime $(AUTOSRC) \
-	 Localstuff Header
-ALLMAGIC =   Magdir/[a-z]*
-
-all:		file magic file.${MANCEXT} magic.${MANFEXT}
-
-TESTFILES = * tst/*
-try:		all $(OFILE)
-		cd tst; $(MAKE)
-		time $(OFILE) $(TESTFILES) >/tmp/t1 # can't use ./magic
-		time ./file -m ./magic $(TESTFILES) >/tmp/t2
-		-diff -b /tmp/t[12]
-		what ./file >lastnocore
-
-file:		$(OBJS)
-		$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@
-lint:		$(SRCS)
-		lint -ha $(DEFS) $(SRCS) | tee $@
-magic:		Localstuff Header Magdir
-		cat Header Localstuff Magdir/[a-z] > $@
-
-ascmagic.o:	names.h
-
-compress.o apprentice.o ascmagic.o file.o fsmagic.o print.o softmagic.o: file.h
-
-install:	file magic
-		cp file	$(BINDIR)/file
-		cp magic $(MAGIC)
-
-install.man: file.${MANCEXT} magic.${MANFEXT}
-		cp file.${MANCEXT} $(MANCDIR)/file.$(MANCEXT)
-		cp magic.${MANFEXT} $(MANFDIR)/magic.$(MANFEXT)
-
-clean:
-		rm -f *.o core file magic lint dist.* MANIFEST \
-		      magic.${MANFEXT} file.${MANCEXT} \
-		      config.h config.status config.cache config.log
-clobber:
-		cd tst; $(MAKE) clean
-
-
-magic.${MANFEXT} :	Makefile magic.man
-		@rm -f $@
-		sed -e s@__CSECTION__@${MANCEXT}@g \
-		    -e s@__FSECTION__@${MANFEXT}@g \
-		    -e s@__VERSION__@${VERSION}@g \
-		    -e s@__MAGIC__@${MAGIC}@g magic.man > $@
-
-file.${MANCEXT} :	Makefile file.man
-		@rm -f $@
-		sed -e s@__CSECTION__@${MANCEXT}@g \
-		    -e s@__FSECTION__@${MANFEXT}@g \
-		    -e s@__VERSION__@${VERSION}@g \
-		    -e s@__MAGIC__@${MAGIC}@g file.man > $@
-
-send:		dist
-		ftp ftp.cs
-
-dist:		dist.src dist.magic
-		@echo Now check this patchlevel!
-		ident patchlevel.h
-
-dist.src:	$(ALLSRC) MANIFEST
-#		Some versions of shar can't handle a single file from
-#		a subdirectory, so we manually insert mkdir as needed.
-#		The point is to exclude all the generable targets in tst.
-		(echo mkdir localinc localinc/sys localsrc tst; \
-			$(SHAR) $(ALLSRC) MANIFEST) > $@
-
-rcsdiff:	$(ALLSRC)
-		rcsdiff -q RCS/*
-
-MANIFEST:	$(ALLSRC)
-		ident $(ALLSRC) > MANIFEST
-dist.magic:	Magdir
-#		As above, but to exclude Magdir/RCS from being shipped.
-		(echo mkdir Magdir; $(SHAR) $(ALLMAGIC)) >$@
-
-tar:		$(ALLSRC) $(ALLMAGIC)
-		-rm -fr file-${VERSION}
-		-mkdir file-${VERSION} file-${VERSION}/Magdir
-		ln $(ALLSRC) file-${VERSION}
-		ln ${ALLMAGIC} file-${VERSION}/Magdir
-		tar cvf file-${VERSION}.tar file-${VERSION}
-		-rm -fr file-${VERSION}

+ 0 - 0
PORTING


+ 16 - 12
README

@@ -1,14 +1,20 @@
 ** README for file(1) Command **
-@(#) $Id: README,v 1.25 2001/07/23 21:30:22 christos Exp $
+@(#) $Id: README,v 1.33 2003/05/23 21:31:56 christos Exp $
 
-This is Release 3.x of Ian Darwin's (copyright but distributable)
+This is Release 4.x of Ian Darwin's (copyright but distributable)
 file(1) command. This version is the standard "file" command for Linux,
 *BSD, and other systems. (See "patchlevel.h" for the exact release number).
 
+The major feature of 4.x is the refactoring of the code into a library,
+and the re-write of the file command in terms of that library. The library
+itself, libmagic can be used by 3rd party programs that wish to identify
+file types without having to fork() and exec() file. The prime contributor
+for 4.0 was M\xe5ns Rullg\xe5rd.
+
 UNIX is a trademark of UNIX System Laboratories.
 
 The prime contributor to Release 3.8 was Guy Harris, who put in megachanges
-including byte-order independance.
+including byte-order independence.
 
 The prime contributor to Release 3.0 was Christos Zoulas, who put
 in hundreds of lines of source code changes, including his own
@@ -33,7 +39,7 @@ In addition, the /etc/magic file is built from a subdirectory
 for easier(?) maintenance.  I will act as a clearinghouse for
 magic numbers assigned to all sorts of data files that
 are in reasonable circulation. Send your magic numbers,
-in magic(4) format please, to the maintainer, Christos Zoulas.
+in magic(5) format please, to the maintainer, Christos Zoulas.
 
 LEGAL.NOTICE - read this first.
 README - read this second (you are currently reading this file).
@@ -43,7 +49,7 @@ Makefile - read this next, adapt it as needed (particularly
 	the man page layouts), type "make" to compile, 
 	"make try" to try it out against your old version.
 	Expect some diffs, particularly since your original
-	file(1) may not grok the imbedded-space ("\ ") in
+	file(1) may not grok the embedded-space ("\ ") in
 	the current magic file, or may even not use the
 	magic file.
 apprentice.c - parses /etc/magic to learn magic
@@ -61,9 +67,8 @@ magdir - directory of /etc/magic pieces
 	magdir/Makefile - ADJUST THIS FOR YOUR CONFIGURATION
 names.h - header file for ascmagic.c
 softmagic.c - 2nd set of tests, based on /etc/magic
-readelf.[ch] - Standalone elf parsing code.
+readelf.[ch] - Stand-alone elf parsing code.
 compress.c - on-the-fly decompression.
-internat.c - recognize international `text' files.
 print.c - print results, errors, warnings.
 
 If your gzip sometimes fails to decompress things complaining about a short
@@ -84,11 +89,10 @@ E-mail: christos@astron.com
 
 Phone: Do not even think of telephoning me about this program. Send cash first!
 
-Parts of this software were developed at SoftQuad Inc., 56 Aberfoyle
-Cres, # 810, Toronto, Ontario CANADA M8X 2W4.  Phone: 416-239-4801 or
-800-387-2777. Email: mail@sq.com.  Call for information on SGML editing
-and browsing, Unix text processing, and customised products on Unix,
-DOS and Mac.
+Parts of this software were developed at SoftQuad Inc., developers
+of SGML/HTML/XML publishing software, in Toronto, Canada.
+SoftQuad was swallowed up by Corel in 2002
+and does not exist any longer.
 
 From: Kees Zeelenberg
 

+ 0 - 48
acconfig.h

@@ -1,48 +0,0 @@
-/* Autoheader needs me */
-#undef PACKAGE
-
-/* Autoheader needs me */
-#undef VERSION
-
-/* Define if builtin ELF support is enabled.  */
-#undef BUILTIN_ELF
-
-/* Define if ELF core file support is enabled.  */
-#undef ELFCORE
-
-/* Define if the `long long' type works.  */
-#undef HAVE_LONG_LONG
-
-/* Define if we have "tm_isdst" in "struct tm".  */
-#undef HAVE_TM_ISDST
-
-/* Define if we have a global "int" variable "daylight".  */
-#undef HAVE_DAYLIGHT
-
-/* Define to `unsigned char' if standard headers don't define.  */
-#undef uint8_t
-
-/* Define to `unsigned short' if standard headers don't define.  */
-#undef uint16_t
-
-/* Define to `unsigned int' if standard headers don't define.  */
-#undef uint32_t
-
-/* Define to `unsigned long long', if available, or `unsigned long', if
-   standard headers don't define.  */
-#undef uint64_t
-
-/* FIXME: These have to be added manually because autoheader doesn't know
-   about AC_CHECK_SIZEOF_INCLUDES.  */
-
-/* The number of bytes in a uint8_t.  */
-#define SIZEOF_UINT8_T 0
-
-/* The number of bytes in a uint16_t.  */
-#define SIZEOF_UINT16_T 0
-
-/* The number of bytes in a uint32_t.  */
-#define SIZEOF_UINT32_T 0
-
-/* The number of bytes in a uint64_t.  */
-#define SIZEOF_UINT64_T 0

+ 186 - 26
acinclude.m4

@@ -1,5 +1,5 @@
 dnl cloned from autoconf 2.13 acspecific.m4
-AC_DEFUN(AC_C_LONG_LONG,
+AC_DEFUN([AC_C_LONG_LONG],
 [AC_CACHE_CHECK(for long long, ac_cv_c_long_long,
 [if test "$GCC" = yes; then
   ac_cv_c_long_long=yes
@@ -14,23 +14,16 @@ if test $ac_cv_c_long_long = yes; then
 fi
 ])
 
-dnl from autoconf 2.13 acgeneral.m4, with patch:
-dnl Date: Fri, 15 Jan 1999 05:52:41 -0800
-dnl Message-ID: <199901151352.FAA18237@shade.twinsun.com>
-dnl From: eggert@twinsun.com (Paul Eggert)
-dnl Subject: autoconf 2.13 AC_CHECK_TYPE doesn't allow shell vars
-dnl Newsgroups: gnu.utils.bug
-
 dnl from autoconf 2.13 acspecific.m4, with changes to check for daylight
 
-AC_DEFUN(AC_STRUCT_TIMEZONE_DAYLIGHT,
+AC_DEFUN([AC_STRUCT_TIMEZONE_DAYLIGHT],
 [AC_REQUIRE([AC_STRUCT_TM])dnl
 AC_CACHE_CHECK([for tm_zone in struct tm], ac_cv_struct_tm_zone,
 [AC_TRY_COMPILE([#include <sys/types.h>
 #include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_zone;],
   ac_cv_struct_tm_zone=yes, ac_cv_struct_tm_zone=no)])
 if test "$ac_cv_struct_tm_zone" = yes; then
-  AC_DEFINE(HAVE_TM_ZONE)
+  AC_DEFINE(HAVE_TM_ZONE,1,[HAVE_TM_ZONE])
 fi
 AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
 [AC_TRY_LINK(
@@ -42,7 +35,7 @@ extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
 changequote([, ])dnl
 [atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])
   if test $ac_cv_var_tzname = yes; then
-    AC_DEFINE(HAVE_TZNAME)
+    AC_DEFINE(HAVE_TZNAME,1,[HAVE_TZNAME])
   fi
 
 AC_CACHE_CHECK([for tm_isdst in struct tm], ac_cv_struct_tm_isdst,
@@ -66,15 +59,27 @@ changequote([, ])dnl
   fi
 ])
 
-dnl AC_CHECK_TYPE2(TYPE, DEFAULT)
-AC_DEFUN(AC_CHECK_TYPE2,
+dnl from autoconf 2.13 acgeneral.m4, with patch:
+dnl Date: Fri, 15 Jan 1999 05:52:41 -0800
+dnl Message-ID: <199901151352.FAA18237@shade.twinsun.com>
+dnl From: eggert@twinsun.com (Paul Eggert)
+dnl Subject: autoconf 2.13 AC_CHECK_TYPE doesn't allow shell vars
+dnl Newsgroups: gnu.utils.bug
+dnl
+dnl now include <stdint.h> if available
+
+dnl AC_CHECK_TYPE2_STDC(TYPE, DEFAULT)
+AC_DEFUN([AC_CHECK_TYPE2_STDC],
 [AC_REQUIRE([AC_HEADER_STDC])dnl
+AC_REQUIRE([AC_HEADER_STDINT])dnl
 AC_MSG_CHECKING(for $1)
 AC_CACHE_VAL(ac_cv_type_$1,
 [AC_EGREP_CPP(dnl
-changequote(<<,>>)dnl
-<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
-changequote([,]), [#include <sys/types.h>
+[(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]],
+[#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include <sys/types.h>
 #if STDC_HEADERS
 #include <stdlib.h>
 #include <stddef.h>
@@ -88,14 +93,12 @@ fi
 ])
 
 dnl from autoconf 2.13 acgeneral.m4, with additional third argument
-dnl AC_CHECK_SIZEOF_INCLUDES(TYPE [, CROSS-SIZE, [INCLUDES]])
-AC_DEFUN(AC_CHECK_SIZEOF_INCLUDES,
-[changequote(<<, >>)dnl
-dnl The name to #define.
-define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
+dnl AC_CHECK_SIZEOF_INCLUDES(TYPE [, CROSS-SIZE [, INCLUDES]])
+AC_DEFUN([AC_CHECK_SIZEOF_INCLUDES],
+[dnl The name to #define.
+define([AC_TYPE_NAME], translit(sizeof_$1, [[[a-z *]]], [[[A-Z_P]]]))dnl
 dnl The cache variable name.
-define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
-changequote([, ])dnl
+define([AC_CV_NAME], translit(ac_cv_sizeof_$1, [[[ *]]], [[[_p]]]))dnl
 AC_MSG_CHECKING(size of $1)
 AC_CACHE_VAL(AC_CV_NAME,
 [AC_TRY_RUN([$3
@@ -114,11 +117,168 @@ undefine([AC_CV_NAME])dnl
 ])
 
 dnl AC_CHECK_SIZEOF_STDC_HEADERS(TYPE [, CROSS_SIZE])
-AC_DEFUN(AC_CHECK_SIZEOF_STDC_HEADERS,
-[AC_CHECK_SIZEOF_INCLUDES($1, $2,
-[#include <sys/types.h>
+AC_DEFUN([AC_CHECK_SIZEOF_STDC_HEADERS],
+[AC_REQUIRE([AC_HEADER_STDC])dnl
+AC_REQUIRE([AC_HEADER_STDINT])dnl
+AC_CHECK_SIZEOF_INCLUDES($1, $2,
+[#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include <sys/types.h>
 #ifdef STDC_HEADERS
 #include <stdlib.h>
 #endif
 ])
 ])
+
+
+dnl AC_CHECK_TYPE_STDC(TYPE, DEFAULT)
+AC_DEFUN([AC_CHECK_TYPE_STDC],
+[AC_REQUIRE([AC_HEADER_STDC])dnl
+AC_REQUIRE([AC_HEADER_STDINT])dnl
+AC_MSG_CHECKING(for $1)
+AC_CACHE_VAL(ac_cv_type_$1,
+[AC_EGREP_CPP(dnl
+[(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]],
+[#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
+AC_MSG_RESULT($ac_cv_type_$1)
+if test $ac_cv_type_$1 = no; then
+  AC_DEFINE($1, $2)
+fi
+])
+
+dnl AC_HEADER_STDINT
+AC_DEFUN([AC_HEADER_STDINT], [AC_CHECK_HEADERS(stdint.h)])
+
+#serial 19
+
+dnl By default, many hosts won't let programs access large files;
+dnl one must use special compiler options to get large-file access to work.
+dnl For more details about this brain damage please see:
+dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
+
+dnl Written by Paul Eggert <eggert@twinsun.com>.
+
+dnl Internal subroutine of AC_SYS_LARGEFILE.
+dnl AC_SYS_LARGEFILE_TEST_INCLUDES
+AC_DEFUN([AC_SYS_LARGEFILE_TEST_INCLUDES],
+  [[#include <sys/types.h>
+    /* Check that off_t can represent 2**63 - 1 correctly.
+       We can't simply "#define LARGE_OFF_T 9223372036854775807",
+       since some C++ compilers masquerading as C compilers
+       incorrectly reject 9223372036854775807.  */
+#   define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+			&& LARGE_OFF_T % 2147483647 == 1)
+		       ? 1 : -1];
+  ]])
+
+dnl Internal subroutine of AC_SYS_LARGEFILE.
+dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLU=
+DES, FUNCTION-BODY)
+AC_DEFUN([AC_SYS_LARGEFILE_MACRO_VALUE],
+  [AC_CACHE_CHECK([for $1 value needed for large files], $3,
+     [$3=no
+      AC_TRY_COMPILE([$5],
+	[$6],
+	,
+	[AC_TRY_COMPILE([#define $1 $2]
+[$5]
+	   ,
+	   [$6],
+	   [$3=$2])])])
+   if test "[$]$3" != no; then
+     AC_DEFINE_UNQUOTED([$1], [$]$3, [$4])
+   fi])
+
+AC_DEFUN([AC_SYS_LARGEFILE],
+  [AC_REQUIRE([AC_PROG_CC])
+   AC_ARG_ENABLE(largefile,
+     [  --disable-largefile     omit support for large files])
+   if test "$enable_largefile" != no; then
+
+     AC_CACHE_CHECK([for special C compiler options needed for large files=
+],
+       ac_cv_sys_largefile_CC,
+       [ac_cv_sys_largefile_CC=no
+        if test "$GCC" != yes; then
+	  # IRIX 6.2 and later do not support large files by default,
+	  # so use the C compiler's -n32 option if that helps.
+	  AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , ,
+	    [ac_save_CC="$CC"
+	     CC="$CC -n32"
+	     AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, ,
+	       ac_cv_sys_largefile_CC=' -n32')
+	     CC="$ac_save_CC"])
+        fi])
+     if test "$ac_cv_sys_largefile_CC" != no; then
+       CC="$CC$ac_cv_sys_largefile_CC"
+     fi
+
+     AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
+       ac_cv_sys_file_offset_bits,
+       [Number of bits in a file offset, on hosts where this is settable.],
+       AC_SYS_LARGEFILE_TEST_INCLUDES)
+     AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
+       ac_cv_sys_large_files,
+       [Define for large files, on AIX-style hosts.],
+       AC_SYS_LARGEFILE_TEST_INCLUDES)
+   fi
+  ])
+
+AC_DEFUN([AC_FUNC_FSEEKO],
+  [AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
+     ac_cv_sys_largefile_source,
+     [Define to make fseeko visible on some hosts (e.g. glibc 2.2).],
+     [#include <stdio.h>], [return !fseeko;])
+   # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
+   # in glibc 2.1.3, but that breaks too many other things.
+   # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
+
+   AC_CACHE_CHECK([for fseeko], ac_cv_func_fseeko,
+     [ac_cv_func_fseeko=no
+      AC_TRY_LINK([#include <stdio.h>],
+        [return fseeko && fseeko (stdin, 0, 0);],
+	[ac_cv_func_fseeko=yes])])
+   if test $ac_cv_func_fseeko != no; then
+     AC_DEFINE(HAVE_FSEEKO, 1,
+       [Define if fseeko (and presumably ftello) exists and is declared.])
+   fi])
+
+# serial 9
+
+# From Paul Eggert.
+
+# BeOS 5 has <wchar.h> but does not define mbstate_t,
+# so you can't declare an object of that type.
+# Check for this incompatibility with Standard C.
+
+# Include stdlib.h first, because otherwise this test would fail on Linux
+# (at least glibc-2.1.3) because the "_XOPEN_SOURCE 500" definition elicits
+# a syntax error in wchar.h due to the use of undefined __int32_t.
+AC_DEFUN([AC_MBSTATE_T],
+  [
+   AC_CHECK_HEADERS(stdlib.h)
+  
+   AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
+    [AC_TRY_COMPILE([
+#if HAVE_STDLIB_H 
+# include <stdlib.h>
+#endif
+#include <wchar.h>],
+      [mbstate_t x; return sizeof x;],
+      ac_cv_type_mbstate_t=yes,
+      ac_cv_type_mbstate_t=no)])
+   if test $ac_cv_type_mbstate_t = no; then
+     AC_DEFINE(mbstate_t, int,
+               [Define to a type if <wchar.h> does not define.])
+   fi])
+
+

File diff suppressed because it is too large
+ 4459 - 111
aclocal.m4


File diff suppressed because it is too large
+ 0 - 1145
apprentice.c


+ 0 - 192
compress.c

@@ -1,192 +0,0 @@
-/*
- * compress routines:
- *	zmagic() - returns 0 if not recognized, uncompresses and prints
- *		   information if recognized
- *	uncompress(method, old, n, newch) - uncompress old into new, 
- *					    using method, return sizeof new
- */
-#include "file.h"
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <string.h>
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
-#ifndef lint
-FILE_RCSID("@(#)$Id: compress.c,v 1.20 2001/07/22 21:04:15 christos Exp $")
-#endif
-
-
-static struct {
-	const char *magic;
-	int   maglen;
-	const char *const argv[3];
-	int	 silent;
-} compr[] = {
-	{ "\037\235", 2, { "gzip", "-cdq", NULL }, 1 },		/* compressed */
-	/* Uncompress can get stuck; so use gzip first if we have it
-	 * Idea from Damien Clark, thanks! */
-	{ "\037\235", 2, { "uncompress", "-c", NULL }, 1 },	/* compressed */
-	{ "\037\213", 2, { "gzip", "-cdq", NULL }, 1 },		/* gzipped */
-	{ "\037\236", 2, { "gzip", "-cdq", NULL }, 1 },		/* frozen */
-	{ "\037\240", 2, { "gzip", "-cdq", NULL }, 1 },		/* SCO LZH */
-	/* the standard pack utilities do not accept standard input */
-	{ "\037\036", 2, { "gzip", "-cdq", NULL }, 0 },		/* packed */
-	{ "BZh",      3, { "bzip2", "-cd", NULL }, 1 },		/* bzip2-ed */
-};
-
-static int ncompr = sizeof(compr) / sizeof(compr[0]);
-
-
-static int uncompress __P((int, const unsigned char *, unsigned char **, int));
-static int swrite __P((int, const void *, size_t));
-static int sread __P((int, void *, size_t));
-
-int
-zmagic(buf, nbytes)
-	unsigned char *buf;
-	int nbytes;
-{
-	unsigned char *newbuf;
-	int newsize;
-	int i;
-
-	for (i = 0; i < ncompr; i++) {
-		if (nbytes < compr[i].maglen)
-			continue;
-		if (memcmp(buf, compr[i].magic, compr[i].maglen) == 0 &&
-		    (newsize = uncompress(i, buf, &newbuf, nbytes)) != 0) {
-			tryit(newbuf, newsize, 1);
-			free(newbuf);
-			printf(" (");
-			tryit(buf, nbytes, 0);
-			printf(")");
-			return 1;
-		}
-	}
-
-	if (i == ncompr)
-		return 0;
-
-	return 1;
-}
-
-/*
- * `safe' write for sockets and pipes.
- */
-static int
-swrite(fd, buf, n)
-	int fd;
-	const void *buf;
-	size_t n;
-{
-	int rv;
-	size_t rn = n;
-
-	do
-		switch (rv = write(fd, buf, n)) {
-		case -1:
-			if (errno == EINTR)
-				continue;
-			return -1;
-		default:
-			n -= rv;
-			buf = ((char *)buf) + rv;
-			break;
-		}
-	while (n > 0);
-	return rn;
-}
-
-
-/*
- * `safe' read for sockets and pipes.
- */
-static int
-sread(fd, buf, n)
-	int fd;
-	void *buf;
-	size_t n;
-{
-	int rv;
-	size_t rn = n;
-
-	do
-		switch (rv = read(fd, buf, n)) {
-		case -1:
-			if (errno == EINTR)
-				continue;
-			return -1;
-		default:
-			n -= rv;
-			buf = ((char *)buf) + rv;
-			break;
-		}
-	while (n > 0);
-	return rn;
-}
-
-static int
-uncompress(method, old, newch, n)
-	int method;
-	const unsigned char *old;
-	unsigned char **newch;
-	int n;
-{
-	int fdin[2], fdout[2];
-
-	if (pipe(fdin) == -1 || pipe(fdout) == -1) {
-		error("cannot create pipe (%s).\n", strerror(errno));	
-		/*NOTREACHED*/
-	}
-	switch (fork()) {
-	case 0:	/* child */
-		(void) close(0);
-		(void) dup(fdin[0]);
-		(void) close(fdin[0]);
-		(void) close(fdin[1]);
-
-		(void) close(1);
-		(void) dup(fdout[1]);
-		(void) close(fdout[0]);
-		(void) close(fdout[1]);
-		if (compr[method].silent)
-			(void) close(2);
-
-		execvp(compr[method].argv[0],
-		       (char *const *)compr[method].argv);
-		exit(1);
-		/*NOTREACHED*/
-	case -1:
-		error("could not fork (%s).\n", strerror(errno));
-		/*NOTREACHED*/
-
-	default: /* parent */
-		(void) close(fdin[0]);
-		(void) close(fdout[1]);
-		if (swrite(fdin[1], old, n) != n) {
-			n = 0;
-			goto err;
-		}
-		(void) close(fdin[1]);
-		fdin[1] = -1;
-		if ((*newch = (unsigned char *) malloc(n)) == NULL) {
-			n = 0;
-			goto err;
-		}
-		if ((n = sread(fdout[0], *newch, n)) <= 0) {
-			free(*newch);
-			n = 0;
-			goto err;
-		}
-err:
-		if (fdin[1] != -1)
-			(void) close(fdin[1]);
-		(void) close(fdout[0]);
-		(void) wait(NULL);
-		return n;
-	}
-}

File diff suppressed because it is too large
+ 1354 - 0
config.guess


+ 155 - 62
config.h.in

@@ -1,100 +1,193 @@
-/* config.h.in.  Generated automatically from configure.in by autoheader.  */
+/* config.h.in.  Generated from configure.in by autoheader.  */
 
-/* Define to empty if the keyword does not work.  */
-#undef const
+/* Use the builtin ELF recognition code */
+#undef BUILTIN_ELF
 
-/* Define if your struct stat has st_rdev.  */
-#undef HAVE_ST_RDEV
+/* Recognize ELF core files */
+#undef ELFCORE
 
-/* Define if you have <sys/wait.h> that is POSIX.1 compatible.  */
-#undef HAVE_SYS_WAIT_H
+/* */
+#undef HAVE_DAYLIGHT
 
-/* Define if your struct tm has tm_zone.  */
-#undef HAVE_TM_ZONE
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
 
-/* Define if you don't have tm_zone but do have the external array
-   tzname.  */
-#undef HAVE_TZNAME
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
 
-/* Define if major, minor, and makedev are declared in <mkdev.h>.  */
-#undef MAJOR_IN_MKDEV
+/* Define to 1 if you have the <getopt.h> header file. */
+#undef HAVE_GETOPT_H
 
-/* Define if major, minor, and makedev are declared in <sysmacros.h>.  */
-#undef MAJOR_IN_SYSMACROS
+/* Define to 1 if you have the `getopt_long' function. */
+#undef HAVE_GETOPT_LONG
 
-/* Define to `long' if <sys/types.h> doesn't define.  */
-#undef off_t
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
 
-/* Define to `unsigned' if <sys/types.h> doesn't define.  */
-#undef size_t
+/* Define to 1 if you have the `z' library (-lz). */
+#undef HAVE_LIBZ
 
-/* Define if you have the ANSI C header files.  */
-#undef STDC_HEADERS
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
 
-/* Define if your <sys/time.h> declares struct tm.  */
-#undef TM_IN_SYS_TIME
+/* */
+#undef HAVE_LONG_LONG
 
-/* Define if builtin ELF support is enabled.  */
-#undef BUILTIN_ELF
+/* Define to 1 if you have the `mbrtowc' function. */
+#undef HAVE_MBRTOWC
 
-/* Define if ELF core file support is enabled.  */
-#undef ELFCORE
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
 
-/* Define if the `long long' type works.  */
-#undef HAVE_LONG_LONG
+/* Define to 1 if you have the `mkstemp' function. */
+#undef HAVE_MKSTEMP
 
-/* Define if we have "tm_isdst" in "struct tm".  */
-#undef HAVE_TM_ISDST
+/* Define to 1 if you have the `mmap' function. */
+#undef HAVE_MMAP
 
-/* Define if we have a global "int" variable "daylight".  */
-#undef HAVE_DAYLIGHT
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
 
-/* Define to `unsigned char' if standard headers don't define.  */
-#undef uint8_t
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
 
-/* Define to `unsigned short' if standard headers don't define.  */
-#undef uint16_t
+/* Define to 1 if you have the `strerror' function. */
+#undef HAVE_STRERROR
 
-/* Define to `unsigned int' if standard headers don't define.  */
-#undef uint32_t
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
 
-/* Define to `unsigned long long', if available, or `unsigned long', if
-   standard headers don't define.  */
-#undef uint64_t
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strtoul' function. */
+#undef HAVE_STRTOUL
+
+/* Define to 1 if `st_rdev' is member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_RDEV
 
-/* The number of bytes in a uint8_t.  */
-#define SIZEOF_UINT8_T 0
+/* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use
+   `HAVE_STRUCT_STAT_ST_RDEV' instead. */
+#undef HAVE_ST_RDEV
 
-/* The number of bytes in a uint16_t.  */
-#define SIZEOF_UINT16_T 0
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#undef HAVE_SYS_MMAN_H
 
-/* The number of bytes in a uint32_t.  */
-#define SIZEOF_UINT32_T 0
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
 
-/* The number of bytes in a uint64_t.  */
-#define SIZEOF_UINT64_T 0
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
 
-/* Define if you have the mmap function.  */
-#undef HAVE_MMAP
+/* Define to 1 if you have the <sys/utime.h> header file. */
+#undef HAVE_SYS_UTIME_H
 
-/* Define if you have the strerror function.  */
-#undef HAVE_STRERROR
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
 
-/* Define if you have the strtoul function.  */
-#undef HAVE_STRTOUL
+/* */
+#undef HAVE_TM_ISDST
 
-/* Define if you have the <locale.h> header file.  */
-#undef HAVE_LOCALE_H
+/* HAVE_TM_ZONE */
+#undef HAVE_TM_ZONE
 
-/* Define if you have the <sys/mman.h> header file.  */
-#undef HAVE_SYS_MMAN_H
+/* HAVE_TZNAME */
+#undef HAVE_TZNAME
 
-/* Define if you have the <unistd.h> header file.  */
+/* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Define to 1 if you have the `utime' function. */
+#undef HAVE_UTIME
+
+/* Define to 1 if you have the `utimes' function. */
+#undef HAVE_UTIMES
+
+/* Define to 1 if you have the <utime.h> header file. */
+#undef HAVE_UTIME_H
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#undef HAVE_WCHAR_H
+
+/* Define to 1 if you have the `wcwidth' function. */
+#undef HAVE_WCWIDTH
+
+/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
+   */
+#undef MAJOR_IN_MKDEV
+
+/* Define to 1 if `major', `minor', and `makedev' are declared in
+   <sysmacros.h>. */
+#undef MAJOR_IN_SYSMACROS
+
 /* Name of package */
 #undef PACKAGE
 
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* */
+#undef SIZEOF_UINT16_T
+
+/* */
+#undef SIZEOF_UINT32_T
+
+/* */
+#undef SIZEOF_UINT64_T
+
+/* */
+#undef SIZEOF_UINT8_T
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+#undef TM_IN_SYS_TIME
+
 /* Version number of package */
 #undef VERSION
 
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* */
+#undef int32_t
+
+/* Define to a type if <wchar.h> does not define. */
+#undef mbstate_t
+
+/* Define to `long' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
+
+/* */
+#undef uint16_t
+
+/* */
+#undef uint32_t
+
+/* */
+#undef uint64_t
+
+/* */
+#undef uint8_t

File diff suppressed because it is too large
+ 1460 - 0
config.sub


File diff suppressed because it is too large
+ 11016 - 1647
configure


+ 54 - 13
configure.in

@@ -1,7 +1,9 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(file.c)
-AM_INIT_AUTOMAKE(file, 3.37)
-AM_CONFIG_HEADER(config.h)
+AC_INIT
+AC_CONFIG_SRCDIR([src/file.c])
+AM_INIT_AUTOMAKE(file, 4.12)
+AM_CONFIG_HEADER([config.h])
+dnl AM_MAINTAINER_MODE
 
 AC_MSG_CHECKING(for builtin ELF support)
 AC_ARG_ENABLE(elf,
@@ -52,27 +54,62 @@ dnl Checks for programs.
 AC_PROG_CC
 AC_PROG_INSTALL
 AC_PROG_LN_S
+AC_PROG_LIBTOOL
+
+dnl Templates for autoheader
+AH_TEMPLATE([BUILTIN_ELF],
+	    [Use the builtin ELF recognition code])
+AH_TEMPLATE([ELFCORE],
+	    [Recognize ELF core files])
+AH_TEMPLATE([HAVE_DAYLIGHT], [])
+AH_TEMPLATE([HAVE_LONG_LONG], [])
+AH_TEMPLATE([HAVE_TM_ISDST], [])
+AH_TEMPLATE([SIZEOF_UINT16_T], [])
+AH_TEMPLATE([SIZEOF_UINT32_T], [])
+AH_TEMPLATE([SIZEOF_UINT64_T], [])
+AH_TEMPLATE([SIZEOF_UINT8_T], [])
+AH_TEMPLATE([int32_t], [])
+AH_TEMPLATE([uint16_t], [])
+AH_TEMPLATE([uint32_t], [])
+AH_TEMPLATE([uint64_t], [])
+AH_TEMPLATE([uint8_t], [])
 
 dnl Checks for headers
 AC_HEADER_STDC
 AC_HEADER_MAJOR
 AC_HEADER_SYS_WAIT
+AC_HEADER_STDINT
+AC_CHECK_HEADERS(fcntl.h locale.h)