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


-- | Bindings to libbz2
--   
--   High-level bindings to libbz2 using c2hs and ByteString
@package bz2
@version 0.1.1.1


-- | This module uses exceptions behind the scenes
--   
--   Consult the upstream <a>documentation</a> for how to use this library.
--   
--   For struct accessors, I recommend using <a>c2hs</a>.
module Codec.Compression.BZip.Foreign
data BZAction
BzRun :: BZAction
BzFlush :: BZAction
BzFinish :: BZAction
data BZError
BzConfigError :: BZError
BzOutbuffFull :: BZError
BzUnexpectedEof :: BZError
BzIoError :: BZError
BzDataErrorMagic :: BZError
BzDataError :: BZError
BzMemError :: BZError
BzParamError :: BZError
BzSequenceError :: BZError
BzOk :: BZError
BzRunOk :: BZError
BzFlushOk :: BZError
BzFinishOk :: BZError
BzStreamEnd :: BZError

-- | Abstract type
data BzStream
type BzStreamPtr = Ptr (BzStream)

-- | Abstract type
data BzFile
type BzFilePtr = Ptr (BzFile)

-- | <tt>FILE*</tt> in C.
data FilePtr
bZ2BzCompressInit :: BzStreamPtr -> CInt -> CInt -> CInt -> IO ()
bZ2BzCompress :: BzStreamPtr -> BZAction -> IO BZError
bZ2BzCompressEnd :: BzStreamPtr -> IO ()
bZ2BzDecompressInit :: BzStreamPtr -> CInt -> Bool -> IO ()
bZ2BzDecompress :: BzStreamPtr -> IO BZError
bZ2BzDecompressEnd :: BzStreamPtr -> IO ()
bZ2BzReadOpen :: FilePtr -> CInt -> Bool -> Ptr a -> CInt -> IO (BzFilePtr, BZError)
bZ2BzReadClose :: BzFilePtr -> IO BZError
bZ2BzReadGetUnused :: BzFilePtr -> IO (BZError, Ptr a, CInt)
bZ2BzRead :: BzFilePtr -> Ptr a -> CInt -> IO (CInt, BZError)
bZ2BzWriteOpen :: FilePtr -> CInt -> CInt -> CInt -> IO (BzFilePtr, BZError)
bZ2BzWrite :: BzFilePtr -> Ptr a -> CInt -> IO BZError
bZ2BzWriteClose :: BzFilePtr -> Bool -> IO (BZError, CUInt, CUInt)
bZ2BzWriteClose64 :: BzFilePtr -> Bool -> IO (BZError, CUInt, CUInt, CUInt, CUInt)
bZMaxUnused :: Integral a => a
bZ2BzBuffToBuffCompress :: Ptr a -> Ptr a -> CUInt -> CInt -> CInt -> CInt -> IO CUInt
bZ2BzBuffToBuffDecompress :: Ptr a -> Ptr a -> CUInt -> Bool -> CInt -> IO (BZError, CUInt)
bZ2BzlibVersion :: String
instance GHC.Show.Show Codec.Compression.BZip.Foreign.BZError
instance GHC.Classes.Eq Codec.Compression.BZip.Foreign.BZError
instance GHC.Enum.Enum Codec.Compression.BZip.Foreign.BZError
instance GHC.Exception.Type.Exception Codec.Compression.BZip.Foreign.BZError
instance GHC.Enum.Enum Codec.Compression.BZip.Foreign.BZAction


-- | High-level functions throw <a>BZError</a> on error.
module Codec.Compression.BZip

compress :: ByteString -> ByteString

-- | See <a>bzlib manual</a> for information on compression parameters.
compressWith :: CInt -> CInt -> ByteString -> ByteString

-- | Don't use this on pathological input; it may not be secure
decompress :: ByteString -> ByteString
