packages feed

zlib 0.5.2.0 → 0.5.3.1

raw patch · 4 files changed

+32/−30 lines, 4 filesdep ~basedep ~bytestring

Dependency ranges changed: base, bytestring

Files

Codec/Compression/Zlib/Internal.hs view
@@ -54,18 +54,16 @@   decompressWithErrors,   DecompressStream(..),   DecompressError(..),+  foldDecompressStream,+  fromDecompressStream,   ) where  import Prelude hiding (length) import Control.Monad (when) import Control.Exception (assert) import qualified Data.ByteString.Lazy as L-#ifdef BYTESTRING_IN_BASE-import qualified Data.ByteString.Base as S-#else import qualified Data.ByteString.Lazy.Internal as L import qualified Data.ByteString.Internal as S-#endif  import qualified Codec.Compression.Zlib.Stream as Stream import Codec.Compression.Zlib.Stream (Stream)@@ -139,13 +137,8 @@ -- are 16k and 32k respectively (less a small accounting overhead). -- defaultCompressBufferSize, defaultDecompressBufferSize :: Int-#ifdef BYTESTRING_IN_BASE-defaultCompressBufferSize   = 16 * 1024 - 16-defaultDecompressBufferSize = 32 * 1024 - 16-#else defaultCompressBufferSize   = 16 * 1024 - L.chunkOverhead defaultDecompressBufferSize = 32 * 1024 - L.chunkOverhead-#endif  -- | A sequence of chunks of data produced from decompression. --@@ -181,7 +174,8 @@    | DataError  -- | Fold an 'DecompressionStream'. Just like 'foldr' but with an extra error--- case. For example to convert to a list and translate the errors into exceptions:+-- case. For example to convert to a list and translate the errors into+-- exceptions: -- -- > foldDecompressStream (:) [] (\code msg -> error msg) --@@ -194,10 +188,18 @@     fold (StreamChunk bs stream) = chunk bs (fold stream)     fold (StreamError code msg)  = err code msg +-- | Convert a 'DecompressStream' to a lazy 'ByteString'. If any decompression+-- errors are encountered then they are thrown as exceptions.+--+-- This is a special case of 'foldDecompressStream'.+-- fromDecompressStream :: DecompressStream -> L.ByteString fromDecompressStream =   foldDecompressStream L.Chunk L.Empty     (\_code msg -> error ("Codec.Compression.Zlib: " ++ msg))++--TODO: throw DecompressError as an Exception class type and document that it+-- does this.  -- | Compress a data stream. --
Codec/Compression/Zlib/Stream.hsc view
@@ -82,15 +82,15 @@ import Foreign          ( Word8, Ptr, nullPtr, plusPtr, peekByteOff, pokeByteOff, mallocBytes          , ForeignPtr, FinalizerPtr, newForeignPtr_, addForeignPtrFinalizer-	 , finalizeForeignPtr, withForeignPtr, touchForeignPtr+	 , withForeignPtr, touchForeignPtr 	 , unsafeForeignPtrToPtr, unsafePerformIO )+#ifdef __GLASGOW_HASKELL__+import Foreign+         ( finalizeForeignPtr )+#endif import Foreign.C          ( CInt, CUInt, CChar, CString, withCAString, peekCAString )-#ifdef BYTESTRING_IN_BASE-import Data.ByteString.Base (nullForeignPtr)-#else import Data.ByteString.Internal (nullForeignPtr)-#endif import System.IO.Unsafe (unsafeInterleaveIO) import Control.Monad (liftM) import Control.Exception (assert)@@ -816,7 +816,12 @@ -- longer be needed, for example if an error occurs or if the stream ends. -- finalise :: Stream ()+#ifdef __GLASGOW_HASKELL__+--TODO: finalizeForeignPtr is ghc-only finalise = getStreamState >>= unsafeLiftIO . finalizeForeignPtr+#else+finalise = return ()+#endif  checkFormatSupported :: Format -> Stream () checkFormatSupported format = do
LICENSE view
@@ -9,6 +9,7 @@ 2. Redistributions in binary form must reproduce the above copyright    notice, this list of conditions and the following disclaimer in the    documentation and/or other materials provided with the distribution.+3. This clause is intentionally left blank.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
zlib.cabal view
@@ -1,10 +1,10 @@ name:            zlib-version:         0.5.2.0+version:         0.5.3.1 copyright:       (c) 2006-2008 Duncan Coutts license:         BSD3 license-file:    LICENSE-author:          Duncan Coutts <duncan@haskell.org>-maintainer:      Duncan Coutts <duncan@haskell.org>+author:          Duncan Coutts <duncan@community.haskell.org>+maintainer:      Duncan Coutts <duncan@community.haskell.org> category:        Codec synopsis:        Compression and decompression in the gzip and zlib formats description:     This package provides a pure interface for compressing and @@ -16,18 +16,17 @@                  It provides a convenient high level API suitable for most                  tasks and for the few cases where more control is needed it                  provides access to the full zlib feature set.-stability:       provisional build-type:      Simple-cabal-version:   >= 1.2.1+cabal-version:   >= 1.6 extra-source-files: cbits/crc32.h cbits/inffast.h cbits/inflate.h                     cbits/trees.h cbits/deflate.h cbits/inffixed.h                     cbits/inftrees.h cbits/zutil.h                     -- demo programs:                     examples/gzip.hs examples/gunzip.hs -flag bytestring-in-base-  description: In the ghc-6.6 era the bytestring modules were-               included in the base package.+source-repository head+  type: darcs+  location: http://code.haskell.org/zlib/  library   exposed-modules: Codec.Compression.GZip,@@ -36,13 +35,8 @@                    Codec.Compression.Zlib.Internal   other-modules:   Codec.Compression.Zlib.Stream   extensions:      CPP, ForeignFunctionInterface-  build-depends: base < 5-  if flag(bytestring-in-base)-    -- bytestring was in base-2.0 and 2.1.1-    build-depends: base >= 2.0 && < 2.2-    cpp-options: -DBYTESTRING_IN_BASE-  else-    build-depends: base < 2.0 || >= 2.2, bytestring >= 0.9+  build-depends:   base >= 3 && < 5,+                   bytestring == 0.9.*   includes:        zlib.h   ghc-options:     -Wall   if !os(windows)