+2007-01-26 13:45 Christos Zoulas <christos@zoulas.com>
+
+ * reduce writable data from Diego "Flameeyes" Petten
+
2007-12-28 15:06 Christos Zoulas <christos@zoulas.com>
* strtof detection
# 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 ubyte <0xff \b%d.
->4 ubyte <0xff \b%d tag
+0 string ID3 Audio file with ID3 version 2.
+>3 ubyte <0xff \b%d
+#>4 ubyte <0xff \b%d tag
>2584 string fLaC \b, FLAC encoding
>>2588 byte&0x7f >0 \b, unknown version
>>2588 byte&0x7f 0 \b
Magdir/mathematica \
Magdir/matroska \
Magdir/mcrypt \
+Magdir/mercurial \
Magdir/mime \
Magdir/mips \
Magdir/mirage \
Magdir/wordprocessors \
Magdir/xdelta \
Magdir/xenix \
+Magdir/xilinx \
Magdir/xo65 \
Magdir/xwindows \
Magdir/zilog \
#endif
#ifndef lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.108 2007/12/27 16:35:58 christos Exp $")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.109 2007/12/27 20:52:36 christos Exp $")
#endif /* lint */
#define EATAB {while (isascii((unsigned char) *l) && \
#endif /* COMPILE_ONLY */
static const struct type_tbl_s {
- const char *name;
+ const char name[16];
const size_t len;
const int type;
const int format;
} type_tbl[] = {
# define XX(s) s, (sizeof(s) - 1)
-# define XX_NULL NULL, 0
+# define XX_NULL "", 0
{ XX("byte"), FILE_BYTE, FILE_FMT_NUM },
{ XX("short"), FILE_SHORT, FILE_FMT_NUM },
{ XX("default"), FILE_DEFAULT, FILE_FMT_STR },
{
const struct type_tbl_s *p;
- for (p = type_tbl; p->name; p++) {
+ for (p = type_tbl; p->len; p++) {
if (strncmp(l, p->name, p->len) == 0) {
if (t)
*t = l + p->len;
return;
done++;
- for (p = type_tbl; p->name; p++) {
+ for (p = type_tbl; p->len; p++) {
assert(p->type < FILE_NAMES_SIZE);
file_names[p->type] = p->name;
file_formats[p->type] = p->format;
private int
get_cond(const char *l, const char **t)
{
- static struct cond_tbl_s {
- const char *name;
- const size_t len;
- const int cond;
+ static const struct cond_tbl_s {
+ char name[8];
+ size_t len;
+ int cond;
} cond_tbl[] = {
{ "if", 2, COND_IF },
{ "elif", 4, COND_ELIF },
{ "else", 4, COND_ELSE },
- { NULL, 0, COND_NONE },
+ { "", 0, COND_NONE },
};
- struct cond_tbl_s *p;
+ const struct cond_tbl_s *p;
- for (p = cond_tbl; p->name; p++) {
+ for (p = cond_tbl; p->len; p++) {
if (strncmp(l, p->name, p->len) == 0 &&
isspace((unsigned char)l[p->len])) {
if (t)
#include "names.h"
#ifndef lint
-FILE_RCSID("@(#)$File: ascmagic.c,v 1.52 2007/10/17 19:33:31 christos Exp $")
+FILE_RCSID("@(#)$File: ascmagic.c,v 1.53 2007/10/29 00:54:08 christos Exp $")
#endif /* lint */
typedef unsigned long unichar;
unsigned char *nbuf = NULL;
unichar *ubuf = NULL;
size_t ulen;
- struct names *p;
+ const struct names *p;
int rv = -1;
int mime = ms->flags & MAGIC_MIME;
#ifndef lint
-FILE_RCSID("@(#)$File: compress.c,v 1.53 2007/10/17 19:33:31 christos Exp $")
+FILE_RCSID("@(#)$File: compress.c,v 1.54 2007/12/02 00:28:10 christos Exp $")
#endif
-private struct {
- const char *magic;
+private const struct {
+ const char magic[8];
size_t maglen;
- const char *const argv[3];
+ const char *argv[3];
int silent;
} compr[] = {
{ "\037\235", 2, { "gzip", "-cdq", NULL }, 1 }, /* compressed */
#include "tar.h"
#ifndef lint
-FILE_RCSID("@(#)$File: is_tar.c,v 1.28 2007/08/19 03:45:08 christos Exp $")
+FILE_RCSID("@(#)$File: is_tar.c,v 1.29 2007/10/17 19:33:31 christos Exp $")
#endif
#define isodigit(c) ( ((c) >= '0') && ((c) <= '7') )
private int is_tar(const unsigned char *, size_t);
private int from_oct(int, const char *); /* Decode octal number */
-static const char *tartype[] = {
+static const char tartype[][32] = {
"tar archive",
"POSIX tar archive",
"POSIX tar archive (GNU)",
* appear at fixed offsets into the file. Don't make HOWMANY
* too high unless you have a very fast CPU.
*
- * $File: names.h,v 1.28 2007/10/29 00:54:08 christos Exp $
+ * $File: names.h,v 1.29 2007/12/27 20:30:35 christos Exp $
*/
/*
#define L_PO 13 /* PO */
static const struct {
- const char *human;
- const char *mime;
+ char human[48];
+ char mime[16];
} types[] = {
{ "C program", "text/x-c", },
{ "C++ program", "text/x-c++" },
{ "BCPL program", "text/x-bcpl" },
{ "M4 macro language pre-processor", "text/x-m4" },
{ "PO (gettext message catalogue)", "text/x-po" },
- { "cannot happen error on names.h/types", "error/x-error" },
- { 0, 0}
+ { "cannot happen error on names.h/types", "error/x-error" }
};
/*
* as Java, as it comes after "the" and "The". Perhaps we need a fancier
* heuristic to identify Java?
*/
-static struct names {
- const char *name;
+static const struct names {
+ char name[14];
short type;
} names[] = {
/* These must be sorted by eye for optimal hit rate */
{"<body", L_HTML},
{"<BODY", L_HTML},
{"<html", L_HTML},
- {"<HTML", L_HTML},
- {NULL, 0}
+ {"<HTML", L_HTML}
};
-#define NNAMES ((sizeof(names)/sizeof(struct names)) - 1)
+#define NNAMES (sizeof(names)/sizeof(struct names))
#include "readelf.h"
#ifndef lint
-FILE_RCSID("@(#)$File: readelf.c,v 1.67 2007/11/17 17:08:27 christos Exp $")
+FILE_RCSID("@(#)$File: readelf.c,v 1.68 2007/12/27 16:13:26 christos Exp $")
#endif
#ifdef ELFCORE
: prpsoffsets64[i])
#ifdef ELFCORE
-size_t prpsoffsets32[] = {
+static const size_t prpsoffsets32[] = {
8, /* FreeBSD */
44, /* Linux (path name) */
28, /* Linux 2.0.36 (short name) */
84, /* SunOS 5.x */
};
-size_t prpsoffsets64[] = {
+static const size_t prpsoffsets64[] = {
16, /* FreeBSD, 64-bit */
56, /* Linux (path name) */
40, /* Linux (tested on core from 2.4.x, short name) */
#define OS_STYLE_FREEBSD 1
#define OS_STYLE_NETBSD 2
-private const char *os_style_names[] = {
+private const char os_style_names[][8] = {
"SVR4",
"FreeBSD",
"NetBSD",