| 1 | /* LzFind.h -- Match finder for LZ algorithms |
| 2 | 2008-10-04 : Igor Pavlov : Public domain */ |
| 3 | |
| 4 | #ifndef __LZFIND_H |
| 5 | #define __LZFIND_Hcxx . . $ `compression/lzma/LzFind.h:5:9`! |
| 6 | |
| 7 | #include "Types.h"cxx . . $ `<file>/compression/lzma/Types.h`/ |
| 8 | |
| 9 | typedef UInt32cxx . . $ UInt32# CLzRefcxx . . $ CLzRef#; |
| 10 | |
| 11 | typedef struct _CMatchFindercxx . . $ _CMatchFinder# |
| 12 | { |
| 13 | Bytecxx . . $ Byte# *buffercxx . . $ _CMatchFinder#buffer.; |
| 14 | UInt32cxx . . $ UInt32# poscxx . . $ _CMatchFinder#pos.; |
| 15 | UInt32cxx . . $ UInt32# posLimitcxx . . $ _CMatchFinder#posLimit.; |
| 16 | UInt32cxx . . $ UInt32# streamPoscxx . . $ _CMatchFinder#streamPos.; |
| 17 | UInt32cxx . . $ UInt32# lenLimitcxx . . $ _CMatchFinder#lenLimit.; |
| 18 | |
| 19 | UInt32cxx . . $ UInt32# cyclicBufferPoscxx . . $ _CMatchFinder#cyclicBufferPos.; |
| 20 | UInt32cxx . . $ UInt32# cyclicBufferSizecxx . . $ _CMatchFinder#cyclicBufferSize.; /* it must be = (historySize + 1) */ |
| 21 | |
| 22 | UInt32cxx . . $ UInt32# matchMaxLencxx . . $ _CMatchFinder#matchMaxLen.; |
| 23 | CLzRefcxx . . $ CLzRef# *hashcxx . . $ _CMatchFinder#hash.; |
| 24 | CLzRefcxx . . $ CLzRef# *soncxx . . $ _CMatchFinder#son.; |
| 25 | UInt32cxx . . $ UInt32# hashMaskcxx . . $ _CMatchFinder#hashMask.; |
| 26 | UInt32cxx . . $ UInt32# cutValuecxx . . $ _CMatchFinder#cutValue.; |
| 27 | |
| 28 | Bytecxx . . $ Byte# *bufferBasecxx . . $ _CMatchFinder#bufferBase.; |
| 29 | ISeqInStreamcxx . . $ ISeqInStream# *streamcxx . . $ _CMatchFinder#stream.; |
| 30 | int streamEndWasReachedcxx . . $ _CMatchFinder#streamEndWasReached.; |
| 31 | |
| 32 | UInt32cxx . . $ UInt32# blockSizecxx . . $ _CMatchFinder#blockSize.; |
| 33 | UInt32cxx . . $ UInt32# keepSizeBeforecxx . . $ _CMatchFinder#keepSizeBefore.; |
| 34 | UInt32cxx . . $ UInt32# keepSizeAftercxx . . $ _CMatchFinder#keepSizeAfter.; |
| 35 | |
| 36 | UInt32cxx . . $ UInt32# numHashBytescxx . . $ _CMatchFinder#numHashBytes.; |
| 37 | int directInputcxx . . $ _CMatchFinder#directInput.; |
| 38 | int btModecxx . . $ _CMatchFinder#btMode.; |
| 39 | /* int skipModeBits; */ |
| 40 | int bigHashcxx . . $ _CMatchFinder#bigHash.; |
| 41 | UInt32cxx . . $ UInt32# historySizecxx . . $ _CMatchFinder#historySize.; |
| 42 | UInt32cxx . . $ UInt32# fixedHashSizecxx . . $ _CMatchFinder#fixedHashSize.; |
| 43 | UInt32cxx . . $ UInt32# hashSizeSumcxx . . $ _CMatchFinder#hashSizeSum.; |
| 44 | UInt32cxx . . $ UInt32# numSonscxx . . $ _CMatchFinder#numSons.; |
| 45 | SRescxx . . $ SRes# resultcxx . . $ _CMatchFinder#result.; |
| 46 | UInt32cxx . . $ UInt32# crccxx . . $ _CMatchFinder#crc.[256]; |
| 47 | } CMatchFindercxx . . $ CMatchFinder#; |
| 48 | |
| 49 | #define Inline_MatchFinder_GetPointerToCurrentPoscxx . . $ `compression/lzma/LzFind.h:49:9`!(p) ((p)->buffer) |
| 50 | #define Inline_MatchFinder_GetIndexBytecxx . . $ `compression/lzma/LzFind.h:50:9`!(p, index) ((p)->buffer[(Int32)(index)]) |
| 51 | |
| 52 | #define Inline_MatchFinder_GetNumAvailableBytescxx . . $ `compression/lzma/LzFind.h:52:9`!(p) ((p)->streamPos - (p)->pos) |
| 53 | |
| 54 | int MatchFinder_NeedMovecxx . . $ MatchFinder_NeedMove(87dc8614b8a2e982).(CMatchFindercxx . . $ CMatchFinder# *p); |
| 55 | Bytecxx . . $ Byte# *MatchFinder_GetPointerToCurrentPoscxx . . $ MatchFinder_GetPointerToCurrentPos(150d404b98f9b8cc).(CMatchFindercxx . . $ CMatchFinder# *p); |
| 56 | void MatchFinder_MoveBlockcxx . . $ MatchFinder_MoveBlock(3e1b07d4842a3f23).(CMatchFindercxx . . $ CMatchFinder# *p); |
| 57 | void MatchFinder_ReadIfRequiredcxx . . $ MatchFinder_ReadIfRequired(3e1b07d4842a3f23).(CMatchFindercxx . . $ CMatchFinder# *p); |
| 58 | |
| 59 | void MatchFinder_Constructcxx . . $ MatchFinder_Construct(3e1b07d4842a3f23).(CMatchFindercxx . . $ CMatchFinder# *p); |
| 60 | |
| 61 | /* Conditions: |
| 62 | historySize <= 3 GB |
| 63 | keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB |
| 64 | */ |
| 65 | int MatchFinder_Createcxx . . $ MatchFinder_Create(64a49c537c4f0f0e).(CMatchFindercxx . . $ CMatchFinder# *p, UInt32cxx . . $ UInt32# historySize, |
| 66 | UInt32cxx . . $ UInt32# keepAddBufferBefore, UInt32cxx . . $ UInt32# matchMaxLen, UInt32cxx . . $ UInt32# keepAddBufferAfter, |
| 67 | ISzAlloccxx . . $ ISzAlloc# *alloc); |
| 68 | void MatchFinder_Freecxx . . $ MatchFinder_Free(e0c953fe8ccde46b).(CMatchFindercxx . . $ CMatchFinder# *p, ISzAlloccxx . . $ ISzAlloc# *alloc); |
| 69 | void MatchFinder_Normalize3cxx . . $ MatchFinder_Normalize3(c10dd20a1588328c).(UInt32cxx . . $ UInt32# subValue, CLzRefcxx . . $ CLzRef# *items, UInt32cxx . . $ UInt32# numItems); |
| 70 | void MatchFinder_ReduceOffsetscxx . . $ MatchFinder_ReduceOffsets(67dd09548828b5be).(CMatchFindercxx . . $ CMatchFinder# *p, UInt32cxx . . $ UInt32# subValue); |
| 71 | |
| 72 | UInt32cxx . . $ UInt32# * GetMatchesSpec1cxx . . $ GetMatchesSpec1(9d97788ecf2d29c4).(UInt32cxx . . $ UInt32# lenLimit, UInt32cxx . . $ UInt32# curMatch, UInt32cxx . . $ UInt32# pos, const Bytecxx . . $ Byte# *buffer, CLzRefcxx . . $ CLzRef# *son, |
| 73 | UInt32cxx . . $ UInt32# _cyclicBufferPos, UInt32cxx . . $ UInt32# _cyclicBufferSize, UInt32cxx . . $ UInt32# _cutValue, |
| 74 | UInt32cxx . . $ UInt32# *distances, UInt32cxx . . $ UInt32# maxLen); |
| 75 | |
| 76 | /* |
| 77 | Conditions: |
| 78 | Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func. |
| 79 | Mf_GetPointerToCurrentPos_Func's result must be used only before any other function |
| 80 | */ |
| 81 | |
| 82 | typedef void (*Mf_Init_Funccxx . . $ Mf_Init_Func#)(void *object); |
| 83 | typedef Bytecxx . . $ Byte# (*Mf_GetIndexByte_Funccxx . . $ Mf_GetIndexByte_Func#)(void *object, Int32cxx . . $ Int32# index); |
| 84 | typedef UInt32cxx . . $ UInt32# (*Mf_GetNumAvailableBytes_Funccxx . . $ Mf_GetNumAvailableBytes_Func#)(void *object); |
| 85 | typedef const Bytecxx . . $ Byte# * (*Mf_GetPointerToCurrentPos_Funccxx . . $ Mf_GetPointerToCurrentPos_Func#)(void *object); |
| 86 | typedef UInt32cxx . . $ UInt32# (*Mf_GetMatches_Funccxx . . $ Mf_GetMatches_Func#)(void *object, UInt32cxx . . $ UInt32# *distances); |
| 87 | typedef void (*Mf_Skip_Funccxx . . $ Mf_Skip_Func#)(void *object, UInt32cxx . . $ UInt32#); |
| 88 | |
| 89 | typedef struct _IMatchFindercxx . . $ _IMatchFinder# |
| 90 | { |
| 91 | Mf_Init_Funccxx . . $ Mf_Init_Func# Initcxx . . $ _IMatchFinder#Init.; |
| 92 | Mf_GetIndexByte_Funccxx . . $ Mf_GetIndexByte_Func# GetIndexBytecxx . . $ _IMatchFinder#GetIndexByte.; |
| 93 | Mf_GetNumAvailableBytes_Funccxx . . $ Mf_GetNumAvailableBytes_Func# GetNumAvailableBytescxx . . $ _IMatchFinder#GetNumAvailableBytes.; |
| 94 | Mf_GetPointerToCurrentPos_Funccxx . . $ Mf_GetPointerToCurrentPos_Func# GetPointerToCurrentPoscxx . . $ _IMatchFinder#GetPointerToCurrentPos.; |
| 95 | Mf_GetMatches_Funccxx . . $ Mf_GetMatches_Func# GetMatchescxx . . $ _IMatchFinder#GetMatches.; |
| 96 | Mf_Skip_Funccxx . . $ Mf_Skip_Func# Skipcxx . . $ _IMatchFinder#Skip.; |
| 97 | } IMatchFindercxx . . $ IMatchFinder#; |
| 98 | |
| 99 | void MatchFinder_CreateVTablecxx . . $ MatchFinder_CreateVTable(e9ccc59caa59e7a6).(CMatchFindercxx . . $ CMatchFinder# *p, IMatchFindercxx . . $ IMatchFinder# *vTable); |
| 100 | |
| 101 | void MatchFinder_Initcxx . . $ MatchFinder_Init(3e1b07d4842a3f23).(CMatchFindercxx . . $ CMatchFinder# *p); |
| 102 | UInt32cxx . . $ UInt32# Bt3Zip_MatchFinder_GetMatchescxx . . $ Bt3Zip_MatchFinder_GetMatches(243791520f511704).(CMatchFindercxx . . $ CMatchFinder# *p, UInt32cxx . . $ UInt32# *distances); |
| 103 | UInt32cxx . . $ UInt32# Hc3Zip_MatchFinder_GetMatchescxx . . $ Hc3Zip_MatchFinder_GetMatches(243791520f511704).(CMatchFindercxx . . $ CMatchFinder# *p, UInt32cxx . . $ UInt32# *distances); |
| 104 | void Bt3Zip_MatchFinder_Skipcxx . . $ Bt3Zip_MatchFinder_Skip(67dd09548828b5be).(CMatchFindercxx . . $ CMatchFinder# *p, UInt32cxx . . $ UInt32# num); |
| 105 | void Hc3Zip_MatchFinder_Skipcxx . . $ Hc3Zip_MatchFinder_Skip(67dd09548828b5be).(CMatchFindercxx . . $ CMatchFinder# *p, UInt32cxx . . $ UInt32# num); |
| 106 | |
| 107 | #endif |