summaryrefslogtreecommitdiff
path: root/util/cbfstool/lzma/lzma.hh
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@chromium.org>2013-03-28 16:51:45 -0700
committerRonald G. Minnich <rminnich@gmail.com>2013-04-03 02:35:28 +0200
commitaa3f7ba36ebe3a933aa664f826382f60b31e86f1 (patch)
treed5db7081e310d418322f1ecc519439c488a9f4fd /util/cbfstool/lzma/lzma.hh
parent60a4a73fcd7babd4819853542a5566293a097ed4 (diff)
downloadcoreboot-aa3f7ba36ebe3a933aa664f826382f60b31e86f1.tar.xz
cbfstool: Replace C++ code with C code
cbfstool was using a C++ wrapper around the C written LZMA functions. And a C wrapper around those C++ functions. Drop the mess and rewrite the functions to be all C. Change-Id: Ieb6645a42f19efcc857be323ed8bdfcd9f48ee7c Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/3010 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'util/cbfstool/lzma/lzma.hh')
-rw-r--r--util/cbfstool/lzma/lzma.hh109
1 files changed, 0 insertions, 109 deletions
diff --git a/util/cbfstool/lzma/lzma.hh b/util/cbfstool/lzma/lzma.hh
deleted file mode 100644
index 5e00ef2d43..0000000000
--- a/util/cbfstool/lzma/lzma.hh
+++ /dev/null
@@ -1,109 +0,0 @@
-#ifndef HHlzmaHH
-#define HHlzmaHH
-
-#include <vector>
-
-extern int LZMA_verbose;
-
-extern unsigned LZMA_NumFastBytes;
-extern unsigned LZMA_AlgorithmNo;
-extern unsigned LZMA_PosStateBits;
-extern unsigned LZMA_LiteralPosStateBits;
-extern unsigned LZMA_LiteralContextBits;
-
-/* decompress LZMA-compressed data. */
-const std::vector<unsigned char> LZMADeCompress
- (const unsigned char* data, std::size_t length);
-
-const std::vector<unsigned char> LZMADeCompress
- (const unsigned char* data, std::size_t length, bool& ok);
-
-static inline const std::vector<unsigned char> LZMADeCompress
- (const std::vector<unsigned char>& buf)
- { return LZMADeCompress(&buf[0], buf.size()); }
-
-static inline const std::vector<unsigned char> LZMADeCompress
- (const std::vector<unsigned char>& buf, bool& ok)
- { return LZMADeCompress(&buf[0], buf.size(), ok); }
-
-/* LZMA-compress data with current settings. */
-const std::vector<unsigned char> LZMACompress
- (const unsigned char* data, std::size_t length);
-
-static inline const std::vector<unsigned char> LZMACompress
- (const std::vector<unsigned char>& buf)
- { return LZMACompress(&buf[0], buf.size()); }
-
-/* LZMA-compress data with given settings. */
-const std::vector<unsigned char> LZMACompress
- (const unsigned char* data, std::size_t length,
- unsigned pb,
- unsigned lp,
- unsigned lc);
-
-static inline const std::vector<unsigned char> LZMACompress
- (const std::vector<unsigned char>& buf,
- unsigned pb,
- unsigned lp,
- unsigned lc)
- { return LZMACompress(&buf[0], buf.size(), pb,lp,lc); }
-
-const std::vector<unsigned char> LZMACompress(
- const unsigned char* data, std::size_t length,
- unsigned pb,
- unsigned lp,
- unsigned lc,
- unsigned dictionarysize);
-
-static inline const std::vector<unsigned char> LZMACompress(
- const std::vector<unsigned char>& buf,
- unsigned pb,
- unsigned lp,
- unsigned lc,
- unsigned dictionarysize)
- { return LZMACompress(&buf[0], buf.size(), pb,lp,lc,dictionarysize); }
-
-/* LZMA-compress data with every settings (5*5*9 times), taking the best.
- * It will consume a lot of time and output useful statistics,
- * so a context parameter ("why") is also given.
- */
-const std::vector<unsigned char> LZMACompressHeavy
- (const unsigned char* data, std::size_t length,
- const char* why = "?");
-
-const std::vector<unsigned char> LZMACompressAuto
- (const unsigned char* data, std::size_t length,
- const char* why = "?");
-
-static inline const std::vector<unsigned char> LZMACompressHeavy
- (const std::vector<unsigned char>& buf,
- const char* why = "?")
- { return LZMACompressHeavy(&buf[0],buf.size(),why); }
-
-static inline const std::vector<unsigned char> LZMACompressAuto
- (const std::vector<unsigned char>& buf,
- const char* why = "?")
- { return LZMACompressAuto(&buf[0],buf.size(),why); }
-
-const std::vector<unsigned char>
- DoLZMACompress(int HeavyLevel,
- const unsigned char* data,
- std::size_t length,
- const char* why = "?");
-
-static inline const std::vector<unsigned char>
- DoLZMACompress(int HeavyLevel,
- const std::vector<unsigned char>& data, const char* why = "?")
- { return DoLZMACompress(HeavyLevel, &data[0], data.size(), why); }
-
-
-/*
-LZMA compressed file format
- ---------------------------
- Offset Size Description
- 0 1 Special LZMA properties for compressed data
- 1 4 Dictionary size (little endian)
- 5 8 Uncompressed size (little endian). -1 means unknown size
- 13 Compressed data
-*/
-#endif