{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (garetxe@gmail.com) Associates a string with a bit flag. Used in g_parse_debug_string(). -} module GI.GLib.Structs.DebugKey ( -- * Exported types DebugKey(..) , noDebugKey , -- * Properties -- ** Key debugKeyReadKey , -- ** Value debugKeyReadValue , ) 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 DebugKey = DebugKey (ForeignPtr DebugKey) noDebugKey :: Maybe DebugKey noDebugKey = Nothing debugKeyReadKey :: DebugKey -> IO T.Text debugKeyReadKey s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 0) :: IO CString val' <- cstringToText val return val' debugKeyReadValue :: DebugKey -> IO Word32 debugKeyReadValue s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 8) :: IO Word32 return val