aboutsummaryrefslogtreecommitdiff
path: root/C/Xz.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--C/Xz.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/C/Xz.h b/C/Xz.h
index 42bc685..ad63b48 100644
--- a/C/Xz.h
+++ b/C/Xz.h
@@ -1,5 +1,5 @@
1/* Xz.h - Xz interface 1/* Xz.h - Xz interface
22024-01-26 : Igor Pavlov : Public domain */ 2Igor Pavlov : Public domain */
3 3
4#ifndef ZIP7_INC_XZ_H 4#ifndef ZIP7_INC_XZ_H
5#define ZIP7_INC_XZ_H 5#define ZIP7_INC_XZ_H
@@ -121,6 +121,7 @@ typedef struct
121 UInt64 startOffset; 121 UInt64 startOffset;
122} CXzStream; 122} CXzStream;
123 123
124#define Xz_CONSTRUCT(p) { (p)->numBlocks = 0; (p)->blocks = NULL; (p)->flags = 0; }
124void Xz_Construct(CXzStream *p); 125void Xz_Construct(CXzStream *p);
125void Xz_Free(CXzStream *p, ISzAllocPtr alloc); 126void Xz_Free(CXzStream *p, ISzAllocPtr alloc);
126 127
@@ -136,8 +137,13 @@ typedef struct
136 CXzStream *streams; 137 CXzStream *streams;
137} CXzs; 138} CXzs;
138 139
140#define Xzs_CONSTRUCT(p) { (p)->num = 0; (p)->numAllocated = 0; (p)->streams = NULL; }
139void Xzs_Construct(CXzs *p); 141void Xzs_Construct(CXzs *p);
140void Xzs_Free(CXzs *p, ISzAllocPtr alloc); 142void Xzs_Free(CXzs *p, ISzAllocPtr alloc);
143/*
144Xzs_ReadBackward() must be called for empty CXzs object.
145Xzs_ReadBackward() can return non empty object with (p->num != 0) even in case of error.
146*/
141SRes Xzs_ReadBackward(CXzs *p, ILookInStreamPtr inStream, Int64 *startOffset, ICompressProgressPtr progress, ISzAllocPtr alloc); 147SRes Xzs_ReadBackward(CXzs *p, ILookInStreamPtr inStream, Int64 *startOffset, ICompressProgressPtr progress, ISzAllocPtr alloc);
142 148
143UInt64 Xzs_GetNumBlocks(const CXzs *p); 149UInt64 Xzs_GetNumBlocks(const CXzs *p);
@@ -268,8 +274,8 @@ typedef struct
268 size_t outBufSize; 274 size_t outBufSize;
269 size_t outDataWritten; // the size of data in (outBuf) that were fully unpacked 275 size_t outDataWritten; // the size of data in (outBuf) that were fully unpacked
270 276
271 Byte shaDigest[SHA256_DIGEST_SIZE]; 277 UInt32 shaDigest32[SHA256_DIGEST_SIZE / 4];
272 Byte buf[XZ_BLOCK_HEADER_SIZE_MAX]; 278 Byte buf[XZ_BLOCK_HEADER_SIZE_MAX]; // it must be aligned for 4-bytes
273} CXzUnpacker; 279} CXzUnpacker;
274 280
275/* alloc : aligned for cache line allocation is better */ 281/* alloc : aligned for cache line allocation is better */