{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (garetxe@gmail.com) Structure used for scatter/gather data input. You generally pass in an array of #GInputVectors and the operation will store the read data starting in the first buffer, switching to the next as needed. -} module GI.Gio.Structs.InputVector ( -- * Exported types InputVector(..) , noInputVector , -- * Properties -- ** Buffer inputVectorReadBuffer , -- ** Size inputVectorReadSize , ) where import Prelude () import Data.GI.Base.ShortPrelude import qualified Data.Text as T import qualified Data.ByteString.Char8 as B import qualified Data.Map as Map import GI.Gio.Types import GI.Gio.Callbacks newtype InputVector = InputVector (ForeignPtr InputVector) noInputVector :: Maybe InputVector noInputVector = Nothing inputVectorReadBuffer :: InputVector -> IO (Ptr ()) inputVectorReadBuffer s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 0) :: IO (Ptr ()) return val inputVectorReadSize :: InputVector -> IO Word64 inputVectorReadSize s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 8) :: IO Word64 return val