    -- GENERATED by C->Haskell Compiler, version 0.28.6 Switcheroo, 25 November 2017 (Haskell)
    -- Edit the ORIGNAL .chs file instead!

    {-# LINE 1 "src/Codec/Compression/BZip/Foreign/Decompress.chs" #-}
    module Codec.Compression.BZip.Foreign.Decompress ( bZ2BzDecompressInit
                                                     , bZ2BzDecompress
                                                     , bZ2BzDecompressEnd
                                                     , BzStreamPtr
                                                     ) where
    import qualified Foreign.C.Types as C2HSImp
    import qualified Foreign.ForeignPtr as C2HSImp
    import qualified Foreign.Marshal.Utils as C2HSImp
    import qualified Foreign.Ptr as C2HSImp

    import Codec.Compression.BZip.Foreign.Common
    {-# LINE 7 "src/Codec/Compression/BZip/Foreign/Decompress.chs" #-}

    import Foreign.C.Types (CInt)

    type BzStreamPtr = C2HSImp.ForeignPtr (BzStream)
    {-# LINE 13 "src/Codec/Compression/BZip/Foreign/Decompress.chs" #-}

    bZ2BzDecompressInit :: (BzStreamPtr) -> (CInt) -> (Bool) -> IO ()
    bZ2BzDecompressInit :: BzStreamPtr -> CInt -> Bool -> IO ()
    bZ2BzDecompressInit a1 :: BzStreamPtr
    a1 a2 :: CInt
    a2 a3 :: Bool
    a3 =
      BzStreamPtr -> (Ptr BzStream -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    C2HSImp.withForeignPtr BzStreamPtr
    a1 ((Ptr BzStream -> IO ()) -> IO ())
    -> (Ptr BzStream -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \a1' :: Ptr BzStream
    a1' ->
      let {a2' = fromIntegral a2} in
      let {a3' = C2HSImp.fromBool a3} in
      bZ2BzDecompressInit'_ a1' a2' a3' >>= \res ->
      bzWrap res >>
      return ()

    {-# LINE 15 "src/Codec/Compression/BZip/Foreign/Decompress.chs" #-}

    bZ2BzDecompress :: (BzStreamPtr) -> IO ((BZError))
    bZ2BzDecompress a1 =
      C2HSImp.withForeignPtr a1 $ \a1' ->
      bZ2BzDecompress'_ a1' >>= \res ->
      bzWrap res >>= \res' ->
      return (res')

    {-# LINE 16 "src/Codec/Compression/BZip/Foreign/Decompress.chs" #-}

    foreign import ccall "Codec/Compression/BZip/Foreign/Decompress.chs.h &BZ2_bzDecompressEnd"
      bZ2BzDecompressEnd :: C2HSImp.FinalizerPtr ()

    foreign import ccall safe "Codec/Compression/BZip/Foreign/Decompress.chs.h BZ2_bzDecompressInit"
      bZ2BzDecompressInit'_ :: ((C2HSImp.Ptr (BzStream)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO C2HSImp.CInt))))

    foreign import ccall safe "Codec/Compression/BZip/Foreign/Decompress.chs.h BZ2_bzDecompress"
      bZ2BzDecompress'_ :: ((C2HSImp.Ptr (BzStream)) -> (IO C2HSImp.CInt))