{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- Represents a diff list.

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

module GI.Ggit.Objects.Diff
    (
#if defined(ENABLE_OVERLOADING)
    DiffForeachMethodInfo                   ,
#endif
#if defined(ENABLE_OVERLOADING)
    DiffBlobToBufferMethodInfo              ,
#endif
#if defined(ENABLE_OVERLOADING)
    DiffBlobsMethodInfo                     ,
#endif

-- * Exported types
    Diff(..)                                ,
    IsDiff                                  ,
    toDiff                                  ,
    noDiff                                  ,


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

#if defined(ENABLE_OVERLOADING)
    ResolveDiffMethod                       ,
#endif


-- ** findSimilar #method:findSimilar#

#if defined(ENABLE_OVERLOADING)
    DiffFindSimilarMethodInfo               ,
#endif
    diffFindSimilar                         ,


-- ** formatEmail #method:formatEmail#

#if defined(ENABLE_OVERLOADING)
    DiffFormatEmailMethodInfo               ,
#endif
    diffFormatEmail                         ,


-- ** getDelta #method:getDelta#

#if defined(ENABLE_OVERLOADING)
    DiffGetDeltaMethodInfo                  ,
#endif
    diffGetDelta                            ,


-- ** getNumDeltas #method:getNumDeltas#

#if defined(ENABLE_OVERLOADING)
    DiffGetNumDeltasMethodInfo              ,
#endif
    diffGetNumDeltas                        ,


-- ** merge #method:merge#

#if defined(ENABLE_OVERLOADING)
    DiffMergeMethodInfo                     ,
#endif
    diffMerge                               ,


-- ** newBuffers #method:newBuffers#

    diffNewBuffers                          ,


-- ** newIndexToWorkdir #method:newIndexToWorkdir#

    diffNewIndexToWorkdir                   ,


-- ** newTreeToIndex #method:newTreeToIndex#

    diffNewTreeToIndex                      ,


-- ** newTreeToTree #method:newTreeToTree#

    diffNewTreeToTree                       ,


-- ** newTreeToWorkdir #method:newTreeToWorkdir#

    diffNewTreeToWorkdir                    ,


-- ** print #method:print#

#if defined(ENABLE_OVERLOADING)
    DiffPrintMethodInfo                     ,
#endif
    diffPrint                               ,




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

#if defined(ENABLE_OVERLOADING)
    DiffRepositoryPropertyInfo              ,
#endif
    constructDiffRepository                 ,
#if defined(ENABLE_OVERLOADING)
    diffRepository                          ,
#endif
    getDiffRepository                       ,




    ) 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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL

import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Ggit.Callbacks as Ggit.Callbacks
import {-# SOURCE #-} qualified GI.Ggit.Enums as Ggit.Enums
import {-# SOURCE #-} qualified GI.Ggit.Objects.DiffFindOptions as Ggit.DiffFindOptions
import {-# SOURCE #-} qualified GI.Ggit.Objects.DiffFormatEmailOptions as Ggit.DiffFormatEmailOptions
import {-# SOURCE #-} qualified GI.Ggit.Objects.DiffOptions as Ggit.DiffOptions
import {-# SOURCE #-} qualified GI.Ggit.Objects.Index as Ggit.Index
import {-# SOURCE #-} qualified GI.Ggit.Objects.Native as Ggit.Native
import {-# SOURCE #-} qualified GI.Ggit.Objects.ObjectFactoryBase as Ggit.ObjectFactoryBase
import {-# SOURCE #-} qualified GI.Ggit.Objects.Repository as Ggit.Repository
import {-# SOURCE #-} qualified GI.Ggit.Objects.Tree as Ggit.Tree
import {-# SOURCE #-} qualified GI.Ggit.Structs.DiffDelta as Ggit.DiffDelta

-- | Memory-managed wrapper type.
newtype Diff = Diff (ManagedPtr Diff)
    deriving (Eq)
foreign import ccall "ggit_diff_get_type"
    c_ggit_diff_get_type :: IO GType

instance GObject Diff where
    gobjectType = c_ggit_diff_get_type


-- | Convert 'Diff' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue Diff where
    toGValue o = do
        gtype <- c_ggit_diff_get_type
        B.ManagedPtr.withManagedPtr o (B.GValue.buildGValue gtype B.GValue.set_object)

    fromGValue gv = do
        ptr <- B.GValue.get_object gv :: IO (Ptr Diff)
        B.ManagedPtr.newObject Diff ptr



-- | Type class for types which can be safely cast to `Diff`, for instance with `toDiff`.
class (GObject o, O.IsDescendantOf Diff o) => IsDiff o
instance (GObject o, O.IsDescendantOf Diff o) => IsDiff o

instance O.HasParentTypes Diff
type instance O.ParentTypes Diff = '[Ggit.Native.Native, Ggit.ObjectFactoryBase.ObjectFactoryBase, GObject.Object.Object]

-- | Cast to `Diff`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toDiff :: (MonadIO m, IsDiff o) => o -> m Diff
toDiff = liftIO . unsafeCastTo Diff

-- | A convenience alias for `Nothing` :: `Maybe` `Diff`.
noDiff :: Maybe Diff
noDiff = Nothing

#if defined(ENABLE_OVERLOADING)
type family ResolveDiffMethod (t :: Symbol) (o :: *) :: * where
    ResolveDiffMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveDiffMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveDiffMethod "findSimilar" o = DiffFindSimilarMethodInfo
    ResolveDiffMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveDiffMethod "foreach" o = DiffForeachMethodInfo
    ResolveDiffMethod "formatEmail" o = DiffFormatEmailMethodInfo
    ResolveDiffMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveDiffMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveDiffMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveDiffMethod "merge" o = DiffMergeMethodInfo
    ResolveDiffMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveDiffMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveDiffMethod "print" o = DiffPrintMethodInfo
    ResolveDiffMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveDiffMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveDiffMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveDiffMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveDiffMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveDiffMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveDiffMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveDiffMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveDiffMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveDiffMethod "getDelta" o = DiffGetDeltaMethodInfo
    ResolveDiffMethod "getNumDeltas" o = DiffGetNumDeltasMethodInfo
    ResolveDiffMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveDiffMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveDiffMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveDiffMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveDiffMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveDiffMethod l o = O.MethodResolutionFailed l o

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

#endif

-- VVV Prop "repository"
   -- Type: TInterface (Name {namespace = "Ggit", name = "Repository"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@repository@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' diff #repository
-- @
getDiffRepository :: (MonadIO m, IsDiff o) => o -> m (Maybe Ggit.Repository.Repository)
getDiffRepository obj = liftIO $ B.Properties.getObjectPropertyObject obj "repository" Ggit.Repository.Repository

-- | Construct a `GValueConstruct` with valid value for the “@repository@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructDiffRepository :: (IsDiff o, Ggit.Repository.IsRepository a) => a -> IO (GValueConstruct o)
constructDiffRepository val = B.Properties.constructObjectPropertyObject "repository" (Just val)

#if defined(ENABLE_OVERLOADING)
data DiffRepositoryPropertyInfo
instance AttrInfo DiffRepositoryPropertyInfo where
    type AttrAllowedOps DiffRepositoryPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint DiffRepositoryPropertyInfo = IsDiff
    type AttrSetTypeConstraint DiffRepositoryPropertyInfo = Ggit.Repository.IsRepository
    type AttrTransferTypeConstraint DiffRepositoryPropertyInfo = Ggit.Repository.IsRepository
    type AttrTransferType DiffRepositoryPropertyInfo = Ggit.Repository.Repository
    type AttrGetType DiffRepositoryPropertyInfo = (Maybe Ggit.Repository.Repository)
    type AttrLabel DiffRepositoryPropertyInfo = "repository"
    type AttrOrigin DiffRepositoryPropertyInfo = Diff
    attrGet = getDiffRepository
    attrSet = undefined
    attrTransfer _ v = do
        unsafeCastTo Ggit.Repository.Repository v
    attrConstruct = constructDiffRepository
    attrClear = undefined
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Diff
type instance O.AttributeList Diff = DiffAttributeList
type DiffAttributeList = ('[ '("native", Ggit.Native.NativeNativePropertyInfo), '("repository", DiffRepositoryPropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
diffRepository :: AttrLabelProxy "repository"
diffRepository = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Diff = DiffSignalList
type DiffSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

-- method Diff::new_buffers
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "buffer1"
--           , argType = TCArray False (-1) 1 (TBasicType TUInt8)
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a buffer to diff from."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buffer1_len"
--           , argType = TBasicType TInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "length of @buffer1."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buffer1_as_path"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "treat @buffer1 as if it had this filename, or %NULL,"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buffer2"
--           , argType = TCArray False (-1) 4 (TBasicType TUInt8)
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a buffer to diff to."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buffer2_len"
--           , argType = TBasicType TInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "length of @buffer2."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buffer2_as_path"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "treat @buffer2 as if it had this filename, or %NULL,"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "diff_options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "DiffOptions" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitDiffOptions, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "buffer2_len"
--              , argType = TBasicType TInt64
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "length of @buffer2."
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          , Arg
--              { argCName = "buffer1_len"
--              , argType = TBasicType TInt64
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "length of @buffer1."
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Diff" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_diff_new_buffers" ggit_diff_new_buffers ::
    Ptr Word8 ->                            -- buffer1 : TCArray False (-1) 1 (TBasicType TUInt8)
    Int64 ->                                -- buffer1_len : TBasicType TInt64
    CString ->                              -- buffer1_as_path : TBasicType TUTF8
    Ptr Word8 ->                            -- buffer2 : TCArray False (-1) 4 (TBasicType TUInt8)
    Int64 ->                                -- buffer2_len : TBasicType TInt64
    CString ->                              -- buffer2_as_path : TBasicType TUTF8
    Ptr Ggit.DiffOptions.DiffOptions ->     -- diff_options : TInterface (Name {namespace = "Ggit", name = "DiffOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Diff)

-- | Same as 'GI.Ggit.Objects.Diff.diffBlobs' but using a buffers.
-- Creates a t'GI.Ggit.Objects.Diff.Diff' which compares /@buffer1@/ and /@buffer2@/.
-- 
-- If /@diffOptions@/ is 'P.Nothing' then the defaults specified in
-- 'GI.Ggit.Objects.DiffOptions.diffOptionsNew' are used.
diffNewBuffers ::
    (B.CallStack.HasCallStack, MonadIO m, Ggit.DiffOptions.IsDiffOptions a) =>
    Maybe (ByteString)
    -- ^ /@buffer1@/: a buffer to diff from.
    -> Maybe (T.Text)
    -- ^ /@buffer1AsPath@/: treat /@buffer1@/ as if it had this filename, or 'P.Nothing',
    -> Maybe (ByteString)
    -- ^ /@buffer2@/: a buffer to diff to.
    -> Maybe (T.Text)
    -- ^ /@buffer2AsPath@/: treat /@buffer2@/ as if it had this filename, or 'P.Nothing',
    -> Maybe (a)
    -- ^ /@diffOptions@/: a t'GI.Ggit.Objects.DiffOptions.DiffOptions', or 'P.Nothing'.
    -> m (Maybe Diff)
    -- ^ __Returns:__ a newly allocated t'GI.Ggit.Objects.Diff.Diff' if
    -- there was no error, 'P.Nothing' otherwise. /(Can throw 'Data.GI.Base.GError.GError')/
diffNewBuffers buffer1 buffer1AsPath buffer2 buffer2AsPath diffOptions = liftIO $ do
    let buffer2Len = case buffer2 of
            Nothing -> 0
            Just jBuffer2 -> fromIntegral $ B.length jBuffer2
    let buffer1Len = case buffer1 of
            Nothing -> 0
            Just jBuffer1 -> fromIntegral $ B.length jBuffer1
    maybeBuffer1 <- case buffer1 of
        Nothing -> return nullPtr
        Just jBuffer1 -> do
            jBuffer1' <- packByteString jBuffer1
            return jBuffer1'
    maybeBuffer1AsPath <- case buffer1AsPath of
        Nothing -> return nullPtr
        Just jBuffer1AsPath -> do
            jBuffer1AsPath' <- textToCString jBuffer1AsPath
            return jBuffer1AsPath'
    maybeBuffer2 <- case buffer2 of
        Nothing -> return nullPtr
        Just jBuffer2 -> do
            jBuffer2' <- packByteString jBuffer2
            return jBuffer2'
    maybeBuffer2AsPath <- case buffer2AsPath of
        Nothing -> return nullPtr
        Just jBuffer2AsPath -> do
            jBuffer2AsPath' <- textToCString jBuffer2AsPath
            return jBuffer2AsPath'
    maybeDiffOptions <- case diffOptions of
        Nothing -> return nullPtr
        Just jDiffOptions -> do
            jDiffOptions' <- unsafeManagedPtrCastPtr jDiffOptions
            return jDiffOptions'
    onException (do
        result <- propagateGError $ ggit_diff_new_buffers maybeBuffer1 buffer1Len maybeBuffer1AsPath maybeBuffer2 buffer2Len maybeBuffer2AsPath maybeDiffOptions
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Diff) result'
            return result''
        whenJust diffOptions touchManagedPtr
        freeMem maybeBuffer1
        freeMem maybeBuffer1AsPath
        freeMem maybeBuffer2
        freeMem maybeBuffer2AsPath
        return maybeResult
     ) (do
        freeMem maybeBuffer1
        freeMem maybeBuffer1AsPath
        freeMem maybeBuffer2
        freeMem maybeBuffer2AsPath
     )

#if defined(ENABLE_OVERLOADING)
#endif

-- method Diff::new_index_to_workdir
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "index"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Index" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitIndex, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "diff_options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "DiffOptions" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitDiffOptions, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Diff" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_diff_new_index_to_workdir" ggit_diff_new_index_to_workdir ::
    Ptr Ggit.Repository.Repository ->       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.Index.Index ->                 -- index : TInterface (Name {namespace = "Ggit", name = "Index"})
    Ptr Ggit.DiffOptions.DiffOptions ->     -- diff_options : TInterface (Name {namespace = "Ggit", name = "DiffOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Diff)

-- | Creates a t'GI.Ggit.Objects.Diff.Diff' which compares the working directory and the index.
-- 
-- If /@index@/ is 'P.Nothing' then /@repository@/ index is used.
-- If /@diffOptions@/ is 'P.Nothing' then the defaults specified in
-- 'GI.Ggit.Objects.DiffOptions.diffOptionsNew' are used.
diffNewIndexToWorkdir ::
    (B.CallStack.HasCallStack, MonadIO m, Ggit.Repository.IsRepository a, Ggit.Index.IsIndex b, Ggit.DiffOptions.IsDiffOptions c) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (b)
    -- ^ /@index@/: a t'GI.Ggit.Objects.Index.Index', or 'P.Nothing'.
    -> Maybe (c)
    -- ^ /@diffOptions@/: a t'GI.Ggit.Objects.DiffOptions.DiffOptions', or 'P.Nothing'.
    -> m (Maybe Diff)
    -- ^ __Returns:__ a newly allocated t'GI.Ggit.Objects.Diff.Diff' if
    -- there was no error, 'P.Nothing' otherwise. /(Can throw 'Data.GI.Base.GError.GError')/
diffNewIndexToWorkdir repository index diffOptions = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    maybeIndex <- case index of
        Nothing -> return nullPtr
        Just jIndex -> do
            jIndex' <- unsafeManagedPtrCastPtr jIndex
            return jIndex'
    maybeDiffOptions <- case diffOptions of
        Nothing -> return nullPtr
        Just jDiffOptions -> do
            jDiffOptions' <- unsafeManagedPtrCastPtr jDiffOptions
            return jDiffOptions'
    onException (do
        result <- propagateGError $ ggit_diff_new_index_to_workdir repository' maybeIndex maybeDiffOptions
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Diff) result'
            return result''
        touchManagedPtr repository
        whenJust index touchManagedPtr
        whenJust diffOptions touchManagedPtr
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
#endif

-- method Diff::new_tree_to_index
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "old_tree"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Tree" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitTree to diff from."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "index"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Index" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitIndex, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "diff_options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "DiffOptions" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitDiffOptions, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Diff" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_diff_new_tree_to_index" ggit_diff_new_tree_to_index ::
    Ptr Ggit.Repository.Repository ->       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.Tree.Tree ->                   -- old_tree : TInterface (Name {namespace = "Ggit", name = "Tree"})
    Ptr Ggit.Index.Index ->                 -- index : TInterface (Name {namespace = "Ggit", name = "Index"})
    Ptr Ggit.DiffOptions.DiffOptions ->     -- diff_options : TInterface (Name {namespace = "Ggit", name = "DiffOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Diff)

-- | Creates a t'GI.Ggit.Objects.Diff.Diff' which compares /@oldTree@/ and the index.
-- 
-- If /@index@/ is 'P.Nothing' then /@repository@/ index is used.
-- If /@diffOptions@/ is 'P.Nothing' then the defaults specified in
-- 'GI.Ggit.Objects.DiffOptions.diffOptionsNew' are used.
diffNewTreeToIndex ::
    (B.CallStack.HasCallStack, MonadIO m, Ggit.Repository.IsRepository a, Ggit.Tree.IsTree b, Ggit.Index.IsIndex c, Ggit.DiffOptions.IsDiffOptions d) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (b)
    -- ^ /@oldTree@/: a t'GI.Ggit.Objects.Tree.Tree' to diff from.
    -> Maybe (c)
    -- ^ /@index@/: a t'GI.Ggit.Objects.Index.Index', or 'P.Nothing'.
    -> Maybe (d)
    -- ^ /@diffOptions@/: a t'GI.Ggit.Objects.DiffOptions.DiffOptions', or 'P.Nothing'.
    -> m (Maybe Diff)
    -- ^ __Returns:__ a newly allocated t'GI.Ggit.Objects.Diff.Diff' if
    -- there was no error, 'P.Nothing' otherwise. /(Can throw 'Data.GI.Base.GError.GError')/
diffNewTreeToIndex repository oldTree index diffOptions = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    maybeOldTree <- case oldTree of
        Nothing -> return nullPtr
        Just jOldTree -> do
            jOldTree' <- unsafeManagedPtrCastPtr jOldTree
            return jOldTree'
    maybeIndex <- case index of
        Nothing -> return nullPtr
        Just jIndex -> do
            jIndex' <- unsafeManagedPtrCastPtr jIndex
            return jIndex'
    maybeDiffOptions <- case diffOptions of
        Nothing -> return nullPtr
        Just jDiffOptions -> do
            jDiffOptions' <- unsafeManagedPtrCastPtr jDiffOptions
            return jDiffOptions'
    onException (do
        result <- propagateGError $ ggit_diff_new_tree_to_index repository' maybeOldTree maybeIndex maybeDiffOptions
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Diff) result'
            return result''
        touchManagedPtr repository
        whenJust oldTree touchManagedPtr
        whenJust index touchManagedPtr
        whenJust diffOptions touchManagedPtr
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
#endif

-- method Diff::new_tree_to_tree
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "old_tree"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Tree" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitTree to diff from."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "new_tree"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Tree" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitTree to diff to."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "diff_options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "DiffOptions" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitDiffOptions, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Diff" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_diff_new_tree_to_tree" ggit_diff_new_tree_to_tree ::
    Ptr Ggit.Repository.Repository ->       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.Tree.Tree ->                   -- old_tree : TInterface (Name {namespace = "Ggit", name = "Tree"})
    Ptr Ggit.Tree.Tree ->                   -- new_tree : TInterface (Name {namespace = "Ggit", name = "Tree"})
    Ptr Ggit.DiffOptions.DiffOptions ->     -- diff_options : TInterface (Name {namespace = "Ggit", name = "DiffOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Diff)

-- | Creates a t'GI.Ggit.Objects.Diff.Diff' which compares /@oldTree@/ and /@newTree@/.
-- 
-- If /@diffOptions@/ is 'P.Nothing' then the defaults specified in
-- 'GI.Ggit.Objects.DiffOptions.diffOptionsNew' are used.
diffNewTreeToTree ::
    (B.CallStack.HasCallStack, MonadIO m, Ggit.Repository.IsRepository a, Ggit.Tree.IsTree b, Ggit.Tree.IsTree c, Ggit.DiffOptions.IsDiffOptions d) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (b)
    -- ^ /@oldTree@/: a t'GI.Ggit.Objects.Tree.Tree' to diff from.
    -> Maybe (c)
    -- ^ /@newTree@/: a t'GI.Ggit.Objects.Tree.Tree' to diff to.
    -> Maybe (d)
    -- ^ /@diffOptions@/: a t'GI.Ggit.Objects.DiffOptions.DiffOptions', or 'P.Nothing'.
    -> m (Maybe Diff)
    -- ^ __Returns:__ a newly allocated t'GI.Ggit.Objects.Diff.Diff' if
    -- there was no error, 'P.Nothing' otherwise. /(Can throw 'Data.GI.Base.GError.GError')/
diffNewTreeToTree repository oldTree newTree diffOptions = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    maybeOldTree <- case oldTree of
        Nothing -> return nullPtr
        Just jOldTree -> do
            jOldTree' <- unsafeManagedPtrCastPtr jOldTree
            return jOldTree'
    maybeNewTree <- case newTree of
        Nothing -> return nullPtr
        Just jNewTree -> do
            jNewTree' <- unsafeManagedPtrCastPtr jNewTree
            return jNewTree'
    maybeDiffOptions <- case diffOptions of
        Nothing -> return nullPtr
        Just jDiffOptions -> do
            jDiffOptions' <- unsafeManagedPtrCastPtr jDiffOptions
            return jDiffOptions'
    onException (do
        result <- propagateGError $ ggit_diff_new_tree_to_tree repository' maybeOldTree maybeNewTree maybeDiffOptions
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Diff) result'
            return result''
        touchManagedPtr repository
        whenJust oldTree touchManagedPtr
        whenJust newTree touchManagedPtr
        whenJust diffOptions touchManagedPtr
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
#endif

-- method Diff::new_tree_to_workdir
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "old_tree"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Tree" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitTree to diff from."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "diff_options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "DiffOptions" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitDiffOptions, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Diff" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_diff_new_tree_to_workdir" ggit_diff_new_tree_to_workdir ::
    Ptr Ggit.Repository.Repository ->       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.Tree.Tree ->                   -- old_tree : TInterface (Name {namespace = "Ggit", name = "Tree"})
    Ptr Ggit.DiffOptions.DiffOptions ->     -- diff_options : TInterface (Name {namespace = "Ggit", name = "DiffOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Diff)

-- | Creates a t'GI.Ggit.Objects.Diff.Diff' which compares the working directory and /@oldTree@/.
-- 
-- If /@diffOptions@/ is 'P.Nothing' then the defaults specified in
-- 'GI.Ggit.Objects.DiffOptions.diffOptionsNew' are used.
diffNewTreeToWorkdir ::
    (B.CallStack.HasCallStack, MonadIO m, Ggit.Repository.IsRepository a, Ggit.Tree.IsTree b, Ggit.DiffOptions.IsDiffOptions c) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (b)
    -- ^ /@oldTree@/: a t'GI.Ggit.Objects.Tree.Tree' to diff from.
    -> Maybe (c)
    -- ^ /@diffOptions@/: a t'GI.Ggit.Objects.DiffOptions.DiffOptions', or 'P.Nothing'.
    -> m (Maybe Diff)
    -- ^ __Returns:__ a newly allocated t'GI.Ggit.Objects.Diff.Diff' if
    -- there was no error, 'P.Nothing' otherwise. /(Can throw 'Data.GI.Base.GError.GError')/
diffNewTreeToWorkdir repository oldTree diffOptions = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    maybeOldTree <- case oldTree of
        Nothing -> return nullPtr
        Just jOldTree -> do
            jOldTree' <- unsafeManagedPtrCastPtr jOldTree
            return jOldTree'
    maybeDiffOptions <- case diffOptions of
        Nothing -> return nullPtr
        Just jDiffOptions -> do
            jDiffOptions' <- unsafeManagedPtrCastPtr jDiffOptions
            return jDiffOptions'
    onException (do
        result <- propagateGError $ ggit_diff_new_tree_to_workdir repository' maybeOldTree maybeDiffOptions
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Diff) result'
            return result''
        touchManagedPtr repository
        whenJust oldTree touchManagedPtr
        whenJust diffOptions touchManagedPtr
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
#endif

-- method Diff::find_similar
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "diff"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Diff" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitDiff." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "DiffFindOptions" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitDiffFindOptions or %NULL."
--                 , 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 "ggit_diff_find_similar" ggit_diff_find_similar ::
    Ptr Diff ->                             -- diff : TInterface (Name {namespace = "Ggit", name = "Diff"})
    Ptr Ggit.DiffFindOptions.DiffFindOptions -> -- options : TInterface (Name {namespace = "Ggit", name = "DiffFindOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Transform /@diff@/ marking file renames, copies, etc.. If /@options@/ is set to
-- 'P.Nothing', then the default options will be used.
diffFindSimilar ::
    (B.CallStack.HasCallStack, MonadIO m, IsDiff a, Ggit.DiffFindOptions.IsDiffFindOptions b) =>
    a
    -- ^ /@diff@/: a t'GI.Ggit.Objects.Diff.Diff'.
    -> Maybe (b)
    -- ^ /@options@/: a t'GI.Ggit.Objects.DiffFindOptions.DiffFindOptions' or 'P.Nothing'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
diffFindSimilar diff options = liftIO $ do
    diff' <- unsafeManagedPtrCastPtr diff
    maybeOptions <- case options of
        Nothing -> return nullPtr
        Just jOptions -> do
            jOptions' <- unsafeManagedPtrCastPtr jOptions
            return jOptions'
    onException (do
        _ <- propagateGError $ ggit_diff_find_similar diff' maybeOptions
        touchManagedPtr diff
        whenJust options touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data DiffFindSimilarMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsDiff a, Ggit.DiffFindOptions.IsDiffFindOptions b) => O.MethodInfo DiffFindSimilarMethodInfo a signature where
    overloadedMethod = diffFindSimilar

#endif

-- XXX Could not generate method Diff::foreach
-- Error was : Not implemented: "Closure for multiple callbacks unsupportedArg\n  { argCName = \"binary_cb\"\n  , argType =\n      TInterface\n        Name { namespace = \"Ggit\" , name = \"DiffBinaryCallback\" }\n  , direction = DirectionIn\n  , mayBeNull = True\n  , argDoc =\n      Documentation\n        { rawDocText = Just \"\\n a #GgitDiffBinaryCallback.\"\n        , sinceVersion = Nothing\n        }\n  , argScope = ScopeTypeCall\n  , argClosure = 5\n  , argDestroy = -1\n  , argCallerAllocates = False\n  , transfer = TransferNothing\n  }\nCallable\n  { returnType = Nothing\n  , returnMayBeNull = False\n  , returnTransfer = TransferNothing\n  , returnDocumentation =\n      Documentation { rawDocText = Nothing , sinceVersion = Nothing }\n  , args =\n      [ Arg\n          { argCName = \"diff\"\n          , argType = TInterface Name { namespace = \"Ggit\" , name = \"Diff\" }\n          , direction = DirectionIn\n          , mayBeNull = False\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"a #GgitDiff.\" , sinceVersion = Nothing }\n          , argScope = ScopeTypeInvalid\n          , argClosure = -1\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"file_cb\"\n          , argType =\n              TInterface Name { namespace = \"Ggit\" , name = \"DiffFileCallback\" }\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"\\n a #GgitDiffFileCallback.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeCall\n          , argClosure = 5\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"binary_cb\"\n          , argType =\n              TInterface\n                Name { namespace = \"Ggit\" , name = \"DiffBinaryCallback\" }\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"\\n a #GgitDiffBinaryCallback.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeCall\n          , argClosure = 5\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"hunk_cb\"\n          , argType =\n              TInterface Name { namespace = \"Ggit\" , name = \"DiffHunkCallback\" }\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"\\n a #GgitDiffHunkCallback.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeCall\n          , argClosure = 5\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"line_cb\"\n          , argType =\n              TInterface Name { namespace = \"Ggit\" , name = \"DiffLineCallback\" }\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"\\n a #GgitDiffLineCallback.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeCall\n          , argClosure = 5\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"user_data\"\n          , argType = TBasicType TPtr\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"callback user data.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeInvalid\n          , argClosure = -1\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      ]\n  , skipReturn = False\n  , callableThrows = True\n  , callableDeprecated = Nothing\n  , callableDocumentation =\n      Documentation\n        { rawDocText =\n            Just\n              \"Iterates over the diff calling @file_cb, @binary_cb, @hunk_cb and @line_cb.\"\n        , sinceVersion = Nothing\n        }\n  }"
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data DiffForeachMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "foreach" Diff) => O.MethodInfo DiffForeachMethodInfo o p where
    overloadedMethod = undefined
#endif

-- method Diff::format_email
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "diff"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Diff" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitDiff." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType =
--               TInterface
--                 Name { namespace = "Ggit" , name = "DiffFormatEmailOptions" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitDiffFormatEmailOptions."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_diff_format_email" ggit_diff_format_email ::
    Ptr Diff ->                             -- diff : TInterface (Name {namespace = "Ggit", name = "Diff"})
    Ptr Ggit.DiffFormatEmailOptions.DiffFormatEmailOptions -> -- options : TInterface (Name {namespace = "Ggit", name = "DiffFormatEmailOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO CString

-- | Create an e-mail ready patch from a diff.
diffFormatEmail ::
    (B.CallStack.HasCallStack, MonadIO m, IsDiff a, Ggit.DiffFormatEmailOptions.IsDiffFormatEmailOptions b) =>
    a
    -- ^ /@diff@/: a t'GI.Ggit.Objects.Diff.Diff'.
    -> b
    -- ^ /@options@/: a t'GI.Ggit.Objects.DiffFormatEmailOptions.DiffFormatEmailOptions'.
    -> m (Maybe T.Text)
    -- ^ __Returns:__ the patch or 'P.Nothing' if an error occurred. /(Can throw 'Data.GI.Base.GError.GError')/
diffFormatEmail diff options = liftIO $ do
    diff' <- unsafeManagedPtrCastPtr diff
    options' <- unsafeManagedPtrCastPtr options
    onException (do
        result <- propagateGError $ ggit_diff_format_email diff' options'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- cstringToText result'
            freeMem result'
            return result''
        touchManagedPtr diff
        touchManagedPtr options
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data DiffFormatEmailMethodInfo
instance (signature ~ (b -> m (Maybe T.Text)), MonadIO m, IsDiff a, Ggit.DiffFormatEmailOptions.IsDiffFormatEmailOptions b) => O.MethodInfo DiffFormatEmailMethodInfo a signature where
    overloadedMethod = diffFormatEmail

#endif

-- method Diff::get_delta
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "diff"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Diff" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitDiff." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "index"
--           , argType = TBasicType TUInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the index." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "DiffDelta" })
-- throws : False
-- Skip return : False

foreign import ccall "ggit_diff_get_delta" ggit_diff_get_delta ::
    Ptr Diff ->                             -- diff : TInterface (Name {namespace = "Ggit", name = "Diff"})
    Word64 ->                               -- index : TBasicType TUInt64
    IO (Ptr Ggit.DiffDelta.DiffDelta)

-- | Get the delta at the specified index.
diffGetDelta ::
    (B.CallStack.HasCallStack, MonadIO m, IsDiff a) =>
    a
    -- ^ /@diff@/: a t'GI.Ggit.Objects.Diff.Diff'.
    -> Word64
    -- ^ /@index@/: the index.
    -> m (Maybe Ggit.DiffDelta.DiffDelta)
    -- ^ __Returns:__ a t'GI.Ggit.Structs.DiffDelta.DiffDelta' or 'P.Nothing'.
diffGetDelta diff index = liftIO $ do
    diff' <- unsafeManagedPtrCastPtr diff
    result <- ggit_diff_get_delta diff' index
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapBoxed Ggit.DiffDelta.DiffDelta) result'
        return result''
    touchManagedPtr diff
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data DiffGetDeltaMethodInfo
instance (signature ~ (Word64 -> m (Maybe Ggit.DiffDelta.DiffDelta)), MonadIO m, IsDiff a) => O.MethodInfo DiffGetDeltaMethodInfo a signature where
    overloadedMethod = diffGetDelta

#endif

-- method Diff::get_num_deltas
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "diff"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Diff" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitDiff." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt64)
-- throws : False
-- Skip return : False

foreign import ccall "ggit_diff_get_num_deltas" ggit_diff_get_num_deltas ::
    Ptr Diff ->                             -- diff : TInterface (Name {namespace = "Ggit", name = "Diff"})
    IO Word64

-- | Get the number of deltas in the diff.
diffGetNumDeltas ::
    (B.CallStack.HasCallStack, MonadIO m, IsDiff a) =>
    a
    -- ^ /@diff@/: a t'GI.Ggit.Objects.Diff.Diff'.
    -> m Word64
    -- ^ __Returns:__ the number of deltas.
diffGetNumDeltas diff = liftIO $ do
    diff' <- unsafeManagedPtrCastPtr diff
    result <- ggit_diff_get_num_deltas diff'
    touchManagedPtr diff
    return result

#if defined(ENABLE_OVERLOADING)
data DiffGetNumDeltasMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsDiff a) => O.MethodInfo DiffGetNumDeltasMethodInfo a signature where
    overloadedMethod = diffGetNumDeltas

#endif

-- method Diff::merge
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "onto"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Diff" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GgitDiff to merge into."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "from"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Diff" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GgitDiff to merge."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : True
-- Skip return : False

foreign import ccall "ggit_diff_merge" ggit_diff_merge ::
    Ptr Diff ->                             -- onto : TInterface (Name {namespace = "Ggit", name = "Diff"})
    Ptr Diff ->                             -- from : TInterface (Name {namespace = "Ggit", name = "Diff"})
    Ptr (Ptr GError) ->                     -- error
    IO ()

-- | Merges /@from@/ into /@onto@/ unless /@error@/ is set.
diffMerge ::
    (B.CallStack.HasCallStack, MonadIO m, IsDiff a, IsDiff b) =>
    a
    -- ^ /@onto@/: the t'GI.Ggit.Objects.Diff.Diff' to merge into.
    -> b
    -- ^ /@from@/: the t'GI.Ggit.Objects.Diff.Diff' to merge.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
diffMerge onto from = liftIO $ do
    onto' <- unsafeManagedPtrCastPtr onto
    from' <- unsafeManagedPtrCastPtr from
    onException (do
        propagateGError $ ggit_diff_merge onto' from'
        touchManagedPtr onto
        touchManagedPtr from
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data DiffMergeMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsDiff a, IsDiff b) => O.MethodInfo DiffMergeMethodInfo a signature where
    overloadedMethod = diffMerge

#endif

-- method Diff::print
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "diff"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Diff" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitDiff." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "type"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "DiffFormatType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitDiffFormatType."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "print_cb"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "DiffLineCallback" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitDiffLineCallback."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeCall
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "callback user data."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : True
-- Skip return : False

foreign import ccall "ggit_diff_print" ggit_diff_print ::
    Ptr Diff ->                             -- diff : TInterface (Name {namespace = "Ggit", name = "Diff"})
    CUInt ->                                -- type : TInterface (Name {namespace = "Ggit", name = "DiffFormatType"})
    FunPtr Ggit.Callbacks.C_DiffLineCallback -> -- print_cb : TInterface (Name {namespace = "Ggit", name = "DiffLineCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    Ptr (Ptr GError) ->                     -- error
    IO ()

-- | Iterates over /@diff@/ generating text output like \"git diff\".
diffPrint ::
    (B.CallStack.HasCallStack, MonadIO m, IsDiff a) =>
    a
    -- ^ /@diff@/: a t'GI.Ggit.Objects.Diff.Diff'.
    -> Ggit.Enums.DiffFormatType
    -- ^ /@type@/: a t'GI.Ggit.Enums.DiffFormatType'.
    -> Ggit.Callbacks.DiffLineCallback
    -- ^ /@printCb@/: a t'GI.Ggit.Callbacks.DiffLineCallback'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
diffPrint diff type_ printCb = liftIO $ do
    diff' <- unsafeManagedPtrCastPtr diff
    let type_' = (fromIntegral . fromEnum) type_
    printCb' <- Ggit.Callbacks.mk_DiffLineCallback (Ggit.Callbacks.wrap_DiffLineCallback Nothing (Ggit.Callbacks.drop_closures_DiffLineCallback printCb))
    let userData = nullPtr
    onException (do
        propagateGError $ ggit_diff_print diff' type_' printCb' userData
        safeFreeFunPtr $ castFunPtrToPtr printCb'
        touchManagedPtr diff
        return ()
     ) (do
        safeFreeFunPtr $ castFunPtrToPtr printCb'
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data DiffPrintMethodInfo
instance (signature ~ (Ggit.Enums.DiffFormatType -> Ggit.Callbacks.DiffLineCallback -> m ()), MonadIO m, IsDiff a) => O.MethodInfo DiffPrintMethodInfo a signature where
    overloadedMethod = diffPrint

#endif

-- XXX Could not generate method Diff::blob_to_buffer
-- Error was : Not implemented: "Closure for multiple callbacks unsupportedArg\n  { argCName = \"binary_cb\"\n  , argType =\n      TInterface\n        Name { namespace = \"Ggit\" , name = \"DiffBinaryCallback\" }\n  , direction = DirectionIn\n  , mayBeNull = True\n  , argDoc =\n      Documentation\n        { rawDocText = Just \"\\n a #GgitDiffBinaryCallback.\"\n        , sinceVersion = Nothing\n        }\n  , argScope = ScopeTypeCall\n  , argClosure = 10\n  , argDestroy = -1\n  , argCallerAllocates = False\n  , transfer = TransferNothing\n  }\nCallable\n  { returnType = Nothing\n  , returnMayBeNull = False\n  , returnTransfer = TransferNothing\n  , returnDocumentation =\n      Documentation { rawDocText = Nothing , sinceVersion = Nothing }\n  , args =\n      [ Arg\n          { argCName = \"old_blob\"\n          , argType = TInterface Name { namespace = \"Ggit\" , name = \"Blob\" }\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"a #GgitBlob to diff from.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeInvalid\n          , argClosure = -1\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"old_as_path\"\n          , argType = TBasicType TUTF8\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText =\n                    Just \"treat @old_blob as if it had this filename, or %NULL,\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeInvalid\n          , argClosure = -1\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"buffer\"\n          , argType = TCArray False (-1) 3 (TBasicType TUInt8)\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"a buffer to diff to.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeInvalid\n          , argClosure = -1\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"buffer_len\"\n          , argType = TBasicType TInt64\n          , direction = DirectionIn\n          , mayBeNull = False\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"length of @buffer.\" , sinceVersion = Nothing }\n          , argScope = ScopeTypeInvalid\n          , argClosure = -1\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"buffer_as_path\"\n          , argType = TBasicType TUTF8\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText =\n                    Just \"treat @buffer as if it had this filename, or %NULL,\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeInvalid\n          , argClosure = -1\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"diff_options\"\n          , argType =\n              TInterface Name { namespace = \"Ggit\" , name = \"DiffOptions\" }\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"a #GgitDiffOptions, or %NULL.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeInvalid\n          , argClosure = -1\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"file_cb\"\n          , argType =\n              TInterface Name { namespace = \"Ggit\" , name = \"DiffFileCallback\" }\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"\\n a #GgitDiffFileCallback.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeCall\n          , argClosure = 10\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"binary_cb\"\n          , argType =\n              TInterface\n                Name { namespace = \"Ggit\" , name = \"DiffBinaryCallback\" }\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"\\n a #GgitDiffBinaryCallback.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeCall\n          , argClosure = 10\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"hunk_cb\"\n          , argType =\n              TInterface Name { namespace = \"Ggit\" , name = \"DiffHunkCallback\" }\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"\\n a #GgitDiffHunkCallback.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeCall\n          , argClosure = 10\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"line_cb\"\n          , argType =\n              TInterface Name { namespace = \"Ggit\" , name = \"DiffLineCallback\" }\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"\\n a #GgitDiffLineCallback.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeCall\n          , argClosure = 10\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"user_data\"\n          , argType = TBasicType TPtr\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"callback user data.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeInvalid\n          , argClosure = -1\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      ]\n  , skipReturn = False\n  , callableThrows = True\n  , callableDeprecated = Nothing\n  , callableDocumentation =\n      Documentation\n        { rawDocText = Just \"Same as ggit_diff_blobs() but using a buffer.\"\n        , sinceVersion = Nothing\n        }\n  }"
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data DiffBlobToBufferMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "blobToBuffer" Diff) => O.MethodInfo DiffBlobToBufferMethodInfo o p where
    overloadedMethod = undefined
#endif

-- XXX Could not generate method Diff::blobs
-- Error was : Not implemented: "Closure for multiple callbacks unsupportedArg\n  { argCName = \"binary_cb\"\n  , argType =\n      TInterface\n        Name { namespace = \"Ggit\" , name = \"DiffBinaryCallback\" }\n  , direction = DirectionIn\n  , mayBeNull = True\n  , argDoc =\n      Documentation\n        { rawDocText = Just \"\\n a #GgitDiffBinaryCallback.\"\n        , sinceVersion = Nothing\n        }\n  , argScope = ScopeTypeCall\n  , argClosure = 9\n  , argDestroy = -1\n  , argCallerAllocates = False\n  , transfer = TransferNothing\n  }\nCallable\n  { returnType = Nothing\n  , returnMayBeNull = False\n  , returnTransfer = TransferNothing\n  , returnDocumentation =\n      Documentation { rawDocText = Nothing , sinceVersion = Nothing }\n  , args =\n      [ Arg\n          { argCName = \"old_blob\"\n          , argType = TInterface Name { namespace = \"Ggit\" , name = \"Blob\" }\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"a #GgitBlob to diff from.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeInvalid\n          , argClosure = -1\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"old_as_path\"\n          , argType = TBasicType TUTF8\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText =\n                    Just \"treat @old_blob as if it had this filename, or %NULL,\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeInvalid\n          , argClosure = -1\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"new_blob\"\n          , argType = TInterface Name { namespace = \"Ggit\" , name = \"Blob\" }\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"a #GgitBlob to diff to.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeInvalid\n          , argClosure = -1\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"new_as_path\"\n          , argType = TBasicType TUTF8\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText =\n                    Just \"treat @new_blob as if it had this filename, or %NULL,\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeInvalid\n          , argClosure = -1\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"diff_options\"\n          , argType =\n              TInterface Name { namespace = \"Ggit\" , name = \"DiffOptions\" }\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"a #GgitDiffOptions, or %NULL.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeInvalid\n          , argClosure = -1\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"file_cb\"\n          , argType =\n              TInterface Name { namespace = \"Ggit\" , name = \"DiffFileCallback\" }\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"\\n a #GgitDiffFileCallback.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeCall\n          , argClosure = 9\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"binary_cb\"\n          , argType =\n              TInterface\n                Name { namespace = \"Ggit\" , name = \"DiffBinaryCallback\" }\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"\\n a #GgitDiffBinaryCallback.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeCall\n          , argClosure = 9\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"hunk_cb\"\n          , argType =\n              TInterface Name { namespace = \"Ggit\" , name = \"DiffHunkCallback\" }\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"\\n a #GgitDiffHunkCallback.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeCall\n          , argClosure = 9\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"line_cb\"\n          , argType =\n              TInterface Name { namespace = \"Ggit\" , name = \"DiffLineCallback\" }\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"\\n a #GgitDiffLineCallback.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeCall\n          , argClosure = 9\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      , Arg\n          { argCName = \"user_data\"\n          , argType = TBasicType TPtr\n          , direction = DirectionIn\n          , mayBeNull = True\n          , argDoc =\n              Documentation\n                { rawDocText = Just \"callback user data.\"\n                , sinceVersion = Nothing\n                }\n          , argScope = ScopeTypeInvalid\n          , argClosure = -1\n          , argDestroy = -1\n          , argCallerAllocates = False\n          , transfer = TransferNothing\n          }\n      ]\n  , skipReturn = False\n  , callableThrows = True\n  , callableDeprecated = Nothing\n  , callableDocumentation =\n      Documentation\n        { rawDocText =\n            Just\n              \"Iterates over the diff calling @file_cb, @binary_cb, @hunk_cb and @line_cb.\\n\\nThe #GgitDiffFile mode always be 0, path will be %NULL and when a blob is\\n%NULL the oid will be 0.\\n\\nIf @diff_options is %NULL then the defaults specified in\\nggit_diff_options_new() are used.\"\n        , sinceVersion = Nothing\n        }\n  }"
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data DiffBlobsMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "blobs" Diff) => O.MethodInfo DiffBlobsMethodInfo o p where
    overloadedMethod = undefined
#endif