/*
 *	MSDOS TAR Extractor
 */

 /* last changed: 28.3.95 */

#define	RECORDSIZE	512
#define	NAMSIZ		100
#define	TUNMLEN		32
#define	TGNMLEN		32

/*
 *	Header block on tape.
 *
 *	no byte swapping
 */

union record {
	char	charptr[RECORDSIZE];
	struct	{
		char	name[NAMSIZ];
		char	mode[8];
		char	uid[8];
		char	gid[8];
		char	size[12];
		char	mtime[12];
		char	chksum[8];
		char	linkflag;
		char	linkname[NAMSIZ];
		char	magic[8];
		char	uname[TUNMLEN];
		char	gname[TGNMLEN];
		char	devmajor[8];
		char	devminor[8];
	} header;
};

#define	CHKBLANKS	"        "	/* Checksum: 8 blanks, no null */
#define	TMAGIC		"ustar  "	/* Majic: 7 bytes and a null */

/* The linkflag defines the type of file */

#define	LF_OLDNORMAL	'\0'		/* Normal disk file, Unix compat */
#define	LF_NORMAL	'0'		/* Normal disk file */
#define	LF_LINK		'1'		/* Link to previously dumped file */
#define	LF_SYMLINK	'2'		/* Symbolic link */
#define	LF_CHR		'3'		/* Character special file */
#define	LF_BLK		'4'		/* Block special file */
#define	LF_DIR		'5'		/* Directory */
#define	LF_FIFO		'6'		/* FIFO special file */
#define	LF_CONTIG	'7'		/* Contiguous file */

/*
 *	Unix Stat Header (K&R)
 *
 */

#include <stat.h>

#define	S_ISUID		0004000  /* SAS/C misses these */
#define	S_ISGID		0002000
#define	S_ISVTX		0001000
