#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.OSTree.Structs.RepoFinderResult
(
RepoFinderResult(..) ,
newZeroRepoFinderResult ,
noRepoFinderResult ,
#if ENABLE_OVERLOADING
RepoFinderResultCompareMethodInfo ,
#endif
repoFinderResultCompare ,
#if ENABLE_OVERLOADING
RepoFinderResultDupMethodInfo ,
#endif
repoFinderResultDup ,
#if ENABLE_OVERLOADING
RepoFinderResultFreeMethodInfo ,
#endif
repoFinderResultFree ,
repoFinderResultFreev ,
clearRepoFinderResultFinder ,
getRepoFinderResultFinder ,
#if ENABLE_OVERLOADING
repoFinderResult_finder ,
#endif
setRepoFinderResultFinder ,
getRepoFinderResultPriority ,
#if ENABLE_OVERLOADING
repoFinderResult_priority ,
#endif
setRepoFinderResultPriority ,
clearRepoFinderResultRemote ,
getRepoFinderResultRemote ,
#if ENABLE_OVERLOADING
repoFinderResult_remote ,
#endif
setRepoFinderResultRemote ,
getRepoFinderResultSummaryLastModified ,
#if ENABLE_OVERLOADING
repoFinderResult_summaryLastModified ,
#endif
setRepoFinderResultSummaryLastModified ,
) 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.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 {-# SOURCE #-} qualified GI.OSTree.Interfaces.RepoFinder as OSTree.RepoFinder
import {-# SOURCE #-} qualified GI.OSTree.Structs.Remote as OSTree.Remote
newtype RepoFinderResult = RepoFinderResult (ManagedPtr RepoFinderResult)
foreign import ccall "ostree_repo_finder_result_get_type" c_ostree_repo_finder_result_get_type ::
IO GType
instance BoxedObject RepoFinderResult where
boxedType _ = c_ostree_repo_finder_result_get_type
newZeroRepoFinderResult :: MonadIO m => m RepoFinderResult
newZeroRepoFinderResult = liftIO $ callocBoxedBytes 72 >>= wrapBoxed RepoFinderResult
instance tag ~ 'AttrSet => Constructible RepoFinderResult tag where
new _ attrs = do
o <- newZeroRepoFinderResult
GI.Attributes.set o attrs
return o
noRepoFinderResult :: Maybe RepoFinderResult
noRepoFinderResult = Nothing
getRepoFinderResultRemote :: MonadIO m => RepoFinderResult -> m (Maybe OSTree.Remote.Remote)
getRepoFinderResultRemote s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (Ptr OSTree.Remote.Remote)
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- (newBoxed OSTree.Remote.Remote) val'
return val''
return result
setRepoFinderResultRemote :: MonadIO m => RepoFinderResult -> Ptr OSTree.Remote.Remote -> m ()
setRepoFinderResultRemote s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: Ptr OSTree.Remote.Remote)
clearRepoFinderResultRemote :: MonadIO m => RepoFinderResult -> m ()
clearRepoFinderResultRemote s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (FP.nullPtr :: Ptr OSTree.Remote.Remote)
#if ENABLE_OVERLOADING
data RepoFinderResultRemoteFieldInfo
instance AttrInfo RepoFinderResultRemoteFieldInfo where
type AttrAllowedOps RepoFinderResultRemoteFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint RepoFinderResultRemoteFieldInfo = (~) (Ptr OSTree.Remote.Remote)
type AttrBaseTypeConstraint RepoFinderResultRemoteFieldInfo = (~) RepoFinderResult
type AttrGetType RepoFinderResultRemoteFieldInfo = Maybe OSTree.Remote.Remote
type AttrLabel RepoFinderResultRemoteFieldInfo = "remote"
type AttrOrigin RepoFinderResultRemoteFieldInfo = RepoFinderResult
attrGet _ = getRepoFinderResultRemote
attrSet _ = setRepoFinderResultRemote
attrConstruct = undefined
attrClear _ = clearRepoFinderResultRemote
repoFinderResult_remote :: AttrLabelProxy "remote"
repoFinderResult_remote = AttrLabelProxy
#endif
getRepoFinderResultFinder :: MonadIO m => RepoFinderResult -> m (Maybe OSTree.RepoFinder.RepoFinder)
getRepoFinderResultFinder s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO (Ptr OSTree.RepoFinder.RepoFinder)
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- (newObject OSTree.RepoFinder.RepoFinder) val'
return val''
return result
setRepoFinderResultFinder :: MonadIO m => RepoFinderResult -> Ptr OSTree.RepoFinder.RepoFinder -> m ()
setRepoFinderResultFinder s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: Ptr OSTree.RepoFinder.RepoFinder)
clearRepoFinderResultFinder :: MonadIO m => RepoFinderResult -> m ()
clearRepoFinderResultFinder s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullPtr :: Ptr OSTree.RepoFinder.RepoFinder)
#if ENABLE_OVERLOADING
data RepoFinderResultFinderFieldInfo
instance AttrInfo RepoFinderResultFinderFieldInfo where
type AttrAllowedOps RepoFinderResultFinderFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint RepoFinderResultFinderFieldInfo = (~) (Ptr OSTree.RepoFinder.RepoFinder)
type AttrBaseTypeConstraint RepoFinderResultFinderFieldInfo = (~) RepoFinderResult
type AttrGetType RepoFinderResultFinderFieldInfo = Maybe OSTree.RepoFinder.RepoFinder
type AttrLabel RepoFinderResultFinderFieldInfo = "finder"
type AttrOrigin RepoFinderResultFinderFieldInfo = RepoFinderResult
attrGet _ = getRepoFinderResultFinder
attrSet _ = setRepoFinderResultFinder
attrConstruct = undefined
attrClear _ = clearRepoFinderResultFinder
repoFinderResult_finder :: AttrLabelProxy "finder"
repoFinderResult_finder = AttrLabelProxy
#endif
getRepoFinderResultPriority :: MonadIO m => RepoFinderResult -> m Int32
getRepoFinderResultPriority s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO Int32
return val
setRepoFinderResultPriority :: MonadIO m => RepoFinderResult -> Int32 -> m ()
setRepoFinderResultPriority s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: Int32)
#if ENABLE_OVERLOADING
data RepoFinderResultPriorityFieldInfo
instance AttrInfo RepoFinderResultPriorityFieldInfo where
type AttrAllowedOps RepoFinderResultPriorityFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint RepoFinderResultPriorityFieldInfo = (~) Int32
type AttrBaseTypeConstraint RepoFinderResultPriorityFieldInfo = (~) RepoFinderResult
type AttrGetType RepoFinderResultPriorityFieldInfo = Int32
type AttrLabel RepoFinderResultPriorityFieldInfo = "priority"
type AttrOrigin RepoFinderResultPriorityFieldInfo = RepoFinderResult
attrGet _ = getRepoFinderResultPriority
attrSet _ = setRepoFinderResultPriority
attrConstruct = undefined
attrClear _ = undefined
repoFinderResult_priority :: AttrLabelProxy "priority"
repoFinderResult_priority = AttrLabelProxy
#endif
getRepoFinderResultSummaryLastModified :: MonadIO m => RepoFinderResult -> m Word64
getRepoFinderResultSummaryLastModified s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 32) :: IO Word64
return val
setRepoFinderResultSummaryLastModified :: MonadIO m => RepoFinderResult -> Word64 -> m ()
setRepoFinderResultSummaryLastModified s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (val :: Word64)
#if ENABLE_OVERLOADING
data RepoFinderResultSummaryLastModifiedFieldInfo
instance AttrInfo RepoFinderResultSummaryLastModifiedFieldInfo where
type AttrAllowedOps RepoFinderResultSummaryLastModifiedFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint RepoFinderResultSummaryLastModifiedFieldInfo = (~) Word64
type AttrBaseTypeConstraint RepoFinderResultSummaryLastModifiedFieldInfo = (~) RepoFinderResult
type AttrGetType RepoFinderResultSummaryLastModifiedFieldInfo = Word64
type AttrLabel RepoFinderResultSummaryLastModifiedFieldInfo = "summary_last_modified"
type AttrOrigin RepoFinderResultSummaryLastModifiedFieldInfo = RepoFinderResult
attrGet _ = getRepoFinderResultSummaryLastModified
attrSet _ = setRepoFinderResultSummaryLastModified
attrConstruct = undefined
attrClear _ = undefined
repoFinderResult_summaryLastModified :: AttrLabelProxy "summaryLastModified"
repoFinderResult_summaryLastModified = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList RepoFinderResult
type instance O.AttributeList RepoFinderResult = RepoFinderResultAttributeList
type RepoFinderResultAttributeList = ('[ '("remote", RepoFinderResultRemoteFieldInfo), '("finder", RepoFinderResultFinderFieldInfo), '("priority", RepoFinderResultPriorityFieldInfo), '("summaryLastModified", RepoFinderResultSummaryLastModifiedFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "ostree_repo_finder_result_compare" ostree_repo_finder_result_compare ::
Ptr RepoFinderResult ->
Ptr RepoFinderResult ->
IO Int32
repoFinderResultCompare ::
(B.CallStack.HasCallStack, MonadIO m) =>
RepoFinderResult
-> RepoFinderResult
-> m Int32
repoFinderResultCompare a b = liftIO $ do
a' <- unsafeManagedPtrGetPtr a
b' <- unsafeManagedPtrGetPtr b
result <- ostree_repo_finder_result_compare a' b'
touchManagedPtr a
touchManagedPtr b
return result
#if ENABLE_OVERLOADING
data RepoFinderResultCompareMethodInfo
instance (signature ~ (RepoFinderResult -> m Int32), MonadIO m) => O.MethodInfo RepoFinderResultCompareMethodInfo RepoFinderResult signature where
overloadedMethod _ = repoFinderResultCompare
#endif
foreign import ccall "ostree_repo_finder_result_dup" ostree_repo_finder_result_dup ::
Ptr RepoFinderResult ->
IO (Ptr RepoFinderResult)
repoFinderResultDup ::
(B.CallStack.HasCallStack, MonadIO m) =>
RepoFinderResult
-> m RepoFinderResult
repoFinderResultDup result_ = liftIO $ do
result_' <- unsafeManagedPtrGetPtr result_
result <- ostree_repo_finder_result_dup result_'
checkUnexpectedReturnNULL "repoFinderResultDup" result
result' <- (wrapBoxed RepoFinderResult) result
touchManagedPtr result_
return result'
#if ENABLE_OVERLOADING
data RepoFinderResultDupMethodInfo
instance (signature ~ (m RepoFinderResult), MonadIO m) => O.MethodInfo RepoFinderResultDupMethodInfo RepoFinderResult signature where
overloadedMethod _ = repoFinderResultDup
#endif
foreign import ccall "ostree_repo_finder_result_free" ostree_repo_finder_result_free ::
Ptr RepoFinderResult ->
IO ()
repoFinderResultFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
RepoFinderResult
-> m ()
repoFinderResultFree result_ = liftIO $ do
result_' <- B.ManagedPtr.disownBoxed result_
ostree_repo_finder_result_free result_'
touchManagedPtr result_
return ()
#if ENABLE_OVERLOADING
data RepoFinderResultFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo RepoFinderResultFreeMethodInfo RepoFinderResult signature where
overloadedMethod _ = repoFinderResultFree
#endif
foreign import ccall "ostree_repo_finder_result_freev" ostree_repo_finder_result_freev ::
Ptr (Ptr RepoFinderResult) ->
IO ()
repoFinderResultFreev ::
(B.CallStack.HasCallStack, MonadIO m) =>
[RepoFinderResult]
-> m ()
repoFinderResultFreev results = liftIO $ do
results' <- mapM B.ManagedPtr.disownBoxed results
results'' <- packZeroTerminatedPtrArray results'
ostree_repo_finder_result_freev results''
mapM_ touchManagedPtr results
return ()
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
type family ResolveRepoFinderResultMethod (t :: Symbol) (o :: *) :: * where
ResolveRepoFinderResultMethod "compare" o = RepoFinderResultCompareMethodInfo
ResolveRepoFinderResultMethod "dup" o = RepoFinderResultDupMethodInfo
ResolveRepoFinderResultMethod "free" o = RepoFinderResultFreeMethodInfo
ResolveRepoFinderResultMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveRepoFinderResultMethod t RepoFinderResult, O.MethodInfo info RepoFinderResult p) => OL.IsLabel t (RepoFinderResult -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif