{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- A table of functions used to handle different types of t'GI.GLib.Structs.IOChannel.IOChannel'
-- in a generic way.

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.GLib.Structs.IOFuncs
    ( 

-- * Exported types
    IOFuncs(..)                             ,
    newZeroIOFuncs                          ,


 -- * Methods
-- ** Overloaded methods #method:Overloaded methods#

#if defined(ENABLE_OVERLOADING)
    ResolveIOFuncsMethod                    ,
#endif




 -- * Properties
-- ** ioClose #attr:ioClose#
-- | /No description available in the introspection data./

    clearIOFuncsIoClose                     ,
    getIOFuncsIoClose                       ,
#if defined(ENABLE_OVERLOADING)
    iOFuncs_ioClose                         ,
#endif
    setIOFuncsIoClose                       ,


-- ** ioCreateWatch #attr:ioCreateWatch#
-- | /No description available in the introspection data./

    clearIOFuncsIoCreateWatch               ,
    getIOFuncsIoCreateWatch                 ,
#if defined(ENABLE_OVERLOADING)
    iOFuncs_ioCreateWatch                   ,
#endif
    setIOFuncsIoCreateWatch                 ,


-- ** ioFree #attr:ioFree#
-- | /No description available in the introspection data./

    clearIOFuncsIoFree                      ,
    getIOFuncsIoFree                        ,
#if defined(ENABLE_OVERLOADING)
    iOFuncs_ioFree                          ,
#endif
    setIOFuncsIoFree                        ,


-- ** ioGetFlags #attr:ioGetFlags#
-- | /No description available in the introspection data./

    clearIOFuncsIoGetFlags                  ,
    getIOFuncsIoGetFlags                    ,
#if defined(ENABLE_OVERLOADING)
    iOFuncs_ioGetFlags                      ,
#endif
    setIOFuncsIoGetFlags                    ,


-- ** ioRead #attr:ioRead#
-- | /No description available in the introspection data./

    clearIOFuncsIoRead                      ,
    getIOFuncsIoRead                        ,
#if defined(ENABLE_OVERLOADING)
    iOFuncs_ioRead                          ,
#endif
    setIOFuncsIoRead                        ,


-- ** ioSeek #attr:ioSeek#
-- | /No description available in the introspection data./

    clearIOFuncsIoSeek                      ,
    getIOFuncsIoSeek                        ,
#if defined(ENABLE_OVERLOADING)
    iOFuncs_ioSeek                          ,
#endif
    setIOFuncsIoSeek                        ,


-- ** ioSetFlags #attr:ioSetFlags#
-- | /No description available in the introspection data./

    clearIOFuncsIoSetFlags                  ,
    getIOFuncsIoSetFlags                    ,
#if defined(ENABLE_OVERLOADING)
    iOFuncs_ioSetFlags                      ,
#endif
    setIOFuncsIoSetFlags                    ,


-- ** ioWrite #attr:ioWrite#
-- | /No description available in the introspection data./

    clearIOFuncsIoWrite                     ,
    getIOFuncsIoWrite                       ,
#if defined(ENABLE_OVERLOADING)
    iOFuncs_ioWrite                         ,
#endif
    setIOFuncsIoWrite                       ,




    ) 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

-- | Memory-managed wrapper type.
newtype IOFuncs = IOFuncs (SP.ManagedPtr IOFuncs)
    deriving (IOFuncs -> IOFuncs -> Bool
(IOFuncs -> IOFuncs -> Bool)
-> (IOFuncs -> IOFuncs -> Bool) -> Eq IOFuncs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IOFuncs -> IOFuncs -> Bool
$c/= :: IOFuncs -> IOFuncs -> Bool
== :: IOFuncs -> IOFuncs -> Bool
$c== :: IOFuncs -> IOFuncs -> Bool
Eq)

instance SP.ManagedPtrNewtype IOFuncs where
    toManagedPtr :: IOFuncs -> ManagedPtr IOFuncs
toManagedPtr (IOFuncs ManagedPtr IOFuncs
p) = ManagedPtr IOFuncs
p

instance BoxedPtr IOFuncs where
    boxedPtrCopy :: IOFuncs -> IO IOFuncs
boxedPtrCopy = \IOFuncs
p -> IOFuncs -> (Ptr IOFuncs -> IO IOFuncs) -> IO IOFuncs
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr IOFuncs
p (Int -> Ptr IOFuncs -> IO (Ptr IOFuncs)
forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
copyBytes Int
64 (Ptr IOFuncs -> IO (Ptr IOFuncs))
-> (Ptr IOFuncs -> IO IOFuncs) -> Ptr IOFuncs -> IO IOFuncs
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> (ManagedPtr IOFuncs -> IOFuncs) -> Ptr IOFuncs -> IO IOFuncs
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.wrapPtr ManagedPtr IOFuncs -> IOFuncs
IOFuncs)
    boxedPtrFree :: IOFuncs -> IO ()
boxedPtrFree = \IOFuncs
x -> IOFuncs -> (Ptr IOFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
SP.withManagedPtr IOFuncs
x Ptr IOFuncs -> IO ()
forall a. Ptr a -> IO ()
SP.freeMem
instance CallocPtr IOFuncs where
    boxedPtrCalloc :: IO (Ptr IOFuncs)
boxedPtrCalloc = Int -> IO (Ptr IOFuncs)
forall a. Int -> IO (Ptr a)
callocBytes Int
64


-- | Construct a `IOFuncs` struct initialized to zero.
newZeroIOFuncs :: MonadIO m => m IOFuncs
newZeroIOFuncs :: m IOFuncs
newZeroIOFuncs = IO IOFuncs -> m IOFuncs
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO IOFuncs -> m IOFuncs) -> IO IOFuncs -> m IOFuncs
forall a b. (a -> b) -> a -> b
$ IO (Ptr IOFuncs)
forall a. CallocPtr a => IO (Ptr a)
boxedPtrCalloc IO (Ptr IOFuncs) -> (Ptr IOFuncs -> IO IOFuncs) -> IO IOFuncs
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr IOFuncs -> IOFuncs) -> Ptr IOFuncs -> IO IOFuncs
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr IOFuncs -> IOFuncs
IOFuncs

instance tag ~ 'AttrSet => Constructible IOFuncs tag where
    new :: (ManagedPtr IOFuncs -> IOFuncs)
-> [AttrOp IOFuncs tag] -> m IOFuncs
new ManagedPtr IOFuncs -> IOFuncs
_ [AttrOp IOFuncs tag]
attrs = do
        IOFuncs
o <- m IOFuncs
forall (m :: * -> *). MonadIO m => m IOFuncs
newZeroIOFuncs
        IOFuncs -> [AttrOp IOFuncs 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set IOFuncs
o [AttrOp IOFuncs tag]
[AttrOp IOFuncs 'AttrSet]
attrs
        IOFuncs -> m IOFuncs
forall (m :: * -> *) a. Monad m => a -> m a
return IOFuncs
o


-- | Get the value of the “@io_read@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' iOFuncs #ioRead
-- @
getIOFuncsIoRead :: MonadIO m => IOFuncs -> m (Maybe GLib.Callbacks.IOFuncsIoReadFieldCallback)
getIOFuncsIoRead :: IOFuncs -> m (Maybe IOFuncsIoReadFieldCallback)
getIOFuncsIoRead IOFuncs
s = IO (Maybe IOFuncsIoReadFieldCallback)
-> m (Maybe IOFuncsIoReadFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe IOFuncsIoReadFieldCallback)
 -> m (Maybe IOFuncsIoReadFieldCallback))
-> IO (Maybe IOFuncsIoReadFieldCallback)
-> m (Maybe IOFuncsIoReadFieldCallback)
forall a b. (a -> b) -> a -> b
$ IOFuncs
-> (Ptr IOFuncs -> IO (Maybe IOFuncsIoReadFieldCallback))
-> IO (Maybe IOFuncsIoReadFieldCallback)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO (Maybe IOFuncsIoReadFieldCallback))
 -> IO (Maybe IOFuncsIoReadFieldCallback))
-> (Ptr IOFuncs -> IO (Maybe IOFuncsIoReadFieldCallback))
-> IO (Maybe IOFuncsIoReadFieldCallback)
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    FunPtr C_IOFuncsIoReadFieldCallback
val <- Ptr (FunPtr C_IOFuncsIoReadFieldCallback)
-> IO (FunPtr C_IOFuncsIoReadFieldCallback)
forall a. Storable a => Ptr a -> IO a
peek (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoReadFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO (FunPtr GLib.Callbacks.C_IOFuncsIoReadFieldCallback)
    Maybe IOFuncsIoReadFieldCallback
result <- FunPtr C_IOFuncsIoReadFieldCallback
-> (FunPtr C_IOFuncsIoReadFieldCallback
    -> IO IOFuncsIoReadFieldCallback)
-> IO (Maybe IOFuncsIoReadFieldCallback)
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr C_IOFuncsIoReadFieldCallback
val ((FunPtr C_IOFuncsIoReadFieldCallback
  -> IO IOFuncsIoReadFieldCallback)
 -> IO (Maybe IOFuncsIoReadFieldCallback))
-> (FunPtr C_IOFuncsIoReadFieldCallback
    -> IO IOFuncsIoReadFieldCallback)
-> IO (Maybe IOFuncsIoReadFieldCallback)
forall a b. (a -> b) -> a -> b
$ \FunPtr C_IOFuncsIoReadFieldCallback
val' -> do
        let val'' :: IOFuncsIoReadFieldCallback
val'' = FunPtr C_IOFuncsIoReadFieldCallback -> IOFuncsIoReadFieldCallback
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_IOFuncsIoReadFieldCallback
-> IOChannel -> Text -> Word64 -> Word64 -> m IOStatus
GLib.Callbacks.dynamic_IOFuncsIoReadFieldCallback FunPtr C_IOFuncsIoReadFieldCallback
val'
        IOFuncsIoReadFieldCallback -> IO IOFuncsIoReadFieldCallback
forall (m :: * -> *) a. Monad m => a -> m a
return IOFuncsIoReadFieldCallback
val''
    Maybe IOFuncsIoReadFieldCallback
-> IO (Maybe IOFuncsIoReadFieldCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe IOFuncsIoReadFieldCallback
result

-- | Set the value of the “@io_read@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' iOFuncs [ #ioRead 'Data.GI.Base.Attributes.:=' value ]
-- @
setIOFuncsIoRead :: MonadIO m => IOFuncs -> FunPtr GLib.Callbacks.C_IOFuncsIoReadFieldCallback -> m ()
setIOFuncsIoRead :: IOFuncs -> FunPtr C_IOFuncsIoReadFieldCallback -> m ()
setIOFuncsIoRead IOFuncs
s FunPtr C_IOFuncsIoReadFieldCallback
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ IOFuncs -> (Ptr IOFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO ()) -> IO ())
-> (Ptr IOFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    Ptr (FunPtr C_IOFuncsIoReadFieldCallback)
-> FunPtr C_IOFuncsIoReadFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoReadFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (FunPtr C_IOFuncsIoReadFieldCallback
val :: FunPtr GLib.Callbacks.C_IOFuncsIoReadFieldCallback)

-- | Set the value of the “@io_read@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #ioRead
-- @
clearIOFuncsIoRead :: MonadIO m => IOFuncs -> m ()
clearIOFuncsIoRead :: IOFuncs -> m ()
clearIOFuncsIoRead IOFuncs
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ IOFuncs -> (Ptr IOFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO ()) -> IO ())
-> (Ptr IOFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    Ptr (FunPtr C_IOFuncsIoReadFieldCallback)
-> FunPtr C_IOFuncsIoReadFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoReadFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (FunPtr C_IOFuncsIoReadFieldCallback
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_IOFuncsIoReadFieldCallback)

#if defined(ENABLE_OVERLOADING)
data IOFuncsIoReadFieldInfo
instance AttrInfo IOFuncsIoReadFieldInfo where
    type AttrBaseTypeConstraint IOFuncsIoReadFieldInfo = (~) IOFuncs
    type AttrAllowedOps IOFuncsIoReadFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint IOFuncsIoReadFieldInfo = (~) (FunPtr GLib.Callbacks.C_IOFuncsIoReadFieldCallback)
    type AttrTransferTypeConstraint IOFuncsIoReadFieldInfo = (~)(FunPtr GLib.Callbacks.C_IOFuncsIoReadFieldCallback)
    type AttrTransferType IOFuncsIoReadFieldInfo = (FunPtr GLib.Callbacks.C_IOFuncsIoReadFieldCallback)
    type AttrGetType IOFuncsIoReadFieldInfo = Maybe GLib.Callbacks.IOFuncsIoReadFieldCallback
    type AttrLabel IOFuncsIoReadFieldInfo = "io_read"
    type AttrOrigin IOFuncsIoReadFieldInfo = IOFuncs
    attrGet = getIOFuncsIoRead
    attrSet = setIOFuncsIoRead
    attrConstruct = undefined
    attrClear = clearIOFuncsIoRead
    attrTransfer _ v = do
        return v

iOFuncs_ioRead :: AttrLabelProxy "ioRead"
iOFuncs_ioRead = AttrLabelProxy

#endif


-- | Get the value of the “@io_write@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' iOFuncs #ioWrite
-- @
getIOFuncsIoWrite :: MonadIO m => IOFuncs -> m (Maybe GLib.Callbacks.IOFuncsIoWriteFieldCallback)
getIOFuncsIoWrite :: IOFuncs -> m (Maybe IOFuncsIoReadFieldCallback)
getIOFuncsIoWrite IOFuncs
s = IO (Maybe IOFuncsIoReadFieldCallback)
-> m (Maybe IOFuncsIoReadFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe IOFuncsIoReadFieldCallback)
 -> m (Maybe IOFuncsIoReadFieldCallback))
-> IO (Maybe IOFuncsIoReadFieldCallback)
-> m (Maybe IOFuncsIoReadFieldCallback)
forall a b. (a -> b) -> a -> b
$ IOFuncs
-> (Ptr IOFuncs -> IO (Maybe IOFuncsIoReadFieldCallback))
-> IO (Maybe IOFuncsIoReadFieldCallback)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO (Maybe IOFuncsIoReadFieldCallback))
 -> IO (Maybe IOFuncsIoReadFieldCallback))
-> (Ptr IOFuncs -> IO (Maybe IOFuncsIoReadFieldCallback))
-> IO (Maybe IOFuncsIoReadFieldCallback)
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    FunPtr C_IOFuncsIoReadFieldCallback
val <- Ptr (FunPtr C_IOFuncsIoReadFieldCallback)
-> IO (FunPtr C_IOFuncsIoReadFieldCallback)
forall a. Storable a => Ptr a -> IO a
peek (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoReadFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) :: IO (FunPtr GLib.Callbacks.C_IOFuncsIoWriteFieldCallback)
    Maybe IOFuncsIoReadFieldCallback
result <- FunPtr C_IOFuncsIoReadFieldCallback
-> (FunPtr C_IOFuncsIoReadFieldCallback
    -> IO IOFuncsIoReadFieldCallback)
-> IO (Maybe IOFuncsIoReadFieldCallback)
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr C_IOFuncsIoReadFieldCallback
val ((FunPtr C_IOFuncsIoReadFieldCallback
  -> IO IOFuncsIoReadFieldCallback)
 -> IO (Maybe IOFuncsIoReadFieldCallback))
-> (FunPtr C_IOFuncsIoReadFieldCallback
    -> IO IOFuncsIoReadFieldCallback)
-> IO (Maybe IOFuncsIoReadFieldCallback)
forall a b. (a -> b) -> a -> b
$ \FunPtr C_IOFuncsIoReadFieldCallback
val' -> do
        let val'' :: IOFuncsIoReadFieldCallback
val'' = FunPtr C_IOFuncsIoReadFieldCallback -> IOFuncsIoReadFieldCallback
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_IOFuncsIoReadFieldCallback
-> IOChannel -> Text -> Word64 -> Word64 -> m IOStatus
GLib.Callbacks.dynamic_IOFuncsIoWriteFieldCallback FunPtr C_IOFuncsIoReadFieldCallback
val'
        IOFuncsIoReadFieldCallback -> IO IOFuncsIoReadFieldCallback
forall (m :: * -> *) a. Monad m => a -> m a
return IOFuncsIoReadFieldCallback
val''
    Maybe IOFuncsIoReadFieldCallback
-> IO (Maybe IOFuncsIoReadFieldCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe IOFuncsIoReadFieldCallback
result

-- | Set the value of the “@io_write@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' iOFuncs [ #ioWrite 'Data.GI.Base.Attributes.:=' value ]
-- @
setIOFuncsIoWrite :: MonadIO m => IOFuncs -> FunPtr GLib.Callbacks.C_IOFuncsIoWriteFieldCallback -> m ()
setIOFuncsIoWrite :: IOFuncs -> FunPtr C_IOFuncsIoReadFieldCallback -> m ()
setIOFuncsIoWrite IOFuncs
s FunPtr C_IOFuncsIoReadFieldCallback
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ IOFuncs -> (Ptr IOFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO ()) -> IO ())
-> (Ptr IOFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    Ptr (FunPtr C_IOFuncsIoReadFieldCallback)
-> FunPtr C_IOFuncsIoReadFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoReadFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (FunPtr C_IOFuncsIoReadFieldCallback
val :: FunPtr GLib.Callbacks.C_IOFuncsIoWriteFieldCallback)

-- | Set the value of the “@io_write@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #ioWrite
-- @
clearIOFuncsIoWrite :: MonadIO m => IOFuncs -> m ()
clearIOFuncsIoWrite :: IOFuncs -> m ()
clearIOFuncsIoWrite IOFuncs
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ IOFuncs -> (Ptr IOFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO ()) -> IO ())
-> (Ptr IOFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    Ptr (FunPtr C_IOFuncsIoReadFieldCallback)
-> FunPtr C_IOFuncsIoReadFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoReadFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (FunPtr C_IOFuncsIoReadFieldCallback
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_IOFuncsIoWriteFieldCallback)

#if defined(ENABLE_OVERLOADING)
data IOFuncsIoWriteFieldInfo
instance AttrInfo IOFuncsIoWriteFieldInfo where
    type AttrBaseTypeConstraint IOFuncsIoWriteFieldInfo = (~) IOFuncs
    type AttrAllowedOps IOFuncsIoWriteFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint IOFuncsIoWriteFieldInfo = (~) (FunPtr GLib.Callbacks.C_IOFuncsIoWriteFieldCallback)
    type AttrTransferTypeConstraint IOFuncsIoWriteFieldInfo = (~)(FunPtr GLib.Callbacks.C_IOFuncsIoWriteFieldCallback)
    type AttrTransferType IOFuncsIoWriteFieldInfo = (FunPtr GLib.Callbacks.C_IOFuncsIoWriteFieldCallback)
    type AttrGetType IOFuncsIoWriteFieldInfo = Maybe GLib.Callbacks.IOFuncsIoWriteFieldCallback
    type AttrLabel IOFuncsIoWriteFieldInfo = "io_write"
    type AttrOrigin IOFuncsIoWriteFieldInfo = IOFuncs
    attrGet = getIOFuncsIoWrite
    attrSet = setIOFuncsIoWrite
    attrConstruct = undefined
    attrClear = clearIOFuncsIoWrite
    attrTransfer _ v = do
        return v

iOFuncs_ioWrite :: AttrLabelProxy "ioWrite"
iOFuncs_ioWrite = AttrLabelProxy

#endif


-- | Get the value of the “@io_seek@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' iOFuncs #ioSeek
-- @
getIOFuncsIoSeek :: MonadIO m => IOFuncs -> m (Maybe GLib.Callbacks.IOFuncsIoSeekFieldCallback)
getIOFuncsIoSeek :: IOFuncs -> m (Maybe IOFuncsIoSeekFieldCallback)
getIOFuncsIoSeek IOFuncs
s = IO (Maybe IOFuncsIoSeekFieldCallback)
-> m (Maybe IOFuncsIoSeekFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe IOFuncsIoSeekFieldCallback)
 -> m (Maybe IOFuncsIoSeekFieldCallback))
-> IO (Maybe IOFuncsIoSeekFieldCallback)
-> m (Maybe IOFuncsIoSeekFieldCallback)
forall a b. (a -> b) -> a -> b
$ IOFuncs
-> (Ptr IOFuncs -> IO (Maybe IOFuncsIoSeekFieldCallback))
-> IO (Maybe IOFuncsIoSeekFieldCallback)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO (Maybe IOFuncsIoSeekFieldCallback))
 -> IO (Maybe IOFuncsIoSeekFieldCallback))
-> (Ptr IOFuncs -> IO (Maybe IOFuncsIoSeekFieldCallback))
-> IO (Maybe IOFuncsIoSeekFieldCallback)
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    FunPtr C_IOFuncsIoSeekFieldCallback
val <- Ptr (FunPtr C_IOFuncsIoSeekFieldCallback)
-> IO (FunPtr C_IOFuncsIoSeekFieldCallback)
forall a. Storable a => Ptr a -> IO a
peek (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoSeekFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) :: IO (FunPtr GLib.Callbacks.C_IOFuncsIoSeekFieldCallback)
    Maybe IOFuncsIoSeekFieldCallback
result <- FunPtr C_IOFuncsIoSeekFieldCallback
-> (FunPtr C_IOFuncsIoSeekFieldCallback
    -> IO IOFuncsIoSeekFieldCallback)
-> IO (Maybe IOFuncsIoSeekFieldCallback)
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr C_IOFuncsIoSeekFieldCallback
val ((FunPtr C_IOFuncsIoSeekFieldCallback
  -> IO IOFuncsIoSeekFieldCallback)
 -> IO (Maybe IOFuncsIoSeekFieldCallback))
-> (FunPtr C_IOFuncsIoSeekFieldCallback
    -> IO IOFuncsIoSeekFieldCallback)
-> IO (Maybe IOFuncsIoSeekFieldCallback)
forall a b. (a -> b) -> a -> b
$ \FunPtr C_IOFuncsIoSeekFieldCallback
val' -> do
        let val'' :: IOFuncsIoSeekFieldCallback
val'' = FunPtr C_IOFuncsIoSeekFieldCallback -> IOFuncsIoSeekFieldCallback
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_IOFuncsIoSeekFieldCallback
-> IOChannel -> Int64 -> SeekType -> m IOStatus
GLib.Callbacks.dynamic_IOFuncsIoSeekFieldCallback FunPtr C_IOFuncsIoSeekFieldCallback
val'
        IOFuncsIoSeekFieldCallback -> IO IOFuncsIoSeekFieldCallback
forall (m :: * -> *) a. Monad m => a -> m a
return IOFuncsIoSeekFieldCallback
val''
    Maybe IOFuncsIoSeekFieldCallback
-> IO (Maybe IOFuncsIoSeekFieldCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe IOFuncsIoSeekFieldCallback
result

-- | Set the value of the “@io_seek@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' iOFuncs [ #ioSeek 'Data.GI.Base.Attributes.:=' value ]
-- @
setIOFuncsIoSeek :: MonadIO m => IOFuncs -> FunPtr GLib.Callbacks.C_IOFuncsIoSeekFieldCallback -> m ()
setIOFuncsIoSeek :: IOFuncs -> FunPtr C_IOFuncsIoSeekFieldCallback -> m ()
setIOFuncsIoSeek IOFuncs
s FunPtr C_IOFuncsIoSeekFieldCallback
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ IOFuncs -> (Ptr IOFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO ()) -> IO ())
-> (Ptr IOFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    Ptr (FunPtr C_IOFuncsIoSeekFieldCallback)
-> FunPtr C_IOFuncsIoSeekFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoSeekFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (FunPtr C_IOFuncsIoSeekFieldCallback
val :: FunPtr GLib.Callbacks.C_IOFuncsIoSeekFieldCallback)

-- | Set the value of the “@io_seek@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #ioSeek
-- @
clearIOFuncsIoSeek :: MonadIO m => IOFuncs -> m ()
clearIOFuncsIoSeek :: IOFuncs -> m ()
clearIOFuncsIoSeek IOFuncs
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ IOFuncs -> (Ptr IOFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO ()) -> IO ())
-> (Ptr IOFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    Ptr (FunPtr C_IOFuncsIoSeekFieldCallback)
-> FunPtr C_IOFuncsIoSeekFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoSeekFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (FunPtr C_IOFuncsIoSeekFieldCallback
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_IOFuncsIoSeekFieldCallback)

#if defined(ENABLE_OVERLOADING)
data IOFuncsIoSeekFieldInfo
instance AttrInfo IOFuncsIoSeekFieldInfo where
    type AttrBaseTypeConstraint IOFuncsIoSeekFieldInfo = (~) IOFuncs
    type AttrAllowedOps IOFuncsIoSeekFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint IOFuncsIoSeekFieldInfo = (~) (FunPtr GLib.Callbacks.C_IOFuncsIoSeekFieldCallback)
    type AttrTransferTypeConstraint IOFuncsIoSeekFieldInfo = (~)(FunPtr GLib.Callbacks.C_IOFuncsIoSeekFieldCallback)
    type AttrTransferType IOFuncsIoSeekFieldInfo = (FunPtr GLib.Callbacks.C_IOFuncsIoSeekFieldCallback)
    type AttrGetType IOFuncsIoSeekFieldInfo = Maybe GLib.Callbacks.IOFuncsIoSeekFieldCallback
    type AttrLabel IOFuncsIoSeekFieldInfo = "io_seek"
    type AttrOrigin IOFuncsIoSeekFieldInfo = IOFuncs
    attrGet = getIOFuncsIoSeek
    attrSet = setIOFuncsIoSeek
    attrConstruct = undefined
    attrClear = clearIOFuncsIoSeek
    attrTransfer _ v = do
        return v

iOFuncs_ioSeek :: AttrLabelProxy "ioSeek"
iOFuncs_ioSeek = AttrLabelProxy

#endif


-- | Get the value of the “@io_close@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' iOFuncs #ioClose
-- @
getIOFuncsIoClose :: MonadIO m => IOFuncs -> m (Maybe GLib.Callbacks.IOFuncsIoCloseFieldCallback)
getIOFuncsIoClose :: IOFuncs -> m (Maybe IOFuncsIoCloseFieldCallback)
getIOFuncsIoClose IOFuncs
s = IO (Maybe IOFuncsIoCloseFieldCallback)
-> m (Maybe IOFuncsIoCloseFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe IOFuncsIoCloseFieldCallback)
 -> m (Maybe IOFuncsIoCloseFieldCallback))
-> IO (Maybe IOFuncsIoCloseFieldCallback)
-> m (Maybe IOFuncsIoCloseFieldCallback)
forall a b. (a -> b) -> a -> b
$ IOFuncs
-> (Ptr IOFuncs -> IO (Maybe IOFuncsIoCloseFieldCallback))
-> IO (Maybe IOFuncsIoCloseFieldCallback)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO (Maybe IOFuncsIoCloseFieldCallback))
 -> IO (Maybe IOFuncsIoCloseFieldCallback))
-> (Ptr IOFuncs -> IO (Maybe IOFuncsIoCloseFieldCallback))
-> IO (Maybe IOFuncsIoCloseFieldCallback)
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    FunPtr C_IOFuncsIoCloseFieldCallback
val <- Ptr (FunPtr C_IOFuncsIoCloseFieldCallback)
-> IO (FunPtr C_IOFuncsIoCloseFieldCallback)
forall a. Storable a => Ptr a -> IO a
peek (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoCloseFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) :: IO (FunPtr GLib.Callbacks.C_IOFuncsIoCloseFieldCallback)
    Maybe IOFuncsIoCloseFieldCallback
result <- FunPtr C_IOFuncsIoCloseFieldCallback
-> (FunPtr C_IOFuncsIoCloseFieldCallback
    -> IO IOFuncsIoCloseFieldCallback)
-> IO (Maybe IOFuncsIoCloseFieldCallback)
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr C_IOFuncsIoCloseFieldCallback
val ((FunPtr C_IOFuncsIoCloseFieldCallback
  -> IO IOFuncsIoCloseFieldCallback)
 -> IO (Maybe IOFuncsIoCloseFieldCallback))
-> (FunPtr C_IOFuncsIoCloseFieldCallback
    -> IO IOFuncsIoCloseFieldCallback)
-> IO (Maybe IOFuncsIoCloseFieldCallback)
forall a b. (a -> b) -> a -> b
$ \FunPtr C_IOFuncsIoCloseFieldCallback
val' -> do
        let val'' :: IOFuncsIoCloseFieldCallback
val'' = FunPtr C_IOFuncsIoCloseFieldCallback -> IOFuncsIoCloseFieldCallback
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_IOFuncsIoCloseFieldCallback -> IOChannel -> m IOStatus
GLib.Callbacks.dynamic_IOFuncsIoCloseFieldCallback FunPtr C_IOFuncsIoCloseFieldCallback
val'
        IOFuncsIoCloseFieldCallback -> IO IOFuncsIoCloseFieldCallback
forall (m :: * -> *) a. Monad m => a -> m a
return IOFuncsIoCloseFieldCallback
val''
    Maybe IOFuncsIoCloseFieldCallback
-> IO (Maybe IOFuncsIoCloseFieldCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe IOFuncsIoCloseFieldCallback
result

-- | Set the value of the “@io_close@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' iOFuncs [ #ioClose 'Data.GI.Base.Attributes.:=' value ]
-- @
setIOFuncsIoClose :: MonadIO m => IOFuncs -> FunPtr GLib.Callbacks.C_IOFuncsIoCloseFieldCallback -> m ()
setIOFuncsIoClose :: IOFuncs -> FunPtr C_IOFuncsIoCloseFieldCallback -> m ()
setIOFuncsIoClose IOFuncs
s FunPtr C_IOFuncsIoCloseFieldCallback
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ IOFuncs -> (Ptr IOFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO ()) -> IO ())
-> (Ptr IOFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    Ptr (FunPtr C_IOFuncsIoCloseFieldCallback)
-> FunPtr C_IOFuncsIoCloseFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoCloseFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (FunPtr C_IOFuncsIoCloseFieldCallback
val :: FunPtr GLib.Callbacks.C_IOFuncsIoCloseFieldCallback)

-- | Set the value of the “@io_close@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #ioClose
-- @
clearIOFuncsIoClose :: MonadIO m => IOFuncs -> m ()
clearIOFuncsIoClose :: IOFuncs -> m ()
clearIOFuncsIoClose IOFuncs
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ IOFuncs -> (Ptr IOFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO ()) -> IO ())
-> (Ptr IOFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    Ptr (FunPtr C_IOFuncsIoCloseFieldCallback)
-> FunPtr C_IOFuncsIoCloseFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoCloseFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (FunPtr C_IOFuncsIoCloseFieldCallback
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_IOFuncsIoCloseFieldCallback)

#if defined(ENABLE_OVERLOADING)
data IOFuncsIoCloseFieldInfo
instance AttrInfo IOFuncsIoCloseFieldInfo where
    type AttrBaseTypeConstraint IOFuncsIoCloseFieldInfo = (~) IOFuncs
    type AttrAllowedOps IOFuncsIoCloseFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint IOFuncsIoCloseFieldInfo = (~) (FunPtr GLib.Callbacks.C_IOFuncsIoCloseFieldCallback)
    type AttrTransferTypeConstraint IOFuncsIoCloseFieldInfo = (~)(FunPtr GLib.Callbacks.C_IOFuncsIoCloseFieldCallback)
    type AttrTransferType IOFuncsIoCloseFieldInfo = (FunPtr GLib.Callbacks.C_IOFuncsIoCloseFieldCallback)
    type AttrGetType IOFuncsIoCloseFieldInfo = Maybe GLib.Callbacks.IOFuncsIoCloseFieldCallback
    type AttrLabel IOFuncsIoCloseFieldInfo = "io_close"
    type AttrOrigin IOFuncsIoCloseFieldInfo = IOFuncs
    attrGet = getIOFuncsIoClose
    attrSet = setIOFuncsIoClose
    attrConstruct = undefined
    attrClear = clearIOFuncsIoClose
    attrTransfer _ v = do
        return v

iOFuncs_ioClose :: AttrLabelProxy "ioClose"
iOFuncs_ioClose = AttrLabelProxy

#endif


-- | Get the value of the “@io_create_watch@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' iOFuncs #ioCreateWatch
-- @
getIOFuncsIoCreateWatch :: MonadIO m => IOFuncs -> m (Maybe GLib.Callbacks.IOFuncsIoCreateWatchFieldCallback)
getIOFuncsIoCreateWatch :: IOFuncs -> m (Maybe IOFuncsIoCreateWatchFieldCallback)
getIOFuncsIoCreateWatch IOFuncs
s = IO (Maybe IOFuncsIoCreateWatchFieldCallback)
-> m (Maybe IOFuncsIoCreateWatchFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe IOFuncsIoCreateWatchFieldCallback)
 -> m (Maybe IOFuncsIoCreateWatchFieldCallback))
-> IO (Maybe IOFuncsIoCreateWatchFieldCallback)
-> m (Maybe IOFuncsIoCreateWatchFieldCallback)
forall a b. (a -> b) -> a -> b
$ IOFuncs
-> (Ptr IOFuncs -> IO (Maybe IOFuncsIoCreateWatchFieldCallback))
-> IO (Maybe IOFuncsIoCreateWatchFieldCallback)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO (Maybe IOFuncsIoCreateWatchFieldCallback))
 -> IO (Maybe IOFuncsIoCreateWatchFieldCallback))
-> (Ptr IOFuncs -> IO (Maybe IOFuncsIoCreateWatchFieldCallback))
-> IO (Maybe IOFuncsIoCreateWatchFieldCallback)
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    FunPtr C_IOFuncsIoCreateWatchFieldCallback
val <- Ptr (FunPtr C_IOFuncsIoCreateWatchFieldCallback)
-> IO (FunPtr C_IOFuncsIoCreateWatchFieldCallback)
forall a. Storable a => Ptr a -> IO a
peek (Ptr IOFuncs
ptr Ptr IOFuncs
-> Int -> Ptr (FunPtr C_IOFuncsIoCreateWatchFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) :: IO (FunPtr GLib.Callbacks.C_IOFuncsIoCreateWatchFieldCallback)
    Maybe IOFuncsIoCreateWatchFieldCallback
result <- FunPtr C_IOFuncsIoCreateWatchFieldCallback
-> (FunPtr C_IOFuncsIoCreateWatchFieldCallback
    -> IO IOFuncsIoCreateWatchFieldCallback)
-> IO (Maybe IOFuncsIoCreateWatchFieldCallback)
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr C_IOFuncsIoCreateWatchFieldCallback
val ((FunPtr C_IOFuncsIoCreateWatchFieldCallback
  -> IO IOFuncsIoCreateWatchFieldCallback)
 -> IO (Maybe IOFuncsIoCreateWatchFieldCallback))
-> (FunPtr C_IOFuncsIoCreateWatchFieldCallback
    -> IO IOFuncsIoCreateWatchFieldCallback)
-> IO (Maybe IOFuncsIoCreateWatchFieldCallback)
forall a b. (a -> b) -> a -> b
$ \FunPtr C_IOFuncsIoCreateWatchFieldCallback
val' -> do
        let val'' :: IOFuncsIoCreateWatchFieldCallback
val'' = FunPtr C_IOFuncsIoCreateWatchFieldCallback
-> IOFuncsIoCreateWatchFieldCallback
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_IOFuncsIoCreateWatchFieldCallback
-> IOChannel -> [IOCondition] -> m Source
GLib.Callbacks.dynamic_IOFuncsIoCreateWatchFieldCallback FunPtr C_IOFuncsIoCreateWatchFieldCallback
val'
        IOFuncsIoCreateWatchFieldCallback
-> IO IOFuncsIoCreateWatchFieldCallback
forall (m :: * -> *) a. Monad m => a -> m a
return IOFuncsIoCreateWatchFieldCallback
val''
    Maybe IOFuncsIoCreateWatchFieldCallback
-> IO (Maybe IOFuncsIoCreateWatchFieldCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe IOFuncsIoCreateWatchFieldCallback
result

-- | Set the value of the “@io_create_watch@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' iOFuncs [ #ioCreateWatch 'Data.GI.Base.Attributes.:=' value ]
-- @
setIOFuncsIoCreateWatch :: MonadIO m => IOFuncs -> FunPtr GLib.Callbacks.C_IOFuncsIoCreateWatchFieldCallback -> m ()
setIOFuncsIoCreateWatch :: IOFuncs -> FunPtr C_IOFuncsIoCreateWatchFieldCallback -> m ()
setIOFuncsIoCreateWatch IOFuncs
s FunPtr C_IOFuncsIoCreateWatchFieldCallback
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ IOFuncs -> (Ptr IOFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO ()) -> IO ())
-> (Ptr IOFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    Ptr (FunPtr C_IOFuncsIoCreateWatchFieldCallback)
-> FunPtr C_IOFuncsIoCreateWatchFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr IOFuncs
ptr Ptr IOFuncs
-> Int -> Ptr (FunPtr C_IOFuncsIoCreateWatchFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) (FunPtr C_IOFuncsIoCreateWatchFieldCallback
val :: FunPtr GLib.Callbacks.C_IOFuncsIoCreateWatchFieldCallback)

-- | Set the value of the “@io_create_watch@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #ioCreateWatch
-- @
clearIOFuncsIoCreateWatch :: MonadIO m => IOFuncs -> m ()
clearIOFuncsIoCreateWatch :: IOFuncs -> m ()
clearIOFuncsIoCreateWatch IOFuncs
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ IOFuncs -> (Ptr IOFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO ()) -> IO ())
-> (Ptr IOFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    Ptr (FunPtr C_IOFuncsIoCreateWatchFieldCallback)
-> FunPtr C_IOFuncsIoCreateWatchFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr IOFuncs
ptr Ptr IOFuncs
-> Int -> Ptr (FunPtr C_IOFuncsIoCreateWatchFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) (FunPtr C_IOFuncsIoCreateWatchFieldCallback
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_IOFuncsIoCreateWatchFieldCallback)

#if defined(ENABLE_OVERLOADING)
data IOFuncsIoCreateWatchFieldInfo
instance AttrInfo IOFuncsIoCreateWatchFieldInfo where
    type AttrBaseTypeConstraint IOFuncsIoCreateWatchFieldInfo = (~) IOFuncs
    type AttrAllowedOps IOFuncsIoCreateWatchFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint IOFuncsIoCreateWatchFieldInfo = (~) (FunPtr GLib.Callbacks.C_IOFuncsIoCreateWatchFieldCallback)
    type AttrTransferTypeConstraint IOFuncsIoCreateWatchFieldInfo = (~)GLib.Callbacks.IOFuncsIoCreateWatchFieldCallback
    type AttrTransferType IOFuncsIoCreateWatchFieldInfo = (FunPtr GLib.Callbacks.C_IOFuncsIoCreateWatchFieldCallback)
    type AttrGetType IOFuncsIoCreateWatchFieldInfo = Maybe GLib.Callbacks.IOFuncsIoCreateWatchFieldCallback
    type AttrLabel IOFuncsIoCreateWatchFieldInfo = "io_create_watch"
    type AttrOrigin IOFuncsIoCreateWatchFieldInfo = IOFuncs
    attrGet = getIOFuncsIoCreateWatch
    attrSet = setIOFuncsIoCreateWatch
    attrConstruct = undefined
    attrClear = clearIOFuncsIoCreateWatch
    attrTransfer _ v = do
        GLib.Callbacks.mk_IOFuncsIoCreateWatchFieldCallback (GLib.Callbacks.wrap_IOFuncsIoCreateWatchFieldCallback Nothing v)

iOFuncs_ioCreateWatch :: AttrLabelProxy "ioCreateWatch"
iOFuncs_ioCreateWatch = AttrLabelProxy

#endif


-- | Get the value of the “@io_free@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' iOFuncs #ioFree
-- @
getIOFuncsIoFree :: MonadIO m => IOFuncs -> m (Maybe GLib.Callbacks.IOFuncsIoFreeFieldCallback)
getIOFuncsIoFree :: IOFuncs -> m (Maybe IOFuncsIoFreeFieldCallback)
getIOFuncsIoFree IOFuncs
s = IO (Maybe IOFuncsIoFreeFieldCallback)
-> m (Maybe IOFuncsIoFreeFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe IOFuncsIoFreeFieldCallback)
 -> m (Maybe IOFuncsIoFreeFieldCallback))
-> IO (Maybe IOFuncsIoFreeFieldCallback)
-> m (Maybe IOFuncsIoFreeFieldCallback)
forall a b. (a -> b) -> a -> b
$ IOFuncs
-> (Ptr IOFuncs -> IO (Maybe IOFuncsIoFreeFieldCallback))
-> IO (Maybe IOFuncsIoFreeFieldCallback)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO (Maybe IOFuncsIoFreeFieldCallback))
 -> IO (Maybe IOFuncsIoFreeFieldCallback))
-> (Ptr IOFuncs -> IO (Maybe IOFuncsIoFreeFieldCallback))
-> IO (Maybe IOFuncsIoFreeFieldCallback)
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    FunPtr C_IOFuncsIoFreeFieldCallback
val <- Ptr (FunPtr C_IOFuncsIoFreeFieldCallback)
-> IO (FunPtr C_IOFuncsIoFreeFieldCallback)
forall a. Storable a => Ptr a -> IO a
peek (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoFreeFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40) :: IO (FunPtr GLib.Callbacks.C_IOFuncsIoFreeFieldCallback)
    Maybe IOFuncsIoFreeFieldCallback
result <- FunPtr C_IOFuncsIoFreeFieldCallback
-> (FunPtr C_IOFuncsIoFreeFieldCallback
    -> IO IOFuncsIoFreeFieldCallback)
-> IO (Maybe IOFuncsIoFreeFieldCallback)
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr C_IOFuncsIoFreeFieldCallback
val ((FunPtr C_IOFuncsIoFreeFieldCallback
  -> IO IOFuncsIoFreeFieldCallback)
 -> IO (Maybe IOFuncsIoFreeFieldCallback))
-> (FunPtr C_IOFuncsIoFreeFieldCallback
    -> IO IOFuncsIoFreeFieldCallback)
-> IO (Maybe IOFuncsIoFreeFieldCallback)
forall a b. (a -> b) -> a -> b
$ \FunPtr C_IOFuncsIoFreeFieldCallback
val' -> do
        let val'' :: IOFuncsIoFreeFieldCallback
val'' = FunPtr C_IOFuncsIoFreeFieldCallback -> IOFuncsIoFreeFieldCallback
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_IOFuncsIoFreeFieldCallback -> IOChannel -> m ()
GLib.Callbacks.dynamic_IOFuncsIoFreeFieldCallback FunPtr C_IOFuncsIoFreeFieldCallback
val'
        IOFuncsIoFreeFieldCallback -> IO IOFuncsIoFreeFieldCallback
forall (m :: * -> *) a. Monad m => a -> m a
return IOFuncsIoFreeFieldCallback
val''
    Maybe IOFuncsIoFreeFieldCallback
-> IO (Maybe IOFuncsIoFreeFieldCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe IOFuncsIoFreeFieldCallback
result

-- | Set the value of the “@io_free@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' iOFuncs [ #ioFree 'Data.GI.Base.Attributes.:=' value ]
-- @
setIOFuncsIoFree :: MonadIO m => IOFuncs -> FunPtr GLib.Callbacks.C_IOFuncsIoFreeFieldCallback -> m ()
setIOFuncsIoFree :: IOFuncs -> FunPtr C_IOFuncsIoFreeFieldCallback -> m ()
setIOFuncsIoFree IOFuncs
s FunPtr C_IOFuncsIoFreeFieldCallback
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ IOFuncs -> (Ptr IOFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO ()) -> IO ())
-> (Ptr IOFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    Ptr (FunPtr C_IOFuncsIoFreeFieldCallback)
-> FunPtr C_IOFuncsIoFreeFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoFreeFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40) (FunPtr C_IOFuncsIoFreeFieldCallback
val :: FunPtr GLib.Callbacks.C_IOFuncsIoFreeFieldCallback)

-- | Set the value of the “@io_free@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #ioFree
-- @
clearIOFuncsIoFree :: MonadIO m => IOFuncs -> m ()
clearIOFuncsIoFree :: IOFuncs -> m ()
clearIOFuncsIoFree IOFuncs
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ IOFuncs -> (Ptr IOFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO ()) -> IO ())
-> (Ptr IOFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    Ptr (FunPtr C_IOFuncsIoFreeFieldCallback)
-> FunPtr C_IOFuncsIoFreeFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoFreeFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40) (FunPtr C_IOFuncsIoFreeFieldCallback
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_IOFuncsIoFreeFieldCallback)

#if defined(ENABLE_OVERLOADING)
data IOFuncsIoFreeFieldInfo
instance AttrInfo IOFuncsIoFreeFieldInfo where
    type AttrBaseTypeConstraint IOFuncsIoFreeFieldInfo = (~) IOFuncs
    type AttrAllowedOps IOFuncsIoFreeFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint IOFuncsIoFreeFieldInfo = (~) (FunPtr GLib.Callbacks.C_IOFuncsIoFreeFieldCallback)
    type AttrTransferTypeConstraint IOFuncsIoFreeFieldInfo = (~)GLib.Callbacks.IOFuncsIoFreeFieldCallback
    type AttrTransferType IOFuncsIoFreeFieldInfo = (FunPtr GLib.Callbacks.C_IOFuncsIoFreeFieldCallback)
    type AttrGetType IOFuncsIoFreeFieldInfo = Maybe GLib.Callbacks.IOFuncsIoFreeFieldCallback
    type AttrLabel IOFuncsIoFreeFieldInfo = "io_free"
    type AttrOrigin IOFuncsIoFreeFieldInfo = IOFuncs
    attrGet = getIOFuncsIoFree
    attrSet = setIOFuncsIoFree
    attrConstruct = undefined
    attrClear = clearIOFuncsIoFree
    attrTransfer _ v = do
        GLib.Callbacks.mk_IOFuncsIoFreeFieldCallback (GLib.Callbacks.wrap_IOFuncsIoFreeFieldCallback Nothing v)

iOFuncs_ioFree :: AttrLabelProxy "ioFree"
iOFuncs_ioFree = AttrLabelProxy

#endif


-- | Get the value of the “@io_set_flags@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' iOFuncs #ioSetFlags
-- @
getIOFuncsIoSetFlags :: MonadIO m => IOFuncs -> m (Maybe GLib.Callbacks.IOFuncsIoSetFlagsFieldCallback)
getIOFuncsIoSetFlags :: IOFuncs -> m (Maybe IOFuncsIoSetFlagsFieldCallback)
getIOFuncsIoSetFlags IOFuncs
s = IO (Maybe IOFuncsIoSetFlagsFieldCallback)
-> m (Maybe IOFuncsIoSetFlagsFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe IOFuncsIoSetFlagsFieldCallback)
 -> m (Maybe IOFuncsIoSetFlagsFieldCallback))
-> IO (Maybe IOFuncsIoSetFlagsFieldCallback)
-> m (Maybe IOFuncsIoSetFlagsFieldCallback)
forall a b. (a -> b) -> a -> b
$ IOFuncs
-> (Ptr IOFuncs -> IO (Maybe IOFuncsIoSetFlagsFieldCallback))
-> IO (Maybe IOFuncsIoSetFlagsFieldCallback)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO (Maybe IOFuncsIoSetFlagsFieldCallback))
 -> IO (Maybe IOFuncsIoSetFlagsFieldCallback))
-> (Ptr IOFuncs -> IO (Maybe IOFuncsIoSetFlagsFieldCallback))
-> IO (Maybe IOFuncsIoSetFlagsFieldCallback)
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    FunPtr C_IOFuncsIoSetFlagsFieldCallback
val <- Ptr (FunPtr C_IOFuncsIoSetFlagsFieldCallback)
-> IO (FunPtr C_IOFuncsIoSetFlagsFieldCallback)
forall a. Storable a => Ptr a -> IO a
peek (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoSetFlagsFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48) :: IO (FunPtr GLib.Callbacks.C_IOFuncsIoSetFlagsFieldCallback)
    Maybe IOFuncsIoSetFlagsFieldCallback
result <- FunPtr C_IOFuncsIoSetFlagsFieldCallback
-> (FunPtr C_IOFuncsIoSetFlagsFieldCallback
    -> IO IOFuncsIoSetFlagsFieldCallback)
-> IO (Maybe IOFuncsIoSetFlagsFieldCallback)
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr C_IOFuncsIoSetFlagsFieldCallback
val ((FunPtr C_IOFuncsIoSetFlagsFieldCallback
  -> IO IOFuncsIoSetFlagsFieldCallback)
 -> IO (Maybe IOFuncsIoSetFlagsFieldCallback))
-> (FunPtr C_IOFuncsIoSetFlagsFieldCallback
    -> IO IOFuncsIoSetFlagsFieldCallback)
-> IO (Maybe IOFuncsIoSetFlagsFieldCallback)
forall a b. (a -> b) -> a -> b
$ \FunPtr C_IOFuncsIoSetFlagsFieldCallback
val' -> do
        let val'' :: IOFuncsIoSetFlagsFieldCallback
val'' = FunPtr C_IOFuncsIoSetFlagsFieldCallback
-> IOFuncsIoSetFlagsFieldCallback
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_IOFuncsIoSetFlagsFieldCallback
-> IOChannel -> [IOFlags] -> m IOStatus
GLib.Callbacks.dynamic_IOFuncsIoSetFlagsFieldCallback FunPtr C_IOFuncsIoSetFlagsFieldCallback
val'
        IOFuncsIoSetFlagsFieldCallback -> IO IOFuncsIoSetFlagsFieldCallback
forall (m :: * -> *) a. Monad m => a -> m a
return IOFuncsIoSetFlagsFieldCallback
val''
    Maybe IOFuncsIoSetFlagsFieldCallback
-> IO (Maybe IOFuncsIoSetFlagsFieldCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe IOFuncsIoSetFlagsFieldCallback
result

-- | Set the value of the “@io_set_flags@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' iOFuncs [ #ioSetFlags 'Data.GI.Base.Attributes.:=' value ]
-- @
setIOFuncsIoSetFlags :: MonadIO m => IOFuncs -> FunPtr GLib.Callbacks.C_IOFuncsIoSetFlagsFieldCallback -> m ()
setIOFuncsIoSetFlags :: IOFuncs -> FunPtr C_IOFuncsIoSetFlagsFieldCallback -> m ()
setIOFuncsIoSetFlags IOFuncs
s FunPtr C_IOFuncsIoSetFlagsFieldCallback
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ IOFuncs -> (Ptr IOFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO ()) -> IO ())
-> (Ptr IOFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    Ptr (FunPtr C_IOFuncsIoSetFlagsFieldCallback)
-> FunPtr C_IOFuncsIoSetFlagsFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoSetFlagsFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48) (FunPtr C_IOFuncsIoSetFlagsFieldCallback
val :: FunPtr GLib.Callbacks.C_IOFuncsIoSetFlagsFieldCallback)

-- | Set the value of the “@io_set_flags@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #ioSetFlags
-- @
clearIOFuncsIoSetFlags :: MonadIO m => IOFuncs -> m ()
clearIOFuncsIoSetFlags :: IOFuncs -> m ()
clearIOFuncsIoSetFlags IOFuncs
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ IOFuncs -> (Ptr IOFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO ()) -> IO ())
-> (Ptr IOFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    Ptr (FunPtr C_IOFuncsIoSetFlagsFieldCallback)
-> FunPtr C_IOFuncsIoSetFlagsFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoSetFlagsFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48) (FunPtr C_IOFuncsIoSetFlagsFieldCallback
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_IOFuncsIoSetFlagsFieldCallback)

#if defined(ENABLE_OVERLOADING)
data IOFuncsIoSetFlagsFieldInfo
instance AttrInfo IOFuncsIoSetFlagsFieldInfo where
    type AttrBaseTypeConstraint IOFuncsIoSetFlagsFieldInfo = (~) IOFuncs
    type AttrAllowedOps IOFuncsIoSetFlagsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint IOFuncsIoSetFlagsFieldInfo = (~) (FunPtr GLib.Callbacks.C_IOFuncsIoSetFlagsFieldCallback)
    type AttrTransferTypeConstraint IOFuncsIoSetFlagsFieldInfo = (~)(FunPtr GLib.Callbacks.C_IOFuncsIoSetFlagsFieldCallback)
    type AttrTransferType IOFuncsIoSetFlagsFieldInfo = (FunPtr GLib.Callbacks.C_IOFuncsIoSetFlagsFieldCallback)
    type AttrGetType IOFuncsIoSetFlagsFieldInfo = Maybe GLib.Callbacks.IOFuncsIoSetFlagsFieldCallback
    type AttrLabel IOFuncsIoSetFlagsFieldInfo = "io_set_flags"
    type AttrOrigin IOFuncsIoSetFlagsFieldInfo = IOFuncs
    attrGet = getIOFuncsIoSetFlags
    attrSet = setIOFuncsIoSetFlags
    attrConstruct = undefined
    attrClear = clearIOFuncsIoSetFlags
    attrTransfer _ v = do
        return v

iOFuncs_ioSetFlags :: AttrLabelProxy "ioSetFlags"
iOFuncs_ioSetFlags = AttrLabelProxy

#endif


-- | Get the value of the “@io_get_flags@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' iOFuncs #ioGetFlags
-- @
getIOFuncsIoGetFlags :: MonadIO m => IOFuncs -> m (Maybe GLib.Callbacks.IOFuncsIoGetFlagsFieldCallback)
getIOFuncsIoGetFlags :: IOFuncs -> m (Maybe IOFuncsIoGetFlagsFieldCallback)
getIOFuncsIoGetFlags IOFuncs
s = IO (Maybe IOFuncsIoGetFlagsFieldCallback)
-> m (Maybe IOFuncsIoGetFlagsFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe IOFuncsIoGetFlagsFieldCallback)
 -> m (Maybe IOFuncsIoGetFlagsFieldCallback))
-> IO (Maybe IOFuncsIoGetFlagsFieldCallback)
-> m (Maybe IOFuncsIoGetFlagsFieldCallback)
forall a b. (a -> b) -> a -> b
$ IOFuncs
-> (Ptr IOFuncs -> IO (Maybe IOFuncsIoGetFlagsFieldCallback))
-> IO (Maybe IOFuncsIoGetFlagsFieldCallback)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO (Maybe IOFuncsIoGetFlagsFieldCallback))
 -> IO (Maybe IOFuncsIoGetFlagsFieldCallback))
-> (Ptr IOFuncs -> IO (Maybe IOFuncsIoGetFlagsFieldCallback))
-> IO (Maybe IOFuncsIoGetFlagsFieldCallback)
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    FunPtr C_IOFuncsIoGetFlagsFieldCallback
val <- Ptr (FunPtr C_IOFuncsIoGetFlagsFieldCallback)
-> IO (FunPtr C_IOFuncsIoGetFlagsFieldCallback)
forall a. Storable a => Ptr a -> IO a
peek (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoGetFlagsFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56) :: IO (FunPtr GLib.Callbacks.C_IOFuncsIoGetFlagsFieldCallback)
    Maybe IOFuncsIoGetFlagsFieldCallback
result <- FunPtr C_IOFuncsIoGetFlagsFieldCallback
-> (FunPtr C_IOFuncsIoGetFlagsFieldCallback
    -> IO IOFuncsIoGetFlagsFieldCallback)
-> IO (Maybe IOFuncsIoGetFlagsFieldCallback)
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr C_IOFuncsIoGetFlagsFieldCallback
val ((FunPtr C_IOFuncsIoGetFlagsFieldCallback
  -> IO IOFuncsIoGetFlagsFieldCallback)
 -> IO (Maybe IOFuncsIoGetFlagsFieldCallback))
-> (FunPtr C_IOFuncsIoGetFlagsFieldCallback
    -> IO IOFuncsIoGetFlagsFieldCallback)
-> IO (Maybe IOFuncsIoGetFlagsFieldCallback)
forall a b. (a -> b) -> a -> b
$ \FunPtr C_IOFuncsIoGetFlagsFieldCallback
val' -> do
        let val'' :: IOFuncsIoGetFlagsFieldCallback
val'' = FunPtr C_IOFuncsIoGetFlagsFieldCallback
-> IOFuncsIoGetFlagsFieldCallback
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_IOFuncsIoGetFlagsFieldCallback -> IOChannel -> m [IOFlags]
GLib.Callbacks.dynamic_IOFuncsIoGetFlagsFieldCallback FunPtr C_IOFuncsIoGetFlagsFieldCallback
val'
        IOFuncsIoGetFlagsFieldCallback -> IO IOFuncsIoGetFlagsFieldCallback
forall (m :: * -> *) a. Monad m => a -> m a
return IOFuncsIoGetFlagsFieldCallback
val''
    Maybe IOFuncsIoGetFlagsFieldCallback
-> IO (Maybe IOFuncsIoGetFlagsFieldCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe IOFuncsIoGetFlagsFieldCallback
result

-- | Set the value of the “@io_get_flags@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' iOFuncs [ #ioGetFlags 'Data.GI.Base.Attributes.:=' value ]
-- @
setIOFuncsIoGetFlags :: MonadIO m => IOFuncs -> FunPtr GLib.Callbacks.C_IOFuncsIoGetFlagsFieldCallback -> m ()
setIOFuncsIoGetFlags :: IOFuncs -> FunPtr C_IOFuncsIoGetFlagsFieldCallback -> m ()
setIOFuncsIoGetFlags IOFuncs
s FunPtr C_IOFuncsIoGetFlagsFieldCallback
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ IOFuncs -> (Ptr IOFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO ()) -> IO ())
-> (Ptr IOFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    Ptr (FunPtr C_IOFuncsIoGetFlagsFieldCallback)
-> FunPtr C_IOFuncsIoGetFlagsFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoGetFlagsFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56) (FunPtr C_IOFuncsIoGetFlagsFieldCallback
val :: FunPtr GLib.Callbacks.C_IOFuncsIoGetFlagsFieldCallback)

-- | Set the value of the “@io_get_flags@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #ioGetFlags
-- @
clearIOFuncsIoGetFlags :: MonadIO m => IOFuncs -> m ()
clearIOFuncsIoGetFlags :: IOFuncs -> m ()
clearIOFuncsIoGetFlags IOFuncs
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ IOFuncs -> (Ptr IOFuncs -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr IOFuncs
s ((Ptr IOFuncs -> IO ()) -> IO ())
-> (Ptr IOFuncs -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IOFuncs
ptr -> do
    Ptr (FunPtr C_IOFuncsIoGetFlagsFieldCallback)
-> FunPtr C_IOFuncsIoGetFlagsFieldCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr IOFuncs
ptr Ptr IOFuncs -> Int -> Ptr (FunPtr C_IOFuncsIoGetFlagsFieldCallback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56) (FunPtr C_IOFuncsIoGetFlagsFieldCallback
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_IOFuncsIoGetFlagsFieldCallback)

#if defined(ENABLE_OVERLOADING)
data IOFuncsIoGetFlagsFieldInfo
instance AttrInfo IOFuncsIoGetFlagsFieldInfo where
    type AttrBaseTypeConstraint IOFuncsIoGetFlagsFieldInfo = (~) IOFuncs
    type AttrAllowedOps IOFuncsIoGetFlagsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint IOFuncsIoGetFlagsFieldInfo = (~) (FunPtr GLib.Callbacks.C_IOFuncsIoGetFlagsFieldCallback)
    type AttrTransferTypeConstraint IOFuncsIoGetFlagsFieldInfo = (~)GLib.Callbacks.IOFuncsIoGetFlagsFieldCallback
    type AttrTransferType IOFuncsIoGetFlagsFieldInfo = (FunPtr GLib.Callbacks.C_IOFuncsIoGetFlagsFieldCallback)
    type AttrGetType IOFuncsIoGetFlagsFieldInfo = Maybe GLib.Callbacks.IOFuncsIoGetFlagsFieldCallback
    type AttrLabel IOFuncsIoGetFlagsFieldInfo = "io_get_flags"
    type AttrOrigin IOFuncsIoGetFlagsFieldInfo = IOFuncs
    attrGet = getIOFuncsIoGetFlags
    attrSet = setIOFuncsIoGetFlags
    attrConstruct = undefined
    attrClear = clearIOFuncsIoGetFlags
    attrTransfer _ v = do
        GLib.Callbacks.mk_IOFuncsIoGetFlagsFieldCallback (GLib.Callbacks.wrap_IOFuncsIoGetFlagsFieldCallback Nothing v)

iOFuncs_ioGetFlags :: AttrLabelProxy "ioGetFlags"
iOFuncs_ioGetFlags = AttrLabelProxy

#endif



#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList IOFuncs
type instance O.AttributeList IOFuncs = IOFuncsAttributeList
type IOFuncsAttributeList = ('[ '("ioRead", IOFuncsIoReadFieldInfo), '("ioWrite", IOFuncsIoWriteFieldInfo), '("ioSeek", IOFuncsIoSeekFieldInfo), '("ioClose", IOFuncsIoCloseFieldInfo), '("ioCreateWatch", IOFuncsIoCreateWatchFieldInfo), '("ioFree", IOFuncsIoFreeFieldInfo), '("ioSetFlags", IOFuncsIoSetFlagsFieldInfo), '("ioGetFlags", IOFuncsIoGetFlagsFieldInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveIOFuncsMethod (t :: Symbol) (o :: *) :: * where
    ResolveIOFuncsMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveIOFuncsMethod t IOFuncs, O.MethodInfo info IOFuncs p) => OL.IsLabel t (IOFuncs -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#endif