Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/dist/file conflict therapy
details: https://anonhg.NetBSD.org/src/rev/fa829543ac73
branches: trunk
changeset: 569996:fa829543ac73
user: pooka <pooka%NetBSD.org@localhost>
date: Thu Sep 16 13:49:07 2004 +0000
description:
conflict therapy
diffstat:
dist/file/configure | 2 +-
dist/file/configure.in | 2 +-
dist/file/doc/file.1 | 4 +-
dist/file/doc/magic.5 | 4 +-
dist/file/file2netbsd | 4 +-
dist/file/magic/Makefile.in | 4 +-
dist/file/magic/magdir/audio | 32 ++++++++++++++--
dist/file/magic/magdir/sgi | 24 ++++++------
dist/file/src/apprentice.c | 83 ++++++++++++++++++++++++++++++++++++++-----
dist/file/src/file.c | 6 +-
dist/file/src/file.h | 48 ++++++++++++++++++++++++-
dist/file/src/magic.c | 8 ++-
dist/file/src/readelf.c | 52 +++++++++++++++++++-------
13 files changed, 215 insertions(+), 58 deletions(-)
diffs (truncated from 608 to 300 lines):
diff -r a0f2b5078400 -r fa829543ac73 dist/file/configure
--- a/dist/file/configure Thu Sep 16 13:43:21 2004 +0000
+++ b/dist/file/configure Thu Sep 16 13:49:07 2004 +0000
@@ -1555,7 +1555,7 @@
# Define the identity of the package.
PACKAGE=file
- VERSION=4.09
+ VERSION=4.10
cat >>confdefs.h <<_ACEOF
diff -r a0f2b5078400 -r fa829543ac73 dist/file/configure.in
--- a/dist/file/configure.in Thu Sep 16 13:43:21 2004 +0000
+++ b/dist/file/configure.in Thu Sep 16 13:49:07 2004 +0000
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/file.c)
-AM_INIT_AUTOMAKE(file, 4.09)
+AM_INIT_AUTOMAKE(file, 4.10)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
diff -r a0f2b5078400 -r fa829543ac73 dist/file/doc/file.1
--- a/dist/file/doc/file.1 Thu Sep 16 13:43:21 2004 +0000
+++ b/dist/file/doc/file.1 Thu Sep 16 13:49:07 2004 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: file.1,v 1.8 2004/04/08 12:29:45 pooka Exp $
+.\" $NetBSD: file.1,v 1.9 2004/09/16 13:49:07 pooka Exp $
.\"
.TH FILE 1 "Copyright but distributable"
.\" Id: file.man,v 1.54 2003/10/27 18:09:08 christos Exp
@@ -31,7 +31,7 @@
.B \-m
magicfile ]
.SH DESCRIPTION
-This manual page documents version 4.09 of the
+This manual page documents version 4.10 of the
.B file
command.
.PP
diff -r a0f2b5078400 -r fa829543ac73 dist/file/doc/magic.5
--- a/dist/file/doc/magic.5 Thu Sep 16 13:43:21 2004 +0000
+++ b/dist/file/doc/magic.5 Thu Sep 16 13:49:07 2004 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: magic.5,v 1.8 2004/04/08 12:29:45 pooka Exp $
+.\" $NetBSD: magic.5,v 1.9 2004/09/16 13:49:07 pooka Exp $
.\"
.TH MAGIC 5 "Public Domain"
.\" install as magic.4 on USG, magic.5 on V7 or Berkeley systems.
@@ -8,7 +8,7 @@
This manual page documents the format of the magic file as
used by the
.BR file (1)
-command, version 4.09.
+command, version 4.10.
The
.BR file
command identifies the type of a file using,
diff -r a0f2b5078400 -r fa829543ac73 dist/file/file2netbsd
--- a/dist/file/file2netbsd Thu Sep 16 13:43:21 2004 +0000
+++ b/dist/file/file2netbsd Thu Sep 16 13:49:07 2004 +0000
@@ -1,6 +1,6 @@
#! /bin/sh
#
-# $NetBSD: file2netbsd,v 1.9 2004/04/08 12:30:24 pooka Exp $
+# $NetBSD: file2netbsd,v 1.10 2004/09/16 13:49:07 pooka Exp $
#
# Copyright (c) 2003 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -41,7 +41,7 @@
#
# edit this
-file_vers='4.09'
+file_vers='4.10'
#
# (usually) NO NEED TO EDIT BELOW THIS LINE
diff -r a0f2b5078400 -r fa829543ac73 dist/file/magic/Makefile.in
--- a/dist/file/magic/Makefile.in Thu Sep 16 13:43:21 2004 +0000
+++ b/dist/file/magic/Makefile.in Thu Sep 16 13:49:07 2004 +0000
@@ -160,6 +160,7 @@
Magdir/citrus \
Magdir/claris \
Magdir/clipper \
+Magdir/spec \
Magdir/commands \
Magdir/communications \
Magdir/compress \
@@ -218,6 +219,7 @@
Magdir/mail.news \
Magdir/maple \
Magdir/mathematica \
+Magdir/matroska \
Magdir/mcrypt \
Magdir/mime \
Magdir/mips \
@@ -491,7 +493,7 @@
$(top_builddir)/src/file -C -m magic
magic.mime.mgc: magic.mime
- $(top_builddir)/src/file -C -m magic.mime
+ $(top_builddir)/src/file -C -m $(srcdir)/magic.mime
# 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.
.NOEXPORT:
diff -r a0f2b5078400 -r fa829543ac73 dist/file/magic/magdir/audio
--- a/dist/file/magic/magdir/audio Thu Sep 16 13:43:21 2004 +0000
+++ b/dist/file/magic/magdir/audio Thu Sep 16 13:49:07 2004 +0000
@@ -15,11 +15,21 @@
>12 belong 5 32-bit linear PCM,
>12 belong 6 32-bit IEEE floating point,
>12 belong 7 64-bit IEEE floating point,
+>12 belong 8 Fragmented sample data,
+>12 belong 10 DSP program,
+>12 belong 11 8-bit fixed point,
+>12 belong 12 16-bit fixed point,
+>12 belong 13 24-bit fixed point,
+>12 belong 14 32-bit fixed point,
+>12 belong 18 16-bit linear with emphasis,
+>12 belong 19 16-bit linear compressed,
+>12 belong 20 16-bit linear with emphasis and compression,
+>12 belong 21 Music kit DSP commands,
>12 belong 23 8-bit ISDN mu-law compressed (CCITT G.721 ADPCM voice data encoding),
->12 belong 24 compressed (8-bit G.722 ADPCM)
->12 belong 25 compressed (3-bit G.723 ADPCM),
->12 belong 26 compressed (5-bit G.723 ADPCM),
->12 belong 27 8-bit A-law,
+>12 belong 24 compressed (8-bit CCITT G.722 ADPCM)
+>12 belong 25 compressed (3-bit CCITT G.723.3 ADPCM),
+>12 belong 26 compressed (5-bit CCITT G.723.5 ADPCM),
+>12 belong 27 8-bit A-law (CCITT G.711),
>20 belong 1 mono,
>20 belong 2 stereo,
>20 belong 4 quad,
@@ -35,7 +45,21 @@
>12 lelong 5 32-bit linear PCM,
>12 lelong 6 32-bit IEEE floating point,
>12 lelong 7 64-bit IEEE floating point,
+>12 belong 8 Fragmented sample data,
+>12 belong 10 DSP program,
+>12 belong 11 8-bit fixed point,
+>12 belong 12 16-bit fixed point,
+>12 belong 13 24-bit fixed point,
+>12 belong 14 32-bit fixed point,
+>12 belong 18 16-bit linear with emphasis,
+>12 belong 19 16-bit linear compressed,
+>12 belong 20 16-bit linear with emphasis and compression,
+>12 belong 21 Music kit DSP commands,
>12 lelong 23 8-bit ISDN mu-law compressed (CCITT G.721 ADPCM voice data encoding),
+>12 belong 24 compressed (8-bit CCITT G.722 ADPCM)
+>12 belong 25 compressed (3-bit CCITT G.723.3 ADPCM),
+>12 belong 26 compressed (5-bit CCITT G.723.5 ADPCM),
+>12 belong 27 8-bit A-law (CCITT G.711),
>20 lelong 1 mono,
>20 lelong 2 stereo,
>20 lelong 4 quad,
diff -r a0f2b5078400 -r fa829543ac73 dist/file/magic/magdir/sgi
--- a/dist/file/magic/magdir/sgi Thu Sep 16 13:43:21 2004 +0000
+++ b/dist/file/magic/magdir/sgi Thu Sep 16 13:49:07 2004 +0000
@@ -7,34 +7,34 @@
# Performance Co-Pilot file types
0 string PmNs PCP compiled namespace (V.0)
0 string PmN PCP compiled namespace
->3 lelong x (V.%1.1s)
+>3 string >\0 (V.%1.1s)
3 lelong 0x84500526 PCP archive
>7 byte x (V.%d)
>20 lelong -2 temporal index
>20 lelong -1 metadata
>20 lelong 0 log volume #0
>20 lelong >0 log volume #%ld
->24 lelong x host: %s
+>24 string >\0 host: %s
0 string PCPFolio PCP
>9 string Version: Archive Folio
->18 lelong x (V.%s)
+>18 string >\0 (V.%s)
0 string #pmchart PCP pmchart view
>9 string Version
->17 lelong x (V%-3.3s)
+>17 string >\0 (V%-3.3s)
0 string pmview PCP pmview config
>7 string Version
->15 lelong x (V%-3.3s)
+>15 string >\0 (V%-3.3s)
0 string #pmlogger PCP pmlogger config
>10 string Version
->18 lelong x (V%1.1s)
+>18 string >\0 (V%1.1s)
0 string PcPh PCP Help
>4 string 1 Index
>4 string 2 Text
->5 lelong x (V.%1.1s)
+>5 string >\0 (V.%1.1s)
0 string #pmieconf-rules PCP pmieconf rules
->16 lelong x (V.%1.1s)
+>16 string >\0 (V.%1.1s)
3 string pmieconf-pmie PCP pmie config
->17 lelong x (V.%1.1s)
+>17 string >\0 (V.%1.1s)
# SpeedShop data files
0 lelong 0x13130303 SpeedShop data file
@@ -50,10 +50,10 @@
# Alias|Wavefront Maya files
0 string //Maya ASCII Alias|Wavefront Maya Ascii File,
->13 lelong x version %s
+>13 string >\0 version %s
8 string MAYAFOR4 Alias|Wavefront Maya Binary File,
->32 lelong x version %s scene
+>32 string >\0 version %s scene
8 string MayaFOR4 Alias|Wavefront Maya Binary File,
->32 lelong x version %s scene
+>32 string >\0 version %s scene
8 string CIMG Alias|Wavefront Maya Image File
8 string DEEP Alias|Wavefront Maya Image File
diff -r a0f2b5078400 -r fa829543ac73 dist/file/src/apprentice.c
--- a/dist/file/src/apprentice.c Thu Sep 16 13:43:21 2004 +0000
+++ b/dist/file/src/apprentice.c Thu Sep 16 13:49:07 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: apprentice.c,v 1.4 2004/03/23 08:40:12 pooka Exp $ */
+/* $NetBSD: apprentice.c,v 1.5 2004/09/16 13:49:07 pooka Exp $ */
/*
* Copyright (c) Ian F. Darwin 1986-1995.
@@ -53,9 +53,9 @@
#ifndef lint
#if 0
-FILE_RCSID("@(#)Id: apprentice.c,v 1.75 2004/03/22 18:48:56 christos Exp")
+FILE_RCSID("@(#)Id: apprentice.c,v 1.78 2004/07/24 20:38:56 christos Exp")
#else
-__RCSID("$NetBSD: apprentice.c,v 1.4 2004/03/23 08:40:12 pooka Exp $");
+__RCSID("$NetBSD: apprentice.c,v 1.5 2004/09/16 13:49:07 pooka Exp $");
#endif
#endif /* lint */
@@ -102,14 +102,12 @@
const char *);
private int apprentice_compile(struct magic_set *, struct magic **, uint32_t *,
const char *);
+private int check_format(struct magic *);
private size_t maxmagic = 0;
private size_t magicsize = sizeof(struct magic);
#ifdef COMPILE_ONLY
-const char *magicfile;
-char *progname;
-int lineno;
int main(int, char *[]);
@@ -117,6 +115,8 @@
main(int argc, char *argv[])
{
int ret;
+ struct magic_set *ms;
+ char *progname;
if ((progname = strrchr(argv[0], '/')) != NULL)
progname++;
@@ -124,12 +124,19 @@
progname = argv[0];
if (argc != 2) {
- (void)fprintf(stderr, "usage: %s file\n", progname);
- exit(1);
+ (void)fprintf(stderr, "Usage: %s file\n", progname);
+ return 1;
}
- magicfile = argv[1];
- exit(file_apprentice(magicfile, COMPILE, MAGIC_CHECK) == -1 ? 1 : 0);
+ if ((ms = magic_open(MAGIC_CHECK)) == NULL) {
+ (void)fprintf(stderr, "%s: %s\n", progname, strerror(errno));
+ return 1;
+ }
+ ret = magic_compile(ms, argv[1]) == -1 ? 1 : 0;
+ if (ret == 1)
+ (void)fprintf(stderr, "%s: %s\n", progname, magic_error(ms));
+ magic_close(ms);
+ return ret;
}
#endif /* COMPILE_ONLY */
@@ -212,6 +219,7 @@
break;
case 1:
p--;
+ /*FALLTHROUGH*/
case 0:
free(p);
break;
@@ -710,6 +718,10 @@
while ((m->desc[i++] = *l++) != '\0' && i < MAXDESC)
/* NULLBODY */;
Home |
Main Index |
Thread Index |
Old Index