1 /* $MirOS: src/sys/lib/libsa/ustar.h,v 1.1 2010/01/10 19:21:38 tg Exp $ */
2 
3 #ifndef _SYS_LIB_LIBSA_USTAR_H
4 #define _SYS_LIB_LIBSA_USTAR_H
5 
6 typedef struct {
7 	char name[100];			/* ASCII filename, NUL or #100 ends */
8 	char mode[8];			/* OCT mode (UNIX permissions) */
9 	char uid[8];			/* OCT numerical uid */
10 	char gid[8];			/* OCT numerical gid */
11 	char size[12];			/* OCT file size (up to 8 GiB) */
12 	char mtime[12];			/* OCT file mtime (time_t) */
13 	char chksum[8];			/* OCT header additive checksum */
14 	char typeflag;			/* see below */
15 	char linkname[100];		/* ASCII linkdest, NUL or #100 ends */
16 	char magic[6];			/* ASCIZ "ustar" */
17 	char version[2];		/* ASCII "00" */
18 	char uname[32];			/* ASCIZ alpha uid */
19 	char gname[32];			/* ASCIZ alpha gid */
20 	char devmajor[8];
21 	char devminor[8];
22 	char prefix[155];		/* ASCII pathpart, NUL or #155 ends */
23 	char _padding[12];		/* pad up to 512 octets */
24 } ustar_hdr_t;
25 
26 /**
27  * Possible typeflags:
28  * + with data blocks stored ((size+511)/512):
29  *   - '0' or '\0' or '7' = regular file
30  * + without data blocks stored:
31  *   - '1' = hardlink (target is in linkname, prev. archived)
32  *   - '2' = symlink (target is in linkname)
33  *   - '3' = character device
34  *   - '4' = block device
35  *   - '5' = directory
36  *   - '6' = FIFO
37  * + everything else is invalid and will initiate header search
38  */
39 
40 extern const char ustar_magic_version[8];
41 
42 #endif
43