mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-10 22:07:08 -06:00
4.20
This commit is contained in:
committed by
Kornel Lesiński
parent
8c1b5c7b7e
commit
3c510ba80b
@@ -1,7 +1,5 @@
|
||||
// Archive/Zip/Header.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __ARCHIVE_ZIP_HEADER_H
|
||||
#define __ARCHIVE_ZIP_HEADER_H
|
||||
|
||||
@@ -10,43 +8,48 @@
|
||||
namespace NArchive {
|
||||
namespace NZip {
|
||||
|
||||
#pragma pack( push, PragmaZipHeaders)
|
||||
#pragma pack( push, 1)
|
||||
|
||||
namespace NSignature
|
||||
{
|
||||
extern UINT32 kLocalFileHeader;
|
||||
extern UINT32 kDataDescriptor;
|
||||
extern UINT32 kCentralFileHeader;
|
||||
extern UINT32 kEndOfCentralDir;
|
||||
extern UInt32 kLocalFileHeader;
|
||||
extern UInt32 kDataDescriptor;
|
||||
extern UInt32 kCentralFileHeader;
|
||||
extern UInt32 kEndOfCentralDir;
|
||||
extern UInt32 kZip64EndOfCentralDir;
|
||||
extern UInt32 kZip64EndOfCentralDirLocator;
|
||||
|
||||
static const UINT32 kMarkerSize = 4;
|
||||
static const UInt32 kMarkerSize = 4;
|
||||
}
|
||||
|
||||
const UInt32 kZip64EndOfCentralDirRecordSize = 44;
|
||||
|
||||
/*
|
||||
struct CEndOfCentralDirectoryRecord
|
||||
{
|
||||
UINT16 ThisDiskNumber;
|
||||
UINT16 StartCentralDirectoryDiskNumber;
|
||||
UINT16 NumEntriesInCentaralDirectoryOnThisDisk;
|
||||
UINT16 NumEntriesInCentaralDirectory;
|
||||
UINT32 CentralDirectorySize;
|
||||
UINT32 CentralDirectoryStartOffset;
|
||||
UINT16 CommentSize;
|
||||
UInt16 ThisDiskNumber;
|
||||
UInt16 StartCentralDirectoryDiskNumber;
|
||||
UInt16 NumEntriesInCentaralDirectoryOnThisDisk;
|
||||
UInt16 NumEntriesInCentaralDirectory;
|
||||
UInt32 CentralDirectorySize;
|
||||
UInt32 CentralDirectoryStartOffset;
|
||||
UInt16 CommentSize;
|
||||
};
|
||||
|
||||
struct CEndOfCentralDirectoryRecordFull
|
||||
{
|
||||
UINT32 Signature;
|
||||
UInt32 Signature;
|
||||
CEndOfCentralDirectoryRecord Header;
|
||||
};
|
||||
*/
|
||||
|
||||
namespace NFileHeader
|
||||
{
|
||||
/*
|
||||
struct CVersion
|
||||
{
|
||||
BYTE Version;
|
||||
BYTE HostOS;
|
||||
Byte Version;
|
||||
Byte HostOS;
|
||||
};
|
||||
*/
|
||||
|
||||
namespace NCompressionMethod
|
||||
{
|
||||
@@ -67,67 +70,76 @@ namespace NFileHeader
|
||||
kBZip2 = 12
|
||||
};
|
||||
const int kNumCompressionMethods = 11;
|
||||
const BYTE kMadeByProgramVersion = 20;
|
||||
const Byte kMadeByProgramVersion = 20;
|
||||
|
||||
const BYTE kDeflateExtractVersion = 20;
|
||||
const BYTE kStoreExtractVersion = 10;
|
||||
const Byte kDeflateExtractVersion = 20;
|
||||
const Byte kStoreExtractVersion = 10;
|
||||
|
||||
const BYTE kSupportedVersion = 20;
|
||||
const Byte kSupportedVersion = 20;
|
||||
}
|
||||
|
||||
const UInt32 kLocalBlockSize = 26;
|
||||
/*
|
||||
struct CLocalBlock
|
||||
{
|
||||
CVersion ExtractVersion;
|
||||
|
||||
UINT16 Flags;
|
||||
UINT16 CompressionMethod;
|
||||
UINT32 Time;
|
||||
UINT32 FileCRC;
|
||||
UINT32 PackSize;
|
||||
UINT32 UnPackSize;
|
||||
UINT16 NameSize;
|
||||
UINT16 ExtraSize;
|
||||
UInt16 Flags;
|
||||
UInt16 CompressionMethod;
|
||||
UInt32 Time;
|
||||
UInt32 FileCRC;
|
||||
UInt32 PackSize;
|
||||
UInt32 UnPackSize;
|
||||
UInt16 NameSize;
|
||||
UInt16 ExtraSize;
|
||||
};
|
||||
*/
|
||||
|
||||
const UInt32 kDataDescriptorSize = 16;
|
||||
/*
|
||||
struct CDataDescriptor
|
||||
{
|
||||
UINT32 Signature;
|
||||
UINT32 FileCRC;
|
||||
UINT32 PackSize;
|
||||
UINT32 UnPackSize;
|
||||
UInt32 Signature;
|
||||
UInt32 FileCRC;
|
||||
UInt32 PackSize;
|
||||
UInt32 UnPackSize;
|
||||
};
|
||||
|
||||
struct CLocalBlockFull
|
||||
{
|
||||
UINT32 Signature;
|
||||
UInt32 Signature;
|
||||
CLocalBlock Header;
|
||||
};
|
||||
*/
|
||||
|
||||
const UInt32 kCentralBlockSize = 42;
|
||||
/*
|
||||
struct CBlock
|
||||
{
|
||||
CVersion MadeByVersion;
|
||||
CVersion ExtractVersion;
|
||||
UINT16 Flags;
|
||||
UINT16 CompressionMethod;
|
||||
UINT32 Time;
|
||||
UINT32 FileCRC;
|
||||
UINT32 PackSize;
|
||||
UINT32 UnPackSize;
|
||||
UINT16 NameSize;
|
||||
UINT16 ExtraSize;
|
||||
UINT16 CommentSize;
|
||||
UINT16 DiskNumberStart;
|
||||
UINT16 InternalAttributes;
|
||||
UINT32 ExternalAttributes;
|
||||
UINT32 LocalHeaderOffset;
|
||||
UInt16 Flags;
|
||||
UInt16 CompressionMethod;
|
||||
UInt32 Time;
|
||||
UInt32 FileCRC;
|
||||
UInt32 PackSize;
|
||||
UInt32 UnPackSize;
|
||||
UInt16 NameSize;
|
||||
UInt16 ExtraSize;
|
||||
UInt16 CommentSize;
|
||||
UInt16 DiskNumberStart;
|
||||
UInt16 InternalAttributes;
|
||||
UInt32 ExternalAttributes;
|
||||
UInt32 LocalHeaderOffset;
|
||||
};
|
||||
|
||||
struct CBlockFull
|
||||
{
|
||||
UINT32 Signature;
|
||||
UInt32 Signature;
|
||||
CBlock Header;
|
||||
};
|
||||
|
||||
*/
|
||||
|
||||
namespace NFlags
|
||||
{
|
||||
const int kNumUsedBits = 4;
|
||||
@@ -175,53 +187,50 @@ namespace NFileHeader
|
||||
}
|
||||
namespace NUnixAttribute
|
||||
{
|
||||
const UINT32 kIFMT = 0170000; /* Unix file type mask */
|
||||
const UInt32 kIFMT = 0170000; /* Unix file type mask */
|
||||
|
||||
const UINT32 kIFDIR = 0040000; /* Unix directory */
|
||||
const UINT32 kIFREG = 0100000; /* Unix regular file */
|
||||
const UINT32 kIFSOCK = 0140000; /* Unix socket (BSD, not SysV or Amiga) */
|
||||
const UINT32 kIFLNK = 0120000; /* Unix symbolic link (not SysV, Amiga) */
|
||||
const UINT32 kIFBLK = 0060000; /* Unix block special (not Amiga) */
|
||||
const UINT32 kIFCHR = 0020000; /* Unix character special (not Amiga) */
|
||||
const UINT32 kIFIFO = 0010000; /* Unix fifo (BCC, not MSC or Amiga) */
|
||||
const UInt32 kIFDIR = 0040000; /* Unix directory */
|
||||
const UInt32 kIFREG = 0100000; /* Unix regular file */
|
||||
const UInt32 kIFSOCK = 0140000; /* Unix socket (BSD, not SysV or Amiga) */
|
||||
const UInt32 kIFLNK = 0120000; /* Unix symbolic link (not SysV, Amiga) */
|
||||
const UInt32 kIFBLK = 0060000; /* Unix block special (not Amiga) */
|
||||
const UInt32 kIFCHR = 0020000; /* Unix character special (not Amiga) */
|
||||
const UInt32 kIFIFO = 0010000; /* Unix fifo (BCC, not MSC or Amiga) */
|
||||
|
||||
const UINT32 kISUID = 04000; /* Unix set user id on execution */
|
||||
const UINT32 kISGID = 02000; /* Unix set group id on execution */
|
||||
const UINT32 kISVTX = 01000; /* Unix directory permissions control */
|
||||
const UINT32 kENFMT = kISGID; /* Unix record locking enforcement flag */
|
||||
const UINT32 kIRWXU = 00700; /* Unix read, write, execute: owner */
|
||||
const UINT32 kIRUSR = 00400; /* Unix read permission: owner */
|
||||
const UINT32 kIWUSR = 00200; /* Unix write permission: owner */
|
||||
const UINT32 kIXUSR = 00100; /* Unix execute permission: owner */
|
||||
const UINT32 kIRWXG = 00070; /* Unix read, write, execute: group */
|
||||
const UINT32 kIRGRP = 00040; /* Unix read permission: group */
|
||||
const UINT32 kIWGRP = 00020; /* Unix write permission: group */
|
||||
const UINT32 kIXGRP = 00010; /* Unix execute permission: group */
|
||||
const UINT32 kIRWXO = 00007; /* Unix read, write, execute: other */
|
||||
const UINT32 kIROTH = 00004; /* Unix read permission: other */
|
||||
const UINT32 kIWOTH = 00002; /* Unix write permission: other */
|
||||
const UINT32 kIXOTH = 00001; /* Unix execute permission: other */
|
||||
const UInt32 kISUID = 04000; /* Unix set user id on execution */
|
||||
const UInt32 kISGID = 02000; /* Unix set group id on execution */
|
||||
const UInt32 kISVTX = 01000; /* Unix directory permissions control */
|
||||
const UInt32 kENFMT = kISGID; /* Unix record locking enforcement flag */
|
||||
const UInt32 kIRWXU = 00700; /* Unix read, write, execute: owner */
|
||||
const UInt32 kIRUSR = 00400; /* Unix read permission: owner */
|
||||
const UInt32 kIWUSR = 00200; /* Unix write permission: owner */
|
||||
const UInt32 kIXUSR = 00100; /* Unix execute permission: owner */
|
||||
const UInt32 kIRWXG = 00070; /* Unix read, write, execute: group */
|
||||
const UInt32 kIRGRP = 00040; /* Unix read permission: group */
|
||||
const UInt32 kIWGRP = 00020; /* Unix write permission: group */
|
||||
const UInt32 kIXGRP = 00010; /* Unix execute permission: group */
|
||||
const UInt32 kIRWXO = 00007; /* Unix read, write, execute: other */
|
||||
const UInt32 kIROTH = 00004; /* Unix read permission: other */
|
||||
const UInt32 kIWOTH = 00002; /* Unix write permission: other */
|
||||
const UInt32 kIXOTH = 00001; /* Unix execute permission: other */
|
||||
}
|
||||
|
||||
namespace NAmigaAttribute
|
||||
{
|
||||
const UINT32 kIFMT = 06000; /* Amiga file type mask */
|
||||
const UINT32 kIFDIR = 04000; /* Amiga directory */
|
||||
const UINT32 kIFREG = 02000; /* Amiga regular file */
|
||||
const UINT32 kIHIDDEN = 00200; /* to be supported in AmigaDOS 3.x */
|
||||
const UINT32 kISCRIPT = 00100; /* executable script (text command file) */
|
||||
const UINT32 kIPURE = 00040; /* allow loading into resident memory */
|
||||
const UINT32 kIARCHIVE = 00020; /* not modified since bit was last set */
|
||||
const UINT32 kIREAD = 00010; /* can be opened for reading */
|
||||
const UINT32 kIWRITE = 00004; /* can be opened for writing */
|
||||
const UINT32 kIEXECUTE = 00002; /* executable image, a loadable runfile */
|
||||
const UINT32 kIDELETE = 00001; /* can be deleted */
|
||||
const UInt32 kIFMT = 06000; /* Amiga file type mask */
|
||||
const UInt32 kIFDIR = 04000; /* Amiga directory */
|
||||
const UInt32 kIFREG = 02000; /* Amiga regular file */
|
||||
const UInt32 kIHIDDEN = 00200; /* to be supported in AmigaDOS 3.x */
|
||||
const UInt32 kISCRIPT = 00100; /* executable script (text command file) */
|
||||
const UInt32 kIPURE = 00040; /* allow loading into resident memory */
|
||||
const UInt32 kIARCHIVE = 00020; /* not modified since bit was last set */
|
||||
const UInt32 kIREAD = 00010; /* can be opened for reading */
|
||||
const UInt32 kIWRITE = 00004; /* can be opened for writing */
|
||||
const UInt32 kIEXECUTE = 00002; /* executable image, a loadable runfile */
|
||||
const UInt32 kIDELETE = 00001; /* can be deleted */
|
||||
}
|
||||
}
|
||||
|
||||
#pragma pack(pop)
|
||||
#pragma pack(pop, PragmaZipHeaders)
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user