module GI.GLib.Structs.TestLogMsg
(
TestLogMsg(..) ,
noTestLogMsg ,
testLogMsgFree ,
testLogMsgReadLogType ,
testLogMsgReadNNums ,
testLogMsgReadNStrings ,
testLogMsgReadNums ,
testLogMsgReadStrings ,
) 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 TestLogMsg = TestLogMsg (ForeignPtr TestLogMsg)
noTestLogMsg :: Maybe TestLogMsg
noTestLogMsg = Nothing
testLogMsgReadLogType :: TestLogMsg -> IO TestLogType
testLogMsgReadLogType s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CUInt
let val' = (toEnum . fromIntegral) val
return val'
testLogMsgReadNStrings :: TestLogMsg -> IO Word32
testLogMsgReadNStrings s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 4) :: IO Word32
return val
testLogMsgReadStrings :: TestLogMsg -> IO T.Text
testLogMsgReadStrings s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO CString
val' <- cstringToText val
return val'
testLogMsgReadNNums :: TestLogMsg -> IO Word32
testLogMsgReadNNums s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO Word32
return val
testLogMsgReadNums :: TestLogMsg -> IO Int64
testLogMsgReadNums s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO Int64
return val
foreign import ccall "g_test_log_msg_free" g_test_log_msg_free ::
Ptr TestLogMsg ->
IO ()
testLogMsgFree ::
(MonadIO m) =>
TestLogMsg ->
m ()
testLogMsgFree _obj = liftIO $ do
let _obj' = unsafeManagedPtrGetPtr _obj
g_test_log_msg_free _obj'
touchManagedPtr _obj
return ()