{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GLib.Structs.MemVTable
(
MemVTable(..) ,
newZeroMemVTable ,
#if defined(ENABLE_OVERLOADING)
ResolveMemVTableMethod ,
#endif
clearMemVTableCalloc ,
getMemVTableCalloc ,
#if defined(ENABLE_OVERLOADING)
memVTable_calloc ,
#endif
setMemVTableCalloc ,
clearMemVTableFree ,
getMemVTableFree ,
#if defined(ENABLE_OVERLOADING)
memVTable_free ,
#endif
setMemVTableFree ,
clearMemVTableMalloc ,
getMemVTableMalloc ,
#if defined(ENABLE_OVERLOADING)
memVTable_malloc ,
#endif
setMemVTableMalloc ,
clearMemVTableRealloc ,
getMemVTableRealloc ,
#if defined(ENABLE_OVERLOADING)
memVTable_realloc ,
#endif
setMemVTableRealloc ,
clearMemVTableTryMalloc ,
getMemVTableTryMalloc ,
#if defined(ENABLE_OVERLOADING)
memVTable_tryMalloc ,
#endif
setMemVTableTryMalloc ,
clearMemVTableTryRealloc ,
getMemVTableTryRealloc ,
#if defined(ENABLE_OVERLOADING)
memVTable_tryRealloc ,
#endif
setMemVTableTryRealloc ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GLib.Callbacks as GLib.Callbacks
newtype MemVTable = MemVTable (SP.ManagedPtr MemVTable)
deriving (MemVTable -> MemVTable -> Bool
(MemVTable -> MemVTable -> Bool)
-> (MemVTable -> MemVTable -> Bool) -> Eq MemVTable
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MemVTable -> MemVTable -> Bool
$c/= :: MemVTable -> MemVTable -> Bool
== :: MemVTable -> MemVTable -> Bool
$c== :: MemVTable -> MemVTable -> Bool
Eq)
instance SP.ManagedPtrNewtype MemVTable where
toManagedPtr :: MemVTable -> ManagedPtr MemVTable
toManagedPtr (MemVTable ManagedPtr MemVTable
p) = ManagedPtr MemVTable
p
instance BoxedPtr MemVTable where
boxedPtrCopy :: MemVTable -> IO MemVTable
boxedPtrCopy = \MemVTable
p -> MemVTable -> (Ptr MemVTable -> IO MemVTable) -> IO MemVTable
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr MemVTable
p (Int -> Ptr MemVTable -> IO (Ptr MemVTable)
forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
copyBytes Int
48 (Ptr MemVTable -> IO (Ptr MemVTable))
-> (Ptr MemVTable -> IO MemVTable) -> Ptr MemVTable -> IO MemVTable
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> (ManagedPtr MemVTable -> MemVTable)
-> Ptr MemVTable -> IO MemVTable
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.wrapPtr ManagedPtr MemVTable -> MemVTable
MemVTable)
boxedPtrFree :: MemVTable -> IO ()
boxedPtrFree = \MemVTable
x -> MemVTable -> (Ptr MemVTable -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
SP.withManagedPtr MemVTable
x Ptr MemVTable -> IO ()
forall a. Ptr a -> IO ()
SP.freeMem
instance CallocPtr MemVTable where
boxedPtrCalloc :: IO (Ptr MemVTable)
boxedPtrCalloc = Int -> IO (Ptr MemVTable)
forall a. Int -> IO (Ptr a)
callocBytes Int
48
newZeroMemVTable :: MonadIO m => m MemVTable
newZeroMemVTable :: m MemVTable
newZeroMemVTable = IO MemVTable -> m MemVTable
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MemVTable -> m MemVTable) -> IO MemVTable -> m MemVTable
forall a b. (a -> b) -> a -> b
$ IO (Ptr MemVTable)
forall a. CallocPtr a => IO (Ptr a)
boxedPtrCalloc IO (Ptr MemVTable)
-> (Ptr MemVTable -> IO MemVTable) -> IO MemVTable
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr MemVTable -> MemVTable)
-> Ptr MemVTable -> IO MemVTable
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr MemVTable -> MemVTable
MemVTable
instance tag ~ 'AttrSet => Constructible MemVTable tag where
new :: (ManagedPtr MemVTable -> MemVTable)
-> [AttrOp MemVTable tag] -> m MemVTable
new ManagedPtr MemVTable -> MemVTable
_ [AttrOp MemVTable tag]
attrs = do
MemVTable
o <- m MemVTable
forall (m :: * -> *). MonadIO m => m MemVTable
newZeroMemVTable
MemVTable -> [AttrOp MemVTable 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set MemVTable
o [AttrOp MemVTable tag]
[AttrOp MemVTable 'AttrSet]
attrs
MemVTable -> m MemVTable
forall (m :: * -> *) a. Monad m => a -> m a
return MemVTable
o
getMemVTableMalloc :: MonadIO m => MemVTable -> m (Maybe GLib.Callbacks.MemVTableMallocFieldCallback)
getMemVTableMalloc :: MemVTable -> m (Maybe MemVTableMallocFieldCallback)
getMemVTableMalloc MemVTable
s = IO (Maybe MemVTableMallocFieldCallback)
-> m (Maybe MemVTableMallocFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe MemVTableMallocFieldCallback)
-> m (Maybe MemVTableMallocFieldCallback))
-> IO (Maybe MemVTableMallocFieldCallback)
-> m (Maybe MemVTableMallocFieldCallback)
forall a b. (a -> b) -> a -> b
$ MemVTable
-> (Ptr MemVTable -> IO (Maybe MemVTableMallocFieldCallback))
-> IO (Maybe MemVTableMallocFieldCallback)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr MemVTable
s ((Ptr MemVTable -> IO (Maybe MemVTableMallocFieldCallback))
-> IO (Maybe MemVTableMallocFieldCallback))
-> (Ptr MemVTable -> IO (Maybe MemVTableMallocFieldCallback))
-> IO (Maybe MemVTableMallocFieldCallback)
forall a b. (a -> b) -> a -> b
$ \Ptr MemVTable
ptr -> do
FunPtr MemVTableMallocFieldCallback
val <- Ptr (FunPtr MemVTableMallocFieldCallback)
-> IO (FunPtr MemVTableMallocFieldCallback)
forall a. Storable a => Ptr a -> IO a
peek (Ptr MemVTable
ptr Ptr MemVTable -> Int -> Ptr (FunPtr MemVTableMallocFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO (FunPtr GLib.Callbacks.C_MemVTableMallocFieldCallback)
Maybe MemVTableMallocFieldCallback
result <- FunPtr MemVTableMallocFieldCallback
-> (FunPtr MemVTableMallocFieldCallback
-> IO MemVTableMallocFieldCallback)
-> IO (Maybe MemVTableMallocFieldCallback)
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr MemVTableMallocFieldCallback
val ((FunPtr MemVTableMallocFieldCallback
-> IO MemVTableMallocFieldCallback)
-> IO (Maybe MemVTableMallocFieldCallback))
-> (FunPtr MemVTableMallocFieldCallback
-> IO MemVTableMallocFieldCallback)
-> IO (Maybe MemVTableMallocFieldCallback)
forall a b. (a -> b) -> a -> b
$ \FunPtr MemVTableMallocFieldCallback
val' -> do
let val'' :: MemVTableMallocFieldCallback
val'' = FunPtr MemVTableMallocFieldCallback -> MemVTableMallocFieldCallback
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr MemVTableMallocFieldCallback -> Word64 -> m (Ptr ())
GLib.Callbacks.dynamic_MemVTableMallocFieldCallback FunPtr MemVTableMallocFieldCallback
val'
MemVTableMallocFieldCallback -> IO MemVTableMallocFieldCallback
forall (m :: * -> *) a. Monad m => a -> m a
return MemVTableMallocFieldCallback
val''
Maybe MemVTableMallocFieldCallback
-> IO (Maybe MemVTableMallocFieldCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe MemVTableMallocFieldCallback
result
setMemVTableMalloc :: MonadIO m => MemVTable -> FunPtr GLib.Callbacks.C_MemVTableMallocFieldCallback -> m ()
setMemVTableMalloc :: MemVTable -> FunPtr MemVTableMallocFieldCallback -> m ()
setMemVTableMalloc MemVTable
s FunPtr MemVTableMallocFieldCallback
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ MemVTable -> (Ptr MemVTable -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr MemVTable
s ((Ptr MemVTable -> IO ()) -> IO ())
-> (Ptr MemVTable -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr MemVTable
ptr -> do
Ptr (FunPtr MemVTableMallocFieldCallback)
-> FunPtr MemVTableMallocFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr MemVTable
ptr Ptr MemVTable -> Int -> Ptr (FunPtr MemVTableMallocFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (FunPtr MemVTableMallocFieldCallback
val :: FunPtr GLib.Callbacks.C_MemVTableMallocFieldCallback)
clearMemVTableMalloc :: MonadIO m => MemVTable -> m ()
clearMemVTableMalloc :: MemVTable -> m ()
clearMemVTableMalloc MemVTable
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ MemVTable -> (Ptr MemVTable -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr MemVTable
s ((Ptr MemVTable -> IO ()) -> IO ())
-> (Ptr MemVTable -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr MemVTable
ptr -> do
Ptr (FunPtr MemVTableMallocFieldCallback)
-> FunPtr MemVTableMallocFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr MemVTable
ptr Ptr MemVTable -> Int -> Ptr (FunPtr MemVTableMallocFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (FunPtr MemVTableMallocFieldCallback
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_MemVTableMallocFieldCallback)
#if defined(ENABLE_OVERLOADING)
data MemVTableMallocFieldInfo
instance AttrInfo MemVTableMallocFieldInfo where
type AttrBaseTypeConstraint MemVTableMallocFieldInfo = (~) MemVTable
type AttrAllowedOps MemVTableMallocFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint MemVTableMallocFieldInfo = (~) (FunPtr GLib.Callbacks.C_MemVTableMallocFieldCallback)
type AttrTransferTypeConstraint MemVTableMallocFieldInfo = (~)GLib.Callbacks.MemVTableMallocFieldCallback
type AttrTransferType MemVTableMallocFieldInfo = (FunPtr GLib.Callbacks.C_MemVTableMallocFieldCallback)
type AttrGetType MemVTableMallocFieldInfo = Maybe GLib.Callbacks.MemVTableMallocFieldCallback
type AttrLabel MemVTableMallocFieldInfo = "malloc"
type AttrOrigin MemVTableMallocFieldInfo = MemVTable
attrGet = getMemVTableMalloc
attrSet = setMemVTableMalloc
attrConstruct = undefined
attrClear = clearMemVTableMalloc
attrTransfer _ v = do
GLib.Callbacks.mk_MemVTableMallocFieldCallback (GLib.Callbacks.wrap_MemVTableMallocFieldCallback Nothing v)
memVTable_malloc :: AttrLabelProxy "malloc"
memVTable_malloc = AttrLabelProxy
#endif
getMemVTableRealloc :: MonadIO m => MemVTable -> m (Maybe GLib.Callbacks.MemVTableReallocFieldCallback)
getMemVTableRealloc :: MemVTable -> m (Maybe MemVTableReallocFieldCallback)
getMemVTableRealloc MemVTable
s = IO (Maybe MemVTableReallocFieldCallback)
-> m (Maybe MemVTableReallocFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe MemVTableReallocFieldCallback)
-> m (Maybe MemVTableReallocFieldCallback))
-> IO (Maybe MemVTableReallocFieldCallback)
-> m (Maybe MemVTableReallocFieldCallback)
forall a b. (a -> b) -> a -> b
$ MemVTable
-> (Ptr MemVTable -> IO (Maybe MemVTableReallocFieldCallback))
-> IO (Maybe MemVTableReallocFieldCallback)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr MemVTable
s ((Ptr MemVTable -> IO (Maybe MemVTableReallocFieldCallback))
-> IO (Maybe MemVTableReallocFieldCallback))
-> (Ptr MemVTable -> IO (Maybe MemVTableReallocFieldCallback))
-> IO (Maybe MemVTableReallocFieldCallback)
forall a b. (a -> b) -> a -> b
$ \Ptr MemVTable
ptr -> do
FunPtr MemVTableReallocFieldCallback
val <- Ptr (FunPtr MemVTableReallocFieldCallback)
-> IO (FunPtr MemVTableReallocFieldCallback)
forall a. Storable a => Ptr a -> IO a
peek (Ptr MemVTable
ptr Ptr MemVTable -> Int -> Ptr (FunPtr MemVTableReallocFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) :: IO (FunPtr GLib.Callbacks.C_MemVTableReallocFieldCallback)
Maybe MemVTableReallocFieldCallback
result <- FunPtr MemVTableReallocFieldCallback
-> (FunPtr MemVTableReallocFieldCallback
-> IO MemVTableReallocFieldCallback)
-> IO (Maybe MemVTableReallocFieldCallback)
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr MemVTableReallocFieldCallback
val ((FunPtr MemVTableReallocFieldCallback
-> IO MemVTableReallocFieldCallback)
-> IO (Maybe MemVTableReallocFieldCallback))
-> (FunPtr MemVTableReallocFieldCallback
-> IO MemVTableReallocFieldCallback)
-> IO (Maybe MemVTableReallocFieldCallback)
forall a b. (a -> b) -> a -> b
$ \FunPtr MemVTableReallocFieldCallback
val' -> do
let val'' :: MemVTableReallocFieldCallback
val'' = FunPtr MemVTableReallocFieldCallback
-> MemVTableReallocFieldCallback
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr MemVTableReallocFieldCallback
-> Ptr () -> Word64 -> m (Ptr ())
GLib.Callbacks.dynamic_MemVTableReallocFieldCallback FunPtr MemVTableReallocFieldCallback
val'
MemVTableReallocFieldCallback -> IO MemVTableReallocFieldCallback
forall (m :: * -> *) a. Monad m => a -> m a
return MemVTableReallocFieldCallback
val''
Maybe MemVTableReallocFieldCallback
-> IO (Maybe MemVTableReallocFieldCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe MemVTableReallocFieldCallback
result
setMemVTableRealloc :: MonadIO m => MemVTable -> FunPtr GLib.Callbacks.C_MemVTableReallocFieldCallback -> m ()
setMemVTableRealloc :: MemVTable -> FunPtr MemVTableReallocFieldCallback -> m ()
setMemVTableRealloc MemVTable
s FunPtr MemVTableReallocFieldCallback
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ MemVTable -> (Ptr MemVTable -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr MemVTable
s ((Ptr MemVTable -> IO ()) -> IO ())
-> (Ptr MemVTable -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr MemVTable
ptr -> do
Ptr (FunPtr MemVTableReallocFieldCallback)
-> FunPtr MemVTableReallocFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr MemVTable
ptr Ptr MemVTable -> Int -> Ptr (FunPtr MemVTableReallocFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (FunPtr MemVTableReallocFieldCallback
val :: FunPtr GLib.Callbacks.C_MemVTableReallocFieldCallback)
clearMemVTableRealloc :: MonadIO m => MemVTable -> m ()
clearMemVTableRealloc :: MemVTable -> m ()
clearMemVTableRealloc MemVTable
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ MemVTable -> (Ptr MemVTable -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr MemVTable
s ((Ptr MemVTable -> IO ()) -> IO ())
-> (Ptr MemVTable -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr MemVTable
ptr -> do
Ptr (FunPtr MemVTableReallocFieldCallback)
-> FunPtr MemVTableReallocFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr MemVTable
ptr Ptr MemVTable -> Int -> Ptr (FunPtr MemVTableReallocFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (FunPtr MemVTableReallocFieldCallback
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_MemVTableReallocFieldCallback)
#if defined(ENABLE_OVERLOADING)
data MemVTableReallocFieldInfo
instance AttrInfo MemVTableReallocFieldInfo where
type AttrBaseTypeConstraint MemVTableReallocFieldInfo = (~) MemVTable
type AttrAllowedOps MemVTableReallocFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint MemVTableReallocFieldInfo = (~) (FunPtr GLib.Callbacks.C_MemVTableReallocFieldCallback)
type AttrTransferTypeConstraint MemVTableReallocFieldInfo = (~)GLib.Callbacks.MemVTableReallocFieldCallback
type AttrTransferType MemVTableReallocFieldInfo = (FunPtr GLib.Callbacks.C_MemVTableReallocFieldCallback)
type AttrGetType MemVTableReallocFieldInfo = Maybe GLib.Callbacks.MemVTableReallocFieldCallback
type AttrLabel MemVTableReallocFieldInfo = "realloc"
type AttrOrigin MemVTableReallocFieldInfo = MemVTable
attrGet = getMemVTableRealloc
attrSet = setMemVTableRealloc
attrConstruct = undefined
attrClear = clearMemVTableRealloc
attrTransfer _ v = do
GLib.Callbacks.mk_MemVTableReallocFieldCallback (GLib.Callbacks.wrap_MemVTableReallocFieldCallback Nothing v)
memVTable_realloc :: AttrLabelProxy "realloc"
memVTable_realloc = AttrLabelProxy
#endif
getMemVTableFree :: MonadIO m => MemVTable -> m (Maybe GLib.Callbacks.MemVTableFreeFieldCallback)
getMemVTableFree :: MemVTable -> m (Maybe MemVTableFreeFieldCallback)
getMemVTableFree MemVTable
s = IO (Maybe MemVTableFreeFieldCallback)
-> m (Maybe MemVTableFreeFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe MemVTableFreeFieldCallback)
-> m (Maybe MemVTableFreeFieldCallback))
-> IO (Maybe MemVTableFreeFieldCallback)
-> m (Maybe MemVTableFreeFieldCallback)
forall a b. (a -> b) -> a -> b
$ MemVTable
-> (Ptr MemVTable -> IO (Maybe MemVTableFreeFieldCallback))
-> IO (Maybe MemVTableFreeFieldCallback)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr MemVTable
s ((Ptr MemVTable -> IO (Maybe MemVTableFreeFieldCallback))
-> IO (Maybe MemVTableFreeFieldCallback))
-> (Ptr MemVTable -> IO (Maybe MemVTableFreeFieldCallback))
-> IO (Maybe MemVTableFreeFieldCallback)
forall a b. (a -> b) -> a -> b
$ \Ptr MemVTable
ptr -> do
FunPtr MemVTableFreeFieldCallback
val <- Ptr (FunPtr MemVTableFreeFieldCallback)
-> IO (FunPtr MemVTableFreeFieldCallback)
forall a. Storable a => Ptr a -> IO a
peek (Ptr MemVTable
ptr Ptr MemVTable -> Int -> Ptr (FunPtr MemVTableFreeFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) :: IO (FunPtr GLib.Callbacks.C_MemVTableFreeFieldCallback)
Maybe MemVTableFreeFieldCallback
result <- FunPtr MemVTableFreeFieldCallback
-> (FunPtr MemVTableFreeFieldCallback
-> IO MemVTableFreeFieldCallback)
-> IO (Maybe MemVTableFreeFieldCallback)
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr MemVTableFreeFieldCallback
val ((FunPtr MemVTableFreeFieldCallback
-> IO MemVTableFreeFieldCallback)
-> IO (Maybe MemVTableFreeFieldCallback))
-> (FunPtr MemVTableFreeFieldCallback
-> IO MemVTableFreeFieldCallback)
-> IO (Maybe MemVTableFreeFieldCallback)
forall a b. (a -> b) -> a -> b
$ \FunPtr MemVTableFreeFieldCallback
val' -> do
let val'' :: MemVTableFreeFieldCallback
val'' = FunPtr MemVTableFreeFieldCallback -> MemVTableFreeFieldCallback
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr MemVTableFreeFieldCallback -> Ptr () -> m ()
GLib.Callbacks.dynamic_MemVTableFreeFieldCallback FunPtr MemVTableFreeFieldCallback
val'
MemVTableFreeFieldCallback -> IO MemVTableFreeFieldCallback
forall (m :: * -> *) a. Monad m => a -> m a
return MemVTableFreeFieldCallback
val''
Maybe MemVTableFreeFieldCallback
-> IO (Maybe MemVTableFreeFieldCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe MemVTableFreeFieldCallback
result
setMemVTableFree :: MonadIO m => MemVTable -> FunPtr GLib.Callbacks.C_MemVTableFreeFieldCallback -> m ()
setMemVTableFree :: MemVTable -> FunPtr MemVTableFreeFieldCallback -> m ()
setMemVTableFree MemVTable
s FunPtr MemVTableFreeFieldCallback
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ MemVTable -> (Ptr MemVTable -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr MemVTable
s ((Ptr MemVTable -> IO ()) -> IO ())
-> (Ptr MemVTable -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr MemVTable
ptr -> do
Ptr (FunPtr MemVTableFreeFieldCallback)
-> FunPtr MemVTableFreeFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr MemVTable
ptr Ptr MemVTable -> Int -> Ptr (FunPtr MemVTableFreeFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (FunPtr MemVTableFreeFieldCallback
val :: FunPtr GLib.Callbacks.C_MemVTableFreeFieldCallback)
clearMemVTableFree :: MonadIO m => MemVTable -> m ()
clearMemVTableFree :: MemVTable -> m ()
clearMemVTableFree MemVTable
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ MemVTable -> (Ptr MemVTable -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr MemVTable
s ((Ptr MemVTable -> IO ()) -> IO ())
-> (Ptr MemVTable -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr MemVTable
ptr -> do
Ptr (FunPtr MemVTableFreeFieldCallback)
-> FunPtr MemVTableFreeFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr MemVTable
ptr Ptr MemVTable -> Int -> Ptr (FunPtr MemVTableFreeFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (FunPtr MemVTableFreeFieldCallback
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_MemVTableFreeFieldCallback)
#if defined(ENABLE_OVERLOADING)
data MemVTableFreeFieldInfo
instance AttrInfo MemVTableFreeFieldInfo where
type AttrBaseTypeConstraint MemVTableFreeFieldInfo = (~) MemVTable
type AttrAllowedOps MemVTableFreeFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint MemVTableFreeFieldInfo = (~) (FunPtr GLib.Callbacks.C_MemVTableFreeFieldCallback)
type AttrTransferTypeConstraint MemVTableFreeFieldInfo = (~)GLib.Callbacks.MemVTableFreeFieldCallback
type AttrTransferType MemVTableFreeFieldInfo = (FunPtr GLib.Callbacks.C_MemVTableFreeFieldCallback)
type AttrGetType MemVTableFreeFieldInfo = Maybe GLib.Callbacks.MemVTableFreeFieldCallback
type AttrLabel MemVTableFreeFieldInfo = "free"
type AttrOrigin MemVTableFreeFieldInfo = MemVTable
attrGet = getMemVTableFree
attrSet = setMemVTableFree
attrConstruct = undefined
attrClear = clearMemVTableFree
attrTransfer _ v = do
GLib.Callbacks.mk_MemVTableFreeFieldCallback (GLib.Callbacks.wrap_MemVTableFreeFieldCallback Nothing v)
memVTable_free :: AttrLabelProxy "free"
memVTable_free = AttrLabelProxy
#endif
getMemVTableCalloc :: MonadIO m => MemVTable -> m (Maybe GLib.Callbacks.MemVTableCallocFieldCallback)
getMemVTableCalloc :: MemVTable -> m (Maybe MemVTableCallocFieldCallback)
getMemVTableCalloc MemVTable
s = IO (Maybe MemVTableCallocFieldCallback)
-> m (Maybe MemVTableCallocFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe MemVTableCallocFieldCallback)
-> m (Maybe MemVTableCallocFieldCallback))
-> IO (Maybe MemVTableCallocFieldCallback)
-> m (Maybe MemVTableCallocFieldCallback)
forall a b. (a -> b) -> a -> b
$ MemVTable
-> (Ptr MemVTable -> IO (Maybe MemVTableCallocFieldCallback))
-> IO (Maybe MemVTableCallocFieldCallback)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr MemVTable
s ((Ptr MemVTable -> IO (Maybe MemVTableCallocFieldCallback))
-> IO (Maybe MemVTableCallocFieldCallback))
-> (Ptr MemVTable -> IO (Maybe MemVTableCallocFieldCallback))
-> IO (Maybe MemVTableCallocFieldCallback)
forall a b. (a -> b) -> a -> b
$ \Ptr MemVTable
ptr -> do
FunPtr MemVTableCallocFieldCallback
val <- Ptr (FunPtr MemVTableCallocFieldCallback)
-> IO (FunPtr MemVTableCallocFieldCallback)
forall a. Storable a => Ptr a -> IO a
peek (Ptr MemVTable
ptr Ptr MemVTable -> Int -> Ptr (FunPtr MemVTableCallocFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) :: IO (FunPtr GLib.Callbacks.C_MemVTableCallocFieldCallback)
Maybe MemVTableCallocFieldCallback
result <- FunPtr MemVTableCallocFieldCallback
-> (FunPtr MemVTableCallocFieldCallback
-> IO MemVTableCallocFieldCallback)
-> IO (Maybe MemVTableCallocFieldCallback)
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr MemVTableCallocFieldCallback
val ((FunPtr MemVTableCallocFieldCallback
-> IO MemVTableCallocFieldCallback)
-> IO (Maybe MemVTableCallocFieldCallback))
-> (FunPtr MemVTableCallocFieldCallback
-> IO MemVTableCallocFieldCallback)
-> IO (Maybe MemVTableCallocFieldCallback)
forall a b. (a -> b) -> a -> b
$ \FunPtr MemVTableCallocFieldCallback
val' -> do
let val'' :: MemVTableCallocFieldCallback
val'' = FunPtr MemVTableCallocFieldCallback -> MemVTableCallocFieldCallback
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr MemVTableCallocFieldCallback
-> Word64 -> Word64 -> m (Ptr ())
GLib.Callbacks.dynamic_MemVTableCallocFieldCallback FunPtr MemVTableCallocFieldCallback
val'
MemVTableCallocFieldCallback -> IO MemVTableCallocFieldCallback
forall (m :: * -> *) a. Monad m => a -> m a
return MemVTableCallocFieldCallback
val''
Maybe MemVTableCallocFieldCallback
-> IO (Maybe MemVTableCallocFieldCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe MemVTableCallocFieldCallback
result
setMemVTableCalloc :: MonadIO m => MemVTable -> FunPtr GLib.Callbacks.C_MemVTableCallocFieldCallback -> m ()
setMemVTableCalloc :: MemVTable -> FunPtr MemVTableCallocFieldCallback -> m ()
setMemVTableCalloc MemVTable
s FunPtr MemVTableCallocFieldCallback
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ MemVTable -> (Ptr MemVTable -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr MemVTable
s ((Ptr MemVTable -> IO ()) -> IO ())
-> (Ptr MemVTable -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr MemVTable
ptr -> do
Ptr (FunPtr MemVTableCallocFieldCallback)
-> FunPtr MemVTableCallocFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr MemVTable
ptr Ptr MemVTable -> Int -> Ptr (FunPtr MemVTableCallocFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (FunPtr MemVTableCallocFieldCallback
val :: FunPtr GLib.Callbacks.C_MemVTableCallocFieldCallback)
clearMemVTableCalloc :: MonadIO m => MemVTable -> m ()
clearMemVTableCalloc :: MemVTable -> m ()
clearMemVTableCalloc MemVTable
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ MemVTable -> (Ptr MemVTable -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr MemVTable
s ((Ptr MemVTable -> IO ()) -> IO ())
-> (Ptr MemVTable -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr MemVTable
ptr -> do
Ptr (FunPtr MemVTableCallocFieldCallback)
-> FunPtr MemVTableCallocFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr MemVTable
ptr Ptr MemVTable -> Int -> Ptr (FunPtr MemVTableCallocFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (FunPtr MemVTableCallocFieldCallback
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_MemVTableCallocFieldCallback)
#if defined(ENABLE_OVERLOADING)
data MemVTableCallocFieldInfo
instance AttrInfo MemVTableCallocFieldInfo where
type AttrBaseTypeConstraint MemVTableCallocFieldInfo = (~) MemVTable
type AttrAllowedOps MemVTableCallocFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint MemVTableCallocFieldInfo = (~) (FunPtr GLib.Callbacks.C_MemVTableCallocFieldCallback)
type AttrTransferTypeConstraint MemVTableCallocFieldInfo = (~)GLib.Callbacks.MemVTableCallocFieldCallback
type AttrTransferType MemVTableCallocFieldInfo = (FunPtr GLib.Callbacks.C_MemVTableCallocFieldCallback)
type AttrGetType MemVTableCallocFieldInfo = Maybe GLib.Callbacks.MemVTableCallocFieldCallback
type AttrLabel MemVTableCallocFieldInfo = "calloc"
type AttrOrigin MemVTableCallocFieldInfo = MemVTable
attrGet = getMemVTableCalloc
attrSet = setMemVTableCalloc
attrConstruct = undefined
attrClear = clearMemVTableCalloc
attrTransfer _ v = do
GLib.Callbacks.mk_MemVTableCallocFieldCallback (GLib.Callbacks.wrap_MemVTableCallocFieldCallback Nothing v)
memVTable_calloc :: AttrLabelProxy "calloc"
memVTable_calloc = AttrLabelProxy
#endif
getMemVTableTryMalloc :: MonadIO m => MemVTable -> m (Maybe GLib.Callbacks.MemVTableTryMallocFieldCallback)
getMemVTableTryMalloc :: MemVTable -> m (Maybe MemVTableMallocFieldCallback)
getMemVTableTryMalloc MemVTable
s = IO (Maybe MemVTableMallocFieldCallback)
-> m (Maybe MemVTableMallocFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe MemVTableMallocFieldCallback)
-> m (Maybe MemVTableMallocFieldCallback))
-> IO (Maybe MemVTableMallocFieldCallback)
-> m (Maybe MemVTableMallocFieldCallback)
forall a b. (a -> b) -> a -> b
$ MemVTable
-> (Ptr MemVTable -> IO (Maybe MemVTableMallocFieldCallback))
-> IO (Maybe MemVTableMallocFieldCallback)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr MemVTable
s ((Ptr MemVTable -> IO (Maybe MemVTableMallocFieldCallback))
-> IO (Maybe MemVTableMallocFieldCallback))
-> (Ptr MemVTable -> IO (Maybe MemVTableMallocFieldCallback))
-> IO (Maybe MemVTableMallocFieldCallback)
forall a b. (a -> b) -> a -> b
$ \Ptr MemVTable
ptr -> do
FunPtr MemVTableMallocFieldCallback
val <- Ptr (FunPtr MemVTableMallocFieldCallback)
-> IO (FunPtr MemVTableMallocFieldCallback)
forall a. Storable a => Ptr a -> IO a
peek (Ptr MemVTable
ptr Ptr MemVTable -> Int -> Ptr (FunPtr MemVTableMallocFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) :: IO (FunPtr GLib.Callbacks.C_MemVTableTryMallocFieldCallback)
Maybe MemVTableMallocFieldCallback
result <- FunPtr MemVTableMallocFieldCallback
-> (FunPtr MemVTableMallocFieldCallback
-> IO MemVTableMallocFieldCallback)
-> IO (Maybe MemVTableMallocFieldCallback)
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr MemVTableMallocFieldCallback
val ((FunPtr MemVTableMallocFieldCallback
-> IO MemVTableMallocFieldCallback)
-> IO (Maybe MemVTableMallocFieldCallback))
-> (FunPtr MemVTableMallocFieldCallback
-> IO MemVTableMallocFieldCallback)
-> IO (Maybe MemVTableMallocFieldCallback)
forall a b. (a -> b) -> a -> b
$ \FunPtr MemVTableMallocFieldCallback
val' -> do
let val'' :: MemVTableMallocFieldCallback
val'' = FunPtr MemVTableMallocFieldCallback -> MemVTableMallocFieldCallback
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr MemVTableMallocFieldCallback -> Word64 -> m (Ptr ())
GLib.Callbacks.dynamic_MemVTableTryMallocFieldCallback FunPtr MemVTableMallocFieldCallback
val'
MemVTableMallocFieldCallback -> IO MemVTableMallocFieldCallback
forall (m :: * -> *) a. Monad m => a -> m a
return MemVTableMallocFieldCallback
val''
Maybe MemVTableMallocFieldCallback
-> IO (Maybe MemVTableMallocFieldCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe MemVTableMallocFieldCallback
result
setMemVTableTryMalloc :: MonadIO m => MemVTable -> FunPtr GLib.Callbacks.C_MemVTableTryMallocFieldCallback -> m ()
setMemVTableTryMalloc :: MemVTable -> FunPtr MemVTableMallocFieldCallback -> m ()
setMemVTableTryMalloc MemVTable
s FunPtr MemVTableMallocFieldCallback
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ MemVTable -> (Ptr MemVTable -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr MemVTable
s ((Ptr MemVTable -> IO ()) -> IO ())
-> (Ptr MemVTable -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr MemVTable
ptr -> do
Ptr (FunPtr MemVTableMallocFieldCallback)
-> FunPtr MemVTableMallocFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr MemVTable
ptr Ptr MemVTable -> Int -> Ptr (FunPtr MemVTableMallocFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) (FunPtr MemVTableMallocFieldCallback
val :: FunPtr GLib.Callbacks.C_MemVTableTryMallocFieldCallback)
clearMemVTableTryMalloc :: MonadIO m => MemVTable -> m ()
clearMemVTableTryMalloc :: MemVTable -> m ()
clearMemVTableTryMalloc MemVTable
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ MemVTable -> (Ptr MemVTable -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr MemVTable
s ((Ptr MemVTable -> IO ()) -> IO ())
-> (Ptr MemVTable -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr MemVTable
ptr -> do
Ptr (FunPtr MemVTableMallocFieldCallback)
-> FunPtr MemVTableMallocFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr MemVTable
ptr Ptr MemVTable -> Int -> Ptr (FunPtr MemVTableMallocFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) (FunPtr MemVTableMallocFieldCallback
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_MemVTableTryMallocFieldCallback)
#if defined(ENABLE_OVERLOADING)
data MemVTableTryMallocFieldInfo
instance AttrInfo MemVTableTryMallocFieldInfo where
type AttrBaseTypeConstraint MemVTableTryMallocFieldInfo = (~) MemVTable
type AttrAllowedOps MemVTableTryMallocFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint MemVTableTryMallocFieldInfo = (~) (FunPtr GLib.Callbacks.C_MemVTableTryMallocFieldCallback)
type AttrTransferTypeConstraint MemVTableTryMallocFieldInfo = (~)GLib.Callbacks.MemVTableTryMallocFieldCallback
type AttrTransferType MemVTableTryMallocFieldInfo = (FunPtr GLib.Callbacks.C_MemVTableTryMallocFieldCallback)
type AttrGetType MemVTableTryMallocFieldInfo = Maybe GLib.Callbacks.MemVTableTryMallocFieldCallback
type AttrLabel MemVTableTryMallocFieldInfo = "try_malloc"
type AttrOrigin MemVTableTryMallocFieldInfo = MemVTable
attrGet = getMemVTableTryMalloc
attrSet = setMemVTableTryMalloc
attrConstruct = undefined
attrClear = clearMemVTableTryMalloc
attrTransfer _ v = do
GLib.Callbacks.mk_MemVTableTryMallocFieldCallback (GLib.Callbacks.wrap_MemVTableTryMallocFieldCallback Nothing v)
memVTable_tryMalloc :: AttrLabelProxy "tryMalloc"
memVTable_tryMalloc = AttrLabelProxy
#endif
getMemVTableTryRealloc :: MonadIO m => MemVTable -> m (Maybe GLib.Callbacks.MemVTableTryReallocFieldCallback)
getMemVTableTryRealloc :: MemVTable -> m (Maybe MemVTableReallocFieldCallback)
getMemVTableTryRealloc MemVTable
s = IO (Maybe MemVTableReallocFieldCallback)
-> m (Maybe MemVTableReallocFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe MemVTableReallocFieldCallback)
-> m (Maybe MemVTableReallocFieldCallback))
-> IO (Maybe MemVTableReallocFieldCallback)
-> m (Maybe MemVTableReallocFieldCallback)
forall a b. (a -> b) -> a -> b
$ MemVTable
-> (Ptr MemVTable -> IO (Maybe MemVTableReallocFieldCallback))
-> IO (Maybe MemVTableReallocFieldCallback)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr MemVTable
s ((Ptr MemVTable -> IO (Maybe MemVTableReallocFieldCallback))
-> IO (Maybe MemVTableReallocFieldCallback))
-> (Ptr MemVTable -> IO (Maybe MemVTableReallocFieldCallback))
-> IO (Maybe MemVTableReallocFieldCallback)
forall a b. (a -> b) -> a -> b
$ \Ptr MemVTable
ptr -> do
FunPtr MemVTableReallocFieldCallback
val <- Ptr (FunPtr MemVTableReallocFieldCallback)
-> IO (FunPtr MemVTableReallocFieldCallback)
forall a. Storable a => Ptr a -> IO a
peek (Ptr MemVTable
ptr Ptr MemVTable -> Int -> Ptr (FunPtr MemVTableReallocFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40) :: IO (FunPtr GLib.Callbacks.C_MemVTableTryReallocFieldCallback)
Maybe MemVTableReallocFieldCallback
result <- FunPtr MemVTableReallocFieldCallback
-> (FunPtr MemVTableReallocFieldCallback
-> IO MemVTableReallocFieldCallback)
-> IO (Maybe MemVTableReallocFieldCallback)
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr MemVTableReallocFieldCallback
val ((FunPtr MemVTableReallocFieldCallback
-> IO MemVTableReallocFieldCallback)
-> IO (Maybe MemVTableReallocFieldCallback))
-> (FunPtr MemVTableReallocFieldCallback
-> IO MemVTableReallocFieldCallback)
-> IO (Maybe MemVTableReallocFieldCallback)
forall a b. (a -> b) -> a -> b
$ \FunPtr MemVTableReallocFieldCallback
val' -> do
let val'' :: MemVTableReallocFieldCallback
val'' = FunPtr MemVTableReallocFieldCallback
-> MemVTableReallocFieldCallback
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr MemVTableReallocFieldCallback
-> Ptr () -> Word64 -> m (Ptr ())
GLib.Callbacks.dynamic_MemVTableTryReallocFieldCallback FunPtr MemVTableReallocFieldCallback
val'
MemVTableReallocFieldCallback -> IO MemVTableReallocFieldCallback
forall (m :: * -> *) a. Monad m => a -> m a
return MemVTableReallocFieldCallback
val''
Maybe MemVTableReallocFieldCallback
-> IO (Maybe MemVTableReallocFieldCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe MemVTableReallocFieldCallback
result
setMemVTableTryRealloc :: MonadIO m => MemVTable -> FunPtr GLib.Callbacks.C_MemVTableTryReallocFieldCallback -> m ()
setMemVTableTryRealloc :: MemVTable -> FunPtr MemVTableReallocFieldCallback -> m ()
setMemVTableTryRealloc MemVTable
s FunPtr MemVTableReallocFieldCallback
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ MemVTable -> (Ptr MemVTable -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr MemVTable
s ((Ptr MemVTable -> IO ()) -> IO ())
-> (Ptr MemVTable -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr MemVTable
ptr -> do
Ptr (FunPtr MemVTableReallocFieldCallback)
-> FunPtr MemVTableReallocFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr MemVTable
ptr Ptr MemVTable -> Int -> Ptr (FunPtr MemVTableReallocFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40) (FunPtr MemVTableReallocFieldCallback
val :: FunPtr GLib.Callbacks.C_MemVTableTryReallocFieldCallback)
clearMemVTableTryRealloc :: MonadIO m => MemVTable -> m ()
clearMemVTableTryRealloc :: MemVTable -> m ()
clearMemVTableTryRealloc MemVTable
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ MemVTable -> (Ptr MemVTable -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr MemVTable
s ((Ptr MemVTable -> IO ()) -> IO ())
-> (Ptr MemVTable -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr MemVTable
ptr -> do
Ptr (FunPtr MemVTableReallocFieldCallback)
-> FunPtr MemVTableReallocFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr MemVTable
ptr Ptr MemVTable -> Int -> Ptr (FunPtr MemVTableReallocFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40) (FunPtr MemVTableReallocFieldCallback
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_MemVTableTryReallocFieldCallback)
#if defined(ENABLE_OVERLOADING)
data MemVTableTryReallocFieldInfo
instance AttrInfo MemVTableTryReallocFieldInfo where
type AttrBaseTypeConstraint MemVTableTryReallocFieldInfo = (~) MemVTable
type AttrAllowedOps MemVTableTryReallocFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint MemVTableTryReallocFieldInfo = (~) (FunPtr GLib.Callbacks.C_MemVTableTryReallocFieldCallback)
type AttrTransferTypeConstraint MemVTableTryReallocFieldInfo = (~)GLib.Callbacks.MemVTableTryReallocFieldCallback
type AttrTransferType MemVTableTryReallocFieldInfo = (FunPtr GLib.Callbacks.C_MemVTableTryReallocFieldCallback)
type AttrGetType MemVTableTryReallocFieldInfo = Maybe GLib.Callbacks.MemVTableTryReallocFieldCallback
type AttrLabel MemVTableTryReallocFieldInfo = "try_realloc"
type AttrOrigin MemVTableTryReallocFieldInfo = MemVTable
attrGet = getMemVTableTryRealloc
attrSet = setMemVTableTryRealloc
attrConstruct = undefined
attrClear = clearMemVTableTryRealloc
attrTransfer _ v = do
GLib.Callbacks.mk_MemVTableTryReallocFieldCallback (GLib.Callbacks.wrap_MemVTableTryReallocFieldCallback Nothing v)
memVTable_tryRealloc :: AttrLabelProxy "tryRealloc"
memVTable_tryRealloc = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList MemVTable
type instance O.AttributeList MemVTable = MemVTableAttributeList
type MemVTableAttributeList = ('[ '("malloc", MemVTableMallocFieldInfo), '("realloc", MemVTableReallocFieldInfo), '("free", MemVTableFreeFieldInfo), '("calloc", MemVTableCallocFieldInfo), '("tryMalloc", MemVTableTryMallocFieldInfo), '("tryRealloc", MemVTableTryReallocFieldInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveMemVTableMethod (t :: Symbol) (o :: *) :: * where
ResolveMemVTableMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveMemVTableMethod t MemVTable, O.MethodInfo info MemVTable p) => OL.IsLabel t (MemVTable -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif