{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}

module GI.GLib.Callbacks
    ( 

 -- * Signals
-- ** ChildWatchFunc #signal:ChildWatchFunc#
    C_ChildWatchFunc                        ,
    ChildWatchFunc                          ,
    ChildWatchFunc_WithClosures             ,
    drop_closures_ChildWatchFunc            ,
    dynamic_ChildWatchFunc                  ,
    genClosure_ChildWatchFunc               ,
    mk_ChildWatchFunc                       ,
    noChildWatchFunc                        ,
    noChildWatchFunc_WithClosures           ,
    wrap_ChildWatchFunc                     ,


-- ** CompareDataFunc #signal:CompareDataFunc#
    C_CompareDataFunc                       ,
    CompareDataFunc                         ,
    CompareDataFunc_WithClosures            ,
    drop_closures_CompareDataFunc           ,
    dynamic_CompareDataFunc                 ,
    genClosure_CompareDataFunc              ,
    mk_CompareDataFunc                      ,
    noCompareDataFunc                       ,
    noCompareDataFunc_WithClosures          ,
    wrap_CompareDataFunc                    ,


-- ** CompareFunc #signal:CompareFunc#
    C_CompareFunc                           ,
    CompareFunc                             ,
    dynamic_CompareFunc                     ,
    genClosure_CompareFunc                  ,
    mk_CompareFunc                          ,
    noCompareFunc                           ,
    wrap_CompareFunc                        ,


-- ** CopyFunc #signal:CopyFunc#
    C_CopyFunc                              ,
    CopyFunc                                ,
    dynamic_CopyFunc                        ,
    genClosure_CopyFunc                     ,
    mk_CopyFunc                             ,
    noCopyFunc                              ,
    wrap_CopyFunc                           ,


-- ** DataForeachFunc #signal:DataForeachFunc#
    C_DataForeachFunc                       ,
    DataForeachFunc                         ,
    DataForeachFunc_WithClosures            ,
    drop_closures_DataForeachFunc           ,
    dynamic_DataForeachFunc                 ,
    genClosure_DataForeachFunc              ,
    mk_DataForeachFunc                      ,
    noDataForeachFunc                       ,
    noDataForeachFunc_WithClosures          ,
    wrap_DataForeachFunc                    ,


-- ** DestroyNotify #signal:DestroyNotify#
    C_DestroyNotify                         ,
    DestroyNotify                           ,
    dynamic_DestroyNotify                   ,
    genClosure_DestroyNotify                ,
    mk_DestroyNotify                        ,
    noDestroyNotify                         ,
    wrap_DestroyNotify                      ,


-- ** DuplicateFunc #signal:DuplicateFunc#
    C_DuplicateFunc                         ,
    DuplicateFunc                           ,
    DuplicateFunc_WithClosures              ,
    drop_closures_DuplicateFunc             ,
    dynamic_DuplicateFunc                   ,
    genClosure_DuplicateFunc                ,
    mk_DuplicateFunc                        ,
    noDuplicateFunc                         ,
    noDuplicateFunc_WithClosures            ,
    wrap_DuplicateFunc                      ,


-- ** EqualFunc #signal:EqualFunc#
    C_EqualFunc                             ,
    EqualFunc                               ,
    dynamic_EqualFunc                       ,
    genClosure_EqualFunc                    ,
    mk_EqualFunc                            ,
    noEqualFunc                             ,
    wrap_EqualFunc                          ,


-- ** FreeFunc #signal:FreeFunc#
    C_FreeFunc                              ,
    FreeFunc                                ,
    dynamic_FreeFunc                        ,
    genClosure_FreeFunc                     ,
    mk_FreeFunc                             ,
    noFreeFunc                              ,
    wrap_FreeFunc                           ,


-- ** Func #signal:Func#
    C_Func                                  ,
    Func                                    ,
    Func_WithClosures                       ,
    drop_closures_Func                      ,
    dynamic_Func                            ,
    genClosure_Func                         ,
    mk_Func                                 ,
    noFunc                                  ,
    noFunc_WithClosures                     ,
    wrap_Func                               ,


-- ** HFunc #signal:HFunc#
    C_HFunc                                 ,
    HFunc                                   ,
    HFunc_WithClosures                      ,
    drop_closures_HFunc                     ,
    dynamic_HFunc                           ,
    genClosure_HFunc                        ,
    mk_HFunc                                ,
    noHFunc                                 ,
    noHFunc_WithClosures                    ,
    wrap_HFunc                              ,


-- ** HRFunc #signal:HRFunc#
    C_HRFunc                                ,
    HRFunc                                  ,
    HRFunc_WithClosures                     ,
    drop_closures_HRFunc                    ,
    dynamic_HRFunc                          ,
    genClosure_HRFunc                       ,
    mk_HRFunc                               ,
    noHRFunc                                ,
    noHRFunc_WithClosures                   ,
    wrap_HRFunc                             ,


-- ** HashFunc #signal:HashFunc#
    C_HashFunc                              ,
    HashFunc                                ,
    dynamic_HashFunc                        ,
    genClosure_HashFunc                     ,
    mk_HashFunc                             ,
    noHashFunc                              ,
    wrap_HashFunc                           ,


-- ** HookCheckFunc #signal:HookCheckFunc#
    C_HookCheckFunc                         ,
    HookCheckFunc                           ,
    dynamic_HookCheckFunc                   ,
    genClosure_HookCheckFunc                ,
    mk_HookCheckFunc                        ,
    noHookCheckFunc                         ,
    wrap_HookCheckFunc                      ,


-- ** HookCheckMarshaller #signal:HookCheckMarshaller#
    C_HookCheckMarshaller                   ,
    HookCheckMarshaller                     ,
    dynamic_HookCheckMarshaller             ,
    genClosure_HookCheckMarshaller          ,
    mk_HookCheckMarshaller                  ,
    noHookCheckMarshaller                   ,
    wrap_HookCheckMarshaller                ,


-- ** HookCompareFunc #signal:HookCompareFunc#
    C_HookCompareFunc                       ,
    HookCompareFunc                         ,
    dynamic_HookCompareFunc                 ,
    genClosure_HookCompareFunc              ,
    mk_HookCompareFunc                      ,
    noHookCompareFunc                       ,
    wrap_HookCompareFunc                    ,


-- ** HookFinalizeFunc #signal:HookFinalizeFunc#
    C_HookFinalizeFunc                      ,
    HookFinalizeFunc                        ,
    dynamic_HookFinalizeFunc                ,
    genClosure_HookFinalizeFunc             ,
    mk_HookFinalizeFunc                     ,
    noHookFinalizeFunc                      ,
    wrap_HookFinalizeFunc                   ,


-- ** HookFindFunc #signal:HookFindFunc#
    C_HookFindFunc                          ,
    HookFindFunc                            ,
    dynamic_HookFindFunc                    ,
    genClosure_HookFindFunc                 ,
    mk_HookFindFunc                         ,
    noHookFindFunc                          ,
    wrap_HookFindFunc                       ,


-- ** HookFunc #signal:HookFunc#
    C_HookFunc                              ,
    HookFunc                                ,
    dynamic_HookFunc                        ,
    genClosure_HookFunc                     ,
    mk_HookFunc                             ,
    noHookFunc                              ,
    wrap_HookFunc                           ,


-- ** HookMarshaller #signal:HookMarshaller#
    C_HookMarshaller                        ,
    HookMarshaller                          ,
    dynamic_HookMarshaller                  ,
    genClosure_HookMarshaller               ,
    mk_HookMarshaller                       ,
    noHookMarshaller                        ,
    wrap_HookMarshaller                     ,


-- ** IOFunc #signal:IOFunc#
    C_IOFunc                                ,
    IOFunc                                  ,
    dynamic_IOFunc                          ,
    genClosure_IOFunc                       ,
    mk_IOFunc                               ,
    noIOFunc                                ,
    wrap_IOFunc                             ,


-- ** IOFuncsIoCloseFieldCallback #signal:IOFuncsIoCloseFieldCallback#
    C_IOFuncsIoCloseFieldCallback           ,
    IOFuncsIoCloseFieldCallback             ,
    dynamic_IOFuncsIoCloseFieldCallback     ,
    mk_IOFuncsIoCloseFieldCallback          ,
    noIOFuncsIoCloseFieldCallback           ,


-- ** IOFuncsIoCreateWatchFieldCallback #signal:IOFuncsIoCreateWatchFieldCallback#
    C_IOFuncsIoCreateWatchFieldCallback     ,
    IOFuncsIoCreateWatchFieldCallback       ,
    dynamic_IOFuncsIoCreateWatchFieldCallback,
    genClosure_IOFuncsIoCreateWatchFieldCallback,
    mk_IOFuncsIoCreateWatchFieldCallback    ,
    noIOFuncsIoCreateWatchFieldCallback     ,
    wrap_IOFuncsIoCreateWatchFieldCallback  ,


-- ** IOFuncsIoFreeFieldCallback #signal:IOFuncsIoFreeFieldCallback#
    C_IOFuncsIoFreeFieldCallback            ,
    IOFuncsIoFreeFieldCallback              ,
    dynamic_IOFuncsIoFreeFieldCallback      ,
    genClosure_IOFuncsIoFreeFieldCallback   ,
    mk_IOFuncsIoFreeFieldCallback           ,
    noIOFuncsIoFreeFieldCallback            ,
    wrap_IOFuncsIoFreeFieldCallback         ,


-- ** IOFuncsIoGetFlagsFieldCallback #signal:IOFuncsIoGetFlagsFieldCallback#
    C_IOFuncsIoGetFlagsFieldCallback        ,
    IOFuncsIoGetFlagsFieldCallback          ,
    dynamic_IOFuncsIoGetFlagsFieldCallback  ,
    genClosure_IOFuncsIoGetFlagsFieldCallback,
    mk_IOFuncsIoGetFlagsFieldCallback       ,
    noIOFuncsIoGetFlagsFieldCallback        ,
    wrap_IOFuncsIoGetFlagsFieldCallback     ,


-- ** IOFuncsIoReadFieldCallback #signal:IOFuncsIoReadFieldCallback#
    C_IOFuncsIoReadFieldCallback            ,
    IOFuncsIoReadFieldCallback              ,
    dynamic_IOFuncsIoReadFieldCallback      ,
    mk_IOFuncsIoReadFieldCallback           ,
    noIOFuncsIoReadFieldCallback            ,


-- ** IOFuncsIoSeekFieldCallback #signal:IOFuncsIoSeekFieldCallback#
    C_IOFuncsIoSeekFieldCallback            ,
    IOFuncsIoSeekFieldCallback              ,
    dynamic_IOFuncsIoSeekFieldCallback      ,
    mk_IOFuncsIoSeekFieldCallback           ,
    noIOFuncsIoSeekFieldCallback            ,


-- ** IOFuncsIoSetFlagsFieldCallback #signal:IOFuncsIoSetFlagsFieldCallback#
    C_IOFuncsIoSetFlagsFieldCallback        ,
    IOFuncsIoSetFlagsFieldCallback          ,
    dynamic_IOFuncsIoSetFlagsFieldCallback  ,
    mk_IOFuncsIoSetFlagsFieldCallback       ,
    noIOFuncsIoSetFlagsFieldCallback        ,


-- ** IOFuncsIoWriteFieldCallback #signal:IOFuncsIoWriteFieldCallback#
    C_IOFuncsIoWriteFieldCallback           ,
    IOFuncsIoWriteFieldCallback             ,
    dynamic_IOFuncsIoWriteFieldCallback     ,
    mk_IOFuncsIoWriteFieldCallback          ,
    noIOFuncsIoWriteFieldCallback           ,


-- ** LogFunc #signal:LogFunc#
    C_LogFunc                               ,
    LogFunc                                 ,
    LogFunc_WithClosures                    ,
    drop_closures_LogFunc                   ,
    dynamic_LogFunc                         ,
    genClosure_LogFunc                      ,
    mk_LogFunc                              ,
    noLogFunc                               ,
    noLogFunc_WithClosures                  ,
    wrap_LogFunc                            ,


-- ** LogWriterFunc #signal:LogWriterFunc#
    C_LogWriterFunc                         ,
    LogWriterFunc                           ,
    LogWriterFunc_WithClosures              ,
    drop_closures_LogWriterFunc             ,
    dynamic_LogWriterFunc                   ,
    genClosure_LogWriterFunc                ,
    mk_LogWriterFunc                        ,
    noLogWriterFunc                         ,
    noLogWriterFunc_WithClosures            ,
    wrap_LogWriterFunc                      ,


-- ** MarkupParserEndElementFieldCallback #signal:MarkupParserEndElementFieldCallback#
    C_MarkupParserEndElementFieldCallback   ,
    MarkupParserEndElementFieldCallback     ,
    MarkupParserEndElementFieldCallback_WithClosures,
    drop_closures_MarkupParserEndElementFieldCallback,
    dynamic_MarkupParserEndElementFieldCallback,
    mk_MarkupParserEndElementFieldCallback  ,
    noMarkupParserEndElementFieldCallback   ,
    noMarkupParserEndElementFieldCallback_WithClosures,


-- ** MarkupParserErrorFieldCallback #signal:MarkupParserErrorFieldCallback#
    C_MarkupParserErrorFieldCallback        ,
    MarkupParserErrorFieldCallback          ,
    MarkupParserErrorFieldCallback_WithClosures,
    drop_closures_MarkupParserErrorFieldCallback,
    dynamic_MarkupParserErrorFieldCallback  ,
    genClosure_MarkupParserErrorFieldCallback,
    mk_MarkupParserErrorFieldCallback       ,
    noMarkupParserErrorFieldCallback        ,
    noMarkupParserErrorFieldCallback_WithClosures,
    wrap_MarkupParserErrorFieldCallback     ,


-- ** MarkupParserPassthroughFieldCallback #signal:MarkupParserPassthroughFieldCallback#
    C_MarkupParserPassthroughFieldCallback  ,
    MarkupParserPassthroughFieldCallback    ,
    MarkupParserPassthroughFieldCallback_WithClosures,
    drop_closures_MarkupParserPassthroughFieldCallback,
    dynamic_MarkupParserPassthroughFieldCallback,
    mk_MarkupParserPassthroughFieldCallback ,
    noMarkupParserPassthroughFieldCallback  ,
    noMarkupParserPassthroughFieldCallback_WithClosures,


-- ** MarkupParserStartElementFieldCallback #signal:MarkupParserStartElementFieldCallback#
    C_MarkupParserStartElementFieldCallback ,
    MarkupParserStartElementFieldCallback   ,
    MarkupParserStartElementFieldCallback_WithClosures,
    drop_closures_MarkupParserStartElementFieldCallback,
    dynamic_MarkupParserStartElementFieldCallback,
    mk_MarkupParserStartElementFieldCallback,
    noMarkupParserStartElementFieldCallback ,
    noMarkupParserStartElementFieldCallback_WithClosures,


-- ** MarkupParserTextFieldCallback #signal:MarkupParserTextFieldCallback#
    C_MarkupParserTextFieldCallback         ,
    MarkupParserTextFieldCallback           ,
    MarkupParserTextFieldCallback_WithClosures,
    drop_closures_MarkupParserTextFieldCallback,
    dynamic_MarkupParserTextFieldCallback   ,
    mk_MarkupParserTextFieldCallback        ,
    noMarkupParserTextFieldCallback         ,
    noMarkupParserTextFieldCallback_WithClosures,


-- ** MemVTableCallocFieldCallback #signal:MemVTableCallocFieldCallback#
    C_MemVTableCallocFieldCallback          ,
    MemVTableCallocFieldCallback            ,
    dynamic_MemVTableCallocFieldCallback    ,
    genClosure_MemVTableCallocFieldCallback ,
    mk_MemVTableCallocFieldCallback         ,
    noMemVTableCallocFieldCallback          ,
    wrap_MemVTableCallocFieldCallback       ,


-- ** MemVTableFreeFieldCallback #signal:MemVTableFreeFieldCallback#
    C_MemVTableFreeFieldCallback            ,
    MemVTableFreeFieldCallback              ,
    dynamic_MemVTableFreeFieldCallback      ,
    genClosure_MemVTableFreeFieldCallback   ,
    mk_MemVTableFreeFieldCallback           ,
    noMemVTableFreeFieldCallback            ,
    wrap_MemVTableFreeFieldCallback         ,


-- ** MemVTableMallocFieldCallback #signal:MemVTableMallocFieldCallback#
    C_MemVTableMallocFieldCallback          ,
    MemVTableMallocFieldCallback            ,
    dynamic_MemVTableMallocFieldCallback    ,
    genClosure_MemVTableMallocFieldCallback ,
    mk_MemVTableMallocFieldCallback         ,
    noMemVTableMallocFieldCallback          ,
    wrap_MemVTableMallocFieldCallback       ,


-- ** MemVTableReallocFieldCallback #signal:MemVTableReallocFieldCallback#
    C_MemVTableReallocFieldCallback         ,
    MemVTableReallocFieldCallback           ,
    dynamic_MemVTableReallocFieldCallback   ,
    genClosure_MemVTableReallocFieldCallback,
    mk_MemVTableReallocFieldCallback        ,
    noMemVTableReallocFieldCallback         ,
    wrap_MemVTableReallocFieldCallback      ,


-- ** MemVTableTryMallocFieldCallback #signal:MemVTableTryMallocFieldCallback#
    C_MemVTableTryMallocFieldCallback       ,
    MemVTableTryMallocFieldCallback         ,
    dynamic_MemVTableTryMallocFieldCallback ,
    genClosure_MemVTableTryMallocFieldCallback,
    mk_MemVTableTryMallocFieldCallback      ,
    noMemVTableTryMallocFieldCallback       ,
    wrap_MemVTableTryMallocFieldCallback    ,


-- ** MemVTableTryReallocFieldCallback #signal:MemVTableTryReallocFieldCallback#
    C_MemVTableTryReallocFieldCallback      ,
    MemVTableTryReallocFieldCallback        ,
    dynamic_MemVTableTryReallocFieldCallback,
    genClosure_MemVTableTryReallocFieldCallback,
    mk_MemVTableTryReallocFieldCallback     ,
    noMemVTableTryReallocFieldCallback      ,
    wrap_MemVTableTryReallocFieldCallback   ,


-- ** NodeForeachFunc #signal:NodeForeachFunc#
    C_NodeForeachFunc                       ,
    NodeForeachFunc                         ,
    dynamic_NodeForeachFunc                 ,
    genClosure_NodeForeachFunc              ,
    mk_NodeForeachFunc                      ,
    noNodeForeachFunc                       ,
    wrap_NodeForeachFunc                    ,


-- ** NodeTraverseFunc #signal:NodeTraverseFunc#
    C_NodeTraverseFunc                      ,
    NodeTraverseFunc                        ,
    dynamic_NodeTraverseFunc                ,
    genClosure_NodeTraverseFunc             ,
    mk_NodeTraverseFunc                     ,
    noNodeTraverseFunc                      ,
    wrap_NodeTraverseFunc                   ,


-- ** OptionArgFunc #signal:OptionArgFunc#
    C_OptionArgFunc                         ,
    OptionArgFunc                           ,
    dynamic_OptionArgFunc                   ,
    mk_OptionArgFunc                        ,
    noOptionArgFunc                         ,


-- ** OptionErrorFunc #signal:OptionErrorFunc#
    C_OptionErrorFunc                       ,
    OptionErrorFunc                         ,
    dynamic_OptionErrorFunc                 ,
    mk_OptionErrorFunc                      ,
    noOptionErrorFunc                       ,


-- ** OptionParseFunc #signal:OptionParseFunc#
    C_OptionParseFunc                       ,
    OptionParseFunc                         ,
    dynamic_OptionParseFunc                 ,
    mk_OptionParseFunc                      ,
    noOptionParseFunc                       ,


-- ** PollFunc #signal:PollFunc#
    C_PollFunc                              ,
    PollFunc                                ,
    dynamic_PollFunc                        ,
    genClosure_PollFunc                     ,
    mk_PollFunc                             ,
    noPollFunc                              ,
    wrap_PollFunc                           ,


-- ** PrintFunc #signal:PrintFunc#
    C_PrintFunc                             ,
    PrintFunc                               ,
    dynamic_PrintFunc                       ,
    genClosure_PrintFunc                    ,
    mk_PrintFunc                            ,
    noPrintFunc                             ,
    wrap_PrintFunc                          ,


-- ** RegexEvalCallback #signal:RegexEvalCallback#
    C_RegexEvalCallback                     ,
    RegexEvalCallback                       ,
    RegexEvalCallback_WithClosures          ,
    drop_closures_RegexEvalCallback         ,
    dynamic_RegexEvalCallback               ,
    genClosure_RegexEvalCallback            ,
    mk_RegexEvalCallback                    ,
    noRegexEvalCallback                     ,
    noRegexEvalCallback_WithClosures        ,
    wrap_RegexEvalCallback                  ,


-- ** ScannerMsgFunc #signal:ScannerMsgFunc#
    C_ScannerMsgFunc                        ,
    ScannerMsgFunc                          ,
    dynamic_ScannerMsgFunc                  ,
    genClosure_ScannerMsgFunc               ,
    mk_ScannerMsgFunc                       ,
    noScannerMsgFunc                        ,
    wrap_ScannerMsgFunc                     ,


-- ** SequenceIterCompareFunc #signal:SequenceIterCompareFunc#
    C_SequenceIterCompareFunc               ,
    SequenceIterCompareFunc                 ,
    dynamic_SequenceIterCompareFunc         ,
    genClosure_SequenceIterCompareFunc      ,
    mk_SequenceIterCompareFunc              ,
    noSequenceIterCompareFunc               ,
    wrap_SequenceIterCompareFunc            ,


-- ** SourceCallbackFuncsRefFieldCallback #signal:SourceCallbackFuncsRefFieldCallback#
    C_SourceCallbackFuncsRefFieldCallback   ,
    SourceCallbackFuncsRefFieldCallback     ,
    dynamic_SourceCallbackFuncsRefFieldCallback,
    genClosure_SourceCallbackFuncsRefFieldCallback,
    mk_SourceCallbackFuncsRefFieldCallback  ,
    noSourceCallbackFuncsRefFieldCallback   ,
    wrap_SourceCallbackFuncsRefFieldCallback,


-- ** SourceCallbackFuncsUnrefFieldCallback #signal:SourceCallbackFuncsUnrefFieldCallback#
    C_SourceCallbackFuncsUnrefFieldCallback ,
    SourceCallbackFuncsUnrefFieldCallback   ,
    dynamic_SourceCallbackFuncsUnrefFieldCallback,
    genClosure_SourceCallbackFuncsUnrefFieldCallback,
    mk_SourceCallbackFuncsUnrefFieldCallback,
    noSourceCallbackFuncsUnrefFieldCallback ,
    wrap_SourceCallbackFuncsUnrefFieldCallback,


-- ** SourceDummyMarshal #signal:SourceDummyMarshal#
    C_SourceDummyMarshal                    ,
    SourceDummyMarshal                      ,
    dynamic_SourceDummyMarshal              ,
    genClosure_SourceDummyMarshal           ,
    mk_SourceDummyMarshal                   ,
    noSourceDummyMarshal                    ,
    wrap_SourceDummyMarshal                 ,


-- ** SourceFunc #signal:SourceFunc#
    C_SourceFunc                            ,
    SourceFunc                              ,
    SourceFunc_WithClosures                 ,
    drop_closures_SourceFunc                ,
    dynamic_SourceFunc                      ,
    genClosure_SourceFunc                   ,
    mk_SourceFunc                           ,
    noSourceFunc                            ,
    noSourceFunc_WithClosures               ,
    wrap_SourceFunc                         ,


-- ** SourceFuncsCheckFieldCallback #signal:SourceFuncsCheckFieldCallback#
    C_SourceFuncsCheckFieldCallback         ,
    SourceFuncsCheckFieldCallback           ,
    dynamic_SourceFuncsCheckFieldCallback   ,
    genClosure_SourceFuncsCheckFieldCallback,
    mk_SourceFuncsCheckFieldCallback        ,
    noSourceFuncsCheckFieldCallback         ,
    wrap_SourceFuncsCheckFieldCallback      ,


-- ** SourceFuncsFinalizeFieldCallback #signal:SourceFuncsFinalizeFieldCallback#
    C_SourceFuncsFinalizeFieldCallback      ,
    SourceFuncsFinalizeFieldCallback        ,
    dynamic_SourceFuncsFinalizeFieldCallback,
    genClosure_SourceFuncsFinalizeFieldCallback,
    mk_SourceFuncsFinalizeFieldCallback     ,
    noSourceFuncsFinalizeFieldCallback      ,
    wrap_SourceFuncsFinalizeFieldCallback   ,


-- ** SourceFuncsPrepareFieldCallback #signal:SourceFuncsPrepareFieldCallback#
    C_SourceFuncsPrepareFieldCallback       ,
    SourceFuncsPrepareFieldCallback         ,
    dynamic_SourceFuncsPrepareFieldCallback ,
    genClosure_SourceFuncsPrepareFieldCallback,
    mk_SourceFuncsPrepareFieldCallback      ,
    noSourceFuncsPrepareFieldCallback       ,
    wrap_SourceFuncsPrepareFieldCallback    ,


-- ** SpawnChildSetupFunc #signal:SpawnChildSetupFunc#
    C_SpawnChildSetupFunc                   ,
    SpawnChildSetupFunc                     ,
    SpawnChildSetupFunc_WithClosures        ,
    drop_closures_SpawnChildSetupFunc       ,
    dynamic_SpawnChildSetupFunc             ,
    genClosure_SpawnChildSetupFunc          ,
    mk_SpawnChildSetupFunc                  ,
    noSpawnChildSetupFunc                   ,
    noSpawnChildSetupFunc_WithClosures      ,
    wrap_SpawnChildSetupFunc                ,


-- ** TestDataFunc #signal:TestDataFunc#
    C_TestDataFunc                          ,
    TestDataFunc                            ,
    TestDataFunc_WithClosures               ,
    drop_closures_TestDataFunc              ,
    dynamic_TestDataFunc                    ,
    genClosure_TestDataFunc                 ,
    mk_TestDataFunc                         ,
    noTestDataFunc                          ,
    noTestDataFunc_WithClosures             ,
    wrap_TestDataFunc                       ,


-- ** TestFixtureFunc #signal:TestFixtureFunc#
    C_TestFixtureFunc                       ,
    TestFixtureFunc                         ,
    TestFixtureFunc_WithClosures            ,
    drop_closures_TestFixtureFunc           ,
    dynamic_TestFixtureFunc                 ,
    genClosure_TestFixtureFunc              ,
    mk_TestFixtureFunc                      ,
    noTestFixtureFunc                       ,
    noTestFixtureFunc_WithClosures          ,
    wrap_TestFixtureFunc                    ,


-- ** TestFunc #signal:TestFunc#
    C_TestFunc                              ,
    TestFunc                                ,
    dynamic_TestFunc                        ,
    genClosure_TestFunc                     ,
    mk_TestFunc                             ,
    noTestFunc                              ,
    wrap_TestFunc                           ,


-- ** TestLogFatalFunc #signal:TestLogFatalFunc#
    C_TestLogFatalFunc                      ,
    TestLogFatalFunc                        ,
    TestLogFatalFunc_WithClosures           ,
    drop_closures_TestLogFatalFunc          ,
    dynamic_TestLogFatalFunc                ,
    genClosure_TestLogFatalFunc             ,
    mk_TestLogFatalFunc                     ,
    noTestLogFatalFunc                      ,
    noTestLogFatalFunc_WithClosures         ,
    wrap_TestLogFatalFunc                   ,


-- ** ThreadFunc #signal:ThreadFunc#
    C_ThreadFunc                            ,
    ThreadFunc                              ,
    dynamic_ThreadFunc                      ,
    genClosure_ThreadFunc                   ,
    mk_ThreadFunc                           ,
    noThreadFunc                            ,
    wrap_ThreadFunc                         ,


-- ** TranslateFunc #signal:TranslateFunc#
    C_TranslateFunc                         ,
    TranslateFunc                           ,
    dynamic_TranslateFunc                   ,
    genClosure_TranslateFunc                ,
    mk_TranslateFunc                        ,
    noTranslateFunc                         ,
    wrap_TranslateFunc                      ,


-- ** TraverseFunc #signal:TraverseFunc#
    C_TraverseFunc                          ,
    TraverseFunc                            ,
    dynamic_TraverseFunc                    ,
    genClosure_TraverseFunc                 ,
    mk_TraverseFunc                         ,
    noTraverseFunc                          ,
    wrap_TraverseFunc                       ,


-- ** UnixFDSourceFunc #signal:UnixFDSourceFunc#
    C_UnixFDSourceFunc                      ,
    UnixFDSourceFunc                        ,
    UnixFDSourceFunc_WithClosures           ,
    drop_closures_UnixFDSourceFunc          ,
    dynamic_UnixFDSourceFunc                ,
    genClosure_UnixFDSourceFunc             ,
    mk_UnixFDSourceFunc                     ,
    noUnixFDSourceFunc                      ,
    noUnixFDSourceFunc_WithClosures         ,
    wrap_UnixFDSourceFunc                   ,


-- ** VoidFunc #signal:VoidFunc#
    C_VoidFunc                              ,
    VoidFunc                                ,
    dynamic_VoidFunc                        ,
    genClosure_VoidFunc                     ,
    mk_VoidFunc                             ,
    noVoidFunc                              ,
    wrap_VoidFunc                           ,




    ) 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.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 {-# SOURCE #-} qualified GI.GLib.Enums as GLib.Enums
import {-# SOURCE #-} qualified GI.GLib.Flags as GLib.Flags
import {-# SOURCE #-} qualified GI.GLib.Structs.Hook as GLib.Hook
import {-# SOURCE #-} qualified GI.GLib.Structs.HookList as GLib.HookList
import {-# SOURCE #-} qualified GI.GLib.Structs.IOChannel as GLib.IOChannel
import {-# SOURCE #-} qualified GI.GLib.Structs.LogField as GLib.LogField
import {-# SOURCE #-} qualified GI.GLib.Structs.MarkupParseContext as GLib.MarkupParseContext
import {-# SOURCE #-} qualified GI.GLib.Structs.MatchInfo as GLib.MatchInfo
import {-# SOURCE #-} qualified GI.GLib.Structs.Node as GLib.Node
import {-# SOURCE #-} qualified GI.GLib.Structs.OptionContext as GLib.OptionContext
import {-# SOURCE #-} qualified GI.GLib.Structs.OptionGroup as GLib.OptionGroup
import {-# SOURCE #-} qualified GI.GLib.Structs.PollFD as GLib.PollFD
import {-# SOURCE #-} qualified GI.GLib.Structs.Scanner as GLib.Scanner
import {-# SOURCE #-} qualified GI.GLib.Structs.SequenceIter as GLib.SequenceIter
import {-# SOURCE #-} qualified GI.GLib.Structs.Source as GLib.Source
import {-# SOURCE #-} qualified GI.GLib.Structs.String as GLib.String

-- callback VoidFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Declares a type of function which takes no arguments\nand has no return value. It is used to specify the type\nfunction passed to g_atexit().", sinceVersion = Nothing}}
type C_VoidFunc =
    IO ()

-- Args : []
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_VoidFunc :: FunPtr C_VoidFunc -> C_VoidFunc

dynamic_VoidFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_VoidFunc
    -> m ()
dynamic_VoidFunc __funPtr = liftIO $ do
    (__dynamic_C_VoidFunc __funPtr)
    return ()

foreign import ccall "wrapper"
    mk_VoidFunc :: C_VoidFunc -> IO (FunPtr C_VoidFunc)

type VoidFunc =
    IO ()

noVoidFunc :: Maybe VoidFunc
noVoidFunc = Nothing

genClosure_VoidFunc :: VoidFunc -> IO Closure
genClosure_VoidFunc cb = do
    let cb' = wrap_VoidFunc Nothing cb
    mk_VoidFunc cb' >>= newCClosure


wrap_VoidFunc ::
    Maybe (Ptr (FunPtr C_VoidFunc)) ->
    VoidFunc ->
    IO ()
wrap_VoidFunc funptrptr _cb = do
    _cb 
    maybeReleaseFunPtr funptrptr


-- callback UnixFDSourceFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%FALSE if the source should be removed", sinceVersion = Nothing}, args = [Arg {argCName = "fd", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the fd that triggered the event", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "condition", argType = TInterface (Name {namespace = "GLib", name = "IOCondition"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the IO conditions reported on @fd", 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 passed to g_unix_fd_add()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The type of functions to be called when a UNIX fd watch source\ntriggers.", sinceVersion = Nothing}}
type C_UnixFDSourceFunc =
    Int32 ->
    CUInt ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "fd", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the fd that triggered the event", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "condition", argType = TInterface (Name {namespace = "GLib", name = "IOCondition"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the IO conditions reported on @fd", 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 passed to g_unix_fd_add()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_UnixFDSourceFunc :: FunPtr C_UnixFDSourceFunc -> C_UnixFDSourceFunc

dynamic_UnixFDSourceFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_UnixFDSourceFunc
    -> Int32
    {- ^ /@fd@/: the fd that triggered the event -}
    -> [GLib.Flags.IOCondition]
    {- ^ /@condition@/: the IO conditions reported on /@fd@/ -}
    -> Ptr ()
    {- ^ /@userData@/: user data passed to @/g_unix_fd_add()/@ -}
    -> m Bool
    {- ^ __Returns:__ 'False' if the source should be removed -}
dynamic_UnixFDSourceFunc __funPtr fd condition userData = liftIO $ do
    let condition' = gflagsToWord condition
    result <- (__dynamic_C_UnixFDSourceFunc __funPtr) fd condition' userData
    let result' = (/= 0) result
    return result'

foreign import ccall "wrapper"
    mk_UnixFDSourceFunc :: C_UnixFDSourceFunc -> IO (FunPtr C_UnixFDSourceFunc)

type UnixFDSourceFunc =
    Int32 ->
    [GLib.Flags.IOCondition] ->
    IO Bool

noUnixFDSourceFunc :: Maybe UnixFDSourceFunc
noUnixFDSourceFunc = Nothing

type UnixFDSourceFunc_WithClosures =
    Int32 ->
    [GLib.Flags.IOCondition] ->
    Ptr () ->
    IO Bool

noUnixFDSourceFunc_WithClosures :: Maybe UnixFDSourceFunc_WithClosures
noUnixFDSourceFunc_WithClosures = Nothing

drop_closures_UnixFDSourceFunc :: UnixFDSourceFunc -> UnixFDSourceFunc_WithClosures
drop_closures_UnixFDSourceFunc _f fd condition _ = _f fd condition

genClosure_UnixFDSourceFunc :: UnixFDSourceFunc -> IO Closure
genClosure_UnixFDSourceFunc cb = do
    let cb' = drop_closures_UnixFDSourceFunc cb
    let cb'' = wrap_UnixFDSourceFunc Nothing cb'
    mk_UnixFDSourceFunc cb'' >>= newCClosure


wrap_UnixFDSourceFunc ::
    Maybe (Ptr (FunPtr C_UnixFDSourceFunc)) ->
    UnixFDSourceFunc_WithClosures ->
    Int32 ->
    CUInt ->
    Ptr () ->
    IO CInt
wrap_UnixFDSourceFunc funptrptr _cb fd condition userData = do
    let condition' = wordToGFlags condition
    result <- _cb  fd condition' userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback TraverseFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE to stop the traversal", sinceVersion = Nothing}, args = [Arg {argCName = "key", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a key of a #GTree node", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the value corresponding to the key", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to g_tree_traverse()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of function passed to g_tree_traverse(). It is\npassed the key and value of each node, together with the @user_data\nparameter passed to g_tree_traverse(). If the function returns\n%TRUE, the traversal is stopped.", sinceVersion = Nothing}}
type C_TraverseFunc =
    Ptr () ->
    Ptr () ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "key", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a key of a #GTree node", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the value corresponding to the key", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to g_tree_traverse()", 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_TraverseFunc :: FunPtr C_TraverseFunc -> C_TraverseFunc

dynamic_TraverseFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TraverseFunc
    -> Ptr ()
    {- ^ /@key@/: a key of a 'GI.GLib.Structs.Tree.Tree' node -}
    -> Ptr ()
    {- ^ /@value@/: the value corresponding to the key -}
    -> Ptr ()
    {- ^ /@data@/: user data passed to @/g_tree_traverse()/@ -}
    -> m Bool
    {- ^ __Returns:__ 'True' to stop the traversal -}
dynamic_TraverseFunc __funPtr key value data_ = liftIO $ do
    result <- (__dynamic_C_TraverseFunc __funPtr) key value data_
    let result' = (/= 0) result
    return result'

foreign import ccall "wrapper"
    mk_TraverseFunc :: C_TraverseFunc -> IO (FunPtr C_TraverseFunc)

type TraverseFunc =
    Ptr () ->
    Ptr () ->
    Ptr () ->
    IO Bool

noTraverseFunc :: Maybe TraverseFunc
noTraverseFunc = Nothing

genClosure_TraverseFunc :: TraverseFunc -> IO Closure
genClosure_TraverseFunc cb = do
    let cb' = wrap_TraverseFunc Nothing cb
    mk_TraverseFunc cb' >>= newCClosure


wrap_TraverseFunc ::
    Maybe (Ptr (FunPtr C_TraverseFunc)) ->
    TraverseFunc ->
    Ptr () ->
    Ptr () ->
    Ptr () ->
    IO CInt
wrap_TraverseFunc funptrptr _cb key value data_ = do
    result <- _cb  key value data_
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback TranslateFunc
--          -> Callable {returnType = Just (TBasicType TUTF8), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "a translation of the string for the current locale.\n The returned string is owned by GLib and must not be freed.", sinceVersion = Nothing}, args = [Arg {argCName = "str", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the untranslated string", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data specified when installing the function, e.g.\n in g_option_group_set_translate_func()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The type of functions which are used to translate user-visible\nstrings, for <option>--help</option> output.", sinceVersion = Nothing}}
type C_TranslateFunc =
    CString ->
    Ptr () ->
    IO CString

-- Args : [Arg {argCName = "str", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the untranslated string", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data specified when installing the function, e.g.\n in g_option_group_set_translate_func()", 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_TranslateFunc :: FunPtr C_TranslateFunc -> C_TranslateFunc

dynamic_TranslateFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TranslateFunc
    -> T.Text
    {- ^ /@str@/: the untranslated string -}
    -> Ptr ()
    {- ^ /@data@/: user data specified when installing the function, e.g.
 in 'GI.GLib.Structs.OptionGroup.optionGroupSetTranslateFunc' -}
    -> m T.Text
    {- ^ __Returns:__ a translation of the string for the current locale.
 The returned string is owned by GLib and must not be freed. -}
dynamic_TranslateFunc __funPtr str data_ = liftIO $ do
    str' <- textToCString str
    result <- (__dynamic_C_TranslateFunc __funPtr) str' data_
    checkUnexpectedReturnNULL "translateFunc" result
    result' <- cstringToText result
    freeMem str'
    return result'

foreign import ccall "wrapper"
    mk_TranslateFunc :: C_TranslateFunc -> IO (FunPtr C_TranslateFunc)

type TranslateFunc =
    T.Text ->
    Ptr () ->
    IO T.Text

noTranslateFunc :: Maybe TranslateFunc
noTranslateFunc = Nothing

genClosure_TranslateFunc :: TranslateFunc -> IO Closure
genClosure_TranslateFunc cb = do
    let cb' = wrap_TranslateFunc Nothing cb
    mk_TranslateFunc cb' >>= newCClosure


wrap_TranslateFunc ::
    Maybe (Ptr (FunPtr C_TranslateFunc)) ->
    TranslateFunc ->
    CString ->
    Ptr () ->
    IO CString
wrap_TranslateFunc funptrptr _cb str data_ = do
    str' <- cstringToText str
    result <- _cb  str' data_
    maybeReleaseFunPtr funptrptr
    result' <- textToCString result
    return result'


-- callback ThreadFunc
--          -> Callable {returnType = Just (TBasicType TPtr), returnMayBeNull = True, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "the return value of the thread", sinceVersion = Nothing}, args = [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data passed to the thread", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of the @func functions passed to g_thread_new()\nor g_thread_try_new().", sinceVersion = Nothing}}
type C_ThreadFunc =
    Ptr () ->
    IO (Ptr ())

-- Args : [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data passed to the thread", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TPtr)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_ThreadFunc :: FunPtr C_ThreadFunc -> C_ThreadFunc

dynamic_ThreadFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_ThreadFunc
    -> Ptr ()
    {- ^ /@data@/: data passed to the thread -}
    -> m (Ptr ())
    {- ^ __Returns:__ the return value of the thread -}
dynamic_ThreadFunc __funPtr data_ = liftIO $ do
    result <- (__dynamic_C_ThreadFunc __funPtr) data_
    return result

foreign import ccall "wrapper"
    mk_ThreadFunc :: C_ThreadFunc -> IO (FunPtr C_ThreadFunc)

type ThreadFunc =
    Ptr () ->
    IO (Ptr ())

noThreadFunc :: Maybe ThreadFunc
noThreadFunc = Nothing

genClosure_ThreadFunc :: ThreadFunc -> IO Closure
genClosure_ThreadFunc cb = do
    let cb' = wrap_ThreadFunc Nothing cb
    mk_ThreadFunc cb' >>= newCClosure


wrap_ThreadFunc ::
    Maybe (Ptr (FunPtr C_ThreadFunc)) ->
    ThreadFunc ->
    Ptr () ->
    IO (Ptr ())
wrap_ThreadFunc funptrptr _cb data_ = do
    result <- _cb  data_
    maybeReleaseFunPtr funptrptr
    return result


-- callback TestLogFatalFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the program should abort, %FALSE otherwise", sinceVersion = Nothing}, args = [Arg {argCName = "log_domain", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the log domain of the message", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "log_level", argType = TInterface (Name {namespace = "GLib", name = "LogLevelFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the log level of the message (including the fatal and recursion flags)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "message", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the message to process", 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, set in g_test_log_set_fatal_handler()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the prototype of fatal log handler functions.", sinceVersion = Just "2.22"}}
type C_TestLogFatalFunc =
    CString ->
    CUInt ->
    CString ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "log_domain", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the log domain of the message", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "log_level", argType = TInterface (Name {namespace = "GLib", name = "LogLevelFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the log level of the message (including the fatal and recursion flags)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "message", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the message to process", 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, set in g_test_log_set_fatal_handler()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TestLogFatalFunc :: FunPtr C_TestLogFatalFunc -> C_TestLogFatalFunc

dynamic_TestLogFatalFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TestLogFatalFunc
    -> T.Text
    {- ^ /@logDomain@/: the log domain of the message -}
    -> [GLib.Flags.LogLevelFlags]
    {- ^ /@logLevel@/: the log level of the message (including the fatal and recursion flags) -}
    -> T.Text
    {- ^ /@message@/: the message to process -}
    -> Ptr ()
    {- ^ /@userData@/: user data, set in @/g_test_log_set_fatal_handler()/@ -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the program should abort, 'False' otherwise -}
dynamic_TestLogFatalFunc __funPtr logDomain logLevel message userData = liftIO $ do
    logDomain' <- textToCString logDomain
    let logLevel' = gflagsToWord logLevel
    message' <- textToCString message
    result <- (__dynamic_C_TestLogFatalFunc __funPtr) logDomain' logLevel' message' userData
    let result' = (/= 0) result
    freeMem logDomain'
    freeMem message'
    return result'

foreign import ccall "wrapper"
    mk_TestLogFatalFunc :: C_TestLogFatalFunc -> IO (FunPtr C_TestLogFatalFunc)

type TestLogFatalFunc =
    T.Text ->
    [GLib.Flags.LogLevelFlags] ->
    T.Text ->
    IO Bool

noTestLogFatalFunc :: Maybe TestLogFatalFunc
noTestLogFatalFunc = Nothing

type TestLogFatalFunc_WithClosures =
    T.Text ->
    [GLib.Flags.LogLevelFlags] ->
    T.Text ->
    Ptr () ->
    IO Bool

noTestLogFatalFunc_WithClosures :: Maybe TestLogFatalFunc_WithClosures
noTestLogFatalFunc_WithClosures = Nothing

drop_closures_TestLogFatalFunc :: TestLogFatalFunc -> TestLogFatalFunc_WithClosures
drop_closures_TestLogFatalFunc _f logDomain logLevel message _ = _f logDomain logLevel message

genClosure_TestLogFatalFunc :: TestLogFatalFunc -> IO Closure
genClosure_TestLogFatalFunc cb = do
    let cb' = drop_closures_TestLogFatalFunc cb
    let cb'' = wrap_TestLogFatalFunc Nothing cb'
    mk_TestLogFatalFunc cb'' >>= newCClosure


wrap_TestLogFatalFunc ::
    Maybe (Ptr (FunPtr C_TestLogFatalFunc)) ->
    TestLogFatalFunc_WithClosures ->
    CString ->
    CUInt ->
    CString ->
    Ptr () ->
    IO CInt
wrap_TestLogFatalFunc funptrptr _cb logDomain logLevel message userData = do
    logDomain' <- cstringToText logDomain
    let logLevel' = wordToGFlags logLevel
    message' <- cstringToText message
    result <- _cb  logDomain' logLevel' message' userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback TestFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The type used for test case functions.", sinceVersion = Just "2.28"}}
type C_TestFunc =
    IO ()

-- Args : []
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TestFunc :: FunPtr C_TestFunc -> C_TestFunc

dynamic_TestFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TestFunc
    -> m ()
dynamic_TestFunc __funPtr = liftIO $ do
    (__dynamic_C_TestFunc __funPtr)
    return ()

foreign import ccall "wrapper"
    mk_TestFunc :: C_TestFunc -> IO (FunPtr C_TestFunc)

type TestFunc =
    IO ()

noTestFunc :: Maybe TestFunc
noTestFunc = Nothing

genClosure_TestFunc :: TestFunc -> IO Closure
genClosure_TestFunc cb = do
    let cb' = wrap_TestFunc Nothing cb
    mk_TestFunc cb' >>= newCClosure


wrap_TestFunc ::
    Maybe (Ptr (FunPtr C_TestFunc)) ->
    TestFunc ->
    IO ()
wrap_TestFunc funptrptr _cb = do
    _cb 
    maybeReleaseFunPtr funptrptr


-- callback TestFixtureFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "fixture", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the test fixture", 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 "the data provided when registering the test", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The type used for functions that operate on test fixtures.  This is\nused for the fixture setup and teardown functions as well as for the\ntestcases themselves.\n\n@user_data is a pointer to the data that was given when registering\nthe test case.\n\n@fixture will be a pointer to the area of memory allocated by the\ntest framework, of the size requested.  If the requested size was\nzero then @fixture will be equal to @user_data.", sinceVersion = Just "2.28"}}
type C_TestFixtureFunc =
    Ptr () ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "fixture", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the test fixture", 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 "the data provided when registering the test", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TestFixtureFunc :: FunPtr C_TestFixtureFunc -> C_TestFixtureFunc

dynamic_TestFixtureFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TestFixtureFunc
    -> Ptr ()
    {- ^ /@fixture@/: the test fixture -}
    -> Ptr ()
    {- ^ /@userData@/: the data provided when registering the test -}
    -> m ()
dynamic_TestFixtureFunc __funPtr fixture userData = liftIO $ do
    (__dynamic_C_TestFixtureFunc __funPtr) fixture userData
    return ()

foreign import ccall "wrapper"
    mk_TestFixtureFunc :: C_TestFixtureFunc -> IO (FunPtr C_TestFixtureFunc)

type TestFixtureFunc =
    Ptr () ->
    IO ()

noTestFixtureFunc :: Maybe TestFixtureFunc
noTestFixtureFunc = Nothing

type TestFixtureFunc_WithClosures =
    Ptr () ->
    Ptr () ->
    IO ()

noTestFixtureFunc_WithClosures :: Maybe TestFixtureFunc_WithClosures
noTestFixtureFunc_WithClosures = Nothing

drop_closures_TestFixtureFunc :: TestFixtureFunc -> TestFixtureFunc_WithClosures
drop_closures_TestFixtureFunc _f fixture _ = _f fixture

genClosure_TestFixtureFunc :: TestFixtureFunc -> IO Closure
genClosure_TestFixtureFunc cb = do
    let cb' = drop_closures_TestFixtureFunc cb
    let cb'' = wrap_TestFixtureFunc Nothing cb'
    mk_TestFixtureFunc cb'' >>= newCClosure


wrap_TestFixtureFunc ::
    Maybe (Ptr (FunPtr C_TestFixtureFunc)) ->
    TestFixtureFunc_WithClosures ->
    Ptr () ->
    Ptr () ->
    IO ()
wrap_TestFixtureFunc funptrptr _cb fixture userData = do
    _cb  fixture userData
    maybeReleaseFunPtr funptrptr


-- callback TestDataFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the data provided when registering the test", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 0, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The type used for test case functions that take an extra pointer\nargument.", sinceVersion = Just "2.28"}}
type C_TestDataFunc =
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the data provided when registering the test", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 0, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TestDataFunc :: FunPtr C_TestDataFunc -> C_TestDataFunc

dynamic_TestDataFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TestDataFunc
    -> Ptr ()
    {- ^ /@userData@/: the data provided when registering the test -}
    -> m ()
dynamic_TestDataFunc __funPtr userData = liftIO $ do
    (__dynamic_C_TestDataFunc __funPtr) userData
    return ()

foreign import ccall "wrapper"
    mk_TestDataFunc :: C_TestDataFunc -> IO (FunPtr C_TestDataFunc)

type TestDataFunc =
    IO ()

noTestDataFunc :: Maybe TestDataFunc
noTestDataFunc = Nothing

type TestDataFunc_WithClosures =
    Ptr () ->
    IO ()

noTestDataFunc_WithClosures :: Maybe TestDataFunc_WithClosures
noTestDataFunc_WithClosures = Nothing

drop_closures_TestDataFunc :: TestDataFunc -> TestDataFunc_WithClosures
drop_closures_TestDataFunc _f _ = _f 

genClosure_TestDataFunc :: TestDataFunc -> IO Closure
genClosure_TestDataFunc cb = do
    let cb' = drop_closures_TestDataFunc cb
    let cb'' = wrap_TestDataFunc Nothing cb'
    mk_TestDataFunc cb'' >>= newCClosure


wrap_TestDataFunc ::
    Maybe (Ptr (FunPtr C_TestDataFunc)) ->
    TestDataFunc_WithClosures ->
    Ptr () ->
    IO ()
wrap_TestDataFunc funptrptr _cb userData = do
    _cb  userData
    maybeReleaseFunPtr funptrptr


-- callback SpawnChildSetupFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data to pass to the function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 0, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of the setup function passed to g_spawn_async(),\ng_spawn_sync() and g_spawn_async_with_pipes(), which can, in very\nlimited ways, be used to affect the child's execution.\n\nOn POSIX platforms, the function is called in the child after GLib\nhas performed all the setup it plans to perform, but before calling\nexec(). Actions taken in this function will only affect the child,\nnot the parent.\n\nOn Windows, the function is called in the parent. Its usefulness on\nWindows is thus questionable. In many cases executing the child setup\nfunction in the parent can have ill effects, and you should be very\ncareful when porting software to Windows that uses child setup\nfunctions.\n\nHowever, even on POSIX, you are extremely limited in what you can\nsafely do from a #GSpawnChildSetupFunc, because any mutexes that were\nheld by other threads in the parent process at the time of the fork()\nwill still be locked in the child process, and they will never be\nunlocked (since the threads that held them don't exist in the child).\nPOSIX allows only async-signal-safe functions (see signal(7)) to be\ncalled in the child between fork() and exec(), which drastically limits\nthe usefulness of child setup functions.\n\nIn particular, it is not safe to call any function which may\ncall malloc(), which includes POSIX functions such as setenv().\nIf you need to set up the child environment differently from\nthe parent, you should use g_get_environ(), g_environ_setenv(),\nand g_environ_unsetenv(), and then pass the complete environment\nlist to the `g_spawn...` function.", sinceVersion = Nothing}}
type C_SpawnChildSetupFunc =
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data to pass to the function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 0, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_SpawnChildSetupFunc :: FunPtr C_SpawnChildSetupFunc -> C_SpawnChildSetupFunc

dynamic_SpawnChildSetupFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SpawnChildSetupFunc
    -> Ptr ()
    {- ^ /@userData@/: user data to pass to the function. -}
    -> m ()
dynamic_SpawnChildSetupFunc __funPtr userData = liftIO $ do
    (__dynamic_C_SpawnChildSetupFunc __funPtr) userData
    return ()

foreign import ccall "wrapper"
    mk_SpawnChildSetupFunc :: C_SpawnChildSetupFunc -> IO (FunPtr C_SpawnChildSetupFunc)

type SpawnChildSetupFunc =
    IO ()

noSpawnChildSetupFunc :: Maybe SpawnChildSetupFunc
noSpawnChildSetupFunc = Nothing

type SpawnChildSetupFunc_WithClosures =
    Ptr () ->
    IO ()

noSpawnChildSetupFunc_WithClosures :: Maybe SpawnChildSetupFunc_WithClosures
noSpawnChildSetupFunc_WithClosures = Nothing

drop_closures_SpawnChildSetupFunc :: SpawnChildSetupFunc -> SpawnChildSetupFunc_WithClosures
drop_closures_SpawnChildSetupFunc _f _ = _f 

genClosure_SpawnChildSetupFunc :: SpawnChildSetupFunc -> IO Closure
genClosure_SpawnChildSetupFunc cb = do
    let cb' = drop_closures_SpawnChildSetupFunc cb
    let cb'' = wrap_SpawnChildSetupFunc Nothing cb'
    mk_SpawnChildSetupFunc cb'' >>= newCClosure


wrap_SpawnChildSetupFunc ::
    Maybe (Ptr (FunPtr C_SpawnChildSetupFunc)) ->
    SpawnChildSetupFunc_WithClosures ->
    Ptr () ->
    IO ()
wrap_SpawnChildSetupFunc funptrptr _cb userData = do
    _cb  userData
    maybeReleaseFunPtr funptrptr


-- callback SourceFuncsPrepareFieldCallback
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "source", argType = TInterface (Name {namespace = "GLib", name = "Source"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "timeout_", argType = TBasicType TInt, 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}}
type C_SourceFuncsPrepareFieldCallback =
    Ptr GLib.Source.Source ->
    Int32 ->
    IO CInt

-- Args : [Arg {argCName = "source", argType = TInterface (Name {namespace = "GLib", name = "Source"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "timeout_", argType = TBasicType TInt, 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_SourceFuncsPrepareFieldCallback :: FunPtr C_SourceFuncsPrepareFieldCallback -> C_SourceFuncsPrepareFieldCallback

dynamic_SourceFuncsPrepareFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SourceFuncsPrepareFieldCallback
    -> GLib.Source.Source
    -> Int32
    -> m Bool
dynamic_SourceFuncsPrepareFieldCallback __funPtr source timeout_ = liftIO $ do
    source' <- unsafeManagedPtrGetPtr source
    result <- (__dynamic_C_SourceFuncsPrepareFieldCallback __funPtr) source' timeout_
    let result' = (/= 0) result
    touchManagedPtr source
    return result'

foreign import ccall "wrapper"
    mk_SourceFuncsPrepareFieldCallback :: C_SourceFuncsPrepareFieldCallback -> IO (FunPtr C_SourceFuncsPrepareFieldCallback)

type SourceFuncsPrepareFieldCallback =
    GLib.Source.Source ->
    Int32 ->
    IO Bool

noSourceFuncsPrepareFieldCallback :: Maybe SourceFuncsPrepareFieldCallback
noSourceFuncsPrepareFieldCallback = Nothing

genClosure_SourceFuncsPrepareFieldCallback :: SourceFuncsPrepareFieldCallback -> IO Closure
genClosure_SourceFuncsPrepareFieldCallback cb = do
    let cb' = wrap_SourceFuncsPrepareFieldCallback Nothing cb
    mk_SourceFuncsPrepareFieldCallback cb' >>= newCClosure


wrap_SourceFuncsPrepareFieldCallback ::
    Maybe (Ptr (FunPtr C_SourceFuncsPrepareFieldCallback)) ->
    SourceFuncsPrepareFieldCallback ->
    Ptr GLib.Source.Source ->
    Int32 ->
    IO CInt
wrap_SourceFuncsPrepareFieldCallback funptrptr _cb source timeout_ = do
    B.ManagedPtr.withTransient GLib.Source.Source source $ \source' -> do
        result <- _cb  source' timeout_
        maybeReleaseFunPtr funptrptr
        let result' = (fromIntegral . fromEnum) result
        return result'


-- callback SourceFuncsFinalizeFieldCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "source", argType = TInterface (Name {namespace = "GLib", name = "Source"}), 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}}
type C_SourceFuncsFinalizeFieldCallback =
    Ptr GLib.Source.Source ->
    IO ()

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

foreign import ccall "dynamic" __dynamic_C_SourceFuncsFinalizeFieldCallback :: FunPtr C_SourceFuncsFinalizeFieldCallback -> C_SourceFuncsFinalizeFieldCallback

dynamic_SourceFuncsFinalizeFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SourceFuncsFinalizeFieldCallback
    -> GLib.Source.Source
    -> m ()
dynamic_SourceFuncsFinalizeFieldCallback __funPtr source = liftIO $ do
    source' <- unsafeManagedPtrGetPtr source
    (__dynamic_C_SourceFuncsFinalizeFieldCallback __funPtr) source'
    touchManagedPtr source
    return ()

foreign import ccall "wrapper"
    mk_SourceFuncsFinalizeFieldCallback :: C_SourceFuncsFinalizeFieldCallback -> IO (FunPtr C_SourceFuncsFinalizeFieldCallback)

type SourceFuncsFinalizeFieldCallback =
    GLib.Source.Source ->
    IO ()

noSourceFuncsFinalizeFieldCallback :: Maybe SourceFuncsFinalizeFieldCallback
noSourceFuncsFinalizeFieldCallback = Nothing

genClosure_SourceFuncsFinalizeFieldCallback :: SourceFuncsFinalizeFieldCallback -> IO Closure
genClosure_SourceFuncsFinalizeFieldCallback cb = do
    let cb' = wrap_SourceFuncsFinalizeFieldCallback Nothing cb
    mk_SourceFuncsFinalizeFieldCallback cb' >>= newCClosure


wrap_SourceFuncsFinalizeFieldCallback ::
    Maybe (Ptr (FunPtr C_SourceFuncsFinalizeFieldCallback)) ->
    SourceFuncsFinalizeFieldCallback ->
    Ptr GLib.Source.Source ->
    IO ()
wrap_SourceFuncsFinalizeFieldCallback funptrptr _cb source = do
    B.ManagedPtr.withTransient GLib.Source.Source source $ \source' -> do
        _cb  source'
        maybeReleaseFunPtr funptrptr


-- callback SourceFuncsCheckFieldCallback
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "source", argType = TInterface (Name {namespace = "GLib", name = "Source"}), 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}}
type C_SourceFuncsCheckFieldCallback =
    Ptr GLib.Source.Source ->
    IO CInt

-- Args : [Arg {argCName = "source", argType = TInterface (Name {namespace = "GLib", name = "Source"}), 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_SourceFuncsCheckFieldCallback :: FunPtr C_SourceFuncsCheckFieldCallback -> C_SourceFuncsCheckFieldCallback

dynamic_SourceFuncsCheckFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SourceFuncsCheckFieldCallback
    -> GLib.Source.Source
    -> m Bool
dynamic_SourceFuncsCheckFieldCallback __funPtr source = liftIO $ do
    source' <- unsafeManagedPtrGetPtr source
    result <- (__dynamic_C_SourceFuncsCheckFieldCallback __funPtr) source'
    let result' = (/= 0) result
    touchManagedPtr source
    return result'

foreign import ccall "wrapper"
    mk_SourceFuncsCheckFieldCallback :: C_SourceFuncsCheckFieldCallback -> IO (FunPtr C_SourceFuncsCheckFieldCallback)

type SourceFuncsCheckFieldCallback =
    GLib.Source.Source ->
    IO Bool

noSourceFuncsCheckFieldCallback :: Maybe SourceFuncsCheckFieldCallback
noSourceFuncsCheckFieldCallback = Nothing

genClosure_SourceFuncsCheckFieldCallback :: SourceFuncsCheckFieldCallback -> IO Closure
genClosure_SourceFuncsCheckFieldCallback cb = do
    let cb' = wrap_SourceFuncsCheckFieldCallback Nothing cb
    mk_SourceFuncsCheckFieldCallback cb' >>= newCClosure


wrap_SourceFuncsCheckFieldCallback ::
    Maybe (Ptr (FunPtr C_SourceFuncsCheckFieldCallback)) ->
    SourceFuncsCheckFieldCallback ->
    Ptr GLib.Source.Source ->
    IO CInt
wrap_SourceFuncsCheckFieldCallback funptrptr _cb source = do
    B.ManagedPtr.withTransient GLib.Source.Source source $ \source' -> do
        result <- _cb  source'
        maybeReleaseFunPtr funptrptr
        let result' = (fromIntegral . fromEnum) result
        return result'


-- callback SourceFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%FALSE if the source should be removed. #G_SOURCE_CONTINUE and\n#G_SOURCE_REMOVE are more memorable names for the return value.", sinceVersion = Nothing}, args = [Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data passed to the function, set when the source was\n    created with one of the above functions", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 0, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of function passed to g_timeout_add(),\ng_timeout_add_full(), g_idle_add(), and g_idle_add_full().", sinceVersion = Nothing}}
type C_SourceFunc =
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data passed to the function, set when the source was\n    created with one of the above functions", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 0, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_SourceFunc :: FunPtr C_SourceFunc -> C_SourceFunc

dynamic_SourceFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SourceFunc
    -> Ptr ()
    {- ^ /@userData@/: data passed to the function, set when the source was
    created with one of the above functions -}
    -> m Bool
    {- ^ __Returns:__ 'False' if the source should be removed. 'GI.GLib.Constants.SOURCE_CONTINUE' and
'GI.GLib.Constants.SOURCE_REMOVE' are more memorable names for the return value. -}
dynamic_SourceFunc __funPtr userData = liftIO $ do
    result <- (__dynamic_C_SourceFunc __funPtr) userData
    let result' = (/= 0) result
    return result'

foreign import ccall "wrapper"
    mk_SourceFunc :: C_SourceFunc -> IO (FunPtr C_SourceFunc)

type SourceFunc =
    IO Bool

noSourceFunc :: Maybe SourceFunc
noSourceFunc = Nothing

type SourceFunc_WithClosures =
    Ptr () ->
    IO Bool

noSourceFunc_WithClosures :: Maybe SourceFunc_WithClosures
noSourceFunc_WithClosures = Nothing

drop_closures_SourceFunc :: SourceFunc -> SourceFunc_WithClosures
drop_closures_SourceFunc _f _ = _f 

genClosure_SourceFunc :: SourceFunc -> IO Closure
genClosure_SourceFunc cb = do
    let cb' = drop_closures_SourceFunc cb
    let cb'' = wrap_SourceFunc Nothing cb'
    mk_SourceFunc cb'' >>= newCClosure


wrap_SourceFunc ::
    Maybe (Ptr (FunPtr C_SourceFunc)) ->
    SourceFunc_WithClosures ->
    Ptr () ->
    IO CInt
wrap_SourceFunc funptrptr _cb userData = do
    result <- _cb  userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback SourceDummyMarshal
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "This is just a placeholder for #GClosureMarshal,\nwhich cannot be used here for dependency reasons.", sinceVersion = Nothing}}
type C_SourceDummyMarshal =
    IO ()

-- Args : []
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_SourceDummyMarshal :: FunPtr C_SourceDummyMarshal -> C_SourceDummyMarshal

dynamic_SourceDummyMarshal ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SourceDummyMarshal
    -> m ()
dynamic_SourceDummyMarshal __funPtr = liftIO $ do
    (__dynamic_C_SourceDummyMarshal __funPtr)
    return ()

foreign import ccall "wrapper"
    mk_SourceDummyMarshal :: C_SourceDummyMarshal -> IO (FunPtr C_SourceDummyMarshal)

type SourceDummyMarshal =
    IO ()

noSourceDummyMarshal :: Maybe SourceDummyMarshal
noSourceDummyMarshal = Nothing

genClosure_SourceDummyMarshal :: SourceDummyMarshal -> IO Closure
genClosure_SourceDummyMarshal cb = do
    let cb' = wrap_SourceDummyMarshal Nothing cb
    mk_SourceDummyMarshal cb' >>= newCClosure


wrap_SourceDummyMarshal ::
    Maybe (Ptr (FunPtr C_SourceDummyMarshal)) ->
    SourceDummyMarshal ->
    IO ()
wrap_SourceDummyMarshal funptrptr _cb = do
    _cb 
    maybeReleaseFunPtr funptrptr


-- callback SourceCallbackFuncsUnrefFieldCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "cb_data", argType = TBasicType TPtr, 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}}
type C_SourceCallbackFuncsUnrefFieldCallback =
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "cb_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_SourceCallbackFuncsUnrefFieldCallback :: FunPtr C_SourceCallbackFuncsUnrefFieldCallback -> C_SourceCallbackFuncsUnrefFieldCallback

dynamic_SourceCallbackFuncsUnrefFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SourceCallbackFuncsUnrefFieldCallback
    -> Ptr ()
    -> m ()
dynamic_SourceCallbackFuncsUnrefFieldCallback __funPtr cbData = liftIO $ do
    (__dynamic_C_SourceCallbackFuncsUnrefFieldCallback __funPtr) cbData
    return ()

foreign import ccall "wrapper"
    mk_SourceCallbackFuncsUnrefFieldCallback :: C_SourceCallbackFuncsUnrefFieldCallback -> IO (FunPtr C_SourceCallbackFuncsUnrefFieldCallback)

type SourceCallbackFuncsUnrefFieldCallback =
    Ptr () ->
    IO ()

noSourceCallbackFuncsUnrefFieldCallback :: Maybe SourceCallbackFuncsUnrefFieldCallback
noSourceCallbackFuncsUnrefFieldCallback = Nothing

genClosure_SourceCallbackFuncsUnrefFieldCallback :: SourceCallbackFuncsUnrefFieldCallback -> IO Closure
genClosure_SourceCallbackFuncsUnrefFieldCallback cb = do
    let cb' = wrap_SourceCallbackFuncsUnrefFieldCallback Nothing cb
    mk_SourceCallbackFuncsUnrefFieldCallback cb' >>= newCClosure


wrap_SourceCallbackFuncsUnrefFieldCallback ::
    Maybe (Ptr (FunPtr C_SourceCallbackFuncsUnrefFieldCallback)) ->
    SourceCallbackFuncsUnrefFieldCallback ->
    Ptr () ->
    IO ()
wrap_SourceCallbackFuncsUnrefFieldCallback funptrptr _cb cbData = do
    _cb  cbData
    maybeReleaseFunPtr funptrptr


-- callback SourceCallbackFuncsRefFieldCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "cb_data", argType = TBasicType TPtr, 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}}
type C_SourceCallbackFuncsRefFieldCallback =
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "cb_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_SourceCallbackFuncsRefFieldCallback :: FunPtr C_SourceCallbackFuncsRefFieldCallback -> C_SourceCallbackFuncsRefFieldCallback

dynamic_SourceCallbackFuncsRefFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SourceCallbackFuncsRefFieldCallback
    -> Ptr ()
    -> m ()
dynamic_SourceCallbackFuncsRefFieldCallback __funPtr cbData = liftIO $ do
    (__dynamic_C_SourceCallbackFuncsRefFieldCallback __funPtr) cbData
    return ()

foreign import ccall "wrapper"
    mk_SourceCallbackFuncsRefFieldCallback :: C_SourceCallbackFuncsRefFieldCallback -> IO (FunPtr C_SourceCallbackFuncsRefFieldCallback)

type SourceCallbackFuncsRefFieldCallback =
    Ptr () ->
    IO ()

noSourceCallbackFuncsRefFieldCallback :: Maybe SourceCallbackFuncsRefFieldCallback
noSourceCallbackFuncsRefFieldCallback = Nothing

genClosure_SourceCallbackFuncsRefFieldCallback :: SourceCallbackFuncsRefFieldCallback -> IO Closure
genClosure_SourceCallbackFuncsRefFieldCallback cb = do
    let cb' = wrap_SourceCallbackFuncsRefFieldCallback Nothing cb
    mk_SourceCallbackFuncsRefFieldCallback cb' >>= newCClosure


wrap_SourceCallbackFuncsRefFieldCallback ::
    Maybe (Ptr (FunPtr C_SourceCallbackFuncsRefFieldCallback)) ->
    SourceCallbackFuncsRefFieldCallback ->
    Ptr () ->
    IO ()
wrap_SourceCallbackFuncsRefFieldCallback funptrptr _cb cbData = do
    _cb  cbData
    maybeReleaseFunPtr funptrptr


-- callback SequenceIterCompareFunc
--          -> Callable {returnType = Just (TBasicType TInt), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "zero if the iterators are equal, a negative value if @a\n    comes before @b, and a positive value if @b comes before @a.", sinceVersion = Nothing}, args = [Arg {argCName = "a", argType = TInterface (Name {namespace = "GLib", name = "SequenceIter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSequenceIter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "b", argType = TInterface (Name {namespace = "GLib", name = "SequenceIter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSequenceIter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "A #GSequenceIterCompareFunc is a function used to compare iterators.\nIt must return zero if the iterators compare equal, a negative value\nif @a comes before @b, and a positive value if @b comes before @a.", sinceVersion = Nothing}}
type C_SequenceIterCompareFunc =
    Ptr GLib.SequenceIter.SequenceIter ->
    Ptr GLib.SequenceIter.SequenceIter ->
    Ptr () ->
    IO Int32

-- Args : [Arg {argCName = "a", argType = TInterface (Name {namespace = "GLib", name = "SequenceIter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSequenceIter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "b", argType = TInterface (Name {namespace = "GLib", name = "SequenceIter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSequenceIter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_SequenceIterCompareFunc :: FunPtr C_SequenceIterCompareFunc -> C_SequenceIterCompareFunc

dynamic_SequenceIterCompareFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SequenceIterCompareFunc
    -> GLib.SequenceIter.SequenceIter
    {- ^ /@a@/: a 'GI.GLib.Structs.SequenceIter.SequenceIter' -}
    -> GLib.SequenceIter.SequenceIter
    {- ^ /@b@/: a 'GI.GLib.Structs.SequenceIter.SequenceIter' -}
    -> Ptr ()
    {- ^ /@data@/: user data -}
    -> m Int32
    {- ^ __Returns:__ zero if the iterators are equal, a negative value if /@a@/
    comes before /@b@/, and a positive value if /@b@/ comes before /@a@/. -}
dynamic_SequenceIterCompareFunc __funPtr a b data_ = liftIO $ do
    a' <- unsafeManagedPtrGetPtr a
    b' <- unsafeManagedPtrGetPtr b
    result <- (__dynamic_C_SequenceIterCompareFunc __funPtr) a' b' data_
    touchManagedPtr a
    touchManagedPtr b
    return result

foreign import ccall "wrapper"
    mk_SequenceIterCompareFunc :: C_SequenceIterCompareFunc -> IO (FunPtr C_SequenceIterCompareFunc)

type SequenceIterCompareFunc =
    GLib.SequenceIter.SequenceIter ->
    GLib.SequenceIter.SequenceIter ->
    Ptr () ->
    IO Int32

noSequenceIterCompareFunc :: Maybe SequenceIterCompareFunc
noSequenceIterCompareFunc = Nothing

genClosure_SequenceIterCompareFunc :: SequenceIterCompareFunc -> IO Closure
genClosure_SequenceIterCompareFunc cb = do
    let cb' = wrap_SequenceIterCompareFunc Nothing cb
    mk_SequenceIterCompareFunc cb' >>= newCClosure


wrap_SequenceIterCompareFunc ::
    Maybe (Ptr (FunPtr C_SequenceIterCompareFunc)) ->
    SequenceIterCompareFunc ->
    Ptr GLib.SequenceIter.SequenceIter ->
    Ptr GLib.SequenceIter.SequenceIter ->
    Ptr () ->
    IO Int32
wrap_SequenceIterCompareFunc funptrptr _cb a b data_ = do
    a' <- (newPtr GLib.SequenceIter.SequenceIter) a
    b' <- (newPtr GLib.SequenceIter.SequenceIter) b
    result <- _cb  a' b' data_
    maybeReleaseFunPtr funptrptr
    return result


-- callback ScannerMsgFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "scanner", argType = TInterface (Name {namespace = "GLib", name = "Scanner"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GScanner", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "message", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the message", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "error", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE if the message signals an error,\n    %FALSE if it signals a warning.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of the message handler function.", sinceVersion = Nothing}}
type C_ScannerMsgFunc =
    Ptr GLib.Scanner.Scanner ->
    CString ->
    CInt ->
    IO ()

-- Args : [Arg {argCName = "scanner", argType = TInterface (Name {namespace = "GLib", name = "Scanner"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GScanner", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "message", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the message", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "error", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE if the message signals an error,\n    %FALSE if it signals a warning.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_ScannerMsgFunc :: FunPtr C_ScannerMsgFunc -> C_ScannerMsgFunc

dynamic_ScannerMsgFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_ScannerMsgFunc
    -> GLib.Scanner.Scanner
    {- ^ /@scanner@/: a 'GI.GLib.Structs.Scanner.Scanner' -}
    -> T.Text
    {- ^ /@message@/: the message -}
    -> Bool
    {- ^ /@error@/: 'True' if the message signals an error,
    'False' if it signals a warning. -}
    -> m ()
dynamic_ScannerMsgFunc __funPtr scanner message error_ = liftIO $ do
    scanner' <- unsafeManagedPtrGetPtr scanner
    message' <- textToCString message
    let error_' = (fromIntegral . fromEnum) error_
    (__dynamic_C_ScannerMsgFunc __funPtr) scanner' message' error_'
    touchManagedPtr scanner
    freeMem message'
    return ()

foreign import ccall "wrapper"
    mk_ScannerMsgFunc :: C_ScannerMsgFunc -> IO (FunPtr C_ScannerMsgFunc)

type ScannerMsgFunc =
    GLib.Scanner.Scanner ->
    T.Text ->
    Bool ->
    IO ()

noScannerMsgFunc :: Maybe ScannerMsgFunc
noScannerMsgFunc = Nothing

genClosure_ScannerMsgFunc :: ScannerMsgFunc -> IO Closure
genClosure_ScannerMsgFunc cb = do
    let cb' = wrap_ScannerMsgFunc Nothing cb
    mk_ScannerMsgFunc cb' >>= newCClosure


wrap_ScannerMsgFunc ::
    Maybe (Ptr (FunPtr C_ScannerMsgFunc)) ->
    ScannerMsgFunc ->
    Ptr GLib.Scanner.Scanner ->
    CString ->
    CInt ->
    IO ()
wrap_ScannerMsgFunc funptrptr _cb scanner message error_ = do
    scanner' <- (newPtr GLib.Scanner.Scanner) scanner
    message' <- cstringToText message
    let error_' = (/= 0) error_
    _cb  scanner' message' error_'
    maybeReleaseFunPtr funptrptr


-- callback RegexEvalCallback
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%FALSE to continue the replacement process, %TRUE to stop it", sinceVersion = Nothing}, args = [Arg {argCName = "match_info", argType = TInterface (Name {namespace = "GLib", name = "MatchInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GMatchInfo generated by the match.\n    Use g_match_info_get_regex() and g_match_info_get_string() if you\n    need the #GRegex or the matched string.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "GLib", name = "String"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GString containing the new string", 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 passed to g_regex_replace_eval()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of the function passed to g_regex_replace_eval().\nIt is called for each occurrence of the pattern in the string passed\nto g_regex_replace_eval(), and it should append the replacement to\n@result.", sinceVersion = Just "2.14"}}
type C_RegexEvalCallback =
    Ptr GLib.MatchInfo.MatchInfo ->
    Ptr GLib.String.String ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "match_info", argType = TInterface (Name {namespace = "GLib", name = "MatchInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GMatchInfo generated by the match.\n    Use g_match_info_get_regex() and g_match_info_get_string() if you\n    need the #GRegex or the matched string.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "GLib", name = "String"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GString containing the new string", 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 passed to g_regex_replace_eval()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_RegexEvalCallback :: FunPtr C_RegexEvalCallback -> C_RegexEvalCallback

dynamic_RegexEvalCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_RegexEvalCallback
    -> GLib.MatchInfo.MatchInfo
    {- ^ /@matchInfo@/: the 'GI.GLib.Structs.MatchInfo.MatchInfo' generated by the match.
    Use 'GI.GLib.Structs.MatchInfo.matchInfoGetRegex' and 'GI.GLib.Structs.MatchInfo.matchInfoGetString' if you
    need the 'GI.GLib.Structs.Regex.Regex' or the matched string. -}
    -> GLib.String.String
    {- ^ /@result@/: a 'GI.GLib.Structs.String.String' containing the new string -}
    -> Ptr ()
    {- ^ /@userData@/: user data passed to @/g_regex_replace_eval()/@ -}
    -> m Bool
    {- ^ __Returns:__ 'False' to continue the replacement process, 'True' to stop it -}
dynamic_RegexEvalCallback __funPtr matchInfo result_ userData = liftIO $ do
    matchInfo' <- unsafeManagedPtrGetPtr matchInfo
    result_' <- unsafeManagedPtrGetPtr result_
    result <- (__dynamic_C_RegexEvalCallback __funPtr) matchInfo' result_' userData
    let result' = (/= 0) result
    touchManagedPtr matchInfo
    touchManagedPtr result_
    return result'

foreign import ccall "wrapper"
    mk_RegexEvalCallback :: C_RegexEvalCallback -> IO (FunPtr C_RegexEvalCallback)

type RegexEvalCallback =
    GLib.MatchInfo.MatchInfo ->
    GLib.String.String ->
    IO Bool

noRegexEvalCallback :: Maybe RegexEvalCallback
noRegexEvalCallback = Nothing

type RegexEvalCallback_WithClosures =
    GLib.MatchInfo.MatchInfo ->
    GLib.String.String ->
    Ptr () ->
    IO Bool

noRegexEvalCallback_WithClosures :: Maybe RegexEvalCallback_WithClosures
noRegexEvalCallback_WithClosures = Nothing

drop_closures_RegexEvalCallback :: RegexEvalCallback -> RegexEvalCallback_WithClosures
drop_closures_RegexEvalCallback _f matchInfo result_ _ = _f matchInfo result_

genClosure_RegexEvalCallback :: RegexEvalCallback -> IO Closure
genClosure_RegexEvalCallback cb = do
    let cb' = drop_closures_RegexEvalCallback cb
    let cb'' = wrap_RegexEvalCallback Nothing cb'
    mk_RegexEvalCallback cb'' >>= newCClosure


wrap_RegexEvalCallback ::
    Maybe (Ptr (FunPtr C_RegexEvalCallback)) ->
    RegexEvalCallback_WithClosures ->
    Ptr GLib.MatchInfo.MatchInfo ->
    Ptr GLib.String.String ->
    Ptr () ->
    IO CInt
wrap_RegexEvalCallback funptrptr _cb matchInfo result_ userData = do
    B.ManagedPtr.withTransient GLib.MatchInfo.MatchInfo matchInfo $ \matchInfo' -> do
        B.ManagedPtr.withTransient GLib.String.String result_ $ \result_' -> do
            result <- _cb  matchInfo' result_' userData
            maybeReleaseFunPtr funptrptr
            let result' = (fromIntegral . fromEnum) result
            return result'


-- callback PrintFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "string", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the message to output", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of the print handler functions.\nThese are called with the complete formatted string to output.", sinceVersion = Nothing}}
type C_PrintFunc =
    CString ->
    IO ()

-- Args : [Arg {argCName = "string", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the message to output", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PrintFunc :: FunPtr C_PrintFunc -> C_PrintFunc

dynamic_PrintFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_PrintFunc
    -> T.Text
    {- ^ /@string@/: the message to output -}
    -> m ()
dynamic_PrintFunc __funPtr string = liftIO $ do
    string' <- textToCString string
    (__dynamic_C_PrintFunc __funPtr) string'
    freeMem string'
    return ()

foreign import ccall "wrapper"
    mk_PrintFunc :: C_PrintFunc -> IO (FunPtr C_PrintFunc)

type PrintFunc =
    T.Text ->
    IO ()

noPrintFunc :: Maybe PrintFunc
noPrintFunc = Nothing

genClosure_PrintFunc :: PrintFunc -> IO Closure
genClosure_PrintFunc cb = do
    let cb' = wrap_PrintFunc Nothing cb
    mk_PrintFunc cb' >>= newCClosure


wrap_PrintFunc ::
    Maybe (Ptr (FunPtr C_PrintFunc)) ->
    PrintFunc ->
    CString ->
    IO ()
wrap_PrintFunc funptrptr _cb string = do
    string' <- cstringToText string
    _cb  string'
    maybeReleaseFunPtr funptrptr


-- callback PollFunc
--          -> Callable {returnType = Just (TBasicType TInt), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "the number of #GPollFD elements which have events or errors\n    reported, or -1 if an error occurred.", sinceVersion = Nothing}, args = [Arg {argCName = "ufds", argType = TInterface (Name {namespace = "GLib", name = "PollFD"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an array of #GPollFD elements", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "nfsd", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the number of elements in @ufds", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "timeout_", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the maximum time to wait for an event of the file descriptors.\n    A negative value indicates an infinite timeout.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of function passed to g_main_context_set_poll_func().\nThe semantics of the function should match those of the poll() system call.", sinceVersion = Nothing}}
type C_PollFunc =
    Ptr GLib.PollFD.PollFD ->
    Word32 ->
    Int32 ->
    IO Int32

-- Args : [Arg {argCName = "ufds", argType = TInterface (Name {namespace = "GLib", name = "PollFD"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an array of #GPollFD elements", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "nfsd", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the number of elements in @ufds", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "timeout_", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the maximum time to wait for an event of the file descriptors.\n    A negative value indicates an infinite timeout.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PollFunc :: FunPtr C_PollFunc -> C_PollFunc

dynamic_PollFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_PollFunc
    -> GLib.PollFD.PollFD
    {- ^ /@ufds@/: an array of 'GI.GLib.Structs.PollFD.PollFD' elements -}
    -> Word32
    {- ^ /@nfsd@/: the number of elements in /@ufds@/ -}
    -> Int32
    {- ^ /@timeout_@/: the maximum time to wait for an event of the file descriptors.
    A negative value indicates an infinite timeout. -}
    -> m Int32
    {- ^ __Returns:__ the number of 'GI.GLib.Structs.PollFD.PollFD' elements which have events or errors
    reported, or -1 if an error occurred. -}
dynamic_PollFunc __funPtr ufds nfsd timeout_ = liftIO $ do
    ufds' <- unsafeManagedPtrGetPtr ufds
    result <- (__dynamic_C_PollFunc __funPtr) ufds' nfsd timeout_
    touchManagedPtr ufds
    return result

foreign import ccall "wrapper"
    mk_PollFunc :: C_PollFunc -> IO (FunPtr C_PollFunc)

type PollFunc =
    GLib.PollFD.PollFD ->
    Word32 ->
    Int32 ->
    IO Int32

noPollFunc :: Maybe PollFunc
noPollFunc = Nothing

genClosure_PollFunc :: PollFunc -> IO Closure
genClosure_PollFunc cb = do
    let cb' = wrap_PollFunc Nothing cb
    mk_PollFunc cb' >>= newCClosure


wrap_PollFunc ::
    Maybe (Ptr (FunPtr C_PollFunc)) ->
    PollFunc ->
    Ptr GLib.PollFD.PollFD ->
    Word32 ->
    Int32 ->
    IO Int32
wrap_PollFunc funptrptr _cb ufds nfsd timeout_ = do
    B.ManagedPtr.withTransient GLib.PollFD.PollFD ufds $ \ufds' -> do
        result <- _cb  ufds' nfsd timeout_
        maybeReleaseFunPtr funptrptr
        return result


-- callback OptionParseFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the function completed successfully, %FALSE if an error\n occurred, in which case @error should be set with g_set_error()", sinceVersion = Nothing}, args = [Arg {argCName = "context", argType = TInterface (Name {namespace = "GLib", name = "OptionContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The active #GOptionContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "group", argType = TInterface (Name {namespace = "GLib", name = "OptionGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The group to which the function belongs", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data added to the #GOptionGroup containing the option when it\n was created with g_option_group_new()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = True, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The type of function that can be called before and after parsing.", sinceVersion = Nothing}}
type C_OptionParseFunc =
    Ptr GLib.OptionContext.OptionContext ->
    Ptr GLib.OptionGroup.OptionGroup ->
    Ptr () ->
    Ptr (Ptr GError) ->
    IO CInt

-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "GLib", name = "OptionContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The active #GOptionContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "group", argType = TInterface (Name {namespace = "GLib", name = "OptionGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The group to which the function belongs", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data added to the #GOptionGroup containing the option when it\n was created with g_option_group_new()", 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_OptionParseFunc :: FunPtr C_OptionParseFunc -> C_OptionParseFunc

dynamic_OptionParseFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_OptionParseFunc
    -> GLib.OptionContext.OptionContext
    {- ^ /@context@/: The active 'GI.GLib.Structs.OptionContext.OptionContext' -}
    -> GLib.OptionGroup.OptionGroup
    {- ^ /@group@/: The group to which the function belongs -}
    -> Ptr ()
    {- ^ /@data@/: User data added to the 'GI.GLib.Structs.OptionGroup.OptionGroup' containing the option when it
 was created with 'GI.GLib.Structs.OptionGroup.optionGroupNew' -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dynamic_OptionParseFunc __funPtr context group data_ = liftIO $ do
    context' <- unsafeManagedPtrGetPtr context
    group' <- unsafeManagedPtrGetPtr group
    onException (do
        _ <- propagateGError $ (__dynamic_C_OptionParseFunc __funPtr) context' group' data_
        touchManagedPtr context
        touchManagedPtr group
        return ()
     ) (do
        return ()
     )

foreign import ccall "wrapper"
    mk_OptionParseFunc :: C_OptionParseFunc -> IO (FunPtr C_OptionParseFunc)

type OptionParseFunc =
    GLib.OptionContext.OptionContext ->
    GLib.OptionGroup.OptionGroup ->
    Ptr () ->
    IO ()

noOptionParseFunc :: Maybe OptionParseFunc
noOptionParseFunc = Nothing

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

-- callback OptionErrorFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "context", argType = TInterface (Name {namespace = "GLib", name = "OptionContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The active #GOptionContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "group", argType = TInterface (Name {namespace = "GLib", name = "OptionGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The group to which the function belongs", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data added to the #GOptionGroup containing the option when it\n was created with g_option_group_new()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = True, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The type of function to be used as callback when a parse error occurs.", sinceVersion = Nothing}}
type C_OptionErrorFunc =
    Ptr GLib.OptionContext.OptionContext ->
    Ptr GLib.OptionGroup.OptionGroup ->
    Ptr () ->
    Ptr (Ptr GError) ->
    IO ()

-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "GLib", name = "OptionContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The active #GOptionContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "group", argType = TInterface (Name {namespace = "GLib", name = "OptionGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The group to which the function belongs", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data added to the #GOptionGroup containing the option when it\n was created with g_option_group_new()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_OptionErrorFunc :: FunPtr C_OptionErrorFunc -> C_OptionErrorFunc

dynamic_OptionErrorFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_OptionErrorFunc
    -> GLib.OptionContext.OptionContext
    {- ^ /@context@/: The active 'GI.GLib.Structs.OptionContext.OptionContext' -}
    -> GLib.OptionGroup.OptionGroup
    {- ^ /@group@/: The group to which the function belongs -}
    -> Ptr ()
    {- ^ /@data@/: User data added to the 'GI.GLib.Structs.OptionGroup.OptionGroup' containing the option when it
 was created with 'GI.GLib.Structs.OptionGroup.optionGroupNew' -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dynamic_OptionErrorFunc __funPtr context group data_ = liftIO $ do
    context' <- unsafeManagedPtrGetPtr context
    group' <- unsafeManagedPtrGetPtr group
    onException (do
        propagateGError $ (__dynamic_C_OptionErrorFunc __funPtr) context' group' data_
        touchManagedPtr context
        touchManagedPtr group
        return ()
     ) (do
        return ()
     )

foreign import ccall "wrapper"
    mk_OptionErrorFunc :: C_OptionErrorFunc -> IO (FunPtr C_OptionErrorFunc)

type OptionErrorFunc =
    GLib.OptionContext.OptionContext ->
    GLib.OptionGroup.OptionGroup ->
    Ptr () ->
    IO ()

noOptionErrorFunc :: Maybe OptionErrorFunc
noOptionErrorFunc = Nothing

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

-- callback OptionArgFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the option was successfully parsed, %FALSE if an error\n occurred, in which case @error should be set with g_set_error()", sinceVersion = Nothing}, args = [Arg {argCName = "option_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name of the option being parsed. This will be either a\n single dash followed by a single letter (for a short name) or two dashes\n followed by a long option name.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The value to be parsed.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data added to the #GOptionGroup containing the option when it\n was created with g_option_group_new()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = True, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The type of function to be passed as callback for %G_OPTION_ARG_CALLBACK\noptions.", sinceVersion = Nothing}}
type C_OptionArgFunc =
    CString ->
    CString ->
    Ptr () ->
    Ptr (Ptr GError) ->
    IO CInt

-- Args : [Arg {argCName = "option_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name of the option being parsed. This will be either a\n single dash followed by a single letter (for a short name) or two dashes\n followed by a long option name.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The value to be parsed.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data added to the #GOptionGroup containing the option when it\n was created with g_option_group_new()", 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_OptionArgFunc :: FunPtr C_OptionArgFunc -> C_OptionArgFunc

dynamic_OptionArgFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_OptionArgFunc
    -> T.Text
    {- ^ /@optionName@/: The name of the option being parsed. This will be either a
 single dash followed by a single letter (for a short name) or two dashes
 followed by a long option name. -}
    -> T.Text
    {- ^ /@value@/: The value to be parsed. -}
    -> Ptr ()
    {- ^ /@data@/: User data added to the 'GI.GLib.Structs.OptionGroup.OptionGroup' containing the option when it
 was created with 'GI.GLib.Structs.OptionGroup.optionGroupNew' -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dynamic_OptionArgFunc __funPtr optionName value data_ = liftIO $ do
    optionName' <- textToCString optionName
    value' <- textToCString value
    onException (do
        _ <- propagateGError $ (__dynamic_C_OptionArgFunc __funPtr) optionName' value' data_
        freeMem optionName'
        freeMem value'
        return ()
     ) (do
        freeMem optionName'
        freeMem value'
     )

foreign import ccall "wrapper"
    mk_OptionArgFunc :: C_OptionArgFunc -> IO (FunPtr C_OptionArgFunc)

type OptionArgFunc =
    T.Text ->
    T.Text ->
    Ptr () ->
    IO ()

noOptionArgFunc :: Maybe OptionArgFunc
noOptionArgFunc = Nothing

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

-- callback NodeTraverseFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE to stop the traversal.", sinceVersion = Nothing}, args = [Arg {argCName = "node", argType = TInterface (Name {namespace = "GLib", name = "Node"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GNode.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to g_node_traverse().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of function passed to g_node_traverse(). The\nfunction is called with each of the nodes visited, together with the\nuser data passed to g_node_traverse(). If the function returns\n%TRUE, then the traversal is stopped.", sinceVersion = Nothing}}
type C_NodeTraverseFunc =
    Ptr GLib.Node.Node ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "node", argType = TInterface (Name {namespace = "GLib", name = "Node"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GNode.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to g_node_traverse().", 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_NodeTraverseFunc :: FunPtr C_NodeTraverseFunc -> C_NodeTraverseFunc

dynamic_NodeTraverseFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_NodeTraverseFunc
    -> GLib.Node.Node
    {- ^ /@node@/: a 'GI.GLib.Structs.Node.Node'. -}
    -> Ptr ()
    {- ^ /@data@/: user data passed to @/g_node_traverse()/@. -}
    -> m Bool
    {- ^ __Returns:__ 'True' to stop the traversal. -}
dynamic_NodeTraverseFunc __funPtr node data_ = liftIO $ do
    node' <- unsafeManagedPtrGetPtr node
    result <- (__dynamic_C_NodeTraverseFunc __funPtr) node' data_
    let result' = (/= 0) result
    touchManagedPtr node
    return result'

foreign import ccall "wrapper"
    mk_NodeTraverseFunc :: C_NodeTraverseFunc -> IO (FunPtr C_NodeTraverseFunc)

type NodeTraverseFunc =
    GLib.Node.Node ->
    Ptr () ->
    IO Bool

noNodeTraverseFunc :: Maybe NodeTraverseFunc
noNodeTraverseFunc = Nothing

genClosure_NodeTraverseFunc :: NodeTraverseFunc -> IO Closure
genClosure_NodeTraverseFunc cb = do
    let cb' = wrap_NodeTraverseFunc Nothing cb
    mk_NodeTraverseFunc cb' >>= newCClosure


wrap_NodeTraverseFunc ::
    Maybe (Ptr (FunPtr C_NodeTraverseFunc)) ->
    NodeTraverseFunc ->
    Ptr GLib.Node.Node ->
    Ptr () ->
    IO CInt
wrap_NodeTraverseFunc funptrptr _cb node data_ = do
    node' <- (newPtr GLib.Node.Node) node
    result <- _cb  node' data_
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback NodeForeachFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "node", argType = TInterface (Name {namespace = "GLib", name = "Node"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GNode.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to g_node_children_foreach().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of function passed to g_node_children_foreach().\nThe function is called with each child node, together with the user\ndata passed to g_node_children_foreach().", sinceVersion = Nothing}}
type C_NodeForeachFunc =
    Ptr GLib.Node.Node ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "node", argType = TInterface (Name {namespace = "GLib", name = "Node"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GNode.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to g_node_children_foreach().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_NodeForeachFunc :: FunPtr C_NodeForeachFunc -> C_NodeForeachFunc

dynamic_NodeForeachFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_NodeForeachFunc
    -> GLib.Node.Node
    {- ^ /@node@/: a 'GI.GLib.Structs.Node.Node'. -}
    -> Ptr ()
    {- ^ /@data@/: user data passed to @/g_node_children_foreach()/@. -}
    -> m ()
dynamic_NodeForeachFunc __funPtr node data_ = liftIO $ do
    node' <- unsafeManagedPtrGetPtr node
    (__dynamic_C_NodeForeachFunc __funPtr) node' data_
    touchManagedPtr node
    return ()

foreign import ccall "wrapper"
    mk_NodeForeachFunc :: C_NodeForeachFunc -> IO (FunPtr C_NodeForeachFunc)

type NodeForeachFunc =
    GLib.Node.Node ->
    Ptr () ->
    IO ()

noNodeForeachFunc :: Maybe NodeForeachFunc
noNodeForeachFunc = Nothing

genClosure_NodeForeachFunc :: NodeForeachFunc -> IO Closure
genClosure_NodeForeachFunc cb = do
    let cb' = wrap_NodeForeachFunc Nothing cb
    mk_NodeForeachFunc cb' >>= newCClosure


wrap_NodeForeachFunc ::
    Maybe (Ptr (FunPtr C_NodeForeachFunc)) ->
    NodeForeachFunc ->
    Ptr GLib.Node.Node ->
    Ptr () ->
    IO ()
wrap_NodeForeachFunc funptrptr _cb node data_ = do
    node' <- (newPtr GLib.Node.Node) node
    _cb  node' data_
    maybeReleaseFunPtr funptrptr


-- callback MemVTableTryReallocFieldCallback
--          -> Callable {returnType = Just (TBasicType TPtr), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "mem", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_bytes", argType = TBasicType TUInt64, 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}}
type C_MemVTableTryReallocFieldCallback =
    Ptr () ->
    Word64 ->
    IO (Ptr ())

-- Args : [Arg {argCName = "mem", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_bytes", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TPtr)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_MemVTableTryReallocFieldCallback :: FunPtr C_MemVTableTryReallocFieldCallback -> C_MemVTableTryReallocFieldCallback

dynamic_MemVTableTryReallocFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MemVTableTryReallocFieldCallback
    -> Ptr ()
    -> Word64
    -> m (Ptr ())
dynamic_MemVTableTryReallocFieldCallback __funPtr mem nBytes = liftIO $ do
    result <- (__dynamic_C_MemVTableTryReallocFieldCallback __funPtr) mem nBytes
    return result

foreign import ccall "wrapper"
    mk_MemVTableTryReallocFieldCallback :: C_MemVTableTryReallocFieldCallback -> IO (FunPtr C_MemVTableTryReallocFieldCallback)

type MemVTableTryReallocFieldCallback =
    Ptr () ->
    Word64 ->
    IO (Ptr ())

noMemVTableTryReallocFieldCallback :: Maybe MemVTableTryReallocFieldCallback
noMemVTableTryReallocFieldCallback = Nothing

genClosure_MemVTableTryReallocFieldCallback :: MemVTableTryReallocFieldCallback -> IO Closure
genClosure_MemVTableTryReallocFieldCallback cb = do
    let cb' = wrap_MemVTableTryReallocFieldCallback Nothing cb
    mk_MemVTableTryReallocFieldCallback cb' >>= newCClosure


wrap_MemVTableTryReallocFieldCallback ::
    Maybe (Ptr (FunPtr C_MemVTableTryReallocFieldCallback)) ->
    MemVTableTryReallocFieldCallback ->
    Ptr () ->
    Word64 ->
    IO (Ptr ())
wrap_MemVTableTryReallocFieldCallback funptrptr _cb mem nBytes = do
    result <- _cb  mem nBytes
    maybeReleaseFunPtr funptrptr
    return result


-- callback MemVTableTryMallocFieldCallback
--          -> Callable {returnType = Just (TBasicType TPtr), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "n_bytes", argType = TBasicType TUInt64, 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}}
type C_MemVTableTryMallocFieldCallback =
    Word64 ->
    IO (Ptr ())

-- Args : [Arg {argCName = "n_bytes", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TPtr)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_MemVTableTryMallocFieldCallback :: FunPtr C_MemVTableTryMallocFieldCallback -> C_MemVTableTryMallocFieldCallback

dynamic_MemVTableTryMallocFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MemVTableTryMallocFieldCallback
    -> Word64
    -> m (Ptr ())
dynamic_MemVTableTryMallocFieldCallback __funPtr nBytes = liftIO $ do
    result <- (__dynamic_C_MemVTableTryMallocFieldCallback __funPtr) nBytes
    return result

foreign import ccall "wrapper"
    mk_MemVTableTryMallocFieldCallback :: C_MemVTableTryMallocFieldCallback -> IO (FunPtr C_MemVTableTryMallocFieldCallback)

type MemVTableTryMallocFieldCallback =
    Word64 ->
    IO (Ptr ())

noMemVTableTryMallocFieldCallback :: Maybe MemVTableTryMallocFieldCallback
noMemVTableTryMallocFieldCallback = Nothing

genClosure_MemVTableTryMallocFieldCallback :: MemVTableTryMallocFieldCallback -> IO Closure
genClosure_MemVTableTryMallocFieldCallback cb = do
    let cb' = wrap_MemVTableTryMallocFieldCallback Nothing cb
    mk_MemVTableTryMallocFieldCallback cb' >>= newCClosure


wrap_MemVTableTryMallocFieldCallback ::
    Maybe (Ptr (FunPtr C_MemVTableTryMallocFieldCallback)) ->
    MemVTableTryMallocFieldCallback ->
    Word64 ->
    IO (Ptr ())
wrap_MemVTableTryMallocFieldCallback funptrptr _cb nBytes = do
    result <- _cb  nBytes
    maybeReleaseFunPtr funptrptr
    return result


-- callback MemVTableReallocFieldCallback
--          -> Callable {returnType = Just (TBasicType TPtr), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "mem", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_bytes", argType = TBasicType TUInt64, 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}}
type C_MemVTableReallocFieldCallback =
    Ptr () ->
    Word64 ->
    IO (Ptr ())

-- Args : [Arg {argCName = "mem", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_bytes", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TPtr)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_MemVTableReallocFieldCallback :: FunPtr C_MemVTableReallocFieldCallback -> C_MemVTableReallocFieldCallback

dynamic_MemVTableReallocFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MemVTableReallocFieldCallback
    -> Ptr ()
    -> Word64
    -> m (Ptr ())
dynamic_MemVTableReallocFieldCallback __funPtr mem nBytes = liftIO $ do
    result <- (__dynamic_C_MemVTableReallocFieldCallback __funPtr) mem nBytes
    return result

foreign import ccall "wrapper"
    mk_MemVTableReallocFieldCallback :: C_MemVTableReallocFieldCallback -> IO (FunPtr C_MemVTableReallocFieldCallback)

type MemVTableReallocFieldCallback =
    Ptr () ->
    Word64 ->
    IO (Ptr ())

noMemVTableReallocFieldCallback :: Maybe MemVTableReallocFieldCallback
noMemVTableReallocFieldCallback = Nothing

genClosure_MemVTableReallocFieldCallback :: MemVTableReallocFieldCallback -> IO Closure
genClosure_MemVTableReallocFieldCallback cb = do
    let cb' = wrap_MemVTableReallocFieldCallback Nothing cb
    mk_MemVTableReallocFieldCallback cb' >>= newCClosure


wrap_MemVTableReallocFieldCallback ::
    Maybe (Ptr (FunPtr C_MemVTableReallocFieldCallback)) ->
    MemVTableReallocFieldCallback ->
    Ptr () ->
    Word64 ->
    IO (Ptr ())
wrap_MemVTableReallocFieldCallback funptrptr _cb mem nBytes = do
    result <- _cb  mem nBytes
    maybeReleaseFunPtr funptrptr
    return result


-- callback MemVTableMallocFieldCallback
--          -> Callable {returnType = Just (TBasicType TPtr), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "n_bytes", argType = TBasicType TUInt64, 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}}
type C_MemVTableMallocFieldCallback =
    Word64 ->
    IO (Ptr ())

-- Args : [Arg {argCName = "n_bytes", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TPtr)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_MemVTableMallocFieldCallback :: FunPtr C_MemVTableMallocFieldCallback -> C_MemVTableMallocFieldCallback

dynamic_MemVTableMallocFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MemVTableMallocFieldCallback
    -> Word64
    -> m (Ptr ())
dynamic_MemVTableMallocFieldCallback __funPtr nBytes = liftIO $ do
    result <- (__dynamic_C_MemVTableMallocFieldCallback __funPtr) nBytes
    return result

foreign import ccall "wrapper"
    mk_MemVTableMallocFieldCallback :: C_MemVTableMallocFieldCallback -> IO (FunPtr C_MemVTableMallocFieldCallback)

type MemVTableMallocFieldCallback =
    Word64 ->
    IO (Ptr ())

noMemVTableMallocFieldCallback :: Maybe MemVTableMallocFieldCallback
noMemVTableMallocFieldCallback = Nothing

genClosure_MemVTableMallocFieldCallback :: MemVTableMallocFieldCallback -> IO Closure
genClosure_MemVTableMallocFieldCallback cb = do
    let cb' = wrap_MemVTableMallocFieldCallback Nothing cb
    mk_MemVTableMallocFieldCallback cb' >>= newCClosure


wrap_MemVTableMallocFieldCallback ::
    Maybe (Ptr (FunPtr C_MemVTableMallocFieldCallback)) ->
    MemVTableMallocFieldCallback ->
    Word64 ->
    IO (Ptr ())
wrap_MemVTableMallocFieldCallback funptrptr _cb nBytes = do
    result <- _cb  nBytes
    maybeReleaseFunPtr funptrptr
    return result


-- callback MemVTableFreeFieldCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "mem", argType = TBasicType TPtr, 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}}
type C_MemVTableFreeFieldCallback =
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "mem", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_MemVTableFreeFieldCallback :: FunPtr C_MemVTableFreeFieldCallback -> C_MemVTableFreeFieldCallback

dynamic_MemVTableFreeFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MemVTableFreeFieldCallback
    -> Ptr ()
    -> m ()
dynamic_MemVTableFreeFieldCallback __funPtr mem = liftIO $ do
    (__dynamic_C_MemVTableFreeFieldCallback __funPtr) mem
    return ()

foreign import ccall "wrapper"
    mk_MemVTableFreeFieldCallback :: C_MemVTableFreeFieldCallback -> IO (FunPtr C_MemVTableFreeFieldCallback)

type MemVTableFreeFieldCallback =
    Ptr () ->
    IO ()

noMemVTableFreeFieldCallback :: Maybe MemVTableFreeFieldCallback
noMemVTableFreeFieldCallback = Nothing

genClosure_MemVTableFreeFieldCallback :: MemVTableFreeFieldCallback -> IO Closure
genClosure_MemVTableFreeFieldCallback cb = do
    let cb' = wrap_MemVTableFreeFieldCallback Nothing cb
    mk_MemVTableFreeFieldCallback cb' >>= newCClosure


wrap_MemVTableFreeFieldCallback ::
    Maybe (Ptr (FunPtr C_MemVTableFreeFieldCallback)) ->
    MemVTableFreeFieldCallback ->
    Ptr () ->
    IO ()
wrap_MemVTableFreeFieldCallback funptrptr _cb mem = do
    _cb  mem
    maybeReleaseFunPtr funptrptr


-- callback MemVTableCallocFieldCallback
--          -> Callable {returnType = Just (TBasicType TPtr), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "n_blocks", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_block_bytes", argType = TBasicType TUInt64, 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}}
type C_MemVTableCallocFieldCallback =
    Word64 ->
    Word64 ->
    IO (Ptr ())

-- Args : [Arg {argCName = "n_blocks", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_block_bytes", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TPtr)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_MemVTableCallocFieldCallback :: FunPtr C_MemVTableCallocFieldCallback -> C_MemVTableCallocFieldCallback

dynamic_MemVTableCallocFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MemVTableCallocFieldCallback
    -> Word64
    -> Word64
    -> m (Ptr ())
dynamic_MemVTableCallocFieldCallback __funPtr nBlocks nBlockBytes = liftIO $ do
    result <- (__dynamic_C_MemVTableCallocFieldCallback __funPtr) nBlocks nBlockBytes
    return result

foreign import ccall "wrapper"
    mk_MemVTableCallocFieldCallback :: C_MemVTableCallocFieldCallback -> IO (FunPtr C_MemVTableCallocFieldCallback)

type MemVTableCallocFieldCallback =
    Word64 ->
    Word64 ->
    IO (Ptr ())

noMemVTableCallocFieldCallback :: Maybe MemVTableCallocFieldCallback
noMemVTableCallocFieldCallback = Nothing

genClosure_MemVTableCallocFieldCallback :: MemVTableCallocFieldCallback -> IO Closure
genClosure_MemVTableCallocFieldCallback cb = do
    let cb' = wrap_MemVTableCallocFieldCallback Nothing cb
    mk_MemVTableCallocFieldCallback cb' >>= newCClosure


wrap_MemVTableCallocFieldCallback ::
    Maybe (Ptr (FunPtr C_MemVTableCallocFieldCallback)) ->
    MemVTableCallocFieldCallback ->
    Word64 ->
    Word64 ->
    IO (Ptr ())
wrap_MemVTableCallocFieldCallback funptrptr _cb nBlocks nBlockBytes = do
    result <- _cb  nBlocks nBlockBytes
    maybeReleaseFunPtr funptrptr
    return result


-- callback MarkupParserTextFieldCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "context", argType = TInterface (Name {namespace = "GLib", name = "MarkupParseContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "text", 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 = "text_len", argType = TBasicType TUInt64, 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 = True, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}}
type C_MarkupParserTextFieldCallback =
    Ptr GLib.MarkupParseContext.MarkupParseContext ->
    CString ->
    Word64 ->
    Ptr () ->
    Ptr (Ptr GError) ->
    IO ()

-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "GLib", name = "MarkupParseContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "text", 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 = "text_len", argType = TBasicType TUInt64, 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 : Nothing
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_MarkupParserTextFieldCallback :: FunPtr C_MarkupParserTextFieldCallback -> C_MarkupParserTextFieldCallback

dynamic_MarkupParserTextFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MarkupParserTextFieldCallback
    -> GLib.MarkupParseContext.MarkupParseContext
    -> T.Text
    -> Word64
    -> Ptr ()
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dynamic_MarkupParserTextFieldCallback __funPtr context text textLen userData = liftIO $ do
    context' <- unsafeManagedPtrGetPtr context
    text' <- textToCString text
    onException (do
        propagateGError $ (__dynamic_C_MarkupParserTextFieldCallback __funPtr) context' text' textLen userData
        touchManagedPtr context
        freeMem text'
        return ()
     ) (do
        freeMem text'
     )

foreign import ccall "wrapper"
    mk_MarkupParserTextFieldCallback :: C_MarkupParserTextFieldCallback -> IO (FunPtr C_MarkupParserTextFieldCallback)

type MarkupParserTextFieldCallback =
    GLib.MarkupParseContext.MarkupParseContext ->
    T.Text ->
    Word64 ->
    IO ()

noMarkupParserTextFieldCallback :: Maybe MarkupParserTextFieldCallback
noMarkupParserTextFieldCallback = Nothing

type MarkupParserTextFieldCallback_WithClosures =
    GLib.MarkupParseContext.MarkupParseContext ->
    T.Text ->
    Word64 ->
    Ptr () ->
    IO ()

noMarkupParserTextFieldCallback_WithClosures :: Maybe MarkupParserTextFieldCallback_WithClosures
noMarkupParserTextFieldCallback_WithClosures = Nothing

drop_closures_MarkupParserTextFieldCallback :: MarkupParserTextFieldCallback -> MarkupParserTextFieldCallback_WithClosures
drop_closures_MarkupParserTextFieldCallback _f context text textLen _ = _f context text textLen

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

-- callback MarkupParserStartElementFieldCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "context", argType = TInterface (Name {namespace = "GLib", name = "MarkupParseContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "element_name", 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 = "attribute_names", 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 = "attribute_values", 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 = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 4, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = True, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}}
type C_MarkupParserStartElementFieldCallback =
    Ptr GLib.MarkupParseContext.MarkupParseContext ->
    CString ->
    CString ->
    CString ->
    Ptr () ->
    Ptr (Ptr GError) ->
    IO ()

-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "GLib", name = "MarkupParseContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "element_name", 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 = "attribute_names", 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 = "attribute_values", 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 = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 4, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_MarkupParserStartElementFieldCallback :: FunPtr C_MarkupParserStartElementFieldCallback -> C_MarkupParserStartElementFieldCallback

dynamic_MarkupParserStartElementFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MarkupParserStartElementFieldCallback
    -> GLib.MarkupParseContext.MarkupParseContext
    -> T.Text
    -> T.Text
    -> T.Text
    -> Ptr ()
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dynamic_MarkupParserStartElementFieldCallback __funPtr context elementName attributeNames attributeValues userData = liftIO $ do
    context' <- unsafeManagedPtrGetPtr context
    elementName' <- textToCString elementName
    attributeNames' <- textToCString attributeNames
    attributeValues' <- textToCString attributeValues
    onException (do
        propagateGError $ (__dynamic_C_MarkupParserStartElementFieldCallback __funPtr) context' elementName' attributeNames' attributeValues' userData
        touchManagedPtr context
        freeMem elementName'
        freeMem attributeNames'
        freeMem attributeValues'
        return ()
     ) (do
        freeMem elementName'
        freeMem attributeNames'
        freeMem attributeValues'
     )

foreign import ccall "wrapper"
    mk_MarkupParserStartElementFieldCallback :: C_MarkupParserStartElementFieldCallback -> IO (FunPtr C_MarkupParserStartElementFieldCallback)

type MarkupParserStartElementFieldCallback =
    GLib.MarkupParseContext.MarkupParseContext ->
    T.Text ->
    T.Text ->
    T.Text ->
    IO ()

noMarkupParserStartElementFieldCallback :: Maybe MarkupParserStartElementFieldCallback
noMarkupParserStartElementFieldCallback = Nothing

type MarkupParserStartElementFieldCallback_WithClosures =
    GLib.MarkupParseContext.MarkupParseContext ->
    T.Text ->
    T.Text ->
    T.Text ->
    Ptr () ->
    IO ()

noMarkupParserStartElementFieldCallback_WithClosures :: Maybe MarkupParserStartElementFieldCallback_WithClosures
noMarkupParserStartElementFieldCallback_WithClosures = Nothing

drop_closures_MarkupParserStartElementFieldCallback :: MarkupParserStartElementFieldCallback -> MarkupParserStartElementFieldCallback_WithClosures
drop_closures_MarkupParserStartElementFieldCallback _f context elementName attributeNames attributeValues _ = _f context elementName attributeNames attributeValues

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

-- callback MarkupParserPassthroughFieldCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "context", argType = TInterface (Name {namespace = "GLib", name = "MarkupParseContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "passthrough_text", 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 = "text_len", argType = TBasicType TUInt64, 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 = True, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}}
type C_MarkupParserPassthroughFieldCallback =
    Ptr GLib.MarkupParseContext.MarkupParseContext ->
    CString ->
    Word64 ->
    Ptr () ->
    Ptr (Ptr GError) ->
    IO ()

-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "GLib", name = "MarkupParseContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "passthrough_text", 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 = "text_len", argType = TBasicType TUInt64, 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 : Nothing
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_MarkupParserPassthroughFieldCallback :: FunPtr C_MarkupParserPassthroughFieldCallback -> C_MarkupParserPassthroughFieldCallback

dynamic_MarkupParserPassthroughFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MarkupParserPassthroughFieldCallback
    -> GLib.MarkupParseContext.MarkupParseContext
    -> T.Text
    -> Word64
    -> Ptr ()
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dynamic_MarkupParserPassthroughFieldCallback __funPtr context passthroughText textLen userData = liftIO $ do
    context' <- unsafeManagedPtrGetPtr context
    passthroughText' <- textToCString passthroughText
    onException (do
        propagateGError $ (__dynamic_C_MarkupParserPassthroughFieldCallback __funPtr) context' passthroughText' textLen userData
        touchManagedPtr context
        freeMem passthroughText'
        return ()
     ) (do
        freeMem passthroughText'
     )

foreign import ccall "wrapper"
    mk_MarkupParserPassthroughFieldCallback :: C_MarkupParserPassthroughFieldCallback -> IO (FunPtr C_MarkupParserPassthroughFieldCallback)

type MarkupParserPassthroughFieldCallback =
    GLib.MarkupParseContext.MarkupParseContext ->
    T.Text ->
    Word64 ->
    IO ()

noMarkupParserPassthroughFieldCallback :: Maybe MarkupParserPassthroughFieldCallback
noMarkupParserPassthroughFieldCallback = Nothing

type MarkupParserPassthroughFieldCallback_WithClosures =
    GLib.MarkupParseContext.MarkupParseContext ->
    T.Text ->
    Word64 ->
    Ptr () ->
    IO ()

noMarkupParserPassthroughFieldCallback_WithClosures :: Maybe MarkupParserPassthroughFieldCallback_WithClosures
noMarkupParserPassthroughFieldCallback_WithClosures = Nothing

drop_closures_MarkupParserPassthroughFieldCallback :: MarkupParserPassthroughFieldCallback -> MarkupParserPassthroughFieldCallback_WithClosures
drop_closures_MarkupParserPassthroughFieldCallback _f context passthroughText textLen _ = _f context passthroughText textLen

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

-- callback MarkupParserErrorFieldCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "context", argType = TInterface (Name {namespace = "GLib", name = "MarkupParseContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "error", argType = TError, 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 = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}}
type C_MarkupParserErrorFieldCallback =
    Ptr GLib.MarkupParseContext.MarkupParseContext ->
    Ptr GError ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "GLib", name = "MarkupParseContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "error", argType = TError, 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 = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_MarkupParserErrorFieldCallback :: FunPtr C_MarkupParserErrorFieldCallback -> C_MarkupParserErrorFieldCallback

dynamic_MarkupParserErrorFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MarkupParserErrorFieldCallback
    -> GLib.MarkupParseContext.MarkupParseContext
    -> GError
    -> Ptr ()
    -> m ()
dynamic_MarkupParserErrorFieldCallback __funPtr context error_ userData = liftIO $ do
    context' <- unsafeManagedPtrGetPtr context
    error_' <- unsafeManagedPtrGetPtr error_
    (__dynamic_C_MarkupParserErrorFieldCallback __funPtr) context' error_' userData
    touchManagedPtr context
    touchManagedPtr error_
    return ()

foreign import ccall "wrapper"
    mk_MarkupParserErrorFieldCallback :: C_MarkupParserErrorFieldCallback -> IO (FunPtr C_MarkupParserErrorFieldCallback)

type MarkupParserErrorFieldCallback =
    GLib.MarkupParseContext.MarkupParseContext ->
    GError ->
    IO ()

noMarkupParserErrorFieldCallback :: Maybe MarkupParserErrorFieldCallback
noMarkupParserErrorFieldCallback = Nothing

type MarkupParserErrorFieldCallback_WithClosures =
    GLib.MarkupParseContext.MarkupParseContext ->
    GError ->
    Ptr () ->
    IO ()

noMarkupParserErrorFieldCallback_WithClosures :: Maybe MarkupParserErrorFieldCallback_WithClosures
noMarkupParserErrorFieldCallback_WithClosures = Nothing

drop_closures_MarkupParserErrorFieldCallback :: MarkupParserErrorFieldCallback -> MarkupParserErrorFieldCallback_WithClosures
drop_closures_MarkupParserErrorFieldCallback _f context error_ _ = _f context error_

genClosure_MarkupParserErrorFieldCallback :: MarkupParserErrorFieldCallback -> IO Closure
genClosure_MarkupParserErrorFieldCallback cb = do
    let cb' = drop_closures_MarkupParserErrorFieldCallback cb
    let cb'' = wrap_MarkupParserErrorFieldCallback Nothing cb'
    mk_MarkupParserErrorFieldCallback cb'' >>= newCClosure


wrap_MarkupParserErrorFieldCallback ::
    Maybe (Ptr (FunPtr C_MarkupParserErrorFieldCallback)) ->
    MarkupParserErrorFieldCallback_WithClosures ->
    Ptr GLib.MarkupParseContext.MarkupParseContext ->
    Ptr GError ->
    Ptr () ->
    IO ()
wrap_MarkupParserErrorFieldCallback funptrptr _cb context error_ userData = do
    B.ManagedPtr.withTransient GLib.MarkupParseContext.MarkupParseContext context $ \context' -> do
        error_' <- (newBoxed GError) error_
        _cb  context' error_' userData
        maybeReleaseFunPtr funptrptr


-- callback MarkupParserEndElementFieldCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "context", argType = TInterface (Name {namespace = "GLib", name = "MarkupParseContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "element_name", 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 = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = True, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}}
type C_MarkupParserEndElementFieldCallback =
    Ptr GLib.MarkupParseContext.MarkupParseContext ->
    CString ->
    Ptr () ->
    Ptr (Ptr GError) ->
    IO ()

-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "GLib", name = "MarkupParseContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "element_name", 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 = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_MarkupParserEndElementFieldCallback :: FunPtr C_MarkupParserEndElementFieldCallback -> C_MarkupParserEndElementFieldCallback

dynamic_MarkupParserEndElementFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MarkupParserEndElementFieldCallback
    -> GLib.MarkupParseContext.MarkupParseContext
    -> T.Text
    -> Ptr ()
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dynamic_MarkupParserEndElementFieldCallback __funPtr context elementName userData = liftIO $ do
    context' <- unsafeManagedPtrGetPtr context
    elementName' <- textToCString elementName
    onException (do
        propagateGError $ (__dynamic_C_MarkupParserEndElementFieldCallback __funPtr) context' elementName' userData
        touchManagedPtr context
        freeMem elementName'
        return ()
     ) (do
        freeMem elementName'
     )

foreign import ccall "wrapper"
    mk_MarkupParserEndElementFieldCallback :: C_MarkupParserEndElementFieldCallback -> IO (FunPtr C_MarkupParserEndElementFieldCallback)

type MarkupParserEndElementFieldCallback =
    GLib.MarkupParseContext.MarkupParseContext ->
    T.Text ->
    IO ()

noMarkupParserEndElementFieldCallback :: Maybe MarkupParserEndElementFieldCallback
noMarkupParserEndElementFieldCallback = Nothing

type MarkupParserEndElementFieldCallback_WithClosures =
    GLib.MarkupParseContext.MarkupParseContext ->
    T.Text ->
    Ptr () ->
    IO ()

noMarkupParserEndElementFieldCallback_WithClosures :: Maybe MarkupParserEndElementFieldCallback_WithClosures
noMarkupParserEndElementFieldCallback_WithClosures = Nothing

drop_closures_MarkupParserEndElementFieldCallback :: MarkupParserEndElementFieldCallback -> MarkupParserEndElementFieldCallback_WithClosures
drop_closures_MarkupParserEndElementFieldCallback _f context elementName _ = _f context elementName

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

-- callback LogWriterFunc
--          -> Callable {returnType = Just (TInterface (Name {namespace = "GLib", name = "LogWriterOutput"})), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%G_LOG_WRITER_HANDLED if the log entry was handled successfully;\n   %G_LOG_WRITER_UNHANDLED otherwise", sinceVersion = Nothing}, args = [Arg {argCName = "log_level", argType = TInterface (Name {namespace = "GLib", name = "LogLevelFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "log level of the message", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "fields", argType = TCArray False (-1) 2 (TInterface (Name {namespace = "GLib", name = "LogField"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "fields forming the message", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_fields", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "number of @fields", 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 passed to g_log_set_writer_func()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Writer function for log entries. A log entry is a collection of one or more\n#GLogFields, using the standard [field names from journal\nspecification](https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html).\nSee g_log_structured() for more information.\n\nWriter functions must ignore fields which they do not recognise, unless they\ncan write arbitrary binary output, as field values may be arbitrary binary.\n\n@log_level is guaranteed to be included in @fields as the `PRIORITY` field,\nbut is provided separately for convenience of deciding whether or where to\noutput the log entry.", sinceVersion = Just "2.50"}}
type C_LogWriterFunc =
    CUInt ->
    Ptr GLib.LogField.LogField ->
    Word64 ->
    Ptr () ->
    IO CUInt

-- Args : [Arg {argCName = "log_level", argType = TInterface (Name {namespace = "GLib", name = "LogLevelFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "log level of the message", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "fields", argType = TCArray False (-1) 2 (TInterface (Name {namespace = "GLib", name = "LogField"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "fields forming the message", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_fields", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "number of @fields", 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 passed to g_log_set_writer_func()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : [Arg {argCName = "n_fields", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "number of @fields", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- returnType : Just (TInterface (Name {namespace = "GLib", name = "LogWriterOutput"}))
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_LogWriterFunc :: FunPtr C_LogWriterFunc -> C_LogWriterFunc

dynamic_LogWriterFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_LogWriterFunc
    -> [GLib.Flags.LogLevelFlags]
    {- ^ /@logLevel@/: log level of the message -}
    -> [GLib.LogField.LogField]
    {- ^ /@fields@/: fields forming the message -}
    -> Ptr ()
    {- ^ /@userData@/: user data passed to 'GI.GLib.Functions.logSetWriterFunc' -}
    -> m GLib.Enums.LogWriterOutput
    {- ^ __Returns:__ 'GI.GLib.Enums.LogWriterOutputHandled' if the log entry was handled successfully;
   'GI.GLib.Enums.LogWriterOutputUnhandled' otherwise -}
dynamic_LogWriterFunc __funPtr logLevel fields userData = liftIO $ do
    let nFields = fromIntegral $ length fields
    let logLevel' = gflagsToWord logLevel
    fields' <- mapM unsafeManagedPtrGetPtr fields
    fields'' <- packBlockArray 24 fields'
    result <- (__dynamic_C_LogWriterFunc __funPtr) logLevel' fields'' nFields userData
    let result' = (toEnum . fromIntegral) result
    mapM_ touchManagedPtr fields
    freeMem fields''
    return result'

foreign import ccall "wrapper"
    mk_LogWriterFunc :: C_LogWriterFunc -> IO (FunPtr C_LogWriterFunc)

type LogWriterFunc =
    [GLib.Flags.LogLevelFlags] ->
    [GLib.LogField.LogField] ->
    IO GLib.Enums.LogWriterOutput

noLogWriterFunc :: Maybe LogWriterFunc
noLogWriterFunc = Nothing

type LogWriterFunc_WithClosures =
    [GLib.Flags.LogLevelFlags] ->
    [GLib.LogField.LogField] ->
    Ptr () ->
    IO GLib.Enums.LogWriterOutput

noLogWriterFunc_WithClosures :: Maybe LogWriterFunc_WithClosures
noLogWriterFunc_WithClosures = Nothing

drop_closures_LogWriterFunc :: LogWriterFunc -> LogWriterFunc_WithClosures
drop_closures_LogWriterFunc _f logLevel fields _ = _f logLevel fields

genClosure_LogWriterFunc :: LogWriterFunc -> IO Closure
genClosure_LogWriterFunc cb = do
    let cb' = drop_closures_LogWriterFunc cb
    let cb'' = wrap_LogWriterFunc Nothing cb'
    mk_LogWriterFunc cb'' >>= newCClosure


wrap_LogWriterFunc ::
    Maybe (Ptr (FunPtr C_LogWriterFunc)) ->
    LogWriterFunc_WithClosures ->
    CUInt ->
    Ptr GLib.LogField.LogField ->
    Word64 ->
    Ptr () ->
    IO CUInt
wrap_LogWriterFunc funptrptr _cb logLevel fields nFields userData = do
    let logLevel' = wordToGFlags logLevel
    fields' <- (unpackBlockArrayWithLength 24 nFields) fields
    fields'' <- mapM (newPtr GLib.LogField.LogField) fields'
    result <- _cb  logLevel' fields'' userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback LogFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "log_domain", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the log domain of the message", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "log_level", argType = TInterface (Name {namespace = "GLib", name = "LogLevelFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the log level of the message (including the\n    fatal and recursion flags)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "message", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the message to process", 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, set in g_log_set_handler()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the prototype of log handler functions.\n\nThe default log handler, g_log_default_handler(), automatically appends a\nnew-line character to @message when printing it. It is advised that any\ncustom log handler functions behave similarly, so that logging calls in user\ncode do not need modifying to add a new-line character to the message if the\nlog handler is changed.\n\nThis is not used if structured logging is enabled; see\n[Using Structured Logging][using-structured-logging].", sinceVersion = Nothing}}
type C_LogFunc =
    CString ->
    CUInt ->
    CString ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "log_domain", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the log domain of the message", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "log_level", argType = TInterface (Name {namespace = "GLib", name = "LogLevelFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the log level of the message (including the\n    fatal and recursion flags)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "message", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the message to process", 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, set in g_log_set_handler()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_LogFunc :: FunPtr C_LogFunc -> C_LogFunc

dynamic_LogFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_LogFunc
    -> T.Text
    {- ^ /@logDomain@/: the log domain of the message -}
    -> [GLib.Flags.LogLevelFlags]
    {- ^ /@logLevel@/: the log level of the message (including the
    fatal and recursion flags) -}
    -> T.Text
    {- ^ /@message@/: the message to process -}
    -> Ptr ()
    {- ^ /@userData@/: user data, set in @/g_log_set_handler()/@ -}
    -> m ()
dynamic_LogFunc __funPtr logDomain logLevel message userData = liftIO $ do
    logDomain' <- textToCString logDomain
    let logLevel' = gflagsToWord logLevel
    message' <- textToCString message
    (__dynamic_C_LogFunc __funPtr) logDomain' logLevel' message' userData
    freeMem logDomain'
    freeMem message'
    return ()

foreign import ccall "wrapper"
    mk_LogFunc :: C_LogFunc -> IO (FunPtr C_LogFunc)

type LogFunc =
    T.Text ->
    [GLib.Flags.LogLevelFlags] ->
    T.Text ->
    IO ()

noLogFunc :: Maybe LogFunc
noLogFunc = Nothing

type LogFunc_WithClosures =
    T.Text ->
    [GLib.Flags.LogLevelFlags] ->
    T.Text ->
    Ptr () ->
    IO ()

noLogFunc_WithClosures :: Maybe LogFunc_WithClosures
noLogFunc_WithClosures = Nothing

drop_closures_LogFunc :: LogFunc -> LogFunc_WithClosures
drop_closures_LogFunc _f logDomain logLevel message _ = _f logDomain logLevel message

genClosure_LogFunc :: LogFunc -> IO Closure
genClosure_LogFunc cb = do
    let cb' = drop_closures_LogFunc cb
    let cb'' = wrap_LogFunc Nothing cb'
    mk_LogFunc cb'' >>= newCClosure


wrap_LogFunc ::
    Maybe (Ptr (FunPtr C_LogFunc)) ->
    LogFunc_WithClosures ->
    CString ->
    CUInt ->
    CString ->
    Ptr () ->
    IO ()
wrap_LogFunc funptrptr _cb logDomain logLevel message userData = do
    logDomain' <- cstringToText logDomain
    let logLevel' = wordToGFlags logLevel
    message' <- cstringToText message
    _cb  logDomain' logLevel' message' userData
    maybeReleaseFunPtr funptrptr


-- callback IOFuncsIoWriteFieldCallback
--          -> Callable {returnType = Just (TInterface (Name {namespace = "GLib", name = "IOStatus"})), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "channel", argType = TInterface (Name {namespace = "GLib", name = "IOChannel"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "buf", 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 = "count", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "bytes_written", argType = TBasicType TUInt64, 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}}
type C_IOFuncsIoWriteFieldCallback =
    Ptr GLib.IOChannel.IOChannel ->
    CString ->
    Word64 ->
    Word64 ->
    Ptr (Ptr GError) ->
    IO CUInt

-- Args : [Arg {argCName = "channel", argType = TInterface (Name {namespace = "GLib", name = "IOChannel"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "buf", 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 = "count", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "bytes_written", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GLib", name = "IOStatus"}))
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_IOFuncsIoWriteFieldCallback :: FunPtr C_IOFuncsIoWriteFieldCallback -> C_IOFuncsIoWriteFieldCallback

dynamic_IOFuncsIoWriteFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IOFuncsIoWriteFieldCallback
    -> GLib.IOChannel.IOChannel
    -> T.Text
    -> Word64
    -> Word64
    -> m GLib.Enums.IOStatus
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dynamic_IOFuncsIoWriteFieldCallback __funPtr channel buf count bytesWritten = liftIO $ do
    channel' <- unsafeManagedPtrGetPtr channel
    buf' <- textToCString buf
    onException (do
        result <- propagateGError $ (__dynamic_C_IOFuncsIoWriteFieldCallback __funPtr) channel' buf' count bytesWritten
        let result' = (toEnum . fromIntegral) result
        touchManagedPtr channel
        freeMem buf'
        return result'
     ) (do
        freeMem buf'
     )

foreign import ccall "wrapper"
    mk_IOFuncsIoWriteFieldCallback :: C_IOFuncsIoWriteFieldCallback -> IO (FunPtr C_IOFuncsIoWriteFieldCallback)

type IOFuncsIoWriteFieldCallback =
    GLib.IOChannel.IOChannel ->
    T.Text ->
    Word64 ->
    Word64 ->
    IO GLib.Enums.IOStatus

noIOFuncsIoWriteFieldCallback :: Maybe IOFuncsIoWriteFieldCallback
noIOFuncsIoWriteFieldCallback = Nothing

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

-- callback IOFuncsIoSetFlagsFieldCallback
--          -> Callable {returnType = Just (TInterface (Name {namespace = "GLib", name = "IOStatus"})), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "channel", argType = TInterface (Name {namespace = "GLib", name = "IOChannel"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "GLib", name = "IOFlags"}), 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}}
type C_IOFuncsIoSetFlagsFieldCallback =
    Ptr GLib.IOChannel.IOChannel ->
    CUInt ->
    Ptr (Ptr GError) ->
    IO CUInt

-- Args : [Arg {argCName = "channel", argType = TInterface (Name {namespace = "GLib", name = "IOChannel"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "GLib", name = "IOFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GLib", name = "IOStatus"}))
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_IOFuncsIoSetFlagsFieldCallback :: FunPtr C_IOFuncsIoSetFlagsFieldCallback -> C_IOFuncsIoSetFlagsFieldCallback

dynamic_IOFuncsIoSetFlagsFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IOFuncsIoSetFlagsFieldCallback
    -> GLib.IOChannel.IOChannel
    -> [GLib.Flags.IOFlags]
    -> m GLib.Enums.IOStatus
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dynamic_IOFuncsIoSetFlagsFieldCallback __funPtr channel flags = liftIO $ do
    channel' <- unsafeManagedPtrGetPtr channel
    let flags' = gflagsToWord flags
    onException (do
        result <- propagateGError $ (__dynamic_C_IOFuncsIoSetFlagsFieldCallback __funPtr) channel' flags'
        let result' = (toEnum . fromIntegral) result
        touchManagedPtr channel
        return result'
     ) (do
        return ()
     )

foreign import ccall "wrapper"
    mk_IOFuncsIoSetFlagsFieldCallback :: C_IOFuncsIoSetFlagsFieldCallback -> IO (FunPtr C_IOFuncsIoSetFlagsFieldCallback)

type IOFuncsIoSetFlagsFieldCallback =
    GLib.IOChannel.IOChannel ->
    [GLib.Flags.IOFlags] ->
    IO GLib.Enums.IOStatus

noIOFuncsIoSetFlagsFieldCallback :: Maybe IOFuncsIoSetFlagsFieldCallback
noIOFuncsIoSetFlagsFieldCallback = Nothing

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

-- callback IOFuncsIoSeekFieldCallback
--          -> Callable {returnType = Just (TInterface (Name {namespace = "GLib", name = "IOStatus"})), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "channel", argType = TInterface (Name {namespace = "GLib", name = "IOChannel"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "offset", argType = TBasicType TInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "type", argType = TInterface (Name {namespace = "GLib", name = "SeekType"}), 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}}
type C_IOFuncsIoSeekFieldCallback =
    Ptr GLib.IOChannel.IOChannel ->
    Int64 ->
    CUInt ->
    Ptr (Ptr GError) ->
    IO CUInt

-- Args : [Arg {argCName = "channel", argType = TInterface (Name {namespace = "GLib", name = "IOChannel"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "offset", argType = TBasicType TInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "type", argType = TInterface (Name {namespace = "GLib", name = "SeekType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GLib", name = "IOStatus"}))
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_IOFuncsIoSeekFieldCallback :: FunPtr C_IOFuncsIoSeekFieldCallback -> C_IOFuncsIoSeekFieldCallback

dynamic_IOFuncsIoSeekFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IOFuncsIoSeekFieldCallback
    -> GLib.IOChannel.IOChannel
    -> Int64
    -> GLib.Enums.SeekType
    -> m GLib.Enums.IOStatus
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dynamic_IOFuncsIoSeekFieldCallback __funPtr channel offset type_ = liftIO $ do
    channel' <- unsafeManagedPtrGetPtr channel
    let type_' = (fromIntegral . fromEnum) type_
    onException (do
        result <- propagateGError $ (__dynamic_C_IOFuncsIoSeekFieldCallback __funPtr) channel' offset type_'
        let result' = (toEnum . fromIntegral) result
        touchManagedPtr channel
        return result'
     ) (do
        return ()
     )

foreign import ccall "wrapper"
    mk_IOFuncsIoSeekFieldCallback :: C_IOFuncsIoSeekFieldCallback -> IO (FunPtr C_IOFuncsIoSeekFieldCallback)

type IOFuncsIoSeekFieldCallback =
    GLib.IOChannel.IOChannel ->
    Int64 ->
    GLib.Enums.SeekType ->
    IO GLib.Enums.IOStatus

noIOFuncsIoSeekFieldCallback :: Maybe IOFuncsIoSeekFieldCallback
noIOFuncsIoSeekFieldCallback = Nothing

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

-- callback IOFuncsIoReadFieldCallback
--          -> Callable {returnType = Just (TInterface (Name {namespace = "GLib", name = "IOStatus"})), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "channel", argType = TInterface (Name {namespace = "GLib", name = "IOChannel"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "buf", 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 = "count", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "bytes_read", argType = TBasicType TUInt64, 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}}
type C_IOFuncsIoReadFieldCallback =
    Ptr GLib.IOChannel.IOChannel ->
    CString ->
    Word64 ->
    Word64 ->
    Ptr (Ptr GError) ->
    IO CUInt

-- Args : [Arg {argCName = "channel", argType = TInterface (Name {namespace = "GLib", name = "IOChannel"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "buf", 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 = "count", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "bytes_read", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GLib", name = "IOStatus"}))
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_IOFuncsIoReadFieldCallback :: FunPtr C_IOFuncsIoReadFieldCallback -> C_IOFuncsIoReadFieldCallback

dynamic_IOFuncsIoReadFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IOFuncsIoReadFieldCallback
    -> GLib.IOChannel.IOChannel
    -> T.Text
    -> Word64
    -> Word64
    -> m GLib.Enums.IOStatus
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dynamic_IOFuncsIoReadFieldCallback __funPtr channel buf count bytesRead = liftIO $ do
    channel' <- unsafeManagedPtrGetPtr channel
    buf' <- textToCString buf
    onException (do
        result <- propagateGError $ (__dynamic_C_IOFuncsIoReadFieldCallback __funPtr) channel' buf' count bytesRead
        let result' = (toEnum . fromIntegral) result
        touchManagedPtr channel
        freeMem buf'
        return result'
     ) (do
        freeMem buf'
     )

foreign import ccall "wrapper"
    mk_IOFuncsIoReadFieldCallback :: C_IOFuncsIoReadFieldCallback -> IO (FunPtr C_IOFuncsIoReadFieldCallback)

type IOFuncsIoReadFieldCallback =
    GLib.IOChannel.IOChannel ->
    T.Text ->
    Word64 ->
    Word64 ->
    IO GLib.Enums.IOStatus

noIOFuncsIoReadFieldCallback :: Maybe IOFuncsIoReadFieldCallback
noIOFuncsIoReadFieldCallback = Nothing

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

-- callback IOFuncsIoGetFlagsFieldCallback
--          -> Callable {returnType = Just (TInterface (Name {namespace = "GLib", name = "IOFlags"})), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "channel", argType = TInterface (Name {namespace = "GLib", name = "IOChannel"}), 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}}
type C_IOFuncsIoGetFlagsFieldCallback =
    Ptr GLib.IOChannel.IOChannel ->
    IO CUInt

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

foreign import ccall "dynamic" __dynamic_C_IOFuncsIoGetFlagsFieldCallback :: FunPtr C_IOFuncsIoGetFlagsFieldCallback -> C_IOFuncsIoGetFlagsFieldCallback

dynamic_IOFuncsIoGetFlagsFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IOFuncsIoGetFlagsFieldCallback
    -> GLib.IOChannel.IOChannel
    -> m [GLib.Flags.IOFlags]
dynamic_IOFuncsIoGetFlagsFieldCallback __funPtr channel = liftIO $ do
    channel' <- unsafeManagedPtrGetPtr channel
    result <- (__dynamic_C_IOFuncsIoGetFlagsFieldCallback __funPtr) channel'
    let result' = wordToGFlags result
    touchManagedPtr channel
    return result'

foreign import ccall "wrapper"
    mk_IOFuncsIoGetFlagsFieldCallback :: C_IOFuncsIoGetFlagsFieldCallback -> IO (FunPtr C_IOFuncsIoGetFlagsFieldCallback)

type IOFuncsIoGetFlagsFieldCallback =
    GLib.IOChannel.IOChannel ->
    IO [GLib.Flags.IOFlags]

noIOFuncsIoGetFlagsFieldCallback :: Maybe IOFuncsIoGetFlagsFieldCallback
noIOFuncsIoGetFlagsFieldCallback = Nothing

genClosure_IOFuncsIoGetFlagsFieldCallback :: IOFuncsIoGetFlagsFieldCallback -> IO Closure
genClosure_IOFuncsIoGetFlagsFieldCallback cb = do
    let cb' = wrap_IOFuncsIoGetFlagsFieldCallback Nothing cb
    mk_IOFuncsIoGetFlagsFieldCallback cb' >>= newCClosure


wrap_IOFuncsIoGetFlagsFieldCallback ::
    Maybe (Ptr (FunPtr C_IOFuncsIoGetFlagsFieldCallback)) ->
    IOFuncsIoGetFlagsFieldCallback ->
    Ptr GLib.IOChannel.IOChannel ->
    IO CUInt
wrap_IOFuncsIoGetFlagsFieldCallback funptrptr _cb channel = do
    B.ManagedPtr.withTransient GLib.IOChannel.IOChannel channel $ \channel' -> do
        result <- _cb  channel'
        maybeReleaseFunPtr funptrptr
        let result' = gflagsToWord result
        return result'


-- callback IOFuncsIoFreeFieldCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "channel", argType = TInterface (Name {namespace = "GLib", name = "IOChannel"}), 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}}
type C_IOFuncsIoFreeFieldCallback =
    Ptr GLib.IOChannel.IOChannel ->
    IO ()

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

foreign import ccall "dynamic" __dynamic_C_IOFuncsIoFreeFieldCallback :: FunPtr C_IOFuncsIoFreeFieldCallback -> C_IOFuncsIoFreeFieldCallback

dynamic_IOFuncsIoFreeFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IOFuncsIoFreeFieldCallback
    -> GLib.IOChannel.IOChannel
    -> m ()
dynamic_IOFuncsIoFreeFieldCallback __funPtr channel = liftIO $ do
    channel' <- unsafeManagedPtrGetPtr channel
    (__dynamic_C_IOFuncsIoFreeFieldCallback __funPtr) channel'
    touchManagedPtr channel
    return ()

foreign import ccall "wrapper"
    mk_IOFuncsIoFreeFieldCallback :: C_IOFuncsIoFreeFieldCallback -> IO (FunPtr C_IOFuncsIoFreeFieldCallback)

type IOFuncsIoFreeFieldCallback =
    GLib.IOChannel.IOChannel ->
    IO ()

noIOFuncsIoFreeFieldCallback :: Maybe IOFuncsIoFreeFieldCallback
noIOFuncsIoFreeFieldCallback = Nothing

genClosure_IOFuncsIoFreeFieldCallback :: IOFuncsIoFreeFieldCallback -> IO Closure
genClosure_IOFuncsIoFreeFieldCallback cb = do
    let cb' = wrap_IOFuncsIoFreeFieldCallback Nothing cb
    mk_IOFuncsIoFreeFieldCallback cb' >>= newCClosure


wrap_IOFuncsIoFreeFieldCallback ::
    Maybe (Ptr (FunPtr C_IOFuncsIoFreeFieldCallback)) ->
    IOFuncsIoFreeFieldCallback ->
    Ptr GLib.IOChannel.IOChannel ->
    IO ()
wrap_IOFuncsIoFreeFieldCallback funptrptr _cb channel = do
    B.ManagedPtr.withTransient GLib.IOChannel.IOChannel channel $ \channel' -> do
        _cb  channel'
        maybeReleaseFunPtr funptrptr


-- callback IOFuncsIoCreateWatchFieldCallback
--          -> Callable {returnType = Just (TInterface (Name {namespace = "GLib", name = "Source"})), returnMayBeNull = False, returnTransfer = TransferEverything, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "channel", argType = TInterface (Name {namespace = "GLib", name = "IOChannel"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "condition", argType = TInterface (Name {namespace = "GLib", name = "IOCondition"}), 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}}
type C_IOFuncsIoCreateWatchFieldCallback =
    Ptr GLib.IOChannel.IOChannel ->
    CUInt ->
    IO (Ptr GLib.Source.Source)

-- Args : [Arg {argCName = "channel", argType = TInterface (Name {namespace = "GLib", name = "IOChannel"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "condition", argType = TInterface (Name {namespace = "GLib", name = "IOCondition"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GLib", name = "Source"}))
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_IOFuncsIoCreateWatchFieldCallback :: FunPtr C_IOFuncsIoCreateWatchFieldCallback -> C_IOFuncsIoCreateWatchFieldCallback

dynamic_IOFuncsIoCreateWatchFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IOFuncsIoCreateWatchFieldCallback
    -> GLib.IOChannel.IOChannel
    -> [GLib.Flags.IOCondition]
    -> m GLib.Source.Source
dynamic_IOFuncsIoCreateWatchFieldCallback __funPtr channel condition = liftIO $ do
    channel' <- unsafeManagedPtrGetPtr channel
    let condition' = gflagsToWord condition
    result <- (__dynamic_C_IOFuncsIoCreateWatchFieldCallback __funPtr) channel' condition'
    checkUnexpectedReturnNULL "iOFuncsIoCreateWatchFieldCallback" result
    result' <- (wrapBoxed GLib.Source.Source) result
    touchManagedPtr channel
    return result'

foreign import ccall "wrapper"
    mk_IOFuncsIoCreateWatchFieldCallback :: C_IOFuncsIoCreateWatchFieldCallback -> IO (FunPtr C_IOFuncsIoCreateWatchFieldCallback)

type IOFuncsIoCreateWatchFieldCallback =
    GLib.IOChannel.IOChannel ->
    [GLib.Flags.IOCondition] ->
    IO GLib.Source.Source

noIOFuncsIoCreateWatchFieldCallback :: Maybe IOFuncsIoCreateWatchFieldCallback
noIOFuncsIoCreateWatchFieldCallback = Nothing

genClosure_IOFuncsIoCreateWatchFieldCallback :: IOFuncsIoCreateWatchFieldCallback -> IO Closure
genClosure_IOFuncsIoCreateWatchFieldCallback cb = do
    let cb' = wrap_IOFuncsIoCreateWatchFieldCallback Nothing cb
    mk_IOFuncsIoCreateWatchFieldCallback cb' >>= newCClosure


wrap_IOFuncsIoCreateWatchFieldCallback ::
    Maybe (Ptr (FunPtr C_IOFuncsIoCreateWatchFieldCallback)) ->
    IOFuncsIoCreateWatchFieldCallback ->
    Ptr GLib.IOChannel.IOChannel ->
    CUInt ->
    IO (Ptr GLib.Source.Source)
wrap_IOFuncsIoCreateWatchFieldCallback funptrptr _cb channel condition = do
    B.ManagedPtr.withTransient GLib.IOChannel.IOChannel channel $ \channel' -> do
        let condition' = wordToGFlags condition
        result <- _cb  channel' condition'
        maybeReleaseFunPtr funptrptr
        result' <- B.ManagedPtr.disownBoxed result
        return result'


-- callback IOFuncsIoCloseFieldCallback
--          -> Callable {returnType = Just (TInterface (Name {namespace = "GLib", name = "IOStatus"})), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "channel", argType = TInterface (Name {namespace = "GLib", name = "IOChannel"}), 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}}
type C_IOFuncsIoCloseFieldCallback =
    Ptr GLib.IOChannel.IOChannel ->
    Ptr (Ptr GError) ->
    IO CUInt

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

foreign import ccall "dynamic" __dynamic_C_IOFuncsIoCloseFieldCallback :: FunPtr C_IOFuncsIoCloseFieldCallback -> C_IOFuncsIoCloseFieldCallback

dynamic_IOFuncsIoCloseFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IOFuncsIoCloseFieldCallback
    -> GLib.IOChannel.IOChannel
    -> m GLib.Enums.IOStatus
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dynamic_IOFuncsIoCloseFieldCallback __funPtr channel = liftIO $ do
    channel' <- unsafeManagedPtrGetPtr channel
    onException (do
        result <- propagateGError $ (__dynamic_C_IOFuncsIoCloseFieldCallback __funPtr) channel'
        let result' = (toEnum . fromIntegral) result
        touchManagedPtr channel
        return result'
     ) (do
        return ()
     )

foreign import ccall "wrapper"
    mk_IOFuncsIoCloseFieldCallback :: C_IOFuncsIoCloseFieldCallback -> IO (FunPtr C_IOFuncsIoCloseFieldCallback)

type IOFuncsIoCloseFieldCallback =
    GLib.IOChannel.IOChannel ->
    IO GLib.Enums.IOStatus

noIOFuncsIoCloseFieldCallback :: Maybe IOFuncsIoCloseFieldCallback
noIOFuncsIoCloseFieldCallback = Nothing

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

-- callback IOFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "the function should return %FALSE if the event source\n         should be removed", sinceVersion = Nothing}, args = [Arg {argCName = "source", argType = TInterface (Name {namespace = "GLib", name = "IOChannel"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GIOChannel event source", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "condition", argType = TInterface (Name {namespace = "GLib", name = "IOCondition"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the condition which has been satisfied", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data set in g_io_add_watch() or g_io_add_watch_full()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of function passed to g_io_add_watch() or\ng_io_add_watch_full(), which is called when the requested condition\non a #GIOChannel is satisfied.", sinceVersion = Nothing}}
type C_IOFunc =
    Ptr GLib.IOChannel.IOChannel ->
    CUInt ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "source", argType = TInterface (Name {namespace = "GLib", name = "IOChannel"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GIOChannel event source", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "condition", argType = TInterface (Name {namespace = "GLib", name = "IOCondition"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the condition which has been satisfied", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data set in g_io_add_watch() or g_io_add_watch_full()", 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_IOFunc :: FunPtr C_IOFunc -> C_IOFunc

dynamic_IOFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IOFunc
    -> GLib.IOChannel.IOChannel
    {- ^ /@source@/: the 'GI.GLib.Structs.IOChannel.IOChannel' event source -}
    -> [GLib.Flags.IOCondition]
    {- ^ /@condition@/: the condition which has been satisfied -}
    -> Ptr ()
    {- ^ /@data@/: user data set in @/g_io_add_watch()/@ or 'GI.GLib.Functions.ioAddWatch' -}
    -> m Bool
    {- ^ __Returns:__ the function should return 'False' if the event source
         should be removed -}
dynamic_IOFunc __funPtr source condition data_ = liftIO $ do
    source' <- unsafeManagedPtrGetPtr source
    let condition' = gflagsToWord condition
    result <- (__dynamic_C_IOFunc __funPtr) source' condition' data_
    let result' = (/= 0) result
    touchManagedPtr source
    return result'

foreign import ccall "wrapper"
    mk_IOFunc :: C_IOFunc -> IO (FunPtr C_IOFunc)

type IOFunc =
    GLib.IOChannel.IOChannel ->
    [GLib.Flags.IOCondition] ->
    Ptr () ->
    IO Bool

noIOFunc :: Maybe IOFunc
noIOFunc = Nothing

genClosure_IOFunc :: IOFunc -> IO Closure
genClosure_IOFunc cb = do
    let cb' = wrap_IOFunc Nothing cb
    mk_IOFunc cb' >>= newCClosure


wrap_IOFunc ::
    Maybe (Ptr (FunPtr C_IOFunc)) ->
    IOFunc ->
    Ptr GLib.IOChannel.IOChannel ->
    CUInt ->
    Ptr () ->
    IO CInt
wrap_IOFunc funptrptr _cb source condition data_ = do
    B.ManagedPtr.withTransient GLib.IOChannel.IOChannel source $ \source' -> do
        let condition' = wordToGFlags condition
        result <- _cb  source' condition' data_
        maybeReleaseFunPtr funptrptr
        let result' = (fromIntegral . fromEnum) result
        return result'


-- callback HookMarshaller
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "hook", argType = TInterface (Name {namespace = "GLib", name = "Hook"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GHook", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "marshal_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Defines the type of function used by g_hook_list_marshal().", sinceVersion = Nothing}}
type C_HookMarshaller =
    Ptr GLib.Hook.Hook ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "hook", argType = TInterface (Name {namespace = "GLib", name = "Hook"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GHook", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "marshal_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_HookMarshaller :: FunPtr C_HookMarshaller -> C_HookMarshaller

dynamic_HookMarshaller ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_HookMarshaller
    -> GLib.Hook.Hook
    {- ^ /@hook@/: a 'GI.GLib.Structs.Hook.Hook' -}
    -> Ptr ()
    {- ^ /@marshalData@/: user data -}
    -> m ()
dynamic_HookMarshaller __funPtr hook marshalData = liftIO $ do
    hook' <- unsafeManagedPtrGetPtr hook
    (__dynamic_C_HookMarshaller __funPtr) hook' marshalData
    touchManagedPtr hook
    return ()

foreign import ccall "wrapper"
    mk_HookMarshaller :: C_HookMarshaller -> IO (FunPtr C_HookMarshaller)

type HookMarshaller =
    GLib.Hook.Hook ->
    Ptr () ->
    IO ()

noHookMarshaller :: Maybe HookMarshaller
noHookMarshaller = Nothing

genClosure_HookMarshaller :: HookMarshaller -> IO Closure
genClosure_HookMarshaller cb = do
    let cb' = wrap_HookMarshaller Nothing cb
    mk_HookMarshaller cb' >>= newCClosure


wrap_HookMarshaller ::
    Maybe (Ptr (FunPtr C_HookMarshaller)) ->
    HookMarshaller ->
    Ptr GLib.Hook.Hook ->
    Ptr () ->
    IO ()
wrap_HookMarshaller funptrptr _cb hook marshalData = do
    hook' <- (newPtr GLib.Hook.Hook) hook
    _cb  hook' marshalData
    maybeReleaseFunPtr funptrptr


-- callback HookFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the data field of the #GHook is passed to the hook function here", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Defines the type of a hook function that can be invoked\nby g_hook_list_invoke().", sinceVersion = Nothing}}
type C_HookFunc =
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the data field of the #GHook is passed to the hook function here", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_HookFunc :: FunPtr C_HookFunc -> C_HookFunc

dynamic_HookFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_HookFunc
    -> Ptr ()
    {- ^ /@data@/: the data field of the 'GI.GLib.Structs.Hook.Hook' is passed to the hook function here -}
    -> m ()
dynamic_HookFunc __funPtr data_ = liftIO $ do
    (__dynamic_C_HookFunc __funPtr) data_
    return ()

foreign import ccall "wrapper"
    mk_HookFunc :: C_HookFunc -> IO (FunPtr C_HookFunc)

type HookFunc =
    Ptr () ->
    IO ()

noHookFunc :: Maybe HookFunc
noHookFunc = Nothing

genClosure_HookFunc :: HookFunc -> IO Closure
genClosure_HookFunc cb = do
    let cb' = wrap_HookFunc Nothing cb
    mk_HookFunc cb' >>= newCClosure


wrap_HookFunc ::
    Maybe (Ptr (FunPtr C_HookFunc)) ->
    HookFunc ->
    Ptr () ->
    IO ()
wrap_HookFunc funptrptr _cb data_ = do
    _cb  data_
    maybeReleaseFunPtr funptrptr


-- callback HookFindFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the required #GHook has been found", sinceVersion = Nothing}, args = [Arg {argCName = "hook", argType = TInterface (Name {namespace = "GLib", name = "Hook"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GHook", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to g_hook_find_func()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Defines the type of the function passed to g_hook_find().", sinceVersion = Nothing}}
type C_HookFindFunc =
    Ptr GLib.Hook.Hook ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "hook", argType = TInterface (Name {namespace = "GLib", name = "Hook"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GHook", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to g_hook_find_func()", 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_HookFindFunc :: FunPtr C_HookFindFunc -> C_HookFindFunc

dynamic_HookFindFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_HookFindFunc
    -> GLib.Hook.Hook
    {- ^ /@hook@/: a 'GI.GLib.Structs.Hook.Hook' -}
    -> Ptr ()
    {- ^ /@data@/: user data passed to @/g_hook_find_func()/@ -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the required 'GI.GLib.Structs.Hook.Hook' has been found -}
dynamic_HookFindFunc __funPtr hook data_ = liftIO $ do
    hook' <- unsafeManagedPtrGetPtr hook
    result <- (__dynamic_C_HookFindFunc __funPtr) hook' data_
    let result' = (/= 0) result
    touchManagedPtr hook
    return result'

foreign import ccall "wrapper"
    mk_HookFindFunc :: C_HookFindFunc -> IO (FunPtr C_HookFindFunc)

type HookFindFunc =
    GLib.Hook.Hook ->
    Ptr () ->
    IO Bool

noHookFindFunc :: Maybe HookFindFunc
noHookFindFunc = Nothing

genClosure_HookFindFunc :: HookFindFunc -> IO Closure
genClosure_HookFindFunc cb = do
    let cb' = wrap_HookFindFunc Nothing cb
    mk_HookFindFunc cb' >>= newCClosure


wrap_HookFindFunc ::
    Maybe (Ptr (FunPtr C_HookFindFunc)) ->
    HookFindFunc ->
    Ptr GLib.Hook.Hook ->
    Ptr () ->
    IO CInt
wrap_HookFindFunc funptrptr _cb hook data_ = do
    hook' <- (newPtr GLib.Hook.Hook) hook
    result <- _cb  hook' data_
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback HookFinalizeFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "hook_list", argType = TInterface (Name {namespace = "GLib", name = "HookList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GHookList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "hook", argType = TInterface (Name {namespace = "GLib", name = "Hook"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the hook in @hook_list that gets finalized", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Defines the type of function to be called when a hook in a\nlist of hooks gets finalized.", sinceVersion = Nothing}}
type C_HookFinalizeFunc =
    Ptr GLib.HookList.HookList ->
    Ptr GLib.Hook.Hook ->
    IO ()

-- Args : [Arg {argCName = "hook_list", argType = TInterface (Name {namespace = "GLib", name = "HookList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GHookList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "hook", argType = TInterface (Name {namespace = "GLib", name = "Hook"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the hook in @hook_list that gets finalized", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_HookFinalizeFunc :: FunPtr C_HookFinalizeFunc -> C_HookFinalizeFunc

dynamic_HookFinalizeFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_HookFinalizeFunc
    -> GLib.HookList.HookList
    {- ^ /@hookList@/: a 'GI.GLib.Structs.HookList.HookList' -}
    -> GLib.Hook.Hook
    {- ^ /@hook@/: the hook in /@hookList@/ that gets finalized -}
    -> m ()
dynamic_HookFinalizeFunc __funPtr hookList hook = liftIO $ do
    hookList' <- unsafeManagedPtrGetPtr hookList
    hook' <- unsafeManagedPtrGetPtr hook
    (__dynamic_C_HookFinalizeFunc __funPtr) hookList' hook'
    touchManagedPtr hookList
    touchManagedPtr hook
    return ()

foreign import ccall "wrapper"
    mk_HookFinalizeFunc :: C_HookFinalizeFunc -> IO (FunPtr C_HookFinalizeFunc)

type HookFinalizeFunc =
    GLib.HookList.HookList ->
    GLib.Hook.Hook ->
    IO ()

noHookFinalizeFunc :: Maybe HookFinalizeFunc
noHookFinalizeFunc = Nothing

genClosure_HookFinalizeFunc :: HookFinalizeFunc -> IO Closure
genClosure_HookFinalizeFunc cb = do
    let cb' = wrap_HookFinalizeFunc Nothing cb
    mk_HookFinalizeFunc cb' >>= newCClosure


wrap_HookFinalizeFunc ::
    Maybe (Ptr (FunPtr C_HookFinalizeFunc)) ->
    HookFinalizeFunc ->
    Ptr GLib.HookList.HookList ->
    Ptr GLib.Hook.Hook ->
    IO ()
wrap_HookFinalizeFunc funptrptr _cb hookList hook = do
    hookList' <- (newPtr GLib.HookList.HookList) hookList
    hook' <- (newPtr GLib.Hook.Hook) hook
    _cb  hookList' hook'
    maybeReleaseFunPtr funptrptr


-- callback HookCompareFunc
--          -> Callable {returnType = Just (TBasicType TInt), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "a value <= 0 if @new_hook should be before @sibling", sinceVersion = Nothing}, args = [Arg {argCName = "new_hook", argType = TInterface (Name {namespace = "GLib", name = "Hook"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GHook being inserted", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sibling", argType = TInterface (Name {namespace = "GLib", name = "Hook"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GHook to compare with @new_hook", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Defines the type of function used to compare #GHook elements in\ng_hook_insert_sorted().", sinceVersion = Nothing}}
type C_HookCompareFunc =
    Ptr GLib.Hook.Hook ->
    Ptr GLib.Hook.Hook ->
    IO Int32

-- Args : [Arg {argCName = "new_hook", argType = TInterface (Name {namespace = "GLib", name = "Hook"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GHook being inserted", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sibling", argType = TInterface (Name {namespace = "GLib", name = "Hook"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GHook to compare with @new_hook", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_HookCompareFunc :: FunPtr C_HookCompareFunc -> C_HookCompareFunc

dynamic_HookCompareFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_HookCompareFunc
    -> GLib.Hook.Hook
    {- ^ /@newHook@/: the 'GI.GLib.Structs.Hook.Hook' being inserted -}
    -> GLib.Hook.Hook
    {- ^ /@sibling@/: the 'GI.GLib.Structs.Hook.Hook' to compare with /@newHook@/ -}
    -> m Int32
    {- ^ __Returns:__ a value \<= 0 if /@newHook@/ should be before /@sibling@/ -}
dynamic_HookCompareFunc __funPtr newHook sibling = liftIO $ do
    newHook' <- unsafeManagedPtrGetPtr newHook
    sibling' <- unsafeManagedPtrGetPtr sibling
    result <- (__dynamic_C_HookCompareFunc __funPtr) newHook' sibling'
    touchManagedPtr newHook
    touchManagedPtr sibling
    return result

foreign import ccall "wrapper"
    mk_HookCompareFunc :: C_HookCompareFunc -> IO (FunPtr C_HookCompareFunc)

type HookCompareFunc =
    GLib.Hook.Hook ->
    GLib.Hook.Hook ->
    IO Int32

noHookCompareFunc :: Maybe HookCompareFunc
noHookCompareFunc = Nothing

genClosure_HookCompareFunc :: HookCompareFunc -> IO Closure
genClosure_HookCompareFunc cb = do
    let cb' = wrap_HookCompareFunc Nothing cb
    mk_HookCompareFunc cb' >>= newCClosure


wrap_HookCompareFunc ::
    Maybe (Ptr (FunPtr C_HookCompareFunc)) ->
    HookCompareFunc ->
    Ptr GLib.Hook.Hook ->
    Ptr GLib.Hook.Hook ->
    IO Int32
wrap_HookCompareFunc funptrptr _cb newHook sibling = do
    newHook' <- (newPtr GLib.Hook.Hook) newHook
    sibling' <- (newPtr GLib.Hook.Hook) sibling
    result <- _cb  newHook' sibling'
    maybeReleaseFunPtr funptrptr
    return result


-- callback HookCheckMarshaller
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%FALSE if @hook should be destroyed", sinceVersion = Nothing}, args = [Arg {argCName = "hook", argType = TInterface (Name {namespace = "GLib", name = "Hook"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GHook", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "marshal_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Defines the type of function used by g_hook_list_marshal_check().", sinceVersion = Nothing}}
type C_HookCheckMarshaller =
    Ptr GLib.Hook.Hook ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "hook", argType = TInterface (Name {namespace = "GLib", name = "Hook"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GHook", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "marshal_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data", 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_HookCheckMarshaller :: FunPtr C_HookCheckMarshaller -> C_HookCheckMarshaller

dynamic_HookCheckMarshaller ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_HookCheckMarshaller
    -> GLib.Hook.Hook
    {- ^ /@hook@/: a 'GI.GLib.Structs.Hook.Hook' -}
    -> Ptr ()
    {- ^ /@marshalData@/: user data -}
    -> m Bool
    {- ^ __Returns:__ 'False' if /@hook@/ should be destroyed -}
dynamic_HookCheckMarshaller __funPtr hook marshalData = liftIO $ do
    hook' <- unsafeManagedPtrGetPtr hook
    result <- (__dynamic_C_HookCheckMarshaller __funPtr) hook' marshalData
    let result' = (/= 0) result
    touchManagedPtr hook
    return result'

foreign import ccall "wrapper"
    mk_HookCheckMarshaller :: C_HookCheckMarshaller -> IO (FunPtr C_HookCheckMarshaller)

type HookCheckMarshaller =
    GLib.Hook.Hook ->
    Ptr () ->
    IO Bool

noHookCheckMarshaller :: Maybe HookCheckMarshaller
noHookCheckMarshaller = Nothing

genClosure_HookCheckMarshaller :: HookCheckMarshaller -> IO Closure
genClosure_HookCheckMarshaller cb = do
    let cb' = wrap_HookCheckMarshaller Nothing cb
    mk_HookCheckMarshaller cb' >>= newCClosure


wrap_HookCheckMarshaller ::
    Maybe (Ptr (FunPtr C_HookCheckMarshaller)) ->
    HookCheckMarshaller ->
    Ptr GLib.Hook.Hook ->
    Ptr () ->
    IO CInt
wrap_HookCheckMarshaller funptrptr _cb hook marshalData = do
    hook' <- (newPtr GLib.Hook.Hook) hook
    result <- _cb  hook' marshalData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback HookCheckFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%FALSE if the #GHook should be destroyed", sinceVersion = Nothing}, args = [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the data field of the #GHook is passed to the hook function here", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Defines the type of a hook function that can be invoked\nby g_hook_list_invoke_check().", sinceVersion = Nothing}}
type C_HookCheckFunc =
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the data field of the #GHook is passed to the hook function here", 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_HookCheckFunc :: FunPtr C_HookCheckFunc -> C_HookCheckFunc

dynamic_HookCheckFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_HookCheckFunc
    -> Ptr ()
    {- ^ /@data@/: the data field of the 'GI.GLib.Structs.Hook.Hook' is passed to the hook function here -}
    -> m Bool
    {- ^ __Returns:__ 'False' if the 'GI.GLib.Structs.Hook.Hook' should be destroyed -}
dynamic_HookCheckFunc __funPtr data_ = liftIO $ do
    result <- (__dynamic_C_HookCheckFunc __funPtr) data_
    let result' = (/= 0) result
    return result'

foreign import ccall "wrapper"
    mk_HookCheckFunc :: C_HookCheckFunc -> IO (FunPtr C_HookCheckFunc)

type HookCheckFunc =
    Ptr () ->
    IO Bool

noHookCheckFunc :: Maybe HookCheckFunc
noHookCheckFunc = Nothing

genClosure_HookCheckFunc :: HookCheckFunc -> IO Closure
genClosure_HookCheckFunc cb = do
    let cb' = wrap_HookCheckFunc Nothing cb
    mk_HookCheckFunc cb' >>= newCClosure


wrap_HookCheckFunc ::
    Maybe (Ptr (FunPtr C_HookCheckFunc)) ->
    HookCheckFunc ->
    Ptr () ->
    IO CInt
wrap_HookCheckFunc funptrptr _cb data_ = do
    result <- _cb  data_
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback HashFunc
--          -> Callable {returnType = Just (TBasicType TUInt), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "the hash value corresponding to the key", sinceVersion = Nothing}, args = [Arg {argCName = "key", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a key", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of the hash function which is passed to\ng_hash_table_new() when a #GHashTable is created.\n\nThe function is passed a key and should return a #guint hash value.\nThe functions g_direct_hash(), g_int_hash() and g_str_hash() provide\nhash functions which can be used when the key is a #gpointer, #gint*,\nand #gchar* respectively.\n\ng_direct_hash() is also the appropriate hash function for keys\nof the form `GINT_TO_POINTER (n)` (or similar macros).\n\n<!-- FIXME: Need more here. --> A good hash functions should produce\nhash values that are evenly distributed over a fairly large range.\nThe modulus is taken with the hash table size (a prime number) to\nfind the 'bucket' to place each key into. The function should also\nbe very fast, since it is called for each key lookup.\n\nNote that the hash functions provided by GLib have these qualities,\nbut are not particularly robust against manufactured keys that\ncause hash collisions. Therefore, you should consider choosing\na more secure hash function when using a GHashTable with keys\nthat originate in untrusted data (such as HTTP requests).\nUsing g_str_hash() in that situation might make your application\nvulerable to\n[Algorithmic Complexity Attacks](https://lwn.net/Articles/474912/).\n\nThe key to choosing a good hash is unpredictability.  Even\ncryptographic hashes are very easy to find collisions for when the\nremainder is taken modulo a somewhat predictable prime number.  There\nmust be an element of randomness that an attacker is unable to guess.", sinceVersion = Nothing}}
type C_HashFunc =
    Ptr () ->
    IO Word32

-- Args : [Arg {argCName = "key", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a key", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_HashFunc :: FunPtr C_HashFunc -> C_HashFunc

dynamic_HashFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_HashFunc
    -> Ptr ()
    {- ^ /@key@/: a key -}
    -> m Word32
    {- ^ __Returns:__ the hash value corresponding to the key -}
dynamic_HashFunc __funPtr key = liftIO $ do
    result <- (__dynamic_C_HashFunc __funPtr) key
    return result

foreign import ccall "wrapper"
    mk_HashFunc :: C_HashFunc -> IO (FunPtr C_HashFunc)

type HashFunc =
    Ptr () ->
    IO Word32

noHashFunc :: Maybe HashFunc
noHashFunc = Nothing

genClosure_HashFunc :: HashFunc -> IO Closure
genClosure_HashFunc cb = do
    let cb' = wrap_HashFunc Nothing cb
    mk_HashFunc cb' >>= newCClosure


wrap_HashFunc ::
    Maybe (Ptr (FunPtr C_HashFunc)) ->
    HashFunc ->
    Ptr () ->
    IO Word32
wrap_HashFunc funptrptr _cb key = do
    result <- _cb  key
    maybeReleaseFunPtr funptrptr
    return result


-- callback HRFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the key/value pair should be removed from the\n    #GHashTable", sinceVersion = Nothing}, args = [Arg {argCName = "key", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a key", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the value associated with the key", 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 passed to g_hash_table_remove()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of the function passed to\ng_hash_table_foreach_remove(). It is called with each key/value\npair, together with the @user_data parameter passed to\ng_hash_table_foreach_remove(). It should return %TRUE if the\nkey/value pair should be removed from the #GHashTable.", sinceVersion = Nothing}}
type C_HRFunc =
    Ptr () ->
    Ptr () ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "key", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a key", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the value associated with the key", 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 passed to g_hash_table_remove()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_HRFunc :: FunPtr C_HRFunc -> C_HRFunc

dynamic_HRFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_HRFunc
    -> Ptr ()
    {- ^ /@key@/: a key -}
    -> Ptr ()
    {- ^ /@value@/: the value associated with the key -}
    -> Ptr ()
    {- ^ /@userData@/: user data passed to 'GI.GLib.Functions.hashTableRemove' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the key\/value pair should be removed from the
    'GI.GLib.Structs.HashTable.HashTable' -}
dynamic_HRFunc __funPtr key value userData = liftIO $ do
    result <- (__dynamic_C_HRFunc __funPtr) key value userData
    let result' = (/= 0) result
    return result'

foreign import ccall "wrapper"
    mk_HRFunc :: C_HRFunc -> IO (FunPtr C_HRFunc)

type HRFunc =
    Ptr () ->
    Ptr () ->
    IO Bool

noHRFunc :: Maybe HRFunc
noHRFunc = Nothing

type HRFunc_WithClosures =
    Ptr () ->
    Ptr () ->
    Ptr () ->
    IO Bool

noHRFunc_WithClosures :: Maybe HRFunc_WithClosures
noHRFunc_WithClosures = Nothing

drop_closures_HRFunc :: HRFunc -> HRFunc_WithClosures
drop_closures_HRFunc _f key value _ = _f key value

genClosure_HRFunc :: HRFunc -> IO Closure
genClosure_HRFunc cb = do
    let cb' = drop_closures_HRFunc cb
    let cb'' = wrap_HRFunc Nothing cb'
    mk_HRFunc cb'' >>= newCClosure


wrap_HRFunc ::
    Maybe (Ptr (FunPtr C_HRFunc)) ->
    HRFunc_WithClosures ->
    Ptr () ->
    Ptr () ->
    Ptr () ->
    IO CInt
wrap_HRFunc funptrptr _cb key value userData = do
    result <- _cb  key value userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback HFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "key", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a key", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the value corresponding to the key", 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 passed to g_hash_table_foreach()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of the function passed to g_hash_table_foreach().\nIt is called with each key/value pair, together with the @user_data\nparameter which is passed to g_hash_table_foreach().", sinceVersion = Nothing}}
type C_HFunc =
    Ptr () ->
    Ptr () ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "key", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a key", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the value corresponding to the key", 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 passed to g_hash_table_foreach()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_HFunc :: FunPtr C_HFunc -> C_HFunc

dynamic_HFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_HFunc
    -> Ptr ()
    {- ^ /@key@/: a key -}
    -> Ptr ()
    {- ^ /@value@/: the value corresponding to the key -}
    -> Ptr ()
    {- ^ /@userData@/: user data passed to @/g_hash_table_foreach()/@ -}
    -> m ()
dynamic_HFunc __funPtr key value userData = liftIO $ do
    (__dynamic_C_HFunc __funPtr) key value userData
    return ()

foreign import ccall "wrapper"
    mk_HFunc :: C_HFunc -> IO (FunPtr C_HFunc)

type HFunc =
    Ptr () ->
    Ptr () ->
    IO ()

noHFunc :: Maybe HFunc
noHFunc = Nothing

type HFunc_WithClosures =
    Ptr () ->
    Ptr () ->
    Ptr () ->
    IO ()

noHFunc_WithClosures :: Maybe HFunc_WithClosures
noHFunc_WithClosures = Nothing

drop_closures_HFunc :: HFunc -> HFunc_WithClosures
drop_closures_HFunc _f key value _ = _f key value

genClosure_HFunc :: HFunc -> IO Closure
genClosure_HFunc cb = do
    let cb' = drop_closures_HFunc cb
    let cb'' = wrap_HFunc Nothing cb'
    mk_HFunc cb'' >>= newCClosure


wrap_HFunc ::
    Maybe (Ptr (FunPtr C_HFunc)) ->
    HFunc_WithClosures ->
    Ptr () ->
    Ptr () ->
    Ptr () ->
    IO ()
wrap_HFunc funptrptr _cb key value userData = do
    _cb  key value userData
    maybeReleaseFunPtr funptrptr


-- callback Func
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the element's data", 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 passed to g_list_foreach() or g_slist_foreach()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of functions passed to g_list_foreach() and\ng_slist_foreach().", sinceVersion = Nothing}}
type C_Func =
    Ptr () ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the element's data", 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 passed to g_list_foreach() or g_slist_foreach()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_Func :: FunPtr C_Func -> C_Func

dynamic_Func ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_Func
    -> Ptr ()
    {- ^ /@data@/: the element\'s data -}
    -> Ptr ()
    {- ^ /@userData@/: user data passed to @/g_list_foreach()/@ or @/g_slist_foreach()/@ -}
    -> m ()
dynamic_Func __funPtr data_ userData = liftIO $ do
    (__dynamic_C_Func __funPtr) data_ userData
    return ()

foreign import ccall "wrapper"
    mk_Func :: C_Func -> IO (FunPtr C_Func)

type Func =
    Ptr () ->
    IO ()

noFunc :: Maybe Func
noFunc = Nothing

type Func_WithClosures =
    Ptr () ->
    Ptr () ->
    IO ()

noFunc_WithClosures :: Maybe Func_WithClosures
noFunc_WithClosures = Nothing

drop_closures_Func :: Func -> Func_WithClosures
drop_closures_Func _f data_ _ = _f data_

genClosure_Func :: Func -> IO Closure
genClosure_Func cb = do
    let cb' = drop_closures_Func cb
    let cb'' = wrap_Func Nothing cb'
    mk_Func cb'' >>= newCClosure


wrap_Func ::
    Maybe (Ptr (FunPtr C_Func)) ->
    Func_WithClosures ->
    Ptr () ->
    Ptr () ->
    IO ()
wrap_Func funptrptr _cb data_ userData = do
    _cb  data_ userData
    maybeReleaseFunPtr funptrptr


-- callback FreeFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a data pointer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Declares a type of function which takes an arbitrary\ndata pointer argument and has no return value. It is\nnot currently used in GLib or GTK+.", sinceVersion = Nothing}}
type C_FreeFunc =
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a data pointer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FreeFunc :: FunPtr C_FreeFunc -> C_FreeFunc

dynamic_FreeFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_FreeFunc
    -> Ptr ()
    {- ^ /@data@/: a data pointer -}
    -> m ()
dynamic_FreeFunc __funPtr data_ = liftIO $ do
    (__dynamic_C_FreeFunc __funPtr) data_
    return ()

foreign import ccall "wrapper"
    mk_FreeFunc :: C_FreeFunc -> IO (FunPtr C_FreeFunc)

type FreeFunc =
    Ptr () ->
    IO ()

noFreeFunc :: Maybe FreeFunc
noFreeFunc = Nothing

genClosure_FreeFunc :: FreeFunc -> IO Closure
genClosure_FreeFunc cb = do
    let cb' = wrap_FreeFunc Nothing cb
    mk_FreeFunc cb' >>= newCClosure


wrap_FreeFunc ::
    Maybe (Ptr (FunPtr C_FreeFunc)) ->
    FreeFunc ->
    Ptr () ->
    IO ()
wrap_FreeFunc funptrptr _cb data_ = do
    _cb  data_
    maybeReleaseFunPtr funptrptr


-- callback EqualFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if @a = @b; %FALSE otherwise", sinceVersion = Nothing}, args = [Arg {argCName = "a", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a value", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "b", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a value to compare with", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of a function used to test two values for\nequality. The function should return %TRUE if both values are equal\nand %FALSE otherwise.", sinceVersion = Nothing}}
type C_EqualFunc =
    Ptr () ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "a", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a value", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "b", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a value to compare with", 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_EqualFunc :: FunPtr C_EqualFunc -> C_EqualFunc

dynamic_EqualFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_EqualFunc
    -> Ptr ()
    {- ^ /@a@/: a value -}
    -> Ptr ()
    {- ^ /@b@/: a value to compare with -}
    -> m Bool
    {- ^ __Returns:__ 'True' if /@a@/ = /@b@/; 'False' otherwise -}
dynamic_EqualFunc __funPtr a b = liftIO $ do
    result <- (__dynamic_C_EqualFunc __funPtr) a b
    let result' = (/= 0) result
    return result'

foreign import ccall "wrapper"
    mk_EqualFunc :: C_EqualFunc -> IO (FunPtr C_EqualFunc)

type EqualFunc =
    Ptr () ->
    Ptr () ->
    IO Bool

noEqualFunc :: Maybe EqualFunc
noEqualFunc = Nothing

genClosure_EqualFunc :: EqualFunc -> IO Closure
genClosure_EqualFunc cb = do
    let cb' = wrap_EqualFunc Nothing cb
    mk_EqualFunc cb' >>= newCClosure


wrap_EqualFunc ::
    Maybe (Ptr (FunPtr C_EqualFunc)) ->
    EqualFunc ->
    Ptr () ->
    Ptr () ->
    IO CInt
wrap_EqualFunc funptrptr _cb a b = do
    result <- _cb  a b
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback DuplicateFunc
--          -> Callable {returnType = Just (TBasicType TPtr), returnMayBeNull = True, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "a duplicate of data", sinceVersion = Nothing}, args = [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the data to duplicate", 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 that was specified in g_datalist_id_dup_data()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The type of functions that are used to 'duplicate' an object.\nWhat this means depends on the context, it could just be\nincrementing the reference count, if @data is a ref-counted\nobject.", sinceVersion = Nothing}}
type C_DuplicateFunc =
    Ptr () ->
    Ptr () ->
    IO (Ptr ())

-- Args : [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the data to duplicate", 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 that was specified in g_datalist_id_dup_data()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TPtr)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_DuplicateFunc :: FunPtr C_DuplicateFunc -> C_DuplicateFunc

dynamic_DuplicateFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_DuplicateFunc
    -> Ptr ()
    {- ^ /@data@/: the data to duplicate -}
    -> Ptr ()
    {- ^ /@userData@/: user data that was specified in @/g_datalist_id_dup_data()/@ -}
    -> m (Ptr ())
    {- ^ __Returns:__ a duplicate of data -}
dynamic_DuplicateFunc __funPtr data_ userData = liftIO $ do
    result <- (__dynamic_C_DuplicateFunc __funPtr) data_ userData
    return result

foreign import ccall "wrapper"
    mk_DuplicateFunc :: C_DuplicateFunc -> IO (FunPtr C_DuplicateFunc)

type DuplicateFunc =
    Ptr () ->
    IO (Ptr ())

noDuplicateFunc :: Maybe DuplicateFunc
noDuplicateFunc = Nothing

type DuplicateFunc_WithClosures =
    Ptr () ->
    Ptr () ->
    IO (Ptr ())

noDuplicateFunc_WithClosures :: Maybe DuplicateFunc_WithClosures
noDuplicateFunc_WithClosures = Nothing

drop_closures_DuplicateFunc :: DuplicateFunc -> DuplicateFunc_WithClosures
drop_closures_DuplicateFunc _f data_ _ = _f data_

genClosure_DuplicateFunc :: DuplicateFunc -> IO Closure
genClosure_DuplicateFunc cb = do
    let cb' = drop_closures_DuplicateFunc cb
    let cb'' = wrap_DuplicateFunc Nothing cb'
    mk_DuplicateFunc cb'' >>= newCClosure


wrap_DuplicateFunc ::
    Maybe (Ptr (FunPtr C_DuplicateFunc)) ->
    DuplicateFunc_WithClosures ->
    Ptr () ->
    Ptr () ->
    IO (Ptr ())
wrap_DuplicateFunc funptrptr _cb data_ userData = do
    result <- _cb  data_ userData
    maybeReleaseFunPtr funptrptr
    return result


-- callback DestroyNotify
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the data element.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of function which is called when a data element\nis destroyed. It is passed the pointer to the data element and\nshould free any memory and resources allocated for it.", sinceVersion = Nothing}}
type C_DestroyNotify =
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the data element.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_DestroyNotify :: FunPtr C_DestroyNotify -> C_DestroyNotify

dynamic_DestroyNotify ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_DestroyNotify
    -> Ptr ()
    {- ^ /@data@/: the data element. -}
    -> m ()
dynamic_DestroyNotify __funPtr data_ = liftIO $ do
    (__dynamic_C_DestroyNotify __funPtr) data_
    return ()

foreign import ccall "wrapper"
    mk_DestroyNotify :: C_DestroyNotify -> IO (FunPtr C_DestroyNotify)

type DestroyNotify =
    Ptr () ->
    IO ()

noDestroyNotify :: Maybe DestroyNotify
noDestroyNotify = Nothing

genClosure_DestroyNotify :: DestroyNotify -> IO Closure
genClosure_DestroyNotify cb = do
    let cb' = wrap_DestroyNotify Nothing cb
    mk_DestroyNotify cb' >>= newCClosure


wrap_DestroyNotify ::
    Maybe (Ptr (FunPtr C_DestroyNotify)) ->
    DestroyNotify ->
    Ptr () ->
    IO ()
wrap_DestroyNotify funptrptr _cb data_ = do
    _cb  data_
    maybeReleaseFunPtr funptrptr


-- callback DataForeachFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "key_id", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GQuark id to identifying the data element.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the data element.", 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 passed to g_dataset_foreach().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of function passed to g_dataset_foreach(). It is\ncalled with each #GQuark id and associated data element, together\nwith the @user_data parameter supplied to g_dataset_foreach().", sinceVersion = Nothing}}
type C_DataForeachFunc =
    Word32 ->
    Ptr () ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "key_id", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GQuark id to identifying the data element.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the data element.", 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 passed to g_dataset_foreach().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_DataForeachFunc :: FunPtr C_DataForeachFunc -> C_DataForeachFunc

dynamic_DataForeachFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_DataForeachFunc
    -> Word32
    {- ^ /@keyId@/: the @/GQuark/@ id to identifying the data element. -}
    -> Ptr ()
    {- ^ /@data@/: the data element. -}
    -> Ptr ()
    {- ^ /@userData@/: user data passed to @/g_dataset_foreach()/@. -}
    -> m ()
dynamic_DataForeachFunc __funPtr keyId data_ userData = liftIO $ do
    (__dynamic_C_DataForeachFunc __funPtr) keyId data_ userData
    return ()

foreign import ccall "wrapper"
    mk_DataForeachFunc :: C_DataForeachFunc -> IO (FunPtr C_DataForeachFunc)

type DataForeachFunc =
    Word32 ->
    Ptr () ->
    IO ()

noDataForeachFunc :: Maybe DataForeachFunc
noDataForeachFunc = Nothing

type DataForeachFunc_WithClosures =
    Word32 ->
    Ptr () ->
    Ptr () ->
    IO ()

noDataForeachFunc_WithClosures :: Maybe DataForeachFunc_WithClosures
noDataForeachFunc_WithClosures = Nothing

drop_closures_DataForeachFunc :: DataForeachFunc -> DataForeachFunc_WithClosures
drop_closures_DataForeachFunc _f keyId data_ _ = _f keyId data_

genClosure_DataForeachFunc :: DataForeachFunc -> IO Closure
genClosure_DataForeachFunc cb = do
    let cb' = drop_closures_DataForeachFunc cb
    let cb'' = wrap_DataForeachFunc Nothing cb'
    mk_DataForeachFunc cb'' >>= newCClosure


wrap_DataForeachFunc ::
    Maybe (Ptr (FunPtr C_DataForeachFunc)) ->
    DataForeachFunc_WithClosures ->
    Word32 ->
    Ptr () ->
    Ptr () ->
    IO ()
wrap_DataForeachFunc funptrptr _cb keyId data_ userData = do
    _cb  keyId data_ userData
    maybeReleaseFunPtr funptrptr


-- callback CopyFunc
--          -> Callable {returnType = Just (TBasicType TPtr), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "A pointer to the copy", sinceVersion = Nothing}, args = [Arg {argCName = "src", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pointer to the data which should be copied", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Additional data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "A function of this signature is used to copy the node data\nwhen doing a deep-copy of a tree.", sinceVersion = Just "2.4"}}
type C_CopyFunc =
    Ptr () ->
    Ptr () ->
    IO (Ptr ())

-- Args : [Arg {argCName = "src", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pointer to the data which should be copied", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Additional data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TPtr)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_CopyFunc :: FunPtr C_CopyFunc -> C_CopyFunc

dynamic_CopyFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_CopyFunc
    -> Ptr ()
    {- ^ /@src@/: A pointer to the data which should be copied -}
    -> Ptr ()
    {- ^ /@data@/: Additional data -}
    -> m (Ptr ())
    {- ^ __Returns:__ A pointer to the copy -}
dynamic_CopyFunc __funPtr src data_ = liftIO $ do
    result <- (__dynamic_C_CopyFunc __funPtr) src data_
    return result

foreign import ccall "wrapper"
    mk_CopyFunc :: C_CopyFunc -> IO (FunPtr C_CopyFunc)

type CopyFunc =
    Ptr () ->
    Ptr () ->
    IO (Ptr ())

noCopyFunc :: Maybe CopyFunc
noCopyFunc = Nothing

genClosure_CopyFunc :: CopyFunc -> IO Closure
genClosure_CopyFunc cb = do
    let cb' = wrap_CopyFunc Nothing cb
    mk_CopyFunc cb' >>= newCClosure


wrap_CopyFunc ::
    Maybe (Ptr (FunPtr C_CopyFunc)) ->
    CopyFunc ->
    Ptr () ->
    Ptr () ->
    IO (Ptr ())
wrap_CopyFunc funptrptr _cb src data_ = do
    result <- _cb  src data_
    maybeReleaseFunPtr funptrptr
    return result


-- callback CompareFunc
--          -> Callable {returnType = Just (TBasicType TInt), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "negative value if @a < @b; zero if @a = @b; positive\n         value if @a > @b", sinceVersion = Nothing}, args = [Arg {argCName = "a", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a value", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "b", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a value to compare with", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of a comparison function used to compare two\nvalues.  The function should return a negative integer if the first\nvalue comes before the second, 0 if they are equal, or a positive\ninteger if the first value comes after the second.", sinceVersion = Nothing}}
type C_CompareFunc =
    Ptr () ->
    Ptr () ->
    IO Int32

-- Args : [Arg {argCName = "a", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a value", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "b", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a value to compare with", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_CompareFunc :: FunPtr C_CompareFunc -> C_CompareFunc

dynamic_CompareFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_CompareFunc
    -> Ptr ()
    {- ^ /@a@/: a value -}
    -> Ptr ()
    {- ^ /@b@/: a value to compare with -}
    -> m Int32
    {- ^ __Returns:__ negative value if /@a@/ \< /@b@/; zero if /@a@/ = /@b@/; positive
         value if /@a@/ > /@b@/ -}
dynamic_CompareFunc __funPtr a b = liftIO $ do
    result <- (__dynamic_C_CompareFunc __funPtr) a b
    return result

foreign import ccall "wrapper"
    mk_CompareFunc :: C_CompareFunc -> IO (FunPtr C_CompareFunc)

type CompareFunc =
    Ptr () ->
    Ptr () ->
    IO Int32

noCompareFunc :: Maybe CompareFunc
noCompareFunc = Nothing

genClosure_CompareFunc :: CompareFunc -> IO Closure
genClosure_CompareFunc cb = do
    let cb' = wrap_CompareFunc Nothing cb
    mk_CompareFunc cb' >>= newCClosure


wrap_CompareFunc ::
    Maybe (Ptr (FunPtr C_CompareFunc)) ->
    CompareFunc ->
    Ptr () ->
    Ptr () ->
    IO Int32
wrap_CompareFunc funptrptr _cb a b = do
    result <- _cb  a b
    maybeReleaseFunPtr funptrptr
    return result


-- callback CompareDataFunc
--          -> Callable {returnType = Just (TBasicType TInt), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "negative value if @a < @b; zero if @a = @b; positive\n         value if @a > @b", sinceVersion = Nothing}, args = [Arg {argCName = "a", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a value", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "b", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a value to compare with", 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 = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Specifies the type of a comparison function used to compare two\nvalues.  The function should return a negative integer if the first\nvalue comes before the second, 0 if they are equal, or a positive\ninteger if the first value comes after the second.", sinceVersion = Nothing}}
type C_CompareDataFunc =
    Ptr () ->
    Ptr () ->
    Ptr () ->
    IO Int32

-- Args : [Arg {argCName = "a", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a value", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "b", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a value to compare with", 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 = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_CompareDataFunc :: FunPtr C_CompareDataFunc -> C_CompareDataFunc

dynamic_CompareDataFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_CompareDataFunc
    -> Ptr ()
    {- ^ /@a@/: a value -}
    -> Ptr ()
    {- ^ /@b@/: a value to compare with -}
    -> Ptr ()
    {- ^ /@userData@/: user data -}
    -> m Int32
    {- ^ __Returns:__ negative value if /@a@/ \< /@b@/; zero if /@a@/ = /@b@/; positive
         value if /@a@/ > /@b@/ -}
dynamic_CompareDataFunc __funPtr a b userData = liftIO $ do
    result <- (__dynamic_C_CompareDataFunc __funPtr) a b userData
    return result

foreign import ccall "wrapper"
    mk_CompareDataFunc :: C_CompareDataFunc -> IO (FunPtr C_CompareDataFunc)

type CompareDataFunc =
    Ptr () ->
    Ptr () ->
    IO Int32

noCompareDataFunc :: Maybe CompareDataFunc
noCompareDataFunc = Nothing

type CompareDataFunc_WithClosures =
    Ptr () ->
    Ptr () ->
    Ptr () ->
    IO Int32

noCompareDataFunc_WithClosures :: Maybe CompareDataFunc_WithClosures
noCompareDataFunc_WithClosures = Nothing

drop_closures_CompareDataFunc :: CompareDataFunc -> CompareDataFunc_WithClosures
drop_closures_CompareDataFunc _f a b _ = _f a b

genClosure_CompareDataFunc :: CompareDataFunc -> IO Closure
genClosure_CompareDataFunc cb = do
    let cb' = drop_closures_CompareDataFunc cb
    let cb'' = wrap_CompareDataFunc Nothing cb'
    mk_CompareDataFunc cb'' >>= newCClosure


wrap_CompareDataFunc ::
    Maybe (Ptr (FunPtr C_CompareDataFunc)) ->
    CompareDataFunc_WithClosures ->
    Ptr () ->
    Ptr () ->
    Ptr () ->
    IO Int32
wrap_CompareDataFunc funptrptr _cb a b userData = do
    result <- _cb  a b userData
    maybeReleaseFunPtr funptrptr
    return result


-- callback ChildWatchFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "pid", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the process id of the child process", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "status", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Status information about the child process, encoded\n    in a platform-specific manner", 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 passed to g_child_watch_add()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Prototype of a #GChildWatchSource callback, called when a child\nprocess has exited.  To interpret @status, see the documentation\nfor g_spawn_check_exit_status().", sinceVersion = Nothing}}
type C_ChildWatchFunc =
    Int32 ->
    Int32 ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "pid", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the process id of the child process", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "status", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Status information about the child process, encoded\n    in a platform-specific manner", 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 passed to g_child_watch_add()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_ChildWatchFunc :: FunPtr C_ChildWatchFunc -> C_ChildWatchFunc

dynamic_ChildWatchFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_ChildWatchFunc
    -> Int32
    {- ^ /@pid@/: the process id of the child process -}
    -> Int32
    {- ^ /@status@/: Status information about the child process, encoded
    in a platform-specific manner -}
    -> Ptr ()
    {- ^ /@userData@/: user data passed to @/g_child_watch_add()/@ -}
    -> m ()
dynamic_ChildWatchFunc __funPtr pid status userData = liftIO $ do
    (__dynamic_C_ChildWatchFunc __funPtr) pid status userData
    return ()

foreign import ccall "wrapper"
    mk_ChildWatchFunc :: C_ChildWatchFunc -> IO (FunPtr C_ChildWatchFunc)

type ChildWatchFunc =
    Int32 ->
    Int32 ->
    IO ()

noChildWatchFunc :: Maybe ChildWatchFunc
noChildWatchFunc = Nothing

type ChildWatchFunc_WithClosures =
    Int32 ->
    Int32 ->
    Ptr () ->
    IO ()

noChildWatchFunc_WithClosures :: Maybe ChildWatchFunc_WithClosures
noChildWatchFunc_WithClosures = Nothing

drop_closures_ChildWatchFunc :: ChildWatchFunc -> ChildWatchFunc_WithClosures
drop_closures_ChildWatchFunc _f pid status _ = _f pid status

genClosure_ChildWatchFunc :: ChildWatchFunc -> IO Closure
genClosure_ChildWatchFunc cb = do
    let cb' = drop_closures_ChildWatchFunc cb
    let cb'' = wrap_ChildWatchFunc Nothing cb'
    mk_ChildWatchFunc cb'' >>= newCClosure


wrap_ChildWatchFunc ::
    Maybe (Ptr (FunPtr C_ChildWatchFunc)) ->
    ChildWatchFunc_WithClosures ->
    Int32 ->
    Int32 ->
    Ptr () ->
    IO ()
wrap_ChildWatchFunc funptrptr _cb pid status userData = do
    _cb  pid status userData
    maybeReleaseFunPtr funptrptr