{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- /No description available in the introspection data./

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

module GI.OSTree.Structs.RepoDevInoCache
    ( 

-- * Exported types
    RepoDevInoCache(..)                     ,


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

#if defined(ENABLE_OVERLOADING)
    ResolveRepoDevInoCacheMethod            ,
#endif


-- ** new #method:new#

    repoDevInoCacheNew                      ,


-- ** ref #method:ref#

#if defined(ENABLE_OVERLOADING)
    RepoDevInoCacheRefMethodInfo            ,
#endif
    repoDevInoCacheRef                      ,


-- ** unref #method:unref#

#if defined(ENABLE_OVERLOADING)
    RepoDevInoCacheUnrefMethodInfo          ,
#endif
    repoDevInoCacheUnref                    ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL


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

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

foreign import ccall "ostree_repo_devino_cache_get_type" c_ostree_repo_devino_cache_get_type :: 
    IO GType

type instance O.ParentTypes RepoDevInoCache = '[]
instance O.HasParentTypes RepoDevInoCache

instance B.Types.TypedObject RepoDevInoCache where
    glibType :: IO GType
glibType = IO GType
c_ostree_repo_devino_cache_get_type

instance B.Types.GBoxed RepoDevInoCache

-- | Convert 'RepoDevInoCache' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue RepoDevInoCache where
    toGValue :: RepoDevInoCache -> IO GValue
toGValue RepoDevInoCache
o = do
        GType
gtype <- IO GType
c_ostree_repo_devino_cache_get_type
        RepoDevInoCache -> (Ptr RepoDevInoCache -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr RepoDevInoCache
o (GType
-> (GValue -> Ptr RepoDevInoCache -> IO ())
-> Ptr RepoDevInoCache
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr RepoDevInoCache -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
        
    fromGValue :: GValue -> IO RepoDevInoCache
fromGValue GValue
gv = do
        Ptr RepoDevInoCache
ptr <- GValue -> IO (Ptr RepoDevInoCache)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr RepoDevInoCache)
        (ManagedPtr RepoDevInoCache -> RepoDevInoCache)
-> Ptr RepoDevInoCache -> IO RepoDevInoCache
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr RepoDevInoCache -> RepoDevInoCache
RepoDevInoCache Ptr RepoDevInoCache
ptr
        
    


#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList RepoDevInoCache
type instance O.AttributeList RepoDevInoCache = RepoDevInoCacheAttributeList
type RepoDevInoCacheAttributeList = ('[ ] :: [(Symbol, *)])
#endif

-- method RepoDevInoCache::new
-- method type : Constructor
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "OSTree" , name = "RepoDevInoCache" })
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_devino_cache_new" ostree_repo_devino_cache_new :: 
    IO (Ptr RepoDevInoCache)

-- | OSTree has support for pairing @/ostree_repo_checkout_tree_at()/@ using
-- hardlinks in combination with a later
-- 'GI.OSTree.Objects.Repo.repoWriteDirectoryToMtree' using a (normally modified)
-- directory.  In order for OSTree to optimally detect just the new
-- files, use this function and fill in the @devino_to_csum_cache@
-- member of @OstreeRepoCheckoutAtOptions@, then call
-- @/ostree_repo_commit_set_devino_cache()/@.
repoDevInoCacheNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m RepoDevInoCache
    -- ^ __Returns:__ Newly allocated cache
repoDevInoCacheNew :: m RepoDevInoCache
repoDevInoCacheNew  = IO RepoDevInoCache -> m RepoDevInoCache
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RepoDevInoCache -> m RepoDevInoCache)
-> IO RepoDevInoCache -> m RepoDevInoCache
forall a b. (a -> b) -> a -> b
$ do
    Ptr RepoDevInoCache
result <- IO (Ptr RepoDevInoCache)
ostree_repo_devino_cache_new
    Text -> Ptr RepoDevInoCache -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"repoDevInoCacheNew" Ptr RepoDevInoCache
result
    RepoDevInoCache
result' <- ((ManagedPtr RepoDevInoCache -> RepoDevInoCache)
-> Ptr RepoDevInoCache -> IO RepoDevInoCache
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr RepoDevInoCache -> RepoDevInoCache
RepoDevInoCache) Ptr RepoDevInoCache
result
    RepoDevInoCache -> IO RepoDevInoCache
forall (m :: * -> *) a. Monad m => a -> m a
return RepoDevInoCache
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method RepoDevInoCache::ref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "cache"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoDevInoCache" }
--           , 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 = "OSTree" , name = "RepoDevInoCache" })
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_devino_cache_ref" ostree_repo_devino_cache_ref :: 
    Ptr RepoDevInoCache ->                  -- cache : TInterface (Name {namespace = "OSTree", name = "RepoDevInoCache"})
    IO (Ptr RepoDevInoCache)

-- | /No description available in the introspection data./
repoDevInoCacheRef ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RepoDevInoCache
    -> m RepoDevInoCache
repoDevInoCacheRef :: RepoDevInoCache -> m RepoDevInoCache
repoDevInoCacheRef RepoDevInoCache
cache = IO RepoDevInoCache -> m RepoDevInoCache
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RepoDevInoCache -> m RepoDevInoCache)
-> IO RepoDevInoCache -> m RepoDevInoCache
forall a b. (a -> b) -> a -> b
$ do
    Ptr RepoDevInoCache
cache' <- RepoDevInoCache -> IO (Ptr RepoDevInoCache)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RepoDevInoCache
cache
    Ptr RepoDevInoCache
result <- Ptr RepoDevInoCache -> IO (Ptr RepoDevInoCache)
ostree_repo_devino_cache_ref Ptr RepoDevInoCache
cache'
    Text -> Ptr RepoDevInoCache -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"repoDevInoCacheRef" Ptr RepoDevInoCache
result
    RepoDevInoCache
result' <- ((ManagedPtr RepoDevInoCache -> RepoDevInoCache)
-> Ptr RepoDevInoCache -> IO RepoDevInoCache
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr RepoDevInoCache -> RepoDevInoCache
RepoDevInoCache) Ptr RepoDevInoCache
result
    RepoDevInoCache -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RepoDevInoCache
cache
    RepoDevInoCache -> IO RepoDevInoCache
forall (m :: * -> *) a. Monad m => a -> m a
return RepoDevInoCache
result'

#if defined(ENABLE_OVERLOADING)
data RepoDevInoCacheRefMethodInfo
instance (signature ~ (m RepoDevInoCache), MonadIO m) => O.MethodInfo RepoDevInoCacheRefMethodInfo RepoDevInoCache signature where
    overloadedMethod = repoDevInoCacheRef

#endif

-- method RepoDevInoCache::unref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "cache"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoDevInoCache" }
--           , 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 "ostree_repo_devino_cache_unref" ostree_repo_devino_cache_unref :: 
    Ptr RepoDevInoCache ->                  -- cache : TInterface (Name {namespace = "OSTree", name = "RepoDevInoCache"})
    IO ()

-- | /No description available in the introspection data./
repoDevInoCacheUnref ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RepoDevInoCache
    -> m ()
repoDevInoCacheUnref :: RepoDevInoCache -> m ()
repoDevInoCacheUnref RepoDevInoCache
cache = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr RepoDevInoCache
cache' <- RepoDevInoCache -> IO (Ptr RepoDevInoCache)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RepoDevInoCache
cache
    Ptr RepoDevInoCache -> IO ()
ostree_repo_devino_cache_unref Ptr RepoDevInoCache
cache'
    RepoDevInoCache -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RepoDevInoCache
cache
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data RepoDevInoCacheUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo RepoDevInoCacheUnrefMethodInfo RepoDevInoCache signature where
    overloadedMethod = repoDevInoCacheUnref

#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveRepoDevInoCacheMethod (t :: Symbol) (o :: *) :: * where
    ResolveRepoDevInoCacheMethod "ref" o = RepoDevInoCacheRefMethodInfo
    ResolveRepoDevInoCacheMethod "unref" o = RepoDevInoCacheUnrefMethodInfo
    ResolveRepoDevInoCacheMethod l o = O.MethodResolutionFailed l o

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

#endif