aboutsummaryrefslogtreecommitdiff
path: root/CPP/7zip/Archive/Tar/TarHeader.h
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/7zip/Archive/Tar/TarHeader.h')
-rw-r--r--CPP/7zip/Archive/Tar/TarHeader.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/CPP/7zip/Archive/Tar/TarHeader.h b/CPP/7zip/Archive/Tar/TarHeader.h
new file mode 100644
index 0000000..b0f0ec3
--- /dev/null
+++ b/CPP/7zip/Archive/Tar/TarHeader.h
@@ -0,0 +1,86 @@
1// Archive/TarHeader.h
2
3#ifndef __ARCHIVE_TAR_HEADER_H
4#define __ARCHIVE_TAR_HEADER_H
5
6#include "../../../Common/MyTypes.h"
7
8namespace NArchive {
9namespace NTar {
10
11namespace NFileHeader
12{
13 const unsigned kRecordSize = 512;
14 const unsigned kNameSize = 100;
15 const unsigned kUserNameSize = 32;
16 const unsigned kGroupNameSize = 32;
17 const unsigned kPrefixSize = 155;
18
19 const unsigned kUstarMagic_Offset = 257;
20
21 /*
22 struct CHeader
23 {
24 char Name[kNameSize];
25 char Mode[8];
26 char UID[8];
27 char GID[8];
28 char Size[12];
29 char ModificationTime[12];
30 char CheckSum[8];
31 char LinkFlag;
32 char LinkName[kNameSize];
33 char Magic[8];
34 char UserName[kUserNameSize];
35 char GroupName[kGroupNameSize];
36 char DeviceMajor[8];
37 char DeviceMinor[8];
38 char Prefix[155];
39 };
40 union CRecord
41 {
42 CHeader Header;
43 Byte Padding[kRecordSize];
44 };
45 */
46
47 namespace NLinkFlag
48 {
49 const char kOldNormal = 0; // Normal disk file, Unix compatible
50 const char kNormal = '0'; // Normal disk file
51 const char kHardLink = '1'; // Link to previously dumped file
52 const char kSymLink = '2'; // Symbolic link
53 const char kCharacter = '3'; // Character special file
54 const char kBlock = '4'; // Block special file
55 const char kDirectory = '5'; // Directory
56 const char kFIFO = '6'; // FIFO special file
57 const char kContiguous = '7'; // Contiguous file
58 const char kGnu_LongLink = 'K';
59 const char kGnu_LongName = 'L';
60 const char kSparse = 'S';
61 const char kLabel = 'V';
62 const char kDumpDir = 'D'; /* GNUTYPE_DUMPDIR.
63 data: list of files created by the --incremental (-G) option
64 Each file name is preceded by either
65 - 'Y' (file should be in this archive)
66 - 'N' (file is a directory, or is not stored in the archive.)
67 Each file name is terminated by a null + an additional null after
68 the last file name. */
69 }
70
71 extern const char * const kLongLink; // = "././@LongLink";
72 extern const char * const kLongLink2; // = "@LongLink";
73
74 namespace NMagic
75 {
76 // extern const char * const kUsTar; // = "ustar"; // 5 chars
77 // extern const char * const kGNUTar; // = "GNUtar "; // 7 chars and a null
78 // extern const char * const kEmpty; // = "\0\0\0\0\0\0\0\0"
79 // extern const char kUsTar_00[8];
80 extern const char kUsTar_GNU[8];
81 }
82}
83
84}}
85
86#endif