]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/LzmaDec.h
MdeModulePkg: Apply uncrustify changes
[mirror_edk2.git] / MdeModulePkg / Library / LzmaCustomDecompressLib / Sdk / C / LzmaDec.h
index ebc568cb4ff44e21d43828a417518e033fa0b20b..11f028876f532c318b3be73af1fde1107da082a9 100644 (file)
@@ -9,6 +9,7 @@
 EXTERN_C_BEGIN\r
 \r
 /* #define _LZMA_PROB32 */\r
+\r
 /* _LZMA_PROB32 can increase the speed on some CPUs,\r
    but memory usage for CLzmaDec::probs will be doubled in that case */\r
 \r
@@ -20,18 +21,16 @@ typedef
 #endif\r
   CLzmaProb;\r
 \r
-\r
 /* ---------- LZMA Properties ---------- */\r
 \r
-#define LZMA_PROPS_SIZE 5\r
+#define LZMA_PROPS_SIZE  5\r
 \r
-typedef struct _CLzmaProps\r
-{\r
-  Byte lc;\r
-  Byte lp;\r
-  Byte pb;\r
-  Byte _pad_;\r
-  UInt32 dicSize;\r
+typedef struct _CLzmaProps {\r
+  Byte      lc;\r
+  Byte      lp;\r
+  Byte      pb;\r
+  Byte      _pad_;\r
+  UInt32    dicSize;\r
 } CLzmaProps;\r
 \r
 /* LzmaProps_Decode - decodes properties\r
@@ -40,49 +39,54 @@ Returns:
   SZ_ERROR_UNSUPPORTED - Unsupported properties\r
 */\r
 \r
-SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size);\r
-\r
+SRes\r
+LzmaProps_Decode (\r
+  CLzmaProps  *p,\r
+  const Byte  *data,\r
+  unsigned    size\r
+  );\r
 \r
 /* ---------- LZMA Decoder state ---------- */\r
 \r
 /* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case.\r
    Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */\r
 \r
-#define LZMA_REQUIRED_INPUT_MAX 20\r
+#define LZMA_REQUIRED_INPUT_MAX  20\r
 \r
-typedef struct\r
-{\r
+typedef struct {\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
-  SizeT dicBufSize;\r
-  SizeT dicPos;\r
-  const Byte *buf;\r
-  UInt32 range;\r
-  UInt32 code;\r
-  UInt32 processedPos;\r
-  UInt32 checkDicSize;\r
-  UInt32 reps[4];\r
-  UInt32 state;\r
-  UInt32 remainLen;\r
-\r
-  UInt32 numProbs;\r
-  unsigned tempBufSize;\r
-  Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];\r
+  CLzmaProps    prop;\r
+  CLzmaProb     *probs;\r
+  CLzmaProb     *probs_1664;\r
+  Byte          *dic;\r
+  SizeT         dicBufSize;\r
+  SizeT         dicPos;\r
+  const Byte    *buf;\r
+  UInt32        range;\r
+  UInt32        code;\r
+  UInt32        processedPos;\r
+  UInt32        checkDicSize;\r
+  UInt32        reps[4];\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 = NULL; (p)->probs = NULL; }\r
+#define LzmaDec_Construct(p)  { (p)->dic = NULL; (p)->probs = NULL; }\r
 \r
-void LzmaDec_Init(CLzmaDec *p);\r
+void\r
+LzmaDec_Init (\r
+  CLzmaDec  *p\r
+  );\r
 \r
 /* There are two types of LZMA streams:\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
+typedef enum {\r
   LZMA_FINISH_ANY,   /* finish at any point */\r
   LZMA_FINISH_END    /* block must be finished at the end */\r
 } ELzmaFinishMode;\r
@@ -102,8 +106,7 @@ typedef enum
      3) Check that output(srcLen) = compressedSize, if you know real compressedSize.\r
         You must use correct finish mode in that case. */\r
 \r
-typedef enum\r
-{\r
+typedef enum {\r
   LZMA_STATUS_NOT_SPECIFIED,               /* use main error code instead */\r
   LZMA_STATUS_FINISHED_WITH_MARK,          /* stream was finished with end mark. */\r
   LZMA_STATUS_NOT_FINISHED,                /* stream was not finished */\r
@@ -113,7 +116,6 @@ typedef enum
 \r
 /* ELzmaStatus is used only as output value for function call */\r
 \r
-\r
 /* ---------- Interfaces ---------- */\r
 \r
 /* There are 3 levels of interfaces:\r
@@ -123,7 +125,6 @@ typedef enum
    You can select any of these interfaces, but don't mix functions from different\r
    groups for same object. */\r
 \r
-\r
 /* There are two variants to allocate state for Dictionary Interface:\r
      1) LzmaDec_Allocate / LzmaDec_Free\r
      2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs\r
@@ -136,11 +137,33 @@ LzmaDec_Allocate* can return:
   SZ_ERROR_UNSUPPORTED - Unsupported properties\r
 */\r
 \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 *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc);\r
-void LzmaDec_Free(CLzmaDec *p, ISzAllocPtr alloc);\r
+SRes\r
+LzmaDec_AllocateProbs (\r
+  CLzmaDec     *p,\r
+  const Byte   *props,\r
+  unsigned     propsSize,\r
+  ISzAllocPtr  alloc\r
+  );\r
+\r
+void\r
+LzmaDec_FreeProbs (\r
+  CLzmaDec     *p,\r
+  ISzAllocPtr  alloc\r
+  );\r
+\r
+SRes\r
+LzmaDec_Allocate (\r
+  CLzmaDec     *p,\r
+  const Byte   *props,\r
+  unsigned     propsSize,\r
+  ISzAllocPtr  alloc\r
+  );\r
+\r
+void\r
+LzmaDec_Free (\r
+  CLzmaDec     *p,\r
+  ISzAllocPtr  alloc\r
+  );\r
 \r
 /* ---------- Dictionary Interface ---------- */\r
 \r
@@ -183,9 +206,15 @@ Returns:
   SZ_ERROR_DATA - Data error\r
 */\r
 \r
-SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,\r
-    const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);\r
-\r
+SRes\r
+LzmaDec_DecodeToDic (\r
+  CLzmaDec         *p,\r
+  SizeT            dicLimit,\r
+  const Byte       *src,\r
+  SizeT            *srcLen,\r
+  ELzmaFinishMode  finishMode,\r
+  ELzmaStatus      *status\r
+  );\r
 \r
 /* ---------- Buffer Interface ---------- */\r
 \r
@@ -200,9 +229,16 @@ finishMode:
   LZMA_FINISH_END - Stream must be finished after (*destLen).\r
 */\r
 \r
-SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,\r
-    const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);\r
-\r
+SRes\r
+LzmaDec_DecodeToBuf (\r
+  CLzmaDec         *p,\r
+  Byte             *dest,\r
+  SizeT            *destLen,\r
+  const Byte       *src,\r
+  SizeT            *srcLen,\r
+  ELzmaFinishMode  finishMode,\r
+  ELzmaStatus      *status\r
+  );\r
 \r
 /* ---------- One Call Interface ---------- */\r
 \r
@@ -225,9 +261,18 @@ Returns:
   SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).\r
 */\r
 \r
-SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,\r
-    const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,\r
-    ELzmaStatus *status, ISzAllocPtr alloc);\r
+SRes\r
+LzmaDecode (\r
+  Byte             *dest,\r
+  SizeT            *destLen,\r
+  const Byte       *src,\r
+  SizeT            *srcLen,\r
+  const Byte       *propData,\r
+  unsigned         propSize,\r
+  ELzmaFinishMode  finishMode,\r
+  ELzmaStatus      *status,\r
+  ISzAllocPtr      alloc\r
+  );\r
 \r
 EXTERN_C_END\r
 \r