From aa45f148926e3461a1fd8b10c990f0a51a908cc9 Mon Sep 17 00:00:00 2001 From: dim Date: Mon, 10 Jun 2013 20:36:52 +0000 Subject: Vendor import of llvm tags/RELEASE_33/final r183502 (effectively, 3.3 release): http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_33/final@183502 --- include/llvm/Support/Compression.h | 58 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 include/llvm/Support/Compression.h (limited to 'include/llvm/Support/Compression.h') diff --git a/include/llvm/Support/Compression.h b/include/llvm/Support/Compression.h new file mode 100644 index 0000000..9b1142d --- /dev/null +++ b/include/llvm/Support/Compression.h @@ -0,0 +1,58 @@ +//===-- llvm/Support/Compression.h ---Compression----------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains basic functions for compression/uncompression. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_SUPPORT_COMPRESSION_H +#define LLVM_SUPPORT_COMPRESSION_H + +#include "llvm/Support/DataTypes.h" + +namespace llvm { + +class MemoryBuffer; +template class OwningPtr; +class StringRef; + +namespace zlib { + +enum CompressionLevel { + NoCompression, + DefaultCompression, + BestSpeedCompression, + BestSizeCompression +}; + +enum Status { + StatusOK, + StatusUnsupported, // zlib is unavaliable + StatusOutOfMemory, // there was not enough memory + StatusBufferTooShort, // there was not enough room in the output buffer + StatusInvalidArg, // invalid input parameter + StatusInvalidData // data was corrupted or incomplete +}; + +bool isAvailable(); + +Status compress(StringRef InputBuffer, + OwningPtr &CompressedBuffer, + CompressionLevel Level = DefaultCompression); + +Status uncompress(StringRef InputBuffer, + OwningPtr &UncompressedBuffer, + size_t UncompressedSize); + +} // End of namespace zlib + +} // End of namespace llvm + +#endif + -- cgit v1.1