tar.h revision 203964
1219140Srwatson/*-
2219140Srwatson * Copyright (c) 1994
3247602Spjd *	The Regents of the University of California.  All rights reserved.
4219140Srwatson *
5219140Srwatson * This code is derived from software contributed to Berkeley by
6219140Srwatson * Chuck Karish of Mindcraft, Inc.
7219140Srwatson *
8219140Srwatson * Redistribution and use in source and binary forms, with or without
9247602Spjd * modification, are permitted provided that the following conditions
10247602Spjd * are met:
11247602Spjd * 1. Redistributions of source code must retain the above copyright
12219140Srwatson *    notice, this list of conditions and the following disclaimer.
13219140Srwatson * 2. Redistributions in binary form must reproduce the above copyright
14219140Srwatson *    notice, this list of conditions and the following disclaimer in the
15219140Srwatson *    documentation and/or other materials provided with the distribution.
16219140Srwatson * 3. Neither the name of the University nor the names of its contributors
17219140Srwatson *    may be used to endorse or promote products derived from this software
18219140Srwatson *    without specific prior written permission.
19219140Srwatson *
20219140Srwatson * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21219140Srwatson * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22219140Srwatson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23219140Srwatson * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24219140Srwatson * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25219140Srwatson * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26219140Srwatson * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27219140Srwatson * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28219140Srwatson * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29219140Srwatson * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30219140Srwatson * SUCH DAMAGE.
31219140Srwatson *
32219140Srwatson *	@(#)tar.h	8.2 (Berkeley) 1/4/94
33219140Srwatson *
34219140Srwatson * $FreeBSD: head/include/tar.h 203964 2010-02-16 19:39:50Z imp $
35219140Srwatson */
36219140Srwatson
37219140Srwatson#ifndef _TAR_H
38219140Srwatson#define _TAR_H
39280224Srwatson
40280224Srwatson#define	TMAGIC		"ustar"	/* ustar and a null */
41219140Srwatson#define	TMAGLEN		6
42219140Srwatson#define	TVERSION	"00"	/* 00 and no null */
43247602Spjd#define	TVERSLEN	2
44219140Srwatson
45255219Spjd/* Values used in typeflag field */
46223762Sjonathan#define	REGTYPE		'0'	/* Regular file */
47247602Spjd#define	AREGTYPE	'\0'	/* Regular file */
48223762Sjonathan#define	LNKTYPE		'1'	/* Link */
49255219Spjd#define	SYMTYPE		'2'	/* Reserved */
50255219Spjd#define	CHRTYPE		'3'	/* Character special */
51255219Spjd#define	BLKTYPE		'4'	/* Block special */
52255219Spjd#define	DIRTYPE		'5'	/* Directory */
53255219Spjd#define	FIFOTYPE	'6'	/* FIFO special */
54255219Spjd#define	CONTTYPE	'7'	/* Reserved */
55223762Sjonathan
56223762Sjonathan/* Bits used in the mode field - values in octal */
57223762Sjonathan#define	TSUID		04000	/* Set UID on execution */
58223762Sjonathan#define	TSGID		02000	/* Set GID on execution */
59223762Sjonathan#define	TSVTX		01000	/* Reserved */
60223762Sjonathan				/* File permissions */
61223762Sjonathan#define	TUREAD		00400	/* Read by owner */
62223762Sjonathan#define	TUWRITE		00200	/* Write by owner */
63223762Sjonathan#define	TUEXEC		00100	/* Execute/Search by owner */
64223762Sjonathan#define	TGREAD		00040	/* Read by group */
65223762Sjonathan#define	TGWRITE		00020	/* Write by group */
66223762Sjonathan#define	TGEXEC		00010	/* Execute/Search by group */
67223762Sjonathan#define	TOREAD		00004	/* Read by other */
68224255Sjonathan#define	TOWRITE		00002	/* Write by other */
69255219Spjd#define	TOEXEC		00001	/* Execute/Search by other */
70247602Spjd
71247602Spjd#endif
72247602Spjd