summaryrefslogtreecommitdiffstats
path: root/third_party/lzma_sdk/Lzma2Dec.h
diff options
context:
space:
mode:
authorbashi@chromium.org <bashi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-18 23:02:31 +0000
committerbashi@chromium.org <bashi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-18 23:02:31 +0000
commitce59605d9f7aa1ba166dff1c36a2b3705a21cff3 (patch)
tree1d8043aa86e47194ef843273556e690fa5666e4d /third_party/lzma_sdk/Lzma2Dec.h
parent9119274849baf458401656254b079b21ece24455 (diff)
downloadchromium_src-ce59605d9f7aa1ba166dff1c36a2b3705a21cff3.zip
chromium_src-ce59605d9f7aa1ba166dff1c36a2b3705a21cff3.tar.gz
chromium_src-ce59605d9f7aa1ba166dff1c36a2b3705a21cff3.tar.bz2
Update lzma_sdk to 9.20
Copied only C code required to open 7z archive files and uncompress LZMA compression. Updated chrome/installer/util/lzma_util.cc to follow API changes. BUG=None TEST=installer_util_unittests --gtest_filter='LzmaUtilTest.*' Review URL: http://codereview.chromium.org/10114005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132887 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/lzma_sdk/Lzma2Dec.h')
-rw-r--r--third_party/lzma_sdk/Lzma2Dec.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/third_party/lzma_sdk/Lzma2Dec.h b/third_party/lzma_sdk/Lzma2Dec.h
new file mode 100644
index 0000000..6bc07bb
--- /dev/null
+++ b/third_party/lzma_sdk/Lzma2Dec.h
@@ -0,0 +1,84 @@
+/* Lzma2Dec.h -- LZMA2 Decoder
+2009-05-03 : Igor Pavlov : Public domain */
+
+#ifndef __LZMA2_DEC_H
+#define __LZMA2_DEC_H
+
+#include "LzmaDec.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ---------- State Interface ---------- */
+
+typedef struct
+{
+ CLzmaDec decoder;
+ UInt32 packSize;
+ UInt32 unpackSize;
+ int state;
+ Byte control;
+ Bool needInitDic;
+ Bool needInitState;
+ Bool needInitProp;
+} CLzma2Dec;
+
+#define Lzma2Dec_Construct(p) LzmaDec_Construct(&(p)->decoder)
+#define Lzma2Dec_FreeProbs(p, alloc) LzmaDec_FreeProbs(&(p)->decoder, alloc);
+#define Lzma2Dec_Free(p, alloc) LzmaDec_Free(&(p)->decoder, alloc);
+
+SRes Lzma2Dec_AllocateProbs(CLzma2Dec *p, Byte prop, ISzAlloc *alloc);
+SRes Lzma2Dec_Allocate(CLzma2Dec *p, Byte prop, ISzAlloc *alloc);
+void Lzma2Dec_Init(CLzma2Dec *p);
+
+
+/*
+finishMode:
+ It has meaning only if the decoding reaches output limit (*destLen or dicLimit).
+ LZMA_FINISH_ANY - use smallest number of input bytes
+ LZMA_FINISH_END - read EndOfStream marker after decoding
+
+Returns:
+ SZ_OK
+ status:
+ LZMA_STATUS_FINISHED_WITH_MARK
+ LZMA_STATUS_NOT_FINISHED
+ LZMA_STATUS_NEEDS_MORE_INPUT
+ SZ_ERROR_DATA - Data error
+*/
+
+SRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, SizeT dicLimit,
+ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
+
+SRes Lzma2Dec_DecodeToBuf(CLzma2Dec *p, Byte *dest, SizeT *destLen,
+ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
+
+
+/* ---------- One Call Interface ---------- */
+
+/*
+finishMode:
+ It has meaning only if the decoding reaches output limit (*destLen).
+ LZMA_FINISH_ANY - use smallest number of input bytes
+ LZMA_FINISH_END - read EndOfStream marker after decoding
+
+Returns:
+ SZ_OK
+ status:
+ LZMA_STATUS_FINISHED_WITH_MARK
+ LZMA_STATUS_NOT_FINISHED
+ SZ_ERROR_DATA - Data error
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_UNSUPPORTED - Unsupported properties
+ SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
+*/
+
+SRes Lzma2Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
+ Byte prop, ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAlloc *alloc);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif