]> granicus.if.org Git - file/commitdiff
*** empty log message ***
authorChristos Zoulas <christos@zoulas.com>
Sat, 27 Jun 1998 13:56:19 +0000 (13:56 +0000)
committerChristos Zoulas <christos@zoulas.com>
Sat, 27 Jun 1998 13:56:19 +0000 (13:56 +0000)
24 files changed:
Makefile.in
config.h.in
configure
configure.in
magic/Magdir/adventure
magic/Magdir/audio
magic/Magdir/compress
magic/Magdir/filesystems
magic/Magdir/frame
magic/Magdir/linux
magic/Magdir/printer
magic/Magdir/tex
magic/Magdir/timezone
src/Makefile
src/Makefile.std
src/apprentice.c
src/compress.c
src/file.c
src/file.h
src/names.h
src/print.c
src/readelf.c
src/readelf.h
src/tar.h

index 3cb022c56b0b006de60bf072b60c4f3a811220d9..24b63729f5a84f0d72fc172749a70d8c6b8a8b07 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for file(1) cmd. 
 # Copyright (c) Ian F. Darwin 86/09/01 - see LEGAL.NOTICE.
-# @(#)$Id: Makefile.in,v 1.3 1998/02/15 23:21:17 christos Exp $
+# @(#)$Id: Makefile.in,v 1.4 1998/06/27 14:01:39 christos Exp $
 #
 # This software is not subject to any license of the American Telephone
 # and Telegraph Company or of the Regents of the University of California.
@@ -21,7 +21,7 @@
 #    ever read sources, credits must appear in the documentation.
 #
 # 4. This notice may not be removed or altered.
-VERSION        = 3.24
+VERSION        = 3.25
 SHELL  = /bin/sh
 #MAGIC = /etc/magic
 prefix = @prefix@
index c4d5fe2558fc6cb4333c85a314f0c922ae4ca3eb..efd00d4ead242e7957a55e368d9c115bf167a8a2 100644 (file)
@@ -6,6 +6,9 @@
 /* Define if your struct stat has st_rdev.  */
 #undef HAVE_ST_RDEV
 
+/* Define if you have <sys/wait.h> that is POSIX.1 compatible.  */
+#undef HAVE_SYS_WAIT_H
+
 /* Define to `long' if <sys/types.h> doesn't define.  */
 #undef off_t
 
index 26983fbdffedd43dfc7fd902b00368b9aa47ca6a..b252ac92eaa0fb12a7ac5cbca0b9d470750e1c26 100755 (executable)
--- a/configure
+++ b/configure
@@ -181,7 +181,7 @@ Features and packages:
   --x-libraries=DIR       X library files are in DIR
 EOF
     if test -n "$ac_help"; then
-      echo "--enable and --with options recognized:$ac_help"
+      echo "--enable and --with options known (Default: + yes, - no, s system-specific):$ac_help"
     fi
     exit 0 ;;
 
@@ -1131,6 +1131,49 @@ EOF
 fi
 
 
+echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
+echo "configure:1136: checking for sys/wait.h that is POSIX.1 compatible" >&5
+if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1141 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+int main() {
+int s;
+wait (&s);
+s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+; return 0; }
+EOF
+if { (eval echo configure:1157: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_header_sys_wait_h=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_header_sys_wait_h=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
+if test $ac_cv_header_sys_wait_h = yes; then
+  cat >> confdefs.h <<\EOF
+#define HAVE_SYS_WAIT_H 1
+EOF
+
+fi
+
+
 trap '' 1 2 15
 cat > confcache <<\EOF
 # This file is a shell script that caches the results of configure
index 1788038bde0b56c2a72d88e48fb6294e819e8f8b..74f2894c345df80dbb88ef322feb804c396c176e 100644 (file)
@@ -12,4 +12,7 @@ AC_TYPE_OFF_T
 AC_TYPE_SIZE_T
 AC_STRUCT_ST_RDEV
 
+dnl Checks for headers
+AC_HEADER_SYS_WAIT
+
 AC_OUTPUT(Makefile config.h)
index 18ab94af543d4b9ee4cc3e7f4f5d86dab5d472e3..67e108da5855f42ad8a7c4965f3c05d114b74196 100644 (file)
@@ -9,10 +9,11 @@
 0      leshort 0x602   ALAN text adventure code data
 >2     byte    <10     version 2.6%d
 
+# Conflicts with too much other stuff!
 # Infocom 
-     byte    <9      Infocom game data (Z-machine %d,
->3     leshort <0x7fff Release %3d,
->18    string  >\0     Serial %.6s)
+#0     byte    <9      Infocom game data (Z-machine %d,
+#>3    leshort <0x7fff Release %3d,
+#>18   string  >\0     Serial %.6s)
 
 # TADS (Text Adventure Development System)
 0      string  TADS    TADS game data
index b5ac2a478abaa8f6abbffb987add8b95dbf2211a..e626c7c35fca17c16d2c5e37b2da8d7cda6338ac 100644 (file)
@@ -44,7 +44,7 @@
 # Creative Labs AUDIO stuff
 0      string  MThd                    Standard MIDI data
 >9     byte    >0                      (format %d)
->11    byte    >1                      using %d channels
+>11    byte    >1                      using %d tracks
 0      string  CTMF                    Creative Music (CMF) data
 0      string  SBI                     SoundBlaster instrument data
 0      string  Creative\ Voice\ File   Creative Labs voice data
index 44ef619ee837df1ccd06d12225b4cd38067dfbe1..dbc25a798791c02c92bc06fcb9e093bd22d320ff 100644 (file)
 >3     string          =7              \b, compression block size 700k
 >3     string          =8              \b, compression block size 800k
 >3     string          =9              \b, compression block size 900k
+
+# lzop from <markus.oberhumer@jk.uni-linz.ac.at>
+0      string          \x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a    lzop compressed data
+>9     beshort         <0x0940
+>>9    byte&0xf0       =0x00           - version 0.
+>>9    beshort&0x0fff  x               \b%03x,
+>>13   byte            1               LZO1X-1,
+>>13   byte            2               LZO1X-1(15),
+>>13   byte            3               LZO1X-999,
+## >>22        bedate          >0              last modified: %s,
+>>14   byte            =0x00           os: MS-DOS
+>>14   byte            =0x01           os: Amiga
+>>14   byte            =0x02           os: VMS
+>>14   byte            =0x03           os: Unix
+>>14   byte            =0x05           os: Atari
+>>14   byte            =0x06           os: OS/2
+>>14   byte            =0x07           os: MacOS
+>>14   byte            =0x0A           os: Tops/20
+>>14   byte            =0x0B           os: WinNT
+>>14   byte            =0x0E           os: Win32
+>9     beshort         >0x0939
+>>9    byte&0xf0       =0x00           - version 0.
+>>9    byte&0xf0       =0x10           - version 1.
+>>9    byte&0xf0       =0x20           - version 2.
+>>9    beshort&0x0fff  x               \b%03x,
+>>15   byte            1               LZO1X-1,
+>>15   byte            2               LZO1X-1(15),
+>>15   byte            3               LZO1X-999,
+## >>25        bedate          >0              last modified: %s,
+>>17   byte            =0x00           os: MS-DOS
+>>17   byte            =0x01           os: Amiga
+>>17   byte            =0x02           os: VMS
+>>17   byte            =0x03           os: Unix
+>>17   byte            =0x05           os: Atari
+>>17   byte            =0x06           os: OS/2
+>>17   byte            =0x07           os: MacOS
+>>17   byte            =0x0A           os: Tops/20
+>>17   byte            =0x0B           os: WinNT
+>>17   byte            =0x0E           os: Win32
index 13a8731b9dd11f72d4a2542378ed0e9e803194a9..f3ae3a69e48c35b4a28ba634033bcf6fd1db25b8 100644 (file)
 >>0x36 string  FAT                     \b, %s
 >>>0x39        string  12                      (%s bit)
 >>>0x39        string  16                      (%s bit)
+>>>43  string          >NO\ NAME       label: %.11s,
+>>>43  string          <NO\ NAME       label: %.11s,
+>>>43  string          NO\ NAME        unlabeled,
+>>>19  leshort         >0              %d sectors
+>>>19  leshort         0               
+>>>>32 lelong          x               %d sectors
 >0x200 lelong  0x82564557              \b, BSD disklabel
+
+# Minix filesystems - Juan Cespedes <cespedes@debian.org>
+0x410  leshort         0x137f          Minix filesystem
+0x410  leshort         0x138f          Minix filesystem, 30 char names
+0x410  leshort         0x2468          Minix filesystem, version 2
+0x410  leshort         0x2478          Minix filesystem, version 2, 30 char names
+
+# romfs filesystems - Juan Cespedes <cespedes@debian.org>
+0      string          -rom1fs-\0      romfs filesystem, version 1
+>8     belong  x                       %d bytes,
+>16    string  x                       named %s.
+
+# netboot image - Juan Cespedes <cespedes@debian.org>
+0      lelong          0x1b031336L     Netboot image,
+>4     lelong&0xFFFFFF00       0
+>>4    lelong&0x100    0x000           mode 2
+>>4    lelong&0x100    0x100           mode 3
+>4     lelong&0xFFFFFF00       !0      unknown mode
+
+0x18b  string  OS/2    OS/2 Boot Manager
index e2c10f116ffb136779673773d874fcc707c3773b..1b397df05799aa7cb0e891edab623e86f6fdf9a4 100644 (file)
@@ -6,6 +6,7 @@
 # copyright, but this file is "published" as witness the following:
 #
 0      string          \<MakerFile     FrameMaker document
+>11    string          5.5              (5.5
 >11    string          5.0              (5.0
 >11    string          4.0              (4.0
 >11    string          3.0              (3.0
index ec6d5c89fb5faa8243a2d45eb0d00592fb20fadf..ba37e24eb8ab6ff4a7cdddfd1771389621e65e79 100644 (file)
 #
 0      string          \007\001\000    Linux/i386 object file
 >20    lelong          >0x1020         \b, DLL library
+# Linux-8086 stuff:
+0      string          \01\03\020\04   Linux-8086 impure executable
+>28    long            !0              not stripped
+0      string          \01\03\040\04   Linux-8086 executable
+>28    long            !0              not stripped
+#
+0      string          \243\206\001\0  Linux-8086 object file
+#
+0      string          \01\03\020\20   Minix-386 impure executable
+>28    long            !0              not stripped
+0      string          \01\03\040\20   Minix-386 executable
+>28    long            !0              not stripped
 # message catalogs, from Mitchum DSouza <m.dsouza@mrc-apu.cam.ac.uk>
 0      string          *nazgul*        Linux compiled message catalog
 >8     lelong          >0              \b, version %ld
@@ -66,7 +78,7 @@
 #
 # Linux kernel boot images, from Albert Cahalan <acahalan@cs.uml.edu>
 # and others such as Axel Kohlmeyer <akohlmey@rincewind.chemie.uni-ulm.de>
-# and Nicolas Lichtmaier <nick@debian.org>
+# and Nicolรกs Lichtmaier <nick@debian.org>
 # All known start with: b8 c0 07 8e d8 b8 00 90 8e c0 b9 00 01 29 f6 29
 514            string  HdrS            Linux kernel
 >518           leshort >0
 0              belong  0xb8c0078e      Linux kernel
 >0x1e3         string  Loading         version 1.3.79 or older
 >0x1e9         string  Loading         from prehistoric times
-# LSM entries - Nicolas Lichtmaier <nick@feedback.com.ar>
+# LSM entries - Nicolรกs Lichtmaier <nick@feedback.net.ar>
 0      string  Begin3  Linux Software Map entry text
index a316f63de0be70b6fa2ae4892fa979674c2d4917..4bf5f06860fb9435389bc23417d2b3f7c5356882 100644 (file)
 >>>16  string          Query           - type %s
 >>>16  string          ExitServer      - type %s
 
+# DOS EPS Binary File Header
+# From: Ed Sznyter <ews@Black.Market.NET>
+0       belong          0xC5D0D3C6      DOS EPS Binary File
+>4      long            >0              Postscript starts at byte %d
+>>8     long            >0              length %d
+>>>12   long            >0              Metafile starts at byte %d
+>>>>16  long            >0              length %d
+>>>20   long            >0              TIFF starts at byte %d
+>>>>24  long            >0              length %d
+
 # Adobe's PostScript Printer Description (PPD) files
 #       Yves Arrouye <arrouye@marin.fdn.fr>
 #
index 5126be8c8001c0165f21f0964c1b2c70b74a8007..79d5bbaaf73b2063852c100f3863388f198ab461 100644 (file)
 0      string          \\setlength     LaTeX document text
 0      string          \\documentstyle LaTeX document text
 0      string          \\chapter       LaTeX document text
+0      string          \\documentclass LaTeX 2e document text
+0      string          \\relax         LaTeX auxiliary file
+0      string          \\contentsline  LaTeX  table of contents
+
+# Index and glossary files
+0      string          \\indexentry    LaTeX raw index file
+0      string          \\begin{theindex}       LaTeX sorted index
+0      string          \\glossaryentry LaTeX raw glossary
+0      string          \\begin{theglossary}    LaTeX sorted glossary
+0      string          This\ is\ makeindex     Makeindex log file
+# End of TeX
index bae5abe87e9ae594dee879b988007cc4d99a3f74..40e7558f8de10a7231a42b3f628972cbfa3332a0 100644 (file)
@@ -6,9 +6,9 @@
 # this should work on Linux, SunOS, and maybe others
 # Added new official magic number for recent versions of the Olson code
 0      string  TZif    timezone data
-0      string  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0      timezone data
-0      string  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0      timezone data
-0      string  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\0      timezone data
-0      string  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0      timezone data
-0      string  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0      timezone data
-0      string  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0      timezone data
+0      string  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0      old timezone data
+0      string  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0      old timezone data
+0      string  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\0      old timezone data
+0      string  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0      old timezone data
+0      string  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0      old timezone data
+0      string  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0      old timezone data
index 548f43844d2fad46599466dabe64813b98464f3d..40aeb61b65648321d18664becd36959873790443 100644 (file)
@@ -1,6 +1,7 @@
+# Generated automatically from Makefile.in by configure.
 # Makefile for file(1) cmd. 
 # Copyright (c) Ian F. Darwin 86/09/01 - see LEGAL.NOTICE.
-# @(#)$Id: Makefile,v 1.56 1997/11/05 16:03:18 christos Exp $
+# @(#)$Id: Makefile,v 1.57 1998/06/27 14:01:39 christos Exp $
 #
 # This software is not subject to any license of the American Telephone
 # and Telegraph Company or of the Regents of the University of California.
 #    ever read sources, credits must appear in the documentation.
 #
 # 4. This notice may not be removed or altered.
-VERSION        = 3.23
+VERSION        = 3.25
 SHELL  = /bin/sh
 #MAGIC = /etc/magic
-MAGIC  = /usr/local/etc/magic
-DEFS   = -DMAGIC='"$(MAGIC)"' -DBUILTIN_ELF # -Dvoid=int
-CC     = cc
-COPTS  = -O -g         # newer compilers allow both; else drop -O
+prefix = /usr/local
+INSTALLCMD = /usr/bin/install -c
+MAGICDIR = ${prefix}/share
+MAGIC  = $(MAGICDIR)/magic
+DEFS   = -DMAGIC='"$(MAGIC)"' -DBUILTIN_ELF -DHAVE_CONFIG_H
+CPPFLAGS = $(DEFS)
+CC     = gcc
+#COPTS = -O -g         # newer compilers allow both; else drop -O
 # For truly antique environments, use this for (dummy) include files:
-COPTS  = -O # -Ilocalinc
-CFLAGS = $(COPTS) $(DEFS)
-LDFLAGS        = $(COPTS) # -Bstatic   # older gdb couldn't handle shared libs
+#COPTS = -O # -Ilocalinc
+#CFLAGS        = $(COPTS) $(DEFS)
+CFLAGS = -g -O2
+#LDFLAGS       = $(COPTS) # -Bstatic   # older gdb couldn't handle shared libs
 SHAR   = bundle
 OFILE  = /usr/bin/file         # old or distributed version, for comparison
 # Where new binary lives; typically /usr/local (BSD), /usr/lbin (USG).
-BINDIR = /usr/local/bin
+BINDIR = ${prefix}/bin
 # For installing our man pages; 
 # MANCxxx is manual section for Commands, MANFxxx is section for file formats.
 # MANxDIR is directory names; MANxEXT is the filename extention. Usual values:
@@ -54,9 +60,9 @@ BINDIR        = /usr/local/bin
 # MANCDIR                      /usr/man/local/man1
 # MANCEXT                      1
 
-MANCDIR        = /usr/local/man/man1
+MANCDIR        = ${prefix}/man/man1
 MANCEXT        = 1
-MANFDIR        = /usr/local/man/man4
+MANFDIR        = ${prefix}/man/man4
 MANFEXT        = 4
 
 # There are no system-dependant configuration options (except maybe CFLAGS).
@@ -75,9 +81,11 @@ SRCS = file.c apprentice.c fsmagic.c softmagic.c ascmagic.c \
 OBJS = file.o apprentice.o fsmagic.o softmagic.o ascmagic.o \
        compress.o is_tar.o readelf.o internat.o \
        print.o $(LOCALOBJS)
+HDRS = file.h names.h patchlevel.h readelf.h tar.h
 
-ALLSRC = LEGAL.NOTICE README MAINT PORTING $(SRCS) *.h \
-        Makefile file.man magic.man 
+AUTOSRC=configure configure.in install-sh config.h.in Makefile.in
+ALLSRC = LEGAL.NOTICE README MAINT PORTING $(SRCS) $(HDRS) \
+        Makefile.std file.man magic.man magic2mime $(AUTOSRC)
 ALLMAGIC =   Magdir/Makefile Magdir/Localstuff Magdir/Header Magdir/[a-z]*
 
 all:           file magic file.${MANCEXT} magic.${MANFEXT}
@@ -103,8 +111,11 @@ ascmagic.o:        names.h
 compress.o apprentice.o ascmagic.o file.o fsmagic.o print.o softmagic.o: file.h
 
 install:       file magic
-               cp file $(BINDIR)/file
-               cp magic $(MAGIC)
+               -mkdir $(BINDIR) $(MAGICDIR) $(MANCDIR) $(MANFDIR)
+               $(INSTALLCMD) file      $(BINDIR)/file
+               $(INSTALLCMD) magic $(MAGIC)
+               $(INSTALLCMD) file.${MANCEXT} $(MANCDIR)/file.$(MANCEXT)
+               $(INSTALLCMD) magic.${MANFEXT} $(MANFDIR)/magic.$(MANFEXT)
 
 install.man: file.${MANCEXT} magic.${MANFEXT}
                cp file.${MANCEXT} $(MANCDIR)/file.$(MANCEXT)
@@ -112,7 +123,8 @@ install.man: file.${MANCEXT} magic.${MANFEXT}
 
 clean:
                rm -f *.o core file magic lint dist.* MANIFEST \
-                     magic.${MANFEXT} file.${MANCEXT}
+                     magic.${MANFEXT} file.${MANCEXT} \
+                     config.h config.status config.cache config.log
 clobber:
                cd tst; $(MAKE) clean
 
index ae22b82b9572a65b48beb4128d144cd94a0dfad7..9022de6359b6bd9313d7b424eea56242a5a4b51d 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for file(1) cmd. 
 # Copyright (c) Ian F. Darwin 86/09/01 - see LEGAL.NOTICE.
-# @(#)$Id: Makefile.std,v 1.3 1998/02/15 23:21:17 christos Exp $
+# @(#)$Id: Makefile.std,v 1.4 1998/06/27 14:01:39 christos Exp $
 #
 # This software is not subject to any license of the American Telephone
 # and Telegraph Company or of the Regents of the University of California.
@@ -21,7 +21,7 @@
 #    ever read sources, credits must appear in the documentation.
 #
 # 4. This notice may not be removed or altered.
-VERSION        = 3.24
+VERSION        = 3.25
 SHELL  = /bin/sh
 #MAGIC = /etc/magic
 MAGIC  = /usr/local/etc/magic
index 2819df87f29700d172a0b3c23725c3b9e30a0a2c..eb50b3371e68c395da20011ae80416848f2122ef 100644 (file)
@@ -33,7 +33,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$Id: apprentice.c,v 1.26 1998/06/27 13:23:39 christos Exp $")
+FILE_RCSID("@(#)$Id: apprentice.c,v 1.27 1998/06/27 13:57:23 christos Exp $")
 #endif /* lint */
 
 #define        EATAB {while (isascii((unsigned char) *l) && \
@@ -50,11 +50,11 @@ static void eatsize __P((char **));
 
 static int maxmagic = 0;
 
-static int apprentice_1        __P((char *, int));
+static int apprentice_1        __P((const char *, int));
 
 int
 apprentice(fn, check)
-char *fn;                      /* list of magic files */
+const char *fn;                        /* list of magic files */
 int check;                     /* non-zero? checking-only run. */
 {
        char *p, *mfn;
@@ -93,7 +93,7 @@ int check;                    /* non-zero? checking-only run. */
 
 static int
 apprentice_1(fn, check)
-char *fn;                      /* name of magic file */
+const char *fn;                        /* name of magic file */
 int check;                     /* non-zero? checking-only run. */
 {
        static const char hdr[] =
index 773d70e5828d5e43f1e59be9ff1462b6299cf4d9..50647bf018f9ce4abb0091d869fee6ab183c44e8 100644 (file)
 #endif
 #include "file.h"
 #ifndef lint
-FILE_RCSID("@(#)$Id: compress.c,v 1.11 1998/06/27 13:23:39 christos Exp $")
+FILE_RCSID("@(#)$Id: compress.c,v 1.12 1998/06/27 13:57:23 christos Exp $")
 #endif
 
 
 static struct {
-   char *magic;
+   const char *magic;
    int   maglen;
-   char *argv[3];
+   const char *const argv[3];
    int  silent;
 } compr[] = {
     { "\037\235", 2, { "uncompress", "-c", NULL }, 0 },        /* compressed */
@@ -97,7 +97,8 @@ int n;
                if (compr[method].silent)
                    (void) close(2);
 
-               execvp(compr[method].argv[0], compr[method].argv);
+               execvp(compr[method].argv[0],
+                      (char *const *)compr[method].argv);
                error("could not execute `%s' (%s).\n", 
                      compr[method].argv[0], strerror(errno));
                /*NOTREACHED*/
index 7acd198c9ea9a5bddd725a253e19522ee5fa0532..e4040ea8f8e68885f95f9071fcbd72927d01576e 100644 (file)
@@ -48,7 +48,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$Id: file.c,v 1.40 1998/06/27 13:23:39 christos Exp $")
+FILE_RCSID("@(#)$Id: file.c,v 1.41 1998/06/27 13:57:23 christos Exp $")
 #endif /* lint */
 
 
@@ -73,7 +73,7 @@ int                   /* Misc globals                         */
 
 struct  magic *magic;  /* array of magic entries               */
 
-char *magicfile;       /* where magic be found                 */
+const char *magicfile; /* where magic be found                 */
 
 char *progname;                /* used throughout                      */
 int lineno;            /* line number in the magic file        */
@@ -85,6 +85,8 @@ static int    byteconv4       __P((int, int, int));
 static short   byteconv2       __P((int, int, int));
 #endif
 
+int main __P((int, char *[]));
+
 /*
  * main - parse arguments and handle options
  */
index 9bce31292824abc9a0e6532c20f7db86b7323b46..60cd42d0ff61a240d8ec77631eca0f535c765156 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * file.h - definitions for file(1) program
- * @(#)$Id: file.h,v 1.26 1998/06/27 13:23:39 christos Exp $
+ * @(#)$Id: file.h,v 1.27 1998/06/27 13:57:23 christos Exp $
  *
  * Copyright (c) Ian F. Darwin, 1987.
  * Written by Ian F. Darwin.
@@ -88,7 +88,7 @@ struct magic {
 # endif
 #endif
 
-extern int   apprentice                __P((char *, int));
+extern int   apprentice                __P((const char *, int));
 extern int   ascmagic          __P((unsigned char *, int));
 extern void  error             __P((const char *, ...));
 extern void  ckfputs           __P((const char *, FILE *));
@@ -112,7 +112,7 @@ extern void tryelf          __P((int, char *, int));
 extern int errno;              /* Some unixes don't define this..      */
 
 extern char *progname;         /* the program name                     */
-extern char *magicfile;                /* name of the magic file               */
+extern const char *magicfile;  /* name of the magic file               */
 extern int lineno;             /* current line number in magic file    */
 
 extern struct magic *magic;    /* array of magic entries               */
index 54d1cbb125135a54f1ecfaee725eaebea4d8d364..a9abb5e57423e6b4a737a666725098fa3449b3d7 100644 (file)
  *
  * See LEGAL.NOTICE
  *
- * $Id: names.h,v 1.13 1997/01/15 17:23:24 christos Exp $
+ * $Id: names.h,v 1.14 1998/06/27 13:57:23 christos Exp $
  */
 
 /* these types are used to index the table 'types': keep em in sync! */
-#define L_C    0               /* first and foremost on UNIX */
-#define L_CC   1               /* Bjarne's postincrement */
+#define        L_C     0               /* first and foremost on UNIX */
+#define        L_CC    1               /* Bjarne's postincrement */
 #define        L_FORT  2               /* the oldest one */
-#define L_MAKE 3               /* Makefiles */
-#define L_PLI  4               /* PL/1 */
-#define L_MACH 5               /* some kinda assembler */
-#define L_ENG  6               /* English */
+#define        L_MAKE  3               /* Makefiles */
+#define        L_PLI   4               /* PL/1 */
+#define        L_MACH  5               /* some kinda assembler */
+#define        L_ENG   6               /* English */
 #define        L_PAS   7               /* Pascal */
 #define        L_MAIL  8               /* Electronic mail */
 #define        L_NEWS  9               /* Usenet Netnews */
+#define        L_JAVA  10              /* Java code */
+#define        L_HTML  11              /* HTML */
 
-static char *types[] = {
+static const char *types[] = {
        "C program text",
        "C++ program text",
        "FORTRAN program text",
@@ -36,15 +38,54 @@ static char *types[] = {
        "Pascal program text",
        "mail text",
        "news text",
+       "Java program text",
+       "HTML document text",
        "can't happen error on names.h/types",
        0};
 
+/*
+ * XXX - how should we distinguish Java from C++?
+ * The trick used in a Debian snapshot, of having "extends" or "implements"
+ * as tags for Java, doesn't work very well, given that those keywords
+ * are often preceded by "class", which flags it as C++.
+ *
+ * Perhaps we need to be able to say
+ *
+ *     If "class" then
+ *
+ *             if "extends" or "implements" then
+ *                     Java
+ *             else
+ *                     C++
+ *     endif
+ *
+ * Or should we use other keywords, such as "package" or "import"?
+ * Unfortunately, Ada95 uses "package", and Modula-3 uses "import",
+ * although I infer from the language spec at
+ *
+ *     http://www.research.digital.com/SRC/m3defn/html/m3.html
+ *
+ * that Modula-3 uses "IMPORT" rather than "import", i.e. it must be
+ * in all caps.
+ *
+ * So, for now, we go with "import".  We must put it before the C++
+ * stuff, so that we don't misidentify Java as C++.  Not using "package"
+ * means we won't identify stuff that defines a package but imports
+ * nothing; hopefully, very little Java code imports nothing (one of the
+ * reasons for doing OO programming is to import as much as possible
+ * and write only what you need to, right?).
+ *
+ * Unfortunately, "import" may cause us to misidentify English text
+ * as Java, as it comes after "the" and "The".  Perhaps we need a fancier
+ * heuristic to identify Java?
+ */
 static struct names {
-       char *name;
+       const char *name;
        short type;
 } names[] = {
        /* These must be sorted by eye for optimal hit rate */
        /* Add to this list only after substantial meditation */
+       {"import",      L_JAVA},
        {"//",          L_CC},
        {"template",    L_CC},
        {"virtual",     L_CC},
@@ -94,6 +135,10 @@ static struct names {
        {"Newsgroups:", L_NEWS},
        {"Path:",       L_NEWS},
        {"Organization:",L_NEWS},
+       {"href=",       L_HTML},
+       {"HREF=",       L_HTML},
+       {"<body",       L_HTML},
+       {"<BODY",       L_HTML},
        {NULL,          0}
 };
 #define NNAMES ((sizeof(names)/sizeof(struct names)) - 1)
index e356ed2c125e6bd7658b766a6938ccac0bb80dc3..511955306ac5fe63dbe0bf10ced0d8e70353f5eb 100644 (file)
@@ -39,7 +39,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$Id: print.c,v 1.25 1998/06/27 13:23:39 christos Exp $")
+FILE_RCSID("@(#)$Id: print.c,v 1.26 1998/06/27 13:57:23 christos Exp $")
 #endif  /* lint */
 
 #define SZOF(a)        (sizeof(a) / sizeof(a[0]))
@@ -48,10 +48,10 @@ void
 mdump(m)
 struct magic *m;
 {
-       static char *typ[] = {   "invalid", "byte", "short", "invalid",
-                                "long", "string", "date", "beshort",
-                                "belong", "bedate", "leshort", "lelong",
-                                "ledate" };
+       static const char *typ[] = { "invalid", "byte", "short", "invalid",
+                                    "long", "string", "date", "beshort",
+                                    "belong", "bedate", "leshort", "lelong",
+                                    "ledate" };
        (void) fputc('[', stderr);
        (void) fprintf(stderr, ">>>>>>>> %d" + 8 - (m->cont_level & 7),
                       m->offset);
index 7e6d14b4126a40e2c12ac1fd565d3e8111ca71ff..157485d11c666f58645658725dc2fa06c0ff108f 100644 (file)
@@ -15,7 +15,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$Id: readelf.c,v 1.7 1998/06/27 13:23:39 christos Exp $")
+FILE_RCSID("@(#)$Id: readelf.c,v 1.8 1998/06/27 13:57:23 christos Exp $")
 #endif
 
 static void
@@ -239,7 +239,8 @@ tryelf(fd, buf, nbytes)
         * Instead we traverse thru all section headers until a symbol table
         * one is found or else the binary is stripped.
         */
-       if (buf[EI_MAG0] != ELFMAG0 || buf[EI_MAG1] != ELFMAG1
+       if (buf[EI_MAG0] != ELFMAG0
+           || (buf[EI_MAG1] != ELFMAG1 && buf[EI_MAG1] != OLFMAG1)
            || buf[EI_MAG2] != ELFMAG2 || buf[EI_MAG3] != ELFMAG3)
            return;
 
index c4b42d7eb13fc1fa4d0ec3f9759b75e1ff33e6d7..9b63498b0a8b2e22c6d63a517f55a3ebd08945a0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * readelf.h 
- * @(#)$Id: readelf.h,v 1.4 1997/01/15 17:23:24 christos Exp $
+ * @(#)$Id: readelf.h,v 1.5 1998/06/27 13:57:23 christos Exp $
  *
  * Provide elf data structures for non-elf machines, allowing file
  * non-elf hosts to determine if an elf binary is stripped.
@@ -92,6 +92,9 @@ typedef struct {
 #define        ELFMAG3         'F'
 #define        ELFMAG          "\177ELF"
 
+#define        OLFMAG1         'O'
+#define        OLFMAG          "\177OLF"
+
 typedef struct {
     Elf32_Word p_type;
     Elf32_Off  p_offset;
index fd6f0c94f744ff2278914e1b8c21aed070ed47b6..162459f5199f98311e52f35699de21d900cc9d32 100644 (file)
--- a/src/tar.h
+++ b/src/tar.h
@@ -5,7 +5,7 @@
  *
  * Created 25 August 1985 by John Gilmore, ihnp4!hoptoad!gnu.
  *
- * $Id: tar.h,v 1.3 1992/09/08 15:32:41 ian Exp $ # checkin only
+ * $Id: tar.h,v 1.4 1998/06/27 13:57:23 christos Exp $ # checkin only
  */
 
 /*
@@ -167,6 +167,7 @@ TAR_EXTERN struct link      *linklist;      /* Points to first link in list */
 TAR_EXTERN char                read_error_flag;
 
 
+#if 0
 /*
  * Declarations of functions available to the world.
  */
@@ -177,3 +178,4 @@ union record *endofrecs();
 void anno();
 #define         annorec(stream, msg)   anno(stream, msg, 0)    /* Cur rec */
 #define        annofile(stream, msg)   anno(stream, msg, 1)    /* Saved rec */
+#endif