summaryrefslogtreecommitdiff
path: root/usr.bin/file/file.h
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/file/file.h')
-rw-r--r--usr.bin/file/file.h35
1 files changed, 27 insertions, 8 deletions
diff --git a/usr.bin/file/file.h b/usr.bin/file/file.h
index 0698c67ed6bd..bdca97bd734f 100644
--- a/usr.bin/file/file.h
+++ b/usr.bin/file/file.h
@@ -1,6 +1,6 @@
/*
* file.h - definitions for file(1) program
- * @(#)$Id$
+ * @(#)$Id: file.h,v 1.1.1.3 1997/03/18 17:58:51 mpp Exp $
*
* Copyright (c) Ian F. Darwin, 1987.
* Written by Ian F. Darwin.
@@ -26,6 +26,12 @@
* 4. This notice may not be removed or altered.
*/
+#ifndef __file_h__
+#define __file_h__
+
+typedef int int32;
+typedef unsigned int uint32;
+
#ifndef HOWMANY
# define HOWMANY 8192 /* how much of the file to look at */
#endif
@@ -37,12 +43,13 @@ struct magic {
short flag;
#define INDIR 1 /* if '>(...)' appears, */
#define UNSIGNED 2 /* comparison is unsigned */
+#define ADD 4 /* if '>&' appears, */
short cont_level; /* level of ">" */
struct {
char type; /* byte short long */
- long offset; /* offset from indirection */
+ int32 offset; /* offset from indirection */
} in;
- long offset; /* offset to magic number */
+ int32 offset; /* offset to magic number */
unsigned char reln; /* relation (0=eq, '>'=gt, etc) */
char type; /* int, short, long or string. */
char vallen; /* length of string value, if any */
@@ -60,12 +67,12 @@ struct magic {
union VALUETYPE {
unsigned char b;
unsigned short h;
- unsigned long l;
+ uint32 l;
char s[MAXstring];
unsigned char hs[2]; /* 2 bytes of a fixed-endian "short" */
unsigned char hl[4]; /* 2 bytes of a fixed-endian "long" */
} value; /* either number or string */
- unsigned long mask; /* mask before comparison with value */
+ uint32 mask; /* mask before comparison with value */
char nospflag; /* supress space character */
char desc[MAXDESC]; /* description */
};
@@ -98,8 +105,9 @@ extern int softmagic __P((unsigned char *, int));
extern int tryit __P((unsigned char *, int, int));
extern int zmagic __P((unsigned char *, int));
extern void ckfprintf __P((FILE *, const char *, ...));
-extern unsigned long signextend __P((struct magic *, unsigned long));
-
+extern uint32 signextend __P((struct magic *, unsigned int32));
+extern int internatmagic __P((unsigned char *, int));
+extern void tryelf __P((int, char *, int));
extern int errno; /* Some unixes don't define this.. */
@@ -119,7 +127,16 @@ extern int lflag; /* follow symbolic links? */
extern int optind; /* From getopt(3) */
extern char *optarg;
-#if !defined(__STDC__) || defined(sun) || defined(__sun__) || defined(__convex__)
+#if defined(sun) || defined(__sun__) || defined (__sun)
+# if defined(__svr4) || defined (__SVR4) || defined(__svr4__)
+# define SOLARIS
+# else
+# define SUNOS
+# endif
+#endif
+
+
+#if !defined(__STDC__) || defined(SUNOS) || defined(__convex__)
extern int sys_nerr;
extern char *sys_errlist[];
#define strerror(e) \
@@ -130,3 +147,5 @@ extern char *sys_errlist[];
#ifndef MAXPATHLEN
#define MAXPATHLEN 512
#endif
+
+#endif /* __file_h__ */