#define HOWMANY	1024		/* how much of the file to look at */
#define MAXMAGIS 500		/* max entries in /etc/magic */
#define MAXDESC	50		/* max leng of text description */
#define MAXstring 32		/* max leng of "string" types */
#define PATHSIZE  160	/* max leng of path */
#define ckfputs(str,fil) {if (fputs(str,fil)==EOF) error(ckfmsg,"");}

#define 			OBJ_BYTE	1
#define				OBJ_SHORT	2
#define				OBJ_LONG	4
#define				OBJ_STRING	5

struct magic 
 {
	short contflag;		/* 1 if '>0' appears */
	long offset;		/* offset to magic number */
	char reln;		/* relation (0=eq, '>'=gt, etc) */
	char type;		/* int, short, long or string. or extended (see below) */
	char vallen;		/* length of string value, if any */
	union VALUETYPE {
		char b;
		short h;
		long l;
		char s[MAXstring];
	} value;		/* either number or string */
	char desc[MAXDESC];	/* description */
 };

int	ascmagic(char *buf);
void	error(char *s1, char *s2);
void	warning(char *f, char *a);
int	apprentice(char *fn);
int	parse(char *l, int *ndx);
char	*getstr(char *s, char *p, int plen, int *slen);
int	hextoint(char c);
void	showstr(char *s);
int	fsmagic(char *fn);
long	from_oct(int digs, char *where);
int	is_tar(union	record	*header);
int	softmagic(char *buf);
int	match(char *s);
void	mprint(struct	magic	*m, char *s);
int	mcheck(char *s, struct	magic	*m);

/* some defines for ascii-magic etc. */

#define TROFF 11
#define FORTRAN 12
/* 13 to 23 are ascii types, see names.h */
#define TAR_ARCH 24
#define POSIX_TAR_ARCH 24
#define ASCII_ESC 27
#define ASCII     27
#define OBJ_DIRECTORY 28
#define ELSE      29
#define EMPTY     30
