view src/win32/7zip/7z/CPP/7zip/Archive/Tar/TarHeader.h @ 1:f9f4f1b99eed

importing src directory
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:31:27 -0600
parents
children
line wrap: on
line source
1 // Archive/Tar/Header.h
3 #ifndef __ARCHIVE_TAR_HEADER_H
4 #define __ARCHIVE_TAR_HEADER_H
6 #include "Common/Types.h"
8 namespace NArchive {
9 namespace NTar {
11 namespace NFileHeader
12 {
13 const int kRecordSize = 512;
14 const int kNameSize = 100;
15 const int kUserNameSize = 32;
16 const int kGroupNameSize = 32;
17 const int kPrefixSize = 155;
19 /*
20 struct CHeader
21 {
22 char Name[kNameSize];
23 char Mode[8];
24 char UID[8];
25 char GID[8];
26 char Size[12];
27 char ModificationTime[12];
28 char CheckSum[8];
29 char LinkFlag;
30 char LinkName[kNameSize];
31 char Magic[8];
32 char UserName[kUserNameSize];
33 char GroupName[kGroupNameSize];
34 char DeviceMajor[8];
35 char DeviceMinor[8];
36 char Prefix[155];
37 };
38 union CRecord
39 {
40 CHeader Header;
41 Byte Padding[kRecordSize];
42 };
43 */
45 namespace NMode
46 {
47 const int kSetUID = 04000; // Set UID on execution
48 const int kSetGID = 02000; // Set GID on execution
49 const int kSaveText = 01000; // Save text (sticky bit)
50 }
52 namespace NFilePermissions
53 {
54 const int kUserRead = 00400; // read by owner
55 const int kUserWrite = 00200; // write by owner
56 const int kUserExecute = 00100; // execute/search by owner
57 const int kGroupRead = 00040; // read by group
58 const int kGroupWrite = 00020; // write by group
59 const int kGroupExecute = 00010; // execute/search by group
60 const int kOtherRead = 00004; // read by other
61 const int kOtherWrite = 00002; // write by other
62 const int kOtherExecute = 00001; // execute/search by other
63 }
66 // The linkflag defines the type of file
67 namespace NLinkFlag
68 {
69 const char kOldNormal = '\0'; // Normal disk file, Unix compatible
70 const char kNormal = '0'; // Normal disk file
71 const char kLink = '1'; // Link to previously dumped file
72 const char kSymbolicLink = '2'; // Symbolic link
73 const char kCharacter = '3'; // Character special file
74 const char kBlock = '4'; // Block special file
75 const char kDirectory = '5'; // Directory
76 const char kFIFO = '6'; // FIFO special file
77 const char kContiguous = '7'; // Contiguous file
79 const char kDumpDir = 'D'; /* GNUTYPE_DUMPDIR.
80 data: list of files created by the --incremental (-G) option
81 Each file name is preceded by either
82 - 'Y' (file should be in this archive)
83 - 'N' (file is a directory, or is not stored in the archive.)
84 Each file name is terminated by a null + an additional null after
85 the last file name. */
87 }
88 // Further link types may be defined later.
90 // The checksum field is filled with this while the checksum is computed.
91 extern const char *kCheckSumBlanks;// = " "; // 8 blanks, no null
93 extern const char *kLongLink; // = "././@LongLink";
94 extern const char *kLongLink2; // = "@LongLink";
96 // The magic field is filled with this if uname and gname are valid.
97 namespace NMagic
98 {
99 extern const char *kUsTar; // = "ustar"; // 5 chars
100 extern const char *kGNUTar; // = "GNUtar "; // 7 chars and a null
101 extern const char *kEmpty; // = "GNUtar "; // 7 chars and a null
102 }
104 }
106 }}
108 #endif