168349Sobrien/*
2133359Sobrien * Copyright (c) Ian F. Darwin 1986-1995.
3133359Sobrien * Software written by Ian F. Darwin and others;
4133359Sobrien * maintained 1995-present by Christos Zoulas and others.
5226048Sobrien *
6133359Sobrien * Redistribution and use in source and binary forms, with or without
7133359Sobrien * modification, are permitted provided that the following conditions
8133359Sobrien * are met:
9133359Sobrien * 1. Redistributions of source code must retain the above copyright
10133359Sobrien *    notice immediately at the beginning of the file, without modification,
11133359Sobrien *    this list of conditions, and the following disclaimer.
12133359Sobrien * 2. Redistributions in binary form must reproduce the above copyright
13133359Sobrien *    notice, this list of conditions and the following disclaimer in the
14133359Sobrien *    documentation and/or other materials provided with the distribution.
15226048Sobrien *
16133359Sobrien * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17133359Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18133359Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19133359Sobrien * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
20133359Sobrien * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21133359Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22133359Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23133359Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24133359Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25133359Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26133359Sobrien * SUCH DAMAGE.
27133359Sobrien */
28133359Sobrien/*
2968349Sobrien * Header file for public domain tar (tape archive) program.
3068349Sobrien *
3168349Sobrien * @(#)tar.h 1.20 86/10/29	Public Domain.
3268349Sobrien *
3368349Sobrien * Created 25 August 1985 by John Gilmore, ihnp4!hoptoad!gnu.
3468349Sobrien *
35226048Sobrien * $File: tar.h,v 1.13 2010/11/30 14:58:53 rrt Exp $ # checkin only
3668349Sobrien */
3768349Sobrien
3868349Sobrien/*
3968349Sobrien * Header block on tape.
4068349Sobrien *
4168349Sobrien * I'm going to use traditional DP naming conventions here.
4268349Sobrien * A "block" is a big chunk of stuff that we do I/O on.
4368349Sobrien * A "record" is a piece of info that we care about.
4468349Sobrien * Typically many "record"s fit into a "block".
4568349Sobrien */
4668349Sobrien#define	RECORDSIZE	512
4768349Sobrien#define	NAMSIZ	100
4868349Sobrien#define	TUNMLEN	32
4968349Sobrien#define	TGNMLEN	32
5068349Sobrien
5168349Sobrienunion record {
52226048Sobrien	unsigned char	charptr[RECORDSIZE];
5368349Sobrien	struct header {
5468349Sobrien		char	name[NAMSIZ];
5568349Sobrien		char	mode[8];
5668349Sobrien		char	uid[8];
5768349Sobrien		char	gid[8];
5868349Sobrien		char	size[12];
5968349Sobrien		char	mtime[12];
6068349Sobrien		char	chksum[8];
6168349Sobrien		char	linkflag;
6268349Sobrien		char	linkname[NAMSIZ];
6368349Sobrien		char	magic[8];
6468349Sobrien		char	uname[TUNMLEN];
6568349Sobrien		char	gname[TGNMLEN];
6668349Sobrien		char	devmajor[8];
6768349Sobrien		char	devminor[8];
6868349Sobrien	} header;
6968349Sobrien};
7068349Sobrien
7168349Sobrien/* The magic field is filled with this if uname and gname are valid. */
72169942Sobrien#define	TMAGIC		"ustar"		/* 5 chars and a null */
73169942Sobrien#define	GNUTMAGIC	"ustar  "	/* 7 chars and a null */
74