*/
#include <stdio.h>
+#include <string.h>
+
#include "file.h"
#ifndef lint
static char *moduleid =
- "@(#)$Header: /home/glen/git/file/cvs/file/src/softmagic.c,v 1.10 1992/05/21 16:16:41 ian Exp $";
+ "@(#)$Header: /home/glen/git/file/cvs/file/src/softmagic.c,v 1.11 1992/05/22 17:58:06 ian Exp $";
#endif /* lint */
extern char *progname;
extern char *magicfile; /* name of current /etc/magic or clone */
extern int debug, nmagic;
-extern FILE *efopen();
extern struct magic magic[];
static int magindex;
+#if defined(__STDC__) || defined(__cplusplus)
+static int match(unsigned char *s);
+static int mcheck(unsigned char *s, struct magic *m);
+static void mprint(struct magic *m, unsigned char *s);
+#else
+static int match();
+static int mcheck();
+static void mprint();
+#endif
/*
* softmagic - lookup one file in database
* Passed the name and FILE * of one file to be typed.
*/
/*ARGSUSED1*/ /* nbytes passed for regularity, maybe need later */
+int
softmagic(buf, nbytes)
unsigned char *buf;
int nbytes;
* go through the whole list, stopping if you find a match.
* Be sure to process every continuation of this match.
*/
+static int
match(s)
unsigned char *s;
{
return 0; /* no match at all */
}
-
-mprint(m,s)
+static void
+mprint(m, s)
struct magic *m;
unsigned char *s;
{
register union VALUETYPE *p = (union VALUETYPE *)(s+m->offset);
- char *pp, *strchr();
+ char *pp;
switch (m->type) {
case BYTE:
}
}
-int
+static int
mcheck(s, m)
unsigned char *s;
struct magic *m;