-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Enumerator interface for zlib compression
--   
--   zlib-enum is a stop-gap package to provide enumeratees for zlib
--   compression/decompression.
@package zlib-enum
@version 0.2.3

module Codec.Zlib.Enum

-- | Compress (deflate) a stream of <a>ByteString</a>s. The
--   <a>WindowBits</a> also control the format (zlib vs. gzip).
compress :: MonadIO m => Int -> WindowBits -> Enumeratee ByteString ByteString m a

-- | Decompress (inflate) a stream of <a>ByteString</a>s. For example:
--   
--   <pre>
--   run $ enumFile "test.z" $$ decompress defaultWindowBits $$ printChunks True
--   </pre>
decompress :: MonadIO m => WindowBits -> Enumeratee ByteString ByteString m a

-- | Gzip compression with default parameters.
gzip :: MonadIO m => Enumeratee ByteString ByteString m a

-- | Gzip decompression with default parameters.
ungzip :: MonadIO m => Enumeratee ByteString ByteString m a
data WindowBits :: *
WindowBits :: Int -> WindowBits
defaultWindowBits :: WindowBits

-- | Exception that can be thrown from the FFI code. The parameter is the
--   numerical error code from the zlib library. Quoting the zlib.h file
--   directly:
--   
--   <ul>
--   <li>#define Z_OK 0</li>
--   <li>#define Z_STREAM_END 1</li>
--   <li>#define Z_NEED_DICT 2</li>
--   <li>#define Z_ERRNO (-1)</li>
--   <li>#define Z_STREAM_ERROR (-2)</li>
--   <li>#define Z_DATA_ERROR (-3)</li>
--   <li>#define Z_MEM_ERROR (-4)</li>
--   <li>#define Z_BUF_ERROR (-5)</li>
--   <li>#define Z_VERSION_ERROR (-6)</li>
--   </ul>
data ZlibException :: *
