1284194Sdelphij/*
2284194Sdelphij * Copyright (c) Ian F. Darwin 1986-1995.
3284194Sdelphij * Software written by Ian F. Darwin and others;
4284194Sdelphij * maintained 1995-present by Christos Zoulas and others.
5284194Sdelphij *
6284194Sdelphij * Redistribution and use in source and binary forms, with or without
7284194Sdelphij * modification, are permitted provided that the following conditions
8284194Sdelphij * are met:
9284194Sdelphij * 1. Redistributions of source code must retain the above copyright
10284194Sdelphij *    notice immediately at the beginning of the file, without modification,
11284194Sdelphij *    this list of conditions, and the following disclaimer.
12284194Sdelphij * 2. Redistributions in binary form must reproduce the above copyright
13284194Sdelphij *    notice, this list of conditions and the following disclaimer in the
14284194Sdelphij *    documentation and/or other materials provided with the distribution.
15284194Sdelphij *
16284194Sdelphij * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17284194Sdelphij * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18284194Sdelphij * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19284194Sdelphij * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
20284194Sdelphij * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21284194Sdelphij * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22284194Sdelphij * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23284194Sdelphij * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24284194Sdelphij * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25284194Sdelphij * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26284194Sdelphij * SUCH DAMAGE.
27284194Sdelphij */
28284194Sdelphij/*
29284194Sdelphij * Header file for public domain tar (tape archive) program.
30284194Sdelphij *
31284194Sdelphij * @(#)tar.h 1.20 86/10/29	Public Domain.
32284194Sdelphij *
33284194Sdelphij * Created 25 August 1985 by John Gilmore, ihnp4!hoptoad!gnu.
34284194Sdelphij *
35284194Sdelphij * $File: tar.h,v 1.13 2010/11/30 14:58:53 rrt Exp $ # checkin only
36284194Sdelphij */
37284194Sdelphij
38284194Sdelphij/*
39284194Sdelphij * Header block on tape.
40284194Sdelphij *
41284194Sdelphij * I'm going to use traditional DP naming conventions here.
42284194Sdelphij * A "block" is a big chunk of stuff that we do I/O on.
43284194Sdelphij * A "record" is a piece of info that we care about.
44284194Sdelphij * Typically many "record"s fit into a "block".
45284194Sdelphij */
46284194Sdelphij#define	RECORDSIZE	512
47284194Sdelphij#define	NAMSIZ	100
48284194Sdelphij#define	TUNMLEN	32
49284194Sdelphij#define	TGNMLEN	32
50284194Sdelphij
51284194Sdelphijunion record {
52284194Sdelphij	unsigned char	charptr[RECORDSIZE];
53284194Sdelphij	struct header {
54284194Sdelphij		char	name[NAMSIZ];
55284194Sdelphij		char	mode[8];
56284194Sdelphij		char	uid[8];
57284194Sdelphij		char	gid[8];
58284194Sdelphij		char	size[12];
59284194Sdelphij		char	mtime[12];
60284194Sdelphij		char	chksum[8];
61284194Sdelphij		char	linkflag;
62284194Sdelphij		char	linkname[NAMSIZ];
63284194Sdelphij		char	magic[8];
64284194Sdelphij		char	uname[TUNMLEN];
65284194Sdelphij		char	gname[TGNMLEN];
66284194Sdelphij		char	devmajor[8];
67284194Sdelphij		char	devminor[8];
68284194Sdelphij	} header;
69284194Sdelphij};
70284194Sdelphij
71284194Sdelphij/* The magic field is filled with this if uname and gname are valid. */
72284194Sdelphij#define	TMAGIC		"ustar"		/* 5 chars and a null */
73284194Sdelphij#define	GNUTMAGIC	"ustar  "	/* 7 chars and a null */
74