| Index: third_party/lzma_sdk/LzFind.h
|
| diff --git a/third_party/lzma_sdk/LzFind.h b/third_party/lzma_sdk/LzFind.h
|
| index 010c4b92ba337fef8861c7245a367cbfa920680b..d119944f44531ca55d1befaec71e64953689607f 100644
|
| --- a/third_party/lzma_sdk/LzFind.h
|
| +++ b/third_party/lzma_sdk/LzFind.h
|
| @@ -1,14 +1,12 @@
|
| /* LzFind.h -- Match finder for LZ algorithms
|
| -2009-04-22 : Igor Pavlov : Public domain */
|
| +2015-10-15 : Igor Pavlov : Public domain */
|
|
|
| #ifndef __LZ_FIND_H
|
| #define __LZ_FIND_H
|
|
|
| -#include "Types.h"
|
| +#include "7zTypes.h"
|
|
|
| -#ifdef __cplusplus
|
| -extern "C" {
|
| -#endif
|
| +EXTERN_C_BEGIN
|
|
|
| typedef UInt32 CLzRef;
|
|
|
| @@ -23,6 +21,11 @@ typedef struct _CMatchFinder
|
| UInt32 cyclicBufferPos;
|
| UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */
|
|
|
| + Byte streamEndWasReached;
|
| + Byte btMode;
|
| + Byte bigHash;
|
| + Byte directInput;
|
| +
|
| UInt32 matchMaxLen;
|
| CLzRef *hash;
|
| CLzRef *son;
|
| @@ -31,30 +34,30 @@ typedef struct _CMatchFinder
|
|
|
| Byte *bufferBase;
|
| ISeqInStream *stream;
|
| - int streamEndWasReached;
|
| -
|
| +
|
| UInt32 blockSize;
|
| UInt32 keepSizeBefore;
|
| UInt32 keepSizeAfter;
|
|
|
| UInt32 numHashBytes;
|
| - int directInput;
|
| size_t directInputRem;
|
| - int btMode;
|
| - int bigHash;
|
| UInt32 historySize;
|
| UInt32 fixedHashSize;
|
| UInt32 hashSizeSum;
|
| - UInt32 numSons;
|
| SRes result;
|
| UInt32 crc[256];
|
| + size_t numRefs;
|
| } CMatchFinder;
|
|
|
| #define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer)
|
| -#define Inline_MatchFinder_GetIndexByte(p, index) ((p)->buffer[(Int32)(index)])
|
|
|
| #define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos)
|
|
|
| +#define Inline_MatchFinder_IsFinishedOK(p) \
|
| + ((p)->streamEndWasReached \
|
| + && (p)->streamPos == (p)->pos \
|
| + && (!(p)->directInput || (p)->directInputRem == 0))
|
| +
|
| int MatchFinder_NeedMove(CMatchFinder *p);
|
| Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p);
|
| void MatchFinder_MoveBlock(CMatchFinder *p);
|
| @@ -70,7 +73,7 @@ int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
|
| UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
|
| ISzAlloc *alloc);
|
| void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc);
|
| -void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems);
|
| +void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, size_t numItems);
|
| void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue);
|
|
|
| UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son,
|
| @@ -84,7 +87,6 @@ Conditions:
|
| */
|
|
|
| typedef void (*Mf_Init_Func)(void *object);
|
| -typedef Byte (*Mf_GetIndexByte_Func)(void *object, Int32 index);
|
| typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object);
|
| typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object);
|
| typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances);
|
| @@ -93,7 +95,6 @@ typedef void (*Mf_Skip_Func)(void *object, UInt32);
|
| typedef struct _IMatchFinder
|
| {
|
| Mf_Init_Func Init;
|
| - Mf_GetIndexByte_Func GetIndexByte;
|
| Mf_GetNumAvailableBytes_Func GetNumAvailableBytes;
|
| Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos;
|
| Mf_GetMatches_Func GetMatches;
|
| @@ -102,14 +103,15 @@ typedef struct _IMatchFinder
|
|
|
| void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable);
|
|
|
| +void MatchFinder_Init_2(CMatchFinder *p, int readData);
|
| void MatchFinder_Init(CMatchFinder *p);
|
| +
|
| UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
|
| UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
|
| +
|
| void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
|
| void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
|
|
|
| -#ifdef __cplusplus
|
| -}
|
| -#endif
|
| +EXTERN_C_END
|
|
|
| #endif
|
|
|