Browse Source

Import upstream version 4.15

Christos Zoulas 18 years ago
parent
commit
a1071468b1
68 changed files with 30076 additions and 10981 deletions
  1. 60 0
      ChangeLog
  2. 323 144
      Makefile.in
  3. 6418 3991
      aclocal.m4
  4. 9 0
      config.h.in
  5. 17816 4795
      configure
  6. 7 4
      configure.in
  7. 213 100
      doc/Makefile.in
  8. 37 8
      doc/file.man
  9. 165 35
      doc/magic.man
  10. 2385 887
      ltmain.sh
  11. 33 21
      magic/Magdir/adventure
  12. 4 0
      magic/Magdir/amigaos
  13. 131 111
      magic/Magdir/animation
  14. 3 0
      magic/Magdir/apple
  15. 324 10
      magic/Magdir/archive
  16. 34 1
      magic/Magdir/audio
  17. 1 1
      magic/Magdir/bout
  18. 17 2
      magic/Magdir/c64
  19. 25 7
      magic/Magdir/cad
  20. 2 2
      magic/Magdir/compress
  21. 3 33
      magic/Magdir/console
  22. 13 0
      magic/Magdir/cracklib
  23. 1 1
      magic/Magdir/ctags
  24. 9 0
      magic/Magdir/database
  25. 2 0
      magic/Magdir/diff
  26. 2 2
      magic/Magdir/digital
  27. 53 56
      magic/Magdir/elf
  28. 265 2
      magic/Magdir/filesystems
  29. 3 0
      magic/Magdir/flash
  30. 11 1
      magic/Magdir/gnu
  31. 0 7
      magic/Magdir/hdf
  32. 10 0
      magic/Magdir/iff
  33. 10 3
      magic/Magdir/images
  34. 4 3
      magic/Magdir/java
  35. 7 0
      magic/Magdir/linux
  36. 63 8
      magic/Magdir/mach
  37. 1 1
      magic/Magdir/macintosh
  38. 3 2
      magic/Magdir/mail.news
  39. 6 2
      magic/Magdir/misctools
  40. 266 130
      magic/Magdir/msdos
  41. 22 0
      magic/Magdir/mup
  42. 9 0
      magic/Magdir/perl
  43. 4 0
      magic/Magdir/printer
  44. 1 0
      magic/Magdir/riff
  45. 60 0
      magic/Magdir/scientific
  46. 6 6
      magic/Magdir/sgi
  47. 1 1
      magic/Magdir/sharc
  48. 16 0
      magic/Magdir/sql
  49. 3 2
      magic/Magdir/varied.out
  50. 11 3
      magic/Makefile.am
  51. 191 82
      magic/Makefile.in
  52. 24 11
      magic/magic.mime
  53. 0 0
      mkinstalldirs
  54. 163 64
      python/Makefile.in
  55. 270 165
      src/Makefile.in
  56. 35 18
      src/apprentice.c
  57. 66 48
      src/ascmagic.c
  58. 72 34
      src/compress.c
  59. 11 4
      src/file.c
  60. 24 12
      src/file.h
  61. 3 1
      src/fsmagic.c
  62. 32 3
      src/funcs.c
  63. 29 20
      src/magic.c
  64. 11 2
      src/patchlevel.h
  65. 6 2
      src/print.c
  66. 16 1
      src/readelf.c
  67. 1 0
      src/readelf.h
  68. 250 132
      src/softmagic.c

+ 60 - 0
ChangeLog

@@ -1,3 +1,63 @@
+2005-08-18 09:53 Christos Zoulas <christos@zoulas.com>
+
+	* Remove erroreous mention of /etc/magic in the file man page
+	  This is gentoo bug 101639. (Mike Frysinger) 
+
+	* Cross-compile support and detection (Mike Frysinger) 
+
+2005-08-12 10:17 Christos Zoulas <christos@zoulas.com>
+
+	* Add -h flag and dereference symlinks if POSIXLY_CORRECT
+	  is set.
+
+2005-07-29 13:57 Christos Zoulas <christos@zoulas.com>
+
+	* Avoid search and regex buffer overflows (Kelledin)
+
+2005-07-12 11:48 Christos Zoulas <christos@zoulas.com>
+
+	* Provide stub implementations for {v,}nsprintf() for older
+	  OS's that don't have them.
+	* Change mbstate_t autoconf detection macro from AC_MBSTATE_T
+	  to AC_TYPE_MBSTATE_T.
+
+2005-06-25 11:48 Christos Zoulas <christos@zoulas.com>
+
+	* Dynamically allocate the string buffers and make the
+	  default read size 256K.
+
+2005-06-01 00:00 Joerg Sonnenberger <joerg@britannica.bec.de>
+
+	* Dragonfly ELF note support
+
+2005-03-14 00:00 Giuliano Bertoletti <gb@symbolic.it>
+
+	* Avoid NULL pointer dereference in time conversion.
+
+2005-03-06 00:00  Joerg Walter <jwalt@mail.garni.ch>
+	
+	* Add indirect magic offset support, and search mode.
+
+2005-01-12 00:00  Stepan Kasal  <kasal@ucw.cz>
+
+        * src/ascmagic.c (file_ascmagic): Fix three bugs about text files:
+          If a CRLF text file happens to have CR at offset HOWMANY - 1
+          (currently 0xffff), it should not be counted as CR line
+          terminator.
+          If a line has length exactly MAXLINELEN, it should not yet be
+          treated as a ``very long line'', as MAXLINELEN is ``longest sane
+          line length''.
+          With CRLF, the line length was not computed correctly, and even
+          lines of length MAXLINELEN - 1 were treated as ``very long''.
+
+2004-12-07 14:15  Christos Zoulas  <christos@zoulas.com>
+
+	* bzip2 needs a lot of input buffer space on some files
+	  before it can begin uncompressing. This makes file -z
+	  fail on some bz2 files. Fix it by giving it a copy of
+	  the file descriptor to read as much as it wants if we
+	  have access to it. <christos@zoulas.com>
+
 2004-11-24 12:39  Christos Zoulas  <christos@zoulas.com>
 
 	* Stack smash fix, and ELF more conservative reading.

+ 323 - 144
Makefile.in

@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.6.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
 # @configure_input@
 
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -13,121 +13,213 @@
 # PARTICULAR PURPOSE.
 
 @SET_MAKE@
-SHELL = @SHELL@
-
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
 VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 top_builddir = .
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_HEADER = $(INSTALL_DATA)
-transform = @program_transform_name@
+transform = $(program_transform_name)
 NORMAL_INSTALL = :
 PRE_INSTALL = :
 POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
-host_alias = @host_alias@
+build_triplet = @build@
 host_triplet = @host@
-
-EXEEXT = @EXEEXT@
-OBJEXT = @OBJEXT@
-PATH_SEPARATOR = @PATH_SEPARATOR@
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(srcdir)/config.h.in \
+	$(top_srcdir)/configure ChangeLog config.guess config.sub \
+	depcomp install-sh ltcf-c.sh ltconfig ltmain.sh missing \
+	mkinstalldirs
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno configure.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+depcomp =
+am__depfiles_maybe =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  { test ! -d $(distdir) \
+    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
-AS = @AS@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
 DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
 ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FSECT5_FALSE = @FSECT5_FALSE@
+FSECT5_TRUE = @FSECT5_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+IS_CROSS_COMPILE_FALSE = @IS_CROSS_COMPILE_FALSE@
+IS_CROSS_COMPILE_TRUE = @IS_CROSS_COMPILE_TRUE@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
 LN_S = @LN_S@
-OBJDUMP = @OBJDUMP@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
+am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
 fsect = @fsect@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
 install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
 
 # don't enforce GNU packaging standards
 AUTOMAKE_OPTIONS = foreign no-dependencies
-
 EXTRA_DIST = LEGAL.NOTICE MAINT PORTING
-
 SUBDIRS = src magic doc python
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =
-depcomp =
-am__depfiles_maybe =
-DIST_SOURCES =
-
-RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
-	uninstall-info-recursive all-recursive install-data-recursive \
-	install-exec-recursive installdirs-recursive install-recursive \
-	uninstall-recursive check-recursive installcheck-recursive
-DIST_COMMON = README ChangeLog Makefile.am Makefile.in acinclude.m4 \
-	aclocal.m4 config.guess config.h.in config.sub configure \
-	configure.in depcomp install-sh ltcf-c.sh ltconfig ltmain.sh \
-	missing mkinstalldirs
-DIST_SUBDIRS = $(SUBDIRS)
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
 .SUFFIXES:
-
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno
-$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4)
+am--refresh:
+	@:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+	      cd $(srcdir) && $(AUTOMAKE) --foreign  \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
 	cd $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign  Makefile
-Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
-	cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
-
-$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    echo ' $(SHELL) ./config.status'; \
+	    $(SHELL) ./config.status;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	$(SHELL) ./config.status --recheck
-$(srcdir)/configure:  $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
-	cd $(srcdir) && $(AUTOCONF)
 
-$(ACLOCAL_M4):  configure.in acinclude.m4
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
 
 config.h: stamp-h1
@@ -139,10 +231,10 @@ config.h: stamp-h1
 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
 	@rm -f stamp-h1
 	cd $(top_builddir) && $(SHELL) ./config.status config.h
-
-$(srcdir)/config.h.in:  $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 
 	cd $(top_srcdir) && $(AUTOHEADER)
-	touch $(srcdir)/config.h.in
+	rm -f stamp-h1
+	touch $@
 
 distclean-hdr:
 	-rm -f config.h stamp-h1
@@ -164,7 +256,13 @@ uninstall-info-am:
 #     (which will cause the Makefiles to be regenerated when you run `make');
 # (2) otherwise, pass the desired values on the `make' command line.
 $(RECURSIVE_TARGETS):
-	@set fnord $$MAKEFLAGS; amf=$$2; \
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -176,7 +274,7 @@ $(RECURSIVE_TARGETS):
 	    local_target="$$target"; \
 	  fi; \
 	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	  || eval $$failcom; \
 	done; \
 	if test "$$dot_seen" = "no"; then \
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
@@ -184,7 +282,13 @@ $(RECURSIVE_TARGETS):
 
 mostlyclean-recursive clean-recursive distclean-recursive \
 maintainer-clean-recursive:
-	@set fnord $$MAKEFLAGS; amf=$$2; \
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
 	dot_seen=no; \
 	case "$@" in \
 	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
@@ -205,17 +309,16 @@ maintainer-clean-recursive:
 	    local_target="$$target"; \
 	  fi; \
 	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	  || eval $$failcom; \
 	done && test -z "$$fail"
 tags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
 	done
-
-ETAGS = etags
-ETAGSFLAGS =
-
-tags: TAGS
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -225,14 +328,23 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	  $(AWK) '    { files[$$0] = 1; } \
 	       END { for (i in files) print i; }'`; \
 	mkid -fID $$unique
+tags: TAGS
 
 TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
 	tags=; \
 	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
 	done; \
 	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
@@ -241,8 +353,24 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 	  done | \
 	  $(AWK) '    { files[$$0] = 1; } \
 	       END { for (i in files) print i; }'`; \
-	test -z "$(ETAGS_ARGS)$$tags$$unique" \
-	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$tags $$unique
 
 GTAGS:
@@ -251,29 +379,23 @@ GTAGS:
 	  && gtags -i $(GTAGS_ARGS) $$here
 
 distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-top_distdir = .
-distdir = $(PACKAGE)-$(VERSION)
-
-am__remove_distdir = \
-  { test ! -d $(distdir) \
-    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr $(distdir); }; }
-
-GZIP_ENV = --best
-distcleancheck_listfiles = find . -type f -print
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
 	$(am__remove_distdir)
 	mkdir $(distdir)
-	@list='$(DISTFILES)'; for file in $$list; do \
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
 	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
 	    dir="/$$dir"; \
-	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
 	  else \
 	    dir=''; \
 	  fi; \
@@ -288,15 +410,17 @@ distdir: $(DISTFILES)
 	    || exit 1; \
 	  fi; \
 	done
-	list='$(SUBDIRS)'; for subdir in $$list; do \
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d $(distdir)/$$subdir \
-	    || mkdir $(distdir)/$$subdir \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
 	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
 	    (cd $$subdir && \
 	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$(top_distdir)" \
-	        distdir=../$(distdir)/$$subdir \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
 	        distdir) \
 	      || exit 1; \
 	  fi; \
@@ -307,26 +431,54 @@ distdir: $(DISTFILES)
 	  ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
 	|| chmod -R a+r $(distdir)
 dist-gzip: distdir
-	$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+dist-bzip2: distdir
+	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+	$(am__remove_distdir)
+
+dist-tarZ: distdir
+	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+	$(am__remove_distdir)
+
+dist-shar: distdir
+	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	$(am__remove_distdir)
+
+dist-zip: distdir
+	-rm -f $(distdir).zip
+	zip -rq $(distdir).zip $(distdir)
 	$(am__remove_distdir)
 
 dist dist-all: distdir
-	$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
 	$(am__remove_distdir)
 
 # This target untars the dist file and tries a VPATH configuration.  Then
 # it guarantees that the distribution is self-contained by making another
 # tarfile.
 distcheck: dist
-	$(am__remove_distdir)
-	GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
+	case '$(DIST_ARCHIVES)' in \
+	*.tar.gz*) \
+	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+	*.tar.bz2*) \
+	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+	*.tar.Z*) \
+	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+	*.shar.gz*) \
+	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+	*.zip*) \
+	  unzip $(distdir).zip ;;\
+	esac
 	chmod -R a-w $(distdir); chmod a+w $(distdir)
-	mkdir $(distdir)/=build
-	mkdir $(distdir)/=inst
+	mkdir $(distdir)/_build
+	mkdir $(distdir)/_inst
 	chmod a-w $(distdir)
-	dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
-	  && cd $(distdir)/=build \
-	  && ../configure --srcdir=.. --prefix=$$dc_install_base \
+	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+	  && cd $(distdir)/_build \
+	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
@@ -334,23 +486,40 @@ distcheck: dist
 	  && $(MAKE) $(AM_MAKEFLAGS) install \
 	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
 	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
-	  && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \
-	      || { echo "ERROR: files left after uninstall:" ; \
-	           find $$dc_install_base -type f -print ; \
-	           exit 1; } >&2 ) \
-	  && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
-	  && rm -f $(distdir).tar.gz \
+	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+	        distuninstallcheck \
+	  && chmod -R a-w "$$dc_install_base" \
+	  && ({ \
+	       (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
+	  && rm -rf "$$dc_destdir" \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist \
+	  && rm -rf $(DIST_ARCHIVES) \
 	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
 	$(am__remove_distdir)
-	@echo "$(distdir).tar.gz is ready for distribution" | \
-	  sed 'h;s/./=/g;p;x;p;x'
+	@(echo "$(distdir) archives ready for distribution: "; \
+	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+	  sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+distuninstallcheck:
+	@cd $(distuninstallcheck_dir) \
+	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+	   || { echo "ERROR: files left after uninstall:" ; \
+	        if test -n "$(DESTDIR)"; then \
+	          echo "  (check DESTDIR support)"; \
+	        fi ; \
+	        $(distuninstallcheck_listfiles) ; \
+	        exit 1; } >&2
 distcleancheck: distclean
-	if test '$(srcdir)' = . ; then \
+	@if test '$(srcdir)' = . ; then \
 	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
 	  exit 1 ; \
 	fi
-	test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
-	  || { echo "ERROR: files left after distclean:" ; \
+	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+	  || { echo "ERROR: files left in build directory after distclean:" ; \
 	       $(distcleancheck_listfiles) ; \
 	       exit 1; } >&2
 check-am: all-am
@@ -358,7 +527,6 @@ check: check-recursive
 all-am: Makefile config.h
 installdirs: installdirs-recursive
 installdirs-am:
-
 install: install-recursive
 install-exec: install-exec-recursive
 install-data: install-data-recursive
@@ -370,7 +538,7 @@ install-am: all-am
 installcheck: installcheck-recursive
 install-strip:
 	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  INSTALL_STRIP_FLAG=-s \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
 	  `test -z '$(STRIP)' || \
 	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
@@ -378,7 +546,7 @@ mostlyclean-generic:
 clean-generic:
 
 distclean-generic:
-	-rm -f Makefile $(CONFIG_CLEAN_FILES)
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -389,13 +557,16 @@ clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-recursive
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-distclean-am: clean-am distclean-generic distclean-hdr distclean-libtool \
-	distclean-tags
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr \
+	distclean-libtool distclean-tags
 
 dvi: dvi-recursive
 
 dvi-am:
 
+html: html-recursive
+
 info: info-recursive
 
 info-am:
@@ -412,32 +583,40 @@ installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-	-rm -rf autom4te.cache
+	-rm -rf $(top_srcdir)/autom4te.cache
+	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-recursive
 
 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
 
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
 uninstall-am: uninstall-info-am
 
 uninstall-info: uninstall-info-recursive
 
-.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \
-	clean-generic clean-libtool clean-recursive dist dist-all \
-	dist-gzip distcheck distclean distclean-generic distclean-hdr \
-	distclean-libtool distclean-recursive distclean-tags \
-	distcleancheck distdir dvi dvi-am dvi-recursive info info-am \
-	info-recursive install install-am install-data install-data-am \
-	install-data-recursive install-exec install-exec-am \
-	install-exec-recursive install-info install-info-am \
-	install-info-recursive install-man install-recursive \
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
+	check-am clean clean-generic clean-libtool clean-recursive \
+	ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
+	dist-shar dist-tarZ dist-zip distcheck distclean \
+	distclean-generic distclean-hdr distclean-libtool \
+	distclean-recursive distclean-tags distcleancheck distdir \
+	distuninstallcheck dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
 	install-strip installcheck installcheck-am installdirs \
-	installdirs-am installdirs-recursive maintainer-clean \
-	maintainer-clean-generic maintainer-clean-recursive mostlyclean \
-	mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
-	tags tags-recursive uninstall uninstall-am uninstall-info-am \
-	uninstall-info-recursive uninstall-recursive
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	maintainer-clean-recursive mostlyclean mostlyclean-generic \
+	mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
+	tags tags-recursive uninstall uninstall-am uninstall-info-am
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.

File diff suppressed because it is too large
+ 6418 - 3991
aclocal.m4


+ 9 - 0
config.h.in

@@ -36,6 +36,9 @@
 /* Define to 1 if you have the `mbrtowc' function. */
 #undef HAVE_MBRTOWC
 
+/* Define to 1 if <wchar.h> declares mbstate_t. */
+#undef HAVE_MBSTATE_T
+
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
@@ -45,6 +48,9 @@
 /* Define to 1 if you have the `mmap' function. */
 #undef HAVE_MMAP
 
+/* Define to 1 if you have the `snprintf' function. */
+#undef HAVE_SNPRINTF
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
@@ -106,6 +112,9 @@
 /* Define to 1 if you have the <utime.h> header file. */
 #undef HAVE_UTIME_H
 
+/* Define to 1 if you have the `vsnprintf' function. */
+#undef HAVE_VSNPRINTF
+
 /* Define to 1 if you have the <wchar.h> header file. */
 #undef HAVE_WCHAR_H
 

File diff suppressed because it is too large
+ 17816 - 4795
configure


+ 7 - 4
configure.in

@@ -1,9 +1,9 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT
 AC_CONFIG_SRCDIR([src/file.c])
-AM_INIT_AUTOMAKE(file, 4.12)
+AM_INIT_AUTOMAKE(file, 4.15)
 AM_CONFIG_HEADER([config.h])
-dnl AM_MAINTAINER_MODE
+AM_MAINTAINER_MODE
 
 AC_MSG_CHECKING(for builtin ELF support)
 AC_ARG_ENABLE(elf,
@@ -104,7 +104,7 @@ AC_CHECK_MEMBERS([struct stat.st_rdev],[AC_DEFINE(HAVE_ST_RDEV, 1,
 
 AC_STRUCT_TIMEZONE_DAYLIGHT
 AC_SYS_LARGEFILE
-AC_MBSTATE_T
+AC_TYPE_MBSTATE_T
 
 AC_CHECK_TYPE_STDC(uint8_t, unsigned char)
 AC_CHECK_TYPE_STDC(uint16_t, unsigned short)
@@ -125,10 +125,13 @@ AC_CHECK_SIZEOF_STDC_HEADERS(uint32_t, 0)
 AC_CHECK_SIZEOF_STDC_HEADERS(uint64_t, 0)
 
 dnl Checks for functions
-AC_CHECK_FUNCS(mmap strerror strtoul mbrtowc mkstemp getopt_long utimes utime wcwidth)
+AC_CHECK_FUNCS(mmap strerror strtoul mbrtowc mkstemp getopt_long utimes utime wcwidth snprintf vsnprintf)
 
 dnl Checks for libraries
 AC_CHECK_LIB(z,gzopen)
 
+dnl See if we are cross-compiling
+AM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes)
+
 AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile doc/Makefile python/Makefile])
 AC_OUTPUT

+ 213 - 100
doc/Makefile.in

@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.6.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
 # @configure_input@
 
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -13,101 +13,191 @@
 # PARTICULAR PURPOSE.
 
 @SET_MAKE@
-SHELL = @SHELL@
-
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
 VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 top_builddir = ..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_HEADER = $(INSTALL_DATA)
-transform = @program_transform_name@
+transform = $(program_transform_name)
 NORMAL_INSTALL = :
 PRE_INSTALL = :
 POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
-host_alias = @host_alias@
+build_triplet = @build@
 host_triplet = @host@
-
-EXEEXT = @EXEEXT@
-OBJEXT = @OBJEXT@
-PATH_SEPARATOR = @PATH_SEPARATOR@
+subdir = doc
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+man1dir = $(mandir)/man1
+am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" \
+	"$(DESTDIR)$(man4dir)" "$(DESTDIR)$(man5dir)"
+man3dir = $(mandir)/man3
+man4dir = $(mandir)/man4
+man5dir = $(mandir)/man5
+NROFF = nroff
+MANS = $(man_MANS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
-AS = @AS@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
 DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
 ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FSECT5_FALSE = @FSECT5_FALSE@
+FSECT5_TRUE = @FSECT5_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+IS_CROSS_COMPILE_FALSE = @IS_CROSS_COMPILE_FALSE@
+IS_CROSS_COMPILE_TRUE = @IS_CROSS_COMPILE_TRUE@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
 LN_S = @LN_S@
-OBJDUMP = @OBJDUMP@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
+am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
 fsect = @fsect@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
 install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
 MAGIC = $(pkgdatadir)/magic
-@FSECT5_TRUE@man_MAGIC = magic.5
 @FSECT5_FALSE@man_MAGIC = magic.4
+@FSECT5_TRUE@man_MAGIC = magic.5
 man_MANS = file.1 $(man_MAGIC) libmagic.3
-
 EXTRA_DIST = file.man magic.man libmagic.man
 CLEANFILES = $(man_MANS)
-subdir = doc
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-DIST_SOURCES =
-
-NROFF = nroff
-MANS = $(man_MANS)
-DIST_COMMON = Makefile.am Makefile.in
 all: all-am
 
 .SUFFIXES:
-$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  doc/Makefile'; \
 	cd $(top_srcdir) && \
 	  $(AUTOMAKE) --gnu  doc/Makefile
-Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
-	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -118,11 +208,9 @@ clean-libtool:
 distclean-libtool:
 	-rm -f libtool
 uninstall-info-am:
-
-man1dir = $(mandir)/man1
 install-man1: $(man1_MANS) $(man_MANS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(DESTDIR)$(man1dir)
+	test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
 	@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
 	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
 	for i in $$l2; do \
@@ -141,8 +229,8 @@ install-man1: $(man1_MANS) $(man_MANS)
 	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
 	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
 	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
-	  $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+	  echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+	  $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
 	done
 uninstall-man1:
 	@$(NORMAL_UNINSTALL)
@@ -155,17 +243,19 @@ uninstall-man1:
 	done; \
 	for i in $$list; do \
 	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  case "$$ext" in \
+	    1*) ;; \
+	    *) ext='1' ;; \
+	  esac; \
 	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
 	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
 	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
-	  rm -f $(DESTDIR)$(man1dir)/$$inst; \
+	  echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
+	  rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
 	done
-
-man3dir = $(mandir)/man3
 install-man3: $(man3_MANS) $(man_MANS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(DESTDIR)$(man3dir)
+	test -z "$(man3dir)" || $(mkdir_p) "$(DESTDIR)$(man3dir)"
 	@list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \
 	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
 	for i in $$l2; do \
@@ -184,8 +274,8 @@ install-man3: $(man3_MANS) $(man_MANS)
 	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
 	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
 	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man3dir)/$$inst"; \
-	  $(INSTALL_DATA) $$file $(DESTDIR)$(man3dir)/$$inst; \
+	  echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
+	  $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst"; \
 	done
 uninstall-man3:
 	@$(NORMAL_UNINSTALL)
@@ -198,17 +288,19 @@ uninstall-man3:
 	done; \
 	for i in $$list; do \
 	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  case "$$ext" in \
+	    3*) ;; \
+	    *) ext='3' ;; \
+	  esac; \
 	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
 	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
 	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " rm -f $(DESTDIR)$(man3dir)/$$inst"; \
-	  rm -f $(DESTDIR)$(man3dir)/$$inst; \
+	  echo " rm -f '$(DESTDIR)$(man3dir)/$$inst'"; \
+	  rm -f "$(DESTDIR)$(man3dir)/$$inst"; \
 	done
-
-man4dir = $(mandir)/man4
 install-man4: $(man4_MANS) $(man_MANS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(DESTDIR)$(man4dir)
+	test -z "$(man4dir)" || $(mkdir_p) "$(DESTDIR)$(man4dir)"
 	@list='$(man4_MANS) $(dist_man4_MANS) $(nodist_man4_MANS)'; \
 	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
 	for i in $$l2; do \
@@ -227,8 +319,8 @@ install-man4: $(man4_MANS) $(man_MANS)
 	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
 	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
 	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man4dir)/$$inst"; \
-	  $(INSTALL_DATA) $$file $(DESTDIR)$(man4dir)/$$inst; \
+	  echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man4dir)/$$inst'"; \
+	  $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man4dir)/$$inst"; \
 	done
 uninstall-man4:
 	@$(NORMAL_UNINSTALL)
@@ -241,17 +333,19 @@ uninstall-man4:
 	done; \
 	for i in $$list; do \
 	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  case "$$ext" in \
+	    4*) ;; \
+	    *) ext='4' ;; \
+	  esac; \
 	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
 	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
 	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " rm -f $(DESTDIR)$(man4dir)/$$inst"; \
-	  rm -f $(DESTDIR)$(man4dir)/$$inst; \
+	  echo " rm -f '$(DESTDIR)$(man4dir)/$$inst'"; \
+	  rm -f "$(DESTDIR)$(man4dir)/$$inst"; \
 	done
-
-man5dir = $(mandir)/man5
 install-man5: $(man5_MANS) $(man_MANS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(DESTDIR)$(man5dir)
+	test -z "$(man5dir)" || $(mkdir_p) "$(DESTDIR)$(man5dir)"
 	@list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \
 	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
 	for i in $$l2; do \
@@ -270,8 +364,8 @@ install-man5: $(man5_MANS) $(man_MANS)
 	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
 	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
 	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst"; \
-	  $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst; \
+	  echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \
+	  $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst"; \
 	done
 uninstall-man5:
 	@$(NORMAL_UNINSTALL)
@@ -284,27 +378,36 @@ uninstall-man5:
 	done; \
 	for i in $$list; do \
 	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  case "$$ext" in \
+	    5*) ;; \
+	    *) ext='5' ;; \
+	  esac; \
 	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
 	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
 	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " rm -f $(DESTDIR)$(man5dir)/$$inst"; \
-	  rm -f $(DESTDIR)$(man5dir)/$$inst; \
+	  echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \
+	  rm -f "$(DESTDIR)$(man5dir)/$$inst"; \
 	done
 tags: TAGS
 TAGS:
 
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ctags: CTAGS
+CTAGS:
 
-top_distdir = ..
-distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
 
 distdir: $(DISTFILES)
-	@list='$(DISTFILES)'; for file in $$list; do \
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
 	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
 	    dir="/$$dir"; \
-	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
 	  else \
 	    dir=''; \
 	  fi; \
@@ -322,10 +425,10 @@ distdir: $(DISTFILES)
 check-am: all-am
 check: check-am
 all-am: Makefile $(MANS)
-
 installdirs:
-	$(mkinstalldirs) $(DESTDIR)$(man1dir) $(DESTDIR)$(man3dir) $(DESTDIR)$(man4dir) $(DESTDIR)$(man5dir)
-
+	for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man4dir)" "$(DESTDIR)$(man5dir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
 install: install-am
 install-exec: install-exec-am
 install-data: install-data-am
@@ -337,7 +440,7 @@ install-am: all-am
 installcheck: installcheck-am
 install-strip:
 	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  INSTALL_STRIP_FLAG=-s \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
 	  `test -z '$(STRIP)' || \
 	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
@@ -346,7 +449,7 @@ clean-generic:
 	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean-generic:
-	-rm -f Makefile $(CONFIG_CLEAN_FILES)
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -356,13 +459,15 @@ clean: clean-am
 clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
-
+	-rm -f Makefile
 distclean-am: clean-am distclean-generic distclean-libtool
 
 dvi: dvi-am
 
 dvi-am:
 
+html: html-am
+
 info: info-am
 
 info-am:
@@ -378,13 +483,21 @@ install-man: install-man1 install-man3 install-man4 install-man5
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-
+	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
 
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
 uninstall-am: uninstall-info-am uninstall-man
 
 uninstall-man: uninstall-man1 uninstall-man3 uninstall-man4 \
@@ -392,15 +505,15 @@ uninstall-man: uninstall-man1 uninstall-man3 uninstall-man4 \
 
 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
 	distclean distclean-generic distclean-libtool distdir dvi \
-	dvi-am info info-am install install-am install-data \
-	install-data-am install-exec install-exec-am install-info \
-	install-info-am install-man install-man1 install-man3 \
-	install-man4 install-man5 install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-exec install-exec-am \
+	install-info install-info-am install-man install-man1 \
+	install-man3 install-man4 install-man5 install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool uninstall uninstall-am uninstall-info-am \
-	uninstall-man uninstall-man1 uninstall-man3 uninstall-man4 \
-	uninstall-man5
+	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+	uninstall-info-am uninstall-man uninstall-man1 uninstall-man3 \
+	uninstall-man4 uninstall-man5
 
 
 file.1:	Makefile file.man

+ 37 - 8
doc/file.man

@@ -1,12 +1,12 @@
 .TH FILE __CSECTION__ "Copyright but distributable"
-.\" $Id: file.man,v 1.54 2003/10/27 18:09:08 christos Exp $
+.\" $Id: file.man,v 1.57 2005/08/18 15:18:22 christos Exp $
 .SH NAME
 file
 \- determine file type
 .SH SYNOPSIS
 .B file
 [
-.B \-bcikLnNprsvz
+.B \-bchikLnNprsvz
 ]
 [
 .B \-f
@@ -103,7 +103,13 @@ magic file
 .I __MAGIC__.mgc ,
 or 
 .I __MAGIC__
-if the compile file does not exist.
+if the compile file does not exist. In addition
+.B file
+will look in
+.I $HOME/.magic.mgc ,
+or
+.I $HOME/.magic
+for magic entries.
 .PP
 If a file does not match any of the entries in the magic file,
 it is examined to see if it seems to be a text file.
@@ -180,6 +186,13 @@ to test the standard input, use ``\-'' as a filename argument.
 Use the specified string as the separator between the filename and the
 file result returned. Defaults to ``:''.
 .TP 8
+.B "\-h, \-\-no-dereference"
+option causes symlinks not to be followed
+(on systems that support symbolic links). This is the default if the
+environment variable
+.I POSIXLY_CORRECT
+is not defined.
+.TP 8
 .B "\-i, \-\-mime"
 Causes the file command to output mime type strings rather than the more
 traditional human readable ones. Thus it may say
@@ -197,8 +210,11 @@ Don't stop at the first match, keep going.
 .TP 8
 .B "\-L, \-\-dereference"
 option causes symlinks to be followed, as the like-named option in
-.BR ls (1).
+.BR ls (1)
 (on systems that support symbolic links).
+This is the default if the environment variable
+.I POSIXLY_CORRECT
+is defined.
 .TP 8
 .BI "\-m, \-\-magic\-file" " list"
 Specify an alternate list of files containing magic numbers.
@@ -273,16 +289,29 @@ the -i option is specified.
 .I __MAGIC__.mime
 Default list of magic numbers, used to output mime types when the -i option
 is specified.
-.TP
-.I /etc/magic
-Local additions to magic wisdom.
 
 .SH ENVIRONMENT
 The environment variable
 .B MAGIC
 can be used to set the default magic number file name.
+If that variable is set, then
+.B file
+will not attempt to open
+.B $HOME/.magic .
 .B file
 adds ".mime" and/or ".mgc" to the value of this variable as appropriate.
+The environment variable
+.B POSIXLY_CORRECT
+controls (on systems that support symbolic links), if
+.B file
+will attempt to follow symlinks or not. If set, then
+.B file
+follows symlink, otherwise it does not. This is also controlled
+by the
+.B L
+and
+.B h
+options.
 .SH SEE ALSO
 .BR magic (__FSECTION__)
 \- description of magic file format.
@@ -410,7 +439,7 @@ to identify character codes and attempt to identify the languages
 of non-ASCII files.
 .PP
 The list of contributors to the "Magdir" directory (source for the
-/etc/magic
+.I __MAGIC__
 file) is too long to include here.
 You know who you are; thank you.
 .SH LEGAL NOTICE

+ 165 - 35
doc/magic.man

@@ -77,6 +77,32 @@ interpreted as a UNIX date.
 A four-byte value (on most systems) in little-endian byte order,
 interpreted as a UNIX-style date, but interpreted as local time rather
 than UTC.
+.IP regex
+A regular expression match in extended POSIX regular expression syntax
+(much like egrep).
+The type specification can be optionally followed by
+.B /c
+for case-insensitive matches.
+The regular expression is always
+tested against the first
+.B N
+lines, where
+.B N
+is the given offset, thus it
+is only useful for (single-byte encoded) text.
+.B ^
+and
+.B $
+will match the beginning and end of individual lines, respectively,
+not beginning and end of file.
+.IP search
+A literal string search starting at the given offset. It must be followed by
+.B /<number>
+which specifies how many matches shall be attempted (the range).
+This is suitable for searching larger binary expressions with variable
+offsets, using
+.B \e
+escapes for special characters.
 .RE
 .PP
 The numeric types may optionally be followed by
@@ -106,15 +132,24 @@ value,
 to specify that the value from the file must be greater than the specified
 value,
 .BR & ,
-to specify that the value from the file must have set all of the bits 
+to specify that the value from the file must have set all of the bits
 that are set in the specified value,
 .BR ^ ,
-to specify that the value from the file must have clear any of the bits 
+to specify that the value from the file must have clear any of the bits
 that are set in the specified value, or
 .BR x ,
 to specify that any value will match.
 If the character is omitted, it is assumed to be
 .BR = .
+For all tests except
+.B string
+and
+.B regex,
+operation
+.BR !
+specifies that the line matches if the test does
+.B not
+succeed.
 .IP
 Numeric values are specified in C form; e.g.
 .B 13
@@ -125,7 +160,7 @@ is octal, and
 is hexadecimal.
 .IP
 For string values, the byte string from the
-file must match the specified byte string. 
+file must match the specified byte string.
 The operators
 .BR = ,
 .B <
@@ -148,28 +183,36 @@ format specification, the value from the file (with any specified masking
 performed) is printed using the message as the format string.
 .PP
 Some file formats contain additional information which is to be printed
-along with the file type.
-A line which begins with the character
+along with the file type or need additional tests to determine the true
+file type.
+These additional tests are introduced by one or more
 .B >
-indicates additional tests and messages to be printed.
+characters preceding the offset.
 The number of
 .B >
 on the line indicates the level of the test; a line with no
 .B >
 at the beginning is considered to be at level 0.
-Each line at level
-.IB n \(pl1
-is under the control of the line at level
+Tests are arranged in a tree-like hierarchy:
+If a the test on a line at level
 .IB n
-most closely preceding it in the magic file.
-If the test on a line at level
-.I n
-succeeds, the tests specified in all the subsequent lines at level
-.IB n \(pl1
-are performed, and the messages printed if the tests succeed.
-The next line at level
-.I n
-terminates this.
+succeeds, all following tests at level
+.IB n+1
+are performed, and the messages printed if the tests succeed, untile a line
+with level
+.IB n
+(or less) appears.
+For more complex files, one can use empty messages to get just the
+"if/then" effect, in the following way:
+.sp
+.nf
+    0      string   MZ
+    >0x18  leshort  <0x40   MS-DOS executable
+    >0x18  leshort  >0x3f   extended PC executable (e.g., MS Windows)
+.fi
+.PP
+Offsets do not need to be constant, but can also be read from the file
+being examined.
 If the first character following the last
 .B >
 is a
@@ -181,11 +224,11 @@ The value at that offset is read, and is used again as an offset
 in the file.
 Indirect offsets are of the form:
 .BI (( x [.[bslBSL]][+\-][ y ]).
-The value of 
+The value of
 .I x
 is used as an offset in the file. A byte, short or long is read at that offset
-depending on the 
-.B [bslBSL] 
+depending on the
+.B [bslBSL]
 type specifier.
 The capitalized types interpret the number as a big endian
 value, whereas the small letter versions interpret the number as a little
@@ -195,18 +238,105 @@ To that number the value of
 is added and the result is used as an offset in the file.
 The default type if one is not specified is long.
 .PP
-Sometimes you do not know the exact offset as this depends on the length of
-preceding fields.
-You can specify an offset relative to the end of the
-last uplevel field (of course this may only be done for sublevel tests, i.e.
-test beginning with 
-.B >
-).
-Such a relative offset is specified using
-.B &
-as a prefix to the offset.
+That way variable length structures can be examined:
+.sp
+.nf
+    # MS Windows executables are also valid MS-DOS executables
+    0           string  MZ
+    >0x18       leshort <0x40   MZ executable (MS-DOS)
+    # skip the whole block below if it is not an extended executable
+    >0x18       leshort >0x3f
+    >>(0x3c.l)  string  PE\e0\e0  PE executable (MS-Windows)
+    >>(0x3c.l)  string  LX\e0\e0  LX executable (OS/2)
+.fi
+.PP
+This strategy of examining has one drawback: You must make sure that
+you eventually print something, or users may get empty output (like, when
+there is neither PE\e0\e0 nor LE\e0\e0 in the above example)
+.PP
+If this indirect offset cannot be used as-is, there are simple calculations
+possible: appending
+.BI [+-*/%&|^]<number>
+inside parentheses allows one to modify
+the value read from the file before it is used as an offset:
+.sp
+.nf
+    # MS Windows executables are also valid MS-DOS executables
+    0           string  MZ
+    # sometimes, the value at 0x18 is less that 0x40 but there's still an
+    # extended executable, simply appended to the file
+    >0x18       leshort <0x40
+    >>(4.s*512) leshort 0x014c  COFF executable (MS-DOS, DJGPP)
+    >>(4.s*512) leshort !0x014c MZ executable (MS-DOS)
+.fi
+.PP
+Sometimes you do not know the exact offset as this depends on the length or
+position (when indirection was used before) of preceding fields. You can
+specify an offset relative to the end of the last uplevel field using
+.BI &
+as a prefix to the offset:
+.sp
+.nf
+    0           string  MZ
+    >0x18       leshort >0x3f
+    >>(0x3c.l)  string  PE\e0\e0    PE executable (MS-Windows)
+    # immediately following the PE signature is the CPU type
+    >>>&0       leshort 0x14c     for Intel 80386
+    >>>&0       leshort 0x184     for DEC Alpha
+.fi
+.PP
+Indirect and relative offsets can be combined:
+.sp
+.nf
+    0             string  MZ
+    >0x18         leshort <0x40
+    >>(4.s*512)   leshort !0x014c MZ executable (MS-DOS)
+    # if it's not COFF, go back 512 bytes and add the offset taken
+    # from byte 2/3, which is yet another way of finding the start
+    # of the extended executable
+    >>>&(2.s-514) string  LE      LE executable (MS Windows VxD driver)
+.fi
+.PP
+Or the other way around:
+.sp
+.nf
+    0                 string  MZ
+    >0x18             leshort >0x3f
+    >>(0x3c.l)        string  LE\e0\e0  LE executable (MS-Windows)
+    # at offset 0x80 (-4, since relative offsets start at the end
+    # of the uplevel match) inside the LE header, we find the absolute
+    # offset to the code area, where we look for a specific signature
+    >>>(&0x7c.l+0x26) string  UPX     \eb, UPX compressed
+.fi
+.PP
+Or even both!
+.sp
+.nf
+    0                string  MZ
+    >0x18            leshort >0x3f
+    >>(0x3c.l)       string  LE\e0\e0 LE executable (MS-Windows)
+    # at offset 0x58 inside the LE header, we find the relative offset
+    # to a data area where we look for a specific signature
+    >>>&(&0x54.l-3)  string  UNACE  \eb, ACE self-extracting archive
+.fi
+.PP
+Finally, if you have to deal with offset/length pairs in your file, even the
+second value in a parenthesed expression can be taken from the file itself,
+using another set of parentheses. Note that this additional indirect offset
+is always relative to the start of the main indirect offset.
+.sp
+.nf
+    0                 string       MZ
+    >0x18             leshort      >0x3f
+    >>(0x3c.l)        string       PE\e0\e0 PE executable (MS-Windows)
+    # search for the PE section called ".idata"...
+    >>>&0xf4          search/0x140 .idata
+    # ...and go to the end of it, calculated from start+length;
+    # these are located 14 and 10 bytes after the section name
+    >>>>(&0xe.l+(-4)) string       PK\e3\e4 \eb, ZIP self-extracting archive
+.fi
 .SH BUGS
-The formats 
+The formats
 .IR long ,
 .IR belong ,
 .IR lelong ,
@@ -218,7 +348,7 @@ The formats
 and
 .I ledate
 are system-dependent; perhaps they should be specified as a number
-of bytes (2B, 4B, etc), 
+of bytes (2B, 4B, etc),
 since the files being recognized typically come from
 a system on which the lengths are invariant.
 .PP
@@ -235,9 +365,9 @@ indirect offsets.
 .\" Date: 3 Sep 85 08:19:07 GMT
 .\" Organization: Sun Microsystems, Inc.
 .\" Lines: 136
-.\" 
+.\"
 .\" Here's a manual page for the format accepted by the "file" made by adding
 .\" the changes I posted to the S5R2 version.
 .\"
 .\" Modified for Ian Darwin's version of the file command.
-.\" @(#)$Id: magic.man,v 1.27 2003/09/12 19:43:30 christos Exp $
+.\" @(#)$Id: magic.man,v 1.28 2005/03/17 17:34:15 christos Exp $

File diff suppressed because it is too large
+ 2385 - 887
ltmain.sh


+ 33 - 21
magic/Magdir/adventure

@@ -12,27 +12,38 @@
 0	beshort	0x0206	ALAN game 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 version 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)
+
+# Infocom (see z-machine)
+#------------------------------------------------------------------------------
+# Z-machine:  file(1) magic for Z-machine binaries.
+#
+# This will match ${TEX_BASE}/texmf/omega/ocp/char2uni/inbig5.ocp which
+# appears to be a version-0 Z-machine binary.
+#
+# The (false match) message is to correct that behavior.  Perhaps it is
+# not needed.
+#
+16	belong&0xfe00f0f0	0x3030	Infocom game data
+>0	ubyte			0	(false match)
+>0	ubyte			>0	(Z-machine %d,
+>>2	ubeshort		x	Release %d /
+>>18	string			>\0	Serial %.6s)
+
+#------------------------------------------------------------------------------
+# Glulx:  file(1) magic for Glulx binaries.
+#
+# I haven't checked for false matches yet.
+#
+0	string			Glul	Glulx game data
+>4	beshort			x	(Version %d
+>>6	byte			x	\b.%d
+>>8	byte			x	\b.%d)
+>36	string			Info	Compiled by Inform
+
+
+
+# For Quetzal and blorb magic see iff
+
 
 # TADS (Text Adventure Development System)
 #  All files are machine-independent (games compile to byte-code) and are tagged
@@ -61,3 +72,4 @@
 >10	belong	!0x0A0D1A00	saved game data, CORRUPTED
 >10	belong	 0x0A0D1A00
 >>14	string	>\0		%s saved game data
+

+ 4 - 0
magic/Magdir/amigaos

@@ -54,3 +54,7 @@
 0	string		DOS\4		Amiga Fastdir DOS disk
 0	string		DOS\5		Amiga Fastdir FFS disk
 0	string		KICK		Kickstart disk
+
+# From: Alex Beregszaszi <alex@fsn.hu>
+0	string		LZX		LZX compressed archive (Amiga)
+

+ 131 - 111
magic/Magdir/animation

@@ -6,13 +6,58 @@
 # MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8)
 # FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com)
 
+# SGI and Apple formats
+0	string		MOVI		Silicon Graphics movie file
+4       string          moov            Apple QuickTime
+>12     string          mvhd            \b movie (fast start)
+>12     string          mdra            \b URL
+>12     string          cmov            \b movie (fast start, compressed header)
+>12     string          rmra            \b multiple URLs
+4       string          mdat            Apple QuickTime movie (unoptimized)
+4       string          wide            Apple QuickTime movie (unoptimized)
+4       string          skip            Apple QuickTime movie (modified)
+4       string          free            Apple QuickTime movie (modified)
+4       string          idsc            Apple QuickTime image (fast start)
+4       string          idat            Apple QuickTime image (unoptimized)
+4       string          pckg            Apple QuickTime compressed archive
+4	string/B	jP		JPEG 2000 image
+4	string		ftyp		ISO Media
+>8	string		isom		\b, MPEG v4 system, version 1
+>8	string		iso2		\b, MPEG v4 system, part 12 revision
+>8	string		mp41		\b, MPEG v4 system, version 1
+>8	string		mp42		\b, MPEG v4 system, version 2
+>8	string		mp7t		\b, MPEG v4 system, MPEG v7 XML
+>8	string		mp7b		\b, MPEG v4 system, MPEG v7 binary XML
+>8	string/B	jp2		\b, JPEG 2000
+>8	string		3gp		\b, MPEG v4 system, 3GPP
+>>11	byte		4		\b v4 (H.263/AMR GSM 6.10)
+>>11	byte		5		\b v5 (H.263/AMR GSM 6.10)
+>>11	byte		6		\b v6 (ITU H.264/AMR GSM 6.10)
+>8	string		mmp4		\b, MPEG v4 system, 3GPP Mobile
+>8	string		avc1		\b, MPEG v4 system, 3GPP JVT AVC
+>8	string/B	M4A		\b, MPEG v4 system, iTunes AAC-LC
+>8	string/B	M4P		\b, MPEG v4 system, iTunes AES encrypted
+>8	string/B	M4B		\b, MPEG v4 system, iTunes bookmarked
+>8	string/B	qt		\b, Apple QuickTime movie
+
 # MPEG sequences
 # Scans for all common MPEG header start codes
+0        belong             0x00000001     JVT NAL sequence
+>4       byte&0x1F          0x07           \b, H.264 video
+>>5      byte               66             \b, baseline
+>>5      byte               77             \b, main
+>>5      byte               88             \b, extended
+>>7      byte               x              \b @ L %u
 0        belong&0xFFFFFF00  0x00000100     MPEG sequence
 >3       byte               0xBA
 >>4      byte               &0x40          \b, v2, program multiplex
 >>4      byte               ^0x40          \b, v1, system multiplex
 >3       byte               0xBB           \b, v1/2, multiplex (missing pack header)
+>3       byte&0x1F          0x07           \b, H.264 video
+>>4      byte               66             \b, baseline
+>>4      byte               77             \b, main
+>>4      byte               88             \b, extended
+>>6      byte               x              \b @ L %u
 >3       byte               0xB0           \b, v4
 >>5      belong             0x000001B5
 >>>9     byte               &0x80
@@ -20,11 +65,10 @@
 >>>>10   byte&0xF0          32             \b, still texture
 >>>>10   byte&0xF0          48             \b, mesh
 >>>>10   byte&0xF0          64             \b, face
->>>9     byte               ^0x80
->>>>9    byte&0xF8          8              \b, video
->>>>9    byte&0xF8          16             \b, still texture
->>>>9    byte&0xF8          24             \b, mesh
->>>>9    byte&0xF8          32             \b, face
+>>>9     byte&0xF8          8              \b, video
+>>>9     byte&0xF8          16             \b, still texture
+>>>9     byte&0xF8          24             \b, mesh
+>>>9     byte&0xF8          32             \b, face
 >>4      byte               1              \b, simple @ L1
 >>4      byte               2              \b, simple @ L2
 >>4      byte               3              \b, simple @ L3
@@ -89,11 +133,10 @@
 >>>5     byte&0xF0          32             \b, still texture (missing profile header)
 >>>5     byte&0xF0          48             \b, mesh (missing profile header)
 >>>5     byte&0xF0          64             \b, face (missing profile header)
->>4      byte               ^0x80
->>>4     byte&0xF8          8              \b, video (missing profile header)
->>>4     byte&0xF8          16             \b, still texture (missing profile header)
->>>4     byte&0xF8          24             \b, mesh (missing profile header)
->>>4     byte&0xF8          32             \b, face (missing profile header)
+>>4      byte&0xF8          8              \b, video (missing profile header)
+>>4      byte&0xF8          16             \b, still texture (missing profile header)
+>>4      byte&0xF8          24             \b, mesh (missing profile header)
+>>4      byte&0xF8          32             \b, face (missing profile header)
 >3       byte               0xB3
 >>12     belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
 >>12     belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
@@ -131,23 +174,23 @@
 >>>>>145 byte&0x06          2              \b Y'CbCr 4:2:0 video
 >>>>>145 byte&0x06          4              \b Y'CbCr 4:2:2 video
 >>>>>145 byte&0x06          6              \b Y'CbCr 4:4:4 video
->>>76    belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
->>>76    belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
->>>76    belong             0x000001B5     \b, v2,
->>>80    byte&0x0F          1              \b HP
->>>80    byte&0x0F          2              \b Spt
->>>80    byte&0x0F          3              \b SNR
->>>80    byte&0x0F          4              \b MP
->>>80    byte&0x0F          5              \b SP
->>>81    byte&0xF0          64             \b@HL
->>>81    byte&0xF0          96             \b@H-14
->>>81    byte&0xF0          128            \b@ML
->>>81    byte&0xF0          160            \b@LL
->>>81    byte               &0x08          \b progressive
->>>81    byte               ^0x08          \b interlaced
->>>81    byte&0x06          2              \b Y'CbCr 4:2:0 video
->>>81    byte&0x06          4              \b Y'CbCr 4:2:2 video
->>>81    byte&0x06          6              \b Y'CbCr 4:4:4 video
+>>76    belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
+>>76    belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
+>>76    belong             0x000001B5     \b, v2,
+>>>80   byte&0x0F          1              \b HP
+>>>80   byte&0x0F          2              \b Spt
+>>>80   byte&0x0F          3              \b SNR
+>>>80   byte&0x0F          4              \b MP
+>>>80   byte&0x0F          5              \b SP
+>>>81   byte&0xF0          64             \b@HL
+>>>81   byte&0xF0          96             \b@H-14
+>>>81   byte&0xF0          128            \b@ML
+>>>81   byte&0xF0          160            \b@LL
+>>>81   byte               &0x08          \b progressive
+>>>81   byte               ^0x08          \b interlaced
+>>>81   byte&0x06          2              \b Y'CbCr 4:2:0 video
+>>>81   byte&0x06          4              \b Y'CbCr 4:2:2 video
+>>>81   byte&0x06          6              \b Y'CbCr 4:4:4 video
 >>4      belong&0xFFFFFF00  0x78043800     \b, HD-TV 1920P
 >>>7     byte&0xF0          0x10           \b, 16:9
 >>4      belong&0xFFFFFF00  0x50002D00     \b, SD-TV 1280I
@@ -234,13 +277,13 @@
 >3      byte&0xC0       0x40           \b, JntStereo
 >3      byte&0xC0       0x80           \b, 2x Monaural
 >3      byte&0xC0       0xC0           \b, Monaural
-#>1     byte            ^0x01           \b, Data Verify
-#>2     byte            &0x02           \b, Packet Pad
-#>2     byte            &0x01           \b, Custom Flag
-#>3     byte            &0x08           \b, Copyrighted
-#>3     byte            &0x04           \b, Original Source
-#>3     byte&0x03       1               \b, NR: 50/15 ms
-#>3     byte&0x03       3               \b, NR: CCIT J.17
+#>1     byte            ^0x01          \b, Data Verify
+#>2     byte            &0x02          \b, Packet Pad
+#>2     byte            &0x01          \b, Custom Flag
+#>3     byte            &0x08          \b, Copyrighted
+#>3     byte            &0x04          \b, Original Source
+#>3     byte&0x03       1              \b, NR: 50/15 ms
+#>3     byte&0x03       3              \b, NR: CCIT J.17
 
 # MP2, M1A
 0       beshort&0xFFFE  0xFFFC         MPEG ADTS, layer II, v1
@@ -268,13 +311,13 @@
 >3      byte&0xC0       0x40           \b, JntStereo
 >3      byte&0xC0       0x80           \b, 2x Monaural
 >3      byte&0xC0       0xC0           \b, Monaural
-#>1     byte            ^0x01           \b, Data Verify
-#>2     byte            &0x02           \b, Packet Pad
-#>2     byte            &0x01           \b, Custom Flag
-#>3     byte            &0x08           \b, Copyrighted
-#>3     byte            &0x04           \b, Original Source
-#>3     byte&0x03       1               \b, NR: 50/15 ms
-#>3     byte&0x03       3               \b, NR: CCIT J.17
+#>1     byte            ^0x01          \b, Data Verify
+#>2     byte            &0x02          \b, Packet Pad
+#>2     byte            &0x01          \b, Custom Flag
+#>3     byte            &0x08          \b, Copyrighted
+#>3     byte            &0x04          \b, Original Source
+#>3     byte&0x03       1              \b, NR: 50/15 ms
+#>3     byte&0x03       3              \b, NR: CCIT J.17
 
 # MPA, M1A
 0       beshort&0xFFFE  0xFFFE         MPEG ADTS, layer I, v1
@@ -302,13 +345,13 @@
 >3      byte&0xC0       0x40           \b, JntStereo
 >3      byte&0xC0       0x80           \b, 2x Monaural
 >3      byte&0xC0       0xC0           \b, Monaural
-#>1     byte            ^0x01           \b, Data Verify
-#>2     byte            &0x02           \b, Packet Pad
-#>2     byte            &0x01           \b, Custom Flag
-#>3     byte            &0x08           \b, Copyrighted
-#>3     byte            &0x04           \b, Original Source
-#>3     byte&0x03       1               \b, NR: 50/15 ms
-#>3     byte&0x03       3               \b, NR: CCIT J.17
+#>1     byte            ^0x01          \b, Data Verify
+#>2     byte            &0x02          \b, Packet Pad
+#>2     byte            &0x01          \b, Custom Flag
+#>3     byte            &0x08          \b, Copyrighted
+#>3     byte            &0x04          \b, Original Source
+#>3     byte&0x03       1              \b, NR: 50/15 ms
+#>3     byte&0x03       3              \b, NR: CCIT J.17
 
 # MP3, M2A
 0       beshort&0xFFFE  0xFFF2         MPEG ADTS, layer III, v2
@@ -336,13 +379,13 @@
 >3      byte&0xC0       0x40           \b, JntStereo
 >3      byte&0xC0       0x80           \b, 2x Monaural
 >3      byte&0xC0       0xC0           \b, Monaural
-#>1     byte            ^0x01           \b, Data Verify
-#>2     byte            &0x02           \b, Packet Pad
-#>2     byte            &0x01           \b, Custom Flag
-#>3     byte            &0x08           \b, Copyrighted
-#>3     byte            &0x04           \b, Original Source
-#>3     byte&0x03       1               \b, NR: 50/15 ms
-#>3     byte&0x03       3               \b, NR: CCIT J.17
+#>1     byte            ^0x01          \b, Data Verify
+#>2     byte            &0x02          \b, Packet Pad
+#>2     byte            &0x01          \b, Custom Flag
+#>3     byte            &0x08          \b, Copyrighted
+#>3     byte            &0x04          \b, Original Source
+#>3     byte&0x03       1              \b, NR: 50/15 ms
+#>3     byte&0x03       3              \b, NR: CCIT J.17
 
 # MP2, M2A
 0       beshort&0xFFFE  0xFFF4         MPEG ADTS, layer II, v2
@@ -370,13 +413,13 @@
 >3      byte&0xC0       0x40           \b, JntStereo
 >3      byte&0xC0       0x80           \b, 2x Monaural
 >3      byte&0xC0       0xC0           \b, Monaural
-#>1     byte            ^0x01           \b, Data Verify
-#>2     byte            &0x02           \b, Packet Pad
-#>2     byte            &0x01           \b, Custom Flag
-#>3     byte            &0x08           \b, Copyrighted
-#>3     byte            &0x04           \b, Original Source
-#>3     byte&0x03       1               \b, NR: 50/15 ms
-#>3     byte&0x03       3               \b, NR: CCIT J.17
+#>1     byte            ^0x01          \b, Data Verify
+#>2     byte            &0x02          \b, Packet Pad
+#>2     byte            &0x01          \b, Custom Flag
+#>3     byte            &0x08          \b, Copyrighted
+#>3     byte            &0x04          \b, Original Source
+#>3     byte&0x03       1              \b, NR: 50/15 ms
+#>3     byte&0x03       3              \b, NR: CCIT J.17
 
 # MPA, M2A
 0       beshort&0xFFFE  0xFFF6         MPEG ADTS, layer I, v2
@@ -404,13 +447,13 @@
 >3      byte&0xC0       0x40           \b, JntStereo
 >3      byte&0xC0       0x80           \b, 2x Monaural
 >3      byte&0xC0       0xC0           \b, Monaural
-#>1     byte            ^0x01           \b, Data Verify
-#>2     byte            &0x02           \b, Packet Pad
-#>2     byte            &0x01           \b, Custom Flag
-#>3     byte            &0x08           \b, Copyrighted
-#>3     byte            &0x04           \b, Original Source
-#>3     byte&0x03       1               \b, NR: 50/15 ms
-#>3     byte&0x03       3               \b, NR: CCIT J.17
+#>1     byte            ^0x01          \b, Data Verify
+#>2     byte            &0x02          \b, Packet Pad
+#>2     byte            &0x01          \b, Custom Flag
+#>3     byte            &0x08          \b, Copyrighted
+#>3     byte            &0x04          \b, Original Source
+#>3     byte&0x03       1              \b, NR: 50/15 ms
+#>3     byte&0x03       3              \b, NR: CCIT J.17
 
 # MP3, M25A
 0       beshort&0xFFFE  0xFFE2         MPEG ADTS, layer III,  v2.5
@@ -438,13 +481,13 @@
 >3      byte&0xC0       0x40           \b, JntStereo
 >3      byte&0xC0       0x80           \b, 2x Monaural
 >3      byte&0xC0       0xC0           \b, Monaural
-#>1     byte            ^0x01           \b, Data Verify
-#>2     byte            &0x02           \b, Packet Pad
-#>2     byte            &0x01           \b, Custom Flag
-#>3     byte            &0x08           \b, Copyrighted
-#>3     byte            &0x04           \b, Original Source
-#>3     byte&0x03       1               \b, NR: 50/15 ms
-#>3     byte&0x03       3               \b, NR: CCIT J.17
+#>1     byte            ^0x01          \b, Data Verify
+#>2     byte            &0x02          \b, Packet Pad
+#>2     byte            &0x01          \b, Custom Flag
+#>3     byte            &0x08          \b, Copyrighted
+#>3     byte            &0x04          \b, Original Source
+#>3     byte&0x03       1              \b, NR: 50/15 ms
+#>3     byte&0x03       3              \b, NR: CCIT J.17
 
 # AAC (aka MPEG-2 NBC audio) and MPEG-4 audio
 
@@ -474,13 +517,13 @@
 
 # Live or stored single AAC stream (used with MPEG-2 systems)
 0       beshort&0xFFF6  0xFFF0         MPEG ADTS, AAC
->1      byte            ^0x08          \b, v2
->1      byte            &0x08          \b, v4
+>1      byte            &0x08          \b, v2
+>1      byte            ^0x08          \b, v4
 # profile
 >>2     byte            &0xC0          \b LTP
->2      byte&0xc0       0x00           \b, Main
->2      byte&0xc0       0x40           \b, LC
->2      byte&0xc0       0x80           \b, SSR
+>2      byte&0xc0       0x00           \b Main
+>2      byte&0xc0       0x40           \b LC
+>2      byte&0xc0       0x80           \b SSR
 # timing
 >2      byte&0x3c       0x00           \b, 96 kHz
 >2      byte&0x3c       0x04           \b, 88.2 kHz
@@ -494,7 +537,7 @@
 >2      byte&0x3c       0x24           \b, 12 kHz
 >2      byte&0x3c       0x28           \b, 11.025 kHz
 >2      byte&0x3c       0x2c           \b, 8 kHz
-# channels/options
+# channels
 >2      beshort&0x01c0  0x0040         \b, monaural
 >2      beshort&0x01c0  0x0080         \b, stereo
 >2      beshort&0x01c0  0x00c0         \b, stereo + center
@@ -564,35 +607,6 @@
 # \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 formats
-0	string		MOVI		Silicon Graphics movie file
-
-# Apple Quicktime and ISO types
-4       string          moov            Apple QuickTime
->12     string          mvhd            \b movie (fast start)
->12     string          mdra            \b URL
->12     string          cmov            \b movie (fast start, compressed header)
->12     string          rmra            \b multiple URLs
-4       string          mdat            Apple QuickTime movie (unoptimized)
-4       string          wide            Apple QuickTime movie (unoptimized)
-4       string          skip            Apple QuickTime movie (modified)
-4       string          free            Apple QuickTime movie (modified)
-4       string          idsc            Apple QuickTime image (fast start)
-4       string          idat            Apple QuickTime image (unoptimized)
-4       string          pckg            Apple QuickTime compressed archive
-4       string/B        jP              JPEG 2000 image
-4       string          ftyp            ISO Media
->8      string          isom            \b, MPEG v4 system
->8      string          mp41            \b, MPEG v4 system, version 1
->8      string          mp42            \b, MPEG v4 system, version 2
->8      string/B        jp2             \b, JPEG 2000 image
->8      string          3gp             \b, MPEG v4 system, 3GPP (H.263/AMR)
->8      string          mmp4            \b, MPEG v4 system, Mobile
->8      string/B        M4A             \b, MPEG v4 system, iTunes AAC-LC
->8      string/B        M4P             \b, MPEG v4 system, ISMA encrypted AAC-LC
->8      string/B        M4B             \b, MPEG v4 system, iTunes AAC-LC/AMR
->8      string/B        qt              \b, Apple QuickTime movie
-
 # iso 13818 transport stream
 #
 # from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001 (ISO 13818.1)
@@ -654,3 +668,9 @@
 >0x26	ubeshort	x		%dµs,
 >0x42	ubeshort	0		no audio
 >0x42	ubeshort	>0		%dHz audio
+
+# From: "Stefan A. Haubenthal" <polluks@web.de>
+0	string		DVDVIDEO-VTS	Video title set,
+>0x21	byte		x		v%x
+0	string		DVDVIDEO-VMG	Video manager,
+>0x21	byte		x		v%x

+ 3 - 0
magic/Magdir/apple

@@ -148,3 +148,6 @@
 # information seems to be more useful.
 #0	long	0x45520200
 #>0x410	string	disk\ image	UDIF read/write image (UDRW)
+
+# From: Toby Peterson <toby@apple.com>
+0	string	bplist00	Apple binary property list

+ 324 - 10
magic/Magdir/archive

@@ -29,7 +29,7 @@
 
 # Debian package (needs to go before regular portable archives)
 #
-0	string		!<arch>\ndebian
+0	string		=!<arch>\ndebian
 >8	string		debian-split	part of multipart Debian package
 >8	string		debian-binary	Debian binary package
 >68	string		>\0		(format %s)
@@ -47,7 +47,7 @@
 
 # MIPS archive (needs to go before regular portable archives)
 #
-0	string	!<arch>\n__________E	MIPS archive
+0	string	=!<arch>\n__________E	MIPS archive
 >20	string	U			with MIPS Ucode members
 >21	string	L			with MIPSEL members
 >21	string	B			with MIPSEB members
@@ -61,7 +61,7 @@
 # XXX - why are there multiple <ar> thingies?  Note that 0x213c6172 is
 # "!<ar", so, for new-style (4.xBSD/SVR2andup) archives, we have:
 #
-# 0	string		!<arch>		current ar archive
+# 0	string		=!<arch>		current ar archive
 # 0	long		0x213c6172	archive file
 #
 # and for SVR1 archives, we have:
@@ -73,7 +73,7 @@
 # and absolute code program modules in the same format as new-style
 # "ar" archives?
 #
-0	string		!<arch>		current ar archive
+0	string		=!<arch>		current ar archive
 >8	string		__.SYMDEF	random library
 >0	belong		=65538		- pre SR9.5
 >0	belong		=65539		- post SR9.5
@@ -121,6 +121,10 @@
 0	lelong&0x8080ffff	0x0000031a	ARC archive data, packed
 0	lelong&0x8080ffff	0x0000041a	ARC archive data, squeezed
 0	lelong&0x8080ffff	0x0000061a	ARC archive data, crunched
+# [JW] stuff taken from idarc, obviously ARC successors:
+0	lelong&0x8080ffff	0x00000a1a	PAK archive data
+0	lelong&0x8080ffff	0x0000141a	ARC+ archive data
+0	lelong&0x8080ffff	0x0000481a	HYP archive data
 
 # Acorn archive formats (Disaster prone simpleton, m91dps@ecs.ox.ac.uk)
 # I can't create either SPARK or ArcFS archives so I have not tested this stuff
@@ -132,6 +136,292 @@
 0       string          \032            RISC OS archive (spark format)
 0       string          Archive\000     RISC OS archive (ArcFS format)
 
+# All these were taken from idarc, many could not be verified. Unfortunately,
+# there were many low-quality sigs, i.e. easy to trigger false positives.
+# Please notify me of any real-world fishy/ambiguous signatures and I'll try
+# to get my hands on the actual archiver and see if I find something better. [JW]
+# probably many can be enhanced by finding some 0-byte or control char near the start
+
+# idarc calls this Crush/Uncompressed... *shrug*
+0	string	CRUSH Crush archive data
+# Squeeze It (.sqz)
+0	string	HLSQZ Squeeze It archive data
+# SQWEZ
+0	string	SQWEZ SQWEZ archive data
+# HPack (.hpk)
+0	string	HPAK HPack archive data
+# HAP
+0	string	\x91\x33HF HAP archive data
+# MD/MDCD
+0	string	MDmd MDCD archive data
+# LIM
+0	string	LIM\x1a LIM archive data
+# SAR
+3	string	LH5 SAR archive data
+# BSArc/BS2
+0	string	\212\3SB \0 BSArc/BS2 archive data
+# MAR
+2	string	=-ah MAR archive data
+# ACB
+0	belong&0x00f800ff	0x00800000 ACB archive data
+# CPZ
+# TODO, this is what idarc says: 0	string	\0\0\0 CPZ archive data
+# JRC
+0	string	JRchive JRC archive data
+# Quantum
+0	string	DS\0 Quantum archive data
+# ReSOF
+0	string	PK\3\6 ReSOF archive data
+# QuArk
+0	string	7\4 QuArk archive data
+# YAC
+14	string	YC YAC archive data
+# X1
+0	string	X1 X1 archive data
+0	string	XhDr X1 archive data
+# CDC Codec (.dqt)
+0	belong&0xffffe000	0x76ff2000 CDC Codec archive data
+# AMGC
+0	string	\xad6" AMGC archive data
+# NuLIB
+0	string	NõFélå NuLIB archive data
+# PakLeo
+0	string	LEOLZW PAKLeo archive data
+# ChArc
+0	string	SChF ChArc archive data
+# PSA
+0	string	PSA PSA archive data
+# CrossePAC
+0	string	DSIGDCC CrossePAC archive data
+# Freeze
+0	string	\x1f\x9f\x4a\x10\x0a Freeze archive data
+# KBoom
+0	string	¨MP¨ KBoom archive data
+# NSQ, must go after CDC Codec
+0	string	\x76\xff NSQ archive data
+# DPA
+0	string	Dirk\ Paehl DPA archive data
+# BA
+# TODO: idarc says "bytes 0-2 == bytes 3-5"
+# TTComp
+0	string	\0\6 TTComp archive data
+# ESP, could this conflict with Easy Software Products' (e.g.ESP ghostscript) documentation?
+0	string	ESP ESP archive data
+# ZPack
+0	string	\1ZPK\1 ZPack archive data
+# Sky
+0	string	\xbc\x40 Sky archive data
+# UFA
+0	string	UFA UFA archive data
+# Dry
+0	string	=-H2O DRY archive data
+# FoxSQZ
+0	string	FOXSQZ FoxSQZ archive data
+# AR7
+0	string	,AR7 AR7 archive data
+# PPMZ
+0	string	PPMZ PPMZ archive data
+# MS Compress
+4	string	\x88\xf0\x27 MS Compress archive data
+# MP3 (archiver, not lossy audio compression)
+0	string	MP3\x1a MP3-Archiver archive data
+# ZET
+0	string	OZÝ ZET archive data
+# TSComp
+0	string	\x65\x5d\x13\x8c\x08\x01\x03\x00 TSComp archive data
+# ARQ
+0	string	gW\4\1 ARQ archive data
+# Squash
+3	string	OctSqu Squash archive data
+# Terse
+0	string	\5\1\1\0 Terse archive data
+# PUCrunch
+0	string	\x01\x08\x0b\x08\xef\x00\x9e\x32\x30\x36\x31 PUCrunch archive data
+# UHarc
+0	string	UHA UHarc archive data
+# ABComp
+0	string	\2AB ABComp archive data
+0	string	\3AB2 ABComp archive data
+# CMP
+0	string	CO\0 CMP archive data
+# Splint
+0	string	\x93\xb9\x06 Splint archive data
+# InstallShield
+0	string	 \x13\x5d\x65\x8c InstallShield Z archive Data
+# Gather
+1	string	GTH Gather archive data
+# BOA
+0	string	BOA BOA archive data
+# RAX
+0	string	ULEB\xa RAX archive data
+# Xtreme
+0	string	ULEB\0 Xtreme archive data
+# Pack Magic
+0	string	@â\1\0 Pack Magic archive data
+# BTS
+0	belong&0xfeffffff	0x1a034465 BTS archive data
+# ELI 5750
+0	string	Ora\  ELI 5750 archive data
+# QFC
+0	string	\x1aFC\x1a QFC archive data
+0	string	\x1aQF\x1a QFC archive data
+# PRO-PACK
+0	string	RNC PRO-PACK archive data
+# 777
+0	string	777 777 archive data
+# LZS221
+0	string	sTaC LZS221 archive data
+# HPA
+0	string	HPA HPA archive data
+# Arhangel
+0	string	LG Arhangel archive data
+# EXP1, uses bzip2
+0	string	0123456789012345BZh EXP1 archive data
+# IMP
+0	string	IMP\xa IMP archive data
+# NRV
+0	string	\x00\x9E\x6E\x72\x76\xFF NRV archive data
+# Squish
+0	string	\x73\xb2\x90\xf4 Squish archive data
+# Par
+0	string	PHILIPP Par archive data
+0	string	PAR Par archive data
+# HIT
+0	string	UB HIT archive data
+# SBX
+0	belong&0xfffff000	0x53423000 SBX archive data
+# NaShrink
+0	string	NSK NaShrink archive data
+# SAPCAR
+0	string	#\ CAR\ archive\ header SAPCAR archive data
+0	string	CAR\ 2.00RG SAPCAR archive data
+# Disintegrator
+0	string	DST Disintegrator archive data
+# ASD
+0	string	ASD ASD archive data
+# InstallShield CAB
+0	string	ISc( InstallShield CAB
+# TOP4
+0	string	T4\x1a TOP4 archive data
+# BatComp left out: sig looks like COM executable
+# so TODO: get real 4dos batcomp file and find sig
+# BlakHole
+0	string	BH\5\7 BlakHole archive data
+# BIX
+0	string	BIX0 BIX archive data
+# ChiefLZA
+0	string	ChfLZ ChiefLZA archive data
+# Blink
+0	string	Blink Blink archive data
+# Logitech Compress
+0	string	\xda\xfa Logitech Compress archive data
+# ARS-Sfx (FIXME: really a SFX? then goto COM/EXE)
+1	string	(C)\ STEPANYUK ARS-Sfx archive data
+# AKT/AKT32
+0	string	AKT32 AKT32 archive data
+0	string	AKT AKT archive data
+# NPack
+0	string	MSTSM NPack archive data
+# PFT
+0	string	\0\x50\0\x14 PFT archive data
+# SemOne
+0	string	SEM SemOne archive data
+# PPMD
+0	string	\x8f\xaf\xac\x84 PPMD archive data
+# FIZ
+0	string	FIZ FIZ archive data
+# MSXiE
+0	belong&0xfffff0f0	0x4d530000 MSXiE archive data
+# DeepFreezer
+0	belong&0xfffffff0	0x797a3030 DeepFreezer archive data
+# DC
+0	string	=<DC- DC archive data
+# TPac
+0	string	\4TPAC\3 TPac archive data
+# Ai
+0	string	Ai\1\1\0 Ai archive data
+0	string	Ai\1\0\0 Ai archive data
+# Ai32
+0	string	Ai\2\0 Ai32 archive data
+0	string	Ai\2\1 Ai32 archive data
+# SBC
+0	string	SBC SBC archive data
+# Ybs
+0	string	YBS Ybs archive data
+# DitPack
+0	string	\x9e\0\0 DitPack archive data
+# DMS
+0	string	DMS! DMS archive data
+# EPC
+0	string	\x8f\xaf\xac\x8c EPC archive data
+# VSARC
+0	string	VS\x1a VSARC archive data
+# PDZ
+0	string	PDZ PDZ archive data
+# ReDuq
+0	string	rdqx ReDuq archive data
+# GCA
+0	string	GCAX GCA archive data
+# PPMN
+0	string	pN PPMN archive data
+# WinImage
+3	string	WINIMAGE WinImage archive data
+# Compressia
+0	string	CMP0CMP Compressia archive data
+# UHBC
+0	string	UHB UHBC archive data
+# WinHKI
+0	string	\x61\x5C\x04\x05 WinHKI archive data
+# WWPack data file
+0	string	WWP WWPack archive data
+# BSN (BSA, PTS-DOS)
+0	string	\xffBSG BSN archive data
+1	string	\xffBSG BSN archive data
+3	string	\xffBSG BSN archive data
+1	string	\0\xae\2 BSN archive data
+1	string	\0\xae\3 BSN archive data
+1	string	\0\xae\7 BSN archive data
+# AIN
+0	string	\x33\x18 AIN archive data
+0	string	\x33\x17 AIN archive data
+# XPA32
+0	string	xpa\0\1 XPA32 archive data
+# SZip (TODO: doesn't catch all versions)
+0	string	SZ\x0a\4 SZip archive data
+# XPack DiskImage
+0	string	jm XPack DiskImage archive data
+# XPack Data
+0	string	xpa XPack archive data
+# XPack Single Data
+0	string	Í\ jm XPack single archive data
+
+# TODO: missing due to unknown magic/magic at end of file:
+#DWC
+#ARG
+#ZAR
+#PC/3270
+#InstallIt
+#RKive
+#RK
+#XPack Diskimage
+
+# These were inspired by idarc, but actually verified
+# Dzip archiver (.dz)
+0	string	DZ Dzip archive data
+>2	byte	x \b, version %i
+>3	byte	x \b.%i
+# ZZip archiver (.zz)
+0	string	ZZ\ \0\0 ZZip archive data
+0	string	ZZ0 ZZip archive data
+# PAQ archiver (.paq)
+0	string	\xaa\x40\x5f\x77\x1f\xe5\x82\x0d PAQ archive data
+0	string	PAQ PAQ archive data
+>3	byte&0xf0	0x30
+>>3	byte	x (v%c)
+# JAR archiver (.j), this is the successor to ARJ, not Java's JAR (which is essentially ZIP)
+0xe	string	\x1aJar\x1b JAR (ARJ Software, Inc.) archive data
+0	string	JARCS JAR (ARJ Software, Inc.) archive data
+
 # ARJ archiver (jason@jarthur.Claremont.EDU)
 0	leshort		0xea60		ARJ archive data
 >5	byte		x		\b, v%d,
@@ -150,6 +440,8 @@
 >7	byte		8		os: NeXT
 >7	byte		9		os: VAX/VMS
 >3	byte		>0		%d]
+# [JW] idarc says this is also possible
+2	leshort		0xea60		ARJ archive data
 
 # HA archiver (Greg Roelofs, newt@uchicago.edu)
 # This is a really bad format. A file containing HAWAII will match this...
@@ -161,6 +453,15 @@
 #>4	byte&0x0f	=2		first is type HSC
 #>4	byte&0x0f	=0x0e		first is type DIR
 #>4	byte&0x0f	=0x0f		first is type SPECIAL
+# suggestion: at least identify small archives (<1024 files)
+0  belong&0xffff00fc 0x48410000 HA archive data
+>2	leshort		=1		1 file,
+>2	leshort		>1		%u files,
+>4	byte&0x0f	=0		first is type CPY
+>4	byte&0x0f	=1		first is type ASC
+>4	byte&0x0f	=2		first is type HSC
+>4	byte&0x0f	=0x0e		first is type DIR
+>4	byte&0x0f	=0x0f		first is type SPECIAL
 
 # HPACK archiver (Peter Gutmann, pgut1@cs.aukuni.ac.nz)
 0	string		HPAK		HPACK archive data
@@ -174,12 +475,12 @@
 >>0x36	string		>\0			fstype %.8s
 
 # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
-2	string		-lh0-		LHarc 1.x archive data [lh0]
-2	string		-lh1-		LHarc 1.x archive data [lh1]
+2	string		-lh0-		LHarc 1.x/ARX archive data [lh0]
+2	string		-lh1-		LHarc 1.x/ARX archive data [lh1]
 2	string		-lz4-		LHarc 1.x archive data [lz4]
 2	string		-lz5-		LHarc 1.x archive data [lz5]
 #	[never seen any but the last; -lh4- reported in comp.compression:]
-2	string		-lzs-		LHa 2.x? archive data [lzs]
+2	string		-lzs-		LHa/LZS archive data [lzs]
 2	string		-lh\40-		LHa 2.x? archive data [lh ]
 2	string		-lhd-		LHa 2.x? archive data [lhd]
 2	string		-lh2-		LHa 2.x? archive data [lh2]
@@ -187,8 +488,12 @@
 2	string		-lh4-		LHa (2.x) archive data [lh4]
 2	string		-lh5-		LHa (2.x) archive data [lh5]
 2	string		-lh6-		LHa (2.x) archive data [lh6]
-2	string		-lh7-		LHa (2.x) archive data [lh7]
+2	string		-lh7-		LHa (2.x)/LHark archive data [lh7]
 >20	byte		x		- header level %d
+# taken from idarc [JW]
+2   string      -lZ         PUT archive data
+2   string      -lz         LZS archive data 
+2   string      -sw1-       Swag archive data
 
 # RAR archiver (Greg Roelofs, newt@uchicago.edu)
 0	string		Rar!		RAR archive data,
@@ -197,12 +502,14 @@
 >35	byte		1		os: OS/2
 >35	byte		2		os: Win32
 >35	byte		3		os: Unix
+# some old version? idarc says:
+0   string      RE\x7e\x5e  RAR archive data
 
 # SQUISH archiver (Greg Roelofs, newt@uchicago.edu)
 0	string		SQSH		squished archive data (Acorn RISCOS)
 
 # UC2 archiver (Greg Roelofs, newt@uchicago.edu)
-# I can't figure out the self-extracting form of these buggers...
+# [JW] see exe section for self-extracting version
 0	string		UC2\x1a		UC2 archive data
 
 # ZIP archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
@@ -284,7 +591,7 @@
 
 # ACE archive (from http://www.wotsit.org/download.asp?f=ace)
 # by Stefan `Sec` Zehl <sec@42.org>
-7	string		**ACE**		ACE compressed archive
+7	string		**ACE**		ACE archive data
 >15	byte	>0		version %d
 >16	byte	=0x00		\b, from MS-DOS
 >16	byte	=0x01		\b, from OS/2
@@ -320,3 +627,10 @@
 >>0x1	string	>\0		Version %s
 >>0x2A	string	>\0		: %s
 
+# DR-DOS 7.03 Packed File *.??_
+0	string	Packed\ File\  Personal		NetWare Packed File
+>12	string	x    				\b, was "%.12s"
+
+# EET archive
+# From: Tilman Sauerbeck <tilman@code-monkey.de>
+0	belong	0x1ee7ff00	EET archive

+ 34 - 1
magic/Magdir/audio

@@ -131,7 +131,7 @@
 0	string	Extended\ Module: Fasttracker II module sound data
 >17	string	>\0		Title: "%s"
 
-21	string/c	!SCREAM!	Screamtracker 2 module sound data
+21	string/c	=!SCREAM!	Screamtracker 2 module sound data
 21	string	BMOD2STM	Screamtracker 2 module sound data
 1080	string	M.K.		4-channel Protracker module sound data
 >0	string	>\0		Title: "%s"
@@ -409,3 +409,36 @@
 >12	lelong	>0	samplerate %d,
 >24	lelong	>0	frames %d
 
+# adlib sound files
+# From Gürkan Sengün <gurkan@linuks.mine.nu>, http://www.linuks.mine.nu
+0    	string		RAWADATA	RdosPlay RAW
+
+1068	string		RoR		AMUSIC Adlib Tracker
+
+0	string		JCH		EdLib
+
+0	string		mpu401tr	MPU-401 Trakker
+
+0	string		SAdT		Surprise! Adlib Tracker
+>4	byte		x		Version %d
+
+0	string		XAD!		eXotic ADlib
+
+0	string		ofTAZ!		eXtra Simple Music
+
+# Spectrum 128 tunes (.ay files).
+# From: Emanuel Haupt <ehaupt@critical.ch>
+0	string		ZXAYEMUL	Spectrum 128 tune
+
+# From: Alex Beregszaszi <alex@fsn.hu>
+0	string		MP+		Musepack
+>3	byte&0x0f	x		SV%d
+
+0	string		\0BONK		BONK,
+#>5	byte		x		version %d
+>14	byte		x		%d channel(s),
+>15	byte		=1		lossless,
+>15	byte		=0		lossy,
+>16	byte		x		mid-side
+
+384	string		LockStream	LockStream Embedded file (mostly MP3 on old Nokia phones)

+ 1 - 1
magic/Magdir/bout

@@ -5,5 +5,5 @@
 >16	long		>0		not stripped
 #
 # b.out archive (hp-rt on i960)
-0	string		!<bout>		b.out archive
+0	string		=!<bout>	b.out archive
 >8	string		__.SYMDEF	random library

+ 17 - 2
magic/Magdir/c64

@@ -2,7 +2,7 @@
 #------------------------------------------------------------------------------
 # c64:  file(1) magic for various commodore 64 related files
 #
-# From <doj@cubic.org>
+# From: Dirk Jagdmann <doj@cubic.org>
 
 0x16500	belong		0x12014100	D64 Image
 0x16500	belong		0x12014180	D71 Image
@@ -11,7 +11,7 @@
 0	belong		0x43154164	X64 Image
 
 0	string		GCR-1541	GCR Image
->8	byte		x		version: $i
+>8	byte		x		version: %i
 >9	byte		x		tracks: %i
 
 9	string		PSUR		ARC archive (c64)
@@ -25,3 +25,18 @@
 0	string		CBM\144\0\0	Power 64 C64 Emulator Snapshot
 
 0	belong		0xFF424CFF	WRAptor packer (c64)
+
+0	string		C64S\x20tape\x20file	T64 tape Image
+>32	leshort		x		Version:0x%x
+>36	leshort		!0		Entries:%i
+>40	string		x		Name:%.24s
+
+0	string		C64\x20tape\x20image\x20file\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0	T64 tape Image
+>32	leshort		x		Version:0x%x
+>36	leshort		!0		Entries:%i
+>40	string		x		Name:%.24s
+
+0	string		C64S\x20tape\x20image\x20file\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0	T64 tape Image
+>32	leshort		x		Version:0x%x
+>36	leshort		!0		Entries:%i
+>40	string		x		Name:%.24s

+ 25 - 7
magic/Magdir/cad