#include "Precomp.h"
#include <string.h>
#include "7z.h"
#include "7zBuf.h"
#include "7zCrc.h"
#include "CpuArch.h"
#define MY_ALLOC(T, p, size, alloc) …
#define MY_ALLOC_ZE(T, p, size, alloc) …
#define MY_ALLOC_AND_CPY(to, size, from, alloc) …
#define MY_ALLOC_ZE_AND_CPY(to, size, from, alloc) …
#define k7zMajorVersion …
enum EIdEnum
{ … };
const Byte k7zSignature[k7zSignatureSize] = …;
#define SzBitUi32s_Init(p) …
static SRes SzBitUi32s_Alloc(CSzBitUi32s *p, size_t num, ISzAllocPtr alloc)
{ … }
static void SzBitUi32s_Free(CSzBitUi32s *p, ISzAllocPtr alloc)
{ … }
#define SzBitUi64s_Init(p) …
static void SzBitUi64s_Free(CSzBitUi64s *p, ISzAllocPtr alloc)
{ … }
static void SzAr_Init(CSzAr *p)
{ … }
static void SzAr_Free(CSzAr *p, ISzAllocPtr alloc)
{ … }
void SzArEx_Init(CSzArEx *p)
{ … }
void SzArEx_Free(CSzArEx *p, ISzAllocPtr alloc)
{ … }
static int TestSignatureCandidate(const Byte *testBytes)
{ … }
#define SzData_Clear(p) …
#define SZ_READ_BYTE_SD(_sd_, dest) …
#define SZ_READ_BYTE(dest) …
#define SZ_READ_BYTE_2(dest) …
#define SKIP_DATA(sd, size) …
#define SKIP_DATA2(sd, size) …
#define SZ_READ_32(dest) …
static MY_NO_INLINE SRes ReadNumber(CSzData *sd, UInt64 *value)
{ … }
static MY_NO_INLINE SRes SzReadNumber32(CSzData *sd, UInt32 *value)
{ … }
#define ReadID(sd, value) …
static SRes SkipData(CSzData *sd)
{ … }
static SRes WaitId(CSzData *sd, UInt32 id)
{ … }
static SRes RememberBitVector(CSzData *sd, UInt32 numItems, const Byte **v)
{ … }
static UInt32 CountDefinedBits(const Byte *bits, UInt32 numItems)
{ … }
static MY_NO_INLINE SRes ReadBitVector(CSzData *sd, UInt32 numItems, Byte **v, ISzAllocPtr alloc)
{ … }
static MY_NO_INLINE SRes ReadUi32s(CSzData *sd2, UInt32 numItems, CSzBitUi32s *crcs, ISzAllocPtr alloc)
{ … }
static SRes ReadBitUi32s(CSzData *sd, UInt32 numItems, CSzBitUi32s *crcs, ISzAllocPtr alloc)
{ … }
static SRes SkipBitUi32s(CSzData *sd, UInt32 numItems)
{ … }
static SRes ReadPackInfo(CSzAr *p, CSzData *sd, ISzAllocPtr alloc)
{ … }
#define k_NumCodersStreams_in_Folder_MAX …
SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd)
{ … }
static MY_NO_INLINE SRes SkipNumbers(CSzData *sd2, UInt32 num)
{ … }
#define k_Scan_NumCoders_MAX …
#define k_Scan_NumCodersStreams_in_Folder_MAX …
static SRes ReadUnpackInfo(CSzAr *p,
CSzData *sd2,
UInt32 numFoldersMax,
const CBuf *tempBufs, UInt32 numTempBufs,
ISzAllocPtr alloc)
{ … }
UInt64 SzAr_GetFolderUnpackSize(const CSzAr *p, UInt32 folderIndex)
{ … }
CSubStreamInfo;
static SRes ReadSubStreamsInfo(CSzAr *p, CSzData *sd, CSubStreamInfo *ssi)
{ … }
static SRes SzReadStreamsInfo(CSzAr *p,
CSzData *sd,
UInt32 numFoldersMax, const CBuf *tempBufs, UInt32 numTempBufs,
UInt64 *dataOffset,
CSubStreamInfo *ssi,
ISzAllocPtr alloc)
{ … }
static SRes SzReadAndDecodePackedStreams(
ILookInStream *inStream,
CSzData *sd,
CBuf *tempBufs,
UInt32 numFoldersMax,
UInt64 baseOffset,
CSzAr *p,
ISzAllocPtr allocTemp)
{ … }
static SRes SzReadFileNames(const Byte *data, size_t size, UInt32 numFiles, size_t *offsets)
{ … }
static MY_NO_INLINE SRes ReadTime(CSzBitUi64s *p, UInt32 num,
CSzData *sd2,
const CBuf *tempBufs, UInt32 numTempBufs,
ISzAllocPtr alloc)
{ … }
#define NUM_ADDITIONAL_STREAMS_MAX …
static SRes SzReadHeader2(
CSzArEx *p,
CSzData *sd,
ILookInStream *inStream,
CBuf *tempBufs, UInt32 *numTempBufs,
ISzAllocPtr allocMain,
ISzAllocPtr allocTemp
)
{ … }
static SRes SzReadHeader(
CSzArEx *p,
CSzData *sd,
ILookInStream *inStream,
ISzAllocPtr allocMain,
ISzAllocPtr allocTemp)
{ … }
static SRes SzArEx_Open2(
CSzArEx *p,
ILookInStream *inStream,
ISzAllocPtr allocMain,
ISzAllocPtr allocTemp)
{ … }
SRes SzArEx_Open(CSzArEx *p, ILookInStream *inStream,
ISzAllocPtr allocMain, ISzAllocPtr allocTemp)
{ … }
SRes SzArEx_Extract(
const CSzArEx *p,
ILookInStream *inStream,
UInt32 fileIndex,
UInt32 *blockIndex,
Byte **tempBuf,
size_t *outBufferSize,
size_t *offset,
size_t *outSizeProcessed,
ISzAllocPtr allocMain,
ISzAllocPtr allocTemp)
{ … }
size_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, UInt16 *dest)
{ … }