gi-gio-0.2.46.12: GI/Gio/Structs/DBusErrorEntry.hs
{- |
Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
Struct used in g_dbus_error_register_error_domain().
-}
module GI.Gio.Structs.DBusErrorEntry
(
-- * Exported types
DBusErrorEntry(..) ,
noDBusErrorEntry ,
-- * Properties
-- ** DbusErrorName
dBusErrorEntryReadDbusErrorName ,
-- ** ErrorCode
dBusErrorEntryReadErrorCode ,
) 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 DBusErrorEntry = DBusErrorEntry (ForeignPtr DBusErrorEntry)
noDBusErrorEntry :: Maybe DBusErrorEntry
noDBusErrorEntry = Nothing
dBusErrorEntryReadErrorCode :: DBusErrorEntry -> IO Int32
dBusErrorEntryReadErrorCode s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO Int32
return val
dBusErrorEntryReadDbusErrorName :: DBusErrorEntry -> IO T.Text
dBusErrorEntryReadDbusErrorName s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO CString
val' <- cstringToText val
return val'