]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/LzmaDec.h
IntelFrameworkModulePkg Lzma: Update LZMA SDK version to 18.05
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / LzmaCustomDecompressLib / Sdk / C / LzmaDec.h
index 2633abeac9db432a032c28083ed0382e1ad1826b..28ce60c3ea94eedd628e7e43faecf9b6259d74ae 100644 (file)
@@ -1,5 +1,5 @@
 /* LzmaDec.h -- LZMA Decoder\r
-2013-01-18 : Igor Pavlov : Public domain */\r
+2018-04-21 : Igor Pavlov : Public domain */\r
 \r
 #ifndef __LZMA_DEC_H\r
 #define __LZMA_DEC_H\r
@@ -12,11 +12,13 @@ EXTERN_C_BEGIN
 /* _LZMA_PROB32 can increase the speed on some CPUs,\r
    but memory usage for CLzmaDec::probs will be doubled in that case */\r
 \r
+typedef\r
 #ifdef _LZMA_PROB32\r
-#define CLzmaProb UInt32\r
+  UInt32\r
 #else\r
-#define CLzmaProb UInt16\r
+  UInt16\r
 #endif\r
+  CLzmaProb;\r
 \r
 \r
 /* ---------- LZMA Properties ---------- */\r
@@ -25,7 +27,10 @@ EXTERN_C_BEGIN
 \r
 typedef struct _CLzmaProps\r
 {\r
-  unsigned lc, lp, pb;\r
+  Byte lc;\r
+  Byte lp;\r
+  Byte pb;\r
+  Byte _pad_;\r
   UInt32 dicSize;\r
 } CLzmaProps;\r
 \r
@@ -47,32 +52,34 @@ SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size);
 \r
 typedef struct\r
 {\r
+  /* Don't change this structure. ASM code can use it. */\r
   CLzmaProps prop;\r
   CLzmaProb *probs;\r
+  CLzmaProb *probs_1664;\r
   Byte *dic;\r
-  const Byte *buf;\r
-  UInt32 range, code;\r
-  SizeT dicPos;\r
   SizeT dicBufSize;\r
+  SizeT dicPos;\r
+  const Byte *buf;\r
+  UInt32 range;\r
+  UInt32 code;\r
   UInt32 processedPos;\r
   UInt32 checkDicSize;\r
-  unsigned state;\r
   UInt32 reps[4];\r
-  unsigned remainLen;\r
-  int needFlush;\r
-  int needInitState;\r
+  UInt32 state;\r
+  UInt32 remainLen;\r
+\r
   UInt32 numProbs;\r
   unsigned tempBufSize;\r
   Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];\r
 } CLzmaDec;\r
 \r
-#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; }\r
+#define LzmaDec_Construct(p) { (p)->dic = NULL; (p)->probs = NULL; }\r
 \r
 void LzmaDec_Init(CLzmaDec *p);\r
 \r
 /* There are two types of LZMA streams:\r
-     0) Stream with end mark. That end mark adds about 6 bytes to compressed size.\r
-     1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */\r
+     - Stream with end mark. That end mark adds about 6 bytes to compressed size.\r
+     - Stream without end mark. You must know exact uncompressed size to decompress such stream. */\r
 \r
 typedef enum\r
 {\r
@@ -129,11 +136,11 @@ LzmaDec_Allocate* can return:
   SZ_ERROR_UNSUPPORTED - Unsupported properties\r
 */\r
    \r
-SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc);\r
-void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);\r
+SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc);\r
+void LzmaDec_FreeProbs(CLzmaDec *p, ISzAllocPtr alloc);\r
 \r
-SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc);\r
-void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc);\r
+SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc);\r
+void LzmaDec_Free(CLzmaDec *p, ISzAllocPtr alloc);\r
 \r
 /* ---------- Dictionary Interface ---------- */\r
 \r
@@ -142,7 +149,7 @@ void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc);
    You must work with CLzmaDec variables directly in this interface.\r
 \r
    STEPS:\r
-     LzmaDec_Constr()\r
+     LzmaDec_Construct()\r
      LzmaDec_Allocate()\r
      for (each new stream)\r
      {\r
@@ -220,7 +227,7 @@ Returns:
 \r
 SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,\r
     const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,\r
-    ELzmaStatus *status, ISzAlloc *alloc);\r
+    ELzmaStatus *status, ISzAllocPtr alloc);\r
 \r
 EXTERN_C_END\r
 \r