-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria

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

module GI.OSTree.Callbacks
    ( 

 -- * Signals


-- ** BootloaderInterfaceGetNameFieldCallback #signal:BootloaderInterfaceGetNameFieldCallback#

    BootloaderInterfaceGetNameFieldCallback ,
    C_BootloaderInterfaceGetNameFieldCallback,
    dynamic_BootloaderInterfaceGetNameFieldCallback,
    genClosure_BootloaderInterfaceGetNameFieldCallback,
    mk_BootloaderInterfaceGetNameFieldCallback,
    noBootloaderInterfaceGetNameFieldCallback,
    wrap_BootloaderInterfaceGetNameFieldCallback,


-- ** BootloaderInterfaceIsAtomicFieldCallback #signal:BootloaderInterfaceIsAtomicFieldCallback#

    BootloaderInterfaceIsAtomicFieldCallback,
    C_BootloaderInterfaceIsAtomicFieldCallback,
    dynamic_BootloaderInterfaceIsAtomicFieldCallback,
    genClosure_BootloaderInterfaceIsAtomicFieldCallback,
    mk_BootloaderInterfaceIsAtomicFieldCallback,
    noBootloaderInterfaceIsAtomicFieldCallback,
    wrap_BootloaderInterfaceIsAtomicFieldCallback,


-- ** BootloaderInterfacePostBlsSyncFieldCallback #signal:BootloaderInterfacePostBlsSyncFieldCallback#

    BootloaderInterfacePostBlsSyncFieldCallback,
    C_BootloaderInterfacePostBlsSyncFieldCallback,
    dynamic_BootloaderInterfacePostBlsSyncFieldCallback,
    mk_BootloaderInterfacePostBlsSyncFieldCallback,
    noBootloaderInterfacePostBlsSyncFieldCallback,


-- ** BootloaderInterfaceQueryFieldCallback #signal:BootloaderInterfaceQueryFieldCallback#

    BootloaderInterfaceQueryFieldCallback   ,
    C_BootloaderInterfaceQueryFieldCallback ,
    dynamic_BootloaderInterfaceQueryFieldCallback,
    mk_BootloaderInterfaceQueryFieldCallback,
    noBootloaderInterfaceQueryFieldCallback ,


-- ** RepoCheckoutFilter #signal:RepoCheckoutFilter#

    C_RepoCheckoutFilter                    ,
    RepoCheckoutFilter                      ,
    RepoCheckoutFilter_WithClosures         ,
    drop_closures_RepoCheckoutFilter        ,
    dynamic_RepoCheckoutFilter              ,
    genClosure_RepoCheckoutFilter           ,
    mk_RepoCheckoutFilter                   ,
    noRepoCheckoutFilter                    ,
    noRepoCheckoutFilter_WithClosures       ,
    wrap_RepoCheckoutFilter                 ,


-- ** RepoCommitFilter #signal:RepoCommitFilter#

    C_RepoCommitFilter                      ,
    RepoCommitFilter                        ,
    RepoCommitFilter_WithClosures           ,
    drop_closures_RepoCommitFilter          ,
    dynamic_RepoCommitFilter                ,
    genClosure_RepoCommitFilter             ,
    mk_RepoCommitFilter                     ,
    noRepoCommitFilter                      ,
    noRepoCommitFilter_WithClosures         ,
    wrap_RepoCommitFilter                   ,


-- ** RepoCommitModifierXattrCallback #signal:RepoCommitModifierXattrCallback#

    C_RepoCommitModifierXattrCallback       ,
    RepoCommitModifierXattrCallback         ,
    RepoCommitModifierXattrCallback_WithClosures,
    drop_closures_RepoCommitModifierXattrCallback,
    dynamic_RepoCommitModifierXattrCallback ,
    genClosure_RepoCommitModifierXattrCallback,
    mk_RepoCommitModifierXattrCallback      ,
    noRepoCommitModifierXattrCallback       ,
    noRepoCommitModifierXattrCallback_WithClosures,
    wrap_RepoCommitModifierXattrCallback    ,


-- ** RepoImportArchiveTranslatePathname #signal:RepoImportArchiveTranslatePathname#

    C_RepoImportArchiveTranslatePathname    ,
    RepoImportArchiveTranslatePathname      ,
    RepoImportArchiveTranslatePathname_WithClosures,
    drop_closures_RepoImportArchiveTranslatePathname,
    dynamic_RepoImportArchiveTranslatePathname,
    genClosure_RepoImportArchiveTranslatePathname,
    mk_RepoImportArchiveTranslatePathname   ,
    noRepoImportArchiveTranslatePathname    ,
    noRepoImportArchiveTranslatePathname_WithClosures,
    wrap_RepoImportArchiveTranslatePathname ,




    ) 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.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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.Coerce as Coerce
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 GHC.Records as R

import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.FileInfo as Gio.FileInfo
import {-# SOURCE #-} qualified GI.OSTree.Enums as OSTree.Enums
import {-# SOURCE #-} qualified GI.OSTree.Objects.Repo as OSTree.Repo
import {-# SOURCE #-} qualified GI.OSTree.Structs.Bootloader as OSTree.Bootloader

-- callback RepoImportArchiveTranslatePathname
{- Callable
  { returnType = Just (TBasicType TUTF8)
  , returnMayBeNull = False
  , returnTransfer = TransferEverything
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "repo"
          , argType =
              TInterface Name { namespace = "OSTree" , name = "Repo" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "stbuf"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "Stat buffer" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "src_path"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "Path in the archive"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "User data" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 3
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Possibly change a pathname while importing an archive. If %NULL is returned,\nthen @src_path will be used unchanged.  Otherwise, return a new pathname which\nwill be freed via `g_free()`.\n\nThis pathname translation will be performed *before* any processing from an\nactive `OstreeRepoCommitModifier`. Will be invoked for all directory and file\ntypes, first with outer directories, then their sub-files and directories.\n\nNote that enabling pathname translation will always override the setting for\n`use_ostree_convention`."
        , sinceVersion = Just "2017.11"
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_RepoImportArchiveTranslatePathname =
    Ptr OSTree.Repo.Repo ->
    Ptr () ->
    CString ->
    Ptr () ->
    IO CString

-- Args: [ Arg
--           { argCName = "repo"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "stbuf"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Stat buffer" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "src_path"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Path in the archive"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "User data" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_RepoImportArchiveTranslatePathname :: FunPtr C_RepoImportArchiveTranslatePathname -> C_RepoImportArchiveTranslatePathname

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_RepoImportArchiveTranslatePathname ::
    (B.CallStack.HasCallStack, MonadIO m, OSTree.Repo.IsRepo a) =>
    FunPtr C_RepoImportArchiveTranslatePathname
    -> a
    -- ^ /@repo@/: Repo
    -> Ptr ()
    -- ^ /@stbuf@/: Stat buffer
    -> T.Text
    -- ^ /@srcPath@/: Path in the archive
    -> Ptr ()
    -- ^ /@userData@/: User data
    -> m T.Text
dynamic_RepoImportArchiveTranslatePathname :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
FunPtr C_RepoImportArchiveTranslatePathname
-> a -> Ptr () -> Text -> Ptr () -> m Text
dynamic_RepoImportArchiveTranslatePathname FunPtr C_RepoImportArchiveTranslatePathname
__funPtr a
repo Ptr ()
stbuf Text
srcPath Ptr ()
userData = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Repo
repo' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
repo
    CString
srcPath' <- Text -> IO CString
textToCString Text
srcPath
    CString
result <- (FunPtr C_RepoImportArchiveTranslatePathname
-> C_RepoImportArchiveTranslatePathname
__dynamic_C_RepoImportArchiveTranslatePathname FunPtr C_RepoImportArchiveTranslatePathname
__funPtr) Ptr Repo
repo' Ptr ()
stbuf CString
srcPath' Ptr ()
userData
    forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"repoImportArchiveTranslatePathname" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
cstringToText CString
result
    forall a. Ptr a -> IO ()
freeMem CString
result
    forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
repo
    forall a. Ptr a -> IO ()
freeMem CString
srcPath'
    forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

-- | Generate a function pointer callable from C code, from a `C_RepoImportArchiveTranslatePathname`.
foreign import ccall "wrapper"
    mk_RepoImportArchiveTranslatePathname :: C_RepoImportArchiveTranslatePathname -> IO (FunPtr C_RepoImportArchiveTranslatePathname)

-- | Possibly change a pathname while importing an archive. If 'P.Nothing' is returned,
-- then /@srcPath@/ will be used unchanged.  Otherwise, return a new pathname which
-- will be freed via @g_free()@.
-- 
-- This pathname translation will be performed *before* any processing from an
-- active @OstreeRepoCommitModifier@. Will be invoked for all directory and file
-- types, first with outer directories, then their sub-files and directories.
-- 
-- Note that enabling pathname translation will always override the setting for
-- @use_ostree_convention@.
-- 
-- /Since: 2017.11/
type RepoImportArchiveTranslatePathname =
    OSTree.Repo.Repo
    -- ^ /@repo@/: Repo
    -> Ptr ()
    -- ^ /@stbuf@/: Stat buffer
    -> T.Text
    -- ^ /@srcPath@/: Path in the archive
    -> IO T.Text

-- | A convenience synonym for @`Nothing` :: `Maybe` `RepoImportArchiveTranslatePathname`@.
noRepoImportArchiveTranslatePathname :: Maybe RepoImportArchiveTranslatePathname
noRepoImportArchiveTranslatePathname :: Maybe RepoImportArchiveTranslatePathname
noRepoImportArchiveTranslatePathname = forall a. Maybe a
Nothing

-- | Possibly change a pathname while importing an archive. If 'P.Nothing' is returned,
-- then /@srcPath@/ will be used unchanged.  Otherwise, return a new pathname which
-- will be freed via @g_free()@.
-- 
-- This pathname translation will be performed *before* any processing from an
-- active @OstreeRepoCommitModifier@. Will be invoked for all directory and file
-- types, first with outer directories, then their sub-files and directories.
-- 
-- Note that enabling pathname translation will always override the setting for
-- @use_ostree_convention@.
-- 
-- /Since: 2017.11/
type RepoImportArchiveTranslatePathname_WithClosures =
    OSTree.Repo.Repo
    -- ^ /@repo@/: Repo
    -> Ptr ()
    -- ^ /@stbuf@/: Stat buffer
    -> T.Text
    -- ^ /@srcPath@/: Path in the archive
    -> Ptr ()
    -- ^ /@userData@/: User data
    -> IO T.Text

-- | A convenience synonym for @`Nothing` :: `Maybe` `RepoImportArchiveTranslatePathname_WithClosures`@.
noRepoImportArchiveTranslatePathname_WithClosures :: Maybe RepoImportArchiveTranslatePathname_WithClosures
noRepoImportArchiveTranslatePathname_WithClosures :: Maybe RepoImportArchiveTranslatePathname_WithClosures
noRepoImportArchiveTranslatePathname_WithClosures = forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_RepoImportArchiveTranslatePathname :: RepoImportArchiveTranslatePathname -> RepoImportArchiveTranslatePathname_WithClosures
drop_closures_RepoImportArchiveTranslatePathname :: RepoImportArchiveTranslatePathname
-> RepoImportArchiveTranslatePathname_WithClosures
drop_closures_RepoImportArchiveTranslatePathname RepoImportArchiveTranslatePathname
_f Repo
repo Ptr ()
stbuf Text
srcPath Ptr ()
_ = RepoImportArchiveTranslatePathname
_f Repo
repo Ptr ()
stbuf Text
srcPath

-- | Wrap the callback into a `GClosure`.
genClosure_RepoImportArchiveTranslatePathname :: MonadIO m => RepoImportArchiveTranslatePathname -> m (GClosure C_RepoImportArchiveTranslatePathname)
genClosure_RepoImportArchiveTranslatePathname :: forall (m :: * -> *).
MonadIO m =>
RepoImportArchiveTranslatePathname
-> m (GClosure C_RepoImportArchiveTranslatePathname)
genClosure_RepoImportArchiveTranslatePathname RepoImportArchiveTranslatePathname
cb = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    let cb' :: RepoImportArchiveTranslatePathname_WithClosures
cb' = RepoImportArchiveTranslatePathname
-> RepoImportArchiveTranslatePathname_WithClosures
drop_closures_RepoImportArchiveTranslatePathname RepoImportArchiveTranslatePathname
cb
    let cb'' :: C_RepoImportArchiveTranslatePathname
cb'' = Maybe (Ptr (FunPtr C_RepoImportArchiveTranslatePathname))
-> RepoImportArchiveTranslatePathname_WithClosures
-> C_RepoImportArchiveTranslatePathname
wrap_RepoImportArchiveTranslatePathname forall a. Maybe a
Nothing RepoImportArchiveTranslatePathname_WithClosures
cb'
    C_RepoImportArchiveTranslatePathname
-> IO (FunPtr C_RepoImportArchiveTranslatePathname)
mk_RepoImportArchiveTranslatePathname C_RepoImportArchiveTranslatePathname
cb'' forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `RepoImportArchiveTranslatePathname` into a `C_RepoImportArchiveTranslatePathname`.
wrap_RepoImportArchiveTranslatePathname :: 
    Maybe (Ptr (FunPtr C_RepoImportArchiveTranslatePathname)) ->
    RepoImportArchiveTranslatePathname_WithClosures ->
    C_RepoImportArchiveTranslatePathname
wrap_RepoImportArchiveTranslatePathname :: Maybe (Ptr (FunPtr C_RepoImportArchiveTranslatePathname))
-> RepoImportArchiveTranslatePathname_WithClosures
-> C_RepoImportArchiveTranslatePathname
wrap_RepoImportArchiveTranslatePathname Maybe (Ptr (FunPtr C_RepoImportArchiveTranslatePathname))
gi'funptrptr RepoImportArchiveTranslatePathname_WithClosures
gi'cb Ptr Repo
repo Ptr ()
stbuf CString
srcPath Ptr ()
userData = do
    Repo
repo' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Repo -> Repo
OSTree.Repo.Repo) Ptr Repo
repo
    Text
srcPath' <- HasCallStack => CString -> IO Text
cstringToText CString
srcPath
    Text
result <- RepoImportArchiveTranslatePathname_WithClosures
gi'cb  Repo
repo' Ptr ()
stbuf Text
srcPath' Ptr ()
userData
    forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_RepoImportArchiveTranslatePathname))
gi'funptrptr
    CString
result' <- Text -> IO CString
textToCString Text
result
    forall (m :: * -> *) a. Monad m => a -> m a
return CString
result'


-- callback RepoCommitModifierXattrCallback
{- Callable
  { returnType = Just TVariant
  , returnMayBeNull = False
  , returnTransfer = TransferEverything
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "repo"
          , argType =
              TInterface Name { namespace = "OSTree" , name = "Repo" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "path"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "file_info"
          , argType =
              TInterface Name { namespace = "Gio" , name = "FileInfo" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 3
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_RepoCommitModifierXattrCallback =
    Ptr OSTree.Repo.Repo ->
    CString ->
    Ptr Gio.FileInfo.FileInfo ->
    Ptr () ->
    IO (Ptr GVariant)

-- Args: [ Arg
--           { argCName = "repo"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "path"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "file_info"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "FileInfo" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just TVariant
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_RepoCommitModifierXattrCallback :: FunPtr C_RepoCommitModifierXattrCallback -> C_RepoCommitModifierXattrCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_RepoCommitModifierXattrCallback ::
    (B.CallStack.HasCallStack, MonadIO m, OSTree.Repo.IsRepo a, Gio.FileInfo.IsFileInfo b) =>
    FunPtr C_RepoCommitModifierXattrCallback
    -> a
    -> T.Text
    -> b
    -> Ptr ()
    -> m GVariant
dynamic_RepoCommitModifierXattrCallback :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsFileInfo b) =>
FunPtr C_RepoCommitModifierXattrCallback
-> a -> Text -> b -> Ptr () -> m GVariant
dynamic_RepoCommitModifierXattrCallback FunPtr C_RepoCommitModifierXattrCallback
__funPtr a
repo Text
path b
fileInfo Ptr ()
userData = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Repo
repo' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
repo
    CString
path' <- Text -> IO CString
textToCString Text
path
    Ptr FileInfo
fileInfo' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
fileInfo
    Ptr GVariant
result <- (FunPtr C_RepoCommitModifierXattrCallback
-> C_RepoCommitModifierXattrCallback
__dynamic_C_RepoCommitModifierXattrCallback FunPtr C_RepoCommitModifierXattrCallback
__funPtr) Ptr Repo
repo' CString
path' Ptr FileInfo
fileInfo' Ptr ()
userData
    forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"repoCommitModifierXattrCallback" Ptr GVariant
result
    GVariant
result' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
result
    forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
repo
    forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
fileInfo
    forall a. Ptr a -> IO ()
freeMem CString
path'
    forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
result'

-- | Generate a function pointer callable from C code, from a `C_RepoCommitModifierXattrCallback`.
foreign import ccall "wrapper"
    mk_RepoCommitModifierXattrCallback :: C_RepoCommitModifierXattrCallback -> IO (FunPtr C_RepoCommitModifierXattrCallback)

-- | /No description available in the introspection data./
type RepoCommitModifierXattrCallback =
    OSTree.Repo.Repo
    -> T.Text
    -> Gio.FileInfo.FileInfo
    -> IO GVariant

-- | A convenience synonym for @`Nothing` :: `Maybe` `RepoCommitModifierXattrCallback`@.
noRepoCommitModifierXattrCallback :: Maybe RepoCommitModifierXattrCallback
noRepoCommitModifierXattrCallback :: Maybe RepoCommitModifierXattrCallback
noRepoCommitModifierXattrCallback = forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type RepoCommitModifierXattrCallback_WithClosures =
    OSTree.Repo.Repo
    -> T.Text
    -> Gio.FileInfo.FileInfo
    -> Ptr ()
    -> IO GVariant

-- | A convenience synonym for @`Nothing` :: `Maybe` `RepoCommitModifierXattrCallback_WithClosures`@.
noRepoCommitModifierXattrCallback_WithClosures :: Maybe RepoCommitModifierXattrCallback_WithClosures
noRepoCommitModifierXattrCallback_WithClosures :: Maybe RepoCommitModifierXattrCallback_WithClosures
noRepoCommitModifierXattrCallback_WithClosures = forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_RepoCommitModifierXattrCallback :: RepoCommitModifierXattrCallback -> RepoCommitModifierXattrCallback_WithClosures
drop_closures_RepoCommitModifierXattrCallback :: RepoCommitModifierXattrCallback
-> RepoCommitModifierXattrCallback_WithClosures
drop_closures_RepoCommitModifierXattrCallback RepoCommitModifierXattrCallback
_f Repo
repo Text
path FileInfo
fileInfo Ptr ()
_ = RepoCommitModifierXattrCallback
_f Repo
repo Text
path FileInfo
fileInfo

-- | Wrap the callback into a `GClosure`.
genClosure_RepoCommitModifierXattrCallback :: MonadIO m => RepoCommitModifierXattrCallback -> m (GClosure C_RepoCommitModifierXattrCallback)
genClosure_RepoCommitModifierXattrCallback :: forall (m :: * -> *).
MonadIO m =>
RepoCommitModifierXattrCallback
-> m (GClosure C_RepoCommitModifierXattrCallback)
genClosure_RepoCommitModifierXattrCallback RepoCommitModifierXattrCallback
cb = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    let cb' :: RepoCommitModifierXattrCallback_WithClosures
cb' = RepoCommitModifierXattrCallback
-> RepoCommitModifierXattrCallback_WithClosures
drop_closures_RepoCommitModifierXattrCallback RepoCommitModifierXattrCallback
cb
    let cb'' :: C_RepoCommitModifierXattrCallback
cb'' = Maybe (Ptr (FunPtr C_RepoCommitModifierXattrCallback))
-> RepoCommitModifierXattrCallback_WithClosures
-> C_RepoCommitModifierXattrCallback
wrap_RepoCommitModifierXattrCallback forall a. Maybe a
Nothing RepoCommitModifierXattrCallback_WithClosures
cb'
    C_RepoCommitModifierXattrCallback
-> IO (FunPtr C_RepoCommitModifierXattrCallback)
mk_RepoCommitModifierXattrCallback C_RepoCommitModifierXattrCallback
cb'' forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `RepoCommitModifierXattrCallback` into a `C_RepoCommitModifierXattrCallback`.
wrap_RepoCommitModifierXattrCallback :: 
    Maybe (Ptr (FunPtr C_RepoCommitModifierXattrCallback)) ->
    RepoCommitModifierXattrCallback_WithClosures ->
    C_RepoCommitModifierXattrCallback
wrap_RepoCommitModifierXattrCallback :: Maybe (Ptr (FunPtr C_RepoCommitModifierXattrCallback))
-> RepoCommitModifierXattrCallback_WithClosures
-> C_RepoCommitModifierXattrCallback
wrap_RepoCommitModifierXattrCallback Maybe (Ptr (FunPtr C_RepoCommitModifierXattrCallback))
gi'funptrptr RepoCommitModifierXattrCallback_WithClosures
gi'cb Ptr Repo
repo CString
path Ptr FileInfo
fileInfo Ptr ()
userData = do
    Repo
repo' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Repo -> Repo
OSTree.Repo.Repo) Ptr Repo
repo
    Text
path' <- HasCallStack => CString -> IO Text
cstringToText CString
path
    FileInfo
fileInfo' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr FileInfo -> FileInfo
Gio.FileInfo.FileInfo) Ptr FileInfo
fileInfo
    GVariant
result <- RepoCommitModifierXattrCallback_WithClosures
gi'cb  Repo
repo' Text
path' FileInfo
fileInfo' Ptr ()
userData
    forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_RepoCommitModifierXattrCallback))
gi'funptrptr
    Ptr GVariant
result' <- GVariant -> IO (Ptr GVariant)
B.GVariant.disownGVariant GVariant
result
    forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
result'


-- callback RepoCommitFilter
{- Callable
  { returnType =
      Just
        (TInterface
           Name { namespace = "OSTree" , name = "RepoCommitFilterResult" })
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just
              "#OstreeRepoCommitFilterResult saying whether or not to commit this file"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "repo"
          , argType =
              TInterface Name { namespace = "OSTree" , name = "Repo" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "path"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "Path to file" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "file_info"
          , argType =
              TInterface Name { namespace = "Gio" , name = "FileInfo" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "File information" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "User data" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 3
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_RepoCommitFilter =
    Ptr OSTree.Repo.Repo ->
    CString ->
    Ptr Gio.FileInfo.FileInfo ->
    Ptr () ->
    IO CUInt

-- Args: [ Arg
--           { argCName = "repo"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "path"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Path to file" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "file_info"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "FileInfo" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "File information" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "User data" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "OSTree" , name = "RepoCommitFilterResult" })
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_RepoCommitFilter :: FunPtr C_RepoCommitFilter -> C_RepoCommitFilter

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_RepoCommitFilter ::
    (B.CallStack.HasCallStack, MonadIO m, OSTree.Repo.IsRepo a, Gio.FileInfo.IsFileInfo b) =>
    FunPtr C_RepoCommitFilter
    -> a
    -- ^ /@repo@/: Repo
    -> T.Text
    -- ^ /@path@/: Path to file
    -> b
    -- ^ /@fileInfo@/: File information
    -> Ptr ()
    -- ^ /@userData@/: User data
    -> m OSTree.Enums.RepoCommitFilterResult
    -- ^ __Returns:__ t'GI.OSTree.Enums.RepoCommitFilterResult' saying whether or not to commit this file
dynamic_RepoCommitFilter :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsFileInfo b) =>
FunPtr C_RepoCommitFilter
-> a -> Text -> b -> Ptr () -> m RepoCommitFilterResult
dynamic_RepoCommitFilter FunPtr C_RepoCommitFilter
__funPtr a
repo Text
path b
fileInfo Ptr ()
userData = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Repo
repo' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
repo
    CString
path' <- Text -> IO CString
textToCString Text
path
    Ptr FileInfo
fileInfo' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
fileInfo
    CUInt
result <- (FunPtr C_RepoCommitFilter -> C_RepoCommitFilter
__dynamic_C_RepoCommitFilter FunPtr C_RepoCommitFilter
__funPtr) Ptr Repo
repo' CString
path' Ptr FileInfo
fileInfo' Ptr ()
userData
    let result' :: RepoCommitFilterResult
result' = (forall a. Enum a => Int -> a
toEnum forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
repo
    forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
fileInfo
    forall a. Ptr a -> IO ()
freeMem CString
path'
    forall (m :: * -> *) a. Monad m => a -> m a
return RepoCommitFilterResult
result'

-- | Generate a function pointer callable from C code, from a `C_RepoCommitFilter`.
foreign import ccall "wrapper"
    mk_RepoCommitFilter :: C_RepoCommitFilter -> IO (FunPtr C_RepoCommitFilter)

-- | /No description available in the introspection data./
type RepoCommitFilter =
    OSTree.Repo.Repo
    -- ^ /@repo@/: Repo
    -> T.Text
    -- ^ /@path@/: Path to file
    -> Gio.FileInfo.FileInfo
    -- ^ /@fileInfo@/: File information
    -> IO OSTree.Enums.RepoCommitFilterResult
    -- ^ __Returns:__ t'GI.OSTree.Enums.RepoCommitFilterResult' saying whether or not to commit this file

-- | A convenience synonym for @`Nothing` :: `Maybe` `RepoCommitFilter`@.
noRepoCommitFilter :: Maybe RepoCommitFilter
noRepoCommitFilter :: Maybe RepoCommitFilter
noRepoCommitFilter = forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type RepoCommitFilter_WithClosures =
    OSTree.Repo.Repo
    -- ^ /@repo@/: Repo
    -> T.Text
    -- ^ /@path@/: Path to file
    -> Gio.FileInfo.FileInfo
    -- ^ /@fileInfo@/: File information
    -> Ptr ()
    -- ^ /@userData@/: User data
    -> IO OSTree.Enums.RepoCommitFilterResult
    -- ^ __Returns:__ t'GI.OSTree.Enums.RepoCommitFilterResult' saying whether or not to commit this file

-- | A convenience synonym for @`Nothing` :: `Maybe` `RepoCommitFilter_WithClosures`@.
noRepoCommitFilter_WithClosures :: Maybe RepoCommitFilter_WithClosures
noRepoCommitFilter_WithClosures :: Maybe RepoCommitFilter_WithClosures
noRepoCommitFilter_WithClosures = forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_RepoCommitFilter :: RepoCommitFilter -> RepoCommitFilter_WithClosures
drop_closures_RepoCommitFilter :: RepoCommitFilter -> RepoCommitFilter_WithClosures
drop_closures_RepoCommitFilter RepoCommitFilter
_f Repo
repo Text
path FileInfo
fileInfo Ptr ()
_ = RepoCommitFilter
_f Repo
repo Text
path FileInfo
fileInfo

-- | Wrap the callback into a `GClosure`.
genClosure_RepoCommitFilter :: MonadIO m => RepoCommitFilter -> m (GClosure C_RepoCommitFilter)
genClosure_RepoCommitFilter :: forall (m :: * -> *).
MonadIO m =>
RepoCommitFilter -> m (GClosure C_RepoCommitFilter)
genClosure_RepoCommitFilter RepoCommitFilter
cb = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    let cb' :: RepoCommitFilter_WithClosures
cb' = RepoCommitFilter -> RepoCommitFilter_WithClosures
drop_closures_RepoCommitFilter RepoCommitFilter
cb
    let cb'' :: C_RepoCommitFilter
cb'' = Maybe (Ptr (FunPtr C_RepoCommitFilter))
-> RepoCommitFilter_WithClosures -> C_RepoCommitFilter
wrap_RepoCommitFilter forall a. Maybe a
Nothing RepoCommitFilter_WithClosures
cb'
    C_RepoCommitFilter -> IO (FunPtr C_RepoCommitFilter)
mk_RepoCommitFilter C_RepoCommitFilter
cb'' forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `RepoCommitFilter` into a `C_RepoCommitFilter`.
wrap_RepoCommitFilter :: 
    Maybe (Ptr (FunPtr C_RepoCommitFilter)) ->
    RepoCommitFilter_WithClosures ->
    C_RepoCommitFilter
wrap_RepoCommitFilter :: Maybe (Ptr (FunPtr C_RepoCommitFilter))
-> RepoCommitFilter_WithClosures -> C_RepoCommitFilter
wrap_RepoCommitFilter Maybe (Ptr (FunPtr C_RepoCommitFilter))
gi'funptrptr RepoCommitFilter_WithClosures
gi'cb Ptr Repo
repo CString
path Ptr FileInfo
fileInfo Ptr ()
userData = do
    Repo
repo' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Repo -> Repo
OSTree.Repo.Repo) Ptr Repo
repo
    Text
path' <- HasCallStack => CString -> IO Text
cstringToText CString
path
    FileInfo
fileInfo' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr FileInfo -> FileInfo
Gio.FileInfo.FileInfo) Ptr FileInfo
fileInfo
    RepoCommitFilterResult
result <- RepoCommitFilter_WithClosures
gi'cb  Repo
repo' Text
path' FileInfo
fileInfo' Ptr ()
userData
    forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_RepoCommitFilter))
gi'funptrptr
    let result' :: CUInt
result' = (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Enum a => a -> Int
fromEnum) RepoCommitFilterResult
result
    forall (m :: * -> *) a. Monad m => a -> m a
return CUInt
result'


-- callback RepoCheckoutFilter
{- Callable
  { returnType =
      Just
        (TInterface
           Name { namespace = "OSTree" , name = "RepoCheckoutFilterResult" })
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just
              "#OstreeRepoCheckoutFilterResult saying whether or not to checkout this file"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "repo"
          , argType =
              TInterface Name { namespace = "OSTree" , name = "Repo" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "path"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "Path to file" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "stbuf"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "File information" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "User data" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 3
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText = Nothing , sinceVersion = Just "2018.2" }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_RepoCheckoutFilter =
    Ptr OSTree.Repo.Repo ->
    CString ->
    Ptr () ->
    Ptr () ->
    IO CUInt

-- Args: [ Arg
--           { argCName = "repo"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "path"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Path to file" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "stbuf"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "File information" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "User data" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "OSTree" , name = "RepoCheckoutFilterResult" })
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_RepoCheckoutFilter :: FunPtr C_RepoCheckoutFilter -> C_RepoCheckoutFilter

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_RepoCheckoutFilter ::
    (B.CallStack.HasCallStack, MonadIO m, OSTree.Repo.IsRepo a) =>
    FunPtr C_RepoCheckoutFilter
    -> a
    -- ^ /@repo@/: Repo
    -> T.Text
    -- ^ /@path@/: Path to file
    -> Ptr ()
    -- ^ /@stbuf@/: File information
    -> Ptr ()
    -- ^ /@userData@/: User data
    -> m OSTree.Enums.RepoCheckoutFilterResult
    -- ^ __Returns:__ t'GI.OSTree.Enums.RepoCheckoutFilterResult' saying whether or not to checkout this file
dynamic_RepoCheckoutFilter :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
FunPtr C_RepoCheckoutFilter
-> a -> Text -> Ptr () -> Ptr () -> m RepoCheckoutFilterResult
dynamic_RepoCheckoutFilter FunPtr C_RepoCheckoutFilter
__funPtr a
repo Text
path Ptr ()
stbuf Ptr ()
userData = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Repo
repo' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
repo
    CString
path' <- Text -> IO CString
textToCString Text
path
    CUInt
result <- (FunPtr C_RepoCheckoutFilter -> C_RepoCheckoutFilter
__dynamic_C_RepoCheckoutFilter FunPtr C_RepoCheckoutFilter
__funPtr) Ptr Repo
repo' CString
path' Ptr ()
stbuf Ptr ()
userData
    let result' :: RepoCheckoutFilterResult
result' = (forall a. Enum a => Int -> a
toEnum forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
repo
    forall a. Ptr a -> IO ()
freeMem CString
path'
    forall (m :: * -> *) a. Monad m => a -> m a
return RepoCheckoutFilterResult
result'

-- | Generate a function pointer callable from C code, from a `C_RepoCheckoutFilter`.
foreign import ccall "wrapper"
    mk_RepoCheckoutFilter :: C_RepoCheckoutFilter -> IO (FunPtr C_RepoCheckoutFilter)

-- | /No description available in the introspection data./
-- 
-- /Since: 2018.2/
type RepoCheckoutFilter =
    OSTree.Repo.Repo
    -- ^ /@repo@/: Repo
    -> T.Text
    -- ^ /@path@/: Path to file
    -> Ptr ()
    -- ^ /@stbuf@/: File information
    -> IO OSTree.Enums.RepoCheckoutFilterResult
    -- ^ __Returns:__ t'GI.OSTree.Enums.RepoCheckoutFilterResult' saying whether or not to checkout this file

-- | A convenience synonym for @`Nothing` :: `Maybe` `RepoCheckoutFilter`@.
noRepoCheckoutFilter :: Maybe RepoCheckoutFilter
noRepoCheckoutFilter :: Maybe RepoCheckoutFilter
noRepoCheckoutFilter = forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
-- 
-- /Since: 2018.2/
type RepoCheckoutFilter_WithClosures =
    OSTree.Repo.Repo
    -- ^ /@repo@/: Repo
    -> T.Text
    -- ^ /@path@/: Path to file
    -> Ptr ()
    -- ^ /@stbuf@/: File information
    -> Ptr ()
    -- ^ /@userData@/: User data
    -> IO OSTree.Enums.RepoCheckoutFilterResult
    -- ^ __Returns:__ t'GI.OSTree.Enums.RepoCheckoutFilterResult' saying whether or not to checkout this file

-- | A convenience synonym for @`Nothing` :: `Maybe` `RepoCheckoutFilter_WithClosures`@.
noRepoCheckoutFilter_WithClosures :: Maybe RepoCheckoutFilter_WithClosures
noRepoCheckoutFilter_WithClosures :: Maybe RepoCheckoutFilter_WithClosures
noRepoCheckoutFilter_WithClosures = forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_RepoCheckoutFilter :: RepoCheckoutFilter -> RepoCheckoutFilter_WithClosures
drop_closures_RepoCheckoutFilter :: RepoCheckoutFilter -> RepoCheckoutFilter_WithClosures
drop_closures_RepoCheckoutFilter RepoCheckoutFilter
_f Repo
repo Text
path Ptr ()
stbuf Ptr ()
_ = RepoCheckoutFilter
_f Repo
repo Text
path Ptr ()
stbuf

-- | Wrap the callback into a `GClosure`.
genClosure_RepoCheckoutFilter :: MonadIO m => RepoCheckoutFilter -> m (GClosure C_RepoCheckoutFilter)
genClosure_RepoCheckoutFilter :: forall (m :: * -> *).
MonadIO m =>
RepoCheckoutFilter -> m (GClosure C_RepoCheckoutFilter)
genClosure_RepoCheckoutFilter RepoCheckoutFilter
cb = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    let cb' :: RepoCheckoutFilter_WithClosures
cb' = RepoCheckoutFilter -> RepoCheckoutFilter_WithClosures
drop_closures_RepoCheckoutFilter RepoCheckoutFilter
cb
    let cb'' :: C_RepoCheckoutFilter
cb'' = Maybe (Ptr (FunPtr C_RepoCheckoutFilter))
-> RepoCheckoutFilter_WithClosures -> C_RepoCheckoutFilter
wrap_RepoCheckoutFilter forall a. Maybe a
Nothing RepoCheckoutFilter_WithClosures
cb'
    C_RepoCheckoutFilter -> IO (FunPtr C_RepoCheckoutFilter)
mk_RepoCheckoutFilter C_RepoCheckoutFilter
cb'' forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `RepoCheckoutFilter` into a `C_RepoCheckoutFilter`.
wrap_RepoCheckoutFilter :: 
    Maybe (Ptr (FunPtr C_RepoCheckoutFilter)) ->
    RepoCheckoutFilter_WithClosures ->
    C_RepoCheckoutFilter
wrap_RepoCheckoutFilter :: Maybe (Ptr (FunPtr C_RepoCheckoutFilter))
-> RepoCheckoutFilter_WithClosures -> C_RepoCheckoutFilter
wrap_RepoCheckoutFilter Maybe (Ptr (FunPtr C_RepoCheckoutFilter))
gi'funptrptr RepoCheckoutFilter_WithClosures
gi'cb Ptr Repo
repo CString
path Ptr ()
stbuf Ptr ()
userData = do
    Repo
repo' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Repo -> Repo
OSTree.Repo.Repo) Ptr Repo
repo
    Text
path' <- HasCallStack => CString -> IO Text
cstringToText CString
path
    RepoCheckoutFilterResult
result <- RepoCheckoutFilter_WithClosures
gi'cb  Repo
repo' Text
path' Ptr ()
stbuf Ptr ()
userData
    forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_RepoCheckoutFilter))
gi'funptrptr
    let result' :: CUInt
result' = (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Enum a => a -> Int
fromEnum) RepoCheckoutFilterResult
result
    forall (m :: * -> *) a. Monad m => a -> m a
return CUInt
result'


-- callback BootloaderInterfaceQueryFieldCallback
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "bootloader"
          , argType =
              TInterface Name { namespace = "OSTree" , name = "Bootloader" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "out_is_active"
          , argType = TBasicType TBoolean
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "cancellable"
          , argType =
              TInterface Name { namespace = "Gio" , name = "Cancellable" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = True
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_BootloaderInterfaceQueryFieldCallback =
    Ptr OSTree.Bootloader.Bootloader ->
    CInt ->
    Ptr Gio.Cancellable.Cancellable ->
    Ptr (Ptr GError) ->
    IO CInt

-- Args: [ Arg
--           { argCName = "bootloader"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Bootloader" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_is_active"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_BootloaderInterfaceQueryFieldCallback :: FunPtr C_BootloaderInterfaceQueryFieldCallback -> C_BootloaderInterfaceQueryFieldCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_BootloaderInterfaceQueryFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
    FunPtr C_BootloaderInterfaceQueryFieldCallback
    -> OSTree.Bootloader.Bootloader
    -> Bool
    -> a
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
dynamic_BootloaderInterfaceQueryFieldCallback :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCancellable a) =>
FunPtr C_BootloaderInterfaceQueryFieldCallback
-> Bootloader -> Bool -> a -> m ()
dynamic_BootloaderInterfaceQueryFieldCallback FunPtr C_BootloaderInterfaceQueryFieldCallback
__funPtr Bootloader
bootloader Bool
outIsActive a
cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Bootloader
bootloader' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bootloader
bootloader
    let outIsActive' :: CInt
outIsActive' = (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Enum a => a -> Int
fromEnum) Bool
outIsActive
    Ptr Cancellable
cancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
cancellable
    forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ (FunPtr C_BootloaderInterfaceQueryFieldCallback
-> C_BootloaderInterfaceQueryFieldCallback
__dynamic_C_BootloaderInterfaceQueryFieldCallback FunPtr C_BootloaderInterfaceQueryFieldCallback
__funPtr) Ptr Bootloader
bootloader' CInt
outIsActive' Ptr Cancellable
cancellable'
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Bootloader
bootloader
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
cancellable
        forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

-- | Generate a function pointer callable from C code, from a `C_BootloaderInterfaceQueryFieldCallback`.
foreign import ccall "wrapper"
    mk_BootloaderInterfaceQueryFieldCallback :: C_BootloaderInterfaceQueryFieldCallback -> IO (FunPtr C_BootloaderInterfaceQueryFieldCallback)

-- | /No description available in the introspection data./
type BootloaderInterfaceQueryFieldCallback =
    OSTree.Bootloader.Bootloader
    -> Bool
    -> Gio.Cancellable.Cancellable
    -> IO ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/

-- | A convenience synonym for @`Nothing` :: `Maybe` `BootloaderInterfaceQueryFieldCallback`@.
noBootloaderInterfaceQueryFieldCallback :: Maybe BootloaderInterfaceQueryFieldCallback
noBootloaderInterfaceQueryFieldCallback :: Maybe BootloaderInterfaceQueryFieldCallback
noBootloaderInterfaceQueryFieldCallback = forall a. Maybe a
Nothing

-- No Haskell->C wrapper generated since the function throws.

-- callback BootloaderInterfacePostBlsSyncFieldCallback
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "self"
          , argType =
              TInterface Name { namespace = "OSTree" , name = "Bootloader" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "bootversion"
          , argType = TBasicType TInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "cancellable"
          , argType =
              TInterface Name { namespace = "Gio" , name = "Cancellable" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = True
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_BootloaderInterfacePostBlsSyncFieldCallback =
    Ptr OSTree.Bootloader.Bootloader ->
    Int32 ->
    Ptr Gio.Cancellable.Cancellable ->
    Ptr (Ptr GError) ->
    IO CInt

-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Bootloader" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "bootversion"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_BootloaderInterfacePostBlsSyncFieldCallback :: FunPtr C_BootloaderInterfacePostBlsSyncFieldCallback -> C_BootloaderInterfacePostBlsSyncFieldCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_BootloaderInterfacePostBlsSyncFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
    FunPtr C_BootloaderInterfacePostBlsSyncFieldCallback
    -> OSTree.Bootloader.Bootloader
    -> Int32
    -> a
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
dynamic_BootloaderInterfacePostBlsSyncFieldCallback :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCancellable a) =>
FunPtr C_BootloaderInterfacePostBlsSyncFieldCallback
-> Bootloader -> Int32 -> a -> m ()
dynamic_BootloaderInterfacePostBlsSyncFieldCallback FunPtr C_BootloaderInterfacePostBlsSyncFieldCallback
__funPtr Bootloader
self Int32
bootversion a
cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Bootloader
self' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bootloader
self
    Ptr Cancellable
cancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
cancellable
    forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ (FunPtr C_BootloaderInterfacePostBlsSyncFieldCallback
-> C_BootloaderInterfacePostBlsSyncFieldCallback
__dynamic_C_BootloaderInterfacePostBlsSyncFieldCallback FunPtr C_BootloaderInterfacePostBlsSyncFieldCallback
__funPtr) Ptr Bootloader
self' Int32
bootversion Ptr Cancellable
cancellable'
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Bootloader
self
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
cancellable
        forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

-- | Generate a function pointer callable from C code, from a `C_BootloaderInterfacePostBlsSyncFieldCallback`.
foreign import ccall "wrapper"
    mk_BootloaderInterfacePostBlsSyncFieldCallback :: C_BootloaderInterfacePostBlsSyncFieldCallback -> IO (FunPtr C_BootloaderInterfacePostBlsSyncFieldCallback)

-- | /No description available in the introspection data./
type BootloaderInterfacePostBlsSyncFieldCallback =
    OSTree.Bootloader.Bootloader
    -> Int32
    -> Gio.Cancellable.Cancellable
    -> IO ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/

-- | A convenience synonym for @`Nothing` :: `Maybe` `BootloaderInterfacePostBlsSyncFieldCallback`@.
noBootloaderInterfacePostBlsSyncFieldCallback :: Maybe BootloaderInterfacePostBlsSyncFieldCallback
noBootloaderInterfacePostBlsSyncFieldCallback :: Maybe BootloaderInterfacePostBlsSyncFieldCallback
noBootloaderInterfacePostBlsSyncFieldCallback = forall a. Maybe a
Nothing

-- No Haskell->C wrapper generated since the function throws.

-- callback BootloaderInterfaceIsAtomicFieldCallback
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "self"
          , argType =
              TInterface Name { namespace = "OSTree" , name = "Bootloader" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_BootloaderInterfaceIsAtomicFieldCallback =
    Ptr OSTree.Bootloader.Bootloader ->
    IO CInt

-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Bootloader" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_BootloaderInterfaceIsAtomicFieldCallback :: FunPtr C_BootloaderInterfaceIsAtomicFieldCallback -> C_BootloaderInterfaceIsAtomicFieldCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_BootloaderInterfaceIsAtomicFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_BootloaderInterfaceIsAtomicFieldCallback
    -> OSTree.Bootloader.Bootloader
    -> m Bool
dynamic_BootloaderInterfaceIsAtomicFieldCallback :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_BootloaderInterfaceIsAtomicFieldCallback
-> Bootloader -> m Bool
dynamic_BootloaderInterfaceIsAtomicFieldCallback FunPtr C_BootloaderInterfaceIsAtomicFieldCallback
__funPtr Bootloader
self = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Bootloader
self' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bootloader
self
    CInt
result <- (FunPtr C_BootloaderInterfaceIsAtomicFieldCallback
-> C_BootloaderInterfaceIsAtomicFieldCallback
__dynamic_C_BootloaderInterfaceIsAtomicFieldCallback FunPtr C_BootloaderInterfaceIsAtomicFieldCallback
__funPtr) Ptr Bootloader
self'
    let result' :: Bool
result' = (forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Bootloader
self
    forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

-- | Generate a function pointer callable from C code, from a `C_BootloaderInterfaceIsAtomicFieldCallback`.
foreign import ccall "wrapper"
    mk_BootloaderInterfaceIsAtomicFieldCallback :: C_BootloaderInterfaceIsAtomicFieldCallback -> IO (FunPtr C_BootloaderInterfaceIsAtomicFieldCallback)

-- | /No description available in the introspection data./
type BootloaderInterfaceIsAtomicFieldCallback =
    OSTree.Bootloader.Bootloader
    -> IO Bool

-- | A convenience synonym for @`Nothing` :: `Maybe` `BootloaderInterfaceIsAtomicFieldCallback`@.
noBootloaderInterfaceIsAtomicFieldCallback :: Maybe BootloaderInterfaceIsAtomicFieldCallback
noBootloaderInterfaceIsAtomicFieldCallback :: Maybe BootloaderInterfaceIsAtomicFieldCallback
noBootloaderInterfaceIsAtomicFieldCallback = forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_BootloaderInterfaceIsAtomicFieldCallback :: MonadIO m => BootloaderInterfaceIsAtomicFieldCallback -> m (GClosure C_BootloaderInterfaceIsAtomicFieldCallback)
genClosure_BootloaderInterfaceIsAtomicFieldCallback :: forall (m :: * -> *).
MonadIO m =>
BootloaderInterfaceIsAtomicFieldCallback
-> m (GClosure C_BootloaderInterfaceIsAtomicFieldCallback)
genClosure_BootloaderInterfaceIsAtomicFieldCallback BootloaderInterfaceIsAtomicFieldCallback
cb = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_BootloaderInterfaceIsAtomicFieldCallback
cb' = Maybe (Ptr (FunPtr C_BootloaderInterfaceIsAtomicFieldCallback))
-> BootloaderInterfaceIsAtomicFieldCallback
-> C_BootloaderInterfaceIsAtomicFieldCallback
wrap_BootloaderInterfaceIsAtomicFieldCallback forall a. Maybe a
Nothing BootloaderInterfaceIsAtomicFieldCallback
cb
    C_BootloaderInterfaceIsAtomicFieldCallback
-> IO (FunPtr C_BootloaderInterfaceIsAtomicFieldCallback)
mk_BootloaderInterfaceIsAtomicFieldCallback C_BootloaderInterfaceIsAtomicFieldCallback
cb' forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `BootloaderInterfaceIsAtomicFieldCallback` into a `C_BootloaderInterfaceIsAtomicFieldCallback`.
wrap_BootloaderInterfaceIsAtomicFieldCallback :: 
    Maybe (Ptr (FunPtr C_BootloaderInterfaceIsAtomicFieldCallback)) ->
    BootloaderInterfaceIsAtomicFieldCallback ->
    C_BootloaderInterfaceIsAtomicFieldCallback
wrap_BootloaderInterfaceIsAtomicFieldCallback :: Maybe (Ptr (FunPtr C_BootloaderInterfaceIsAtomicFieldCallback))
-> BootloaderInterfaceIsAtomicFieldCallback
-> C_BootloaderInterfaceIsAtomicFieldCallback
wrap_BootloaderInterfaceIsAtomicFieldCallback Maybe (Ptr (FunPtr C_BootloaderInterfaceIsAtomicFieldCallback))
gi'funptrptr BootloaderInterfaceIsAtomicFieldCallback
gi'cb Ptr Bootloader
self = do
    Bootloader
self' <- (forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Bootloader -> Bootloader
OSTree.Bootloader.Bootloader) Ptr Bootloader
self
    Bool
result <- BootloaderInterfaceIsAtomicFieldCallback
gi'cb  Bootloader
self'
    forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_BootloaderInterfaceIsAtomicFieldCallback))
gi'funptrptr
    let result' :: CInt
result' = (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Enum a => a -> Int
fromEnum) Bool
result
    forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback BootloaderInterfaceGetNameFieldCallback
{- Callable
  { returnType = Just (TBasicType TUTF8)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "self"
          , argType =
              TInterface Name { namespace = "OSTree" , name = "Bootloader" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_BootloaderInterfaceGetNameFieldCallback =
    Ptr OSTree.Bootloader.Bootloader ->
    IO CString

-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Bootloader" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_BootloaderInterfaceGetNameFieldCallback :: FunPtr C_BootloaderInterfaceGetNameFieldCallback -> C_BootloaderInterfaceGetNameFieldCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_BootloaderInterfaceGetNameFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_BootloaderInterfaceGetNameFieldCallback
    -> OSTree.Bootloader.Bootloader
    -> m T.Text
dynamic_BootloaderInterfaceGetNameFieldCallback :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_BootloaderInterfaceGetNameFieldCallback
-> Bootloader -> m Text
dynamic_BootloaderInterfaceGetNameFieldCallback FunPtr C_BootloaderInterfaceGetNameFieldCallback
__funPtr Bootloader
self = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Bootloader
self' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bootloader
self
    CString
result <- (FunPtr C_BootloaderInterfaceGetNameFieldCallback
-> C_BootloaderInterfaceGetNameFieldCallback
__dynamic_C_BootloaderInterfaceGetNameFieldCallback FunPtr C_BootloaderInterfaceGetNameFieldCallback
__funPtr) Ptr Bootloader
self'
    forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bootloaderInterfaceGetNameFieldCallback" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
cstringToText CString
result
    forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Bootloader
self
    forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

-- | Generate a function pointer callable from C code, from a `C_BootloaderInterfaceGetNameFieldCallback`.
foreign import ccall "wrapper"
    mk_BootloaderInterfaceGetNameFieldCallback :: C_BootloaderInterfaceGetNameFieldCallback -> IO (FunPtr C_BootloaderInterfaceGetNameFieldCallback)

-- | /No description available in the introspection data./
type BootloaderInterfaceGetNameFieldCallback =
    OSTree.Bootloader.Bootloader
    -> IO T.Text

-- | A convenience synonym for @`Nothing` :: `Maybe` `BootloaderInterfaceGetNameFieldCallback`@.
noBootloaderInterfaceGetNameFieldCallback :: Maybe BootloaderInterfaceGetNameFieldCallback
noBootloaderInterfaceGetNameFieldCallback :: Maybe BootloaderInterfaceGetNameFieldCallback
noBootloaderInterfaceGetNameFieldCallback = forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_BootloaderInterfaceGetNameFieldCallback :: MonadIO m => BootloaderInterfaceGetNameFieldCallback -> m (GClosure C_BootloaderInterfaceGetNameFieldCallback)
genClosure_BootloaderInterfaceGetNameFieldCallback :: forall (m :: * -> *).
MonadIO m =>
BootloaderInterfaceGetNameFieldCallback
-> m (GClosure C_BootloaderInterfaceGetNameFieldCallback)
genClosure_BootloaderInterfaceGetNameFieldCallback BootloaderInterfaceGetNameFieldCallback
cb = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_BootloaderInterfaceGetNameFieldCallback
cb' = Maybe (Ptr (FunPtr C_BootloaderInterfaceGetNameFieldCallback))
-> BootloaderInterfaceGetNameFieldCallback
-> C_BootloaderInterfaceGetNameFieldCallback
wrap_BootloaderInterfaceGetNameFieldCallback forall a. Maybe a
Nothing BootloaderInterfaceGetNameFieldCallback
cb
    C_BootloaderInterfaceGetNameFieldCallback
-> IO (FunPtr C_BootloaderInterfaceGetNameFieldCallback)
mk_BootloaderInterfaceGetNameFieldCallback C_BootloaderInterfaceGetNameFieldCallback
cb' forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `BootloaderInterfaceGetNameFieldCallback` into a `C_BootloaderInterfaceGetNameFieldCallback`.
wrap_BootloaderInterfaceGetNameFieldCallback :: 
    Maybe (Ptr (FunPtr C_BootloaderInterfaceGetNameFieldCallback)) ->
    BootloaderInterfaceGetNameFieldCallback ->
    C_BootloaderInterfaceGetNameFieldCallback
wrap_BootloaderInterfaceGetNameFieldCallback :: Maybe (Ptr (FunPtr C_BootloaderInterfaceGetNameFieldCallback))
-> BootloaderInterfaceGetNameFieldCallback
-> C_BootloaderInterfaceGetNameFieldCallback
wrap_BootloaderInterfaceGetNameFieldCallback Maybe (Ptr (FunPtr C_BootloaderInterfaceGetNameFieldCallback))
gi'funptrptr BootloaderInterfaceGetNameFieldCallback
gi'cb Ptr Bootloader
self = do
    Bootloader
self' <- (forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Bootloader -> Bootloader
OSTree.Bootloader.Bootloader) Ptr Bootloader
self
    Text
result <- BootloaderInterfaceGetNameFieldCallback
gi'cb  Bootloader
self'
    forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_BootloaderInterfaceGetNameFieldCallback))
gi'funptrptr
    CString
result' <- Text -> IO CString
textToCString Text
result
    forall (m :: * -> *) a. Monad m => a -> m a
return CString
result'