Import NetBSD file(1)

This commit is contained in:
Ben Gras 2012-03-31 20:24:03 +02:00
parent adb4e9428a
commit ef01931f76
304 changed files with 81554 additions and 319 deletions

View file

@ -10,7 +10,7 @@ SUBDIR= add_route arp ash at awk \
comm compress cp crc cron crontab cut \
dd decomp16 DESCRIBE dev2name devsize df dhcpd \
dhrystone diff dirname diskctl dumpcore \
eject elvis env expand factor fbdctl file \
eject elvis env expand factor fbdctl \
find finger fingerd fix fold format fortune fsck.mfs \
ftp101 gcore gcov-pull getty grep head hexdump host \
hostaddr id ifconfig ifdef install \

View file

@ -1,4 +0,0 @@
PROG= file
MAN=
.include <bsd.prog.mk>

View file

@ -1,286 +0,0 @@
/* file - report on file type. Author: Andy Tanenbaum */
/* Magic number detection changed to look-up table 08-Jan-91 - ajm */
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#define BLOCK_SIZE 1024
#define XBITS 00111 /* rwXrwXrwX (x bits in the mode) */
#define ENGLISH 25 /* cutoff for determining if text is Eng. */
unsigned char buf[BLOCK_SIZE];
struct info {
int execflag; /* 1 == ack executable, 2 == gnu executable,
* 3 == core, 4 == elf executable */
unsigned char magic[4]; /* First four bytes of the magic number */
unsigned char mask[4]; /* Mask to apply when matching */
char *description; /* What it means */
} table[] = {
0x00, 0x1f, 0x9d, 0x8d, 0x00, 0xff, 0xff, 0xff, 0x00,
"13-bit compressed file",
0x00, 0x1f, 0x9d, 0x90, 0x00, 0xff, 0xff, 0xff, 0x00,
"16-bit compressed file",
0x00, 0x65, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
"MINIX-PC bcc archive",
0x00, 0x2c, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
"ACK object archive",
0x00, 0x65, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
"MINIX-PC ack archive",
0x00, 0x47, 0x6e, 0x75, 0x20, 0xff, 0xff, 0xff, 0xff,
"MINIX-68k gnu archive",
0x00, 0x21, 0x3c, 0x61, 0x72, 0xff, 0xff, 0xff, 0xff,
"MINIX-PC gnu archive",
0x00, 0x01, 0x02, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
"ACK object file",
0x00, 0xa3, 0x86, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
"MINIX-PC bcc object file",
0x00, 0x00, 0x00, 0x01, 0x07, 0xff, 0xff, 0xff, 0xff,
"MINIX-68k gnu object file",
0x00, 0x07, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
"MINIX-PC gnu object file",
0x01, 0x01, 0x03, 0x00, 0x04, 0xff, 0xff, 0x00, 0xff,
"MINIX-PC 16-bit executable",
0x01, 0x01, 0x03, 0x00, 0x10, 0xff, 0xff, 0x00, 0xff,
"MINIX-PC 32-bit executable",
0x01, 0x04, 0x10, 0x03, 0x01, 0xff, 0xff, 0xff, 0xff,
"MINIX-68k old style executable",
0x01, 0x01, 0x03, 0x10, 0x0b, 0xff, 0xff, 0xff, 0xff,
"MINIX-68k new style executable",
0x02, 0x0b, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
"MINIX-PC 32-bit gnu executable combined I & D space",
0x02, 0x00, 0x00, 0x0b, 0x01, 0xff, 0xff, 0xff, 0xff,
"MINIX-68k gnu executable",
0x03, 0x82, 0x12, 0xC4, 0xC0, 0xff, 0xff, 0xff, 0xff,
"core file",
0x04, 0x7F, 0x45, 0x4C, 0x46, 0xff, 0xff, 0xff, 0xff,
"ELF executable",
};
int tabsize = sizeof(table) / sizeof(struct info);
int L_flag;
int main(int argc, char **argv);
void file(char *name);
void do_strip(int type);
void usage(void);
int main(argc, argv)
int argc;
char *argv[];
{
/* This program uses some heuristics to try to guess about a file type by
* looking at its contents.
*/
int c, i;
L_flag= 0;
while ((c= getopt(argc, argv, "L?")) != -1)
{
switch(c)
{
case 'L':
L_flag= 1;
break;
case '?':
usage();
default:
fprintf(stderr, "file: panic getopt failed\n");
exit(1);
}
}
if (optind >= argc) usage();
for (i = optind; i < argc; i++) file(argv[i]);
return(0);
}
void file(name)
char *name;
{
int i, fd, n, mode, nonascii, special, funnypct, etaoins;
int j;
long engpct;
int c;
struct stat st_buf;
printf("%s: ", name);
#ifdef S_IFLNK
if (!L_flag)
n = lstat(name, &st_buf);
else
n = stat(name, &st_buf);
#else
n = stat(name, &st_buf);
#endif
if (n < 0) {
printf("cannot stat\n");
return;
}
mode = st_buf.st_mode;
/* Check for directories and special files. */
if (S_ISDIR(mode)) {
printf("directory\n");
return;
}
if (S_ISCHR(mode)) {
printf("character special file\n");
return;
}
if (S_ISBLK(mode)) {
printf("block special file\n");
return;
}
if (S_ISFIFO(mode)) {
printf("named pipe\n");
return;
}
#ifdef S_IFLNK
if (S_ISLNK(mode)) {
n= readlink(name, (char *)buf, BLOCK_SIZE);
if (n == -1)
printf("cannot readlink\n");
else
printf("symbolic link to %.*s\n", n, buf);
return;
}
#endif
if (!S_ISREG(mode)) {
printf("strange file type %5o\n", mode);
return;
}
/* Open the file, stat it, and read in 1 block. */
fd = open(name, O_RDONLY);
if (fd < 0) {
printf("cannot open\n");
return;
}
n = read(fd, (char *)buf, BLOCK_SIZE);
if (n < 0) {
printf("cannot read\n");
close(fd);
return;
}
if (n == 0) { /* must check this, for loop will fail otherwise !! */
printf("empty file\n");
close(fd);
return;
}
for (i = 0; i < tabsize; i++) {
for (j = 0; j < 4; j++)
if ((buf[j] & table[i].mask[j]) != table[i].magic[j])
break;
if (j == 4) {
printf("%s", table[i].description);
do_strip(table[i].execflag);
close(fd);
return;
}
}
/* Check to see if file is a shell script. */
if (mode & XBITS) {
/* Not a binary, but executable. Probably a shell script. */
printf("shell script\n");
close(fd);
return;
}
/* Check for ASCII data and certain punctuation. */
nonascii = 0;
special = 0;
etaoins = 0;
for (i = 0; i < n; i++) {
c = buf[i];
if (c & 0200) nonascii++;
if (c == ';' || c == '{' || c == '}' || c == '#') special++;
if (c == '*' || c == '<' || c == '>' || c == '/') special++;
if (c >= 'A' && c <= 'Z') c = c - 'A' + 'a';
if (c == 'e' || c == 't' || c == 'a' || c == 'o') etaoins++;
if (c == 'i' || c == 'n' || c == 's') etaoins++;
}
if (nonascii == 0) {
/* File only contains ASCII characters. Continue processing. */
funnypct = 100 * special / n;
engpct = 100L * (long) etaoins / n;
if (funnypct > 1) {
printf("C program\n");
} else {
if (engpct > (long) ENGLISH)
printf("English text\n");
else
printf("ASCII text\n");
}
close(fd);
return;
}
/* Give up. Call it data. */
printf("data\n");
close(fd);
return;
}
void do_strip(type)
int type;
{
if (type == 1) { /* Non-GNU executable */
if (buf[2] & 1)
printf(", UZP");
if (buf[2] & 2)
printf(", PAL");
if (buf[2] & 4)
printf(", NSYM");
if (buf[2] & 0x20)
printf(", sep I&D");
else
printf(", comm I&D");
if (( buf[28] | buf[29] | buf[30] | buf[31]) != 0)
printf(" not stripped\n");
else
printf(" stripped\n");
return;
}
if (type == 2) { /* GNU format executable */
if ((buf[16] | buf[17] | buf[18] | buf[19]) != 0)
printf(" not stripped\n");
else
printf(" stripped\n");
return;
}
if (type == 3) { /* Core file in <sys/core.h> format */
switch(buf[36] & 0xff)
{
case 1: printf(" of i86 executable"); break;
case 2: printf(" of i386 executable"); break;
default:printf(" of unknown executable"); break;
}
printf(" '%.32s'\n", buf+4);
return;
}
if (type == 4) { /* ELF executable */
printf("\n");
return;
}
printf("\n"); /* Not an executable file */
}
void usage()
{
printf("Usage: file [-L] name ...\n");
exit(1);
}

View file

@ -1,3 +1,3 @@
.include <bsd.own.mk>
SUBDIR=mdocml
SUBDIR=mdocml file
.include <bsd.subdir.mk>

5
external/bsd/file/Makefile vendored Normal file
View file

@ -0,0 +1,5 @@
# $NetBSD: Makefile,v 1.1 2009/05/08 17:43:54 christos Exp $
SUBDIR= lib .WAIT bin
.include <bsd.subdir.mk>

20
external/bsd/file/Makefile.inc vendored Normal file
View file

@ -0,0 +1,20 @@
# $NetBSD: Makefile.inc,v 1.3 2009/05/08 23:36:42 christos Exp $
DIST=${.CURDIR}/../dist
WARNS=4
BINDIR?= /usr/bin
USE_FORT?= yes # data-driven bugs?
TOOL_MKMAGIC?= ${.OBJDIR}/file
MFILESDIR?= /usr/share/misc
MFILES?= magic.mgc
MAGIC?= ${MFILESDIR}/magic
# -DQUICK
CPPFLAGS+= -DMAGIC='"${MAGIC}"' -DHAVE_CONFIG_H -DBUILTIN_ELF \
-DELFCORE
CPPFLAGS+= -I${.CURDIR}/../include -I${DIST}/src
.PATH: ${DIST}/src ${DIST}/doc

33
external/bsd/file/bin/Makefile vendored Normal file
View file

@ -0,0 +1,33 @@
# $NetBSD: Makefile,v 1.1 2009/05/08 17:28:01 christos Exp $
.include <bsd.own.mk>
.include <bsd.sys.mk>
.include "../Makefile.inc"
.if ${MKSHARE} != "no"
FILESDIR= ${MFILESDIR}
FILES= ${MFILES}
.endif
PROG= file
LDADD+= -L../lib -lmagic -lz
DPADD+= ${LIBMAGIC} ${LIBZ}
MAN= file.1 magic.5
CLEANFILES+= magic.mgc
.if ${MKSHARE} != "no"
realall: file magic.mgc
.endif
.if ${MKSHARE} != "no"
magic.mgc: ${PROG}
${_MKTARGET_CREATE}
${.CURDIR}/${PROG} -C -m ${DIST}/magic/magdir
@mv magdir.mgc ${.TARGET}
.else
magic.mgc:
.endif
.include <bsd.prog.mk>

1
external/bsd/file/dist/AUTHORS vendored Normal file
View file

@ -0,0 +1 @@
See COPYING.

29
external/bsd/file/dist/COPYING vendored Normal file
View file

@ -0,0 +1,29 @@
$File: COPYING,v 1.1 2008/02/05 19:08:11 christos Exp $
Copyright (c) Ian F. Darwin 1986, 1987, 1989, 1990, 1991, 1992, 1994, 1995.
Software written by Ian F. Darwin and others;
maintained 1994- Christos Zoulas.
This software is not subject to any export provision of the United States
Department of Commerce, and may be exported to any country or planet.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice immediately at the beginning of the file, without modification,
this list of conditions, and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

847
external/bsd/file/dist/ChangeLog vendored Normal file
View file

@ -0,0 +1,847 @@
2009-05-06 10:25 Christos Zoulas <christos@zoulas.com>
* Avoid null dereference in cdf code (Drew Yao)
* More cdf bounds checks and overflow checks
2009-05-01 18:37 Christos Zoulas <christos@zoulas.com>
* Buffer overflow fixes from Drew Yao
2009-04-30 17:10 Christos Zoulas <christos@zoulas.com>
* Fix more cdf lossage. All the documents I have
right now print the correct information.
2009-03-27 18:43 Christos Zoulas <christos@zoulas.com>
* don't print \012- separators in the same magic entry
if it consists of multiple magic printing lines.
2009-03-23 10:20 Christos Zoulas <christos@zoulas.com>
* Avoid file descriptor leak in compress code from
(Daniel Novotny)
2009-03-18 16:50 Christos Zoulas <christos@zoulas.com>
* Allow escaping of relation characters, so that we can say \^[A-Z]
and the ^ is not eaten as a relation char.
* Fix troff and fortran to their previous glory using
regex. This was broken since their removel from ascmagic.
2009-03-10 16:50 Christos Zoulas <christos@zoulas.com>
* don't use strlen in strndup() (Toby Peterson)
2009-03-10 7:45 Christos Zoulas <christos@zoulas.com>
* avoid c99 syntax.
2009-02-23 15:45 Christos Zoulas <christos@zoulas.com>
* make the cdf code use the buffer first if available,
and then the fd code.
2009-02-13 13:45 Christos Zoulas <christos@zoulas.com>
* look for struct option to determine if getopt.h is usable for IRIX.
* sanitize cdf document strings
2009-02-04 13:25 Christos Zoulas <christos@zoulas.com>
* fix OS/2 warnings.
2008-12-12 15:50 Christos Zoulas <christos@zoulas.com>
* fix initial offset calculation for non 4K sector files
* add loop limits to avoid DoS attacks by constructing
looping sector references.
2008-12-03 13:05 Christos Zoulas <christos@zoulas.com>
* fix memory botches on cdf file parsing.
* exit with non-zero value for any error, not just for the last
file processed.
2008-11-09 20:42 Charles Longeau <chl@tuxfamily.org>
* Replace all str{cpy,cat} functions with strl{cpy,cat}
* Ensure that strl{cpy,cat} are included in libmagic,
as needed.
2008-11-06 18:18 Christos Zoulas <christos@zoulas.com>
* Handle ID3 format files.
2008-11-06 23:00 Reuben Thomas <rrt@sc3d.org>
* Fix --mime, --mime-type and --mime-encoding under new scheme.
* Rename "ascii" to "text" and add "encoding" test.
* Return a precise ("utf-16le" or "utf-16be") MIME charset for
UTF-16.
* Fix error in comment caused by automatic indentation adding
words!
2008-11-06 10:35 Christos Zoulas <christos@astron.com>
* use memchr instead of strchr because the string
might not be NUL terminated (Scott MacVicar)
2008-11-03 07:31 Reuben Thomas <rrt@sc3d.org>
* Fix a printf with a non-literal format string.
* Fix formatting and punctuation of help for "--apple".
2008-10-30 11:00 Reuben Thomas <rrt@sc3d.org>
* Correct words counts in comments of struct magic.
* Fix handle_annotation to allow both Apple and MIME types to be
printed, and to return correct code if MIME type is
printed (1, not 0) or if there's an error (-1 not 1).
* Fix output of charset for MIME type (precede with semi-colon;
fixes Debian bug #501460).
* Fix potential attacks via conversion specifications in magic
strings.
* Add a FIXME for Debian bug #488562 (magic files should be
read in a defined order, by sorting the names).
2008-10-18 16:45 Christos Zoulas <christos@astron.com>
* Added APPLE file creator/type
2008-10-12 10:20 Christos Zoulas <christos@astron.com>
* Added CDF parsing
2008-10-09 16:40 Christos Zoulas <christos@astron.com>
* filesystem and msdos patches (Joerg Jenderek)
2008-10-09 13:20 Christos Zoulas <christos@astron.com>
* correct --exclude documentation issues: remove troff and fortran
and rename "token" to "tokens". (Randy McMurchy)
2008-10-01 10:30 Christos Zoulas <christos@astron.com>
* Read ~/.magic in addition to the default magic file not instead
of, as documented in the man page.
2008-09-10 21:30 Reuben Thomas <rrt@sc3d.org>
* Comment out graphviz patterns, as they match too many files.
2008-08-30 12:54 Christos Zoulas <christos@astron.com>
* Don't eat trailing \n in magic enties.
* Cast defines to allow compilation using a c++ compiler.
2008-08-25 23:56 Reuben Thomas <rrt@sc3d.org>
* Add text/x-lua MIME type for Lua scripts.
* Escape { in regex in graphviz patterns.
2008-07-26 00:59 Reuben Thomas <rrt@sc3d.org>
* Add MIME types for special files.
* Use access to give more accurate information for files that
can't be opened.
* Add a TODO list.
2008-07-02 11:15 Christos Zoulas <christos@astron.com>
* add !:strength op to adjust magic strength (experimental)
2008-06-16 21:41 Reuben Thomas <rrt@sc3d.org>
* Fix automake error in configure.ac.
* Add MIME type for Psion Sketch files.
2008-06-05 08:59 Christos Zoulas <christos@astron.com>
* Don't print warnings about bad namesize in stripped
binaries with PT_NOTE is still there, and the actual
note is gone (Jakub Jelinek)
2008-05-28 15:12 Robert Byrnes <byrnes@wildpumpkin.net>
* magic/Magdir/elf:
Note invalid byte order for little-endian SPARC32PLUS.
Add SPARC V9 vendor extensions and memory model.
* src/elfclass.h:
Pass target machine to doshn (for Solaris hardware capabilities).
* src/readelf.c (doshn):
Add support for Solaris hardware/software capabilities.
* src/readelf.h:
Ditto.
* src/vasprintf.c (dispatch):
Add support for ll modifier.
2008-05-16 10:25 Christos Zoulas <christos@astron.com>
* Fix compiler warnings.
* remove stray printf, and fix a vprintf bug. (Martin Dorey)
2008-05-06 00:13 Robert Byrnes <byrnes@wildpumpkin.net>
* src/Makefile.am:
Ensure that getopt_long and [v]asprintf are included in libmagic,
as needed.
Remove unnecessary EXTRA_DIST.
* src/Makefile.in:
Rerun automake.
* src/vasprintf.c (dispatch):
Fix variable precision bug: be sure to step past '*'.
* src/vasprintf.c (core):
Remove unreachable code.
* src/apprentice.c (set_test_type):
Add cast to avoid compiler warning.
2008-04-22 23:45 Christos Zoulas <christos@astron.com>
* Add magic submission guidelines (Abel Cheung)
* split msdos and windows magic (Abel Cheung)
2008-04-04 11:00 Christos Zoulas <christos@astron.com>
* >= <= is not supported, so fix the magic and warn about it.
reported by: Thien-Thi Nguyen <ttn@gnuvola.org>
2008-03-27 16:16 Robert Byrnes <byrnes@wildpumpkin.net>
* src/readelf.c (donote):
ELF core file command name/line bug fixes and enhancements:
Try larger offsets first to avoid false matches
from earlier data that happen to look like strings;
this primarily affected SunOS 5.x 32-bit Intel core files.
Add support for command line (instead of just short name)
for SunOS 5.x.
Add information about NT_PSINFO for SunOS 5.x.
Only trim whitespace from end of command line.
2007-02-11 01:36 Reuben Thomas <rrt@sc3d.org>
* Change strength of ! from MULT to 0, as it matches almost
anything (Reuben Thomas)
* Debian fixes (Reuben Thomas)
2007-02-11 00:17 Reuben Thomas <rrt@sc3d.org>
* Clarify UTF-8 BOM message (Reuben Thomas)
* Add HTML comment to token list in names.h
2007-02-04 15:50 Christos Zoulas <christos@astron.com>
* Debian fixes (Reuben Thomas)
2007-02-04 11:31 Christos Zoulas <christos@astron.com>
* !:mime annotations in magic files (Reuben Thomas)
2007-01-29 15:35 Christos Zoulas <christos@astron.com>
* zero out utime/utimes structs (Gavin Atkinson)
2007-01-26 13:45 Christos Zoulas <christos@astron.com>
* reduce writable data from Diego "Flameeyes" Petten
2007-12-28 15:06 Christos Zoulas <christos@astron.com>
* strtof detection
* remove bogus regex magic that could cause a DoS
* better mismatch version message
2007-12-27 11:35 Christos Zoulas <christos@astron.com>
* bring back some fixes from OpenBSD
* treat ELF dynamic objects as executables
* fix gcc warnings
2007-12-01 19:55 Christos Zoulas <christos@astron.com>
* make sure we have zlib.h and libz to compile the builtin
decompress code
2007-10-28 20:48 Christos Zoulas <christos@astron.com>
* float and double magic support (Behan Webster)
2007-10-28 20:48 Christos Zoulas <christos@astron.com>
* Convert fortran to a soft test (Reuben Thomas)
2007-10-23 5:25 Christos Zoulas <christos@astron.com>
* Add --with-filename, and --no-filename (Reuben Thomas)
2007-10-23 3:59 Christos Zoulas <christos@astron.com>
* Rest of the mime split (Reuben Thomas)
* Make usage message generated from the flags so that
they stay consistent (Reuben Thomas)
2007-10-20 3:06 Christos Zoulas <christos@astron.com>
* typo in comment, missing ifdef QUICK, remove unneeded code
(Charles Longeau)
2007-10-17 3:33 Christos Zoulas <christos@astron.com>
* Fix problem printing -\012 in some entries
* Separate magic type and encoding flags (Reuben Thomas)
2007-10-09 3:55 Christos Zoulas <christos@astron.com>
* configure fix for int64 and strndup (Reuben Thomas)
2007-09-26 4:45 Christos Zoulas <christos@astron.com>
* Add magic_descriptor() function.
* Fix regression in elf reading code where the core name was
not being printed.
* Don't convert NUL's to spaces in {l,b}estring16 (Daniel Dawson)
2007-08-19 6:30 Christos Zoulas <christos@astron.com>
* Make mime format consistent so that it can
be easily parsed:
mimetype [charset=character-set] [encoding=encoding-mime-type]
Remove spurious extra text from some MIME type printouts
(mostly in is_tar).
Fix one case where -i produced nothing at all (for a 1-byte file,
which is now classed as application/octet-stream).
Remove 7/8bit classifications, since they were arbitrary
and not based on the file data.
This work was done by Reuben Thomas
2007-05-24 10:00 Christos Zoulas <christos@astron.com>
* Fix another integer overflow (Colin Percival)
2007-03-26 13:58 Christos Zoulas <christos@astron.com>
* make sure that all of struct magic_set is initialized appropriately
(Brett)
2007-03-25 17:44 Christos Zoulas <christos@astron.com>
* reset left bytes in the buffer (Dmitry V. Levin)
* compilation failed with COMPILE_ONLY and ENABLE_CONDITIONALS
(Peter Avalos)
2007-03-15 10:51 Christos Zoulas <christos@astron.com>
* fix fortran and nroff reversed tests (Dmitry V. Levin)
* fix exclude option (Dmitry V. Levin)
2007-02-08 17:30 Christos Zoulas <christos@astron.com>
* fix integer underflow in file_printf which can lead to
to exploitable heap overflow (Jean-Sebastien Guay-Lero)
2007-02-05 11:35 Christos Zoulas <christos@astron.com>
* make socket/pipe reading more robust
2007-01-25 16:01 Christos Zoulas <christos@astron.com>
* Centralize all the tests in file_buffer.
* Add exclude flag.
2007-01-18 05:29 Anon Ymous <do@not.spam.me>
* Move the "type" detection code from parse() into its own table
driven routine. This avoids maintaining multiple lists in
file.h.
* Add an optional conditional field (ust before the type field).
This code is wrapped in "#ifdef ENABLE_CONDITIONALS" as it is
likely to go away.
2007-01-16 23:24 Anon Ymous <do@not.spam.me>
* Fix an initialization bug in check_mem().
2007-01-16 14:58 Anon Ymous <do@not.spam.me>
* Add a "default" type to print a message if nothing previously
matched at that level or since the last default at that
level. This is useful for setting up switch-like statements.
It can also be used to do if/else constructions without a
redundant second test.
* Fix the "x" special case test so that one can test for that
string with "=x".
* Allow "search" to search the entire buffer if the "/N"
search count is missing.
* Make "regex" work! It now starts its search at the
specified offset and takes an (optional) "/N" line count to
specify the search range; otherwise it searches to the end
of the file. The match is now grabbed correctly for format
strings and the offset set to the end of the match.
* Add a "/s" flag to "regex" and "search" to set the offset to
the start of the match. By default the offset is set to the
end of the match, as it is with other tests. This is mostly
useful for "regex".
* Make "search", "string" and "pstring" use the same
file_strncmp() routine so that they support the same flags;
"bestring16" and "lestring16" call the same routine, but
with flags = 0. Also add a "/C" flag (in analogy to "/c")
to ignore the case on uppercase (lowercase) characters in
the test string.
* Strict adherence to C style string escapes. A warnings are
printed when compiling. Note: previously "\a" was
incorrectly translated to 'a' instead of an <alert> (i.e.,
BELL, typically 0x07).
* Make this compile with "-Wall -Wextra" and all the warning
flags used with WARNS=4 in the NetBSD source. Also make it
pass lint.
* Many "cleanups" and hopefully not too many new bugs!
2007-01-16 14:56 Anon Ymous <do@not.spam.me>
* make several more files compile with gcc warnings
on and also make them pass lint.
2007-01-16 14:54 Anon Ymous <do@not.spam.me>
* fix a puts()/putc() usage goof in file.c
* make file.c compile with gcc warnings and pass lint
2006-12-11 16:49 Christos Zoulas <christos@astron.com>
* fix byteswapping issue
* report the number of bytes we tried to
allocate when allocation fails
* add a few missed cases in the strength routine
2006-12-08 16:32 Christos Zoulas <christos@astron.com>
* store and print the line number of the magic
entry for debugging.
* if the magic entry did not print anything,
don't treat it as a match
* change the magic strength algorithm to take
into account the relationship op.
* fix a bug in search where we could accidentally
return a match.
* propagate the error return from match to
file_softmagic.
2006-11-25 13:35 Christos Zoulas <christos@astron.com>
* Don't store the current offset in the magic
struct, because it needs to be restored and
it was not done properly all the time. Bug
found by: Arkadiusz Miskiewicz
* Fix problem in the '\0' separator; and don't
print it as an additional separator; print
it as the only separator.
2006-11-17 10:51 Christos Zoulas <christos@astron.com>
* Added a -0 option to print a '\0' separator
Etienne Buira <etienne.buira@free.fr>
2006-10-31 15:14 Christos Zoulas <christos@astron.com>
* Check offset before copying (Mike Frysinger)
* merge duplicated code
* add quad date support
* make sure that we nul terminate desc (Ryoji Kanai)
* don't process elf notes multiple times
* allow -z to report empty compressed files
* use calloc to initialize the ascii buffers (Jos van den Oever)
2006-06-08 11:11 Christos Zoulas <christos@astron.com>
* QNX fixes (Mike Gorchak)
* Add quad support.
* FIFO checks (Dr. Werner Fink)
* Linux ELF fixes (Dr. Werner Fink)
* Magic format checks (Dr. Werner Fink)
* Magic format function improvent (Karl Chen)
2006-05-03 11:11 Christos Zoulas <christos@astron.com>
* Pick up some elf changes and some constant fixes from SUSE
* Identify gnu tar vs. posix tar
* When keep going, don't print spurious newlines (Radek Vokál)
2006-04-01 12:02 Christos Zoulas <christos@astron.com>
* Use calloc instead of malloc (Mike Frysinger)
* Fix configure script to detect wctypes.h (Mike Frysinger)
2006-03-02 16:06 Christos Zoulas <christos@astron.com>
* Print empty if the file is (Mike Frysinger)
* Don't try to read past the end of the buffer (Mike Frysinger)
* Sort magic entries by strength [experimental]
2005-11-29 13:26 Christos Zoulas <christos@astron.com>
* Use iswprint() to convert the output string.
(Bastien Nocera)
2005-10-31 8:54 Christos Zoulas <christos@astron.com>
* Fix regression where the core info was not completely processed
(Radek Vokál)
2005-10-20 11:15 Christos Zoulas <christos@astron.com>
* Middle Endian magic (Diomidis Spinellis)
2005-10-17 11:15 Christos Zoulas <christos@astron.com>
* Open with O_BINARY for CYGWIN (Corinna Vinschen)
* Don't close stdin (Arkadiusz Miskiewicz)
* Look for note sections in non executables.
2005-09-20 13:33 Christos Zoulas <christos@astron.com>
* Don't print SVR4 Style in core files multiple times
(Radek Vokál)
2005-08-27 04:09 Christos Zoulas <christos@astron.com>
* Cygwin changes Corinna Vinschen
2005-08-18 09:53 Christos Zoulas <christos@astron.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@astron.com>
* Add -h flag and dereference symlinks if POSIXLY_CORRECT
is set.
2005-07-29 13:57 Christos Zoulas <christos@astron.com>
* Avoid search and regex buffer overflows (Kelledin)
2005-07-12 11:48 Christos Zoulas <christos@astron.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@astron.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@astron.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@astron.com>
2004-11-24 12:39 Christos Zoulas <christos@astron.com>
* Stack smash fix, and ELF more conservative reading.
Jakub Bogusz <qboosh@pld-linux.org>
2004-11-20 18:50 Christos Zoulas <christos@astron.com>
* New FreeBSD version parsing code:
Jon Noack <noackjr@alumni.rice.edu>
* Hackish support for ucs16 strings <christos@astron.com>
2004-11-13 03:07 Christos Zoulas <christos@astron.com>
* print the file name and line number in syntax errors.
2004 10-12 10:50 Christos Zoulas <christos@astron.com>
* Fix stack overwriting on 0 length strings: Tim Waugh
<twaugh@redhat.com> Ned Ludd <solar@gentoo.org>
2004-09-27 11:30 Christos Zoulas <christos@astron.com>
* Remove 3rd and 4th copyright clause; approved by Ian Darwin.
* Fix small memory leaks; caught by: Tamas Sarlos
<stamas@csillag.ilab.sztaki.hu>
2004-07-24 16:33 Christos Zoulas <christos@astron.com>
* magic.mime update Danny Milosavljevic <danny.milo@gmx.net>
* FreeBSD version update Oliver Eikemeier <eikemeier@fillmore-labs.com>
* utime/utimes detection Ian Lance Taylor <ian@wasabisystems.com>
* errors reading elf magic Jakub Bogusz <qboosh@pld-linux.org>
2004-04-12 10:55 Christos Zoulas <christos@astron.com>
* make sure that magic formats match magic types during compilation
* fix broken sgi magic file
2004-04-06 20:36 Christos Zoulas <christos@astron.com>
* detect present of mbstate_t Petter Reinholdtsen <pere@hungry.com>
* magic fixes
2004-03-22 15:25 Christos Zoulas <christos@astron.com>
* Lots of mime fixes
(Joerg Ostertag) <ostertag@rechengilde.de>
* FreeBSD ELF version handling
(Edwin Groothuis) <edwin@mavetju.org>
* correct cleanup in all cases; don't just close the file.
(Christos Zoulas) <christos@astron.com>
* add gettext message catalogue support
(Michael Piefel) <piefel@debian.org>
* better printout for unreadable files
(Michael Piefel) <piefel@debian.org>
* compensate for missing MAXPATHLEN
(Michael Piefel) <piefel@debian.org>
* add wide character string length computation
(Michael Piefel) <piefel@debian.org>
* Avoid infinite loops caused by bad elf alignments
or name and description note sizes. Reported by
(Mikael Magnusson) <mmikael@comhem.se>
2004-03-09 13:55 Christos Zoulas <christos@astron.com>
* Fix possible memory leak on error and add missing regfree
(Dmitry V. Levin) <ldv@altlinux.org>
2003-12-23 12:12 Christos Zoulas <christos@astron.com>
* fix -k flag (Maciej W. Rozycki)
2003-11-18 14:10 Christos Zoulas <christos@astron.com>
* Try to give us much info as possible on corrupt elf files.
(Willy Tarreau) <willy@w.ods.org>
* Updated python bindings (Brett Funderburg)
<brettf@deepfile.com>
2003-11-11 15:03 Christos Zoulas <christos@astron.com>
* Include file.h first, because it includes config.h
breaks largefile test macros otherwise.
(Paul Eggert <eggert@CS.UCLA.EDU> via
Lars Hecking <lhecking@nmrc.ie>)
2003-10-14 21:39 Christos Zoulas <christos@astron.com>
* Python bindings (Brett Funderburg) <brettf@deepfile.com>
* Don't lookup past the end of the buffer
(Chad Hanson) <chanson@tcs-sec.com>
* Add MAGIC_ERROR and api on magic_errno()
2003-10-08 12:40 Christos Zoulas <christos@astron.com>
* handle error conditions from compile as fatal
(Antti Kantee) <pooka@netbsd.org>
* handle magic filename parsing sanely
* more magic fixes.
* fix a memory leak (Illes Marton) <illes.marton@balabit.hu>
* describe magic file handling
(Bryan Henderson) <bryanh@giraffe-data.com>
2003-09-12 15:09 Christos Zoulas <christos@astron.com>
* update magic files.
* remove largefile support from file.h; it breaks things on most OS's
2003-08-10 10:25 Christos Zoulas <christos@astron.com>
* fix unmapping'ing of mmaped files.
2003-07-10 12:03 Christos Zoulas <christos@astron.com>
* don't exit with -1 on error; always exit 1 (Marty Leisner)
* restore utimes code.
2003-06-10 17:03 Christos Zoulas <christos@astron.com>
* make sure we don't access uninitialized memory.
* pass lint
* #ifdef __cplusplus in magic.h
2003-05-25 19:23 Christos Zoulas <christos@astron.com>
* rename cvs magic file to revision to deal with
case insensitive filesystems.
2003-05-23 17:03 Christos Zoulas <christos@astron.com>
* documentation fixes from Michael Piefel <piefel@debian.org>
* magic fixes (various)
* revert basename magic in .mgc name determination
* buffer protection in uncompress,
signness issues,
close files
Maciej W. Rozycki <macro@ds2.pg.gda.pl
2003-04-21 20:12 Christos Zoulas <christos@astron.com>
* fix zsh magic
2003-04-04 16:59 Christos Zoulas <christos@astron.com>
* fix operand sort order in string.
2003-04-02 17:30 Christos Zoulas <christos@astron.com>
* cleanup namespace in magic.h
2003-04-02 13:50 Christos Zoulas <christos@astron.com>
* Magic additions (Alex Ott)
* Fix bug that broke VPATH compilation (Peter Breitenlohner)
2003-03-28 16:03 Christos Zoulas <christos@astron.com>
* remove packed attribute from magic struct.
* make the magic struct properly aligned.
* bump version number of compiled files to 2.
2003-03-27 13:10 Christos Zoulas <christos@astron.com>
* separate tar detection and run it before softmagic.
* fix reversed symlink test.
* fix version printing.
* make separator a string instead of a char.
* update manual page and sort options.
2003-03-26 11:00 Christos Zoulas <christos@astron.com>
* Pass lint
* make NULL in magic_file mean stdin
* Fix "-" argument to file to pass NULL to magic_file
* avoid pointer casts by using memcpy
* rename magic_buf -> magic_buffer
* keep only the first error
* manual page: new sentence, new line
* fix typo in api function (magic_buf -> magic_buffer)

234
external/bsd/file/dist/INSTALL vendored Normal file
View file

@ -0,0 +1,234 @@
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that the
`configure' script does not know about. Run `./configure --help' for
details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

44
external/bsd/file/dist/MAINT vendored Normal file
View file

@ -0,0 +1,44 @@
$File: MAINT,v 1.10 2008/02/05 19:08:11 christos Exp $
Maintenance notes:
I am continuing to maintain the file command. I welcome your help,
but to make my life easier I'd like to request the following:
- Do not distribute changed versions.
People trying to be helpful occasionally put up their hacked versions
of the file command for anonymous FTP, and people all over the
world get copies of the hacked versions. Within a day or two I am
getting email from around the world asking me why "my" file command
won't compile!!! Needless to say this detracts from the limited
time I have available to work on the actual software. Therefore I
ask you again to please NOT distribute your changed version. If
you need to make changes, please add a patch file next to the
distribution tar, and a README file that clearly explains what you
are trying to fix.
Thank you for your assistance and cooperation.
Code Overview
This is a rough idea of the control flow from the main program:
file.c main()
file.c process (called for each file)
printf file name
magic.c magic_file()
fsmagic.c file_fsmagic()
(handles statbuf modes for DEV)
(handles statbuf modes for executable &c.
reads data from file.
funcs.c: file_buffer()
compress.c file_zmagic()
is_tar.c file_is_tar()
softmagic.c file_softmagic()
match() - looks for match against main magic database
ascmagic.c file_ascmagic()
readelf.c file_tryelf()
"unknown"
Christos Zoulas (see README for email address)

5
external/bsd/file/dist/Makefile.am vendored Normal file
View file

@ -0,0 +1,5 @@
#ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = MAINT
SUBDIRS = src magic doc

637
external/bsd/file/dist/Makefile.in vendored Normal file
View file

@ -0,0 +1,637 @@
# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 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.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#ACLOCAL_AMFLAGS = -I m4
VPATH = @srcdir@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
TODO compile config.guess config.sub depcomp install-sh \
ltmain.sh missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-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
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
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@
DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NMEDIT = @NMEDIT@
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@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
WARNINGS = @WARNINGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
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@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
fsect = @fsect@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = MAINT
SUBDIRS = src magic
#SUBDIRS = src magic tests doc python
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
cd $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
.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
$(top_srcdir)/configure: $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
else :; fi
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: $(am__configure_deps)
@echo "NOT REBUILDING $@"
NetBSD_DISABLED_srcdir_config.h.in:
cd $(top_srcdir) && $(AUTOHEADER)
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (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):
@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 \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@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)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
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)'; \
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; }'`; \
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 $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
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; }'`; \
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:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d $(distdir) || mkdir $(distdir)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
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" \
am__remove_distdir=: \
am__skip_length_check=: \
distdir) \
|| exit 1; \
fi; \
done
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
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
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
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
chmod a-w $(distdir)
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 \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(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) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$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 \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@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
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
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-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:
install-data-am:
install-dvi: install-dvi-recursive
install-exec-am:
install-html: install-html-recursive
install-info: install-info-recursive
install-man:
install-pdf: install-pdf-recursive
install-ps: install-ps-recursive
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-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:
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
install-strip
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
clean-libtool 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-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-recursive uninstall uninstall-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.
.NOEXPORT:

1
external/bsd/file/dist/NEWS vendored Normal file
View file

@ -0,0 +1 @@
See ChangeLog.

134
external/bsd/file/dist/README vendored Normal file
View file

@ -0,0 +1,134 @@
** README for file(1) Command **
@(#) $File: README,v 1.42 2009/02/14 15:16:24 christos Exp $
E-mail: christos@astron.com
Mailing List: file@mx.gw.com
Phone: Do not even think of telephoning me about this program. Send cash first!
This is Release 5.x of Ian Darwin's (copyright but distributable)
file(1) command. This version is the standard "file" command for Linux,
*BSD, and other systems. (See "patchlevel.h" for the exact release number).
The major changes for 5.x are CDF file parsing, indirect magic, and
overhaul in mime and ascii encoding handling.
The major feature of 4.x is the refactoring of the code into a library,
and the re-write of the file command in terms of that library. The library
itself, libmagic can be used by 3rd party programs that wish to identify
file types without having to fork() and exec() file. The prime contributor
for 4.0 was M\xe5ns Rullg\xe5rd.
UNIX is a trademark of UNIX System Laboratories.
The prime contributor to Release 3.8 was Guy Harris, who put in megachanges
including byte-order independence.
The prime contributor to Release 3.0 was Christos Zoulas, who put
in hundreds of lines of source code changes, including his own
ANSIfication of the code (I liked my own ANSIfication better, but
his (__P()) is the "Berkeley standard" way of doing it, and I wanted UCB
to include the code...), his HP-like "indirection" (a feature of
the HP file command, I think), and his mods that finally got the
uncompress (-z) mode finished and working.
This release has compiled in numerous environments; see PORTING
for a list and problems.
This fine freeware file(1) follows the USG (System V) model of the file
command, rather than the Research (V7) version or the V7-derived 4.[23]
Berkeley one. That is, the file /etc/magic contains much of the ritual
information that is the source of this program's power. My version
knows a little more magic (including tar archives) than System V; the
/etc/magic parsing seems to be compatible with the (poorly documented)
System V /etc/magic format (with one exception; see the man page).
In addition, the /etc/magic file is built from a subdirectory
for easier(?) maintenance. I will act as a clearinghouse for
magic numbers assigned to all sorts of data files that
are in reasonable circulation. Send your magic numbers,
in magic(5) format please, to the maintainer, Christos Zoulas.
COPYING - read this first.
README - read this second (you are currently reading this file).
INSTALL - read on how to install
src/apprentice.c - parses /etc/magic to learn magic
src/apptype.c - used for OS/2 specific application type magic
src/asprintf.c - replacement for OS's that don't have it.
src/ascmagic.c - third & last set of tests, based on hardwired assumptions.
src/cdf.c - parser for Microsoft Compound Document Files
src/cdf_time.c - time converter for CDF.
src/compress.c - handles decompressing files to look inside.
src/encoding.c - handles unicode encodings
src/file.c - the main program
src/file.h - header file
src/fsmagic.c - first set of tests the program runs, based on filesystem info
src/funcs.c - utilility functions
src/getopt_long.c - used for OS/2 specific application type magic
src/is_tar.c, tar.h - knows about tarchives (courtesy John Gilmore).
src/names.h - header file for ascmagic.c
src/magic.c - the libmagic api
src/print.c - print results, errors, warnings.
src/readcdf.c - CDF wrapper.
src/readelf.[ch] - Stand-alone elf parsing code.
src/softmagic.c - 2nd set of tests, based on /etc/magic
src/strlcat.c - used for OS/2 specific application type magic
src/strlcpy.c - used for OS/2 specific application type magic
src/vasprintf.c - used for OS/2 specific application type magic
doc/file.1 - man page for the command
doc/magic.4 - man page for the magic file, courtesy Guy Harris.
Install as magic.4 on USG and magic.5 on V7 or Berkeley; cf Makefile.
Magdir - directory of /etc/magic pieces
------------------------------------------------------------------------------
If you submit a new magic entry please make sure you read the following
guidelines:
- Initial match is preferably at least 32 bits long, and is a _unique_ match
- If this is not feasible, use additional check
- Match of <= 16 bits are not accepted
- Delay printing string as much as possible, don't print output too early
- Avoid printf arbitrary byte as string, which can be a source of
crash and buffer overflow
- Provide complete information with entry:
* One line short summary
* Optional long description
* File extension, if applicable
* Full name and contact method (for discussion when entry has problem)
* Further reference, such as documentation of format
------------------------------------------------------------------------------
You can download the latest version of file from:
ftp://ftp.astron.com/pub/file/
If your gzip sometimes fails to decompress things complaining about a short
file, apply this patch [which is going to be in the next version of gzip]:
*** - Tue Oct 29 02:06:35 1996
--- util.c Sun Jul 21 21:51:38 1996
*** 106,111 ****
--- 108,114 ----
if (insize == 0) {
if (eof_ok) return EOF;
+ flush_window();
read_error();
}
bytes_in += (ulg)insize;
Parts of this software were developed at SoftQuad Inc., developers
of SGML/HTML/XML publishing software, in Toronto, Canada.
SoftQuad was swallowed up by Corel in 2002
and does not exist any longer.
From: Kees Zeelenberg
An MS-Windows (Win32) port of File-4.17 is available from
http://gnuwin32.sourceforge.net/
File is an implementation of the Unix File(1) command.
It knows the 'magic number' of several thousands of file types.

15
external/bsd/file/dist/TODO vendored Normal file
View file

@ -0,0 +1,15 @@
Fix output so that tests for MIME and APPLE flags are not needed all
over the place, and actual output is only done in one place. This
needs a design. Suggestion: push possible outputs on to a list, then
pick the last-pushed (most specific, one hopes) value at the end, or
use a default if the list is empty.
Continue to squash all magic bugs. See Debian BTS for a good source.
Store arbitrarily long strings, for example for %s patterns, so that
they can be printed out. Fixes Debian bug #271672.
Add syntax for other sorts of counted string (Debian bug #466032). Use
to fix bug #283760.
Add syntax for relative offsets after current level (Debian bug #466037).

55
external/bsd/file/dist/acinclude.m4 vendored Normal file
View file

@ -0,0 +1,55 @@
dnl from autoconf 2.13 acspecific.m4, with changes to check for daylight
AC_DEFUN([AC_STRUCT_TIMEZONE_DAYLIGHT],
[AC_REQUIRE([AC_STRUCT_TM])dnl
AC_CACHE_CHECK([for tm_zone in struct tm], ac_cv_struct_tm_zone,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_zone;],
ac_cv_struct_tm_zone=yes, ac_cv_struct_tm_zone=no)])
if test "$ac_cv_struct_tm_zone" = yes; then
AC_DEFINE(HAVE_TM_ZONE,1,[HAVE_TM_ZONE])
fi
AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
[AC_TRY_LINK(
changequote(<<, >>)dnl
<<#include <time.h>
#ifndef tzname /* For SGI. */
extern char *tzname[]; /* RS6000 and others reject char **tzname. */
#endif>>,
changequote([, ])dnl
[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])
if test $ac_cv_var_tzname = yes; then
AC_DEFINE(HAVE_TZNAME,1,[HAVE_TZNAME])
fi
AC_CACHE_CHECK([for tm_isdst in struct tm], ac_cv_struct_tm_isdst,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_isdst;],
ac_cv_struct_tm_isdst=yes, ac_cv_struct_tm_isdst=no)])
if test "$ac_cv_struct_tm_isdst" = yes; then
AC_DEFINE(HAVE_TM_ISDST,1,[HAVE_TM_ISDST])
fi
AC_CACHE_CHECK(for daylight, ac_cv_var_daylight,
[AC_TRY_LINK(
changequote(<<, >>)dnl
<<#include <time.h>
#ifndef daylight /* In case IRIX #defines this, too */
extern int daylight;
#endif>>,
changequote([, ])dnl
[atoi(daylight);], ac_cv_var_daylight=yes, ac_cv_var_daylight=no)])
if test $ac_cv_var_daylight = yes; then
AC_DEFINE(HAVE_DAYLIGHT,1,[HAVE_DAYLIGHT])
fi
])
AC_DEFUN([AC_STRUCT_OPTION_GETOPT_H],
[AC_CACHE_CHECK([for struct option in getopt], ac_cv_struct_option_getopt_h,
[AC_TRY_COMPILE([#include <getopt.h>], [struct option op; op.name;],
ac_cv_struct_option_getopt_h=yes, ac_cv_struct_option_getopt_h=no)])
if test "$ac_cv_struct_option_getopt_h" = yes; then
AC_DEFINE(HAVE_STRUCT_OPTION,1,[HAVE_STRUCT_OPTION])
fi
])

7545
external/bsd/file/dist/aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load diff

142
external/bsd/file/dist/compile vendored Executable file
View file

@ -0,0 +1,142 @@
#! /bin/sh
# Wrapper for compilers which do not understand `-c -o'.
scriptversion=2005-05-14.22
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand `-c -o'.
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file `INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
esac
ofile=
cfile=
eat=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as `compile cc -o foo foo.c'.
# So we strip `-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no `-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# `.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
# Create the lock directory.
# Note: use `[/.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

1504
external/bsd/file/dist/config.guess vendored Executable file

File diff suppressed because it is too large Load diff

268
external/bsd/file/dist/config.h.in vendored Normal file
View file

@ -0,0 +1,268 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define in built-in ELF support is used */
#undef BUILTIN_ELF
/* Define for ELF core file support */
#undef ELFCORE
/* Define to 1 if you have the `asprintf' function. */
#undef HAVE_ASPRINTF
/* HAVE_DAYLIGHT */
#undef HAVE_DAYLIGHT
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <err.h> header file. */
#undef HAVE_ERR_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#undef HAVE_FSEEKO
/* Define to 1 if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
/* Define to 1 if you have the `getopt_long' function. */
#undef HAVE_GETOPT_LONG
/* Define to 1 if the system has the type `int32_t'. */
#undef HAVE_INT32_T
/* Define to 1 if the system has the type `int64_t'. */
#undef HAVE_INT64_T
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
/* 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
/* Define to 1 if you have the `mkstemp' function. */
#undef HAVE_MKSTEMP
/* Define to 1 if you have the `mmap' function. */
#undef HAVE_MMAP
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strlcat' function. */
#undef HAVE_STRLCAT
/* Define to 1 if you have the `strlcpy' function. */
#undef HAVE_STRLCPY
/* Define to 1 if you have the `strndup' function. */
#undef HAVE_STRNDUP
/* Define to 1 if you have the `strtof' function. */
#undef HAVE_STRTOF
/* Define to 1 if you have the `strtoul' function. */
#undef HAVE_STRTOUL
/* HAVE_STRUCT_OPTION */
#undef HAVE_STRUCT_OPTION
/* Define to 1 if `st_rdev' is member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_RDEV
/* Define to 1 if `tm_gmtoff' is member of `struct tm'. */
#undef HAVE_STRUCT_TM_TM_GMTOFF
/* Define to 1 if `tm_zone' is member of `struct tm'. */
#undef HAVE_STRUCT_TM_TM_ZONE
/* Define to 1 if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <sys/utime.h> header file. */
#undef HAVE_SYS_UTIME_H
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
/* HAVE_TM_ISDST */
#undef HAVE_TM_ISDST
/* HAVE_TM_ZONE */
#undef HAVE_TM_ZONE
/* HAVE_TZNAME */
#undef HAVE_TZNAME
/* Define to 1 if the system has the type `uint16_t'. */
#undef HAVE_UINT16_T
/* Define to 1 if the system has the type `uint32_t'. */
#undef HAVE_UINT32_T
/* Define to 1 if the system has the type `uint64_t'. */
#undef HAVE_UINT64_T
/* Define to 1 if the system has the type `uint8_t'. */
#undef HAVE_UINT8_T
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `utime' function. */
#undef HAVE_UTIME
/* Define to 1 if you have the `utimes' function. */
#undef HAVE_UTIMES
/* Define to 1 if you have the <utime.h> header file. */
#undef HAVE_UTIME_H
/* Define to 1 if you have the `vasprintf' function. */
#undef HAVE_VASPRINTF
/* Define to 1 if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H
/* Define to 1 if you have the <wctype.h> header file. */
#undef HAVE_WCTYPE_H
/* Define to 1 if you have the `wcwidth' function. */
#undef HAVE_WCWIDTH
/* Define to 1 if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
*/
#undef MAJOR_IN_MKDEV
/* Define to 1 if `major', `minor', and `makedev' are declared in
<sysmacros.h>. */
#undef MAJOR_IN_SYSMACROS
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of `long long', as computed by sizeof. */
#undef SIZEOF_LONG_LONG
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME
/* Version number of package */
#undef VERSION
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
#undef _LARGEFILE_SOURCE
/* Define for large files, on AIX-style hosts. */
#undef _LARGE_FILES
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to a type if <wchar.h> does not define. */
#undef mbstate_t
/* Define to `long int' if <sys/types.h> does not define. */
#undef off_t
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
#ifndef HAVE_UINT8_T
typedef unsigned char uint8_t;
#endif
#ifndef HAVE_UINT16_T
typedef unsigned short uint16_t;
#endif
#ifndef HAVE_UINT32_T
typedef unsigned int uint32_t;
#endif
#ifndef HAVE_INT32_T
typedef int int32_t;
#endif
#ifndef HAVE_UINT64_T
#if SIZEOF_LONG_LONG == 8
typedef unsigned long long uint64_t;
#else
typedef unsigned long uint64_t;
#endif
#endif
#ifndef HAVE_INT64_T
#if SIZEOF_LONG_LONG == 8
typedef long long int64_t;
#else
typedef long int64_t;
#endif
#endif

1622
external/bsd/file/dist/config.sub vendored Executable file

File diff suppressed because it is too large Load diff

25296
external/bsd/file/dist/configure vendored Executable file

File diff suppressed because it is too large Load diff

157
external/bsd/file/dist/configure.ac vendored Normal file
View file

@ -0,0 +1,157 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(file, 5.03, christos@astron.com)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
#AC_CONFIG_MACRO_DIR([m4])
AC_MSG_CHECKING(for builtin ELF support)
AC_ARG_ENABLE(elf,
[ --disable-elf disable builtin ELF support],
[if test "${enableval}" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE([BUILTIN_ELF], 1, [Define if built-in ELF support is used])
else
AC_MSG_RESULT(no)
fi], [
# enable by default
AC_MSG_RESULT(yes)
AC_DEFINE([BUILTIN_ELF], 1, [Define in built-in ELF support is used])
])
AC_MSG_CHECKING(for ELF core file support)
AC_ARG_ENABLE(elf-core,
[ --disable-elf-core disable ELF core file support],
[if test "${enableval}" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE([ELFCORE], 1, [Define for ELF core file support])
else
AC_MSG_RESULT(no)
fi], [
# enable by default
AC_MSG_RESULT(yes)
AC_DEFINE([ELFCORE], 1, [Define for ELF core file support])
])
AC_MSG_CHECKING(for file formats in man section 5)
AC_ARG_ENABLE(fsect-man5,
[ --enable-fsect-man5 enable file formats in man section 5],
[if test "${enableval}" = yes; then
AC_MSG_RESULT(yes)
fsect=5
else
AC_MSG_RESULT(no)
fsect=4
fi], [
# disable by default
AC_MSG_RESULT(no)
fsect=4
])
AC_SUBST([pkgdatadir], ['$(datadir)/misc'])
AC_SUBST(fsect)
AM_CONDITIONAL(FSECT5, test x$fsect = x5)
AC_SUBST(WARNINGS)
AC_GNU_SOURCE
dnl Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_LIBTOOL
dnl Checks for headers
AC_HEADER_STDC
AC_HEADER_MAJOR
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(stdint.h fcntl.h locale.h stdint.h inttypes.h unistd.h)
AC_CHECK_HEADERS(utime.h wchar.h wctype.h limits.h)
AC_CHECK_HEADERS(getopt.h err.h)
AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)
AC_CHECK_HEADERS(zlib.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_CHECK_MEMBERS([struct stat.st_rdev])
AC_STRUCT_TM
AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct tm.tm_zone])
AC_STRUCT_TIMEZONE_DAYLIGHT
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
AC_TYPE_MBSTATE_T
AC_STRUCT_OPTION_GETOPT_H
AC_CHECK_TYPES([uint8_t, uint16_t, uint32_t, int32_t, uint64_t, int64_t])
AC_CHECK_SIZEOF(long long)
AH_BOTTOM([
#ifndef HAVE_UINT8_T
typedef unsigned char uint8_t;
#endif
#ifndef HAVE_UINT16_T
typedef unsigned short uint16_t;
#endif
#ifndef HAVE_UINT32_T
typedef unsigned int uint32_t;
#endif
#ifndef HAVE_INT32_T
typedef int int32_t;
#endif
#ifndef HAVE_UINT64_T
#if SIZEOF_LONG_LONG == 8
typedef unsigned long long uint64_t;
#else
typedef unsigned long uint64_t;
#endif
#endif
#ifndef HAVE_INT64_T
#if SIZEOF_LONG_LONG == 8
typedef long long int64_t;
#else
typedef long int64_t;
#endif
#endif
])
AC_MSG_CHECKING(for gcc compiler warnings)
AC_ARG_ENABLE(warnings,
[ --disable-warnings disable compiler warnings],
[if test "${enableval}" = no -o "$GCC" = no; then
AC_MSG_RESULT(no)
WARNINGS=
else
AC_MSG_RESULT(yes)
WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
-Wmissing-declarations -Wredundant-decls -Wnested-externs \
-Wsign-compare -Wreturn-type -Wswitch -Wshadow \
-Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter"
fi], [
if test "$GCC" = no; then
WARNINGS=
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
-Wmissing-declarations -Wredundant-decls -Wnested-externs \
-Wsign-compare -Wreturn-type -Wswitch -Wshadow \
-Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter"
fi])
dnl Checks for functions
AC_CHECK_FUNCS(mmap strerror strndup strtoul mbrtowc mkstemp utimes utime wcwidth strtof)
dnl Provide implementation of some required functions if necessary
AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat)
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 tests/Makefile doc/Makefile python/Makefile])
AC_OUTPUT

584
external/bsd/file/dist/depcomp vendored Executable file
View file

@ -0,0 +1,584 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2006-10-15.18
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test -f "$tmpdepfile"; then :
else
stripped=`echo "$stripped" | sed 's,^.*/,,'`
tmpdepfile="$stripped.u"
fi
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add `dependent.h:' lines.
sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mechanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

32
external/bsd/file/dist/doc/Makefile.am vendored Normal file
View file

@ -0,0 +1,32 @@
MAGIC = $(pkgdatadir)/magic
if FSECT5
man_MAGIC = magic.5
else
man_MAGIC = magic.4
endif
fsect = @fsect@
man_MANS = file.1 $(man_MAGIC) libmagic.3
EXTRA_DIST = file.man magic.man libmagic.man
CLEANFILES = $(man_MANS)
file.1: Makefile file.man
@rm -f $@
sed -e s@__CSECTION__@1@g \
-e s@__FSECTION__@${fsect}@g \
-e s@__VERSION__@${VERSION}@g \
-e s@__MAGIC__@${MAGIC}@g $(srcdir)/file.man > $@
magic.${fsect}: Makefile magic.man
@rm -f $@
sed -e s@__CSECTION__@1@g \
-e s@__FSECTION__@${fsect}@g \
-e s@__VERSION__@${VERSION}@g \
-e s@__MAGIC__@${MAGIC}@g $(srcdir)/magic.man > $@
libmagic.3: Makefile libmagic.man
@rm -f $@
sed -e s@__CSECTION__@1@g \
-e s@__FSECTION__@${fsect}@g \
-e s@__VERSION__@${VERSION}@g \
-e s@__MAGIC__@${MAGIC}@g $(srcdir)/libmagic.man > $@

550
external/bsd/file/dist/doc/Makefile.in vendored Normal file
View file

@ -0,0 +1,550 @@
# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 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.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
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.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
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)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
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@
DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NMEDIT = @NMEDIT@
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@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
WARNINGS = @WARNINGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
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@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
fsect = @fsect@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
MAGIC = $(pkgdatadir)/magic
@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)
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(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
.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: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-man1: $(man1_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
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 \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
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 " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
done
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
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"; \
done
install-man3: $(man3_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
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 \
case "$$i" in \
*.3*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
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 " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst"; \
done
uninstall-man3:
@$(NORMAL_UNINSTALL)
@list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.3*) list="$$list $$i" ;; \
esac; \
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"; \
done
install-man4: $(man4_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
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 \
case "$$i" in \
*.4*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
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 " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man4dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man4dir)/$$inst"; \
done
uninstall-man4:
@$(NORMAL_UNINSTALL)
@list='$(man4_MANS) $(dist_man4_MANS) $(nodist_man4_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.4*) list="$$list $$i" ;; \
esac; \
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"; \
done
install-man5: $(man5_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
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 \
case "$$i" in \
*.5*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
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 " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst"; \
done
uninstall-man5:
@$(NORMAL_UNINSTALL)
@list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.5*) list="$$list $$i" ;; \
esac; \
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"; \
done
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(MANS)
installdirs:
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
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-man
install-dvi: install-dvi-am
install-exec-am:
install-html: install-html-am
install-info: install-info-am
install-man: install-man1 install-man3 install-man4 install-man5
install-pdf: install-pdf-am
install-ps: install-ps-am
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-man
uninstall-man: uninstall-man1 uninstall-man3 uninstall-man4 \
uninstall-man5
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-man1 \
install-man3 install-man4 install-man5 install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-man uninstall-man1 uninstall-man3 uninstall-man4 \
uninstall-man5
file.1: Makefile file.man
@rm -f $@
sed -e s@__CSECTION__@1@g \
-e s@__FSECTION__@${fsect}@g \
-e s@__VERSION__@${VERSION}@g \
-e s@__MAGIC__@${MAGIC}@g $(srcdir)/file.man > $@
magic.${fsect}: Makefile magic.man
@rm -f $@
sed -e s@__CSECTION__@1@g \
-e s@__FSECTION__@${fsect}@g \
-e s@__VERSION__@${VERSION}@g \
-e s@__MAGIC__@${MAGIC}@g $(srcdir)/magic.man > $@
libmagic.3: Makefile libmagic.man
@rm -f $@
sed -e s@__CSECTION__@1@g \
-e s@__FSECTION__@${fsect}@g \
-e s@__VERSION__@${VERSION}@g \
-e s@__MAGIC__@${MAGIC}@g $(srcdir)/libmagic.man > $@
# 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:

566
external/bsd/file/dist/doc/file.1 vendored Normal file
View file

@ -0,0 +1,566 @@
.\" $NetBSD: file.1,v 1.5 2010/05/14 16:51:32 joerg Exp $
.\"
.\" $File: file.man,v 1.79 2008/11/06 22:49:08 rrt Exp $
.Dd October 9, 2008
.Dt FILE 1
.Os
.Sh NAME
.Nm file
.Nd determine file type
.Sh SYNOPSIS
.Nm
.Op Fl 0bchikLNnprsvz
.Op Fl F Ar separator
.Op Fl f Ar namefile
.Op Fl m Ar magicfiles
.Op Fl Fl mime-encoding
.Op Fl Fl mime-type
.Ar file
.Nm
.Fl C
.Op Fl m Ar magicfile
.Nm
.Op Fl Fl help
.Sh DESCRIPTION
This manual page documents version 5.03 of the
.Nm
command.
.Pp
.Nm
tests each argument in an attempt to classify it.
There are three sets of tests, performed in this order:
filesystem tests, magic tests, and language tests.
The
.Em first
test that succeeds causes the file type to be printed.
.Pp
The type printed will usually contain one of the words
.Em text
(the file contains only
printing characters and a few common control
characters and is probably safe to read on an
.Dv ASCII
terminal),
.Em executable
(the file contains the result of compiling a program
in a form understandable to some
.Tn UNIX
kernel or another),
or
.Em data
meaning anything else (data is usually
.Dq binary
or non-printable).
Exceptions are well-known file formats (core files, tar archives)
that are known to contain binary data.
When modifying magic files or the program itself, make sure to
.Em "preserve these keywords" .
Users depend on knowing that all the readable files in a directory
have the word
.Dq text
printed.
Don't do as Berkeley did and change
.Dq shell commands text
to
.Dq shell script .
.Pp
The filesystem tests are based on examining the return from a
.Xr stat 2
system call.
The program checks to see if the file is empty,
or if it's some sort of special file.
Any known file types appropriate to the system you are running on
(sockets, symbolic links, or named pipes (FIFOs) on those systems that
implement them)
are intuited if they are defined in the system header file
.In sys/stat.h .
.Pp
The magic tests are used to check for files with data in
particular fixed formats.
The canonical example of this is a binary executable (compiled program)
.Dv a.out
file, whose format is defined in
.In elf.h ,
.In a.out.h
and possibly
.In exec.h
in the standard include directory.
These files have a
.Dq "magic number"
stored in a particular place
near the beginning of the file that tells the
.Tn UNIX
operating system
that the file is a binary executable, and which of several types thereof.
The concept of a
.Dq "magic"
has been applied by extension to data files.
Any file with some invariant identifier at a small fixed
offset into the file can usually be described in this way.
The information identifying these files is read from the compiled
magic file
.Pa /usr/share/misc/magic.mgc ,
or the files in the directory
.Pa /usr/share/misc/magic
if the compiled file does not exist.
In addition, if
.Pa $HOME/.magic.mgc
or
.Pa $HOME/.magic
exists, it will be used in preference to the system magic files.
.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.
ASCII, ISO-8859-x, non-ISO 8-bit extended-ASCII character sets
(such as those used on Macintosh and IBM PC systems),
UTF-8-encoded Unicode, UTF-16-encoded Unicode, and EBCDIC
character sets can be distinguished by the different
ranges and sequences of bytes that constitute printable text
in each set.
If a file passes any of these tests, its character set is reported.
ASCII, ISO-8859-x, UTF-8, and extended-ASCII files are identified
as
.Dq text
because they will be mostly readable on nearly any terminal;
UTF-16 and EBCDIC are only
.Dq character data
because, while
they contain text, it is text that will require translation
before it can be read.
In addition,
.Nm
will attempt to determine other characteristics of text-type files.
If the lines of a file are terminated by CR, CRLF, or NEL, instead
of the Unix-standard LF, this will be reported.
Files that contain embedded escape sequences or overstriking
will also be identified.
.Pp
Once
.Nm
has determined the character set used in a text-type file,
it will
attempt to determine in what language the file is written.
The language tests look for particular strings (cf.
.In names.h )
that can appear anywhere in the first few blocks of a file.
For example, the keyword
.Em .br
indicates that the file is most likely a
.Xr troff 1
input file, just as the keyword
.Em struct
indicates a C program.
These tests are less reliable than the previous
two groups, so they are performed last.
The language test routines also test for some miscellany
(such as
.Xr tar 1
archives).
.Pp
Any file that cannot be identified as having been written
in any of the character sets listed above is simply said to be
.Dq data .
.Sh OPTIONS
.Bl -tag -width indent
.It Fl 0 , -print0
Output a null character
.Sq \e0
after the end of the filename.
Nice to
.Xr cut 1
the output.
This does not affect the separator which is still printed.
.It Fl b , Fl Fl brief
Do not prepend filenames to output lines (brief mode).
.It Fl c , Fl Fl checking-printout
Cause a checking printout of the parsed form of the magic file.
This is usually used in conjunction with the
.Fl m
flag to debug a new magic file before installing it.
.It Fl C , Fl Fl compile
Write a
.Pa magic.mgc
output file that contains a pre-parsed version of the magic file or directory.
.It Fl e , Fl Fl exclude Ar testname
Exclude the test named in
.Ar testname
from the list of tests made to determine the file type.
Valid test names are:
.Bl -tag -width compress
.It apptype
.Dv EMX
application type (only on EMX).
.It text
Various types of text files (this test will try to guess the text
encoding, irrespective of the setting of the
.Dq encoding
option).
.It encoding
Different text encodings for soft magic tests.
.It tokens
Looks for known tokens inside text files.
.It cdf
Prints details of Compound Document Files.
.It compress
Checks for, and looks inside, compressed files.
.It elf
Prints ELF file details.
.It soft
Consults magic files.
.It tar
Examines tar files.
.El
.It Fl F , Fl Fl separator Ar separator
Use the specified string as the separator between the filename and the
file result returned.
Defaults to
.Sq \&: .
.It Fl f , Fl Fl files-from Ar namefile
Read the names of the files to be examined from
.Ar namefile
(one per line)
before the argument list.
Either
.Ar namefile
or at least one filename argument must be present;
to test the standard input, use
.Sq -
as a filename argument.
.It Fl h , Fl Fl no-dereference
Do not follow symlinks
(on systems that support symbolic links).
This is the default if the environment variable
.Ev POSIXLY_CORRECT
is not defined.
.It Fl Fl help
Print a help message and exit.
.It Fl i , Fl Fl mime
Output mime type strings rather than the more
traditional human readable ones.
Thus
.Nm
may say
.Dq text/plain; charset=us-ascii
rather than
.Dq ASCII text .
In order for this option to work,
.Nm
changes the way
it handles files recognized by the command itself (such as many of the
text file types, directories etc), and makes use of an alternative
.Dq magic
file.
(See the
.Sx FILES
section, below).
.It Fl Fl mime-type , Fl Fl mime-encoding
Like
.Fl i ,
but print only the specified element(s).
.It Fl k , Fl Fl keep-going
Don't stop at the first match, keep going.
Subsequent matches will have the string
.Dq "\[rs]012\- "
prepended.
(If you want a newline, see the
.Fl r
option.)
.It Fl L , Fl Fl dereference
Follow symlinks, as the like-named option in
.Xr ls 1
(on systems that support symbolic links).
This is the default if the environment variable
.Ev POSIXLY_CORRECT
is defined.
.It Fl m , Fl Fl magic-file Ar list
Specify an alternate list of files and directories containing magic.
This can be a single item, or a colon-separated list.
If a compiled magic file is found alongside a file or directory,
it will be used instead.
.It Fl N , Fl Fl no-pad
Don't pad filenames so that they align in the output.
.It Fl n , Fl Fl no-buffer
Force stdout to be flushed after checking each file.
This is only useful if checking a list of files.
It is intended to be used by programs that want filetype output from a pipe.
.It Fl p , Fl Fl preserve-date
On systems that support
.Xr utime 3
or
.Xr utimes 2 ,
attempt to preserve the access time of files analyzed, to pretend that
.Nm
never read them.
.It Fl r , Fl Fl raw
Don't translate unprintable characters to \eooo.
Normally
.Nm
translates unprintable characters to their octal representation.
.It Fl s , Fl Fl special-files
Normally,
.Nm
only attempts to read and determine the type of argument files which
.Xr stat 2
reports are ordinary files.
This prevents problems, because reading special files may have peculiar
consequences.
Specifying the
.Fl s
option causes
.Nm
to also read argument files which are block or character special files.
This is useful for determining the filesystem types of the data in raw
disk partitions, which are block special files.
This option also causes
.Nm
to disregard the file size as reported by
.Xr stat 2
since on some systems it reports a zero size for raw disk partitions.
.It Fl v , Fl Fl version
Print the version of the program and exit.
.It Fl z , Fl Fl uncompress
Try to look inside compressed files.
.El
.Sh ENVIRONMENT
The environment variable
.Ev MAGIC
can be used to set the default magic file name.
If that variable is set, then
.Nm
will not attempt to open
.Pa $HOME/.magic .
.Nm
adds
.Dq Pa .mgc
to the value of this variable as appropriate.
The environment variable
.Ev POSIXLY_CORRECT
controls (on systems that support symbolic links), whether
.Nm
will attempt to follow symlinks or not.
If set, then
.Nm
follows symlink, otherwise it does not.
This is also controlled by the
.Fl L
and
.Fl h
options.
.Sh FILES
.Bl -tag -width /usr/share/misc/magic.mgc -compact
.It Pa /usr/share/misc/magic.mgc
Default compiled list of magic.
.It Pa /usr/share/misc/magic
Directory containing default magic files.
.El
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
.Bd -literal -offset indent
$ file file.c file /dev/{wd0a,hda}
file.c: C program text
file: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), stripped
/dev/wd0a: block special (0/0)
/dev/hda: block special (3/0)
$ file -s /dev/wd0{b,d}
/dev/wd0b: data
/dev/wd0d: x86 boot sector
$ file -s /dev/hda{,1,2,3,4,5,6,7,8,9,10}
/dev/hda: x86 boot sector
/dev/hda1: Linux/i386 ext2 filesystem
/dev/hda2: x86 boot sector
/dev/hda3: x86 boot sector, extended partition table
/dev/hda4: Linux/i386 ext2 filesystem
/dev/hda5: Linux/i386 swap file
/dev/hda6: Linux/i386 swap file
/dev/hda7: Linux/i386 swap file
/dev/hda8: Linux/i386 swap file
/dev/hda9: empty
/dev/hda10: empty
$ file -i file.c file /dev/{wd0a,hda}
file.c: text/x-c
file: application/x-executable
/dev/hda: application/x-not-regular-file
/dev/wd0a: application/x-not-regular-file
.Ed
.Sh SEE ALSO
.Xr hexdump 1 ,
.Xr od 1 ,
.Xr strings 1 ,
.Xr magic 5
.Sh STANDARDS
This program is believed to exceed the System V Interface Definition
of FILE(CMD), as near as one can determine from the vague language
contained therein.
Its behavior is mostly compatible with the System V program of the same name.
This version knows more magic, however, so it will produce
different (albeit more accurate) output in many cases.
.\" URL: http://www.opengroup.org/onlinepubs/009695399/utilities/file.html
.Pp
The one significant difference
between this version and System V
is that this version treats any white space
as a delimiter, so that spaces in pattern strings must be escaped.
For example,
.Bd -literal -offset indent
\*[Gt]10 string language impress\ (imPRESS data)
.Ed
.Pp
in an existing magic file would have to be changed to
.Bd -literal -offset indent
\*[Gt]10 string language\e impress (imPRESS data)
.Ed
.Pp
In addition, in this version, if a pattern string contains a backslash,
it must be escaped.
For example
.Bd -literal -offset indent
0 string \ebegindata Andrew Toolkit document
.Ed
.Pp
in an existing magic file would have to be changed to
.Bd -literal -offset indent
0 string \e\ebegindata Andrew Toolkit document
.Ed
.Pp
SunOS releases 3.2 and later from Sun Microsystems include a
.Nm
command derived from the System V one, but with some extensions.
This version differs from Sun's only in minor ways.
It includes the extension of the
.Sq \*[Am]
operator, used as,
for example,
.Bd -literal -offset indent
\*[Gt]16 long\*[Am]0x7fffffff \*[Gt]0 not stripped
.Ed
.Sh MAGIC DIRECTORY
The magic file entries have been collected from various sources,
mainly USENET, and contributed by various authors.
Christos Zoulas (address below) will collect additional
or corrected magic file entries.
A consolidation of magic file entries
will be distributed periodically.
.Pp
The order of entries in the magic file is significant.
Depending on what system you are using, the order that
they are put together may be incorrect.
If your old
.Nm
command uses a magic file,
keep the old magic file around for comparison purposes
(rename it to
.Pa /usr/share/misc/magic.orig ) .
.Sh HISTORY
There has been a
.Nm
command in every
.Dv UNIX since at least Research Version 4
(man page dated November, 1973).
The System V version introduced one significant major change:
the external list of magic types.
This slowed the program down slightly but made it a lot more flexible.
.Pp
This program, based on the System V version,
was written by Ian Darwin
.Aq ian@darwinsys.com
without looking at anybody else's source code.
.Pp
John Gilmore revised the code extensively, making it better than
the first version.
Geoff Collyer found several inadequacies
and provided some magic file entries.
Contributions by the
.Sq \*[Am]
operator by Rob McMahon, cudcv@warwick.ac.uk, 1989.
.Pp
Guy Harris, guy@netapp.com, made many changes from 1993 to the present.
.Pp
Primary development and maintenance from 1990 to the present by
Christos Zoulas
.Aq christos@astron.com .
.Pp
Altered by Chris Lowth, chris@lowth.com, 2000:
Handle the
.Fl i
option to output mime type strings, using an alternative
magic file and internal logic.
.Pp
Altered by Eric Fischer
.Aq enf@pobox.com ,
July, 2000,
to identify character codes and attempt to identify the languages
of non-ASCII files.
.Pp
Altered by Reuben Thomas
.Aq rrt@sc3d.org ,
2007 to 2008, to improve MIME
support and merge MIME and non-MIME magic, support directories as well
as files of magic, apply many bug fixes and improve the build system.
.Pp
The list of contributors to the
.Sq magic
directory (magic files)
is too long to include here.
You know who you are; thank you.
Many contributors are listed in the source files.
.Sh LEGAL NOTICE
Copyright (c) Ian F. Darwin, Toronto, Canada, 1986-1999.
Covered by the standard Berkeley Software Distribution copyright; see the file
LEGAL.NOTICE in the source distribution.
.Pp
The files
.Pa tar.h
and
.Pa is_tar.c
were written by John Gilmore from his public-domain
.Xr tar 1
program, and are not covered by the above license.
.Sh BUGS
There must be a better way to automate the construction of the Magic
file from all the glop in Magdir.
What is it?
.Pp
.Nm
uses several algorithms that favor speed over accuracy,
thus it can be misled about the contents of text files.
.Pp
The support for text files (primarily for programming languages)
is simplistic, inefficient and requires recompilation to update.
.Pp
The list of keywords in
.Dv ascmagic
probably belongs in the Magic file.
This could be done by using some keyword like
.Sq *
for the offset value.
.Pp
Complain about conflicts in the magic file entries.
Make a rule that the magic entries sort based on file offset rather
than position within the magic file?
.Pp
The program should provide a way to give an estimate of
.Sq how good
a guess is.
We end up removing guesses (e.g.
.Sq From\
as first 5 chars of file) because
they are not as good as other guesses (e.g.
.Sq Newsgroups:
versus
.Sq Return-Path: ) .
Still, if the others don't pan out, it should be possible to use the
first guess.
.Pp
This manual page, and particularly this section, is too long.
.Sh AVAILABILITY
You can obtain the original author's latest version by anonymous FTP
on
.Pa ftp.astron.com
in the directory
.Pa /pub/file/file-X.YZ.tar.gz .

276
external/bsd/file/dist/doc/libmagic.3 vendored Normal file
View file

@ -0,0 +1,276 @@
.\" $NetBSD: libmagic.3,v 1.5 2010/05/14 03:14:41 joerg Exp $
.\"
.\" $File: libmagic.man,v 1.19 2008/10/06 20:16:04 christos Exp $
.\"
.\" Copyright (c) Christos Zoulas 2003.
.\" All Rights Reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice immediately at the beginning of the file, without modification,
.\" this list of conditions, and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd October 6, 2008
.Dt LIBMAGIC 3
.Os
.Sh NAME
.Nm magic_open ,
.Nm magic_close ,
.Nm magic_error ,
.Nm magic_file ,
.Nm magic_buffer ,
.Nm magic_setflags ,
.Nm magic_check ,
.Nm magic_compile ,
.Nm magic_load
.Nd Magic number recognition library
.Sh LIBRARY
.Lb libmagic
.Sh SYNOPSIS
.In magic.h
.Ft magic_t
.Fn magic_open "int flags"
.Ft void
.Fn magic_close "magic_t cookie"
.Ft const char *
.Fn magic_error "magic_t cookie"
.Ft int
.Fn magic_errno "magic_t cookie"
.Ft const char *
.Fn magic_file "magic_t cookie" "const char *filename"
.Ft const char *
.Fn magic_buffer "magic_t cookie" "const void *buffer" "size_t length"
.Ft int
.Fn magic_setflags "magic_t cookie" "int flags"
.Ft int
.Fn magic_check "magic_t cookie" "const char *filename"
.Ft int
.Fn magic_compile "magic_t cookie" "const char *filename"
.Ft int
.Fn magic_load "magic_t cookie" "const char *filename"
.Sh DESCRIPTION
These functions
operate on the magic database file
which is described
in
.Xr magic 5 .
.Pp
The function
.Fn magic_open
creates a magic cookie pointer and returns it.
It returns
.Dv NULL
if there was an error allocating the magic cookie.
The
.Ar flags
argument specifies how the other magic functions should behave:
.Bl -tag -width MAGIC_COMPRESS
.It Dv MAGIC_NONE
No special handling.
.It Dv MAGIC_DEBUG
Print debugging messages to stderr.
.It Dv MAGIC_SYMLINK
If the file queried is a symlink, follow it.
.It Dv MAGIC_COMPRESS
If the file is compressed, unpack it and look at the contents.
.It Dv MAGIC_DEVICES
If the file is a block or character special device, then open the device
and try to look in its contents.
.It Dv MAGIC_MIME_TYPE
Return a MIME type string, instead of a textual description.
.It Dv MAGIC_MIME_ENCODING
Return a MIME encoding, instead of a textual description.
.It Dv MAGIC_CONTINUE
Return all matches, not just the first.
.It Dv MAGIC_CHECK
Check the magic database for consistency and print warnings to stderr.
.It Dv MAGIC_PRESERVE_ATIME
On systems that support
.Xr utime 3
or
.Xr utimes 2 ,
attempt to preserve the access time of files analyzed.
.It Dv MAGIC_RAW
Don't translate unprintable characters to a \eooo octal representation.
.It Dv MAGIC_ERROR
Treat operating system errors while trying to open files and follow symlinks
as real errors, instead of printing them in the magic buffer.
.It Dv MAGIC_NO_CHECK_APPTYPE
Check for
.Dv EMX
application type (only on EMX).
.It Dv MAGIC_NO_CHECK_ASCII
Check for various types of ascii files.
.It Dv MAGIC_NO_CHECK_COMPRESS
Don't look for, or inside compressed files.
.It Dv MAGIC_NO_CHECK_ELF
Don't print elf details.
.It Dv MAGIC_NO_CHECK_FORTRAN
Don't look for fortran sequences inside ascii files.
.It Dv MAGIC_NO_CHECK_SOFT
Don't consult magic files.
.It Dv MAGIC_NO_CHECK_TAR
Don't examine tar files.
.It Dv MAGIC_NO_CHECK_TOKENS
Don't look for known tokens inside ascii files.
.It Dv MAGIC_NO_CHECK_TROFF
Don't look for troff sequences inside ascii files.
.El
.Pp
The
.Fn magic_close
function closes the
.Xr magic 5
database and deallocates any resources used.
.Pp
The
.Fn magic_error
function returns a textual explanation of the last error, or
.Dv NULL
if there was no error.
.Pp
The
.Fn magic_errno
function returns the last operating system error number
.Pq Xr errno 2
that was encountered by a system call.
.Pp
The
.Fn magic_file
function returns a textual description of the contents of the
.Ar filename
argument, or
.Dv NULL
if an error occurred.
If the
.Ar filename
is
.Dv NULL ,
then stdin is used.
.Pp
The
.Fn magic_buffer
function returns a textual description of the contents of the
.Ar buffer
argument with
.Ar length
bytes size.
.Pp
The
.Fn magic_setflags
function sets the
.Ar flags
described above.
Note that using both MIME flags together can also
return extra information on the charset.
.Pp
The
.Fn magic_check
function can be used to check the validity of entries in the colon
separated database files passed in as
.Ar filename ,
or
.Dv NULL
for the default database.
It returns 0 on success and \-1 on failure.
.Pp
The
.Fn magic_compile
function can be used to compile the the colon
separated list of database files passed in as
.Ar filename ,
or
.Dv NULL
for the default database.
It returns 0 on success and \-1 on failure.
The compiled files created are named from the
.Xr basename 1
of each file argument with
.Dq .mgc
appended to it.
.Pp
The
.Fn magic_load
function must be used to load the the colon
separated list of database files passed in as
.Ar filename ,
or
.Dv NULL
for the default database file before any magic queries can performed.
.Pp
The default database file is named by the MAGIC environment variable.
If that variable is not set, the default database file name is
.Pa /usr/share/misc/magic .
.Fn magic_load
adds
.Dq .mgc
to the database filename as appropriate.
.Sh RETURN VALUES
The function
.Fn magic_open
returns a magic cookie on success and
.Dv NULL
on failure setting errno to an appropriate value.
It will set errno to
.Er EINVAL
if an unsupported value for flags was given.
The
.Fn magic_load ,
.Fn magic_compile ,
and
.Fn magic_check
functions return 0 on success and \-1 on failure.
The
.Fn magic_file ,
and
.Fn magic_buffer
functions return a string on success and
.Dv NULL
on failure.
The
.Fn magic_error
function returns a textual description of the errors of the above
functions, or
.Dv NULL
if there was no error.
Finally,
.Fn magic_setflags
returns \-1 on systems that don't support
.Xr utime 3 ,
or
.Xr utimes 2
when
.Dv MAGIC_PRESERVE_ATIME
is set.
.Sh FILES
.Bl -tag -width /usr/share/misc/magic.mgc -compact
.It Pa /usr/share/misc/magic
The non-compiled default magic database.
.It Pa /usr/share/misc/magic.mgc
The compiled default magic database.
.El
.Sh SEE ALSO
.Xr file 1 ,
.Xr magic 5
.Sh AUTHORS
.An M\(oans Rullg\(oard
Initial libmagic implementation, and configuration.
.An Christos Zoulas
API cleanup, error code and allocation handling.

530
external/bsd/file/dist/doc/magic.5 vendored Normal file
View file

@ -0,0 +1,530 @@
.\" $NetBSD: magic.5,v 1.4 2009/05/08 20:20:39 wiz Exp $
.\"
.\" $File: magic.man,v 1.59 2008/11/06 23:22:53 christos Exp $
.Dd August 30, 2008
.Dt MAGIC 5
.Os
.\" install as magic.4 on USG, magic.5 on V7, Berkeley and Linux systems.
.Sh NAME
.Nm magic
.Nd file command's magic pattern file
.Sh DESCRIPTION
This manual page documents the format of the magic file as
used by the
.Xr file 1
command, version 5.03.
The
.Xr file 1
command identifies the type of a file using,
among other tests,
a test for whether the file contains certain
.Dq "magic patterns" .
The file
.Pa /usr/share/misc/magic
specifies what patterns are to be tested for, what message or
MIME type to print if a particular pattern is found,
and additional information to extract from the file.
.Pp
Each line of the file specifies a test to be performed.
A test compares the data starting at a particular offset
in the file with a byte value, a string or a numeric value.
If the test succeeds, a message is printed.
The line consists of the following fields:
.Bl -tag -width ".Dv message"
.It Dv offset
A number specifying the offset, in bytes, into the file of the data
which is to be tested.
.It Dv type
The type of the data to be tested.
The possible values are:
.Bl -tag -width ".Dv lestring16"
.It Dv byte
A one-byte value.
.It Dv short
A two-byte value in this machine's native byte order.
.It Dv long
A four-byte value in this machine's native byte order.
.It Dv quad
An eight-byte value in this machine's native byte order.
.It Dv float
A 32-bit single precision IEEE floating point number in this machine's native byte order.
.It Dv double
A 64-bit double precision IEEE floating point number in this machine's native byte order.
.It Dv string
A string of bytes.
The string type specification can be optionally followed
by /[Bbc]*.
The
.Dq B
flag compacts whitespace in the target, which must
contain at least one whitespace character.
If the magic has
.Dv n
consecutive blanks, the target needs at least
.Dv n
consecutive blanks to match.
The
.Dq b
flag treats every blank in the target as an optional blank.
Finally the
.Dq c
flag, specifies case insensitive matching: lowercase
characters in the magic match both lower and upper case characters in the
target, whereas upper case characters in the magic only match uppercase
characters in the target.
.It Dv pstring
A Pascal-style string where the first byte is interpreted as the an
unsigned length.
The string is not NUL terminated.
.It Dv date
A four-byte value interpreted as a UNIX date.
.It Dv qdate
A eight-byte value interpreted as a UNIX date.
.It Dv ldate
A four-byte value interpreted as a UNIX-style date, but interpreted as
local time rather than UTC.
.It Dv qldate
An eight-byte value interpreted as a UNIX-style date, but interpreted as
local time rather than UTC.
.It Dv beid3
A 32-bit ID3 length in big-endian byte order.
.It Dv beshort
A two-byte value in big-endian byte order.
.It Dv belong
A four-byte value in big-endian byte order.
.It Dv bequad
An eight-byte value in big-endian byte order.
.It Dv befloat
A 32-bit single precision IEEE floating point number in big-endian byte order.
.It Dv bedouble
A 64-bit double precision IEEE floating point number in big-endian byte order.
.It Dv bedate
A four-byte value in big-endian byte order,
interpreted as a Unix date.
.It Dv beqdate
An eight-byte value in big-endian byte order,
interpreted as a Unix date.
.It Dv beldate
A four-byte value in big-endian byte order,
interpreted as a UNIX-style date, but interpreted as local time rather
than UTC.
.It Dv beqldate
An eight-byte value in big-endian byte order,
interpreted as a UNIX-style date, but interpreted as local time rather
than UTC.
.It Dv bestring16
A two-byte unicode (UCS16) string in big-endian byte order.
.It Dv leid3
A 32-bit ID3 length in little-endian byte order.
.It Dv leshort
A two-byte value in little-endian byte order.
.It Dv lelong
A four-byte value in little-endian byte order.
.It Dv lequad
An eight-byte value in little-endian byte order.
.It Dv lefloat
A 32-bit single precision IEEE floating point number in little-endian byte order.
.It Dv ledouble
A 64-bit double precision IEEE floating point number in little-endian byte order.
.It Dv ledate
A four-byte value in little-endian byte order,
interpreted as a UNIX date.
.It Dv leqdate
An eight-byte value in little-endian byte order,
interpreted as a UNIX date.
.It Dv leldate
A four-byte value in little-endian byte order,
interpreted as a UNIX-style date, but interpreted as local time rather
than UTC.
.It Dv leqldate
An eight-byte value in little-endian byte order,
interpreted as a UNIX-style date, but interpreted as local time rather
than UTC.
.It Dv lestring16
A two-byte unicode (UCS16) string in little-endian byte order.
.It Dv melong
A four-byte value in middle-endian (PDP-11) byte order.
.It Dv medate
A four-byte value in middle-endian (PDP-11) byte order,
interpreted as a UNIX date.
.It Dv meldate
A four-byte value in middle-endian (PDP-11) byte order,
interpreted as a UNIX-style date, but interpreted as local time rather
than UTC.
.It Dv indirect
Starting at the given offset, consult the magic database again.
.It Dv regex
A regular expression match in extended POSIX regular expression syntax
(like egrep).
Regular expressions can take exponential time to process, and their
performance is hard to predict, so their use is discouraged.
When used in production environments, their performance
should be carefully checked.
The type specification can be optionally followed by
.Dv /[c][s] .
The
.Dq c
flag makes the match case insensitive, while the
.Dq s
flag update the offset to the start offset of the match, rather than the end.
The regular expression is tested against line
.Dv N + 1
onwards, where
.Dv N
is the given offset.
Line endings are assumed to be in the machine's native format.
.Dv ^
and
.Dv $
match the beginning and end of individual lines, respectively,
not beginning and end of file.
.It Dv search
A literal string search starting at the given offset.
The same modifier flags can be used as for string patterns.
The modifier flags (if any) must be followed by
.Dv /number
the range, that is, the number of positions at which the match will be
attempted, starting from the start offset.
This is suitable for
searching larger binary expressions with variable offsets, using
.Dv \e
escapes for special characters.
The offset works as for regex.
.It Dv default
This is intended to be used with the test
.Em x
(which is always true) and a message that is to be used if there are
no other matches.
.El
.Pp
Each top-level magic pattern (see below for an explanation of levels)
is classified as text or binary according to the types used.
Types
.Dq regex
and
.Dq search
are classified as text tests, unless non-printable characters are used
in the pattern.
All other tests are classified as binary.
A top-level
pattern is considered to be a test text when all its patterns are text
patterns; otherwise, it is considered to be a binary pattern.
When
matching a file, binary patterns are tried first; if no match is
found, and the file looks like text, then its encoding is determined
and the text patterns are tried.
.Pp
The numeric types may optionally be followed by
.Dv \*[Am]
and a numeric value,
to specify that the value is to be AND'ed with the
numeric value before any comparisons are done.
Prepending a
.Dv u
to the type indicates that ordered comparisons should be unsigned.
.It Dv test
The value to be compared with the value from the file.
If the type is
numeric, this value
is specified in C form; if it is a string, it is specified as a C string
with the usual escapes permitted (e.g. \en for new-line).
.Pp
Numeric values
may be preceded by a character indicating the operation to be performed.
It may be
.Dv = ,
to specify that the value from the file must equal the specified value,
.Dv \*[Lt] ,
to specify that the value from the file must be less than the specified
value,
.Dv \*[Gt] ,
to specify that the value from the file must be greater than the specified
value,
.Dv \*[Am] ,
to specify that the value from the file must have set all of the bits
that are set in the specified value,
.Dv ^ ,
to specify that the value from the file must have clear any of the bits
that are set in the specified value, or
.Dv ~ ,
the value specified after is negated before tested.
.Dv x ,
to specify that any value will match.
If the character is omitted, it is assumed to be
.Dv = .
Operators
.Dv \*[Am] ,
.Dv ^ ,
and
.Dv ~
don't work with floats and doubles.
The operator
.Dv !\&
specifies that the line matches if the test does
.Em not
succeed.
.Pp
Numeric values are specified in C form; e.g.
.Dv 13
is decimal,
.Dv 013
is octal, and
.Dv 0x13
is hexadecimal.
.Pp
For string values, the string from the
file must match the specified string.
The operators
.Dv = ,
.Dv \*[Lt]
and
.Dv \*[Gt]
(but not
.Dv \*[Am] )
can be applied to strings.
The length used for matching is that of the string argument
in the magic file.
This means that a line can match any non-empty string (usually used to
then print the string), with
.Em \*[Gt]\e0
(because all non-empty strings are greater than the empty string).
.Pp
The special test
.Em x
always evaluates to true.
.Dv message
The message to be printed if the comparison succeeds.
If the string contains a
.Xr printf 3
format specification, the value from the file (with any specified masking
performed) is printed using the message as the format string.
If the string begins with
.Dq \eb ,
the message printed is the remainder of the string with no whitespace
added before it: multiple matches are normally separated by a single
space.
.El
.Pp
An APPLE 4+4 character APPLE creator and type can be specified as:
.Bd -literal -offset indent
!:apple CREATYPE
.Ed
.Pp
A MIME type is given on a separate line, which must be the next
non-blank or comment line after the magic line that identifies the
file type, and has the following format:
.Bd -literal -offset indent
!:mime MIMETYPE
.Ed
.Pp
i.e. the literal string
.Dq !:mime
followed by the MIME type.
.Pp
An optional strength can be supplied on a separate line which refers to
the current magic description using the following format:
.Bd -literal -offset indent
!:strength OP VALUE
.Ed
.Pp
The operand
.Dv OP
can be:
.Dv + ,
.Dv - ,
.Dv * ,
or
.Dv /
and
.Dv VALUE
is a constant between 0 and 255.
This constant is applied using the specified operand
to the currently computed default magic strength.
.Pp
Some file formats contain additional information which is to be printed
along with the file type or need additional tests to determine the true
file type.
These additional tests are introduced by one or more
.Em \*[Gt]
characters preceding the offset.
The number of
.Em \*[Gt]
on the line indicates the level of the test; a line with no
.Em \*[Gt]
at the beginning is considered to be at level 0.
Tests are arranged in a tree-like hierarchy:
If a the test on a line at level
.Em n
succeeds, all following tests at level
.Em n+1
are performed, and the messages printed if the tests succeed, untile a line
with level
.Em n
(or less) appears.
For more complex files, one can use empty messages to get just the
"if/then" effect, in the following way:
.Bd -literal -offset indent
0 string MZ
\*[Gt]0x18 leshort \*[Lt]0x40 MS-DOS executable
\*[Gt]0x18 leshort \*[Gt]0x3f extended PC executable (e.g., MS Windows)
.Ed
.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
.Em \*[Gt]
is a
.Em (
then the string after the parenthesis is interpreted as an indirect offset.
That means that the number after the parenthesis is used as an offset in
the file.
The value at that offset is read, and is used again as an offset
in the file.
Indirect offsets are of the form:
.Em (( x [.[bislBISL]][+\-][ y ]) .
The value of
.Em x
is used as an offset in the file.
A byte, id3 length, short or long is read at that offset depending on the
.Em [bislBISLm]
type specifier.
The capitalized types interpret the number as a big endian
value, whereas the small letter versions interpret the number as a little
endian value;
the
.Em m
type interprets the number as a middle endian (PDP-11) value.
To that number the value of
.Em y
is added and the result is used as an offset in the file.
The default type if one is not specified is long.
.Pp
That way variable length structures can be examined:
.Bd -literal -offset indent
# MS Windows executables are also valid MS-DOS executables
0 string MZ
\*[Gt]0x18 leshort \*[Lt]0x40 MZ executable (MS-DOS)
# skip the whole block below if it is not an extended executable
\*[Gt]0x18 leshort \*[Gt]0x3f
\*[Gt]\*[Gt](0x3c.l) string PE\e0\e0 PE executable (MS-Windows)
\*[Gt]\*[Gt](0x3c.l) string LX\e0\e0 LX executable (OS/2)
.Ed
.Pp
This strategy of examining has a 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 directly, simple calculations are
possible: appending
.Em [+-*/%\*[Am]|^]number
inside parentheses allows one to modify
the value read from the file before it is used as an offset:
.Bd -literal -offset indent
# 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
\*[Gt]0x18 leshort \*[Lt]0x40
\*[Gt]\*[Gt](4.s*512) leshort 0x014c COFF executable (MS-DOS, DJGPP)
\*[Gt]\*[Gt](4.s*512) leshort !0x014c MZ executable (MS-DOS)
.Ed
.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 up-level
field using
.Sq \*[Am]
as a prefix to the offset:
.Bd -literal -offset indent
0 string MZ
\*[Gt]0x18 leshort \*[Gt]0x3f
\*[Gt]\*[Gt](0x3c.l) string PE\e0\e0 PE executable (MS-Windows)
# immediately following the PE signature is the CPU type
\*[Gt]\*[Gt]\*[Gt]\*[Am]0 leshort 0x14c for Intel 80386
\*[Gt]\*[Gt]\*[Gt]\*[Am]0 leshort 0x184 for DEC Alpha
.Ed
.Pp
Indirect and relative offsets can be combined:
.Bd -literal -offset indent
0 string MZ
\*[Gt]0x18 leshort \*[Lt]0x40
\*[Gt]\*[Gt](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
\*[Gt]\*[Gt]\*[Gt]\*[Am](2.s-514) string LE LE executable (MS Windows VxD driver)
.Ed
.Pp
Or the other way around:
.Bd -literal -offset indent
0 string MZ
\*[Gt]0x18 leshort \*[Gt]0x3f
\*[Gt]\*[Gt](0x3c.l) string LE\e0\e0 LE executable (MS-Windows)
# at offset 0x80 (-4, since relative offsets start at the end
# of the up-level match) inside the LE header, we find the absolute
# offset to the code area, where we look for a specific signature
\*[Gt]\*[Gt]\*[Gt](\*[Am]0x7c.l+0x26) string UPX \eb, UPX compressed
.Ed
.Pp
Or even both!
.Bd -literal -offset indent
0 string MZ
\*[Gt]0x18 leshort \*[Gt]0x3f
\*[Gt]\*[Gt](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
\*[Gt]\*[Gt]\*[Gt]\*[Am](\*[Am]0x54.l-3) string UNACE \eb, ACE self-extracting archive
.Ed
.Pp
Finally, if you have to deal with offset/length pairs in your file, even the
second value in a parenthesized 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.
.Bd -literal -offset indent
0 string MZ
\*[Gt]0x18 leshort \*[Gt]0x3f
\*[Gt]\*[Gt](0x3c.l) string PE\e0\e0 PE executable (MS-Windows)
# search for the PE section called ".idata"...
\*[Gt]\*[Gt]\*[Gt]\*[Am]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
\*[Gt]\*[Gt]\*[Gt]\*[Gt](\*[Am]0xe.l+(-4)) string PK\e3\e4 \eb, ZIP self-extracting archive
.Ed
.Sh SEE ALSO
.Xr file 1
\- the command that reads this file.
.Sh BUGS
The formats
.Dv long ,
.Dv belong ,
.Dv lelong ,
.Dv melong ,
.Dv short ,
.Dv beshort ,
.Dv leshort ,
.Dv date ,
.Dv bedate ,
.Dv medate ,
.Dv ledate ,
.Dv beldate ,
.Dv leldate ,
and
.Dv meldate
are system-dependent; perhaps they should be specified as a number
of bytes (2B, 4B, etc),
since the files being recognized typically come from
a system on which the lengths are invariant.
.\"
.\" From: guy@sun.uucp (Guy Harris)
.\" Newsgroups: net.bugs.usg
.\" Subject: /etc/magic's format isn't well documented
.\" Message-ID: <2752@sun.uucp>
.\" 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.

114
external/bsd/file/dist/file2netbsd vendored Executable file
View file

@ -0,0 +1,114 @@
#! /bin/sh
#
# $NetBSD: file2netbsd,v 1.2 2009/05/08 16:40:10 christos Exp $
#
# Copyright (c) 2003 The NetBSD Foundation, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# file2netbsd: convert a file source tree into a
# format suitable for import. Works on current dir.
# You can run this only once if you want it to work.
#
# based on texinfo2netbsd
#
if [ -z "$1" ]
then
echo "Usage $0: <file-version>" 1>&2
exit 1
fi
file_vers="$1"
#
# (usually) NO NEED TO EDIT BELOW THIS LINE
#
### Wipe out stuff we don't want
rm -f .cvsignore
### Remove the $'s around RCS tags
find . -type f -print | xargs egrep -l '\$(Id|Date|Header|Log|Revision)'\
| while read f; do
sed -e 's/\$\(Id.*\) \$/\1/' \
-e 's/\$\(Date.*\) \$/\1/' \
-e 's/\$\(Header.*\) \$/\1/' \
-e 's/\$\(Log.*\) \$/\1/' \
-e 's/\$\(Revision.*\) \$/\1/' \
$f > /tmp/file2$$ && mv /tmp/file2$$ $f && \
echo removed RCS tag from $f
done
### Add NetBSD RCS Id
find . -type f -name '*.[chly]' -print | while read c; do
sed -e '1{/$NetBSD/!{i\
/* \$NetBSD\$ */\
};}
/#ifndef[ ]lint/{N;/FILE_RCSID/s/\n/\
#if 0\
/
a\
#else\
__RCSID("\$NetBSD\$");\
#endif
}' $c > /tmp/file3$$
mv /tmp/file3$$ $c && echo did source mods for $c
done
#### Move files to proper names
mv -f doc/file.man doc/file.1
mv -f doc/libmagic.man doc/libmagic.3
mv -f doc/magic.man doc/magic.5
#### Add RCS tags to man pages
find . -type f -name '*.[0-9]' -print | while read m; do
sed -e '1{/$NetBSD/!i\
.\\" \$NetBSD\$\
.\\"
}' -e 's/__CSECTION__/1/g' \
-e 's/__FSECTION__/5/g' \
-e 's/__VERSION__/'"${file_vers}/g" \
-e 's,__MAGIC__,/usr/share/misc/magic,g' \
$m > /tmp/file4$$
mv /tmp/file4$$ $m && echo did manpage mods for $m
done
#### de-"capsize" the magdir
mv magic/Magdir magic/magdir
#### Make building easier, don't build magic and doc
echo '/^SUBDIRS/
t.
s/^/#/
-
s/ magic.*//
wq' | ed Makefile.in > /dev/null 2>&1
echo done
echo You can import now. Use the following command:
echo cvs import src/external/bsd/file/dist CHRISTOS FILE${file_vers%.*}_${file_vers#*.}
exit 0

507
external/bsd/file/dist/install-sh vendored Executable file
View file

@ -0,0 +1,507 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2006-10-14.15
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
posix_glob=
posix_mkdir=
# Desired mode of installed file.
mode=0755
chmodcmd=$chmodprog
chowncmd=
chgrpcmd=
stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=
dst=
dir_arg=
dstarg=
no_target_directory=
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
-c (ignored)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
--help display this help and exit.
--version display version info and exit.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) shift
continue;;
-d) dir_arg=true
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
shift
shift
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t) dstarg=$2
shift
shift
continue;;
-T) no_target_directory=true
shift
continue;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
done
if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dstarg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
shift # fnord
fi
shift # arg
dstarg=$arg
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src ;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dstarg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dstarg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst ;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dstarg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix=/ ;;
-*) prefix=./ ;;
*) prefix= ;;
esac
case $posix_glob in
'')
if (set -f) 2>/dev/null; then
posix_glob=true
else
posix_glob=false
fi ;;
esac
oIFS=$IFS
IFS=/
$posix_glob && set -f
set fnord $dstdir
shift
$posix_glob && set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
if test -f "$dst"; then
$doit $rmcmd -f "$dst" 2>/dev/null \
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|| {
echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
} || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

7050
external/bsd/file/dist/ltmain.sh vendored Normal file

File diff suppressed because it is too large Load diff

5
external/bsd/file/dist/magic/Header vendored Normal file
View file

@ -0,0 +1,5 @@
# Magic
# Magic data for file(1) command.
# Machine-generated from src/cmd/file/magdir/*; edit there only!
# Format is described in magic(files), where:
# files is 5 on V7 and BSD, 4 on SV, and ?? in the SVID.

View file

@ -0,0 +1,7 @@
#------------------------------------------------------------------------------
# Localstuff: file(1) magic for locally observed files
#
# $File: Localstuff,v 1.4 2003/03/23 04:17:27 christos Exp $
# Add any locally observed files here. Remember:
# text if readable, executable if runnable binary, data if unreadable.

238
external/bsd/file/dist/magic/Makefile.am vendored Normal file
View file

@ -0,0 +1,238 @@
#
# $File: Makefile.am,v 1.45 2009/03/05 22:40:59 christos Exp $
#
MAGIC_FRAGMENT_BASE = magdir
MAGIC_FRAGMENT_DIR = $(top_srcdir)/magic/$(MAGIC_FRAGMENT_BASE)
pkgdata_DATA = magic.mgc
EXTRA_DIST = Header Localstuff \
$(MAGIC_FRAGMENT_DIR)/acorn \
$(MAGIC_FRAGMENT_DIR)/adi \
$(MAGIC_FRAGMENT_DIR)/adventure \
$(MAGIC_FRAGMENT_DIR)/allegro \
$(MAGIC_FRAGMENT_DIR)/alliant \
$(MAGIC_FRAGMENT_DIR)/alpha \
$(MAGIC_FRAGMENT_DIR)/amanda \
$(MAGIC_FRAGMENT_DIR)/amigaos \
$(MAGIC_FRAGMENT_DIR)/animation \
$(MAGIC_FRAGMENT_DIR)/apl \
$(MAGIC_FRAGMENT_DIR)/apple \
$(MAGIC_FRAGMENT_DIR)/applix \
$(MAGIC_FRAGMENT_DIR)/archive \
$(MAGIC_FRAGMENT_DIR)/asterix \
$(MAGIC_FRAGMENT_DIR)/att3b \
$(MAGIC_FRAGMENT_DIR)/audio \
$(MAGIC_FRAGMENT_DIR)/basis \
$(MAGIC_FRAGMENT_DIR)/bflt \
$(MAGIC_FRAGMENT_DIR)/blender \
$(MAGIC_FRAGMENT_DIR)/blit \
$(MAGIC_FRAGMENT_DIR)/bout \
$(MAGIC_FRAGMENT_DIR)/bsdi \
$(MAGIC_FRAGMENT_DIR)/btsnoop \
$(MAGIC_FRAGMENT_DIR)/c-lang \
$(MAGIC_FRAGMENT_DIR)/c64 \
$(MAGIC_FRAGMENT_DIR)/cad \
$(MAGIC_FRAGMENT_DIR)/cafebabe \
$(MAGIC_FRAGMENT_DIR)/cddb \
$(MAGIC_FRAGMENT_DIR)/chord \
$(MAGIC_FRAGMENT_DIR)/cisco \
$(MAGIC_FRAGMENT_DIR)/citrus \
$(MAGIC_FRAGMENT_DIR)/clarion \
$(MAGIC_FRAGMENT_DIR)/claris \
$(MAGIC_FRAGMENT_DIR)/clipper \
$(MAGIC_FRAGMENT_DIR)/commands \
$(MAGIC_FRAGMENT_DIR)/communications \
$(MAGIC_FRAGMENT_DIR)/compress \
$(MAGIC_FRAGMENT_DIR)/console \
$(MAGIC_FRAGMENT_DIR)/convex \
$(MAGIC_FRAGMENT_DIR)/cracklib \
$(MAGIC_FRAGMENT_DIR)/ctags \
$(MAGIC_FRAGMENT_DIR)/dact \
$(MAGIC_FRAGMENT_DIR)/database \
$(MAGIC_FRAGMENT_DIR)/diamond \
$(MAGIC_FRAGMENT_DIR)/diff \
$(MAGIC_FRAGMENT_DIR)/digital \
$(MAGIC_FRAGMENT_DIR)/dolby \
$(MAGIC_FRAGMENT_DIR)/dump \
$(MAGIC_FRAGMENT_DIR)/dyadic \
$(MAGIC_FRAGMENT_DIR)/editors \
$(MAGIC_FRAGMENT_DIR)/efi \
$(MAGIC_FRAGMENT_DIR)/elf \
$(MAGIC_FRAGMENT_DIR)/encore \
$(MAGIC_FRAGMENT_DIR)/epoc \
$(MAGIC_FRAGMENT_DIR)/erlang \
$(MAGIC_FRAGMENT_DIR)/esri \
$(MAGIC_FRAGMENT_DIR)/fcs \
$(MAGIC_FRAGMENT_DIR)/filesystems \
$(MAGIC_FRAGMENT_DIR)/flash \
$(MAGIC_FRAGMENT_DIR)/fonts \
$(MAGIC_FRAGMENT_DIR)/fortran \
$(MAGIC_FRAGMENT_DIR)/frame \
$(MAGIC_FRAGMENT_DIR)/freebsd \
$(MAGIC_FRAGMENT_DIR)/fsav \
$(MAGIC_FRAGMENT_DIR)/games \
$(MAGIC_FRAGMENT_DIR)/gcc \
$(MAGIC_FRAGMENT_DIR)/geos \
$(MAGIC_FRAGMENT_DIR)/gimp \
$(MAGIC_FRAGMENT_DIR)/gnome-keyring \
$(MAGIC_FRAGMENT_DIR)/gnu \
$(MAGIC_FRAGMENT_DIR)/gnumeric \
$(MAGIC_FRAGMENT_DIR)/grace \
$(MAGIC_FRAGMENT_DIR)/graphviz \
$(MAGIC_FRAGMENT_DIR)/gringotts \
$(MAGIC_FRAGMENT_DIR)/hitachi-sh \
$(MAGIC_FRAGMENT_DIR)/hp \
$(MAGIC_FRAGMENT_DIR)/human68k \
$(MAGIC_FRAGMENT_DIR)/ibm370 \
$(MAGIC_FRAGMENT_DIR)/ibm6000 \
$(MAGIC_FRAGMENT_DIR)/iff \
$(MAGIC_FRAGMENT_DIR)/images \
$(MAGIC_FRAGMENT_DIR)/inform \
$(MAGIC_FRAGMENT_DIR)/intel \
$(MAGIC_FRAGMENT_DIR)/interleaf \
$(MAGIC_FRAGMENT_DIR)/island \
$(MAGIC_FRAGMENT_DIR)/ispell \
$(MAGIC_FRAGMENT_DIR)/java \
$(MAGIC_FRAGMENT_DIR)/jpeg \
$(MAGIC_FRAGMENT_DIR)/karma \
$(MAGIC_FRAGMENT_DIR)/kde \
$(MAGIC_FRAGMENT_DIR)/kml \
$(MAGIC_FRAGMENT_DIR)/lecter \
$(MAGIC_FRAGMENT_DIR)/lex \
$(MAGIC_FRAGMENT_DIR)/lif \
$(MAGIC_FRAGMENT_DIR)/linux \
$(MAGIC_FRAGMENT_DIR)/lisp \
$(MAGIC_FRAGMENT_DIR)/llvm \
$(MAGIC_FRAGMENT_DIR)/lua \
$(MAGIC_FRAGMENT_DIR)/luks \
$(MAGIC_FRAGMENT_DIR)/mach \
$(MAGIC_FRAGMENT_DIR)/macintosh \
$(MAGIC_FRAGMENT_DIR)/magic \
$(MAGIC_FRAGMENT_DIR)/mail.news \
$(MAGIC_FRAGMENT_DIR)/maple \
$(MAGIC_FRAGMENT_DIR)/mathcad \
$(MAGIC_FRAGMENT_DIR)/mathematica \
$(MAGIC_FRAGMENT_DIR)/matroska \
$(MAGIC_FRAGMENT_DIR)/mcrypt \
$(MAGIC_FRAGMENT_DIR)/mercurial \
$(MAGIC_FRAGMENT_DIR)/mime \
$(MAGIC_FRAGMENT_DIR)/mips \
$(MAGIC_FRAGMENT_DIR)/mirage \
$(MAGIC_FRAGMENT_DIR)/misctools \
$(MAGIC_FRAGMENT_DIR)/mkid \
$(MAGIC_FRAGMENT_DIR)/mlssa \
$(MAGIC_FRAGMENT_DIR)/mmdf \
$(MAGIC_FRAGMENT_DIR)/modem \
$(MAGIC_FRAGMENT_DIR)/motorola \
$(MAGIC_FRAGMENT_DIR)/mozilla \
$(MAGIC_FRAGMENT_DIR)/msdos \
$(MAGIC_FRAGMENT_DIR)/msvc \
$(MAGIC_FRAGMENT_DIR)/mup \
$(MAGIC_FRAGMENT_DIR)/natinst \
$(MAGIC_FRAGMENT_DIR)/ncr \
$(MAGIC_FRAGMENT_DIR)/netbsd \
$(MAGIC_FRAGMENT_DIR)/netscape \
$(MAGIC_FRAGMENT_DIR)/netware \
$(MAGIC_FRAGMENT_DIR)/news \
$(MAGIC_FRAGMENT_DIR)/nitpicker \
$(MAGIC_FRAGMENT_DIR)/ocaml \
$(MAGIC_FRAGMENT_DIR)/octave \
$(MAGIC_FRAGMENT_DIR)/ole2compounddocs \
$(MAGIC_FRAGMENT_DIR)/olf \
$(MAGIC_FRAGMENT_DIR)/os2 \
$(MAGIC_FRAGMENT_DIR)/os400 \
$(MAGIC_FRAGMENT_DIR)/os9 \
$(MAGIC_FRAGMENT_DIR)/osf1 \
$(MAGIC_FRAGMENT_DIR)/palm \
$(MAGIC_FRAGMENT_DIR)/parix \
$(MAGIC_FRAGMENT_DIR)/pbm \
$(MAGIC_FRAGMENT_DIR)/pdf \
$(MAGIC_FRAGMENT_DIR)/pdp \
$(MAGIC_FRAGMENT_DIR)/perl \
$(MAGIC_FRAGMENT_DIR)/pgp \
$(MAGIC_FRAGMENT_DIR)/pkgadd \
$(MAGIC_FRAGMENT_DIR)/plan9 \
$(MAGIC_FRAGMENT_DIR)/plus5 \
$(MAGIC_FRAGMENT_DIR)/printer \
$(MAGIC_FRAGMENT_DIR)/project \
$(MAGIC_FRAGMENT_DIR)/psdbms \
$(MAGIC_FRAGMENT_DIR)/psion \
$(MAGIC_FRAGMENT_DIR)/pulsar \
$(MAGIC_FRAGMENT_DIR)/pyramid \
$(MAGIC_FRAGMENT_DIR)/python \
$(MAGIC_FRAGMENT_DIR)/revision \
$(MAGIC_FRAGMENT_DIR)/riff \
$(MAGIC_FRAGMENT_DIR)/rpm \
$(MAGIC_FRAGMENT_DIR)/rtf \
$(MAGIC_FRAGMENT_DIR)/ruby \
$(MAGIC_FRAGMENT_DIR)/sc \
$(MAGIC_FRAGMENT_DIR)/sccs \
$(MAGIC_FRAGMENT_DIR)/scientific \
$(MAGIC_FRAGMENT_DIR)/securitycerts \
$(MAGIC_FRAGMENT_DIR)/sendmail \
$(MAGIC_FRAGMENT_DIR)/sequent \
$(MAGIC_FRAGMENT_DIR)/sgi \
$(MAGIC_FRAGMENT_DIR)/sgml \
$(MAGIC_FRAGMENT_DIR)/sharc \
$(MAGIC_FRAGMENT_DIR)/sinclair \
$(MAGIC_FRAGMENT_DIR)/sketch \
$(MAGIC_FRAGMENT_DIR)/smalltalk \
$(MAGIC_FRAGMENT_DIR)/sniffer \
$(MAGIC_FRAGMENT_DIR)/softquad \
$(MAGIC_FRAGMENT_DIR)/spec \
$(MAGIC_FRAGMENT_DIR)/spectrum \
$(MAGIC_FRAGMENT_DIR)/sql \
$(MAGIC_FRAGMENT_DIR)/sun \
$(MAGIC_FRAGMENT_DIR)/sysex \
$(MAGIC_FRAGMENT_DIR)/teapot \
$(MAGIC_FRAGMENT_DIR)/terminfo \
$(MAGIC_FRAGMENT_DIR)/tex \
$(MAGIC_FRAGMENT_DIR)/tgif \
$(MAGIC_FRAGMENT_DIR)/ti-8x \
$(MAGIC_FRAGMENT_DIR)/timezone \
$(MAGIC_FRAGMENT_DIR)/troff \
$(MAGIC_FRAGMENT_DIR)/tuxedo \
$(MAGIC_FRAGMENT_DIR)/typeset \
$(MAGIC_FRAGMENT_DIR)/unicode \
$(MAGIC_FRAGMENT_DIR)/unknown \
$(MAGIC_FRAGMENT_DIR)/uuencode \
$(MAGIC_FRAGMENT_DIR)/varied.out \
$(MAGIC_FRAGMENT_DIR)/varied.script \
$(MAGIC_FRAGMENT_DIR)/vax \
$(MAGIC_FRAGMENT_DIR)/vicar \
$(MAGIC_FRAGMENT_DIR)/virtutech \
$(MAGIC_FRAGMENT_DIR)/visx \
$(MAGIC_FRAGMENT_DIR)/vms \
$(MAGIC_FRAGMENT_DIR)/vmware \
$(MAGIC_FRAGMENT_DIR)/vorbis \
$(MAGIC_FRAGMENT_DIR)/vxl \
$(MAGIC_FRAGMENT_DIR)/warc \
$(MAGIC_FRAGMENT_DIR)/weak \
$(MAGIC_FRAGMENT_DIR)/windows \
$(MAGIC_FRAGMENT_DIR)/wireless \
$(MAGIC_FRAGMENT_DIR)/wordprocessors \
$(MAGIC_FRAGMENT_DIR)/xdelta \
$(MAGIC_FRAGMENT_DIR)/xenix \
$(MAGIC_FRAGMENT_DIR)/xilinx \
$(MAGIC_FRAGMENT_DIR)/xo65 \
$(MAGIC_FRAGMENT_DIR)/xwindows \
$(MAGIC_FRAGMENT_DIR)/zilog \
$(MAGIC_FRAGMENT_DIR)/zyxel
MAGIC = magic.mgc
CLEANFILES = ${MAGIC}
# FIXME: Build file natively as well so that it can be used to compile
# the target's magic file
if IS_CROSS_COMPILE
FILE_COMPILE = file
FILE_COMPILE_DEP =
else
FILE_COMPILE = $(top_builddir)/src/file
FILE_COMPILE_DEP = $(FILE_COMPILE)
endif
${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP)
$(FILE_COMPILE) -C -m $(MAGIC_FRAGMENT_DIR)
@mv $(MAGIC_FRAGMENT_BASE).mgc $@

591
external/bsd/file/dist/magic/Makefile.in vendored Normal file
View file

@ -0,0 +1,591 @@
# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 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.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = magic
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.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(pkgdatadir)"
pkgdataDATA_INSTALL = $(INSTALL_DATA)
DATA = $(pkgdata_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
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@
DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NMEDIT = @NMEDIT@
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@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
WARNINGS = @WARNINGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
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@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
fsect = @fsect@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
#
# $File: Makefile.am,v 1.45 2009/03/05 22:40:59 christos Exp $
#
MAGIC_FRAGMENT_BASE = magdir
MAGIC_FRAGMENT_DIR = $(top_srcdir)/magic/$(MAGIC_FRAGMENT_BASE)
pkgdata_DATA = magic.mgc
EXTRA_DIST = Header Localstuff \
$(MAGIC_FRAGMENT_DIR)/acorn \
$(MAGIC_FRAGMENT_DIR)/adi \
$(MAGIC_FRAGMENT_DIR)/adventure \
$(MAGIC_FRAGMENT_DIR)/allegro \
$(MAGIC_FRAGMENT_DIR)/alliant \
$(MAGIC_FRAGMENT_DIR)/alpha \
$(MAGIC_FRAGMENT_DIR)/amanda \
$(MAGIC_FRAGMENT_DIR)/amigaos \
$(MAGIC_FRAGMENT_DIR)/animation \
$(MAGIC_FRAGMENT_DIR)/apl \
$(MAGIC_FRAGMENT_DIR)/apple \
$(MAGIC_FRAGMENT_DIR)/applix \
$(MAGIC_FRAGMENT_DIR)/archive \
$(MAGIC_FRAGMENT_DIR)/asterix \
$(MAGIC_FRAGMENT_DIR)/att3b \
$(MAGIC_FRAGMENT_DIR)/audio \
$(MAGIC_FRAGMENT_DIR)/basis \
$(MAGIC_FRAGMENT_DIR)/bflt \
$(MAGIC_FRAGMENT_DIR)/blender \
$(MAGIC_FRAGMENT_DIR)/blit \
$(MAGIC_FRAGMENT_DIR)/bout \
$(MAGIC_FRAGMENT_DIR)/bsdi \
$(MAGIC_FRAGMENT_DIR)/btsnoop \
$(MAGIC_FRAGMENT_DIR)/c-lang \
$(MAGIC_FRAGMENT_DIR)/c64 \
$(MAGIC_FRAGMENT_DIR)/cad \
$(MAGIC_FRAGMENT_DIR)/cafebabe \
$(MAGIC_FRAGMENT_DIR)/cddb \
$(MAGIC_FRAGMENT_DIR)/chord \
$(MAGIC_FRAGMENT_DIR)/cisco \
$(MAGIC_FRAGMENT_DIR)/citrus \
$(MAGIC_FRAGMENT_DIR)/clarion \
$(MAGIC_FRAGMENT_DIR)/claris \
$(MAGIC_FRAGMENT_DIR)/clipper \
$(MAGIC_FRAGMENT_DIR)/commands \
$(MAGIC_FRAGMENT_DIR)/communications \
$(MAGIC_FRAGMENT_DIR)/compress \
$(MAGIC_FRAGMENT_DIR)/console \
$(MAGIC_FRAGMENT_DIR)/convex \
$(MAGIC_FRAGMENT_DIR)/cracklib \
$(MAGIC_FRAGMENT_DIR)/ctags \
$(MAGIC_FRAGMENT_DIR)/dact \
$(MAGIC_FRAGMENT_DIR)/database \
$(MAGIC_FRAGMENT_DIR)/diamond \
$(MAGIC_FRAGMENT_DIR)/diff \
$(MAGIC_FRAGMENT_DIR)/digital \
$(MAGIC_FRAGMENT_DIR)/dolby \
$(MAGIC_FRAGMENT_DIR)/dump \
$(MAGIC_FRAGMENT_DIR)/dyadic \
$(MAGIC_FRAGMENT_DIR)/editors \
$(MAGIC_FRAGMENT_DIR)/efi \
$(MAGIC_FRAGMENT_DIR)/elf \
$(MAGIC_FRAGMENT_DIR)/encore \
$(MAGIC_FRAGMENT_DIR)/epoc \
$(MAGIC_FRAGMENT_DIR)/erlang \
$(MAGIC_FRAGMENT_DIR)/esri \
$(MAGIC_FRAGMENT_DIR)/fcs \
$(MAGIC_FRAGMENT_DIR)/filesystems \
$(MAGIC_FRAGMENT_DIR)/flash \
$(MAGIC_FRAGMENT_DIR)/fonts \
$(MAGIC_FRAGMENT_DIR)/fortran \
$(MAGIC_FRAGMENT_DIR)/frame \
$(MAGIC_FRAGMENT_DIR)/freebsd \
$(MAGIC_FRAGMENT_DIR)/fsav \
$(MAGIC_FRAGMENT_DIR)/games \
$(MAGIC_FRAGMENT_DIR)/gcc \
$(MAGIC_FRAGMENT_DIR)/geos \
$(MAGIC_FRAGMENT_DIR)/gimp \
$(MAGIC_FRAGMENT_DIR)/gnome-keyring \
$(MAGIC_FRAGMENT_DIR)/gnu \
$(MAGIC_FRAGMENT_DIR)/gnumeric \
$(MAGIC_FRAGMENT_DIR)/grace \
$(MAGIC_FRAGMENT_DIR)/graphviz \
$(MAGIC_FRAGMENT_DIR)/gringotts \
$(MAGIC_FRAGMENT_DIR)/hitachi-sh \
$(MAGIC_FRAGMENT_DIR)/hp \
$(MAGIC_FRAGMENT_DIR)/human68k \
$(MAGIC_FRAGMENT_DIR)/ibm370 \
$(MAGIC_FRAGMENT_DIR)/ibm6000 \
$(MAGIC_FRAGMENT_DIR)/iff \
$(MAGIC_FRAGMENT_DIR)/images \
$(MAGIC_FRAGMENT_DIR)/inform \
$(MAGIC_FRAGMENT_DIR)/intel \
$(MAGIC_FRAGMENT_DIR)/interleaf \
$(MAGIC_FRAGMENT_DIR)/island \
$(MAGIC_FRAGMENT_DIR)/ispell \
$(MAGIC_FRAGMENT_DIR)/java \
$(MAGIC_FRAGMENT_DIR)/jpeg \
$(MAGIC_FRAGMENT_DIR)/karma \
$(MAGIC_FRAGMENT_DIR)/kde \
$(MAGIC_FRAGMENT_DIR)/kml \
$(MAGIC_FRAGMENT_DIR)/lecter \
$(MAGIC_FRAGMENT_DIR)/lex \
$(MAGIC_FRAGMENT_DIR)/lif \
$(MAGIC_FRAGMENT_DIR)/linux \
$(MAGIC_FRAGMENT_DIR)/lisp \
$(MAGIC_FRAGMENT_DIR)/llvm \
$(MAGIC_FRAGMENT_DIR)/lua \
$(MAGIC_FRAGMENT_DIR)/luks \
$(MAGIC_FRAGMENT_DIR)/mach \
$(MAGIC_FRAGMENT_DIR)/macintosh \
$(MAGIC_FRAGMENT_DIR)/magic \
$(MAGIC_FRAGMENT_DIR)/mail.news \
$(MAGIC_FRAGMENT_DIR)/maple \
$(MAGIC_FRAGMENT_DIR)/mathcad \
$(MAGIC_FRAGMENT_DIR)/mathematica \
$(MAGIC_FRAGMENT_DIR)/matroska \
$(MAGIC_FRAGMENT_DIR)/mcrypt \
$(MAGIC_FRAGMENT_DIR)/mercurial \
$(MAGIC_FRAGMENT_DIR)/mime \
$(MAGIC_FRAGMENT_DIR)/mips \
$(MAGIC_FRAGMENT_DIR)/mirage \
$(MAGIC_FRAGMENT_DIR)/misctools \
$(MAGIC_FRAGMENT_DIR)/mkid \
$(MAGIC_FRAGMENT_DIR)/mlssa \
$(MAGIC_FRAGMENT_DIR)/mmdf \
$(MAGIC_FRAGMENT_DIR)/modem \
$(MAGIC_FRAGMENT_DIR)/motorola \
$(MAGIC_FRAGMENT_DIR)/mozilla \
$(MAGIC_FRAGMENT_DIR)/msdos \
$(MAGIC_FRAGMENT_DIR)/msvc \
$(MAGIC_FRAGMENT_DIR)/mup \
$(MAGIC_FRAGMENT_DIR)/natinst \
$(MAGIC_FRAGMENT_DIR)/ncr \
$(MAGIC_FRAGMENT_DIR)/netbsd \
$(MAGIC_FRAGMENT_DIR)/netscape \
$(MAGIC_FRAGMENT_DIR)/netware \
$(MAGIC_FRAGMENT_DIR)/news \
$(MAGIC_FRAGMENT_DIR)/nitpicker \
$(MAGIC_FRAGMENT_DIR)/ocaml \
$(MAGIC_FRAGMENT_DIR)/octave \
$(MAGIC_FRAGMENT_DIR)/ole2compounddocs \
$(MAGIC_FRAGMENT_DIR)/olf \
$(MAGIC_FRAGMENT_DIR)/os2 \
$(MAGIC_FRAGMENT_DIR)/os400 \
$(MAGIC_FRAGMENT_DIR)/os9 \
$(MAGIC_FRAGMENT_DIR)/osf1 \
$(MAGIC_FRAGMENT_DIR)/palm \
$(MAGIC_FRAGMENT_DIR)/parix \
$(MAGIC_FRAGMENT_DIR)/pbm \
$(MAGIC_FRAGMENT_DIR)/pdf \
$(MAGIC_FRAGMENT_DIR)/pdp \
$(MAGIC_FRAGMENT_DIR)/perl \
$(MAGIC_FRAGMENT_DIR)/pgp \
$(MAGIC_FRAGMENT_DIR)/pkgadd \
$(MAGIC_FRAGMENT_DIR)/plan9 \
$(MAGIC_FRAGMENT_DIR)/plus5 \
$(MAGIC_FRAGMENT_DIR)/printer \
$(MAGIC_FRAGMENT_DIR)/project \
$(MAGIC_FRAGMENT_DIR)/psdbms \
$(MAGIC_FRAGMENT_DIR)/psion \
$(MAGIC_FRAGMENT_DIR)/pulsar \
$(MAGIC_FRAGMENT_DIR)/pyramid \
$(MAGIC_FRAGMENT_DIR)/python \
$(MAGIC_FRAGMENT_DIR)/revision \
$(MAGIC_FRAGMENT_DIR)/riff \
$(MAGIC_FRAGMENT_DIR)/rpm \
$(MAGIC_FRAGMENT_DIR)/rtf \
$(MAGIC_FRAGMENT_DIR)/ruby \
$(MAGIC_FRAGMENT_DIR)/sc \
$(MAGIC_FRAGMENT_DIR)/sccs \
$(MAGIC_FRAGMENT_DIR)/scientific \
$(MAGIC_FRAGMENT_DIR)/securitycerts \
$(MAGIC_FRAGMENT_DIR)/sendmail \
$(MAGIC_FRAGMENT_DIR)/sequent \
$(MAGIC_FRAGMENT_DIR)/sgi \
$(MAGIC_FRAGMENT_DIR)/sgml \
$(MAGIC_FRAGMENT_DIR)/sharc \
$(MAGIC_FRAGMENT_DIR)/sinclair \
$(MAGIC_FRAGMENT_DIR)/sketch \
$(MAGIC_FRAGMENT_DIR)/smalltalk \
$(MAGIC_FRAGMENT_DIR)/sniffer \
$(MAGIC_FRAGMENT_DIR)/softquad \
$(MAGIC_FRAGMENT_DIR)/spec \
$(MAGIC_FRAGMENT_DIR)/spectrum \
$(MAGIC_FRAGMENT_DIR)/sql \
$(MAGIC_FRAGMENT_DIR)/sun \
$(MAGIC_FRAGMENT_DIR)/sysex \
$(MAGIC_FRAGMENT_DIR)/teapot \
$(MAGIC_FRAGMENT_DIR)/terminfo \
$(MAGIC_FRAGMENT_DIR)/tex \
$(MAGIC_FRAGMENT_DIR)/tgif \
$(MAGIC_FRAGMENT_DIR)/ti-8x \
$(MAGIC_FRAGMENT_DIR)/timezone \
$(MAGIC_FRAGMENT_DIR)/troff \
$(MAGIC_FRAGMENT_DIR)/tuxedo \
$(MAGIC_FRAGMENT_DIR)/typeset \
$(MAGIC_FRAGMENT_DIR)/unicode \
$(MAGIC_FRAGMENT_DIR)/unknown \
$(MAGIC_FRAGMENT_DIR)/uuencode \
$(MAGIC_FRAGMENT_DIR)/varied.out \
$(MAGIC_FRAGMENT_DIR)/varied.script \
$(MAGIC_FRAGMENT_DIR)/vax \
$(MAGIC_FRAGMENT_DIR)/vicar \
$(MAGIC_FRAGMENT_DIR)/virtutech \
$(MAGIC_FRAGMENT_DIR)/visx \
$(MAGIC_FRAGMENT_DIR)/vms \
$(MAGIC_FRAGMENT_DIR)/vmware \
$(MAGIC_FRAGMENT_DIR)/vorbis \
$(MAGIC_FRAGMENT_DIR)/vxl \
$(MAGIC_FRAGMENT_DIR)/warc \
$(MAGIC_FRAGMENT_DIR)/weak \
$(MAGIC_FRAGMENT_DIR)/windows \
$(MAGIC_FRAGMENT_DIR)/wireless \
$(MAGIC_FRAGMENT_DIR)/wordprocessors \
$(MAGIC_FRAGMENT_DIR)/xdelta \
$(MAGIC_FRAGMENT_DIR)/xenix \
$(MAGIC_FRAGMENT_DIR)/xilinx \
$(MAGIC_FRAGMENT_DIR)/xo65 \
$(MAGIC_FRAGMENT_DIR)/xwindows \
$(MAGIC_FRAGMENT_DIR)/zilog \
$(MAGIC_FRAGMENT_DIR)/zyxel
MAGIC = magic.mgc
CLEANFILES = ${MAGIC}
@IS_CROSS_COMPILE_FALSE@FILE_COMPILE = $(top_builddir)/src/file
# FIXME: Build file natively as well so that it can be used to compile
# the target's magic file
@IS_CROSS_COMPILE_TRUE@FILE_COMPILE = file
@IS_CROSS_COMPILE_FALSE@FILE_COMPILE_DEP = $(FILE_COMPILE)
@IS_CROSS_COMPILE_TRUE@FILE_COMPILE_DEP =
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(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 magic/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu magic/Makefile
.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: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-pkgdataDATA: $(pkgdata_DATA)
@$(NORMAL_INSTALL)
test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
@list='$(pkgdata_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \
$(pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \
done
uninstall-pkgdataDATA:
@$(NORMAL_UNINSTALL)
@list='$(pkgdata_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
done
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(DATA)
installdirs:
for dir in "$(DESTDIR)$(pkgdatadir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-pkgdataDATA
install-dvi: install-dvi-am
install-exec-am:
install-html: install-html-am
install-info: install-info-am
install-man:
install-pdf: install-pdf-am
install-ps: install-ps-am
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-pkgdataDATA
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-pkgdataDATA install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
uninstall uninstall-am uninstall-pkgdataDATA
${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP)
$(FILE_COMPILE) -C -m $(MAGIC_FRAGMENT_DIR)
@mv $(MAGIC_FRAGMENT_BASE).mgc $@
# 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:

View file

@ -0,0 +1,67 @@
#------------------------------------------------------------------------------
# acorn: file(1) magic for files found on Acorn systems
#
# RISC OS Chunk File Format
# From RISC OS Programmer's Reference Manual, Appendix D
# We guess the file type from the type of the first chunk.
0 lelong 0xc3cbc6c5 RISC OS Chunk data
>12 string OBJ_ \b, AOF object
>12 string LIB_ \b, ALF library
# RISC OS AIF, contains "SWI OS_Exit" at offset 16.
16 lelong 0xef000011 RISC OS AIF executable
# RISC OS Draw files
# From RISC OS Programmer's Reference Manual, Appendix E
0 string Draw RISC OS Draw file data
# RISC OS new format font files
# From RISC OS Programmer's Reference Manual, Appendix E
0 string FONT\0 RISC OS outline font data,
>5 byte x version %d
0 string FONT\1 RISC OS 1bpp font data,
>5 byte x version %d
0 string FONT\4 RISC OS 4bpp font data
>5 byte x version %d
# RISC OS Music files
# From RISC OS Programmer's Reference Manual, Appendix E
0 string Maestro\r RISC OS music file
>8 byte x version %d
>8 byte x type %d
# Digital Symphony data files
# From: Bernard Jungen (bern8817@euphonynet.be)
0 string \x02\x01\x13\x13\x13\x01\x0d\x10 Digital Symphony sound sample (RISC OS),
>8 byte x version %d,
>9 pstring x named "%s",
>(9.b+19) byte =0 8-bit logarithmic
>(9.b+19) byte =1 LZW-compressed linear
>(9.b+19) byte =2 8-bit linear signed
>(9.b+19) byte =3 16-bit linear signed
>(9.b+19) byte =4 SigmaDelta-compressed linear
>(9.b+19) byte =5 SigmaDelta-compressed logarithmic
>(9.b+19) byte >5 unknown format
0 string \x02\x01\x13\x13\x14\x12\x01\x0b Digital Symphony song (RISC OS),
>8 byte x version %d,
>9 byte =1 1 voice,
>9 byte !1 %d voices,
>10 leshort =1 1 track,
>10 leshort !1 %d tracks,
>12 leshort =1 1 pattern
>12 leshort !1 %d patterns
0 string \x02\x01\x13\x13\x10\x14\x12\x0e
>9 byte =0 Digital Symphony sequence (RISC OS),
>>8 byte x version %d,
>>10 byte =1 1 line,
>>10 byte !1 %d lines,
>>11 leshort =1 1 position
>>11 leshort !1 %d positions
>9 byte =1 Digital Symphony pattern data (RISC OS),
>>8 byte x version %d,
>>10 leshort =1 1 pattern
>>10 leshort !1 %d patterns

12
external/bsd/file/dist/magic/magdir/adi vendored Normal file
View file

@ -0,0 +1,12 @@
#------------------------------------------------------------------------------
# adi: file(1) magic for ADi's objects
# From Gregory McGarry <g.mcgarry@ieee.org>
#
0 leshort 0x521c COFF DSP21k
>18 lelong &02 executable,
>18 lelong ^02
>>18 lelong &01 static object,
>>18 lelong ^01 relocatable object,
>18 lelong &010 stripped
>18 lelong ^010 not stripped

View file

@ -0,0 +1,85 @@
#------------------------------------------------------------------------------
# adventure: file(1) magic for Adventure game files
#
# from Allen Garvin <earendil@faeryland.tamu-commerce.edu>
# Edited by Dave Chapeskie <dchapes@ddm.on.ca> Jun 28, 1998
# Edited by Chris Chittleborough <cchittleborough@yahoo.com.au>, March 2002
#
# ALAN
# I assume there are other, lower versions, but these are the only ones I
# saw in the archive.
0 beshort 0x0206 ALAN game data
>2 byte <10 version 2.6%d
# 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
# with a version string of the form "V2.<digit>.<digit>\0" (but TADS 3 is
# on the way).
# Game files start with "TADS2 bin\n\r\032\0" then the compiler version.
0 string TADS2\ bin TADS
>9 belong !0x0A0D1A00 game data, CORRUPTED
>9 belong 0x0A0D1A00
>>13 string >\0 %s game data
# Resource files start with "TADS2 rsc\n\r\032\0" then the compiler version.
0 string TADS2\ rsc TADS
>9 belong !0x0A0D1A00 resource data, CORRUPTED
>9 belong 0x0A0D1A00
>>13 string >\0 %s resource data
# Some saved game files start with "TADS2 save/g\n\r\032\0", a little-endian
# 2-byte length N, the N-char name of the game file *without* a NUL (darn!),
# "TADS2 save\n\r\032\0" and the interpreter version.
0 string TADS2\ save/g TADS
>12 belong !0x0A0D1A00 saved game data, CORRUPTED
>12 belong 0x0A0D1A00
>>(16.s+32) string >\0 %s saved game data
# Other saved game files start with "TADS2 save\n\r\032\0" and the interpreter
# version.
0 string TADS2\ save TADS
>10 belong !0x0A0D1A00 saved game data, CORRUPTED
>10 belong 0x0A0D1A00
>>14 string >\0 %s saved game data
# Danny Milosavljevic <danny.milo@gmx.net>
# this are adrift (adventure game standard) game files, extension .taf
# depending on version magic continues with 0x93453E6139FA (V 4.0)
# 0x9445376139FA (V 3.90)
# 0x9445366139FA (V 3.80)
# this is from source (http://www.adrift.org.uk/) and I have some taf
# files, and checked them.
#0 belong 0x3C423FC9
#>4 belong 0x6A87C2CF Adrift game file
#!:mime application/x-adrift

View file

@ -0,0 +1,7 @@
#------------------------------------------------------------------------------
# allegro: file(1) magic for Allegro datafiles
# Toby Deshane <hac@shoelace.digivill.net>
#
0 belong 0x736C6821 Allegro datafile (packed)
0 belong 0x736C682E Allegro datafile (not packed/autodetect)
0 belong 0x736C682B Allegro datafile (appended exe data)

View file

@ -0,0 +1,17 @@
#------------------------------------------------------------------------------
# alliant: file(1) magic for Alliant FX series a.out files
#
# If the FX series is the one that had a processor with a 68K-derived
# instruction set, the "short" should probably become "beshort" and the
# "long" should probably become "belong".
# If it's the i860-based one, they should probably become either the
# big-endian or little-endian versions, depending on the mode they ran
# the 860 in....
#
0 short 0420 0420 Alliant virtual executable
>2 short &0x0020 common library
>16 long >0 not stripped
0 short 0421 0421 Alliant compact executable
>2 short &0x0020 common library
>16 long >0 not stripped

View file

@ -0,0 +1,30 @@
#------------------------------------------------------------------------------
# alpha architecture description
#
0 leshort 0603 COFF format alpha
>22 leshort&030000 !020000 executable
>24 leshort 0410 pure
>24 leshort 0413 paged
>22 leshort&020000 !0 dynamically linked
>16 lelong !0 not stripped
>16 lelong 0 stripped
>22 leshort&030000 020000 shared library
>24 leshort 0407 object
>27 byte x - version %d
>26 byte x .%d
>28 byte x -%d
# Basic recognition of Digital UNIX core dumps - Mike Bremford <mike@opac.bl.uk>
#
# The actual magic number is just "Core", followed by a 2-byte version
# number; however, treating any file that begins with "Core" as a Digital
# UNIX core dump file may produce too many false hits, so we include one
# byte of the version number as well; DU 5.0 appears only to be up to
# version 2.
#
0 string Core\001 Alpha COFF format core dump (Digital UNIX)
>24 string >\0 \b, from '%s'
0 string Core\002 Alpha COFF format core dump (Digital UNIX)
>24 string >\0 \b, from '%s'

View file

@ -0,0 +1,10 @@
#------------------------------------------------------------------------------
# amanda: file(1) magic for amanda file format
#
0 string AMANDA:\ AMANDA
>8 string TAPESTART\ DATE tape header file,
>>23 string X
>>>25 string >\ Unused %s
>>23 string >\ DATE %s
>8 string FILE\ dump file,
>>13 string >\ DATE %s

View file

@ -0,0 +1,63 @@
#------------------------------------------------------------------------------
# amigaos: file(1) magic for AmigaOS binary formats:
#
# From ignatios@cs.uni-bonn.de (Ignatios Souvatzis)
#
0 belong 0x000003fa AmigaOS shared library
0 belong 0x000003f3 AmigaOS loadseg()ble executable/binary
0 belong 0x000003e7 AmigaOS object/library data
#
0 beshort 0xe310 Amiga Workbench
>2 beshort 1
>>48 byte 1 disk icon
>>48 byte 2 drawer icon
>>48 byte 3 tool icon
>>48 byte 4 project icon
>>48 byte 5 garbage icon
>>48 byte 6 device icon
>>48 byte 7 kickstart icon
>>48 byte 8 workbench application icon
>2 beshort >1 icon, vers. %d
#
# various sound formats from the Amiga
# G=F6tz Waschk <waschk@informatik.uni-rostock.de>
#
0 string FC14 Future Composer 1.4 Module sound file
0 string SMOD Future Composer 1.3 Module sound file
0 string AON4artofnoise Art Of Noise Module sound file
1 string MUGICIAN/SOFTEYES Mugician Module sound file
58 string SIDMON\ II\ -\ THE Sidmon 2.0 Module sound file
0 string Synth4.0 Synthesis Module sound file
0 string ARP. The Holy Noise Module sound file
0 string BeEp\0 JamCracker Module sound file
0 string COSO\0 Hippel-COSO Module sound file
# Too simple (short, pure ASCII, deep), MPi
#26 string V.3 Brian Postma's Soundmon Module sound file v3
#26 string BPSM Brian Postma's Soundmon Module sound file v3
#26 string V.2 Brian Postma's Soundmon Module sound file v2
# The following are from: "Stefan A. Haubenthal" <polluks@web.de>
0 beshort 0x0f00 AmigaOS bitmap font
0 beshort 0x0f03 AmigaOS outline font
0 belong 0x80001001 AmigaOS outline tag
0 string ##\ version catalog translation
0 string EMOD\0 Amiga E module
8 string ECXM\0 ECX module
0 string/c @database AmigaGuide file
# Amiga disk types
#
0 string RDSK Rigid Disk Block
>160 string x on %.24s
0 string DOS\0 Amiga DOS disk
0 string DOS\1 Amiga FFS disk
0 string DOS\2 Amiga Inter DOS disk
0 string DOS\3 Amiga Inter FFS disk
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)

View file

@ -0,0 +1,815 @@
#------------------------------------------------------------------------------
# animation: file(1) magic for animation/movie formats
#
# animation formats
# MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8)
# FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com)
# SGI and Apple formats
0 string MOVI Silicon Graphics movie file
!:mime video/x-sgi-movie
4 string moov Apple QuickTime
!:mime video/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)
!:mime video/quicktime
#4 string wide Apple QuickTime movie (unoptimized)
#!:mime video/quicktime
#4 string skip Apple QuickTime movie (modified)
#!:mime video/quicktime
#4 string free Apple QuickTime movie (modified)
#!:mime video/quicktime
4 string idsc Apple QuickTime image (fast start)
!:mime image/x-quicktime
#4 string idat Apple QuickTime image (unoptimized)
#!:mime image/x-quicktime
4 string pckg Apple QuickTime compressed archive
!:mime application/x-quicktime-player
4 string/B jP JPEG 2000 image
!:mime image/jp2
4 string ftyp ISO Media
>8 string isom \b, MPEG v4 system, version 1
!:mime video/mp4
>8 string iso2 \b, MPEG v4 system, part 12 revision
>8 string mp41 \b, MPEG v4 system, version 1
!:mime video/mp4
>8 string mp42 \b, MPEG v4 system, version 2
!:mime video/mp4
>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
!:mime image/jp2
>8 string 3gp \b, MPEG v4 system, 3GPP
!:mime video/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
!:mime video/mp4
>8 string avc1 \b, MPEG v4 system, 3GPP JVT AVC
!:mime video/3gpp
>8 string/B M4A \b, MPEG v4 system, iTunes AAC-LC
!:mime audio/mp4
>8 string/B M4V \b, MPEG v4 system, iTunes AVC-LC
!:mime video/mp4
>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
!:mime video/quicktime
# MPEG sequences
# Scans for all common MPEG header start codes
0 belong 0x00000001
>4 byte&0x1F 0x07 JVT NAL sequence, 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
>3 byte 0xBA MPEG sequence
>>4 byte &0x40 \b, v2, program multiplex
>>4 byte ^0x40 \b, v1, system multiplex
>3 byte 0xBB MPEG sequence, v1/2, multiplex (missing pack header)
>3 byte&0x1F 0x07 MPEG sequence, 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 MPEG sequence, v4
>>5 belong 0x000001B5
>>>9 byte &0x80
>>>>10 byte&0xF0 16 \b, video
>>>>10 byte&0xF0 32 \b, still texture
>>>>10 byte&0xF0 48 \b, mesh
>>>>10 byte&0xF0 64 \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
>>4 byte 4 \b, simple @ L0
>>4 byte 17 \b, simple scalable @ L1
>>4 byte 18 \b, simple scalable @ L2
>>4 byte 33 \b, core @ L1
>>4 byte 34 \b, core @ L2
>>4 byte 50 \b, main @ L2
>>4 byte 51 \b, main @ L3
>>4 byte 53 \b, main @ L4
>>4 byte 66 \b, n-bit @ L2
>>4 byte 81 \b, scalable texture @ L1
>>4 byte 97 \b, simple face animation @ L1
>>4 byte 98 \b, simple face animation @ L2
>>4 byte 99 \b, simple face basic animation @ L1
>>4 byte 100 \b, simple face basic animation @ L2
>>4 byte 113 \b, basic animation text @ L1
>>4 byte 114 \b, basic animation text @ L2
>>4 byte 129 \b, hybrid @ L1
>>4 byte 130 \b, hybrid @ L2
>>4 byte 145 \b, advanced RT simple @ L!
>>4 byte 146 \b, advanced RT simple @ L2
>>4 byte 147 \b, advanced RT simple @ L3
>>4 byte 148 \b, advanced RT simple @ L4
>>4 byte 161 \b, core scalable @ L1
>>4 byte 162 \b, core scalable @ L2
>>4 byte 163 \b, core scalable @ L3
>>4 byte 177 \b, advanced coding efficiency @ L1
>>4 byte 178 \b, advanced coding efficiency @ L2
>>4 byte 179 \b, advanced coding efficiency @ L3
>>4 byte 180 \b, advanced coding efficiency @ L4
>>4 byte 193 \b, advanced core @ L1
>>4 byte 194 \b, advanced core @ L2
>>4 byte 209 \b, advanced scalable texture @ L1
>>4 byte 210 \b, advanced scalable texture @ L2
>>4 byte 211 \b, advanced scalable texture @ L3
>>4 byte 225 \b, simple studio @ L1
>>4 byte 226 \b, simple studio @ L2
>>4 byte 227 \b, simple studio @ L3
>>4 byte 228 \b, simple studio @ L4
>>4 byte 229 \b, core studio @ L1
>>4 byte 230 \b, core studio @ L2
>>4 byte 231 \b, core studio @ L3
>>4 byte 232 \b, core studio @ L4
>>4 byte 240 \b, advanced simple @ L0
>>4 byte 241 \b, advanced simple @ L1
>>4 byte 242 \b, advanced simple @ L2
>>4 byte 243 \b, advanced simple @ L3
>>4 byte 244 \b, advanced simple @ L4
>>4 byte 245 \b, advanced simple @ L5
>>4 byte 247 \b, advanced simple @ L3b
>>4 byte 248 \b, FGS @ L0
>>4 byte 249 \b, FGS @ L1
>>4 byte 250 \b, FGS @ L2
>>4 byte 251 \b, FGS @ L3
>>4 byte 252 \b, FGS @ L4
>>4 byte 253 \b, FGS @ L5
>3 byte 0xB5 MPEG sequence, v4
>>4 byte &0x80
>>>5 byte&0xF0 16 \b, video (missing profile header)
>>>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&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 MPEG sequence
>>12 belong 0x000001B8 \b, v1, progressive Y'CbCr 4:2:0 video
>>12 belong 0x000001B2 \b, v1, progressive Y'CbCr 4:2:0 video
>>12 belong 0x000001B5 \b, v2,
>>>16 byte&0x0F 1 \b HP
>>>16 byte&0x0F 2 \b Spt
>>>16 byte&0x0F 3 \b SNR
>>>16 byte&0x0F 4 \b MP
>>>16 byte&0x0F 5 \b SP
>>>17 byte&0xF0 64 \b@HL
>>>17 byte&0xF0 96 \b@H-14
>>>17 byte&0xF0 128 \b@ML
>>>17 byte&0xF0 160 \b@LL
>>>17 byte &0x08 \b progressive
>>>17 byte ^0x08 \b interlaced
>>>17 byte&0x06 2 \b Y'CbCr 4:2:0 video
>>>17 byte&0x06 4 \b Y'CbCr 4:2:2 video
>>>17 byte&0x06 6 \b Y'CbCr 4:4:4 video
>>11 byte &0x02
>>>75 byte &0x01
>>>>140 belong 0x000001B8 \b, v1, progressive Y'CbCr 4:2:0 video
>>>>140 belong 0x000001B2 \b, v1, progressive Y'CbCr 4:2:0 video
>>>>140 belong 0x000001B5 \b, v2,
>>>>>144 byte&0x0F 1 \b HP
>>>>>144 byte&0x0F 2 \b Spt
>>>>>144 byte&0x0F 3 \b SNR
>>>>>144 byte&0x0F 4 \b MP
>>>>>144 byte&0x0F 5 \b SP
>>>>>145 byte&0xF0 64 \b@HL
>>>>>145 byte&0xF0 96 \b@H-14
>>>>>145 byte&0xF0 128 \b@ML
>>>>>145 byte&0xF0 160 \b@LL
>>>>>145 byte &0x08 \b progressive
>>>>>145 byte ^0x08 \b interlaced
>>>>>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
>>4 belong&0xFFFFFF00 0x78043800 \b, HD-TV 1920P
>>>7 byte&0xF0 0x10 \b, 16:9
>>4 belong&0xFFFFFF00 0x50002D00 \b, SD-TV 1280I
>>>7 byte&0xF0 0x10 \b, 16:9
>>4 belong&0xFFFFFF00 0x30024000 \b, PAL Capture
>>>7 byte&0xF0 0x10 \b, 4:3
>>4 beshort&0xFFF0 0x2C00 \b, 4CIF
>>>5 beshort&0x0FFF 0x01E0 \b NTSC
>>>5 beshort&0x0FFF 0x0240 \b PAL
>>>7 byte&0xF0 0x20 \b, 4:3
>>>7 byte&0xF0 0x30 \b, 16:9
>>>7 byte&0xF0 0x40 \b, 11:5
>>>7 byte&0xF0 0x80 \b, PAL 4:3
>>>7 byte&0xF0 0xC0 \b, NTSC 4:3
>>4 belong&0xFFFFFF00 0x2801E000 \b, LD-TV 640P
>>>7 byte&0xF0 0x10 \b, 4:3
>>4 belong&0xFFFFFF00 0x1400F000 \b, 320x240
>>>7 byte&0xF0 0x10 \b, 4:3
>>4 belong&0xFFFFFF00 0x0F00A000 \b, 240x160
>>>7 byte&0xF0 0x10 \b, 4:3
>>4 belong&0xFFFFFF00 0x0A007800 \b, 160x120
>>>7 byte&0xF0 0x10 \b, 4:3
>>4 beshort&0xFFF0 0x1600 \b, CIF
>>>5 beshort&0x0FFF 0x00F0 \b NTSC
>>>5 beshort&0x0FFF 0x0120 \b PAL
>>>7 byte&0xF0 0x20 \b, 4:3
>>>7 byte&0xF0 0x30 \b, 16:9
>>>7 byte&0xF0 0x40 \b, 11:5
>>>7 byte&0xF0 0x80 \b, PAL 4:3
>>>7 byte&0xF0 0xC0 \b, NTSC 4:3
>>>5 beshort&0x0FFF 0x0240 \b PAL 625
>>>>7 byte&0xF0 0x20 \b, 4:3
>>>>7 byte&0xF0 0x30 \b, 16:9
>>>>7 byte&0xF0 0x40 \b, 11:5
>>4 beshort&0xFFF0 0x2D00 \b, CCIR/ITU
>>>5 beshort&0x0FFF 0x01E0 \b NTSC 525
>>>5 beshort&0x0FFF 0x0240 \b PAL 625
>>>7 byte&0xF0 0x20 \b, 4:3
>>>7 byte&0xF0 0x30 \b, 16:9
>>>7 byte&0xF0 0x40 \b, 11:5
>>4 beshort&0xFFF0 0x1E00 \b, SVCD
>>>5 beshort&0x0FFF 0x01E0 \b NTSC 525
>>>5 beshort&0x0FFF 0x0240 \b PAL 625
>>>7 byte&0xF0 0x20 \b, 4:3
>>>7 byte&0xF0 0x30 \b, 16:9
>>>7 byte&0xF0 0x40 \b, 11:5
>>7 byte&0x0F 1 \b, 23.976 fps
>>7 byte&0x0F 2 \b, 24 fps
>>7 byte&0x0F 3 \b, 25 fps
>>7 byte&0x0F 4 \b, 29.97 fps
>>7 byte&0x0F 5 \b, 30 fps
>>7 byte&0x0F 6 \b, 50 fps
>>7 byte&0x0F 7 \b, 59.94 fps
>>7 byte&0x0F 8 \b, 60 fps
>>11 byte &0x04 \b, Constrained
# MPEG ADTS Audio (*.mpx/mxa/aac)
# from dreesen@math.fu-berlin.de
# modified to fully support MPEG ADTS
# MP3, M1A
# modified by Joerg Jenderek
# GRR the original test are too common for many DOS files
# so don't accept as MP3 until we've tested the rate
0 beshort&0xFFFE 0xFFFA
# rates
>2 byte&0xF0 0x10 MPEG ADTS, layer III, v1, 32 kbps
!:mime audio/mpeg
>2 byte&0xF0 0x20 MPEG ADTS, layer III, v1, 40 kbps
!:mime audio/mpeg
>2 byte&0xF0 0x30 MPEG ADTS, layer III, v1, 48 kbps
!:mime audio/mpeg
>2 byte&0xF0 0x40 MPEG ADTS, layer III, v1, 56 kbps
!:mime audio/mpeg
>2 byte&0xF0 0x50 MPEG ADTS, layer III, v1, 64 kbps
!:mime audio/mpeg
>2 byte&0xF0 0x60 MPEG ADTS, layer III, v1, 80 kbps
!:mime audio/mpeg
>2 byte&0xF0 0x70 MPEG ADTS, layer III, v1, 96 kbps
!:mime audio/mpeg
>2 byte&0xF0 0x80 MPEG ADTS, layer III, v1, 112 kbps
!:mime audio/mpeg
>2 byte&0xF0 0x90 MPEG ADTS, layer III, v1, 128 kbps
!:mime audio/mpeg
>2 byte&0xF0 0xA0 MPEG ADTS, layer III, v1, 160 kbps
!:mime audio/mpeg
>2 byte&0xF0 0xB0 MPEG ADTS, layer III, v1, 192 kbps
!:mime audio/mpeg
>2 byte&0xF0 0xC0 MPEG ADTS, layer III, v1, 224 kbps
!:mime audio/mpeg
>2 byte&0xF0 0xD0 MPEG ADTS, layer III, v1, 256 kbps
!:mime audio/mpeg
>2 byte&0xF0 0xE0 MPEG ADTS, layer III, v1, 320 kbps
!:mime audio/mpeg
# timing
>2 byte&0x0C 0x00 \b, 44.1 kHz
>2 byte&0x0C 0x04 \b, 48 kHz
>2 byte&0x0C 0x08 \b, 32 kHz
# channels/options
>3 byte&0xC0 0x00 \b, Stereo
>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
# MP2, M1A
0 beshort&0xFFFE 0xFFFC MPEG ADTS, layer II, v1
!:mime audio/mpeg
# rates
>2 byte&0xF0 0x10 \b, 32 kbps
>2 byte&0xF0 0x20 \b, 48 kbps
>2 byte&0xF0 0x30 \b, 56 kbps
>2 byte&0xF0 0x40 \b, 64 kbps
>2 byte&0xF0 0x50 \b, 80 kbps
>2 byte&0xF0 0x60 \b, 96 kbps
>2 byte&0xF0 0x70 \b, 112 kbps
>2 byte&0xF0 0x80 \b, 128 kbps
>2 byte&0xF0 0x90 \b, 160 kbps
>2 byte&0xF0 0xA0 \b, 192 kbps
>2 byte&0xF0 0xB0 \b, 224 kbps
>2 byte&0xF0 0xC0 \b, 256 kbps
>2 byte&0xF0 0xD0 \b, 320 kbps
>2 byte&0xF0 0xE0 \b, 384 kbps
# timing
>2 byte&0x0C 0x00 \b, 44.1 kHz
>2 byte&0x0C 0x04 \b, 48 kHz
>2 byte&0x0C 0x08 \b, 32 kHz
# channels/options
>3 byte&0xC0 0x00 \b, Stereo
>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
# MPA, M1A
# updated by Joerg Jenderek
# GRR the original test are too common for many DOS files, so test 32 <= kbits <= 448
# GRR this test is still too general as it catches a BOM of UTF-16 files (0xFFFE)
# FIXME: Almost all little endian UTF-16 text with BOM are clobbered by these entries
#0 beshort&0xFFFE 0xFFFE
#>2 ubyte&0xF0 >0x0F
#>>2 ubyte&0xF0 <0xE1 MPEG ADTS, layer I, v1
## rate
#>>>2 byte&0xF0 0x10 \b, 32 kbps
#>>>2 byte&0xF0 0x20 \b, 64 kbps
#>>>2 byte&0xF0 0x30 \b, 96 kbps
#>>>2 byte&0xF0 0x40 \b, 128 kbps
#>>>2 byte&0xF0 0x50 \b, 160 kbps
#>>>2 byte&0xF0 0x60 \b, 192 kbps
#>>>2 byte&0xF0 0x70 \b, 224 kbps
#>>>2 byte&0xF0 0x80 \b, 256 kbps
#>>>2 byte&0xF0 0x90 \b, 288 kbps
#>>>2 byte&0xF0 0xA0 \b, 320 kbps
#>>>2 byte&0xF0 0xB0 \b, 352 kbps
#>>>2 byte&0xF0 0xC0 \b, 384 kbps
#>>>2 byte&0xF0 0xD0 \b, 416 kbps
#>>>2 byte&0xF0 0xE0 \b, 448 kbps
## timing
#>>>2 byte&0x0C 0x00 \b, 44.1 kHz
#>>>2 byte&0x0C 0x04 \b, 48 kHz
#>>>2 byte&0x0C 0x08 \b, 32 kHz
## channels/options
#>>>3 byte&0xC0 0x00 \b, Stereo
#>>>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
# MP3, M2A
0 beshort&0xFFFE 0xFFF2 MPEG ADTS, layer III, v2
!:mime audio/mpeg
# rate
>2 byte&0xF0 0x10 \b, 8 kbps
>2 byte&0xF0 0x20 \b, 16 kbps
>2 byte&0xF0 0x30 \b, 24 kbps
>2 byte&0xF0 0x40 \b, 32 kbps
>2 byte&0xF0 0x50 \b, 40 kbps
>2 byte&0xF0 0x60 \b, 48 kbps
>2 byte&0xF0 0x70 \b, 56 kbps
>2 byte&0xF0 0x80 \b, 64 kbps
>2 byte&0xF0 0x90 \b, 80 kbps
>2 byte&0xF0 0xA0 \b, 96 kbps
>2 byte&0xF0 0xB0 \b, 112 kbps
>2 byte&0xF0 0xC0 \b, 128 kbps
>2 byte&0xF0 0xD0 \b, 144 kbps
>2 byte&0xF0 0xE0 \b, 160 kbps
# timing
>2 byte&0x0C 0x00 \b, 22.05 kHz
>2 byte&0x0C 0x04 \b, 24 kHz
>2 byte&0x0C 0x08 \b, 16 kHz
# channels/options
>3 byte&0xC0 0x00 \b, Stereo
>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
# MP2, M2A
0 beshort&0xFFFE 0xFFF4 MPEG ADTS, layer II, v2
# rate
>2 byte&0xF0 0x10 \b, 8 kbps
>2 byte&0xF0 0x20 \b, 16 kbps
>2 byte&0xF0 0x30 \b, 24 kbps
>2 byte&0xF0 0x40 \b, 32 kbps
>2 byte&0xF0 0x50 \b, 40 kbps
>2 byte&0xF0 0x60 \b, 48 kbps
>2 byte&0xF0 0x70 \b, 56 kbps
>2 byte&0xF0 0x80 \b, 64 kbps
>2 byte&0xF0 0x90 \b, 80 kbps
>2 byte&0xF0 0xA0 \b, 96 kbps
>2 byte&0xF0 0xB0 \b, 112 kbps
>2 byte&0xF0 0xC0 \b, 128 kbps
>2 byte&0xF0 0xD0 \b, 144 kbps
>2 byte&0xF0 0xE0 \b, 160 kbps
# timing
>2 byte&0x0C 0x00 \b, 22.05 kHz
>2 byte&0x0C 0x04 \b, 24 kHz
>2 byte&0x0C 0x08 \b, 16 kHz
# channels/options
>3 byte&0xC0 0x00 \b, Stereo
>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
# MPA, M2A
0 beshort&0xFFFE 0xFFF6 MPEG ADTS, layer I, v2
# rate
>2 byte&0xF0 0x10 \b, 32 kbps
>2 byte&0xF0 0x20 \b, 48 kbps
>2 byte&0xF0 0x30 \b, 56 kbps
>2 byte&0xF0 0x40 \b, 64 kbps
>2 byte&0xF0 0x50 \b, 80 kbps
>2 byte&0xF0 0x60 \b, 96 kbps
>2 byte&0xF0 0x70 \b, 112 kbps
>2 byte&0xF0 0x80 \b, 128 kbps
>2 byte&0xF0 0x90 \b, 144 kbps
>2 byte&0xF0 0xA0 \b, 160 kbps
>2 byte&0xF0 0xB0 \b, 176 kbps
>2 byte&0xF0 0xC0 \b, 192 kbps
>2 byte&0xF0 0xD0 \b, 224 kbps
>2 byte&0xF0 0xE0 \b, 256 kbps
# timing
>2 byte&0x0C 0x00 \b, 22.05 kHz
>2 byte&0x0C 0x04 \b, 24 kHz
>2 byte&0x0C 0x08 \b, 16 kHz
# channels/options
>3 byte&0xC0 0x00 \b, Stereo
>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
# MP3, M25A
0 beshort&0xFFFE 0xFFE2 MPEG ADTS, layer III, v2.5
# rate
>2 byte&0xF0 0x10 \b, 8 kbps
>2 byte&0xF0 0x20 \b, 16 kbps
>2 byte&0xF0 0x30 \b, 24 kbps
>2 byte&0xF0 0x40 \b, 32 kbps
>2 byte&0xF0 0x50 \b, 40 kbps
>2 byte&0xF0 0x60 \b, 48 kbps
>2 byte&0xF0 0x70 \b, 56 kbps
>2 byte&0xF0 0x80 \b, 64 kbps
>2 byte&0xF0 0x90 \b, 80 kbps
>2 byte&0xF0 0xA0 \b, 96 kbps
>2 byte&0xF0 0xB0 \b, 112 kbps
>2 byte&0xF0 0xC0 \b, 128 kbps
>2 byte&0xF0 0xD0 \b, 144 kbps
>2 byte&0xF0 0xE0 \b, 160 kbps
# timing
>2 byte&0x0C 0x00 \b, 11.025 kHz
>2 byte&0x0C 0x04 \b, 12 kHz
>2 byte&0x0C 0x08 \b, 8 kHz
# channels/options
>3 byte&0xC0 0x00 \b, Stereo
>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
# AAC (aka MPEG-2 NBC audio) and MPEG-4 audio
# Stored AAC streams (instead of the MP4 format)
0 string ADIF MPEG ADIF, AAC
!:mime audio/x-hx-aac-adif
>4 byte &0x80
>>13 byte &0x10 \b, VBR
>>13 byte ^0x10 \b, CBR
>>16 byte&0x1E 0x02 \b, single stream
>>16 byte&0x1E 0x04 \b, 2 streams
>>16 byte&0x1E 0x06 \b, 3 streams
>>16 byte &0x08 \b, 4 or more streams
>>16 byte &0x10 \b, 8 or more streams
>>4 byte &0x80 \b, Copyrighted
>>13 byte &0x40 \b, Original Source
>>13 byte &0x20 \b, Home Flag
>4 byte ^0x80
>>4 byte &0x10 \b, VBR
>>4 byte ^0x10 \b, CBR
>>7 byte&0x1E 0x02 \b, single stream
>>7 byte&0x1E 0x04 \b, 2 streams
>>7 byte&0x1E 0x06 \b, 3 streams
>>7 byte &0x08 \b, 4 or more streams
>>7 byte &0x10 \b, 8 or more streams
>>4 byte &0x40 \b, Original Stream(s)
>>4 byte &0x20 \b, Home Source
# Live or stored single AAC stream (used with MPEG-2 systems)
0 beshort&0xFFF6 0xFFF0 MPEG ADTS, AAC
!:mime audio/x-hx-aac-adts
>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
# timing
>2 byte&0x3c 0x00 \b, 96 kHz
>2 byte&0x3c 0x04 \b, 88.2 kHz
>2 byte&0x3c 0x08 \b, 64 kHz
>2 byte&0x3c 0x0c \b, 48 kHz
>2 byte&0x3c 0x10 \b, 44.1 kHz
>2 byte&0x3c 0x14 \b, 32 kHz
>2 byte&0x3c 0x18 \b, 24 kHz
>2 byte&0x3c 0x1c \b, 22.05 kHz
>2 byte&0x3c 0x20 \b, 16 kHz
>2 byte&0x3c 0x24 \b, 12 kHz
>2 byte&0x3c 0x28 \b, 11.025 kHz
>2 byte&0x3c 0x2c \b, 8 kHz
# channels
>2 beshort&0x01c0 0x0040 \b, monaural
>2 beshort&0x01c0 0x0080 \b, stereo
>2 beshort&0x01c0 0x00c0 \b, stereo + center
>2 beshort&0x01c0 0x0100 \b, stereo+center+LFE
>2 beshort&0x01c0 0x0140 \b, surround
>2 beshort&0x01c0 0x0180 \b, surround + LFE
>2 beshort &0x01C0 \b, surround + side
#>1 byte ^0x01 \b, Data Verify
#>2 byte &0x02 \b, Custom Flag
#>3 byte &0x20 \b, Original Stream
#>3 byte &0x10 \b, Home Source
#>3 byte &0x08 \b, Copyrighted
# Live MPEG-4 audio streams (instead of RTP FlexMux)
0 beshort&0xFFE0 0x56E0 MPEG-4 LOAS
!:mime audio/x-mp4a-latm
#>1 beshort&0x1FFF x \b, %u byte packet
>3 byte&0xE0 0x40
>>4 byte&0x3C 0x04 \b, single stream
>>4 byte&0x3C 0x08 \b, 2 streams
>>4 byte&0x3C 0x0C \b, 3 streams
>>4 byte &0x08 \b, 4 or more streams
>>4 byte &0x20 \b, 8 or more streams
>3 byte&0xC0 0
>>4 byte&0x78 0x08 \b, single stream
>>4 byte&0x78 0x10 \b, 2 streams
>>4 byte&0x78 0x18 \b, 3 streams
>>4 byte &0x20 \b, 4 or more streams
>>4 byte &0x40 \b, 8 or more streams
# This magic isn't strong enough (matches plausible ISO-8859-1 text)
#0 beshort 0x4DE1 MPEG-4 LO-EP audio stream
#!:mime audio/x-mp4a-latm
# Summary: FLI animation format
# Created by: Daniel Quinlan <quinlan@yggdrasil.com>
# Modified by (1): Abel Cheung <abelcheung@gmail.com> (avoid over-generic detection)
4 leshort 0xAF11
# standard FLI always has 320x200 resolution and 8 bit color
>8 leshort 320
>>10 leshort 200
>>>12 leshort 8 FLI animation, 320x200x8
!:mime video/x-fli
>>>>6 leshort x \b, %d frames
# frame speed is multiple of 1/70s
>>>>16 leshort x \b, %d/70s per frame
# Summary: FLC animation format
# Created by: Daniel Quinlan <quinlan@yggdrasil.com>
# Modified by (1): Abel Cheung <abelcheung@gmail.com> (avoid over-generic detection)
4 leshort 0xAF12
# standard FLC always use 8 bit color
>12 leshort 8 FLC animation
!:mime video/x-flc
>>8 leshort x \b, %d
>>10 leshort x \bx%dx8
>>6 uleshort x \b, %d frames
>>16 uleshort x \b, %dms per frame
# DL animation format
# XXX - collision with most `mips' magic
#
# I couldn't find a real magic number for these, however, this
# -appears- to work. Note that it might catch other files, too, so be
# careful!
#
# Note that title and author appear in the two 20-byte chunks
# at decimal offsets 2 and 22, respectively, but they are XOR'ed with
# 255 (hex FF)! The DL format is really bad.
#
#0 byte 1 DL version 1, medium format (160x100, 4 images/screen)
#!:mime video/x-unknown
#>42 byte x - %d screens,
#>43 byte x %d commands
#0 byte 2 DL version 2
#!:mime video/x-unknown
#>1 byte 1 - large format (320x200,1 image/screen),
#>1 byte 2 - medium format (160x100,4 images/screen),
#>1 byte >2 - unknown format,
#>42 byte x %d screens,
#>43 byte x %d commands
# Based on empirical evidence, DL version 3 have several nulls following the
# \003. Most of them start with non-null values at hex offset 0x34 or so.
#0 string \3\0\0\0\0\0\0\0\0\0\0\0 DL version 3
# iso 13818 transport stream
#
# from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001 (ISO 13818.1)
# (the following is a little bit restrictive and works fine for a stream
# that starts with PAT properly. it won't work for stream data, that is
# cut from an input device data right in the middle, but this shouldn't
# disturb)
# syncbyte 8 bit 0x47
# error_ind 1 bit -
# payload_start 1 bit 1
# priority 1 bit -
# PID 13 bit 0x0000
# scrambling 2 bit -
# adaptfld_ctrl 2 bit 1 or 3
# conti_count 4 bit 0
0 belong&0xFF5FFF1F 0x47400010 MPEG transport stream data
>188 byte !0x47 CORRUPTED
# DIF digital video file format <mpruett@sgi.com>
0 belong&0xffffff00 0x1f070000 DIF
>4 byte &0x01 (DVCPRO) movie file
>4 byte ^0x01 (DV) movie file
>3 byte &0x80 (PAL)
>3 byte ^0x80 (NTSC)
# Microsoft Advanced Streaming Format (ASF) <mpruett@sgi.com>
0 belong 0x3026b275 Microsoft ASF
# MNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
0 string \x8aMNG MNG video data,
!:mime video/x-mng
>4 belong !0x0d0a1a0a CORRUPTED,
>4 belong 0x0d0a1a0a
>>16 belong x %ld x
>>20 belong x %ld
# JNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
0 string \x8bJNG JNG video data,
!:mime video/x-jng
>4 belong !0x0d0a1a0a CORRUPTED,
>4 belong 0x0d0a1a0a
>>16 belong x %ld x
>>20 belong x %ld
# Vivo video (Wolfram Kleff)
3 string \x0D\x0AVersion:Vivo Vivo video data
# VRML (Virtual Reality Modelling Language)
0 string/b #VRML\ V1.0\ ascii VRML 1 file
!:mime model/vrml
0 string/b #VRML\ V2.0\ utf8 ISO/IEC 14772 VRML 97 file
!:mime model/vrml
# X3D (Extensible 3D) [http://www.web3d.org/specifications/x3d-3.0.dtd]
# From Michel Briand <michelbriand@free.fr>
0 string \<?xml\ version="
!:strength +1
>20 search/1000/cb \<!DOCTYPE\ X3D X3D (Extensible 3D) model xml text
!:mime model/x3d
#---------------------------------------------------------------------------
# HVQM4: compressed movie format designed by Hudson for Nintendo GameCube
# From Mark Sheppard <msheppard@climax.co.uk>, 2002-10-03
#
0 string HVQM4 %s
>6 string >\0 v%s
>0 byte x GameCube movie,
>0x34 ubeshort x %d x
>0x36 ubeshort x %d,
>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
# From: Behan Webster <behanw@websterwood.com>
# NuppelVideo used by Mythtv (*.nuv)
# Note: there are two identical stanzas here differing only in the
# initial string matched. It used to be done with a regex, but we're
# trying to get rid of those.
0 string NuppelVideo MythTV NuppelVideo
>12 string x v%s
>20 lelong x (%d
>24 lelong x \bx%d),
>36 string P \bprogressive,
>36 string I \binterlaced,
>40 ledouble x \baspect:%.2f,
>48 ledouble x \bfps:%.2f
0 string MythTV MythTV NuppelVideo
>12 string x v%s
>20 lelong x (%d
>24 lelong x \bx%d),
>36 string P \bprogressive,
>36 string I \binterlaced,
>40 ledouble x \baspect:%.2f,
>48 ledouble x \bfps:%.2f
# MPEG file
# MPEG sequences
# FIXME: This section is from the old magic.mime file and needs integrating with the rest
0 belong 0x000001BA
>4 byte &0x40
!:mime video/mp2p
>4 byte ^0x40
!:mime video/mpeg
0 belong 0x000001BB
!:mime video/mpeg
0 belong 0x000001B0
!:mime video/mp4v-es
0 belong 0x000001B5
!:mime video/mp4v-es
0 belong 0x000001B3
!:mime video/mpv
0 belong&0xFF5FFF1F 0x47400010
!:mime video/mp2t
0 belong 0x00000001
>4 byte&0x1F 0x07
!:mime video/h264
# Type: Bink Video
# URL: http://wiki.multimedia.cx/index.php?title=3DBink_Container
# From: <hoehle@users.sourceforge.net> 2008-07-18
0 string BIK Bink Video
>3 regex =[a-z] rev.%s
#>4 ulelong x size %d
>20 ulelong x \b, %d
>24 ulelong x \bx%d
>8 ulelong x \b, %d frames
>32 ulelong x at rate %d/
>28 ulelong >1 \b%d
>40 ulelong =0 \b, no audio
>40 ulelong !0 \b, %d audio track
>>40 ulelong !1 \bs
# follow properties of the first audio track only
>>48 uleshort x %dHz
>>51 byte&0x20 0 mono
>>51 byte&0x20 !0 stereo
#>>51 byte&0x10 0 FFT
#>>51 byte&0x10 !0 DCT

View file

@ -0,0 +1,6 @@
#------------------------------------------------------------------------------
# apl: file(1) magic for APL (see also "pdp" and "vax" for other APL
# workspaces)
#
0 long 0100554 APL workspace (Ken's original?)

View file

@ -0,0 +1,249 @@
#------------------------------------------------------------------------------
# apple: file(1) magic for Apple file formats
#
0 search/1 FiLeStArTfIlEsTaRt binscii (apple ][) text
0 string \x0aGL Binary II (apple ][) data
0 string \x76\xff Squeezed (apple ][) data
0 string NuFile NuFile archive (apple ][) data
0 string N\xf5F\xe9l\xe5 NuFile archive (apple ][) data
0 belong 0x00051600 AppleSingle encoded Macintosh file
0 belong 0x00051607 AppleDouble encoded Macintosh file
# Type: Apple Emulator 2IMG format
# From: Radek Vokal <rvokal@redhat.com>
0 string 2IMG Apple ][ 2IMG Disk Image
>4 string XGS! \b, XGS
>4 string CTKG \b, Catakig
>4 string ShIm \b, Sheppy's ImageMaker
>4 string WOOF \b, Sweet 16
>4 string B2TR \b, Bernie ][ the Rescue
>4 string !nfc \b, ASIMOV2
>4 string x \b, Unknown Format
>0xc byte 00 \b, DOS 3.3 sector order
>>0x10 byte 00 \b, Volume 254
>>0x10 byte&0x7f x \b, Volume %u
>0xc byte 01 \b, ProDOS sector order
>>0x14 short x \b, %u Blocks
>0xc byte 02 \b, NIB data
# magic for Newton PDA package formats
# from Ruda Moura <ruda@helllabs.org>
0 string package0 Newton package, NOS 1.x,
>12 belong &0x80000000 AutoRemove,
>12 belong &0x40000000 CopyProtect,
>12 belong &0x10000000 NoCompression,
>12 belong &0x04000000 Relocation,
>12 belong &0x02000000 UseFasterCompression,
>16 belong x version %d
0 string package1 Newton package, NOS 2.x,
>12 belong &0x80000000 AutoRemove,
>12 belong &0x40000000 CopyProtect,
>12 belong &0x10000000 NoCompression,
>12 belong &0x04000000 Relocation,
>12 belong &0x02000000 UseFasterCompression,
>16 belong x version %d
0 string package4 Newton package,
>8 byte 8 NOS 1.x,
>8 byte 9 NOS 2.x,
>12 belong &0x80000000 AutoRemove,
>12 belong &0x40000000 CopyProtect,
>12 belong &0x10000000 NoCompression,
# The following entries for the Apple II are for files that have
# been transferred as raw binary data from an Apple, without having
# been encapsulated by any of the above archivers.
#
# In general, Apple II formats are hard to identify because Apple DOS
# and especially Apple ProDOS have strong typing in the file system and
# therefore programmers never felt much need to include type information
# in the files themselves.
#
# Eric Fischer <enf@pobox.com>
# AppleWorks word processor:
#
# This matches the standard tab stops for an AppleWorks file, but if
# a file has a tab stop set in the first four columns this will fail.
#
# The "O" is really the magic number, but that's so common that it's
# necessary to check the tab stops that follow it to avoid false positives.
4 string O==== AppleWorks word processor data
>85 byte&0x01 >0 \b, zoomed
>90 byte&0x01 >0 \b, paginated
>92 byte&0x01 >0 \b, with mail merge
#>91 byte x \b, left margin %d
# AppleWorks database:
#
# This isn't really a magic number, but it's the closest thing to one
# that I could find. The 1 and 2 really mean "order in which you defined
# categories" and "left to right, top to bottom," respectively; the D and R
# mean that the cursor should move either down or right when you press Return.
#30 string \x01D AppleWorks database data
#30 string \x02D AppleWorks database data
#30 string \x01R AppleWorks database data
#30 string \x02R AppleWorks database data
# AppleWorks spreadsheet:
#
# Likewise, this isn't really meant as a magic number. The R or C means
# row- or column-order recalculation; the A or M means automatic or manual
# recalculation.
#131 string RA AppleWorks spreadsheet data
#131 string RM AppleWorks spreadsheet data
#131 string CA AppleWorks spreadsheet data
#131 string CM AppleWorks spreadsheet data
# Applesoft BASIC:
#
# This is incredibly sloppy, but will be true if the program was
# written at its usual memory location of 2048 and its first line
# number is less than 256. Yuck.
0 belong&0xff00ff 0x80000 Applesoft BASIC program data
#>2 leshort x \b, first line number %d
# ORCA/EZ assembler:
#
# This will not identify ORCA/M source files, since those have
# some sort of date code instead of the two zero bytes at 6 and 7
# XXX Conflicts with ELF
#4 belong&0xff00ffff 0x01000000 ORCA/EZ assembler source data
#>5 byte x \b, build number %d
# Broderbund Fantavision
#
# I don't know what these values really mean, but they seem to recur.
# Will they cause too many conflicts?
# Probably :-)
#2 belong&0xFF00FF 0x040008 Fantavision movie data
# Some attempts at images.
#
# These are actually just bit-for-bit dumps of the frame buffer, so
# there's really no reasonably way to distinguish them except for their
# address (if preserved) -- 8192 or 16384 -- and their length -- 8192
# or, occasionally, 8184.
#
# Nevertheless this will manage to catch a lot of images that happen
# to have a solid-colored line at the bottom of the screen.
# GRR: Magic too weak
#8144 string \x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F Apple II image with white background
#8144 string \x55\x2A\x55\x2A\x55\x2A\x55\x2A Apple II image with purple background
#8144 string \x2A\x55\x2A\x55\x2A\x55\x2A\x55 Apple II image with green background
#8144 string \xD5\xAA\xD5\xAA\xD5\xAA\xD5\xAA Apple II image with blue background
#8144 string \xAA\xD5\xAA\xD5\xAA\xD5\xAA\xD5 Apple II image with orange background
# Beagle Bros. Apple Mechanic fonts
0 belong&0xFF00FFFF 0x6400D000 Apple Mechanic font
# Apple Universal Disk Image Format (UDIF) - dmg files.
# From Johan Gade.
# These entries are disabled for now until we fix the following issues.
#
# Note there might be some problems with the "VAX COFF executable"
# entry. Note this entry should be placed before the mac filesystem section,
# particularly the "Apple Partition data" entry.
#
# The intended meaning of these tests is, that the file is only of the
# specified type if both of the lines are correct - i.e. if the first
# line matches and the second doesn't then it is not of that type.
#
#0 long 0x7801730d
#>4 long 0x62626060 UDIF read-only zlib-compressed image (UDZO)
#
# Note that this entry is recognized correctly by the "Apple Partition
# data" entry - however since this entry is more specific - this
# 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
# Apple binary property list (bplist)
# Assumes version bytes are hex.
# Provides content hints for version 0 files. Assumes that the root
# object is the first object (true for CoreFoundation implementation).
# From: David Remahl <dremahl@apple.com>
0 string bplist
>6 byte x \bCoreFoundation binary property list data, version 0x%c
>>7 byte x \b%c
>6 string 00 \b
>>8 byte&0xF0 0x00 \b
>>>8 byte&0x0F 0x00 \b, root type: null
>>>8 byte&0x0F 0x08 \b, root type: false boolean
>>>8 byte&0x0F 0x09 \b, root type: true boolean
>>8 byte&0xF0 0x10 \b, root type: integer
>>8 byte&0xF0 0x20 \b, root type: real
>>8 byte&0xF0 0x30 \b, root type: date
>>8 byte&0xF0 0x40 \b, root type: data
>>8 byte&0xF0 0x50 \b, root type: ascii string
>>8 byte&0xF0 0x60 \b, root type: unicode string
>>8 byte&0xF0 0x80 \b, root type: uid (CORRUPT)
>>8 byte&0xF0 0xa0 \b, root type: array
>>8 byte&0xF0 0xd0 \b, root type: dictionary
# Apple/NeXT typedstream data
# Serialization format used by NeXT and Apple for various
# purposes in YellowStep/Cocoa, including some nib files.
# From: David Remahl <dremahl@apple.com>
2 string typedstream NeXT/Apple typedstream data, big endian
>0 byte x \b, version %hhd
>0 byte <5 \b
>>13 byte 0x81 \b
>>>14 ubeshort x \b, system %hd
2 string streamtyped NeXT/Apple typedstream data, little endian
>0 byte x \b, version %hhd
>0 byte <5 \b
>>13 byte 0x81 \b
>>>14 uleshort x \b, system %hd
#------------------------------------------------------------------------------
# CAF: Apple CoreAudio File Format
#
# Container format for high-end audio purposes.
# From: David Remahl <dremahl@apple.com>
#
0 string caff CoreAudio Format audio file
>4 beshort <10 version %d
>6 beshort x
#------------------------------------------------------------------------------
# Keychain database files
0 string kych Mac OS X Keychain File
#------------------------------------------------------------------------------
# Code Signing related file types
0 belong 0xfade0c00 Mac OS X Code Requirement
>8 belong 1 (opExpr)
>4 belong x - %d bytes
0 belong 0xfade0c01 Mac OS X Code Requirement Set
>8 belong >1 containing %d items
>4 belong x - %d bytes
0 belong 0xfade0c02 Mac OS X Code Directory
>8 belong x version %x
>12 belong >0 flags 0x%x
>4 belong x - %d bytes
0 belong 0xfade0cc0 Mac OS X Detached Code Signature (non-executable)
>4 belong x - %d bytes
0 belong 0xfade0cc1 Mac OS X Detached Code Signature
>8 belong >1 (%d elements)
>4 belong x - %d bytes
# From: "Nelson A. de Oliveira" <naoliv@gmail.com>
# .vdi
4 string innotek\ VirtualBox\ Disk\ Image %s

View file

@ -0,0 +1,12 @@
#------------------------------------------------------------------------------
# applix: file(1) magic for Applixware
# From: Peter Soos <sp@osb.hu>
#
0 string *BEGIN Applixware
>7 string WORDS Words Document
>7 string GRAPHICS Graphic
>7 string RASTER Bitmap
>7 string SPREADSHEETS Spreadsheet
>7 string MACRO Macro
>7 string BUILDER Builder Object

View file

@ -0,0 +1,806 @@
#------------------------------------------------------------------------------
# archive: file(1) magic for archive formats (see also "msdos" for self-
# extracting compressed archives)
#
# cpio, ar, arc, arj, hpack, lha/lharc, rar, squish, uc2, zip, zoo, etc.
# pre-POSIX "tar" archives are handled in the C code.
# POSIX tar archives
257 string ustar\0 POSIX tar archive
!:mime application/x-tar # encoding: posix
257 string ustar\040\040\0 GNU tar archive
!:mime application/x-tar # encoding: gnu
# cpio archives
#
# Yes, the top two "cpio archive" formats *are* supposed to just be "short".
# The idea is to indicate archives produced on machines with the same
# byte order as the machine running "file" with "cpio archive", and
# to indicate archives produced on machines with the opposite byte order
# from the machine running "file" with "byte-swapped cpio archive".
#
# The SVR4 "cpio(4)" hints that there are additional formats, but they
# are defined as "short"s; I think all the new formats are
# character-header formats and thus are strings, not numbers.
0 short 070707 cpio archive
!:mime application/x-cpio
0 short 0143561 byte-swapped cpio archive
!:mime application/x-cpio # encoding: swapped
0 string 070707 ASCII cpio archive (pre-SVR4 or odc)
0 string 070701 ASCII cpio archive (SVR4 with no CRC)
0 string 070702 ASCII cpio archive (SVR4 with CRC)
# Debian package (needs to go before regular portable archives)
#
0 string =!<arch>\ndebian
!:mime application/x-debian-package
>8 string debian-split part of multipart Debian package
>8 string debian-binary Debian binary package
>8 string !debian
>68 string >\0 (format %s)
# These next two lines do not work, because a bzip2 Debian archive
# still uses gzip for the control.tar (first in the archive). Only
# data.tar varies, and the location of its filename varies too.
# file/libmagic does not current have support for ascii-string based
# (offsets) as of 2005-09-15.
#>81 string bz2 \b, uses bzip2 compression
#>84 string gz \b, uses gzip compression
#>136 ledate x created: %s
# other archives
0 long 0177555 very old archive
0 short 0177555 very old PDP-11 archive
0 long 0177545 old archive
0 short 0177545 old PDP-11 archive
0 long 0100554 apl workspace
0 string =<ar> archive
!:mime application/x-archive
# MIPS archive (needs to go before regular portable archives)
#
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
>19 string L and an EL hash table
>19 string B and an EB hash table
>22 string X -- out of date
0 search/1 -h- Software Tools format archive text
#
# 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 long 0x213c6172 archive file
#
# and for SVR1 archives, we have:
#
# 0 string \<ar> System V Release 1 ar archive
# 0 string =<ar> archive
#
# XXX - did Aegis really store shared libraries, breakpointed modules,
# and absolute code program modules in the same format as new-style
# "ar" archives?
#
0 string =!<arch> current ar archive
!:mime application/x-archive
>8 string __.SYMDEF random library
>0 belong =65538 - pre SR9.5
>0 belong =65539 - post SR9.5
>0 beshort 2 - object archive
>0 beshort 3 - shared library module
>0 beshort 4 - debug break-pointed module
>0 beshort 5 - absolute code program module
0 string \<ar> System V Release 1 ar archive
0 string =<ar> archive
#
# XXX - from "vax", which appears to collect a bunch of byte-swapped
# thingies, to help you recognize VAX files on big-endian machines;
# with "leshort", "lelong", and "string", that's no longer necessary....
#
0 belong 0x65ff0000 VAX 3.0 archive
0 belong 0x3c61723e VAX 5.0 archive
#
0 long 0x213c6172 archive file
0 lelong 0177555 very old VAX archive
0 leshort 0177555 very old PDP-11 archive
#
# XXX - "pdp" claims that 0177545 can have an __.SYMDEF member and thus
# be a random library (it said 0xff65 rather than 0177545).
#
0 lelong 0177545 old VAX archive
>8 string __.SYMDEF random library
0 leshort 0177545 old PDP-11 archive
>8 string __.SYMDEF random library
#
# From "pdp" (but why a 4-byte quantity?)
#
0 lelong 0x39bed PDP-11 old archive
0 lelong 0x39bee PDP-11 4.0 archive
# ARC archiver, from Daniel Quinlan (quinlan@yggdrasil.com)
#
# The first byte is the magic (0x1a), byte 2 is the compression type for
# the first file (0x01 through 0x09), and bytes 3 to 15 are the MS-DOS
# filename of the first file (null terminated). Since some types collide
# we only test some types on basis of frequency: 0x08 (83%), 0x09 (5%),
# 0x02 (5%), 0x03 (3%), 0x04 (2%), 0x06 (2%). 0x01 collides with terminfo.
0 lelong&0x8080ffff 0x0000081a ARC archive data, dynamic LZW
!:mime application/x-arc
0 lelong&0x8080ffff 0x0000091a ARC archive data, squashed
!:mime application/x-arc
0 lelong&0x8080ffff 0x0000021a ARC archive data, uncompressed
!:mime application/x-arc
0 lelong&0x8080ffff 0x0000031a ARC archive data, packed
!:mime application/x-arc
0 lelong&0x8080ffff 0x0000041a ARC archive data, squeezed
!:mime application/x-arc
0 lelong&0x8080ffff 0x0000061a ARC archive data, crunched
!:mime application/x-arc
# [JW] stuff taken from idarc, obviously ARC successors:
0 lelong&0x8080ffff 0x00000a1a PAK archive data
!:mime application/x-arc
0 lelong&0x8080ffff 0x0000141a ARC+ archive data
!:mime application/x-arc
0 lelong&0x8080ffff 0x0000481a HYP archive data
!:mime application/x-arc
# 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
# [GRR: the original entries collide with ARC, above; replaced with combined
# version (not tested)]
#0 byte 0x1a RISC OS archive (spark format)
0 string \032archive RISC OS archive (ArcFS 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
# updated by Joerg Jenderek
>9 string \0
>>0 string KWAJ
>>>7 string \321\003 MS Compress archive data
>>>>14 ulong >0 \b, original size: %ld bytes
>>>>18 ubyte >0x65
>>>>>18 string x \b, was %.8s
>>>>>(10.b-4) string x \b.%.3s
# 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
!:mime application/x-arj
>5 byte x \b, v%d,
>8 byte &0x04 multi-volume,
>8 byte &0x10 slash-switched,
>8 byte &0x20 backup,
>34 string x original name: %s,
>7 byte 0 os: MS-DOS
>7 byte 1 os: PRIMOS
>7 byte 2 os: Unix
>7 byte 3 os: Amiga
>7 byte 4 os: Macintosh
>7 byte 5 os: OS/2
>7 byte 6 os: Apple ][ GS
>7 byte 7 os: Atari ST
>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...
#0 string HA 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
# 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
# JAM Archive volume format, by Dmitry.Kohmanyuk@UA.net
0 string \351,\001JAM\ JAM archive,
>7 string >\0 version %.4s
>0x26 byte =0x27 -
>>0x2b string >\0 label %.11s,
>>0x27 lelong x serial %08x,
>>0x36 string >\0 fstype %.8s
# LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
2 string -lh0- LHarc 1.x/ARX archive data [lh0]
!:mime application/x-lharc
2 string -lh1- LHarc 1.x/ARX archive data [lh1]
!:mime application/x-lharc
2 string -lz4- LHarc 1.x archive data [lz4]
!:mime application/x-lharc
2 string -lz5- LHarc 1.x archive data [lz5]
!:mime application/x-lharc
# [never seen any but the last; -lh4- reported in comp.compression:]
2 string -lzs- LHa/LZS archive data [lzs]
!:mime application/x-lha
2 string -lh\40- LHa 2.x? archive data [lh ]
!:mime application/x-lha
2 string -lhd- LHa 2.x? archive data [lhd]
!:mime application/x-lha
2 string -lh2- LHa 2.x? archive data [lh2]
!:mime application/x-lha
2 string -lh3- LHa 2.x? archive data [lh3]
!:mime application/x-lha
2 string -lh4- LHa (2.x) archive data [lh4]
!:mime application/x-lha
2 string -lh5- LHa (2.x) archive data [lh5]
!:mime application/x-lha
2 string -lh6- LHa (2.x) archive data [lh6]
!:mime application/x-lha
2 string -lh7- LHa (2.x)/LHark archive data [lh7]
!:mime application/x-lha
>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,
!:mime application/x-rar
>44 byte x v%0x,
>10 byte >0 flags:
>>10 byte &0x01 Archive volume,
>>10 byte &0x02 Commented,
>>10 byte &0x04 Locked,
>>10 byte &0x08 Solid,
>>10 byte &0x20 Authenticated,
>35 byte 0 os: MS-DOS
>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)
# [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)
0 string PK\003\004
>4 byte 0x00 Zip archive data
!:mime application/zip
>4 byte 0x09 Zip archive data, at least v0.9 to extract
!:mime application/zip
>4 byte 0x0a Zip archive data, at least v1.0 to extract
!:mime application/zip
>4 byte 0x0b Zip archive data, at least v1.1 to extract
!:mime application/zip
>0x161 string WINZIP Zip archive data, WinZIP self-extracting
!:mime application/zip
>4 byte 0x14
>>30 ubelong !0x6d696d65 Zip archive data, at least v2.0 to extract
>0x161 string WINZIP Zip archive data, WinZIP self-extracting
!:mime application/zip
# OpenOffice.org / KOffice / StarOffice documents
# Listed here because they ARE zip files
#
# From: Abel Cheung <abel@oaka.org>
>4 byte 0x14
>>30 string mimetype
# KOffice (1.2 or above) formats
>>>50 string vnd.kde. KOffice (>=1.2)
>>>>58 string karbon Karbon document
>>>>58 string kchart KChart document
>>>>58 string kformula KFormula document
>>>>58 string kivio Kivio document
>>>>58 string kontour Kontour document
>>>>58 string kpresenter KPresenter document
>>>>58 string kspread KSpread document
>>>>58 string kword KWord document
# OpenOffice formats (for OpenOffice 1.x / StarOffice 6/7)
>>>50 string vnd.sun.xml. OpenOffice.org 1.x
>>>>62 string writer Writer
>>>>>68 byte !0x2e document
>>>>>68 string .template template
>>>>>68 string .global global document
>>>>62 string calc Calc
>>>>>66 byte !0x2e spreadsheet
>>>>>66 string .template template
>>>>62 string draw Draw
>>>>>66 byte !0x2e document
>>>>>66 string .template template
>>>>62 string impress Impress
>>>>>69 byte !0x2e presentation
>>>>>69 string .template template
>>>>62 string math Math document
>>>>62 string base Database file
# OpenDocument formats (for OpenOffice 2.x / StarOffice >= 8)
# http://lists.oasis-open.org/archives/office/200505/msg00006.html
>>>50 string vnd.oasis.opendocument. OpenDocument
>>>>73 string text
>>>>>77 byte !0x2d Text
!:mime application/vnd.oasis.opendocument.text
>>>>>77 string -template Text Template
>>>>>77 string -web HTML Document Template
>>>>>77 string -master Master Document
>>>>73 string graphics Drawing
>>>>>81 string -template Template
>>>>73 string presentation Presentation
>>>>>85 string -template Template
>>>>73 string spreadsheet Spreadsheet
>>>>>84 string -template Template
>>>>73 string chart Chart
>>>>>78 string -template Template
>>>>73 string formula Formula
>>>>>80 string -template Template
>>>>73 string database Database
>>>>73 string image Image
# Zoo archiver
20 lelong 0xfdc4a7dc Zoo archive data
!:mime application/x-zoo
>4 byte >48 \b, v%c.
>>6 byte >47 \b%c
>>>7 byte >47 \b%c
>32 byte >0 \b, modify: v%d
>>33 byte x \b.%d+
>42 lelong 0xfdc4a7dc \b,
>>70 byte >0 extract: v%d
>>>71 byte x \b.%d+
# Shell archives
10 string #\ This\ is\ a\ shell\ archive shell archive text
!:mime application/octet-stream
#
# LBR. NB: May conflict with the questionable
# "binary Computer Graphics Metafile" format.
#
0 string \0\ \ \ \ \ \ \ \ \ \ \ \0\0 LBR archive data
#
# PMA (CP/M derivative of LHA)
#
2 string -pm0- PMarc archive data [pm0]
2 string -pm1- PMarc archive data [pm1]
2 string -pm2- PMarc archive data [pm2]
2 string -pms- PMarc SFX archive (CP/M, DOS)
5 string -pc1- PopCom compressed executable (CP/M)
# From Rafael Laboissiere <rafael@laboissiere.net>
# The Project Revision Control System (see
# http://prcs.sourceforge.net) generates a packaged project
# file which is recognized by the following entry:
0 leshort 0xeb81 PRCS packaged project
# Microsoft cabinets
# by David Necas (Yeti) <yeti@physics.muni.cz>
#0 string MSCF\0\0\0\0 Microsoft cabinet file data,
#>25 byte x v%d
#>24 byte x \b.%d
# MPi: All CABs have version 1.3, so this is pointless.
# Better magic in debian-additions.
# GTKtalog catalogs
# by David Necas (Yeti) <yeti@physics.muni.cz>
4 string gtktalog\ GTKtalog catalog data,
>13 string 3 version 3
>>14 beshort 0x677a (gzipped)
>>14 beshort !0x677a (not gzipped)
>13 string >3 version %s
############################################################################
# Parity archive reconstruction file, the 'par' file format now used on Usenet.
0 string PAR\0 PARity archive data
>48 leshort =0 - Index file
>48 leshort >0 - file number %d
# Felix von Leitner <felix-file@fefe.de>
0 string d8:announce BitTorrent file
!:mime application/x-bittorrent
# Atari MSA archive - Teemu Hukkanen <tjhukkan@iki.fi>
0 beshort 0x0e0f Atari MSA archive data
>2 beshort x \b, %d sectors per track
>4 beshort 0 \b, 1 sided
>4 beshort 1 \b, 2 sided
>6 beshort x \b, starting track: %d
>8 beshort x \b, ending track: %d
# Alternate ZIP string (amc@arwen.cs.berkeley.edu)
0 string PK00PK\003\004 Zip archive data
# ACE archive (from http://www.wotsit.org/download.asp?f=ace)
# by Stefan `Sec` Zehl <sec@42.org>
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
>16 byte =0x02 \b, from Win/32
>16 byte =0x03 \b, from Unix
>16 byte =0x04 \b, from MacOS
>16 byte =0x05 \b, from WinNT
>16 byte =0x06 \b, from Primos
>16 byte =0x07 \b, from AppleGS
>16 byte =0x08 \b, from Atari
>16 byte =0x09 \b, from Vax/VMS
>16 byte =0x0A \b, from Amiga
>16 byte =0x0B \b, from Next
>14 byte x \b, version %d to extract
>5 leshort &0x0080 \b, multiple volumes,
>>17 byte x \b (part %d),
>5 leshort &0x0002 \b, contains comment
>5 leshort &0x0200 \b, sfx
>5 leshort &0x0400 \b, small dictionary
>5 leshort &0x0800 \b, multi-volume
>5 leshort &0x1000 \b, contains AV-String
>>30 string \x16*UNREGISTERED\x20VERSION* (unregistered)
>5 leshort &0x2000 \b, with recovery record
>5 leshort &0x4000 \b, locked
>5 leshort &0x8000 \b, solid
# Date in MS-DOS format (whatever that is)
#>18 lelong x Created on
# sfArk : compression program for Soundfonts (sf2) by Dirk Jagdmann
# <doj@cubic.org>
0x1A string sfArk sfArk compressed Soundfont
>0x15 string 2
>>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
!:mime application/x-eet
# rzip archives
0 string RZIP rzip compressed data
>4 byte x - version %d
>5 byte x \b.%d
>6 belong x (%d bytes)
# From: "Robert Dale" <robdale@gmail.com>
0 belong 123 dar archive,
>4 belong x label "%.8x
>>8 belong x %.8x
>>>12 beshort x %.4x"
>14 byte 0x54 end slice
>14 beshort 0x4e4e multi-part
>14 beshort 0x4e53 multi-part, with -S
# Symbian installation files
# http://www.thouky.co.uk/software/psifs/sis.html
# http://developer.symbian.com/main/downloads/papers/SymbianOSv91/softwareinstallsis.pdf
8 lelong 0x10000419 Symbian installation file
!:mime application/vnd.symbian.install
>4 lelong 0x1000006D (EPOC release 3/4/5)
>4 lelong 0x10003A12 (EPOC release 6)
0 lelong 0x10201A7A Symbian installation file (Symbian OS 9.x)
!:mime x-epoc/x-sisx-app
# From "Nelson A. de Oliveira" <naoliv@gmail.com>
0 string MPQ\032 MoPaQ (MPQ) archive
# From: Dirk Jagdmann <doj@cubic.org>
# xar archive format: http://code.google.com/p/xar/
0 string xar! xar archive
>6 beshort x - version %ld
# From: "Nelson A. de Oliveira" <naoliv@gmail.com>
# .kgb
0 string KGB_arch KGB Archiver file
>10 string x with compression level %.1s
# xar (eXtensible ARchiver) archive
# From: "David Remahl" <dremahl@apple.com>
0 string xar! xar archive
#>4 beshort x header size %d
>6 beshort x version %d,
#>8 quad x compressed TOC: %d,
#>16 quad x uncompressed TOC: %d,
>24 belong 0 no checksum
>24 belong 1 SHA-1 checksum
>24 belong 2 MD5 checksum

View file

@ -0,0 +1,17 @@
#------------------------------------------------------------------------------
# asterix: file(1) magic for Aster*x; SunOS 5.5.1 gave the 4-character
# strings as "long" - we assume they're just strings:
# From: guy@netapp.com (Guy Harris)
#
0 string *STA Aster*x
>7 string WORD Words Document
>7 string GRAP Graphic
>7 string SPRE Spreadsheet
>7 string MACR Macro
0 string 2278 Aster*x Version 2
>29 byte 0x36 Words Document
>29 byte 0x35 Graphic
>29 byte 0x32 Spreadsheet
>29 byte 0x38 Macro

View file

@ -0,0 +1,40 @@
#------------------------------------------------------------------------------
# att3b: file(1) magic for AT&T 3B machines
#
# The `versions' should be un-commented if they work for you.
# (Was the problem just one of endianness?)
#
# 3B20
#
# The 3B20 conflicts with SCCS.
#0 beshort 0550 3b20 COFF executable
#>12 belong >0 not stripped
#>22 beshort >0 - version %ld
#0 beshort 0551 3b20 COFF executable (TV)
#>12 belong >0 not stripped
#>22 beshort >0 - version %ld
#
# WE32K
#
0 beshort 0560 WE32000 COFF
>18 beshort ^00000020 object
>18 beshort &00000020 executable
>12 belong >0 not stripped
>18 beshort ^00010000 N/A on 3b2/300 w/paging
>18 beshort &00020000 32100 required
>18 beshort &00040000 and MAU hardware required
>20 beshort 0407 (impure)
>20 beshort 0410 (pure)
>20 beshort 0413 (demand paged)
>20 beshort 0443 (target shared library)
>22 beshort >0 - version %ld
0 beshort 0561 WE32000 COFF executable (TV)
>12 belong >0 not stripped
#>18 beshort &00020000 - 32100 required
#>18 beshort &00040000 and MAU hardware required
#>22 beshort >0 - version %ld
#
# core file for 3b2
0 string \000\004\036\212\200 3b2 core file
>364 string >\0 of '%s'

View file

@ -0,0 +1,606 @@
#------------------------------------------------------------------------------
# audio: file(1) magic for sound formats (see also "iff")
#
# Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
# and others
#
# Sun/NeXT audio data
0 string .snd Sun/NeXT audio data:
>12 belong 1 8-bit ISDN mu-law,
!:mime audio/basic
>12 belong 2 8-bit linear PCM [REF-PCM],
!:mime audio/basic
>12 belong 3 16-bit linear PCM,
!:mime audio/basic
>12 belong 4 24-bit linear PCM,
!:mime audio/basic
>12 belong 5 32-bit linear PCM,
!:mime audio/basic
>12 belong 6 32-bit IEEE floating point,
!:mime audio/basic
>12 belong 7 64-bit IEEE floating point,
!:mime audio/basic
>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 enc.),
!:mime audio/x-adpcm
>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,
>16 belong >0 %d Hz
# DEC systems (e.g. DECstation 5000) use a variant of the Sun/NeXT format
# that uses little-endian encoding and has a different magic number
0 lelong 0x0064732E DEC audio data:
>12 lelong 1 8-bit ISDN mu-law,
!:mime audio/x-dec-basic
>12 lelong 2 8-bit linear PCM [REF-PCM],
!:mime audio/x-dec-basic
>12 lelong 3 16-bit linear PCM,
!:mime audio/x-dec-basic
>12 lelong 4 24-bit linear PCM,
!:mime audio/x-dec-basic
>12 lelong 5 32-bit linear PCM,
!:mime audio/x-dec-basic
>12 lelong 6 32-bit IEEE floating point,
!:mime audio/x-dec-basic
>12 lelong 7 64-bit IEEE floating point,
!:mime audio/x-dec-basic
>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 enc.),
!:mime audio/x-dec-basic
>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,
>16 lelong >0 %d Hz
# Creative Labs AUDIO stuff
0 string MThd Standard MIDI data
!:mime audio/midi
>8 beshort x (format %d)
>10 beshort x using %d track
>10 beshort >1 \bs
>12 beshort&0x7fff x at 1/%d
>12 beshort&0x8000 >0 SMPTE
0 string CTMF Creative Music (CMF) data
!:mime audio/x-unknown
0 string SBI SoundBlaster instrument data
!:mime audio/x-unknown
0 string Creative\ Voice\ File Creative Labs voice data
!:mime audio/x-unknown
# is this next line right? it came this way...
>19 byte 0x1A
>23 byte >0 - version %d
>22 byte >0 \b.%d
# first entry is also the string "NTRK"
0 belong 0x4e54524b MultiTrack sound data
>4 belong x - version %ld
# Extended MOD format (*.emd) (Greg Roelofs, newt@uchicago.edu); NOT TESTED
# [based on posting 940824 by "Dirk/Elastik", husberg@lehtori.cc.tut.fi]
0 string EMOD Extended MOD sound data,
>4 byte&0xf0 x version %d
>4 byte&0x0f x \b.%d,
>45 byte x %d instruments
>83 byte 0 (module)
>83 byte 1 (song)
# Real Audio (Magic .ra\0375)
0 belong 0x2e7261fd RealAudio sound file
!:mime audio/x-pn-realaudio
0 string .RMF RealMedia file
!:mime application/vnd.rn-realmedia
#video/x-pn-realvideo
#video/vnd.rn-realvideo
#application/vnd.rn-realmedia
# sigh, there are many mimes for that but the above are the most common.
# MTM/669/FAR/S3M/ULT/XM format checking [Aaron Eppert, aeppert@dialin.ind.net]
# Oct 31, 1995
# fixed by <doj@cubic.org> 2003-06-24
# Too short...
#0 string MTM MultiTracker Module sound file
#0 string if Composer 669 Module sound data
#0 string JN Composer 669 Module sound data (extended format)
0 string MAS_U ULT(imate) Module sound data
#0 string FAR Module sound data
#>4 string >\15 Title: "%s"
0x2c string SCRM ScreamTracker III Module sound data
>0 string >\0 Title: "%s"
# Gravis UltraSound patches
# From <ache@nagual.ru>
0 string GF1PATCH110\0ID#000002\0 GUS patch
0 string GF1PATCH100\0ID#000002\0 Old GUS patch
# mime types according to http://www.geocities.com/nevilo/mod.htm:
# audio/it .it
# audio/x-zipped-it .itz
# audio/xm fasttracker modules
# audio/x-s3m screamtracker modules
# audio/s3m screamtracker modules
# audio/x-zipped-mod mdz
# audio/mod mod
# audio/x-mod All modules (mod, s3m, 669, mtm, med, xm, it, mdz, stm, itz, xmz, s3z)
#
# Taken from loader code from mikmod version 2.14
# by Steve McIntyre (stevem@chiark.greenend.org.uk)
# <doj@cubic.org> added title printing on 2003-06-24
0 string MAS_UTrack_V00
>14 string >/0 ultratracker V1.%.1s module sound data
!:mime audio/x-mod
#audio/x-tracker-module
0 string UN05 MikMod UNI format module sound data
0 string Extended\ Module: Fasttracker II module sound data
!:mime audio/x-mod
#audio/x-tracker-module
>17 string >\0 Title: "%s"
21 string/c =!SCREAM! Screamtracker 2 module sound data
!:mime audio/x-mod
#audio/x-screamtracker-module
21 string BMOD2STM Screamtracker 2 module sound data
!:mime audio/x-mod
#audio/x-screamtracker-module
1080 string M.K. 4-channel Protracker module sound data
!:mime audio/x-mod
#audio/x-protracker-module
>0 string >\0 Title: "%s"
1080 string M!K! 4-channel Protracker module sound data
!:mime audio/x-mod
#audio/x-protracker-module
>0 string >\0 Title: "%s"
1080 string FLT4 4-channel Startracker module sound data
!:mime audio/x-mod
#audio/x-startracker-module
>0 string >\0 Title: "%s"
1080 string FLT8 8-channel Startracker module sound data
!:mime audio/x-mod
#audio/x-startracker-module
>0 string >\0 Title: "%s"
1080 string 4CHN 4-channel Fasttracker module sound data
!:mime audio/x-mod
#audio/x-fasttracker-module
>0 string >\0 Title: "%s"
1080 string 6CHN 6-channel Fasttracker module sound data
!:mime audio/x-mod
#audio/x-fasttracker-module
>0 string >\0 Title: "%s"
1080 string 8CHN 8-channel Fasttracker module sound data
!:mime audio/x-mod
#audio/x-fasttracker-module
>0 string >\0 Title: "%s"
1080 string CD81 8-channel Octalyser module sound data
!:mime audio/x-mod
#audio/x-octalysertracker-module
>0 string >\0 Title: "%s"
1080 string OKTA 8-channel Octalyzer module sound data
!:mime audio/x-mod
#audio/x-octalysertracker-module
>0 string >\0 Title: "%s"
# Not good enough.
#1082 string CH
#>1080 string >/0 %.2s-channel Fasttracker "oktalyzer" module sound data
1080 string 16CN 16-channel Taketracker module sound data
!:mime audio/x-mod
#audio/x-taketracker-module
>0 string >\0 Title: "%s"
1080 string 32CN 32-channel Taketracker module sound data
!:mime audio/x-mod
#audio/x-taketracker-module
>0 string >\0 Title: "%s"
# TOC sound files -Trevor Johnson <trevor@jpj.net>
#
0 string TOC TOC sound file
# sidfiles <pooka@iki.fi>
# added name,author,(c) and new RSID type by <doj@cubic.org> 2003-06-24
0 string SIDPLAY\ INFOFILE Sidplay info file
0 string PSID PlaySID v2.2+ (AMIGA) sidtune
>4 beshort >0 w/ header v%d,
>14 beshort =1 single song,
>14 beshort >1 %d songs,
>16 beshort >0 default song: %d
>0x16 string >\0 name: "%s"
>0x36 string >\0 author: "%s"
>0x56 string >\0 copyright: "%s"
0 string RSID RSID sidtune PlaySID compatible
>4 beshort >0 w/ header v%d,
>14 beshort =1 single song,
>14 beshort >1 %d songs,
>16 beshort >0 default song: %d
>0x16 string >\0 name: "%s"
>0x36 string >\0 author: "%s"
>0x56 string >\0 copyright: "%s"
# IRCAM <mpruett@sgi.com>
# VAX and MIPS files are little-endian; Sun and NeXT are big-endian
0 belong 0x64a30100 IRCAM file (VAX)
0 belong 0x64a30200 IRCAM file (Sun)
0 belong 0x64a30300 IRCAM file (MIPS little-endian)
0 belong 0x64a30400 IRCAM file (NeXT)
# NIST SPHERE <mpruett@sgi.com>
0 string NIST_1A\n\ \ \ 1024\n NIST SPHERE file
# Sample Vision <mpruett@sgi.com>
0 string SOUND\ SAMPLE\ DATA\ Sample Vision file
# Audio Visual Research <tonigonenstein@users.sourceforge.net>
0 string 2BIT Audio Visual Research file,
>12 beshort =0 mono,
>12 beshort =-1 stereo,
>14 beshort x %d bits
>16 beshort =0 unsigned,
>16 beshort =-1 signed,
>22 belong&0x00ffffff x %d Hz,
>18 beshort =0 no loop,
>18 beshort =-1 loop,
>21 ubyte <128 note %d,
>22 byte =0 replay 5.485 KHz
>22 byte =1 replay 8.084 KHz
>22 byte =2 replay 10.971 Khz
>22 byte =3 replay 16.168 Khz
>22 byte =4 replay 21.942 KHz
>22 byte =5 replay 32.336 KHz
>22 byte =6 replay 43.885 KHz
>22 byte =7 replay 47.261 KHz
# SGI SoundTrack <mpruett@sgi.com>
0 string _SGI_SoundTrack SGI SoundTrack project file
# ID3 version 2 tags <waschk@informatik.uni-rostock.de>
0 string ID3 Audio file with ID3 version 2
>3 byte x \b.%d
>4 byte x \b.%d
>>5 byte &0x80 \b, unsynchronized frames
>>5 byte &0x40 \b, extended header
>>5 byte &0x20 \b, experimental
>>5 byte &0x10 \b, footer present
>(6.I) indirect x \b, contains:
# NSF (NES sound file) magic
0 string NESM\x1a NES Sound File
>14 string >\0 ("%s" by
>46 string >\0 %s, copyright
>78 string >\0 %s),
>5 byte x version %d,
>6 byte x %d tracks,
>122 byte&0x2 =1 dual PAL/NTSC
>122 byte&0x1 =1 PAL
>122 byte&0x1 =0 NTSC
# Impulse tracker module (audio/x-it)
0 string IMPM Impulse Tracker module sound data -
!:mime audio/x-mod
>4 string >\0 "%s"
>40 leshort !0 compatible w/ITv%x
>42 leshort !0 created w/ITv%x
# Imago Orpheus module (audio/x-imf)
60 string IM10 Imago Orpheus module sound data -
>0 string >\0 "%s"
# From <collver1@attbi.com>
# These are the /etc/magic entries to decode modules, instruments, and
# samples in Impulse Tracker's native format.
0 string IMPS Impulse Tracker Sample
>18 byte &2 16 bit
>18 byte ^2 8 bit
>18 byte &4 stereo
>18 byte ^4 mono
0 string IMPI Impulse Tracker Instrument
>28 leshort !0 ITv%x
>30 byte !0 %d samples
# Yamaha TX Wave: file(1) magic for Yamaha TX Wave audio files
# From <collver1@attbi.com>
0 string LM8953 Yamaha TX Wave
>22 byte 0x49 looped
>22 byte 0xC9 non-looped
>23 byte 1 33kHz
>23 byte 2 50kHz
>23 byte 3 16kHz
# scream tracker: file(1) magic for Scream Tracker sample files
#
# From <collver1@attbi.com>
76 string SCRS Scream Tracker Sample
>0 byte 1 sample
>0 byte 2 adlib melody
>0 byte >2 adlib drum
>31 byte &2 stereo
>31 byte ^2 mono
>31 byte &4 16bit little endian
>31 byte ^4 8bit
>30 byte 0 unpacked
>30 byte 1 packed
# audio
# From: Cory Dikkers <cdikkers@swbell.net>
0 string MMD0 MED music file, version 0
0 string MMD1 OctaMED Pro music file, version 1
0 string MMD3 OctaMED Soundstudio music file, version 3
0 string OctaMEDCmpr OctaMED Soundstudio compressed file
0 string MED MED_Song
0 string SymM Symphonie SymMOD music file
#
0 string THX AHX version
>3 byte =0 1 module data
>3 byte =1 2 module data
#
0 string OKTASONG Oktalyzer module data
#
0 string DIGI\ Booster\ module\0 %s
>20 byte >0 %c
>>21 byte >0 \b%c
>>>22 byte >0 \b%c
>>>>23 byte >0 \b%c
>610 string >\0 \b, "%s"
#
0 string DBM0 DIGI Booster Pro Module
>4 byte >0 V%X.
>>5 byte x \b%02X
>16 string >\0 \b, "%s"
#
0 string FTMN FaceTheMusic module
>16 string >\0d \b, "%s"
# From: <doj@cubic.org> 2003-06-24
0 string AMShdr\32 Velvet Studio AMS Module v2.2
0 string Extreme Extreme Tracker AMS Module v1.3
0 string DDMF Xtracker DMF Module
>4 byte x v%i
>0xD string >\0 Title: "%s"
>0x2B string >\0 Composer: "%s"
0 string DSM\32 Dynamic Studio Module DSM
0 string SONG DigiTrekker DTM Module
0 string DMDL DigiTrakker MDL Module
0 string PSM\32 Protracker Studio PSM Module
44 string PTMF Poly Tracker PTM Module
>0 string >\32 Title: "%s"
0 string MT20 MadTracker 2.0 Module MT2
0 string RAD\40by\40REALiTY!! RAD Adlib Tracker Module RAD
0 string RTMM RTM Module
0x426 string MaDoKaN96 XMS Adlib Module
>0 string >\0 Composer: "%s"
0 string AMF AMF Module
>4 string >\0 Title: "%s"
0 string MODINFO1 Open Cubic Player Module Inforation MDZ
0 string Extended\40Instrument: Fast Tracker II Instrument
# From: Takeshi Hamasaki <hma@syd.odn.ne.jp>
# NOA Nancy Codec file
0 string \210NOA\015\012\032 NOA Nancy Codec Movie file
# Yamaha SMAF format
0 string MMMD Yamaha SMAF file
# Sharp Jisaku Melody format for PDC
0 string \001Sharp\040JisakuMelody SHARP Cell-Phone ringing Melody
>20 string Ver01.00 Ver. 1.00
>>32 byte x , %d tracks
# Free lossless audio codec <http://flac.sourceforge.net>
# From: Przemyslaw Augustyniak <silvathraec@rpg.pl>
0 string fLaC FLAC audio bitstream data
!:mime audio/x-flac
>4 byte&0x7f >0 \b, unknown version
>4 byte&0x7f 0 \b
# some common bits/sample values
>>20 beshort&0x1f0 0x030 \b, 4 bit
>>20 beshort&0x1f0 0x050 \b, 6 bit
>>20 beshort&0x1f0 0x070 \b, 8 bit
>>20 beshort&0x1f0 0x0b0 \b, 12 bit
>>20 beshort&0x1f0 0x0f0 \b, 16 bit
>>20 beshort&0x1f0 0x170 \b, 24 bit
>>20 byte&0xe 0x0 \b, mono
>>20 byte&0xe 0x2 \b, stereo
>>20 byte&0xe 0x4 \b, 3 channels
>>20 byte&0xe 0x6 \b, 4 channels
>>20 byte&0xe 0x8 \b, 5 channels
>>20 byte&0xe 0xa \b, 6 channels
>>20 byte&0xe 0xc \b, 7 channels
>>20 byte&0xe 0xe \b, 8 channels
# some common sample rates
>>17 belong&0xfffff0 0x0ac440 \b, 44.1 kHz
>>17 belong&0xfffff0 0x0bb800 \b, 48 kHz
>>17 belong&0xfffff0 0x07d000 \b, 32 kHz
>>17 belong&0xfffff0 0x056220 \b, 22.05 kHz
>>17 belong&0xfffff0 0x05dc00 \b, 24 kHz
>>17 belong&0xfffff0 0x03e800 \b, 16 kHz
>>17 belong&0xfffff0 0x02b110 \b, 11.025 kHz
>>17 belong&0xfffff0 0x02ee00 \b, 12 kHz
>>17 belong&0xfffff0 0x01f400 \b, 8 kHz
>>17 belong&0xfffff0 0x177000 \b, 96 kHz
>>17 belong&0xfffff0 0x0fa000 \b, 64 kHz
>>21 byte&0xf >0 \b, >4G samples
>>21 byte&0xf 0 \b
>>>22 belong >0 \b, %u samples
>>>22 belong 0 \b, length unknown
# (ISDN) VBOX voice message file (Wolfram Kleff)
0 string VBOX VBOX voice message data
# ReBorn Song Files (.rbs)
# David J. Singer <doc@deadvirgins.org.uk>
8 string RB40 RBS Song file
>29 string ReBorn created by ReBorn
>37 string Propellerhead created by ReBirth
# Synthesizer Generator and Kimwitu share their file format
0 string A#S#C#S#S#L#V#3 Synthesizer Generator or Kimwitu data
# Kimwitu++ uses a slightly different magic
0 string A#S#C#S#S#L#HUB Kimwitu++ data
# From "Simon Hosie
0 string TFMX-SONG TFMX module sound data
# Monkey's Audio compressed audio format (.ape)
# From danny.milo@gmx.net (Danny Milosavljevic)
# New version from Abel Cheung <abel (@) oaka.org>
0 string MAC\040 Monkey's Audio compressed format
>4 uleshort >0x0F8B version %d
>>(0x08.l) uleshort =1000 with fast compression
>>(0x08.l) uleshort =2000 with normal compression
>>(0x08.l) uleshort =3000 with high compression
>>(0x08.l) uleshort =4000 with extra high compression
>>(0x08.l) uleshort =5000 with insane compression
>>(0x08.l+18) uleshort =1 \b, mono
>>(0x08.l+18) uleshort =2 \b, stereo
>>(0x08.l+20) ulelong x \b, sample rate %d
>4 uleshort <0x0F8C version %d
>>6 uleshort =1000 with fast compression
>>6 uleshort =2000 with normal compression
>>6 uleshort =3000 with high compression
>>6 uleshort =4000 with extra high compression
>>6 uleshort =5000 with insane compression
>>10 uleshort =1 \b, mono
>>10 uleshort =2 \b, stereo
>>12 ulelong x \b, sample rate %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
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)
# format VQF (proprietary codec for sound)
# some infos on the header file available at :
# http://www.twinvq.org/english/technology_format.html
0 string TWIN97012000 VQF data
>27 short 0 \b, Mono
>27 short 1 \b, Stereo
>31 short >0 \b, %d kbit/s
>35 short >0 \b, %d kHz
# Nelson A. de Oliveira (naoliv@gmail.com)
# .eqf
0 string Winamp\ EQ\ library\ file %s
# it will match only versions like v<digit>.<digit>
# Since I saw only eqf files with version v1.1 I think that it's OK
>23 string x \b%.4s
# .preset
0 string [Equalizer\ preset] XMMS equalizer preset
# .m3u
0 search/1 #EXTM3U M3U playlist text
# .pls
0 search/1 [playlist] PLS playlist text
# licq.conf
1 string [licq] LICQ configuration file
# Atari ST audio files by Dirk Jagdmann <doj@cubic.org>
0 string ICE! SNDH Atari ST music
0 string SC68\ Music-file\ /\ (c)\ (BeN)jami sc68 Atari ST music
# musepak support From: "Jiri Pejchal" <jiri.pejchal@gmail.com>
0 string MP+ Musepack audio
>3 byte 255 \b, SV pre8
>3 byte&0xF 0x6 \b, SV 6
>3 byte&0xF 0x8 \b, SV 8
>3 byte&0xF 0x7 \b, SV 7
>>3 byte&0xF0 0x0 \b.0
>>3 byte&0xF0 0x10 \b.1
>>3 byte&0xF0 240 \b.15
>>10 byte&0xF0 0x0 \b, no profile
>>10 byte&0xF0 0x10 \b, profile 'Unstable/Experimental'
>>10 byte&0xF0 0x50 \b, quality 0
>>10 byte&0xF0 0x60 \b, quality 1
>>10 byte&0xF0 0x70 \b, quality 2 (Telephone)
>>10 byte&0xF0 0x80 \b, quality 3 (Thumb)
>>10 byte&0xF0 0x90 \b, quality 4 (Radio)
>>10 byte&0xF0 0xA0 \b, quality 5 (Standard)
>>10 byte&0xF0 0xB0 \b, quality 6 (Xtreme)
>>10 byte&0xF0 0xC0 \b, quality 7 (Insane)
>>10 byte&0xF0 0xD0 \b, quality 8 (BrainDead)
>>10 byte&0xF0 0xE0 \b, quality 9
>>10 byte&0xF0 0xF0 \b, quality 10
>>27 byte 0x0 \b, Buschmann 1.7.0-9, Klemm 0.90-1.05
>>27 byte 102 \b, Beta 1.02
>>27 byte 104 \b, Beta 1.04
>>27 byte 105 \b, Alpha 1.05
>>27 byte 106 \b, Beta 1.06
>>27 byte 110 \b, Release 1.1
>>27 byte 111 \b, Alpha 1.11
>>27 byte 112 \b, Beta 1.12
>>27 byte 113 \b, Alpha 1.13
>>27 byte 114 \b, Beta 1.14
>>27 byte 115 \b, Alpha 1.15
# IMY
# from http://filext.com/detaillist.php?extdetail=IMY
# http://cellphones.about.com/od/cellularfaqs/f/rf_imelody.htm
# http://download.ncl.ie/doc/api/ie/ncl/media/music/IMelody.html
# http://www.wx800.com/msg/download/irda/iMelody.pdf
0 string BEGIN:IMELODY iMelody Ringtone Format
# From: "Mateus Caruccio" <mateus@caruccio.com>
# guitar pro v3,4,5 from http://filext.com/file-extension/gp3
0 string \030FICHIER\ GUITAR\ PRO\ v3. Guitar Pro Ver. 3 Tablature
# From: "Leslie P. Polzer" <leslie.polzer@gmx.net>
60 string SONG SoundFX Module sound file
# Type: Adaptive Multi-Rate Codec
# URL: http://filext.com/detaillist.php?extdetail=AMR
# From: Russell Coker <russell@coker.com.au>
0 string #!AMR Adaptive Multi-Rate Codec (GSM telephony)

View file

@ -0,0 +1,16 @@
#----------------------------------------------------------------
# basis: file(1) magic for BBx/Pro5-files
# Oliver Dammer <dammer@olida.de> 2005/11/07
# http://www.basis.com business-basic-files.
#
0 string \074\074bbx\076\076 BBx
>7 string \000 indexed file
>7 string \001 serial file
>7 string \002 keyed file
>>13 short 0 (sort)
>7 string \004 program
>>18 byte x (LEVEL %d)
>>>23 string >\000 psaved
>7 string \006 mkeyed file
>>13 short 0 (sort)
>>8 string \000 (mkey)

View file

@ -0,0 +1,12 @@
#------------------------------------------------------------------------------
# bFLT: file(1) magic for BFLT uclinux binary files
#
# From Philippe De Muyter <phdm@macqel.be>
#
0 string bFLT BFLT executable
>4 belong x - version %ld
>4 belong 4
>>36 belong&0x1 0x1 ram
>>36 belong&0x2 0x2 gotpic
>>36 belong&0x4 0x4 gzip
>>36 belong&0x8 0x8 gzdata

View file

@ -0,0 +1,37 @@
#------------------------------------------------------------------------------
# blender: file(1) magic for Blender 3D related files
#
# Native format rule v1.2. For questions use the developers list
# http://lists.blender.org/mailman/listinfo/bf-committers
# GLOB chunk was moved near start and provides subversion info since 2.42
0 string =BLENDER Blender3D,
>7 string =_ saved as 32-bits
>>8 string =v little endian
>>>9 byte x with version %c.
>>>10 byte x \b%c
>>>11 byte x \b%c
>>>0x40 string =GLOB \b.
>>>>0x58 leshort x \b%.4d
>>8 string =V big endian
>>>9 byte x with version %c.
>>>10 byte x \b%c
>>>11 byte x \b%c
>>>0x40 string =GLOB \b.
>>>>0x58 beshort x \b%.4d
>7 string =- saved as 64-bits
>>8 string =v little endian
>>9 byte x with version %c.
>>10 byte x \b%c
>>11 byte x \b%c
>>0x44 string =GLOB \b.
>>>0x60 leshort x \b%.4d
>>8 string =V big endian
>>>9 byte x with version %c.
>>>10 byte x \b%c
>>>11 byte x \b%c
>>>0x44 string =GLOB \b.
>>>>0x60 beshort x \b%.4d
# Scripts that run in the embeded Python interpreter
0 string #!BPY Blender3D BPython script

View file

@ -0,0 +1,19 @@
#------------------------------------------------------------------------------
# blit: file(1) magic for 68K Blit stuff as seen from 680x0 machine
#
# Note that this 0407 conflicts with several other a.out formats...
#
# XXX - should this be redone with "be" and "le", so that it works on
# little-endian machines as well? If so, what's the deal with
# "VAX-order" and "VAX-order2"?
#
#0 long 0407 68K Blit (standalone) executable
#0 short 0407 VAX-order2 68K Blit (standalone) executable
0 short 03401 VAX-order 68K Blit (standalone) executable
0 long 0406 68k Blit mpx/mux executable
0 short 0406 VAX-order2 68k Blit mpx/mux executable
0 short 03001 VAX-order 68k Blit mpx/mux executable
# Need more values for WE32 DMD executables.
# Note that 0520 is the same as COFF
#0 short 0520 tty630 layers executable

View file

@ -0,0 +1,9 @@
#
# i80960 b.out objects and archives
#
0 long 0x10d i960 b.out relocatable object
>16 long >0 not stripped
#
# b.out archive (hp-rt on i960)
0 string =!<bout> b.out archive
>8 string __.SYMDEF random library

View file

@ -0,0 +1,41 @@
#------------------------------------------------------------------------------
# bsdi: file(1) magic for BSD/OS (from BSDI) objects
#
0 lelong 0314 386 compact demand paged pure executable
>16 lelong >0 not stripped
>32 byte 0x6a (uses shared libs)
0 lelong 0407 386 executable
>16 lelong >0 not stripped
>32 byte 0x6a (uses shared libs)
0 lelong 0410 386 pure executable
>16 lelong >0 not stripped
>32 byte 0x6a (uses shared libs)
0 lelong 0413 386 demand paged pure executable
>16 lelong >0 not stripped
>32 byte 0x6a (uses shared libs)
# same as in SunOS 4.x, except for static shared libraries
0 belong&077777777 0600413 sparc demand paged
>0 byte &0x80
>>20 belong <4096 shared library
>>20 belong =4096 dynamically linked executable
>>20 belong >4096 dynamically linked executable
>0 byte ^0x80 executable
>16 belong >0 not stripped
>36 belong 0xb4100001 (uses shared libs)
0 belong&077777777 0600410 sparc pure
>0 byte &0x80 dynamically linked executable
>0 byte ^0x80 executable
>16 belong >0 not stripped
>36 belong 0xb4100001 (uses shared libs)
0 belong&077777777 0600407 sparc
>0 byte &0x80 dynamically linked executable
>0 byte ^0x80 executable
>16 belong >0 not stripped
>36 belong 0xb4100001 (uses shared libs)

View file

@ -0,0 +1,11 @@
#------------------------------------------------------------------------------
# BTSnoop: file(1) magic for BTSnoop files
#
# From <marcel@holtmann.org>
0 string btsnoop\0 BTSnoop
>8 belong x version %d,
>12 belong 1001 Unencapsulated HCI
>12 belong 1002 HCI UART (H4)
>12 belong 1003 HCI BCSP
>12 belong 1004 HCI Serial (H5)
>>12 belong x type %d

View file

@ -0,0 +1,27 @@
#------------------------------------------------------------------------------
# c-lang: file(1) magic for C programs (or REXX)
#
# XPM icons (Greg Roelofs, newt@uchicago.edu)
# if you uncomment "/*" for C/REXX below, also uncomment this entry
#0 string /*\ XPM\ */ X pixmap image data
#!:mime image/x-xpmi
# 3DS (3d Studio files) Conflicts with diff output 0x3d '='
#16 beshort 0x3d3d image/x-3ds
# this first will upset you if you're a PL/1 shop...
# in which case rm it; ascmagic will catch real C programs
#0 search/1 /* C or REXX program text
#0 search/1 // C++ program text
# From: Mikhail Teterin <mi@aldan.algebra.com>
0 string cscope cscope reference data
>7 string x version %.2s
# We skip the path here, because it is often long (so file will
# truncate it) and mostly redundant.
# The inverted index functionality was added some time betwen
# versions 11 and 15, so look for -q if version is above 14:
>7 string >14
>>10 search/100 \ -q\ with inverted index
>10 search/100 \ -c\ text (non-compressed)

41
external/bsd/file/dist/magic/magdir/c64 vendored Normal file
View file

@ -0,0 +1,41 @@
#------------------------------------------------------------------------------
# c64: file(1) magic for various commodore 64 related files
#
# From: Dirk Jagdmann <doj@cubic.org>
0x16500 belong 0x12014100 D64 Image
0x16500 belong 0x12014180 D71 Image
0x61800 belong 0x28034400 D81 Image
0 string C64\40CARTRIDGE CCS C64 Emultar Cartridge Image
0 belong 0x43154164 X64 Image
0 string GCR-1541 GCR Image
>8 byte x version: %i
>9 byte x tracks: %i
9 string PSUR ARC archive (c64)
2 string -LH1- LHA archive (c64)
0 string C64File PC64 Emulator file
>8 string >\0 "%s"
0 string C64Image PC64 Freezer Image
0 beshort 0x38CD C64 PCLink Image
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

69
external/bsd/file/dist/magic/magdir/cad vendored Normal file
View file

@ -0,0 +1,69 @@
#------------------------------------------------------------------------------
# autocad: file(1) magic for cad files
#
# AutoCAD DWG versions R13/R14 (www.autodesk.com)
# Written December 01, 2003 by Lester Hightower
# Based on the DWG File Format Specifications at http://www.opendwg.org/
0 string \101\103\061\060\061 AutoCAD
>5 string \062\000\000\000\000 DWG ver. R13
>5 string \064\000\000\000\000 DWG ver. R14
# Microstation DGN/CIT Files (www.bentley.com)
# Last updated July 29, 2005 by Lester Hightower
# DGN is the default file extension of Microstation/Intergraph CAD files.
# CIT is the proprietary raster format (similar to TIFF) used to attach
# raster underlays to Microstation DGN (vector) drawings.
#
# http://www.wotsit.org/search.asp
# http://filext.com/detaillist.php?extdetail=DGN
# http://filext.com/detaillist.php?extdetail=CIT
#
# http://www.bentley.com/products/default.cfm?objectid=97F351F5-9C35-4E5E-89C2
# 3F86C928&method=display&p_objectid=97F351F5-9C35-4E5E-89C280A93F86C928
# http://www.bentley.com/products/default.cfm?objectid=A5C2FD43-3AC9-4C71-B682
# 721C479F&method=display&p_objectid=A5C2FD43-3AC9-4C71-B682C7BE721C479F
0 string \010\011\376 Microstation
>3 string \002
>>30 string \026\105 DGNFile
>>30 string \034\105 DGNFile
>>30 string \073\107 DGNFile
>>30 string \073\110 DGNFile
>>30 string \106\107 DGNFile
>>30 string \110\103 DGNFile
>>30 string \120\104 DGNFile
>>30 string \172\104 DGNFile
>>30 string \172\105 DGNFile
>>30 string \172\106 DGNFile
>>30 string \234\106 DGNFile
>>30 string \273\105 DGNFile
>>30 string \306\106 DGNFile
>>30 string \310\104 DGNFile
>>30 string \341\104 DGNFile
>>30 string \372\103 DGNFile
>>30 string \372\104 DGNFile
>>30 string \372\106 DGNFile
>>30 string \376\103 DGNFile
>4 string \030\000\000 CITFile
>4 string \030\000\003 CITFile
# AutoCad, from Nahuel Greco
# AutoCAD DWG versions R12/R13/R14 (www.autodesk.com)
0 string AC1012 AutoCad (release 12)
0 string AC1013 AutoCad (release 13)
0 string AC1014 AutoCad (release 14)
# CAD: file(1) magic for computer aided design files
# Phillip Griffith <phillip dot griffith at gmail dot com>
# AutoCAD magic taken from the Open Design Alliance's OpenDWG specifications.
#
0 belong 0x08051700 Bentley/Intergraph MicroStation DGN cell library
0 belong 0x0809fe02 Bentley/Intergraph MicroStation DGN vector CAD
0 belong 0xc809fe02 Bentley/Intergraph MicroStation DGN vector CAD
0 beshort 0x0809 Bentley/Intergraph MicroStation
>0x02 byte 0xfe
>>0x04 beshort 0x1800 CIT raster CAD
0 string AC1012 AutoDesk AutoCAD R13
0 string AC1014 AutoDesk AutoCAD R14
0 string AC1015 AutoDesk AutoCAD R2000

View file

@ -0,0 +1,38 @@
#------------------------------------------------------------------------------
# Cafe Babes unite!
#
# Since Java bytecode and Mach-O fat-files have the same magic number, the test
# must be performed in the same "magic" sequence to get both right. The long
# at offset 4 in a mach-O fat file tells the number of architectures; the short at
# offset 4 in a Java bytecode file is the JVM minor version and the
# short at offset 6 is the JVM major version. Since there are only
# only 18 labeled Mach-O architectures at current, and the first released
# Java class format was version 43.0, we can safely choose any number
# between 18 and 39 to test the number of architectures against
# (and use as a hack). Let's not use 18, because the Mach-O people
# might add another one or two as time goes by...
#
0 belong 0xcafebabe
!:mime application/x-java-applet
>4 belong >30 compiled Java class data,
>>6 beshort x version %d.
>>4 beshort x \b%d
# Which is which?
#>>4 belong 0x032d (Java 1.0)
#>>4 belong 0x032d (Java 1.1)
>>4 belong 0x002e (Java 1.2)
>>4 belong 0x002f (Java 1.3)
>>4 belong 0x0030 (Java 1.4)
>>4 belong 0x0031 (Java 1.5)
>>4 belong 0x0032 (Java 1.6)
0 belong 0xcafebabe
>4 belong 1 Mach-O fat file with 1 architecture
>4 belong >1
>>4 belong <20 Mach-O fat file with %ld architectures
0 belong 0xcafed00d JAR compressed with pack200,
>>5 byte x version %d.
>>4 byte x \b%d
!:mime application/x-java-pack200

View file

@ -0,0 +1,10 @@
#------------------------------------------------------------------------------
# CDDB: file(1) magic for CDDB(tm) format CD text data files
#
# From <steve@gracenote.com>
#
# This is the /etc/magic entry to decode datafiles as used by
# CDDB-enabled CD player applications.
#
0 search/1/b #\040xmcd CDDB(tm) format CD text data

View file

@ -0,0 +1,9 @@
#------------------------------------------------------------------------------
# chord: file(1) magic for Chord music sheet typesetting utility input files
#
# From Philippe De Muyter <phdm@macqel.be>
# File format is actually free, but many distributed files begin with `{title'
#
0 string {title Chord text file

View file

@ -0,0 +1,10 @@
#------------------------------------------------------------------------------
# cisco: file(1) magic for cisco Systems routers
#
# Most cisco file-formats are covered by the generic elf code
#
# Microcode files are non-ELF, 0x8501 conflicts with NetBSD/alpha.
0 belong&0xffffff00 0x85011400 cisco IOS microcode
>7 string >\0 for '%s'
0 belong&0xffffff00 0x8501cb00 cisco IOS experimental microcode
>7 string >\0 for '%s'

View file

@ -0,0 +1,6 @@
#------------------------------------------------------------------------------
# citrus locale declaration
#
0 string RuneCT Citrus locale declaration for LC_CTYPE

View file

@ -0,0 +1,26 @@
#------------------------------------------------------------------------------
# clarion: file(1) magic for # Clarion Personal/Professional Developer
# (v2 and above)
# From: Julien Blache <jb@jblache.org>
# Database files
# signature
0 leshort 0x3343 Clarion Developer (v2 and above) data file
# attributes
>2 leshort &0x0001 \b, locked
>2 leshort &0x0004 \b, encrypted
>2 leshort &0x0008 \b, memo file exists
>2 leshort &0x0010 \b, compressed
>2 leshort &0x0040 \b, read only
# number of records
>5 lelong x \b, %ld records
# Memo files
0 leshort 0x334d Clarion Developer (v2 and above) memo data
# Key/Index files
# No magic? :(
# Help files
0 leshort 0x49e0 Clarion Developer (v2 and above) help data

View file

@ -0,0 +1,46 @@
#------------------------------------------------------------------------------
# claris: file(1) magic for claris
# "H. Nanosecond" <aldomel@ix.netcom.com>
# Claris Works a word processor, etc.
# Version 3.0
# .pct claris works clip art files
#0000000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
#*
#0001000 #010 250 377 377 377 377 000 213 000 230 000 021 002 377 014 000
#null to byte 1000 octal
514 string \377\377\377\377\000 Claris clip art?
>0 string \0\0\0\0\0\0\0\0\0\0\0\0\0 yes.
514 string \377\377\377\377\001 Claris clip art?
>0 string \0\0\0\0\0\0\0\0\0\0\0\0\0 yes.
# Claris works files
# .cwk
0 string \002\000\210\003\102\117\102\117\000\001\206 Claris works document
# .plt
0 string \020\341\000\000\010\010 Claris Works pallete files .plt
# .msp a dictionary file I am not sure about this I have only one .msp file
0 string \002\271\262\000\040\002\000\164 Claris works dictionary
# .usp are user dictionary bits
# I am not sure about a magic header:
#0000000 001 123 160 146 070 125 104 040 136 123 015 012 160 157 144 151
# soh S p f 8 U D sp ^ S cr nl p o d i
#0000020 141 164 162 151 163 164 040 136 123 015 012 144 151 166 040 043
# a t r i s t sp ^ S cr nl d i v sp #
# .mth Thesaurus
# starts with \0 but no magic header
# .chy Hyphenation file
# I am not sure: 000 210 034 000 000
# other claris files
#./windows/claris/useng.ndx: data
#./windows/claris/xtndtran.l32: data
#./windows/claris/xtndtran.lst: data
#./windows/claris/clworks.lbl: data
#./windows/claris/clworks.prf: data
#./windows/claris/userd.spl: data

View file

@ -0,0 +1,64 @@
#------------------------------------------------------------------------------
# clipper: file(1) magic for Intergraph (formerly Fairchild) Clipper.
#
# XXX - what byte order does the Clipper use?
#
# XXX - what's the "!" stuff:
#
# >18 short !074000,000000 C1 R1
# >18 short !074000,004000 C2 R1
# >18 short !074000,010000 C3 R1
# >18 short !074000,074000 TEST
#
# I shall assume it's ANDing the field with the first value and
# comparing it with the second, and rewrite it as:
#
# >18 short&074000 000000 C1 R1
# >18 short&074000 004000 C2 R1
# >18 short&074000 010000 C3 R1
# >18 short&074000 074000 TEST
#
# as SVR3.1's "file" doesn't support anything of the "!074000,000000"
# sort, nor does SunOS 4.x, so either it's something Intergraph added
# in CLIX, or something AT&T added in SVR3.2 or later, or something
# somebody else thought was a good idea; it's not documented in the
# man page for this version of "magic", nor does it appear to be
# implemented (at least not after I blew off the bogus code to turn
# old-style "&"s into new-style "&"s, which just didn't work at all).
#
0 short 0575 CLIPPER COFF executable (VAX #)
>20 short 0407 (impure)
>20 short 0410 (5.2 compatible)
>20 short 0411 (pure)
>20 short 0413 (demand paged)
>20 short 0443 (target shared library)
>12 long >0 not stripped
>22 short >0 - version %ld
0 short 0577 CLIPPER COFF executable
>18 short&074000 000000 C1 R1
>18 short&074000 004000 C2 R1
>18 short&074000 010000 C3 R1
>18 short&074000 074000 TEST
>20 short 0407 (impure)
>20 short 0410 (pure)
>20 short 0411 (separate I&D)
>20 short 0413 (paged)
>20 short 0443 (target shared library)
>12 long >0 not stripped
>22 short >0 - version %ld
>48 long&01 01 alignment trap enabled
>52 byte 1 -Ctnc
>52 byte 2 -Ctsw
>52 byte 3 -Ctpw
>52 byte 4 -Ctcb
>53 byte 1 -Cdnc
>53 byte 2 -Cdsw
>53 byte 3 -Cdpw
>53 byte 4 -Cdcb
>54 byte 1 -Csnc
>54 byte 2 -Cssw
>54 byte 3 -Cspw
>54 byte 4 -Cscb
4 string pipe CLIPPER instruction trace
4 string prof CLIPPER instruction profile

View file

@ -0,0 +1,83 @@
#------------------------------------------------------------------------------
# commands: file(1) magic for various shells and interpreters
#
#0 string : shell archive or script for antique kernel text
0 string/b #!\ /bin/sh POSIX shell script text executable
!:mime text/x-shellscript
0 string/b #!\ /bin/csh C shell script text executable
!:mime text/x-shellscript
# korn shell magic, sent by George Wu, gwu@clyde.att.com
0 string/b #!\ /bin/ksh Korn shell script text executable
!:mime text/x-shellscript
0 string/b #!\ /bin/tcsh Tenex C shell script text executable
!:mime text/x-shellscript
0 string/b #!\ /usr/local/tcsh Tenex C shell script text executable
!:mime text/x-shellscript
0 string/b #!\ /usr/local/bin/tcsh Tenex C shell script text executable
!:mime text/x-shellscript
#
# zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson)
0 string/b #!\ /bin/zsh Paul Falstad's zsh script text executable
!:mime text/x-shellscript
0 string/b #!\ /usr/bin/zsh Paul Falstad's zsh script text executable
!:mime text/x-shellscript
0 string/b #!\ /usr/local/bin/zsh Paul Falstad's zsh script text executable
!:mime text/x-shellscript
0 string/b #!\ /usr/local/bin/ash Neil Brown's ash script text executable
!:mime text/x-shellscript
0 string/b #!\ /usr/local/bin/ae Neil Brown's ae script text executable
!:mime text/x-shellscript
0 string/b #!\ /bin/nawk new awk script text executable
!:mime text/x-nawk
0 string/b #!\ /usr/bin/nawk new awk script text executable
!:mime text/x-nawk
0 string/b #!\ /usr/local/bin/nawk new awk script text executable
!:mime text/x-nawk
0 string/b #!\ /bin/gawk GNU awk script text executable
!:mime text/x-gawk
0 string/b #!\ /usr/bin/gawk GNU awk script text executable
!:mime text/x-gawk
0 string/b #!\ /usr/local/bin/gawk GNU awk script text executable
!:mime text/x-gawk
#
0 string/b #!\ /bin/awk awk script text executable
!:mime text/x-awk
0 string/b #!\ /usr/bin/awk awk script text executable
!:mime text/x-awk
# update to distinguish from *.vcf files
# this is broken because postscript has /EBEGIN{ for example.
#0 search/Bb BEGIN { awk script text
# AT&T Bell Labs' Plan 9 shell
0 string/b #!\ /bin/rc Plan 9 rc shell script text executable
# bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de)
0 string/b #!\ /bin/bash Bourne-Again shell script text executable
!:mime text/x-shellscript
0 string/b #!\ /usr/local/bin/bash Bourne-Again shell script text executable
!:mime text/x-shellscript
# using env
0 string #!/usr/bin/env a
>15 string >\0 %s script text executable
0 string #!\ /usr/bin/env a
>16 string >\0 %s script text executable
# PHP scripts
# Ulf Harnhammar <ulfh@update.uu.se>
0 search/1/c =<?php PHP script text
!:mime text/x-php
0 search/1 =<?\n PHP script text
!:mime text/x-php
0 search/1 =<?\r PHP script text
!:mime text/x-php
0 search/1/b #!\ /usr/local/bin/php PHP script text executable
!:mime text/x-php
0 search/1/b #!\ /usr/bin/php PHP script text executable
!:mime text/x-php
0 string Zend\x00 PHP script Zend Optimizer data
0 string $! DCL command file

View file

@ -0,0 +1,21 @@
#----------------------------------------------------------------------------
# communication
# TTCN is the Tree and Tabular Combined Notation described in ISO 9646-3.
# It is used for conformance testing of communication protocols.
# Added by W. Borgert <debacle@debian.org>.
0 string $Suite TTCN Abstract Test Suite
>&1 string $SuiteId
>>&1 string >\n %s
>&2 string $SuiteId
>>&1 string >\n %s
>&3 string $SuiteId
>>&1 string >\n %s
# MSC (message sequence charts) are a formal description technique,
# described in ITU-T Z.120, mainly used for communication protocols.
# Added by W. Borgert <debacle@debian.org>.
0 string mscdocument Message Sequence Chart (document)
0 string msc Message Sequence Chart (chart)
0 string submsc Message Sequence Chart (subchart)

View file

@ -0,0 +1,219 @@
#------------------------------------------------------------------------------
# compress: file(1) magic for pure-compression formats (no archives)
#
# compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
#
# Formats for various forms of compressed data
# Formats for "compress" proper have been moved into "compress.c",
# because it tries to uncompress it to figure out what's inside.
# standard unix compress
0 string \037\235 compress'd data
!:mime application/x-compress
!:apple LZIVZIVU
>2 byte&0x80 >0 block compressed
>2 byte&0x1f x %d bits
# gzip (GNU zip, not to be confused with Info-ZIP or PKWARE zip archiver)
# Edited by Chris Chittleborough <cchittleborough@yahoo.com.au>, March 2002
# * Original filename is only at offset 10 if "extra field" absent
# * Produce shorter output - notably, only report compression methods
# other than 8 ("deflate", the only method defined in RFC 1952).
0 string \037\213 gzip compressed data
!:mime application/x-gzip
>2 byte <8 \b, reserved method
>2 byte >8 \b, unknown method
>3 byte &0x01 \b, ASCII
>3 byte &0x02 \b, has CRC
>3 byte &0x04 \b, extra field
>3 byte&0xC =0x08
>>10 string x \b, was "%s"
>3 byte &0x10 \b, has comment
>9 byte =0x00 \b, from FAT filesystem (MS-DOS, OS/2, NT)
>9 byte =0x01 \b, from Amiga
>9 byte =0x02 \b, from VMS
>9 byte =0x03 \b, from Unix
>9 byte =0x04 \b, from VM/CMS
>9 byte =0x05 \b, from Atari
>9 byte =0x06 \b, from HPFS filesystem (OS/2, NT)
>9 byte =0x07 \b, from MacOS
>9 byte =0x08 \b, from Z-System
>9 byte =0x09 \b, from CP/M
>9 byte =0x0A \b, from TOPS/20
>9 byte =0x0B \b, from NTFS filesystem (NT)
>9 byte =0x0C \b, from QDOS
>9 byte =0x0D \b, from Acorn RISCOS
>3 byte &0x10 \b, comment
>3 byte &0x20 \b, encrypted
>4 ledate >0 \b, last modified: %s
>8 byte 2 \b, max compression
>8 byte 4 \b, max speed
# packed data, Huffman (minimum redundancy) codes on a byte-by-byte basis
0 string \037\036 packed data
!:mime application/octet-stream
>2 belong >1 \b, %d characters originally
>2 belong =1 \b, %d character originally
#
# This magic number is byte-order-independent.
0 short 0x1f1f old packed data
!:mime application/octet-stream
# XXX - why *two* entries for "compacted data", one of which is
# byte-order independent, and one of which is byte-order dependent?
#
0 short 0x1fff compacted data
!:mime application/octet-stream
# This string is valid for SunOS (BE) and a matching "short" is listed
# in the Ultrix (LE) magic file.
0 string \377\037 compacted data
!:mime application/octet-stream
0 short 0145405 huf output
!:mime application/octet-stream
# bzip2
0 string BZh bzip2 compressed data
!:mime application/x-bzip2
>3 byte >47 \b, block size = %c00k
# lzip
0 string LZIP lzip compressed data
!:mime application/x-lzip
>4 byte x \b, version: %d
# squeeze and crunch
# Michael Haardt <michael@cantor.informatik.rwth-aachen.de>
0 beshort 0x76FF squeezed data,
>4 string x original name %s
0 beshort 0x76FE crunched data,
>2 string x original name %s
0 beshort 0x76FD LZH compressed data,
>2 string x original name %s
# Freeze
0 string \037\237 frozen file 2.1
0 string \037\236 frozen file 1.0 (or gzip 0.5)
# SCO compress -H (LZH)
0 string \037\240 SCO compress -H (LZH) data
# European GSM 06.10 is a provisional standard for full-rate speech
# transcoding, prI-ETS 300 036, which uses RPE/LTP (residual pulse
# excitation/long term prediction) coding at 13 kbit/s.
#
# There's only a magic nibble (4 bits); that nibble repeats every 33
# bytes. This isn't suited for use, but maybe we can use it someday.
#
# This will cause very short GSM files to be declared as data and
# mismatches to be declared as data too!
#0 byte&0xF0 0xd0 data
#>33 byte&0xF0 0xd0
#>66 byte&0xF0 0xd0
#>99 byte&0xF0 0xd0
#>132 byte&0xF0 0xd0 GSM 06.10 compressed audio
# bzip a block-sorting file compressor
# by Julian Seward <sewardj@cs.man.ac.uk> and others
#
#0 string BZ bzip compressed data
#>2 byte x \b, version: %c
#>3 string =1 \b, compression block size 100k
#>3 string =2 \b, compression block size 200k
#>3 string =3 \b, compression block size 300k
#>3 string =4 \b, compression block size 400k
#>3 string =5 \b, compression block size 500k
#>3 string =6 \b, compression block size 600k
#>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
# 4.3BSD-Quasijarus Strong Compression
# http://minnie.tuhs.org/Quasijarus/compress.html
0 string \037\241 Quasijarus strong compressed data
# From: Cory Dikkers <cdikkers@swbell.net>
0 string XPKF Amiga xpkf.library compressed data
0 string PP11 Power Packer 1.1 compressed data
0 string PP20 Power Packer 2.0 compressed data,
>4 belong 0x09090909 fast compression
>4 belong 0x090A0A0A mediocre compression
>4 belong 0x090A0B0B good compression
>4 belong 0x090A0C0C very good compression
>4 belong 0x090A0C0D best compression
# 7-zip archiver, from Thomas Klausner (wiz@danbala.tuwien.ac.at)
# http://www.7-zip.org or DOC/7zFormat.txt
#
0 string 7z\274\257\047\034 7-zip archive data,
>6 byte x version %d
>7 byte x \b.%d
# Type: LZMA
# URL: http://www.7-zip.org/sdk.html
# From: Robert Millan <rmh@aybabtu.com> and Reuben Thomas <rrt@sc3d.org>
# Commented out because apparently not reliable (according to Debian
# bug #364260)
#0 string ]\000\000\200\000 LZMA compressed data
# http://tukaani.org/xz/xz-file-format.txt
0 ustring \xFD7zXZ\x00 xz compressed data
!:mime application/x-xz
# AFX compressed files (Wolfram Kleff)
2 string -afx- AFX compressed file data
# Supplementary magic data for the file(1) command to support
# rzip(1). The format is described in magic(5).
#
# Copyright (C) 2003 by Andrew Tridgell. You may do whatever you want with
# this file.
#
0 string RZIP rzip compressed data
>4 byte x - version %d
>5 byte x \b.%d
>6 belong x (%d bytes)
# Type: XZ
# URL: http://tukaani.org/xz/
0 string \xfd\x37\x7a\x58\x5a\x00 XZ compressed data
!:mime application/x-xz

View file

@ -0,0 +1,254 @@
#------------------------------------------------------------------------------
# Console game magic
# Toby Deshane <hac@shoelace.digivill.net>
# ines: file(1) magic for Marat's iNES Nintendo Entertainment System
# ROM dump format
0 string NES\032 iNES ROM dump,
>4 byte x %dx16k PRG
>5 byte x \b, %dx8k CHR
>6 byte&0x01 =0x1 \b, [Vert.]
>6 byte&0x01 =0x0 \b, [Horiz.]
>6 byte&0x02 =0x2 \b, [SRAM]
>6 byte&0x04 =0x4 \b, [Trainer]
>6 byte&0x04 =0x8 \b, [4-Scr]
#------------------------------------------------------------------------------
# gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format
#
0x104 belong 0xCEED6666 Gameboy ROM:
>0x134 string >\0 "%.16s"
>0x146 byte 0x03 \b,[SGB]
>0x147 byte 0x00 \b, [ROM ONLY]
>0x147 byte 0x01 \b, [ROM+MBC1]
>0x147 byte 0x02 \b, [ROM+MBC1+RAM]
>0x147 byte 0x03 \b, [ROM+MBC1+RAM+BATT]
>0x147 byte 0x05 \b, [ROM+MBC2]
>0x147 byte 0x06 \b, [ROM+MBC2+BATTERY]
>0x147 byte 0x08 \b, [ROM+RAM]
>0x147 byte 0x09 \b, [ROM+RAM+BATTERY]
>0x147 byte 0x0B \b, [ROM+MMM01]
>0x147 byte 0x0C \b, [ROM+MMM01+SRAM]
>0x147 byte 0x0D \b, [ROM+MMM01+SRAM+BATT]
>0x147 byte 0x0F \b, [ROM+MBC3+TIMER+BATT]
>0x147 byte 0x10 \b, [ROM+MBC3+TIMER+RAM+BATT]
>0x147 byte 0x11 \b, [ROM+MBC3]
>0x147 byte 0x12 \b, [ROM+MBC3+RAM]
>0x147 byte 0x13 \b, [ROM+MBC3+RAM+BATT]
>0x147 byte 0x19 \b, [ROM+MBC5]
>0x147 byte 0x1A \b, [ROM+MBC5+RAM]
>0x147 byte 0x1B \b, [ROM+MBC5+RAM+BATT]
>0x147 byte 0x1C \b, [ROM+MBC5+RUMBLE]
>0x147 byte 0x1D \b, [ROM+MBC5+RUMBLE+SRAM]
>0x147 byte 0x1E \b, [ROM+MBC5+RUMBLE+SRAM+BATT]
>0x147 byte 0x1F \b, [Pocket Camera]
>0x147 byte 0xFD \b, [Bandai TAMA5]
>0x147 byte 0xFE \b, [Hudson HuC-3]
>0x147 byte 0xFF \b, [Hudson HuC-1]
>0x148 byte 0 \b, ROM: 256Kbit
>0x148 byte 1 \b, ROM: 512Kbit
>0x148 byte 2 \b, ROM: 1Mbit
>0x148 byte 3 \b, ROM: 2Mbit
>0x148 byte 4 \b, ROM: 4Mbit
>0x148 byte 5 \b, ROM: 8Mbit
>0x148 byte 6 \b, ROM: 16Mbit
>0x148 byte 0x52 \b, ROM: 9Mbit
>0x148 byte 0x53 \b, ROM: 10Mbit
>0x148 byte 0x54 \b, ROM: 12Mbit
>0x149 byte 1 \b, RAM: 16Kbit
>0x149 byte 2 \b, RAM: 64Kbit
>0x149 byte 3 \b, RAM: 128Kbit
>0x149 byte 4 \b, RAM: 1Mbit
#>0x14e long x \b, CRC: %x
#------------------------------------------------------------------------------
# genesis: file(1) magic for the Sega MegaDrive/Genesis raw ROM format
#
0x100 string SEGA Sega MegaDrive/Genesis raw ROM dump
>0x120 string >\0 Name: "%.16s"
>0x110 string >\0 %.16s
>0x1B0 string RA with SRAM
#------------------------------------------------------------------------------
# genesis: file(1) magic for the Super MegaDrive ROM dump format
#
0x280 string EAGN Super MagicDrive ROM dump
>0 byte x %dx16k blocks
>2 byte 0 \b, last in series or standalone
>2 byte >0 \b, split ROM
>8 byte 0xAA
>9 byte 0xBB
#------------------------------------------------------------------------------
# genesis: file(1) alternate magic for the Super MegaDrive ROM dump format
#
0x280 string EAMG Super MagicDrive ROM dump
>0 byte x %dx16k blocks
>2 byte x \b, last in series or standalone
>8 byte 0xAA
>9 byte 0xBB
#------------------------------------------------------------------------------
# smsgg: file(1) magic for Sega Master System and Game Gear ROM dumps
#
# Does not detect all images. Very preliminary guesswork. Need more data
# on format.
#
# FIXME: need a little more info...;P
#
#0 byte 0xF3
#>1 byte 0xED Sega Master System/Game Gear ROM dump
#>1 byte 0x31 Sega Master System/Game Gear ROM dump
#>1 byte 0xDB Sega Master System/Game Gear ROM dump
#>1 byte 0xAF Sega Master System/Game Gear ROM dump
#>1 byte 0xC3 Sega Master System/Game Gear ROM dump
#------------------------------------------------------------------------------
# dreamcast: file(1) uncertain magic for the Sega Dreamcast VMU image format
#
0 belong 0x21068028 Sega Dreamcast VMU game image
0 string LCDi Dream Animator file
#------------------------------------------------------------------------------
# v64: file(1) uncertain magic for the V64 format N64 ROM dumps
#
0 belong 0x37804012 V64 Nintendo 64 ROM dump
# From: "Nelson A. de Oliveira" <naoliv@gmail.com>
# Nintendo .nds
192 string \044\377\256Qi\232 Nintendo DS Game ROM Image
# Nintendo .gba
0 string \056\000\000\352$\377\256Qi Nintendo Game Boy Advance ROM Image
#------------------------------------------------------------------------------
# msx: file(1) magic for MSX game cartridge dumps
# Too simple - MPi
#0 beshort 0x4142 MSX game cartridge dump
#------------------------------------------------------------------------------
# Sony Playstation executables (Adam Sjoegren <asjo@diku.dk>) :
0 string PS-X\ EXE Sony Playstation executable
# Area:
>113 string x (%s)
#------------------------------------------------------------------------------
# Microsoft Xbox executables .xbe (Esa Hyytiä <ehyytia@cc.hut.fi>)
0 string XBEH XBE, Microsoft Xbox executable
# probabilistic checks whether signed or not
>0x0004 ulelong =0x0
>>&2 ulelong =0x0
>>>&2 ulelong =0x0 \b, not signed
>0x0004 ulelong >0
>>&2 ulelong >0
>>>&2 ulelong >0 \b, signed
# expect base address of 0x10000
>0x0104 ulelong =0x10000
>>(0x0118-0x0FF60) ulelong&0x80000007 0x80000007 \b, all regions
>>(0x0118-0x0FF60) ulelong&0x80000007 !0x80000007
>>>(0x0118-0x0FF60) ulelong >0 (regions:
>>>>(0x0118-0x0FF60) ulelong &0x00000001 NA
>>>>(0x0118-0x0FF60) ulelong &0x00000002 Japan
>>>>(0x0118-0x0FF60) ulelong &0x00000004 Rest_of_World
>>>>(0x0118-0x0FF60) ulelong &0x80000000 Manufacturer
>>>(0x0118-0x0FF60) ulelong >0 \b)
# --------------------------------
# Microsoft Xbox data file formats
0 string XIP0 XIP, Microsoft Xbox data
0 string XTF0 XTF, Microsoft Xbox data
# Atari Lynx cartridge dump (EXE/BLL header)
# From: "Stefan A. Haubenthal" <polluks@web.de>
0 beshort 0x8008 Lynx cartridge,
>2 beshort x RAM start $%04x
>6 string BS93
# Opera file system that is used on the 3DO console
# From: Serge van den Boom <svdb@stack.nl>
0 string \x01ZZZZZ\x01 3DO "Opera" file system
# From Gürkan Sengün <gurkan@linuks.mine.nu>, www.linuks.mine.nu
0 string GBS Nintendo Gameboy Music/Audio Data
12 string GameBoy\ Music\ Module Nintendo Gameboy Music Module
# Playstations Patch Files from: From: Thomas Klausner <tk@giga.or.at>
0 string PPF30 Playstation Patch File version 3.0
>5 byte 0 \b, PPF 1.0 patch
>5 byte 1 \b, PPF 2.0 patch
>5 byte 2 \b, PPF 3.0 patch
>>56 byte 0 \b, Imagetype BIN (any)
>>56 byte 1 \b, Imagetype GI (PrimoDVD)
>>57 byte 0 \b, Blockcheck disabled
>>57 byte 1 \b, Blockcheck enabled
>>58 byte 0 \b, Undo data not available
>>58 byte 1 \b, Undo data available
>6 string x \b, description: %s
0 string PPF20 Playstation Patch File version 2.0
>5 byte 0 \b, PPF 1.0 patch
>5 byte 1 \b, PPF 2.0 patch
>>56 lelong >0 \b, size of file to patch %d
>6 string x \b, description: %s
0 string PPF10 Playstation Patch File version 1.0
>5 byte 0 \b, Simple Encoding
>6 string x \b, description: %s
# From: Daniel Dawson <ddawson@icehouse.net>
# SNES9x .smv "movie" file format.
0 string SMV\x1A SNES9x input recording
>0x4 lelong x \b, version %d
# version 4 is latest so far
>0x4 lelong <5
>>0x8 ledate x \b, recorded at %s
>>0xc lelong >0 \b, rerecorded %d times
>>0x10 lelong x \b, %d frames long
>>0x14 byte >0 \b, data for controller(s):
>>>0x14 byte &0x1 #1
>>>0x14 byte &0x2 #2
>>>0x14 byte &0x4 #3
>>>0x14 byte &0x8 #4
>>>0x14 byte &0x10 #5
>>0x15 byte ^0x1 \b, begins from snapshot
>>0x15 byte &0x1 \b, begins from reset
>>0x15 byte ^0x2 \b, NTSC standard
>>0x15 byte &0x2 \b, PAL standard
>>0x17 byte &0x1 \b, settings:
# WIP1Timing not used as of version 4
>>>0x4 lelong <4
>>>>0x17 byte &0x2 WIP1Timing
>>>0x17 byte &0x4 Left+Right
>>>0x17 byte &0x8 VolumeEnvX
>>>0x17 byte &0x10 FakeMute
>>>0x17 byte &0x20 SyncSound
# New flag as of version 4
>>>0x4 lelong >3
>>>>0x17 byte &0x80 NoCPUShutdown
>>0x4 lelong <4
>>>0x18 lelong >0x23
>>>>0x20 leshort !0
>>>>>0x20 lestring16 x \b, metadata: "%s"
>>0x4 lelong >3
>>>0x24 byte >0 \b, port 1:
>>>>0x24 byte 1 joypad
>>>>0x24 byte 2 mouse
>>>>0x24 byte 3 SuperScope
>>>>0x24 byte 4 Justifier
>>>>0x24 byte 5 multitap
>>>0x24 byte >0 \b, port 2:
>>>>0x25 byte 1 joypad
>>>>0x25 byte 2 mouse
>>>>0x25 byte 3 SuperScope
>>>>0x25 byte 4 Justifier
>>>>0x25 byte 5 multitap
>>>0x18 lelong >0x43
>>>>0x40 leshort !0
>>>>>0x40 lestring16 x \b, metadata: "%s"
>>0x17 byte &0x40 \b, ROM:
>>>(0x18.l-26) lelong x CRC32 0x%08x
>>>(0x18.l-23) string x "%s"

View file

@ -0,0 +1,69 @@
#------------------------------------------------------------------------------
# convex: file(1) magic for Convex boxes
#
# Convexes are big-endian.
#
# /*\
# * Below are the magic numbers and tests added for Convex.
# * Added at beginning, because they are expected to be used most.
# \*/
0 belong 0507 Convex old-style object
>16 belong >0 not stripped
0 belong 0513 Convex old-style demand paged executable
>16 belong >0 not stripped
0 belong 0515 Convex old-style pre-paged executable
>16 belong >0 not stripped
0 belong 0517 Convex old-style pre-paged, non-swapped executable
>16 belong >0 not stripped
0 belong 0x011257 Core file
#
# The following are a series of dump format magic numbers. Each one
# corresponds to a drastically different dump format. The first on is
# the original dump format on a 4.1 BSD or earlier file system. The
# second marks the change between the 4.1 file system and the 4.2 file
# system. The Third marks the changing of the block size from 1K
# to 2K to be compatible with an IDC file system. The fourth indicates
# a dump that is dependent on Convex Storage Manager, because data in
# secondary storage is not physically contained within the dump.
# The restore program uses these number to determine how the data is
# to be extracted.
#
24 belong =60011 dump format, 4.1 BSD or earlier
24 belong =60012 dump format, 4.2 or 4.3 BSD without IDC
24 belong =60013 dump format, 4.2 or 4.3 BSD (IDC compatible)
24 belong =60014 dump format, Convex Storage Manager by-reference dump
#
# what follows is a bunch of bit-mask checks on the flags field of the opthdr.
# If there is no `=' sign, assume just checking for whether the bit is set?
#
0 belong 0601 Convex SOFF
>88 belong&0x000f0000 =0x00000000 c1
>88 belong &0x00010000 c2
>88 belong &0x00020000 c2mp
>88 belong &0x00040000 parallel
>88 belong &0x00080000 intrinsic
>88 belong &0x00000001 demand paged
>88 belong &0x00000002 pre-paged
>88 belong &0x00000004 non-swapped
>88 belong &0x00000008 POSIX
#
>84 belong &0x80000000 executable
>84 belong &0x40000000 object
>84 belong&0x20000000 =0 not stripped
>84 belong&0x18000000 =0x00000000 native fpmode
>84 belong&0x18000000 =0x10000000 ieee fpmode
>84 belong&0x18000000 =0x18000000 undefined fpmode
#
0 belong 0605 Convex SOFF core
#
0 belong 0607 Convex SOFF checkpoint
>88 belong&0x000f0000 =0x00000000 c1
>88 belong &0x00010000 c2
>88 belong &0x00020000 c2mp
>88 belong &0x00040000 parallel
>88 belong &0x00080000 intrinsic
>88 belong &0x00000008 POSIX
#
>84 belong&0x18000000 =0x00000000 native fpmode
>84 belong&0x18000000 =0x10000000 ieee fpmode
>84 belong&0x18000000 =0x18000000 undefined fpmode

View file

@ -0,0 +1,13 @@
#------------------------------------------------------------------------------
# cracklib: file (1) magic for cracklib v2.7
0 lelong 0x70775631 Cracklib password index, little endian
>4 long >0 (%i words)
>4 long 0 ("64-bit")
>>8 long >-1 (%i words)
0 belong 0x70775631 Cracklib password index, big endian
>4 belong >-1 (%i words)
# really bellong 0x0000000070775631
0 search/1 \0\0\0\0pwV1 Cracklib password index, big endian ("64-bit")
>12 belong >0 (%i words)

View file

@ -0,0 +1,4 @@
# ----------------------------------------------------------------------------
# ctags: file (1) magic for Exuberant Ctags files
# From: Alexander Mai <mai@migdal.ikp.physik.tu-darmstadt.de>
0 search/1 =!_TAG Exuberant Ctags tag file text

View file

@ -0,0 +1,10 @@
#------------------------------------------------------------------------------
# dact: file(1) magic for DACT compressed files
#
0 long 0x444354C3 DACT compressed data
>4 byte >-1 (version %i.
>5 byte >-1 $BS%i.
>6 byte >-1 $BS%i)
>7 long >0 $BS, original size: %i bytes
>15 long >30 $BS, block size: %i bytes

View file

@ -0,0 +1,269 @@
#------------------------------------------------------------------------------
# database: file(1) magic for various databases
#
# extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
#
#
# GDBM magic numbers
# Will be maintained as part of the GDBM distribution in the future.
# <downsj@teeny.org>
0 belong 0x13579ace GNU dbm 1.x or ndbm database, big endian
!:mime application/x-gdbm
0 lelong 0x13579ace GNU dbm 1.x or ndbm database, little endian
!:mime application/x-gdbm
0 string GDBM GNU dbm 2.x database
!:mime application/x-gdbm
#
# Berkeley DB
#
# Ian Darwin's file /etc/magic files: big/little-endian version.
#
# Hash 1.85/1.86 databases store metadata in network byte order.
# Btree 1.85/1.86 databases store the metadata in host byte order.
# Hash and Btree 2.X and later databases store the metadata in host byte order.
0 long 0x00061561 Berkeley DB
!:mime application/x-dbm
>8 belong 4321
>>4 belong >2 1.86
>>4 belong <3 1.85
>>4 belong >0 (Hash, version %d, native byte-order)
>8 belong 1234
>>4 belong >2 1.86
>>4 belong <3 1.85
>>4 belong >0 (Hash, version %d, little-endian)
0 belong 0x00061561 Berkeley DB
>8 belong 4321
>>4 belong >2 1.86
>>4 belong <3 1.85
>>4 belong >0 (Hash, version %d, big-endian)
>8 belong 1234
>>4 belong >2 1.86
>>4 belong <3 1.85
>>4 belong >0 (Hash, version %d, native byte-order)
0 long 0x00053162 Berkeley DB 1.85/1.86
>4 long >0 (Btree, version %d, native byte-order)
0 belong 0x00053162 Berkeley DB 1.85/1.86
>4 belong >0 (Btree, version %d, big-endian)
0 lelong 0x00053162 Berkeley DB 1.85/1.86
>4 lelong >0 (Btree, version %d, little-endian)
12 long 0x00061561 Berkeley DB
>16 long >0 (Hash, version %d, native byte-order)
12 belong 0x00061561 Berkeley DB
>16 belong >0 (Hash, version %d, big-endian)
12 lelong 0x00061561 Berkeley DB
>16 lelong >0 (Hash, version %d, little-endian)
12 long 0x00053162 Berkeley DB
>16 long >0 (Btree, version %d, native byte-order)
12 belong 0x00053162 Berkeley DB
>16 belong >0 (Btree, version %d, big-endian)
12 lelong 0x00053162 Berkeley DB
>16 lelong >0 (Btree, version %d, little-endian)
12 long 0x00042253 Berkeley DB
>16 long >0 (Queue, version %d, native byte-order)
12 belong 0x00042253 Berkeley DB
>16 belong >0 (Queue, version %d, big-endian)
12 lelong 0x00042253 Berkeley DB
>16 lelong >0 (Queue, version %d, little-endian)
# From Max Bowsher.
12 long 0x00040988 Berkeley DB
>16 long >0 (Log, version %d, native byte-order)
12 belong 0x00040988 Berkeley DB
>16 belong >0 (Log, version %d, big-endian)
12 lelong 0x00040988 Berkeley DB
>16 lelong >0 (Log, version %d, little-endian)
#
#
# Round Robin Database Tool by Tobias Oetiker <oetiker@ee.ethz.ch>
0 string RRD RRDTool DB
>4 string x version %s
#----------------------------------------------------------------------
# ROOT: file(1) magic for ROOT databases
#
0 string root\0 ROOT file
>4 belong x Version %d
>33 belong x (Compression: %d)
# XXX: Weak magic.
# Alex Ott <ott@jet.msk.su>
## Paradox file formats
#2 leshort 0x0800 Paradox
#>0x39 byte 3 v. 3.0
#>0x39 byte 4 v. 3.5
#>0x39 byte 9 v. 4.x
#>0x39 byte 10 v. 5.x
#>0x39 byte 11 v. 5.x
#>0x39 byte 12 v. 7.x
#>>0x04 byte 0 indexed .DB data file
#>>0x04 byte 1 primary index .PX file
#>>0x04 byte 2 non-indexed .DB data file
#>>0x04 byte 3 non-incrementing secondary index .Xnn file
#>>0x04 byte 4 secondary index .Ynn file
#>>0x04 byte 5 incrementing secondary index .Xnn file
#>>0x04 byte 6 non-incrementing secondary index .XGn file
#>>0x04 byte 7 secondary index .YGn file
#>>>0x04 byte 8 incrementing secondary index .XGn file
## XBase database files
#0 byte 0x02
#>8 leshort >0
#>>12 leshort 0 FoxBase
#!:mime application/x-dbf
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0x03
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 FoxBase+, FoxPro, dBaseIII+, dBaseIV, no memo
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0x04
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 dBASE IV no memo file
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0x05
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 dBASE V no memo file
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0x30
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 Visual FoxPro
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0x43
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 FlagShip with memo var size
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0x7b
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 dBASEIV with memo
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0x83
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 FoxBase+, dBaseIII+ with memo
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0x8b
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 dBaseIV with memo
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0x8e
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 dBaseIV with SQL Table
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0xb3
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 FlagShip with .dbt memo
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0xf5
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 FoxPro with memo
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 leshort 0x0006 DBase 3 index file
# MS Access database
4 string Standard\ Jet\ DB Microsoft Access Database
!:mime application/x-msaccess
# TDB database from Samba et al - Martin Pool <mbp@samba.org>
0 string TDB\ file TDB database
>32 lelong 0x2601196D version 6, little-endian
>>36 lelong x hash size %d bytes
# SE Linux policy database
0 lelong 0xf97cff8c SE Linux policy
>16 lelong x v%d
>20 lelong 1 MLS
>24 lelong x %d symbols
>28 lelong x %d ocons
# ICE authority file data (Wolfram Kleff)
2 string ICE ICE authority data
# X11 Xauthority file (Wolfram Kleff)
10 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
11 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
12 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
13 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
14 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
15 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
16 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
17 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
18 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
# From: Maxime Henrion <mux@FreeBSD.org>
# PostgreSQL's custom dump format, Maxime Henrion <mux@FreeBSD.org>
0 string PGDMP PostgreSQL custom database dump
>5 byte x - v%d
>6 byte x \b.%d
>5 beshort <0x101 \b-0
>5 beshort >0x100
>>7 byte x \b-%d
# Type: Advanced Data Format (ADF) database
# URL: http://www.grc.nasa.gov/WWW/cgns/adf/
# From: Nicolas Chauvat <nicolas.chauvat@logilab.fr>
0 string @(#)ADF\ Database CGNS Advanced Data Format
# Tokyo Cabinet magic data
# http://tokyocabinet.sourceforge.net/index.html
0 string ToKyO\ CaBiNeT\n Tokyo Cabinet
>14 string x \b (%s)
>32 byte 0 \b, Hash
!:mime application/x-tokyocabinet-hash
>32 byte 1 \b, B+ tree
!:mime application/x-tokyocabinet-btree
>32 byte 2 \b, Fixed-length
!:mime application/x-tokyocabinet-fixed
>32 byte 3 \b, Table
!:mime application/x-tokyocabinet-table
>33 byte &1 \b, [open]
>33 byte &2 \b, [fatal]
>34 byte x \b, apow=%d
>35 byte x \b, fpow=%d
>36 byte &0x01 \b, [large]
>36 byte &0x02 \b, [deflate]
>36 byte &0x04 \b, [bzip]
>36 byte &0x08 \b, [tcbs]
>36 byte &0x10 \b, [excodec]
>40 lequad x \b, bnum=%lld
>48 lequad x \b, rnum=%lld
>56 lequad x \b, fsiz=%lld

View file

@ -0,0 +1,11 @@
#------------------------------------------------------------------------------
# diamond: file(1) magic for Diamond system
#
# ... diamond is a multi-media mail and electronic conferencing system....
#
# XXX - I think it was either renamed Slate, or replaced by Slate....
#
# The full deal is too long...
#0 string <list>\n<protocol\ bbn-multimedia-format> Diamond Multimedia Document
0 string =<list>\n<protocol\ bbn-m Diamond Multimedia Document

View file

@ -0,0 +1,19 @@
#------------------------------------------------------------------------------
# diff: file(1) magic for diff(1) output
#
0 search/1 diff\ diff output text
!:mime text/x-diff
0 search/1 ***\ diff output text
!:mime text/x-diff
0 search/1 Only\ in\ diff output text
!:mime text/x-diff
0 search/1 Common\ subdirectories:\ diff output text
!:mime text/x-diff
0 search/1 Index: RCS/CVS diff output text
!:mime text/x-diff
#
#------------------------------------------------------------------------------
# bsdiff: file(1) magic for bsdiff(1) output
#
0 string BSDIFF40 bsdiff(1) patch file

View file

@ -0,0 +1,41 @@
# Digital UNIX - Info
#
0 string =!<arch>\n________64E Alpha archive
>22 string X -- out of date
#
# Alpha COFF Based Executables
# The stripped stuff really needs to be an 8 byte (64 bit) compare,
# but this works
0 leshort 0x183 COFF format alpha
>22 leshort&020000 &010000 sharable library,
>22 leshort&020000 ^010000 dynamically linked,
>24 leshort 0410 pure
>24 leshort 0413 demand paged
>8 lelong >0 executable or object module, not stripped
>8 lelong 0
>>12 lelong 0 executable or object module, stripped
>>12 lelong >0 executable or object module, not stripped
>27 byte >0 - version %d.
>26 byte >0 %d-
>28 leshort >0 %d
#
# The next is incomplete, we could tell more about this format,
# but its not worth it.
0 leshort 0x188 Alpha compressed COFF
0 leshort 0x18f Alpha u-code object
#
#
# Some other interesting Digital formats,
0 string \377\377\177 ddis/ddif
0 string \377\377\174 ddis/dots archive
0 string \377\377\176 ddis/dtif table data
0 string \033c\033 LN03 output
0 long 04553207 X image
#
0 string =!<PDF>!\n profiling data file
#
# Locale data tables (MIPS and Alpha).
#
0 short 0x0501 locale data table
>6 short 0x24 for MIPS
>6 short 0x40 for Alpha

View file

@ -0,0 +1,57 @@
# ATSC A/53 aka AC-3 aka Dolby Digital <ashitaka@gmx.at>
# from http://www.atsc.org/standards/a_52a.pdf
# corrections, additions, etc. are always welcome!
#
# syncword
0 beshort 0x0b77 ATSC A/52 aka AC-3 aka Dolby Digital stream,
# fscod
>4 byte&0xc0 0x00 48 kHz,
>4 byte&0xc0 0x40 44.1 kHz,
>4 byte&0xc0 0x80 32 kHz,
# is this one used for 96 kHz?
>4 byte&0xc0 0xc0 reserved frequency,
#
>5 byte&7 = 0 \b, complete main (CM)
>5 byte&7 = 1 \b, music and effects (ME)
>5 byte&7 = 2 \b, visually impaired (VI)
>5 byte&7 = 3 \b, hearing impaired (HI)
>5 byte&7 = 4 \b, dialogue (D)
>5 byte&7 = 5 \b, commentary (C)
>5 byte&7 = 6 \b, emergency (E)
# acmod
>6 byte&0xe0 0x00 1+1 front,
>6 byte&0xe0 0x20 1 front/0 rear,
>6 byte&0xe0 0x40 2 front/0 rear,
>6 byte&0xe0 0x60 3 front/0 rear,
>6 byte&0xe0 0x80 2 front/1 rear,
>6 byte&0xe0 0xa0 3 front/1 rear,
>6 byte&0xe0 0xc0 2 front/2 rear,
>6 byte&0xe0 0xe0 3 front/2 rear,
# lfeon (these may be incorrect)
>7 byte&0x40 0x00 LFE off,
>7 byte&0x40 0x40 LFE on,
#
>4 byte&0x3e = 0x00 \b, 32 kbit/s
>4 byte&0x3e = 0x02 \b, 40 kbit/s
>4 byte&0x3e = 0x04 \b, 48 kbit/s
>4 byte&0x3e = 0x06 \b, 56 kbit/s
>4 byte&0x3e = 0x08 \b, 64 kbit/s
>4 byte&0x3e = 0x0a \b, 80 kbit/s
>4 byte&0x3e = 0x0c \b, 96 kbit/s
>4 byte&0x3e = 0x0e \b, 112 kbit/s
>4 byte&0x3e = 0x10 \b, 128 kbit/s
>4 byte&0x3e = 0x12 \b, 160 kbit/s
>4 byte&0x3e = 0x14 \b, 192 kbit/s
>4 byte&0x3e = 0x16 \b, 224 kbit/s
>4 byte&0x3e = 0x18 \b, 256 kbit/s
>4 byte&0x3e = 0x1a \b, 320 kbit/s
>4 byte&0x3e = 0x1c \b, 384 kbit/s
>4 byte&0x3e = 0x1e \b, 448 kbit/s
>4 byte&0x3e = 0x20 \b, 512 kbit/s
>4 byte&0x3e = 0x22 \b, 576 kbit/s
>4 byte&0x3e = 0x24 \b, 640 kbit/s
# dsurmod (these may be incorrect)
>6 beshort&0x0180 0x0000 Dolby Surround not indicated
>6 beshort&0x0180 0x0080 not Dolby Surround encoded
>6 beshort&0x0180 0x0100 Dolby Surround encoded
>6 beshort&0x0180 0x0180 reserved Dolby Surround mode

131
external/bsd/file/dist/magic/magdir/dump vendored Normal file
View file

@ -0,0 +1,131 @@
#------------------------------------------------------------------------------
# dump: file(1) magic for dump file format--for new and old dump filesystems
#
# We specify both byte orders in order to recognize byte-swapped dumps.
#
24 belong 60012 new-fs dump file (big endian),
>4 bedate x Previous dump %s,
>8 bedate x This dump %s,
>12 belong >0 Volume %ld,
>692 belong 0 Level zero, type:
>692 belong >0 Level %d, type:
>0 belong 1 tape header,
>0 belong 2 beginning of file record,
>0 belong 3 map of inodes on tape,
>0 belong 4 continuation of file record,
>0 belong 5 end of volume,
>0 belong 6 map of inodes deleted,
>0 belong 7 end of medium (for floppy),
>676 string >\0 Label %s,
>696 string >\0 Filesystem %s,
>760 string >\0 Device %s,
>824 string >\0 Host %s,
>888 belong >0 Flags %x
24 belong 60011 old-fs dump file (big endian),
#>4 bedate x Previous dump %s,
#>8 bedate x This dump %s,
>12 belong >0 Volume %ld,
>692 belong 0 Level zero, type:
>692 belong >0 Level %d, type:
>0 belong 1 tape header,
>0 belong 2 beginning of file record,
>0 belong 3 map of inodes on tape,
>0 belong 4 continuation of file record,
>0 belong 5 end of volume,
>0 belong 6 map of inodes deleted,
>0 belong 7 end of medium (for floppy),
>676 string >\0 Label %s,
>696 string >\0 Filesystem %s,
>760 string >\0 Device %s,
>824 string >\0 Host %s,
>888 belong >0 Flags %x
24 lelong 60012 new-fs dump file (little endian),
>4 ledate x This dump %s,
>8 ledate x Previous dump %s,
>12 lelong >0 Volume %ld,
>692 lelong 0 Level zero, type:
>692 lelong >0 Level %d, type:
>0 lelong 1 tape header,
>0 lelong 2 beginning of file record,
>0 lelong 3 map of inodes on tape,
>0 lelong 4 continuation of file record,
>0 lelong 5 end of volume,
>0 lelong 6 map of inodes deleted,
>0 lelong 7 end of medium (for floppy),
>676 string >\0 Label %s,
>696 string >\0 Filesystem %s,
>760 string >\0 Device %s,
>824 string >\0 Host %s,
>888 lelong >0 Flags %x
24 lelong 60011 old-fs dump file (little endian),
#>4 ledate x Previous dump %s,
#>8 ledate x This dump %s,
>12 lelong >0 Volume %ld,
>692 lelong 0 Level zero, type:
>692 lelong >0 Level %d, type:
>0 lelong 1 tape header,
>0 lelong 2 beginning of file record,
>0 lelong 3 map of inodes on tape,
>0 lelong 4 continuation of file record,
>0 lelong 5 end of volume,
>0 lelong 6 map of inodes deleted,
>0 lelong 7 end of medium (for floppy),
>676 string >\0 Label %s,
>696 string >\0 Filesystem %s,
>760 string >\0 Device %s,
>824 string >\0 Host %s,
>888 lelong >0 Flags %x
18 leshort 60011 old-fs dump file (16-bit, assuming PDP-11 endianness),
>2 medate x Previous dump %s,
>6 medate x This dump %s,
>10 leshort >0 Volume %ld,
>0 leshort 1 tape header.
>0 leshort 2 beginning of file record.
>0 leshort 3 map of inodes on tape.
>0 leshort 4 continuation of file record.
>0 leshort 5 end of volume.
>0 leshort 6 map of inodes deleted.
>0 leshort 7 end of medium (for floppy).
24 belong 0x19540119 new-fs dump file (ufs2, big endian),
>896 beqdate x Previous dump %s,
>904 beqdate x This dump %s,
>12 belong >0 Volume %ld,
>692 belong 0 Level zero, type:
>692 belong >0 Level %d, type:
>0 belong 1 tape header,
>0 belong 2 beginning of file record,
>0 belong 3 map of inodes on tape,
>0 belong 4 continuation of file record,
>0 belong 5 end of volume,
>0 belong 6 map of inodes deleted,
>0 belong 7 end of medium (for floppy),
>676 string >\0 Label %s,
>696 string >\0 Filesystem %s,
>760 string >\0 Device %s,
>824 string >\0 Host %s,
>888 belong >0 Flags %x
24 lelong 0x19540119 new-fs dump file (ufs2, little endian),
>896 leqdate x This dump %s,
>904 leqdate x Previous dump %s,
>12 lelong >0 Volume %ld,
>692 lelong 0 Level zero, type:
>692 lelong >0 Level %d, type:
>0 lelong 1 tape header,
>0 lelong 2 beginning of file record,
>0 lelong 3 map of inodes on tape,
>0 lelong 4 continuation of file record,
>0 lelong 5 end of volume,
>0 lelong 6 map of inodes deleted,
>0 lelong 7 end of medium (for floppy),
>676 string >\0 Label %s,
>696 string >\0 Filesystem %s,
>760 string >\0 Device %s,
>824 string >\0 Host %s,
>888 lelong >0 Flags %x

View file

@ -0,0 +1,12 @@
#------------------------------------------------------------------------------
# Dyadic: file(1) magic for Dyalog APL.
#
0 byte 0xaa
>1 byte <4 Dyalog APL
>>1 byte 0x00 incomplete workspace
>>1 byte 0x01 component file
>>1 byte 0x02 external variable
>>1 byte 0x03 workspace
>>2 byte x version %d
>>3 byte x .%d

View file

@ -0,0 +1,17 @@
#------------------------------------------------------------------------------
# T602 editor documents
# by David Necas <yeti@physics.muni.cz>
0 string @CT\ T602 document data,
>4 string 0 Kamenicky
>4 string 1 CP 852
>4 string 2 KOI8-CS
>4 string >2 unknown encoding
# Vi IMproved Encrypted file
# by David Necas <yeti@physics.muni.cz>
0 string VimCrypt~ Vim encrypted file data
# Vi IMproved Swap file
# by Sven Wegener <swegener@gentoo.org>
0 string b0VIM\ Vim swap file
>&0 string >\0 \b, version %s

14
external/bsd/file/dist/magic/magdir/efi vendored Normal file
View file

@ -0,0 +1,14 @@
#------------------------------------------------------------------------------
# efi: file(1) magic for Universal EFI binaries
0 lelong 0x0ef1fab9
>4 lelong 1 Universal EFI binary with 1 architecture
>>&0 lelong 7 \b, i386
>>&0 lelong 0x01000007 \b, x86_64
>4 lelong 2 Universal EFI binary with 2 architectures
>>&0 lelong 7 \b, i386
>>&0 lelong 0x01000007 \b, x86_64
>>&20 lelong 7 \b, i386
>>&20 lelong 0x01000007 \b, x86_64
>4 lelong >2 Universal EFI binary with %ld architectures

288
external/bsd/file/dist/magic/magdir/elf vendored Normal file
View file

@ -0,0 +1,288 @@
#------------------------------------------------------------------------------
# elf: file(1) magic for ELF executables
#
# We have to check the byte order flag to see what byte order all the
# other stuff in the header is in.
#
# What're the correct byte orders for the nCUBE and the Fujitsu VPP500?
#
# Created by: unknown
# Modified by (1): Daniel Quinlan <quinlan@yggdrasil.com>
# Modified by (2): Peter Tobias <tobias@server.et-inf.fho-emden.de> (core support)
# Modified by (3): Christian 'Dr. Disk' Hechelmann <drdisk@ds9.au.s.shuttle.de> (fix of core support)
# Modified by (4): <gerardo.cacciari@gmail.com> (VMS Itanium)
# Modified by (5): Matthias Urlichs <smurf@debian.org> (Listing of many architectures)
0 string \177ELF ELF
>4 byte 0 invalid class
>4 byte 1 32-bit
>4 byte 2 64-bit
>5 byte 0 invalid byte order
>5 byte 1 LSB
>>16 leshort 0 no file type,
!:strength *2
!:mime application/octet-stream
>>16 leshort 1 relocatable,
!:mime application/x-object
>>16 leshort 2 executable,
!:mime application/x-executable
>>16 leshort 3 shared object,
!:mime application/x-sharedlib
>>16 leshort 4 core file
!:mime application/x-coredump
# Core file detection is not reliable.
#>>>(0x38+0xcc) string >\0 of '%s'
#>>>(0x38+0x10) lelong >0 (signal %d),
>>16 leshort &0xff00 processor-specific,
>>18 leshort 0 no machine,
>>18 leshort 1 AT&T WE32100 - invalid byte order,
>>18 leshort 2 SPARC - invalid byte order,
>>18 leshort 3 Intel 80386,
>>18 leshort 4 Motorola
>>>36 lelong &0x01000000 68000 - invalid byte order,
>>>36 lelong &0x00810000 CPU32 - invalid byte order,
>>>36 lelong 0 68020 - invalid byte order,
>>18 leshort 5 Motorola 88000 - invalid byte order,
>>18 leshort 6 Intel 80486,
>>18 leshort 7 Intel 80860,
# The official e_machine number for MIPS is now #8, regardless of endianness.
# The second number (#10) will be deprecated later. For now, we still
# say something if #10 is encountered, but only gory details for #8.
>>18 leshort 8 MIPS,
>>>36 lelong &0x20 N32
>>18 leshort 10 MIPS,
>>>36 lelong &0x20 N32
>>18 leshort 8
# only for 32-bit
>>>4 byte 1
>>>>36 lelong&0xf0000000 0x00000000 MIPS-I
>>>>36 lelong&0xf0000000 0x10000000 MIPS-II
>>>>36 lelong&0xf0000000 0x20000000 MIPS-III
>>>>36 lelong&0xf0000000 0x30000000 MIPS-IV
>>>>36 lelong&0xf0000000 0x40000000 MIPS-V
>>>>36 lelong&0xf0000000 0x50000000 MIPS32
>>>>36 lelong&0xf0000000 0x60000000 MIPS64
>>>>36 lelong&0xf0000000 0x70000000 MIPS32 rel2
>>>>36 lelong&0xf0000000 0x80000000 MIPS64 rel2
# only for 64-bit
>>>4 byte 2
>>>>48 lelong&0xf0000000 0x00000000 MIPS-I
>>>>48 lelong&0xf0000000 0x10000000 MIPS-II
>>>>48 lelong&0xf0000000 0x20000000 MIPS-III
>>>>48 lelong&0xf0000000 0x30000000 MIPS-IV
>>>>48 lelong&0xf0000000 0x40000000 MIPS-V
>>>>48 lelong&0xf0000000 0x50000000 MIPS32
>>>>48 lelong&0xf0000000 0x60000000 MIPS64
>>>>48 lelong&0xf0000000 0x70000000 MIPS32 rel2
>>>>48 lelong&0xf0000000 0x80000000 MIPS64 rel2
>>18 leshort 9 Amdahl - invalid byte order,
>>18 leshort 10 MIPS (deprecated),
>>18 leshort 11 RS6000 - invalid byte order,
>>18 leshort 15 PA-RISC - invalid byte order,
>>>50 leshort 0x0214 2.0
>>>48 leshort &0x0008 (LP64),
>>18 leshort 16 nCUBE,
>>18 leshort 17 Fujitsu VPP500,
>>18 leshort 18 SPARC32PLUS - invalid byte order,
>>18 leshort 20 PowerPC,
>>18 leshort 22 IBM S/390,
>>18 leshort 36 NEC V800,
>>18 leshort 37 Fujitsu FR20,
>>18 leshort 38 TRW RH-32,
>>18 leshort 39 Motorola RCE,
>>18 leshort 40 ARM,
>>18 leshort 41 Alpha,
>>18 leshort 0xa390 IBM S/390 (obsolete),
>>18 leshort 42 Renesas SH,
>>18 leshort 43 SPARC V9 - invalid byte order,
>>18 leshort 44 Siemens Tricore Embedded Processor,
>>18 leshort 45 Argonaut RISC Core, Argonaut Technologies Inc.,
>>18 leshort 46 Renesas H8/300,
>>18 leshort 47 Renesas H8/300H,
>>18 leshort 48 Renesas H8S,
>>18 leshort 49 Renesas H8/500,
>>18 leshort 50 IA-64,
>>18 leshort 51 Stanford MIPS-X,
>>18 leshort 52 Motorola Coldfire,
>>18 leshort 53 Motorola M68HC12,
>>18 leshort 54 Fujitsu MMA,
>>18 leshort 55 Siemens PCP,
>>18 leshort 56 Sony nCPU,
>>18 leshort 57 Denso NDR1,
>>18 leshort 58 Start*Core,
>>18 leshort 59 Toyota ME16,
>>18 leshort 60 ST100,
>>18 leshort 61 Tinyj emb.,
>>18 leshort 62 x86-64,
>>18 leshort 63 Sony DSP,
>>18 leshort 66 FX66,
>>18 leshort 67 ST9+ 8/16 bit,
>>18 leshort 68 ST7 8 bit,
>>18 leshort 69 MC68HC16,
>>18 leshort 70 MC68HC11,
>>18 leshort 71 MC68HC08,
>>18 leshort 72 MC68HC05,
>>18 leshort 73 SGI SVx,
>>18 leshort 74 ST19 8 bit,
>>18 leshort 75 Digital VAX,
>>18 leshort 76 Axis cris,
>>18 leshort 77 Infineon 32-bit embedded,
>>18 leshort 78 Element 14 64-bit DSP,
>>18 leshort 79 LSI Logic 16-bit DSP,
>>18 leshort 80 MMIX,
>>18 leshort 81 Harvard machine-independent,
>>18 leshort 82 SiTera Prism,
>>18 leshort 83 Atmel AVR 8-bit,
>>18 leshort 84 Fujitsu FR30,
>>18 leshort 85 Mitsubishi D10V,
>>18 leshort 86 Mitsubishi D30V,
>>18 leshort 87 NEC v850,
>>18 leshort 88 Renesas M32R,
>>18 leshort 89 Matsushita MN10300,
>>18 leshort 90 Matsushita MN10200,
>>18 leshort 91 picoJava,
>>18 leshort 92 OpenRISC,
>>18 leshort 93 ARC Cores Tangent-A5,
>>18 leshort 94 Tensilica Xtensa,
>>18 leshort 97 NatSemi 32k,
>>18 leshort 106 Analog Devices Blackfin,
>>18 leshort 113 Altera Nios II,
>>18 leshort 0xae META,
>>18 leshort 0x3426 OpenRISC (obsolete),
>>18 leshort 0x8472 OpenRISC (obsolete),
>>18 leshort 0x9026 Alpha (unofficial),
>>20 lelong 0 invalid version
>>20 lelong 1 version 1
>>36 lelong 1 MathCoPro/FPU/MAU Required
>5 byte 2 MSB
>>16 beshort 0 no file type,
!:mime application/octet-stream
>>16 beshort 1 relocatable,
!:mime application/x-object
>>16 beshort 2 executable,
!:mime application/x-executable
>>16 beshort 3 shared object,
!:mime application/x-sharedlib
>>16 beshort 4 core file,
!:mime application/x-coredump
#>>>(0x38+0xcc) string >\0 of '%s'
#>>>(0x38+0x10) belong >0 (signal %d),
>>16 beshort &0xff00 processor-specific,
>>18 beshort 0 no machine,
>>18 beshort 1 AT&T WE32100,
>>18 beshort 2 SPARC,
>>18 beshort 3 Intel 80386 - invalid byte order,
>>18 beshort 4 Motorola
>>>36 belong &0x01000000 68000,
>>>36 belong &0x00810000 CPU32,
>>>36 belong 0 68020,
>>18 beshort 5 Motorola 88000,
>>18 beshort 6 Intel 80486 - invalid byte order,
>>18 beshort 7 Intel 80860,
# only for MIPS - see comment in little-endian section above.
>>18 beshort 8 MIPS,
>>>36 belong &0x20 N32
>>18 beshort 10 MIPS,
>>>36 belong &0x20 N32
>>18 beshort 8
# only for 32-bit
>>>4 byte 1
>>>>36 belong&0xf0000000 0x00000000 MIPS-I
>>>>36 belong&0xf0000000 0x10000000 MIPS-II
>>>>36 belong&0xf0000000 0x20000000 MIPS-III
>>>>36 belong&0xf0000000 0x30000000 MIPS-IV
>>>>36 belong&0xf0000000 0x40000000 MIPS-V
>>>>36 belong&0xf0000000 0x50000000 MIPS32
>>>>36 belong&0xf0000000 0x60000000 MIPS64
>>>>36 belong&0xf0000000 0x70000000 MIPS32 rel2
>>>>36 belong&0xf0000000 0x80000000 MIPS64 rel2
# only for 64-bit
>>>4 byte 2
>>>>48 belong&0xf0000000 0x00000000 MIPS-I
>>>>48 belong&0xf0000000 0x10000000 MIPS-II
>>>>48 belong&0xf0000000 0x20000000 MIPS-III
>>>>48 belong&0xf0000000 0x30000000 MIPS-IV
>>>>48 belong&0xf0000000 0x40000000 MIPS-V
>>>>48 belong&0xf0000000 0x50000000 MIPS32
>>>>48 belong&0xf0000000 0x60000000 MIPS64
>>>>48 belong&0xf0000000 0x70000000 MIPS32 rel2
>>>>48 belong&0xf0000000 0x80000000 MIPS64 rel2
>>18 beshort 9 Amdahl,
>>18 beshort 10 MIPS (deprecated),
>>18 beshort 11 RS6000,
>>18 beshort 15 PA-RISC
>>>50 beshort 0x0214 2.0
>>>48 beshort &0x0008 (LP64)
>>18 beshort 16 nCUBE,
>>18 beshort 17 Fujitsu VPP500,
>>18 beshort 18 SPARC32PLUS,
>>>36 belong&0xffff00 0x000100 V8+ Required,
>>>36 belong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required,
>>>36 belong&0xffff00 0x000400 HaL R1 Extensions Required,
>>>36 belong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required,
>>18 beshort 20 PowerPC or cisco 4500,
>>18 beshort 21 64-bit PowerPC or cisco 7500,
>>18 beshort 22 IBM S/390,
>>18 beshort 23 Cell SPU,
>>18 beshort 24 cisco SVIP,
>>18 beshort 25 cisco 7200,
>>18 beshort 36 NEC V800 or cisco 12000,
>>18 beshort 37 Fujitsu FR20,
>>18 beshort 38 TRW RH-32,
>>18 beshort 39 Motorola RCE,
>>18 beshort 40 ARM,
>>18 beshort 41 Alpha,
>>18 beshort 42 Renesas SH,
>>18 beshort 43 SPARC V9,
>>>48 belong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required,
>>>48 belong&0xffff00 0x000400 HaL R1 Extensions Required,
>>>48 belong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required,
>>>48 belong&0x3 0 total store ordering,
>>>48 belong&0x3 1 partial store ordering,
>>>48 belong&0x3 2 relaxed memory ordering,
>>18 beshort 44 Siemens Tricore Embedded Processor,
>>18 beshort 45 Argonaut RISC Core, Argonaut Technologies Inc.,
>>18 beshort 46 Renesas H8/300,
>>18 beshort 47 Renesas H8/300H,
>>18 beshort 48 Renesas H8S,
>>18 beshort 49 Renesas H8/500,
>>18 beshort 50 IA-64,
>>18 beshort 51 Stanford MIPS-X,
>>18 beshort 52 Motorola Coldfire,
>>18 beshort 53 Motorola M68HC12,
>>18 beshort 73 Cray NV1,
>>18 beshort 75 Digital VAX,
>>18 beshort 88 Renesas M32R,
>>18 leshort 92 OpenRISC,
>>18 leshort 0x3426 OpenRISC (obsolete),
>>18 leshort 0x8472 OpenRISC (obsolete),
>>18 beshort 94 Tensilica Xtensa,
>>18 beshort 97 NatSemi 32k,
>>18 beshort 0x18ad AVR32 (unofficial),
>>18 beshort 0x9026 Alpha (unofficial),
>>18 beshort 0xa390 IBM S/390 (obsolete),
>>20 belong 0 invalid version
>>20 belong 1 version 1
>>36 belong 1 MathCoPro/FPU/MAU Required
# Up to now only 0, 1 and 2 are defined; I've seen a file with 0x83, it seemed
# like proper ELF, but extracting the string had bad results.
>4 byte <0x80
>>8 string >\0 (%s)
>8 string \0
>>7 byte 0 (SYSV)
>>7 byte 1 (HP-UX)
>>7 byte 2 (NetBSD)
>>7 byte 3 (GNU/Linux)
>>7 byte 4 (GNU/Hurd)
>>7 byte 5 (86Open)
>>7 byte 6 (Solaris)
>>7 byte 7 (Monterey)
>>7 byte 8 (IRIX)
>>7 byte 9 (FreeBSD)
>>7 byte 10 (Tru64)
>>7 byte 11 (Novell Modesto)
>>7 byte 12 (OpenBSD)
>8 string \2
>>7 byte 13 (OpenVMS)
>>7 byte 97 (ARM)
>>7 byte 255 (embedded)

View file

@ -0,0 +1,21 @@
#------------------------------------------------------------------------------
# encore: file(1) magic for Encore machines
#
# XXX - needs to have the byte order specified (NS32K was little-endian,
# dunno whether they run the 88K in little-endian mode or not).
#
0 short 0x154 Encore
>20 short 0x107 executable
>20 short 0x108 pure executable
>20 short 0x10b demand-paged executable
>20 short 0x10f unsupported executable
>12 long >0 not stripped
>22 short >0 - version %ld
>22 short 0 -
#>4 date x stamp %s
0 short 0x155 Encore unsupported executable
>12 long >0 not stripped
>22 short >0 - version %ld
>22 short 0 -
#>4 date x stamp %s

View file

@ -0,0 +1,11 @@
#------------------------------------------------------------------------------
# EPOC : file(1) magic for EPOC documents [Psion Series 5/Osaris/Geofox 1]
# Stefan Praszalowicz (hpicollo@worldnet.fr)
# Useful information for improving this file can be found at:
# http://software.frodo.looijaard.name/psiconv/formats/Index.html
0 lelong 0x10000037
>4 lelong 0x1000006D
>>8 lelong 0x1000007F Psion Word
>>8 lelong 0x10000088 Psion Sheet
>>8 lelong 0x1000007D Psion Sketch
>>8 lelong 0x10000085 Psion TextEd

View file

@ -0,0 +1,18 @@
#------------------------------------------------------------------------------
# erlang: file(1) magic for Erlang JAM and BEAM files
# URL: http://www.erlang.org/faq/x779.html#AEN812
# OTP R3-R4
0 string \0177BEAM! Old Erlang BEAM file
>6 short >0 - version %d
# OTP R5 and onwards
0 string FOR1
>8 string BEAM Erlang BEAM file
# 4.2 version may have a copyright notice!
4 string Tue\ Jan\ 22\ 14:32:44\ MET\ 1991 Erlang JAM file - version 4.2
79 string Tue\ Jan\ 22\ 14:32:44\ MET\ 1991 Erlang JAM file - version 4.2
4 string 1.0\ Fri\ Feb\ 3\ 09:55:56\ MET\ 1995 Erlang JAM file - version 4.3

View file

@ -0,0 +1,27 @@
#------------------------------------------------------------------------------
# ESRI Shapefile format (.shp .shx .dbf=DBaseIII)
# Based on info from
# <URL:http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf>
0 belong 9994 ESRI Shapefile
>4 belong =0
>8 belong =0
>12 belong =0
>16 belong =0
>20 belong =0
>28 lelong x version %d
>24 belong x length %d
>32 lelong =0 type Null Shape
>32 lelong =1 type Point
>32 lelong =3 type PolyLine
>32 lelong =5 type Polygon
>32 lelong =8 type MultiPoint
>32 lelong =11 type PointZ
>32 lelong =13 type PolyLineZ
>32 lelong =15 type PolygonZ
>32 lelong =18 type MultiPointZ
>32 lelong =21 type PointM
>32 lelong =23 type PolyLineM
>32 lelong =25 type PolygonM
>32 lelong =28 type MultiPointM
>32 lelong =31 type MultiPatch

View file

@ -0,0 +1,8 @@
#------------------------------------------------------------------------------
# fcs: file(1) magic for FCS (Flow Cytometry Standard) data files
# From Roger Leigh <roger@whinlatter.uklinux.net>
0 string FCS1.0 Flow Cytometry Standard (FCS) data, version 1.0
0 string FCS2.0 Flow Cytometry Standard (FCS) data, version 2.0
0 string FCS3.0 Flow Cytometry Standard (FCS) data, version 3.0

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,21 @@
#------------------------------------------------------------------------------
# flash: file(1) magic for Macromedia Flash file format
#
# See
#
# http://www.macromedia.com/software/flash/open/
#
0 string FWS Macromedia Flash data,
>3 byte x version %d
!:mime application/x-shockwave-flash
0 string CWS Macromedia Flash data (compressed),
!:mime application/x-shockwave-flash
>3 byte x version %d
# From: Cal Peake <cp@absolutedigital.net>
0 string FLV Macromedia Flash Video
!:mime video/x-flv
#
# From Dave Wilson
0 string AGD4\xbe\xb8\xbb\xcb\x00 Macromedia Freehand 9 Document

View file

@ -0,0 +1,65 @@
#------------------------------------------------------------------------------
# fonts: file(1) magic for font data
#
0 search/1 FONT ASCII vfont text
0 short 0436 Berkeley vfont data
0 short 017001 byte-swapped Berkeley vfont data
# PostScript fonts (must precede "printer" entries), quinlan@yggdrasil.com
0 string %!PS-AdobeFont-1. PostScript Type 1 font text
>20 string >\0 (%s)
6 string %!PS-AdobeFont-1. PostScript Type 1 font program data
# X11 font files in SNF (Server Natural Format) format
0 belong 00000004 X11 SNF font data, MSB first
0 lelong 00000004 X11 SNF font data, LSB first
# X11 Bitmap Distribution Format, from Daniel Quinlan (quinlan@yggdrasil.com)
0 search/1 STARTFONT\ X11 BDF font text
# X11 fonts, from Daniel Quinlan (quinlan@yggdrasil.com)
# PCF must come before SGI additions ("MIPSEL MIPS-II COFF" collides)
0 string \001fcp X11 Portable Compiled Font data
>12 byte 0x02 \b, LSB first
>12 byte 0x0a \b, MSB first
0 string D1.0\015 X11 Speedo font data
#------------------------------------------------------------------------------
# FIGlet fonts and controlfiles
# From figmagic supplied with Figlet version 2.2
# "David E. O'Brien" <obrien@FreeBSD.ORG>
0 string flf FIGlet font
>3 string >2a version %-2.2s
0 string flc FIGlet controlfile
>3 string >2a version %-2.2s
# libGrx graphics lib fonts, from Albert Cahalan (acahalan@cs.uml.edu)
# Used with djgpp (DOS Gnu C++), sometimes Linux or Turbo C++
0 belong 0x14025919 libGrx font data,
>8 leshort x %dx
>10 leshort x \b%d
>40 string x %s
# Misc. DOS VGA fonts, from Albert Cahalan (acahalan@cs.uml.edu)
0 belong 0xff464f4e DOS code page font data collection
7 belong 0x00454741 DOS code page font data
7 belong 0x00564944 DOS code page font data (from Linux?)
4098 string DOSFONT DOSFONT2 encrypted font data
# downloadable fonts for browser (prints type) anthon@mnt.org
0 string PFR1 PFR1 font
>102 string >0 \b: %s
# True Type fonts
0 string \000\001\000\000\000 TrueType font data
0 string \007\001\001\000Copyright\ (c)\ 199 Adobe Multiple Master font
0 string \012\001\001\000Copyright\ (c)\ 199 Adobe Multiple Master font
0 string ttcf TrueType font collection data
# Opentype font data from Avi Bercovich
0 string OTTO OpenType font data
# Gürkan Sengün <gurkan@linuks.mine.nu>, www.linuks.mine.nu
0 string SplineFontDB: Spline Font Database
>14 string x version %s

View file

@ -0,0 +1,3 @@
# FORTRAN source
0 regex/100 \^[Cc][\ \t] FORTRAN program
!:mime text/x-fortran

View file

@ -0,0 +1,48 @@
#------------------------------------------------------------------------------
# frame: file(1) magic for FrameMaker files
#
# This stuff came on a FrameMaker demo tape, most of which is
# copyright, but this file is "published" as witness the following:
#
# Note that this is the Framemaker Maker Interchange Format, not the
# Normal format which would be application/vnd.framemaker.
#
0 string \<MakerFile FrameMaker document
!:mime application/x-mif
>11 string 5.5 (5.5
>11 string 5.0 (5.0
>11 string 4.0 (4.0
>11 string 3.0 (3.0
>11 string 2.0 (2.0
>11 string 1.0 (1.0
>14 byte x %c)
0 string \<MIFFile FrameMaker MIF (ASCII) file
!:mime application/x-mif
>9 string 4.0 (4.0)
>9 string 3.0 (3.0)
>9 string 2.0 (2.0)
>9 string 1.0 (1.x)
0 search/1 \<MakerDictionary FrameMaker Dictionary text
!:mime application/x-mif
>17 string 3.0 (3.0)
>17 string 2.0 (2.0)
>17 string 1.0 (1.x)
0 string \<MakerScreenFont FrameMaker Font file
!:mime application/x-mif
>17 string 1.01 (%s)
0 string \<MML FrameMaker MML file
!:mime application/x-mif
0 string \<BookFile FrameMaker Book file
!:mime application/x-mif
>10 string 3.0 (3.0
>10 string 2.0 (2.0
>10 string 1.0 (1.0
>13 byte x %c)
# XXX - this book entry should be verified, if you find one, uncomment this
#0 string \<Book\ FrameMaker Book (ASCII) file
#!:mime application/x-mif
#>6 string 3.0 (3.0)
#>6 string 2.0 (2.0)
#>6 string 1.0 (1.0)
0 string \<Maker Intermediate Print File FrameMaker IPL file
!:mime application/x-mif

Some files were not shown because too many files have changed in this diff Show more