1 /* 7z.h -- 7z interface
2 2010-03-11 : Igor Pavlov : Public domain */
11 #define k7zStartHeaderSize 0x20
12 #define k7zSignatureSize 6
13 extern Byte k7zSignature
[k7zSignatureSize
];
14 #define k7zMajorVersion 0
20 k7zIdArchiveProperties
,
21 k7zIdAdditionalStreamsInfo
,
30 k7zIdCodersUnpackSize
,
54 void SzCoderInfo_Init(CSzCoderInfo
*p
);
55 void SzCoderInfo_Free(CSzCoderInfo
*p
, ISzAlloc
*alloc
);
66 CSzBindPair
*BindPairs
;
71 UInt32 NumPackStreams
;
75 UInt32 NumUnpackStreams
;
78 void SzFolder_Init(CSzFolder
*p
);
79 UInt64
SzFolder_GetUnpackSize(CSzFolder
*p
);
80 int SzFolder_FindBindPairForInStream(CSzFolder
*p
, UInt32 inStreamIndex
);
81 UInt32
SzFolder_GetNumOutStreams(CSzFolder
*p
);
82 UInt64
SzFolder_GetUnpackSize(CSzFolder
*p
);
84 SRes
SzFolder_Decode(const CSzFolder
*folder
, const UInt64
*packSizes
,
85 ILookInStream
*stream
, UInt64 startPos
,
86 Byte
*outBuffer
, size_t outSize
, ISzAlloc
*allocMain
);
108 void SzFile_Init(CSzFileItem
*p
);
113 Byte
*PackCRCsDefined
;
117 UInt32 NumPackStreams
;
122 void SzAr_Init(CSzAr
*p
);
123 void SzAr_Free(CSzAr
*p
, ISzAlloc
*alloc
);
127 SzExtract extracts file from archive
129 *outBuffer must be 0 before first call for each new archive.
132 If you need to decompress more than one file, you can send
133 these values from previous call:
137 You can consider "*outBuffer" as cache of solid block. If your archive is solid,
138 it will increase decompression speed.
140 If you use external function, you can declare these 3 cache variables
141 (blockIndex, outBuffer, outBufferSize) as static in that external function.
143 Free *outBuffer and set *outBuffer to 0, if you want to flush cache.
150 UInt64 startPosAfterHeader
;
153 UInt32
*FolderStartPackStreamIndex
;
154 UInt64
*PackStreamStartPositions
;
155 UInt32
*FolderStartFileIndex
;
156 UInt32
*FileIndexToFolderIndexMap
;
158 size_t *FileNameOffsets
; /* in 2-byte steps */
159 CBuf FileNames
; /* UTF-16-LE */
162 void SzArEx_Init(CSzArEx
*p
);
163 void SzArEx_Free(CSzArEx
*p
, ISzAlloc
*alloc
);
164 UInt64
SzArEx_GetFolderStreamPos(const CSzArEx
*p
, UInt32 folderIndex
, UInt32 indexInFolder
);
165 int SzArEx_GetFolderFullPackSize(const CSzArEx
*p
, UInt32 folderIndex
, UInt64
*resSize
);
168 if dest == NULL, the return value specifies the required size of the buffer,
169 in 16-bit characters, including the null-terminating character.
170 if dest != NULL, the return value specifies the number of 16-bit characters that
171 are written to the dest, including the null-terminating character. */
173 size_t SzArEx_GetFileNameUtf16(const CSzArEx
*p
, size_t fileIndex
, UInt16
*dest
);
177 ILookInStream
*inStream
,
178 UInt32 fileIndex
, /* index of file */
179 UInt32
*blockIndex
, /* index of solid block */
180 Byte
**outBuffer
, /* pointer to pointer to output buffer (allocated with allocMain) */
181 size_t *outBufferSize
, /* buffer size for output buffer */
182 size_t *offset
, /* offset of stream for required file in *outBuffer */
183 size_t *outSizeProcessed
, /* size of file in *outBuffer */
185 ISzAlloc
*allocTemp
);
199 SRes
SzArEx_Open(CSzArEx
*p
, ILookInStream
*inStream
, ISzAlloc
*allocMain
, ISzAlloc
*allocTemp
);