{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (garetxe@gmail.com) Contains the public fields of a pointer array. -} module GI.GLib.Structs.PtrArray ( -- * Exported types PtrArray(..) , noPtrArray , -- * Properties -- ** Len ptrArrayReadLen , -- ** Pdata ptrArrayReadPdata , ) 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.GLib.Types import GI.GLib.Callbacks newtype PtrArray = PtrArray (ForeignPtr PtrArray) foreign import ccall "g_ptr_array_get_type" c_g_ptr_array_get_type :: IO GType instance BoxedObject PtrArray where boxedType _ = c_g_ptr_array_get_type noPtrArray :: Maybe PtrArray noPtrArray = Nothing ptrArrayReadPdata :: PtrArray -> IO (Ptr ()) ptrArrayReadPdata s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 0) :: IO (Ptr ()) return val ptrArrayReadLen :: PtrArray -> IO Word32 ptrArrayReadLen s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 8) :: IO Word32 return val