xref: /titanic_44/usr/src/lib/libast/i386/include/ast/tar.h (revision 55553f719b521a0bb4deab6efc944cd30c1a56aa)
1 
2 /* : : generated by proto : : */
3 /***********************************************************************
4 *                                                                      *
5 *               This software is part of the ast package               *
6 *           Copyright (c) 1985-2007 AT&T Knowledge Ventures            *
7 *                      and is licensed under the                       *
8 *                  Common Public License, Version 1.0                  *
9 *                      by AT&T Knowledge Ventures                      *
10 *                                                                      *
11 *                A copy of the License is available at                 *
12 *            http://www.opensource.org/licenses/cpl1.0.txt             *
13 *         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
14 *                                                                      *
15 *              Information and Software Systems Research               *
16 *                            AT&T Research                             *
17 *                           Florham Park NJ                            *
18 *                                                                      *
19 *                 Glenn Fowler <gsf@research.att.com>                  *
20 *                  David Korn <dgk@research.att.com>                   *
21 *                   Phong Vo <kpv@research.att.com>                    *
22 *                                                                      *
23 ***********************************************************************/
24 
25 /*
26  * Standard Archive Format
27  * USTAR - Uniform Standard Tape ARchive
28  */
29 
30 #ifndef _TAR_H
31 #if !defined(__PROTO__)
32 #include <prototyped.h>
33 #endif
34 #if !defined(__LINKAGE__)
35 #define __LINKAGE__		/* 2004-08-11 transition */
36 #endif
37 
38 #define _TAR_H
39 
40 #define TBLOCK		512
41 #define NAMSIZ		100
42 #define PFXSIZ		155
43 
44 #define TMODLEN		8
45 #define TUIDLEN		8
46 #define TGIDLEN		8
47 #define TSIZLEN		12
48 #define TMTMLEN		12
49 #define TCKSLEN		8
50 
51 #define TMAGIC		"ustar"		/* ustar and a null		*/
52 #define TMAGLEN		6
53 #define TVERSION	"00"		/* 00 and no null		*/
54 #define TVERSLEN	2
55 #define TUNMLEN		32
56 #define TGNMLEN		32
57 #define TDEVLEN		8
58 
59 /*
60  * values used in typeflag field
61  */
62 
63 #define REGTYPE		'0'		/* regular file			*/
64 #define AREGTYPE	0		/* alternate REGTYPE		*/
65 #define LNKTYPE		'1'		/* hard link			*/
66 #define SYMTYPE		'2'		/* soft link			*/
67 #define CHRTYPE		'3'		/* character special		*/
68 #define BLKTYPE		'4'		/* block special		*/
69 #define DIRTYPE		'5'		/* directory			*/
70 #define FIFOTYPE	'6'		/* FIFO special			*/
71 #define CONTTYPE	'7'		/* reserved			*/
72 #define SOKTYPE		'8'		/* socket			*/
73 #define EXTTYPE		'x'		/* extended header		*/
74 #define GLBTYPE		'g'		/* global extended header	*/
75 #define LLNKTYPE	'K'		/* long link path		*/
76 #define LREGTYPE	'L'		/* long file path		*/
77 #define VERTYPE		'V'		/* version			*/
78 
79 /*
80  * bits used in mode field
81  */
82 
83 #define TSUID		04000		/* set uid on exec		*/
84 #define TSGID		02000		/* set gid on exec		*/
85 #define TSVTX		01000		/* sticky bit -- reserved	*/
86 
87 /*
88  * file permissions
89  */
90 
91 #define TUREAD		00400		/* read by owner		*/
92 #define TUWRITE		00200		/* write by owner		*/
93 #define TUEXEC		00100		/* execute by owner		*/
94 #define TGREAD		00040		/* read by group		*/
95 #define TGWRITE		00020		/* execute by group		*/
96 #define TGEXEC		00010		/* write by group		*/
97 #define TOREAD		00004		/* read by other		*/
98 #define TOWRITE		00002		/* write by other		*/
99 #define TOEXEC		00001		/* execute by other		*/
100 
101 struct header
102 {
103 	char		name[NAMSIZ];
104 	char		mode[TMODLEN];
105 	char		uid[TUIDLEN];
106 	char		gid[TGIDLEN];
107 	char		size[TSIZLEN];
108 	char		mtime[TMTMLEN];
109 	char		chksum[TCKSLEN];
110 	char		typeflag;
111 	char		linkname[NAMSIZ];
112 	char		magic[TMAGLEN];
113 	char		version[TVERSLEN];
114 	char		uname[TUNMLEN];
115 	char		gname[TGNMLEN];
116 	char		devmajor[TDEVLEN];
117 	char		devminor[TDEVLEN];
118 	char		prefix[PFXSIZ];
119 };
120 
121 union hblock
122 {
123 	char		dummy[TBLOCK];
124 	struct header	dbuf;
125 };
126 
127 #endif
128