[llvm-commits] CVS: llvm/include/llvm/Support/Compressor.h

Reid Spencer reid at x10sys.com
Mon Oct 4 10:29:36 PDT 2004



Changes in directory llvm/include/llvm/Support:

Compressor.h updated: 1.1 -> 1.2
---
Log message:

Add a context for the callback so different compression scenarios can be
distinguished. Tidy up documentation.  Thanks, Chris.


---
Diffs of the changes:  (+11 -9)

Index: llvm/include/llvm/Support/Compressor.h
diff -u llvm/include/llvm/Support/Compressor.h:1.1 llvm/include/llvm/Support/Compressor.h:1.2
--- llvm/include/llvm/Support/Compressor.h:1.1	Mon Oct  4 05:49:41 2004
+++ llvm/include/llvm/Support/Compressor.h	Mon Oct  4 12:29:25 2004
@@ -14,25 +14,25 @@
 #ifndef LLVM_SUPPORT_COMPRESSOR_H
 #define LLVM_SUPPORT_COMPRESSOR_H
 
-#include <llvm/Support/DataTypes.h>
+#include "llvm/Support/DataTypes.h"
 
 namespace llvm {
 
   /// This class provides an abstraction for compressing a block of memory using
   /// a standard compression utility such as bzip2 or libz. This interface
-  /// allos us to abstraction the notion of compression and deal with alternate
+  /// allows us to abstract the notion of compression and deal with alternate
   /// compression scheme availability depending on the configured platform. This
   /// facility will always favor a bzip2 implementation if its available.
-  /// Otherwise, libz will be used if its available. If neither zlib nor bzip2
+  /// Otherwise, libz will be used if it is available. If neither zlib nor bzip2
   /// are available, a very simple algorithm provided by the Compressor class
-  /// will be used The type of compression used can be determined by inspecting 
+  /// will be used. The type of compression used can be determined by inspecting 
   /// the first byte of the compressed output. ASCII values '0', '1', and '2', 
   /// denote the compression type as given in the Algorithm enumeration below.
   /// The Compressor is intended for use with memory mapped files where the 
   /// entire data block to be compressed or decompressed is available in 
-  /// memory. Output, however, can be gathered in repeated calls to a callback.
+  /// memory. However, output can be gathered in repeated calls to a callback.
   /// @since 1.4
-  /// @brief An abstraction for memory to memory data compression
+  /// @brief An abstraction for memory to memory data (de)compression
   class Compressor {
     /// @name Types
     /// @{
@@ -50,7 +50,8 @@
       /// @returns 0 for success, 1 for failure
       /// @throws nothing
       /// @brief Output callback function type
-      typedef unsigned (OutputDataCallback)(char*& buffer, unsigned& size);
+      typedef unsigned (OutputDataCallback)(char*& buffer, unsigned& size,
+                                            void* context);
 
     /// @}
     /// @name Methods
@@ -72,7 +73,8 @@
       /// @returns the total size of the compressed data
       /// @brief Compress a block of memory.
       static uint64_t compress(char* in, unsigned size, OutputDataCallback* cb,
-                               Algorithm hint = COMP_TYPE_BZIP2);
+                               Algorithm hint = COMP_TYPE_BZIP2,
+                               void* context = 0);
 
       /// This function does the decompression work. The block of memory
       /// starting at \p in and extending for \p size bytes is decompressed. The
@@ -88,7 +90,7 @@
       /// @returns the total size of the decompressed data
       /// @brief Decompress a block of memory.
       static uint64_t decompress(char *in, unsigned size, 
-                                 OutputDataCallback* cb);
+                                 OutputDataCallback* cb, void* context = 0);
 
     /// @}
   };






More information about the llvm-commits mailing list