{- | 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 output when sending multiple messages or packets in one go. You generally pass in an array of #GOutputVectors and the operation will use all the buffers as if they were one buffer. If @address is %NULL then the message is sent to the default receiver (as previously set by g_socket_connect()). -} module GI.Gio.Structs.OutputMessage ( -- * Exported types OutputMessage(..) , noOutputMessage , -- * Properties -- ** Address outputMessageReadAddress , -- ** BytesSent outputMessageReadBytesSent , -- ** NumControlMessages outputMessageReadNumControlMessages , -- ** NumVectors outputMessageReadNumVectors , -- ** Vectors outputMessageReadVectors , ) 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 OutputMessage = OutputMessage (ForeignPtr OutputMessage) noOutputMessage :: Maybe OutputMessage noOutputMessage = Nothing outputMessageReadAddress :: OutputMessage -> IO SocketAddress outputMessageReadAddress s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 0) :: IO (Ptr SocketAddress) val' <- (newObject SocketAddress) val return val' outputMessageReadVectors :: OutputMessage -> IO OutputVector outputMessageReadVectors s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 8) :: IO (Ptr OutputVector) val' <- (newPtr 16 OutputVector) val return val' outputMessageReadNumVectors :: OutputMessage -> IO Word32 outputMessageReadNumVectors s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 16) :: IO Word32 return val outputMessageReadBytesSent :: OutputMessage -> IO Word32 outputMessageReadBytesSent s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 20) :: IO Word32 return val -- XXX Skipped getter for "OutputMessage:control_messages" :: Not implemented: "Don't know how to unpack C array of type TCArray False (-1) 5 (TInterface \"Gio\" \"SocketControlMessage\")" outputMessageReadNumControlMessages :: OutputMessage -> IO Word32 outputMessageReadNumControlMessages s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 32) :: IO Word32 return val