# 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.
# 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@
/* 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
--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 ;;
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
AC_TYPE_SIZE_T
AC_STRUCT_ST_RDEV
+dnl Checks for headers
+AC_HEADER_SYS_WAIT
+
AC_OUTPUT(Makefile config.h)
0 leshort 0x602 ALAN text adventure code data
>2 byte <10 version 2.6%d
+# Conflicts with too much other stuff!
# Infocom
-0 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
# 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
>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
>>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
# 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
#
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
#
# 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
>>>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>
#
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
# 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
+# 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:
# 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).
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}
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)
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
# 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.
# 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
#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) && \
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;
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[] =
#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 */
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*/
#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 */
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 */
static short byteconv2 __P((int, int, int));
#endif
+int main __P((int, char *[]));
+
/*
* main - parse arguments and handle options
*/
/*
* 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.
# 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 *));
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 */
*
* 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",
"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},
{"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)
#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]))
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);
#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
* 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;
/*
* 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.
#define ELFMAG3 'F'
#define ELFMAG "\177ELF"
+#define OLFMAG1 'O'
+#define OLFMAG "\177OLF"
+
typedef struct {
Elf32_Word p_type;
Elf32_Off p_offset;
*
* 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
*/
/*
TAR_EXTERN char read_error_flag;
+#if 0
/*
* Declarations of functions available to the world.
*/
void anno();
#define annorec(stream, msg) anno(stream, msg, 0) /* Cur rec */
#define annofile(stream, msg) anno(stream, msg, 1) /* Saved rec */
+#endif