xref: /netbsd-src/include/tar.h (revision 039cc95684ed0da206d259b9445f65310484658e)
1*039cc956Sagc /*	$NetBSD: tar.h,v 1.4 2003/08/07 09:44:11 agc Exp $	*/
292576441Sjtc 
392576441Sjtc /*-
445c131a8Sperry  * Copyright (c) 1994
545c131a8Sperry  *	The Regents of the University of California.  All rights reserved.
692576441Sjtc  *
745c131a8Sperry  * This code is derived from software contributed to Berkeley by
845c131a8Sperry  * Chuck Karish of Mindcraft, Inc.
992576441Sjtc  *
1092576441Sjtc  * Redistribution and use in source and binary forms, with or without
1192576441Sjtc  * modification, are permitted provided that the following conditions
1292576441Sjtc  * are met:
1392576441Sjtc  * 1. Redistributions of source code must retain the above copyright
1492576441Sjtc  *    notice, this list of conditions and the following disclaimer.
1592576441Sjtc  * 2. Redistributions in binary form must reproduce the above copyright
1692576441Sjtc  *    notice, this list of conditions and the following disclaimer in the
1792576441Sjtc  *    documentation and/or other materials provided with the distribution.
18*039cc956Sagc  * 3. Neither the name of the University nor the names of its contributors
1945c131a8Sperry  *    may be used to endorse or promote products derived from this software
2045c131a8Sperry  *    without specific prior written permission.
2192576441Sjtc  *
2245c131a8Sperry  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2345c131a8Sperry  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2445c131a8Sperry  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2545c131a8Sperry  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2645c131a8Sperry  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2745c131a8Sperry  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2845c131a8Sperry  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2945c131a8Sperry  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3045c131a8Sperry  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3145c131a8Sperry  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3245c131a8Sperry  * SUCH DAMAGE.
3345c131a8Sperry  *
3445c131a8Sperry  *	@(#)tar.h	8.2 (Berkeley) 1/4/94
3592576441Sjtc  */
3692576441Sjtc 
3745c131a8Sperry #ifndef _TAR_H
3845c131a8Sperry #define _TAR_H
3992576441Sjtc 
4045c131a8Sperry #define	TMAGIC		"ustar"	/* ustar and a null */
4192576441Sjtc #define	TMAGLEN		6
4245c131a8Sperry #define	TVERSION	"00"	/* 00 and no null */
4392576441Sjtc #define	TVERSLEN	2
4492576441Sjtc 
4545c131a8Sperry /* Values used in typeflag field */
4645c131a8Sperry #define	REGTYPE		'0'	/* Regular file */
4745c131a8Sperry #define	AREGTYPE	'\0'	/* Regular file */
4845c131a8Sperry #define	LNKTYPE		'1'	/* Link */
4945c131a8Sperry #define	SYMTYPE		'2'	/* Reserved */
5045c131a8Sperry #define	CHRTYPE		'3'	/* Character special */
5145c131a8Sperry #define	BLKTYPE		'4'	/* Block special */
5245c131a8Sperry #define	DIRTYPE		'5'	/* Directory */
5345c131a8Sperry #define	FIFOTYPE	'6'	/* FIFO special */
5445c131a8Sperry #define	CONTTYPE	'7'	/* Reserved */
5592576441Sjtc 
5645c131a8Sperry /* Bits used in the mode field - values in octal */
5745c131a8Sperry #define	TSUID		04000	/* Set UID on execution */
5845c131a8Sperry #define	TSGID		02000	/* Set GID on execution */
5945c131a8Sperry #define	TSVTX		01000	/* Reserved */
6045c131a8Sperry 				/* File permissions */
6145c131a8Sperry #define	TUREAD		00400	/* Read by owner */
6245c131a8Sperry #define	TUWRITE		00200	/* Write by owner */
6345c131a8Sperry #define	TUEXEC		00100	/* Execute/Search by owner */
6445c131a8Sperry #define	TGREAD		00040	/* Read by group */
6545c131a8Sperry #define	TGWRITE		00020	/* Write by group */
6645c131a8Sperry #define	TGEXEC		00010	/* Execute/Search by group */
6745c131a8Sperry #define	TOREAD		00004	/* Read by other */
6845c131a8Sperry #define	TOWRITE		00002	/* Write by other */
6945c131a8Sperry #define	TOEXEC		00001	/* Execute/Search by other */
7092576441Sjtc 
7145c131a8Sperry #endif
72