{-# OPTIONS_GHC -optc-DZSTD_STATIC_LINKING_ONLY #-}
{-# LINE 1 "Codec/Compression/Zstd/FFI/Types.hsc" #-}
{-# LANGUAGE ExistentialQuantification #-}
module Codec.Compression.Zstd.FFI.Types
(
Buffer(..)
, In
, Out
, CCtx
, DCtx
, CDict
, DDict
, peekPtr
, pokePtr
, peekSize
, pokeSize
, peekPos
, pokePos
) where
import Foreign.C.Types (CInt(..), CSize(..))
import Foreign.Storable
import GHC.Ptr (Ptr(..))
data CCtx
data DCtx
data CDict
data DDict
data In
data Out
data Buffer io = forall a. Buffer {
bufPtr :: {-# UNPACK #-} !(Ptr a)
, bufSize :: {-# UNPACK #-} !CSize
, bufPos :: {-# UNPACK #-} !CSize
}
instance Storable (Buffer io) where
sizeOf _ = 24
{-# LINE 78 "Codec/Compression/Zstd/FFI/Types.hsc" #-}
alignment _ = alignment (undefined :: CInt)
peek p = do
ptr <- ((\hsc_ptr -> peekByteOff hsc_ptr 0)) p
{-# LINE 82 "Codec/Compression/Zstd/FFI/Types.hsc" #-}
size <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) p
{-# LINE 83 "Codec/Compression/Zstd/FFI/Types.hsc" #-}
pos <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) p
{-# LINE 84 "Codec/Compression/Zstd/FFI/Types.hsc" #-}
return (Buffer ptr size pos)
poke p (Buffer ptr size pos) = do
((\hsc_ptr -> pokeByteOff hsc_ptr 0)) p ptr
{-# LINE 88 "Codec/Compression/Zstd/FFI/Types.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 8)) p size
{-# LINE 89 "Codec/Compression/Zstd/FFI/Types.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 16)) p pos
{-# LINE 90 "Codec/Compression/Zstd/FFI/Types.hsc" #-}
peekPtr :: Ptr (Buffer io) -> IO CSize
peekPtr p = ((\hsc_ptr -> peekByteOff hsc_ptr 0)) p
{-# LINE 94 "Codec/Compression/Zstd/FFI/Types.hsc" #-}
pokePtr :: Ptr (Buffer io) -> Ptr a -> IO ()
pokePtr dst p = ((\hsc_ptr -> pokeByteOff hsc_ptr 0)) dst p
{-# LINE 98 "Codec/Compression/Zstd/FFI/Types.hsc" #-}
peekSize :: Ptr (Buffer io) -> IO CSize
peekSize p = ((\hsc_ptr -> peekByteOff hsc_ptr 8)) p
{-# LINE 102 "Codec/Compression/Zstd/FFI/Types.hsc" #-}
pokeSize :: Ptr (Buffer io) -> CSize -> IO ()
pokeSize dst s = ((\hsc_ptr -> pokeByteOff hsc_ptr 8)) dst s
{-# LINE 106 "Codec/Compression/Zstd/FFI/Types.hsc" #-}
peekPos :: Ptr (Buffer io) -> IO CSize
peekPos p = ((\hsc_ptr -> peekByteOff hsc_ptr 16)) p
{-# LINE 110 "Codec/Compression/Zstd/FFI/Types.hsc" #-}
pokePos :: Ptr (Buffer io) -> CSize -> IO ()
pokePos dst s = ((\hsc_ptr -> pokeByteOff hsc_ptr 16)) dst s
{-# LINE 114 "Codec/Compression/Zstd/FFI/Types.hsc" #-}