{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.OSTree.Objects.Repo
(
#if defined(ENABLE_OVERLOADING)
RepoListCollectionRefsMethodInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
RepoListCommitObjectsStartingWithMethodInfo,
#endif
#if defined(ENABLE_OVERLOADING)
RepoListObjectsMethodInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
RepoListRefsMethodInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
RepoListRefsExtMethodInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
RepoRemoteListCollectionRefsMethodInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
RepoRemoteListRefsMethodInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
RepoTraverseCommitMethodInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
RepoTraverseReachableRefsMethodInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
RepoTraverseNewParentsMethodInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
RepoTraverseNewReachableMethodInfo ,
#endif
Repo(..) ,
IsRepo ,
toRepo ,
noRepo ,
#if defined(ENABLE_OVERLOADING)
ResolveRepoMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
RepoAbortTransactionMethodInfo ,
#endif
repoAbortTransaction ,
#if defined(ENABLE_OVERLOADING)
RepoAddGpgSignatureSummaryMethodInfo ,
#endif
repoAddGpgSignatureSummary ,
#if defined(ENABLE_OVERLOADING)
RepoAppendGpgSignatureMethodInfo ,
#endif
repoAppendGpgSignature ,
#if defined(ENABLE_OVERLOADING)
RepoCheckoutAtMethodInfo ,
#endif
repoCheckoutAt ,
#if defined(ENABLE_OVERLOADING)
RepoCheckoutGcMethodInfo ,
#endif
repoCheckoutGc ,
#if defined(ENABLE_OVERLOADING)
RepoCheckoutTreeMethodInfo ,
#endif
repoCheckoutTree ,
#if defined(ENABLE_OVERLOADING)
RepoCommitTransactionMethodInfo ,
#endif
repoCommitTransaction ,
#if defined(ENABLE_OVERLOADING)
RepoCopyConfigMethodInfo ,
#endif
repoCopyConfig ,
#if defined(ENABLE_OVERLOADING)
RepoCreateMethodInfo ,
#endif
repoCreate ,
repoCreateAt ,
#if defined(ENABLE_OVERLOADING)
RepoDeleteObjectMethodInfo ,
#endif
repoDeleteObject ,
#if defined(ENABLE_OVERLOADING)
RepoEqualMethodInfo ,
#endif
repoEqual ,
#if defined(ENABLE_OVERLOADING)
RepoFindRemotesAsyncMethodInfo ,
#endif
repoFindRemotesAsync ,
#if defined(ENABLE_OVERLOADING)
RepoFindRemotesFinishMethodInfo ,
#endif
repoFindRemotesFinish ,
#if defined(ENABLE_OVERLOADING)
RepoFsckObjectMethodInfo ,
#endif
repoFsckObject ,
#if defined(ENABLE_OVERLOADING)
RepoGetBootloaderMethodInfo ,
#endif
repoGetBootloader ,
#if defined(ENABLE_OVERLOADING)
RepoGetCollectionIdMethodInfo ,
#endif
repoGetCollectionId ,
#if defined(ENABLE_OVERLOADING)
RepoGetConfigMethodInfo ,
#endif
repoGetConfig ,
#if defined(ENABLE_OVERLOADING)
RepoGetDefaultRepoFindersMethodInfo ,
#endif
repoGetDefaultRepoFinders ,
#if defined(ENABLE_OVERLOADING)
RepoGetDfdMethodInfo ,
#endif
repoGetDfd ,
#if defined(ENABLE_OVERLOADING)
RepoGetDisableFsyncMethodInfo ,
#endif
repoGetDisableFsync ,
#if defined(ENABLE_OVERLOADING)
RepoGetMinFreeSpaceBytesMethodInfo ,
#endif
repoGetMinFreeSpaceBytes ,
#if defined(ENABLE_OVERLOADING)
RepoGetModeMethodInfo ,
#endif
repoGetMode ,
#if defined(ENABLE_OVERLOADING)
RepoGetParentMethodInfo ,
#endif
repoGetParent ,
#if defined(ENABLE_OVERLOADING)
RepoGetPathMethodInfo ,
#endif
repoGetPath ,
#if defined(ENABLE_OVERLOADING)
RepoGetRemoteBooleanOptionMethodInfo ,
#endif
repoGetRemoteBooleanOption ,
#if defined(ENABLE_OVERLOADING)
RepoGetRemoteListOptionMethodInfo ,
#endif
repoGetRemoteListOption ,
#if defined(ENABLE_OVERLOADING)
RepoGetRemoteOptionMethodInfo ,
#endif
repoGetRemoteOption ,
#if defined(ENABLE_OVERLOADING)
RepoGpgVerifyDataMethodInfo ,
#endif
repoGpgVerifyData ,
#if defined(ENABLE_OVERLOADING)
RepoHasObjectMethodInfo ,
#endif
repoHasObject ,
#if defined(ENABLE_OVERLOADING)
RepoHashMethodInfo ,
#endif
repoHash ,
#if defined(ENABLE_OVERLOADING)
RepoImportObjectFromMethodInfo ,
#endif
repoImportObjectFrom ,
#if defined(ENABLE_OVERLOADING)
RepoImportObjectFromWithTrustMethodInfo ,
#endif
repoImportObjectFromWithTrust ,
#if defined(ENABLE_OVERLOADING)
RepoIsSystemMethodInfo ,
#endif
repoIsSystem ,
#if defined(ENABLE_OVERLOADING)
RepoIsWritableMethodInfo ,
#endif
repoIsWritable ,
#if defined(ENABLE_OVERLOADING)
RepoListStaticDeltaNamesMethodInfo ,
#endif
repoListStaticDeltaNames ,
#if defined(ENABLE_OVERLOADING)
RepoLoadCommitMethodInfo ,
#endif
repoLoadCommit ,
#if defined(ENABLE_OVERLOADING)
RepoLoadFileMethodInfo ,
#endif
repoLoadFile ,
#if defined(ENABLE_OVERLOADING)
RepoLoadObjectStreamMethodInfo ,
#endif
repoLoadObjectStream ,
#if defined(ENABLE_OVERLOADING)
RepoLoadVariantMethodInfo ,
#endif
repoLoadVariant ,
#if defined(ENABLE_OVERLOADING)
RepoLoadVariantIfExistsMethodInfo ,
#endif
repoLoadVariantIfExists ,
#if defined(ENABLE_OVERLOADING)
RepoMarkCommitPartialMethodInfo ,
#endif
repoMarkCommitPartial ,
repoModeFromString ,
repoNew ,
repoNewDefault ,
repoNewForSysrootPath ,
#if defined(ENABLE_OVERLOADING)
RepoOpenMethodInfo ,
#endif
repoOpen ,
repoOpenAt ,
#if defined(ENABLE_OVERLOADING)
RepoPrepareTransactionMethodInfo ,
#endif
repoPrepareTransaction ,
#if defined(ENABLE_OVERLOADING)
RepoPruneMethodInfo ,
#endif
repoPrune ,
#if defined(ENABLE_OVERLOADING)
RepoPruneFromReachableMethodInfo ,
#endif
repoPruneFromReachable ,
#if defined(ENABLE_OVERLOADING)
RepoPruneStaticDeltasMethodInfo ,
#endif
repoPruneStaticDeltas ,
#if defined(ENABLE_OVERLOADING)
RepoPullMethodInfo ,
#endif
repoPull ,
repoPullDefaultConsoleProgressChanged ,
#if defined(ENABLE_OVERLOADING)
RepoPullFromRemotesAsyncMethodInfo ,
#endif
repoPullFromRemotesAsync ,
#if defined(ENABLE_OVERLOADING)
RepoPullFromRemotesFinishMethodInfo ,
#endif
repoPullFromRemotesFinish ,
#if defined(ENABLE_OVERLOADING)
RepoPullOneDirMethodInfo ,
#endif
repoPullOneDir ,
#if defined(ENABLE_OVERLOADING)
RepoPullWithOptionsMethodInfo ,
#endif
repoPullWithOptions ,
#if defined(ENABLE_OVERLOADING)
RepoQueryObjectStorageSizeMethodInfo ,
#endif
repoQueryObjectStorageSize ,
#if defined(ENABLE_OVERLOADING)
RepoReadCommitMethodInfo ,
#endif
repoReadCommit ,
#if defined(ENABLE_OVERLOADING)
RepoReadCommitDetachedMetadataMethodInfo,
#endif
repoReadCommitDetachedMetadata ,
#if defined(ENABLE_OVERLOADING)
RepoRegenerateSummaryMethodInfo ,
#endif
repoRegenerateSummary ,
#if defined(ENABLE_OVERLOADING)
RepoReloadConfigMethodInfo ,
#endif
repoReloadConfig ,
#if defined(ENABLE_OVERLOADING)
RepoRemoteAddMethodInfo ,
#endif
repoRemoteAdd ,
#if defined(ENABLE_OVERLOADING)
RepoRemoteChangeMethodInfo ,
#endif
repoRemoteChange ,
#if defined(ENABLE_OVERLOADING)
RepoRemoteDeleteMethodInfo ,
#endif
repoRemoteDelete ,
#if defined(ENABLE_OVERLOADING)
RepoRemoteFetchSummaryMethodInfo ,
#endif
repoRemoteFetchSummary ,
#if defined(ENABLE_OVERLOADING)
RepoRemoteFetchSummaryWithOptionsMethodInfo,
#endif
repoRemoteFetchSummaryWithOptions ,
#if defined(ENABLE_OVERLOADING)
RepoRemoteGetGpgVerifyMethodInfo ,
#endif
repoRemoteGetGpgVerify ,
#if defined(ENABLE_OVERLOADING)
RepoRemoteGetGpgVerifySummaryMethodInfo ,
#endif
repoRemoteGetGpgVerifySummary ,
#if defined(ENABLE_OVERLOADING)
RepoRemoteGetUrlMethodInfo ,
#endif
repoRemoteGetUrl ,
#if defined(ENABLE_OVERLOADING)
RepoRemoteGpgImportMethodInfo ,
#endif
repoRemoteGpgImport ,
#if defined(ENABLE_OVERLOADING)
RepoRemoteListMethodInfo ,
#endif
repoRemoteList ,
#if defined(ENABLE_OVERLOADING)
RepoResolveCollectionRefMethodInfo ,
#endif
repoResolveCollectionRef ,
#if defined(ENABLE_OVERLOADING)
RepoResolveKeyringForCollectionMethodInfo,
#endif
repoResolveKeyringForCollection ,
#if defined(ENABLE_OVERLOADING)
RepoResolveRevMethodInfo ,
#endif
repoResolveRev ,
#if defined(ENABLE_OVERLOADING)
RepoResolveRevExtMethodInfo ,
#endif
repoResolveRevExt ,
#if defined(ENABLE_OVERLOADING)
RepoScanHardlinksMethodInfo ,
#endif
repoScanHardlinks ,
#if defined(ENABLE_OVERLOADING)
RepoSetAliasRefImmediateMethodInfo ,
#endif
repoSetAliasRefImmediate ,
#if defined(ENABLE_OVERLOADING)
RepoSetCacheDirMethodInfo ,
#endif
repoSetCacheDir ,
#if defined(ENABLE_OVERLOADING)
RepoSetCollectionIdMethodInfo ,
#endif
repoSetCollectionId ,
#if defined(ENABLE_OVERLOADING)
RepoSetCollectionRefImmediateMethodInfo ,
#endif
repoSetCollectionRefImmediate ,
#if defined(ENABLE_OVERLOADING)
RepoSetDisableFsyncMethodInfo ,
#endif
repoSetDisableFsync ,
#if defined(ENABLE_OVERLOADING)
RepoSetRefImmediateMethodInfo ,
#endif
repoSetRefImmediate ,
#if defined(ENABLE_OVERLOADING)
RepoSignCommitMethodInfo ,
#endif
repoSignCommit ,
#if defined(ENABLE_OVERLOADING)
RepoSignDeltaMethodInfo ,
#endif
repoSignDelta ,
#if defined(ENABLE_OVERLOADING)
RepoStaticDeltaExecuteOfflineMethodInfo ,
#endif
repoStaticDeltaExecuteOffline ,
#if defined(ENABLE_OVERLOADING)
RepoStaticDeltaGenerateMethodInfo ,
#endif
repoStaticDeltaGenerate ,
#if defined(ENABLE_OVERLOADING)
RepoTransactionSetCollectionRefMethodInfo,
#endif
repoTransactionSetCollectionRef ,
#if defined(ENABLE_OVERLOADING)
RepoTransactionSetRefMethodInfo ,
#endif
repoTransactionSetRef ,
#if defined(ENABLE_OVERLOADING)
RepoTransactionSetRefspecMethodInfo ,
#endif
repoTransactionSetRefspec ,
repoTraverseParentsGetCommits ,
#if defined(ENABLE_OVERLOADING)
RepoVerifyCommitMethodInfo ,
#endif
repoVerifyCommit ,
#if defined(ENABLE_OVERLOADING)
RepoVerifyCommitExtMethodInfo ,
#endif
repoVerifyCommitExt ,
#if defined(ENABLE_OVERLOADING)
RepoVerifyCommitForRemoteMethodInfo ,
#endif
repoVerifyCommitForRemote ,
#if defined(ENABLE_OVERLOADING)
RepoVerifySummaryMethodInfo ,
#endif
repoVerifySummary ,
#if defined(ENABLE_OVERLOADING)
RepoWriteArchiveToMtreeMethodInfo ,
#endif
repoWriteArchiveToMtree ,
#if defined(ENABLE_OVERLOADING)
RepoWriteCommitMethodInfo ,
#endif
repoWriteCommit ,
#if defined(ENABLE_OVERLOADING)
RepoWriteCommitDetachedMetadataMethodInfo,
#endif
repoWriteCommitDetachedMetadata ,
#if defined(ENABLE_OVERLOADING)
RepoWriteCommitWithTimeMethodInfo ,
#endif
repoWriteCommitWithTime ,
#if defined(ENABLE_OVERLOADING)
RepoWriteConfigMethodInfo ,
#endif
repoWriteConfig ,
#if defined(ENABLE_OVERLOADING)
RepoWriteContentMethodInfo ,
#endif
repoWriteContent ,
#if defined(ENABLE_OVERLOADING)
RepoWriteContentAsyncMethodInfo ,
#endif
repoWriteContentAsync ,
#if defined(ENABLE_OVERLOADING)
RepoWriteContentFinishMethodInfo ,
#endif
repoWriteContentFinish ,
#if defined(ENABLE_OVERLOADING)
RepoWriteContentTrustedMethodInfo ,
#endif
repoWriteContentTrusted ,
#if defined(ENABLE_OVERLOADING)
RepoWriteDfdToMtreeMethodInfo ,
#endif
repoWriteDfdToMtree ,
#if defined(ENABLE_OVERLOADING)
RepoWriteDirectoryToMtreeMethodInfo ,
#endif
repoWriteDirectoryToMtree ,
#if defined(ENABLE_OVERLOADING)
RepoWriteMetadataMethodInfo ,
#endif
repoWriteMetadata ,
#if defined(ENABLE_OVERLOADING)
RepoWriteMetadataAsyncMethodInfo ,
#endif
repoWriteMetadataAsync ,
#if defined(ENABLE_OVERLOADING)
RepoWriteMetadataFinishMethodInfo ,
#endif
repoWriteMetadataFinish ,
#if defined(ENABLE_OVERLOADING)
RepoWriteMetadataStreamTrustedMethodInfo,
#endif
repoWriteMetadataStreamTrusted ,
#if defined(ENABLE_OVERLOADING)
RepoWriteMetadataTrustedMethodInfo ,
#endif
repoWriteMetadataTrusted ,
#if defined(ENABLE_OVERLOADING)
RepoWriteMtreeMethodInfo ,
#endif
repoWriteMtree ,
#if defined(ENABLE_OVERLOADING)
RepoPathPropertyInfo ,
#endif
constructRepoPath ,
getRepoPath ,
#if defined(ENABLE_OVERLOADING)
repoPath ,
#endif
#if defined(ENABLE_OVERLOADING)
RepoRemotesConfigDirPropertyInfo ,
#endif
constructRepoRemotesConfigDir ,
getRepoRemotesConfigDir ,
#if defined(ENABLE_OVERLOADING)
repoRemotesConfigDir ,
#endif
#if defined(ENABLE_OVERLOADING)
RepoSysrootPathPropertyInfo ,
#endif
constructRepoSysrootPath ,
getRepoSysrootPath ,
#if defined(ENABLE_OVERLOADING)
repoSysrootPath ,
#endif
C_RepoGpgVerifyResultCallback ,
RepoGpgVerifyResultCallback ,
#if defined(ENABLE_OVERLOADING)
RepoGpgVerifyResultSignalInfo ,
#endif
afterRepoGpgVerifyResult ,
genClosure_RepoGpgVerifyResult ,
mk_RepoGpgVerifyResultCallback ,
noRepoGpgVerifyResultCallback ,
onRepoGpgVerifyResult ,
wrap_RepoGpgVerifyResultCallback ,
) 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.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.KeyFile as GLib.KeyFile
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.FileInfo as Gio.FileInfo
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import {-# SOURCE #-} qualified GI.OSTree.Enums as OSTree.Enums
import {-# SOURCE #-} qualified GI.OSTree.Flags as OSTree.Flags
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.RepoFinder as OSTree.RepoFinder
import {-# SOURCE #-} qualified GI.OSTree.Objects.AsyncProgress as OSTree.AsyncProgress
import {-# SOURCE #-} qualified GI.OSTree.Objects.GpgVerifyResult as OSTree.GpgVerifyResult
import {-# SOURCE #-} qualified GI.OSTree.Objects.MutableTree as OSTree.MutableTree
import {-# SOURCE #-} qualified GI.OSTree.Objects.RepoFile as OSTree.RepoFile
import {-# SOURCE #-} qualified GI.OSTree.Structs.CollectionRef as OSTree.CollectionRef
import {-# SOURCE #-} qualified GI.OSTree.Structs.Remote as OSTree.Remote
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoCheckoutAtOptions as OSTree.RepoCheckoutAtOptions
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoCommitModifier as OSTree.RepoCommitModifier
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoFinderResult as OSTree.RepoFinderResult
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoPruneOptions as OSTree.RepoPruneOptions
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoTransactionStats as OSTree.RepoTransactionStats
newtype Repo = Repo (ManagedPtr Repo)
deriving (Repo -> Repo -> Bool
(Repo -> Repo -> Bool) -> (Repo -> Repo -> Bool) -> Eq Repo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Repo -> Repo -> Bool
$c/= :: Repo -> Repo -> Bool
== :: Repo -> Repo -> Bool
$c== :: Repo -> Repo -> Bool
Eq)
foreign import ccall "ostree_repo_get_type"
c_ostree_repo_get_type :: IO GType
instance GObject Repo where
gobjectType :: IO GType
gobjectType = IO GType
c_ostree_repo_get_type
instance B.GValue.IsGValue Repo where
toGValue :: Repo -> IO GValue
toGValue o :: Repo
o = do
GType
gtype <- IO GType
c_ostree_repo_get_type
Repo -> (Ptr Repo -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Repo
o (GType -> (GValue -> Ptr Repo -> IO ()) -> Ptr Repo -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Repo -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Repo
fromGValue gv :: GValue
gv = do
Ptr Repo
ptr <- GValue -> IO (Ptr Repo)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Repo)
(ManagedPtr Repo -> Repo) -> Ptr Repo -> IO Repo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Repo -> Repo
Repo Ptr Repo
ptr
class (GObject o, O.IsDescendantOf Repo o) => IsRepo o
instance (GObject o, O.IsDescendantOf Repo o) => IsRepo o
instance O.HasParentTypes Repo
type instance O.ParentTypes Repo = '[GObject.Object.Object]
toRepo :: (MonadIO m, IsRepo o) => o -> m Repo
toRepo :: o -> m Repo
toRepo = IO Repo -> m Repo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Repo -> m Repo) -> (o -> IO Repo) -> o -> m Repo
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Repo -> Repo) -> o -> IO Repo
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Repo -> Repo
Repo
noRepo :: Maybe Repo
noRepo :: Maybe Repo
noRepo = Maybe Repo
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveRepoMethod (t :: Symbol) (o :: *) :: * where
ResolveRepoMethod "abortTransaction" o = RepoAbortTransactionMethodInfo
ResolveRepoMethod "addGpgSignatureSummary" o = RepoAddGpgSignatureSummaryMethodInfo
ResolveRepoMethod "appendGpgSignature" o = RepoAppendGpgSignatureMethodInfo
ResolveRepoMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveRepoMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveRepoMethod "checkoutAt" o = RepoCheckoutAtMethodInfo
ResolveRepoMethod "checkoutGc" o = RepoCheckoutGcMethodInfo
ResolveRepoMethod "checkoutTree" o = RepoCheckoutTreeMethodInfo
ResolveRepoMethod "commitTransaction" o = RepoCommitTransactionMethodInfo
ResolveRepoMethod "copyConfig" o = RepoCopyConfigMethodInfo
ResolveRepoMethod "create" o = RepoCreateMethodInfo
ResolveRepoMethod "deleteObject" o = RepoDeleteObjectMethodInfo
ResolveRepoMethod "equal" o = RepoEqualMethodInfo
ResolveRepoMethod "findRemotesAsync" o = RepoFindRemotesAsyncMethodInfo
ResolveRepoMethod "findRemotesFinish" o = RepoFindRemotesFinishMethodInfo
ResolveRepoMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveRepoMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveRepoMethod "fsckObject" o = RepoFsckObjectMethodInfo
ResolveRepoMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveRepoMethod "gpgVerifyData" o = RepoGpgVerifyDataMethodInfo
ResolveRepoMethod "hasObject" o = RepoHasObjectMethodInfo
ResolveRepoMethod "hash" o = RepoHashMethodInfo
ResolveRepoMethod "importObjectFrom" o = RepoImportObjectFromMethodInfo
ResolveRepoMethod "importObjectFromWithTrust" o = RepoImportObjectFromWithTrustMethodInfo
ResolveRepoMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveRepoMethod "isSystem" o = RepoIsSystemMethodInfo
ResolveRepoMethod "isWritable" o = RepoIsWritableMethodInfo
ResolveRepoMethod "listCollectionRefs" o = RepoListCollectionRefsMethodInfo
ResolveRepoMethod "listCommitObjectsStartingWith" o = RepoListCommitObjectsStartingWithMethodInfo
ResolveRepoMethod "listObjects" o = RepoListObjectsMethodInfo
ResolveRepoMethod "listRefs" o = RepoListRefsMethodInfo
ResolveRepoMethod "listRefsExt" o = RepoListRefsExtMethodInfo
ResolveRepoMethod "listStaticDeltaNames" o = RepoListStaticDeltaNamesMethodInfo
ResolveRepoMethod "loadCommit" o = RepoLoadCommitMethodInfo
ResolveRepoMethod "loadFile" o = RepoLoadFileMethodInfo
ResolveRepoMethod "loadObjectStream" o = RepoLoadObjectStreamMethodInfo
ResolveRepoMethod "loadVariant" o = RepoLoadVariantMethodInfo
ResolveRepoMethod "loadVariantIfExists" o = RepoLoadVariantIfExistsMethodInfo
ResolveRepoMethod "markCommitPartial" o = RepoMarkCommitPartialMethodInfo
ResolveRepoMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveRepoMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveRepoMethod "open" o = RepoOpenMethodInfo
ResolveRepoMethod "prepareTransaction" o = RepoPrepareTransactionMethodInfo
ResolveRepoMethod "prune" o = RepoPruneMethodInfo
ResolveRepoMethod "pruneFromReachable" o = RepoPruneFromReachableMethodInfo
ResolveRepoMethod "pruneStaticDeltas" o = RepoPruneStaticDeltasMethodInfo
ResolveRepoMethod "pull" o = RepoPullMethodInfo
ResolveRepoMethod "pullFromRemotesAsync" o = RepoPullFromRemotesAsyncMethodInfo
ResolveRepoMethod "pullFromRemotesFinish" o = RepoPullFromRemotesFinishMethodInfo
ResolveRepoMethod "pullOneDir" o = RepoPullOneDirMethodInfo
ResolveRepoMethod "pullWithOptions" o = RepoPullWithOptionsMethodInfo
ResolveRepoMethod "queryObjectStorageSize" o = RepoQueryObjectStorageSizeMethodInfo
ResolveRepoMethod "readCommit" o = RepoReadCommitMethodInfo
ResolveRepoMethod "readCommitDetachedMetadata" o = RepoReadCommitDetachedMetadataMethodInfo
ResolveRepoMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveRepoMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveRepoMethod "regenerateSummary" o = RepoRegenerateSummaryMethodInfo
ResolveRepoMethod "reloadConfig" o = RepoReloadConfigMethodInfo
ResolveRepoMethod "remoteAdd" o = RepoRemoteAddMethodInfo
ResolveRepoMethod "remoteChange" o = RepoRemoteChangeMethodInfo
ResolveRepoMethod "remoteDelete" o = RepoRemoteDeleteMethodInfo
ResolveRepoMethod "remoteFetchSummary" o = RepoRemoteFetchSummaryMethodInfo
ResolveRepoMethod "remoteFetchSummaryWithOptions" o = RepoRemoteFetchSummaryWithOptionsMethodInfo
ResolveRepoMethod "remoteGetGpgVerify" o = RepoRemoteGetGpgVerifyMethodInfo
ResolveRepoMethod "remoteGetGpgVerifySummary" o = RepoRemoteGetGpgVerifySummaryMethodInfo
ResolveRepoMethod "remoteGetUrl" o = RepoRemoteGetUrlMethodInfo
ResolveRepoMethod "remoteGpgImport" o = RepoRemoteGpgImportMethodInfo
ResolveRepoMethod "remoteList" o = RepoRemoteListMethodInfo
ResolveRepoMethod "remoteListCollectionRefs" o = RepoRemoteListCollectionRefsMethodInfo
ResolveRepoMethod "remoteListRefs" o = RepoRemoteListRefsMethodInfo
ResolveRepoMethod "resolveCollectionRef" o = RepoResolveCollectionRefMethodInfo
ResolveRepoMethod "resolveKeyringForCollection" o = RepoResolveKeyringForCollectionMethodInfo
ResolveRepoMethod "resolveRev" o = RepoResolveRevMethodInfo
ResolveRepoMethod "resolveRevExt" o = RepoResolveRevExtMethodInfo
ResolveRepoMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveRepoMethod "scanHardlinks" o = RepoScanHardlinksMethodInfo
ResolveRepoMethod "signCommit" o = RepoSignCommitMethodInfo
ResolveRepoMethod "signDelta" o = RepoSignDeltaMethodInfo
ResolveRepoMethod "staticDeltaExecuteOffline" o = RepoStaticDeltaExecuteOfflineMethodInfo
ResolveRepoMethod "staticDeltaGenerate" o = RepoStaticDeltaGenerateMethodInfo
ResolveRepoMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveRepoMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveRepoMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveRepoMethod "transactionSetCollectionRef" o = RepoTransactionSetCollectionRefMethodInfo
ResolveRepoMethod "transactionSetRef" o = RepoTransactionSetRefMethodInfo
ResolveRepoMethod "transactionSetRefspec" o = RepoTransactionSetRefspecMethodInfo
ResolveRepoMethod "traverseCommit" o = RepoTraverseCommitMethodInfo
ResolveRepoMethod "traverseReachableRefs" o = RepoTraverseReachableRefsMethodInfo
ResolveRepoMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveRepoMethod "verifyCommit" o = RepoVerifyCommitMethodInfo
ResolveRepoMethod "verifyCommitExt" o = RepoVerifyCommitExtMethodInfo
ResolveRepoMethod "verifyCommitForRemote" o = RepoVerifyCommitForRemoteMethodInfo
ResolveRepoMethod "verifySummary" o = RepoVerifySummaryMethodInfo
ResolveRepoMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveRepoMethod "writeArchiveToMtree" o = RepoWriteArchiveToMtreeMethodInfo
ResolveRepoMethod "writeCommit" o = RepoWriteCommitMethodInfo
ResolveRepoMethod "writeCommitDetachedMetadata" o = RepoWriteCommitDetachedMetadataMethodInfo
ResolveRepoMethod "writeCommitWithTime" o = RepoWriteCommitWithTimeMethodInfo
ResolveRepoMethod "writeConfig" o = RepoWriteConfigMethodInfo
ResolveRepoMethod "writeContent" o = RepoWriteContentMethodInfo
ResolveRepoMethod "writeContentAsync" o = RepoWriteContentAsyncMethodInfo
ResolveRepoMethod "writeContentFinish" o = RepoWriteContentFinishMethodInfo
ResolveRepoMethod "writeContentTrusted" o = RepoWriteContentTrustedMethodInfo
ResolveRepoMethod "writeDfdToMtree" o = RepoWriteDfdToMtreeMethodInfo
ResolveRepoMethod "writeDirectoryToMtree" o = RepoWriteDirectoryToMtreeMethodInfo
ResolveRepoMethod "writeMetadata" o = RepoWriteMetadataMethodInfo
ResolveRepoMethod "writeMetadataAsync" o = RepoWriteMetadataAsyncMethodInfo
ResolveRepoMethod "writeMetadataFinish" o = RepoWriteMetadataFinishMethodInfo
ResolveRepoMethod "writeMetadataStreamTrusted" o = RepoWriteMetadataStreamTrustedMethodInfo
ResolveRepoMethod "writeMetadataTrusted" o = RepoWriteMetadataTrustedMethodInfo
ResolveRepoMethod "writeMtree" o = RepoWriteMtreeMethodInfo
ResolveRepoMethod "getBootloader" o = RepoGetBootloaderMethodInfo
ResolveRepoMethod "getCollectionId" o = RepoGetCollectionIdMethodInfo
ResolveRepoMethod "getConfig" o = RepoGetConfigMethodInfo
ResolveRepoMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveRepoMethod "getDefaultRepoFinders" o = RepoGetDefaultRepoFindersMethodInfo
ResolveRepoMethod "getDfd" o = RepoGetDfdMethodInfo
ResolveRepoMethod "getDisableFsync" o = RepoGetDisableFsyncMethodInfo
ResolveRepoMethod "getMinFreeSpaceBytes" o = RepoGetMinFreeSpaceBytesMethodInfo
ResolveRepoMethod "getMode" o = RepoGetModeMethodInfo
ResolveRepoMethod "getParent" o = RepoGetParentMethodInfo
ResolveRepoMethod "getPath" o = RepoGetPathMethodInfo
ResolveRepoMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveRepoMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveRepoMethod "getRemoteBooleanOption" o = RepoGetRemoteBooleanOptionMethodInfo
ResolveRepoMethod "getRemoteListOption" o = RepoGetRemoteListOptionMethodInfo
ResolveRepoMethod "getRemoteOption" o = RepoGetRemoteOptionMethodInfo
ResolveRepoMethod "setAliasRefImmediate" o = RepoSetAliasRefImmediateMethodInfo
ResolveRepoMethod "setCacheDir" o = RepoSetCacheDirMethodInfo
ResolveRepoMethod "setCollectionId" o = RepoSetCollectionIdMethodInfo
ResolveRepoMethod "setCollectionRefImmediate" o = RepoSetCollectionRefImmediateMethodInfo
ResolveRepoMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveRepoMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveRepoMethod "setDisableFsync" o = RepoSetDisableFsyncMethodInfo
ResolveRepoMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveRepoMethod "setRefImmediate" o = RepoSetRefImmediateMethodInfo
ResolveRepoMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveRepoMethod t Repo, O.MethodInfo info Repo p) => OL.IsLabel t (Repo -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type RepoGpgVerifyResultCallback =
T.Text
-> OSTree.GpgVerifyResult.GpgVerifyResult
-> IO ()
noRepoGpgVerifyResultCallback :: Maybe RepoGpgVerifyResultCallback
noRepoGpgVerifyResultCallback :: Maybe RepoGpgVerifyResultCallback
noRepoGpgVerifyResultCallback = Maybe RepoGpgVerifyResultCallback
forall a. Maybe a
Nothing
type C_RepoGpgVerifyResultCallback =
Ptr () ->
CString ->
Ptr OSTree.GpgVerifyResult.GpgVerifyResult ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_RepoGpgVerifyResultCallback :: C_RepoGpgVerifyResultCallback -> IO (FunPtr C_RepoGpgVerifyResultCallback)
genClosure_RepoGpgVerifyResult :: MonadIO m => RepoGpgVerifyResultCallback -> m (GClosure C_RepoGpgVerifyResultCallback)
genClosure_RepoGpgVerifyResult :: RepoGpgVerifyResultCallback
-> m (GClosure C_RepoGpgVerifyResultCallback)
genClosure_RepoGpgVerifyResult cb :: RepoGpgVerifyResultCallback
cb = IO (GClosure C_RepoGpgVerifyResultCallback)
-> m (GClosure C_RepoGpgVerifyResultCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_RepoGpgVerifyResultCallback)
-> m (GClosure C_RepoGpgVerifyResultCallback))
-> IO (GClosure C_RepoGpgVerifyResultCallback)
-> m (GClosure C_RepoGpgVerifyResultCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_RepoGpgVerifyResultCallback
cb' = RepoGpgVerifyResultCallback -> C_RepoGpgVerifyResultCallback
wrap_RepoGpgVerifyResultCallback RepoGpgVerifyResultCallback
cb
C_RepoGpgVerifyResultCallback
-> IO (FunPtr C_RepoGpgVerifyResultCallback)
mk_RepoGpgVerifyResultCallback C_RepoGpgVerifyResultCallback
cb' IO (FunPtr C_RepoGpgVerifyResultCallback)
-> (FunPtr C_RepoGpgVerifyResultCallback
-> IO (GClosure C_RepoGpgVerifyResultCallback))
-> IO (GClosure C_RepoGpgVerifyResultCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_RepoGpgVerifyResultCallback
-> IO (GClosure C_RepoGpgVerifyResultCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_RepoGpgVerifyResultCallback ::
RepoGpgVerifyResultCallback ->
C_RepoGpgVerifyResultCallback
wrap_RepoGpgVerifyResultCallback :: RepoGpgVerifyResultCallback -> C_RepoGpgVerifyResultCallback
wrap_RepoGpgVerifyResultCallback _cb :: RepoGpgVerifyResultCallback
_cb _ checksum :: CString
checksum result_ :: Ptr GpgVerifyResult
result_ _ = do
Text
checksum' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
checksum
GpgVerifyResult
result_' <- ((ManagedPtr GpgVerifyResult -> GpgVerifyResult)
-> Ptr GpgVerifyResult -> IO GpgVerifyResult
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr GpgVerifyResult -> GpgVerifyResult
OSTree.GpgVerifyResult.GpgVerifyResult) Ptr GpgVerifyResult
result_
RepoGpgVerifyResultCallback
_cb Text
checksum' GpgVerifyResult
result_'
onRepoGpgVerifyResult :: (IsRepo a, MonadIO m) => a -> RepoGpgVerifyResultCallback -> m SignalHandlerId
onRepoGpgVerifyResult :: a -> RepoGpgVerifyResultCallback -> m SignalHandlerId
onRepoGpgVerifyResult obj :: a
obj cb :: RepoGpgVerifyResultCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_RepoGpgVerifyResultCallback
cb' = RepoGpgVerifyResultCallback -> C_RepoGpgVerifyResultCallback
wrap_RepoGpgVerifyResultCallback RepoGpgVerifyResultCallback
cb
FunPtr C_RepoGpgVerifyResultCallback
cb'' <- C_RepoGpgVerifyResultCallback
-> IO (FunPtr C_RepoGpgVerifyResultCallback)
mk_RepoGpgVerifyResultCallback C_RepoGpgVerifyResultCallback
cb'
a
-> Text
-> FunPtr C_RepoGpgVerifyResultCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "gpg-verify-result" FunPtr C_RepoGpgVerifyResultCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterRepoGpgVerifyResult :: (IsRepo a, MonadIO m) => a -> RepoGpgVerifyResultCallback -> m SignalHandlerId
afterRepoGpgVerifyResult :: a -> RepoGpgVerifyResultCallback -> m SignalHandlerId
afterRepoGpgVerifyResult obj :: a
obj cb :: RepoGpgVerifyResultCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_RepoGpgVerifyResultCallback
cb' = RepoGpgVerifyResultCallback -> C_RepoGpgVerifyResultCallback
wrap_RepoGpgVerifyResultCallback RepoGpgVerifyResultCallback
cb
FunPtr C_RepoGpgVerifyResultCallback
cb'' <- C_RepoGpgVerifyResultCallback
-> IO (FunPtr C_RepoGpgVerifyResultCallback)
mk_RepoGpgVerifyResultCallback C_RepoGpgVerifyResultCallback
cb'
a
-> Text
-> FunPtr C_RepoGpgVerifyResultCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "gpg-verify-result" FunPtr C_RepoGpgVerifyResultCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data RepoGpgVerifyResultSignalInfo
instance SignalInfo RepoGpgVerifyResultSignalInfo where
type HaskellCallbackType RepoGpgVerifyResultSignalInfo = RepoGpgVerifyResultCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_RepoGpgVerifyResultCallback cb
cb'' <- mk_RepoGpgVerifyResultCallback cb'
connectSignalFunPtr obj "gpg-verify-result" cb'' connectMode detail
#endif
getRepoPath :: (MonadIO m, IsRepo o) => o -> m Gio.File.File
getRepoPath :: o -> m File
getRepoPath obj :: o
obj = IO File -> m File
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO File -> m File) -> IO File -> m File
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe File) -> IO File
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getRepoPath" (IO (Maybe File) -> IO File) -> IO (Maybe File) -> IO File
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr File -> File) -> IO (Maybe File)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj "path" ManagedPtr File -> File
Gio.File.File
constructRepoPath :: (IsRepo o, Gio.File.IsFile a) => a -> IO (GValueConstruct o)
constructRepoPath :: a -> IO (GValueConstruct o)
constructRepoPath val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "path" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
#if defined(ENABLE_OVERLOADING)
data RepoPathPropertyInfo
instance AttrInfo RepoPathPropertyInfo where
type AttrAllowedOps RepoPathPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint RepoPathPropertyInfo = IsRepo
type AttrSetTypeConstraint RepoPathPropertyInfo = Gio.File.IsFile
type AttrTransferTypeConstraint RepoPathPropertyInfo = Gio.File.IsFile
type AttrTransferType RepoPathPropertyInfo = Gio.File.File
type AttrGetType RepoPathPropertyInfo = Gio.File.File
type AttrLabel RepoPathPropertyInfo = "path"
type AttrOrigin RepoPathPropertyInfo = Repo
attrGet = getRepoPath
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gio.File.File v
attrConstruct = constructRepoPath
attrClear = undefined
#endif
getRepoRemotesConfigDir :: (MonadIO m, IsRepo o) => o -> m (Maybe T.Text)
getRepoRemotesConfigDir :: o -> m (Maybe Text)
getRepoRemotesConfigDir obj :: o
obj = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj "remotes-config-dir"
constructRepoRemotesConfigDir :: (IsRepo o) => T.Text -> IO (GValueConstruct o)
constructRepoRemotesConfigDir :: Text -> IO (GValueConstruct o)
constructRepoRemotesConfigDir val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString "remotes-config-dir" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
#if defined(ENABLE_OVERLOADING)
data RepoRemotesConfigDirPropertyInfo
instance AttrInfo RepoRemotesConfigDirPropertyInfo where
type AttrAllowedOps RepoRemotesConfigDirPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint RepoRemotesConfigDirPropertyInfo = IsRepo
type AttrSetTypeConstraint RepoRemotesConfigDirPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint RepoRemotesConfigDirPropertyInfo = (~) T.Text
type AttrTransferType RepoRemotesConfigDirPropertyInfo = T.Text
type AttrGetType RepoRemotesConfigDirPropertyInfo = (Maybe T.Text)
type AttrLabel RepoRemotesConfigDirPropertyInfo = "remotes-config-dir"
type AttrOrigin RepoRemotesConfigDirPropertyInfo = Repo
attrGet = getRepoRemotesConfigDir
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructRepoRemotesConfigDir
attrClear = undefined
#endif
getRepoSysrootPath :: (MonadIO m, IsRepo o) => o -> m (Maybe Gio.File.File)
getRepoSysrootPath :: o -> m (Maybe File)
getRepoSysrootPath obj :: o
obj = IO (Maybe File) -> m (Maybe File)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe File) -> m (Maybe File))
-> IO (Maybe File) -> m (Maybe File)
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr File -> File) -> IO (Maybe File)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj "sysroot-path" ManagedPtr File -> File
Gio.File.File
constructRepoSysrootPath :: (IsRepo o, Gio.File.IsFile a) => a -> IO (GValueConstruct o)
constructRepoSysrootPath :: a -> IO (GValueConstruct o)
constructRepoSysrootPath val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "sysroot-path" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
#if defined(ENABLE_OVERLOADING)
data RepoSysrootPathPropertyInfo
instance AttrInfo RepoSysrootPathPropertyInfo where
type AttrAllowedOps RepoSysrootPathPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint RepoSysrootPathPropertyInfo = IsRepo
type AttrSetTypeConstraint RepoSysrootPathPropertyInfo = Gio.File.IsFile
type AttrTransferTypeConstraint RepoSysrootPathPropertyInfo = Gio.File.IsFile
type AttrTransferType RepoSysrootPathPropertyInfo = Gio.File.File
type AttrGetType RepoSysrootPathPropertyInfo = (Maybe Gio.File.File)
type AttrLabel RepoSysrootPathPropertyInfo = "sysroot-path"
type AttrOrigin RepoSysrootPathPropertyInfo = Repo
attrGet = getRepoSysrootPath
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gio.File.File v
attrConstruct = constructRepoSysrootPath
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Repo
type instance O.AttributeList Repo = RepoAttributeList
type RepoAttributeList = ('[ '("path", RepoPathPropertyInfo), '("remotesConfigDir", RepoRemotesConfigDirPropertyInfo), '("sysrootPath", RepoSysrootPathPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
repoPath :: AttrLabelProxy "path"
repoPath = AttrLabelProxy
repoRemotesConfigDir :: AttrLabelProxy "remotesConfigDir"
repoRemotesConfigDir = AttrLabelProxy
repoSysrootPath :: AttrLabelProxy "sysrootPath"
repoSysrootPath = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Repo = RepoSignalList
type RepoSignalList = ('[ '("gpgVerifyResult", RepoGpgVerifyResultSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "ostree_repo_new" ostree_repo_new ::
Ptr Gio.File.File ->
IO (Ptr Repo)
repoNew ::
(B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a) =>
a
-> m Repo
repoNew :: a -> m Repo
repoNew path :: a
path = IO Repo -> m Repo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Repo -> m Repo) -> IO Repo -> m Repo
forall a b. (a -> b) -> a -> b
$ do
Ptr File
path' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
path
Ptr Repo
result <- Ptr File -> IO (Ptr Repo)
ostree_repo_new Ptr File
path'
Text -> Ptr Repo -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoNew" Ptr Repo
result
Repo
result' <- ((ManagedPtr Repo -> Repo) -> Ptr Repo -> IO Repo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Repo -> Repo
Repo) Ptr Repo
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
path
Repo -> IO Repo
forall (m :: * -> *) a. Monad m => a -> m a
return Repo
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ostree_repo_new_default" ostree_repo_new_default ::
IO (Ptr Repo)
repoNewDefault ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Repo
repoNewDefault :: m Repo
repoNewDefault = IO Repo -> m Repo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Repo -> m Repo) -> IO Repo -> m Repo
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
result <- IO (Ptr Repo)
ostree_repo_new_default
Text -> Ptr Repo -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoNewDefault" Ptr Repo
result
Repo
result' <- ((ManagedPtr Repo -> Repo) -> Ptr Repo -> IO Repo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Repo -> Repo
Repo) Ptr Repo
result
Repo -> IO Repo
forall (m :: * -> *) a. Monad m => a -> m a
return Repo
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ostree_repo_new_for_sysroot_path" ostree_repo_new_for_sysroot_path ::
Ptr Gio.File.File ->
Ptr Gio.File.File ->
IO (Ptr Repo)
repoNewForSysrootPath ::
(B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a, Gio.File.IsFile b) =>
a
-> b
-> m Repo
repoNewForSysrootPath :: a -> b -> m Repo
repoNewForSysrootPath repoPath :: a
repoPath sysrootPath :: b
sysrootPath = IO Repo -> m Repo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Repo -> m Repo) -> IO Repo -> m Repo
forall a b. (a -> b) -> a -> b
$ do
Ptr File
repoPath' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
repoPath
Ptr File
sysrootPath' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
sysrootPath
Ptr Repo
result <- Ptr File -> Ptr File -> IO (Ptr Repo)
ostree_repo_new_for_sysroot_path Ptr File
repoPath' Ptr File
sysrootPath'
Text -> Ptr Repo -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoNewForSysrootPath" Ptr Repo
result
Repo
result' <- ((ManagedPtr Repo -> Repo) -> Ptr Repo -> IO Repo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Repo -> Repo
Repo) Ptr Repo
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
repoPath
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
sysrootPath
Repo -> IO Repo
forall (m :: * -> *) a. Monad m => a -> m a
return Repo
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ostree_repo_abort_transaction" ostree_repo_abort_transaction ::
Ptr Repo ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoAbortTransaction ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m ()
repoAbortTransaction :: a -> Maybe b -> m ()
repoAbortTransaction self :: a
self cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo -> Ptr Cancellable -> Ptr (Ptr GError) -> IO CInt
ostree_repo_abort_transaction Ptr Repo
self' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoAbortTransactionMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoAbortTransactionMethodInfo a signature where
overloadedMethod = repoAbortTransaction
#endif
foreign import ccall "ostree_repo_add_gpg_signature_summary" ostree_repo_add_gpg_signature_summary ::
Ptr Repo ->
Ptr CString ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoAddGpgSignatureSummary ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> [T.Text]
-> Maybe (T.Text)
-> Maybe (b)
-> m ()
repoAddGpgSignatureSummary :: a -> [Text] -> Maybe Text -> Maybe b -> m ()
repoAddGpgSignatureSummary self :: a
self keyId :: [Text]
keyId homedir :: Maybe Text
homedir cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr CString
keyId' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
keyId
CString
maybeHomedir <- case Maybe Text
homedir of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jHomedir :: Text
jHomedir -> do
CString
jHomedir' <- Text -> IO CString
textToCString Text
jHomedir
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jHomedir'
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr CString
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_add_gpg_signature_summary Ptr Repo
self' Ptr CString
keyId' CString
maybeHomedir Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
keyId'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
keyId'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeHomedir
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
keyId'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
keyId'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeHomedir
)
#if defined(ENABLE_OVERLOADING)
data RepoAddGpgSignatureSummaryMethodInfo
instance (signature ~ ([T.Text] -> Maybe (T.Text) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoAddGpgSignatureSummaryMethodInfo a signature where
overloadedMethod = repoAddGpgSignatureSummary
#endif
foreign import ccall "ostree_repo_append_gpg_signature" ostree_repo_append_gpg_signature ::
Ptr Repo ->
CString ->
Ptr GLib.Bytes.Bytes ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoAppendGpgSignature ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> GLib.Bytes.Bytes
-> Maybe (b)
-> m ()
repoAppendGpgSignature :: a -> Text -> Bytes -> Maybe b -> m ()
repoAppendGpgSignature self :: a
self commitChecksum :: Text
commitChecksum signatureBytes :: Bytes
signatureBytes cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
commitChecksum' <- Text -> IO CString
textToCString Text
commitChecksum
Ptr Bytes
signatureBytes' <- Bytes -> IO (Ptr Bytes)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bytes
signatureBytes
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr Bytes
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_append_gpg_signature Ptr Repo
self' CString
commitChecksum' Ptr Bytes
signatureBytes' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Bytes -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Bytes
signatureBytes
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
commitChecksum'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
commitChecksum'
)
#if defined(ENABLE_OVERLOADING)
data RepoAppendGpgSignatureMethodInfo
instance (signature ~ (T.Text -> GLib.Bytes.Bytes -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoAppendGpgSignatureMethodInfo a signature where
overloadedMethod = repoAppendGpgSignature
#endif
foreign import ccall "ostree_repo_checkout_at" ostree_repo_checkout_at ::
Ptr Repo ->
Ptr OSTree.RepoCheckoutAtOptions.RepoCheckoutAtOptions ->
Int32 ->
CString ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoCheckoutAt ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (OSTree.RepoCheckoutAtOptions.RepoCheckoutAtOptions)
-> Int32
-> T.Text
-> T.Text
-> Maybe (b)
-> m ()
repoCheckoutAt :: a
-> Maybe RepoCheckoutAtOptions
-> Int32
-> Text
-> Text
-> Maybe b
-> m ()
repoCheckoutAt self :: a
self options :: Maybe RepoCheckoutAtOptions
options destinationDfd :: Int32
destinationDfd destinationPath :: Text
destinationPath commit :: Text
commit cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr RepoCheckoutAtOptions
maybeOptions <- case Maybe RepoCheckoutAtOptions
options of
Nothing -> Ptr RepoCheckoutAtOptions -> IO (Ptr RepoCheckoutAtOptions)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr RepoCheckoutAtOptions
forall a. Ptr a
nullPtr
Just jOptions :: RepoCheckoutAtOptions
jOptions -> do
Ptr RepoCheckoutAtOptions
jOptions' <- RepoCheckoutAtOptions -> IO (Ptr RepoCheckoutAtOptions)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RepoCheckoutAtOptions
jOptions
Ptr RepoCheckoutAtOptions -> IO (Ptr RepoCheckoutAtOptions)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr RepoCheckoutAtOptions
jOptions'
CString
destinationPath' <- Text -> IO CString
textToCString Text
destinationPath
CString
commit' <- Text -> IO CString
textToCString Text
commit
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr RepoCheckoutAtOptions
-> Int32
-> CString
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_checkout_at Ptr Repo
self' Ptr RepoCheckoutAtOptions
maybeOptions Int32
destinationDfd CString
destinationPath' CString
commit' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe RepoCheckoutAtOptions
-> (RepoCheckoutAtOptions -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe RepoCheckoutAtOptions
options RepoCheckoutAtOptions -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
destinationPath'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
commit'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
destinationPath'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
commit'
)
#if defined(ENABLE_OVERLOADING)
data RepoCheckoutAtMethodInfo
instance (signature ~ (Maybe (OSTree.RepoCheckoutAtOptions.RepoCheckoutAtOptions) -> Int32 -> T.Text -> T.Text -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoCheckoutAtMethodInfo a signature where
overloadedMethod = repoCheckoutAt
#endif
foreign import ccall "ostree_repo_checkout_gc" ostree_repo_checkout_gc ::
Ptr Repo ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoCheckoutGc ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m ()
repoCheckoutGc :: a -> Maybe b -> m ()
repoCheckoutGc self :: a
self cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo -> Ptr Cancellable -> Ptr (Ptr GError) -> IO CInt
ostree_repo_checkout_gc Ptr Repo
self' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoCheckoutGcMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoCheckoutGcMethodInfo a signature where
overloadedMethod = repoCheckoutGc
#endif
foreign import ccall "ostree_repo_checkout_tree" ostree_repo_checkout_tree ::
Ptr Repo ->
CUInt ->
CUInt ->
Ptr Gio.File.File ->
Ptr OSTree.RepoFile.RepoFile ->
Ptr Gio.FileInfo.FileInfo ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoCheckoutTree ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.File.IsFile b, OSTree.RepoFile.IsRepoFile c, Gio.FileInfo.IsFileInfo d, Gio.Cancellable.IsCancellable e) =>
a
-> OSTree.Enums.RepoCheckoutMode
-> OSTree.Enums.RepoCheckoutOverwriteMode
-> b
-> c
-> d
-> Maybe (e)
-> m ()
repoCheckoutTree :: a
-> RepoCheckoutMode
-> RepoCheckoutOverwriteMode
-> b
-> c
-> d
-> Maybe e
-> m ()
repoCheckoutTree self :: a
self mode :: RepoCheckoutMode
mode overwriteMode :: RepoCheckoutOverwriteMode
overwriteMode destination :: b
destination source :: c
source sourceInfo :: d
sourceInfo cancellable :: Maybe e
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let mode' :: CUInt
mode' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (RepoCheckoutMode -> Int) -> RepoCheckoutMode -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RepoCheckoutMode -> Int
forall a. Enum a => a -> Int
fromEnum) RepoCheckoutMode
mode
let overwriteMode' :: CUInt
overwriteMode' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (RepoCheckoutOverwriteMode -> Int)
-> RepoCheckoutOverwriteMode
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RepoCheckoutOverwriteMode -> Int
forall a. Enum a => a -> Int
fromEnum) RepoCheckoutOverwriteMode
overwriteMode
Ptr File
destination' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
destination
Ptr RepoFile
source' <- c -> IO (Ptr RepoFile)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
source
Ptr FileInfo
sourceInfo' <- d -> IO (Ptr FileInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr d
sourceInfo
Ptr Cancellable
maybeCancellable <- case Maybe e
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: e
jCancellable -> do
Ptr Cancellable
jCancellable' <- e -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr e
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CUInt
-> CUInt
-> Ptr File
-> Ptr RepoFile
-> Ptr FileInfo
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_checkout_tree Ptr Repo
self' CUInt
mode' CUInt
overwriteMode' Ptr File
destination' Ptr RepoFile
source' Ptr FileInfo
sourceInfo' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
destination
c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
source
d -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr d
sourceInfo
Maybe e -> (e -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe e
cancellable e -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoCheckoutTreeMethodInfo
instance (signature ~ (OSTree.Enums.RepoCheckoutMode -> OSTree.Enums.RepoCheckoutOverwriteMode -> b -> c -> d -> Maybe (e) -> m ()), MonadIO m, IsRepo a, Gio.File.IsFile b, OSTree.RepoFile.IsRepoFile c, Gio.FileInfo.IsFileInfo d, Gio.Cancellable.IsCancellable e) => O.MethodInfo RepoCheckoutTreeMethodInfo a signature where
overloadedMethod = repoCheckoutTree
#endif
foreign import ccall "ostree_repo_commit_transaction" ostree_repo_commit_transaction ::
Ptr Repo ->
Ptr OSTree.RepoTransactionStats.RepoTransactionStats ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoCommitTransaction ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m (OSTree.RepoTransactionStats.RepoTransactionStats)
repoCommitTransaction :: a -> Maybe b -> m RepoTransactionStats
repoCommitTransaction self :: a
self cancellable :: Maybe b
cancellable = IO RepoTransactionStats -> m RepoTransactionStats
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RepoTransactionStats -> m RepoTransactionStats)
-> IO RepoTransactionStats -> m RepoTransactionStats
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr RepoTransactionStats
outStats <- Int -> IO (Ptr RepoTransactionStats)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 56 :: IO (Ptr OSTree.RepoTransactionStats.RepoTransactionStats)
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO RepoTransactionStats -> IO () -> IO RepoTransactionStats
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr RepoTransactionStats
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_commit_transaction Ptr Repo
self' Ptr RepoTransactionStats
outStats Ptr Cancellable
maybeCancellable
RepoTransactionStats
outStats' <- ((ManagedPtr RepoTransactionStats -> RepoTransactionStats)
-> Ptr RepoTransactionStats -> IO RepoTransactionStats
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr RepoTransactionStats -> RepoTransactionStats
OSTree.RepoTransactionStats.RepoTransactionStats) Ptr RepoTransactionStats
outStats
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
RepoTransactionStats -> IO RepoTransactionStats
forall (m :: * -> *) a. Monad m => a -> m a
return RepoTransactionStats
outStats'
) (do
Ptr RepoTransactionStats -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr RepoTransactionStats
outStats
)
#if defined(ENABLE_OVERLOADING)
data RepoCommitTransactionMethodInfo
instance (signature ~ (Maybe (b) -> m (OSTree.RepoTransactionStats.RepoTransactionStats)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoCommitTransactionMethodInfo a signature where
overloadedMethod = repoCommitTransaction
#endif
foreign import ccall "ostree_repo_copy_config" ostree_repo_copy_config ::
Ptr Repo ->
IO (Ptr GLib.KeyFile.KeyFile)
repoCopyConfig ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> m GLib.KeyFile.KeyFile
repoCopyConfig :: a -> m KeyFile
repoCopyConfig self :: a
self = IO KeyFile -> m KeyFile
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO KeyFile -> m KeyFile) -> IO KeyFile -> m KeyFile
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr KeyFile
result <- Ptr Repo -> IO (Ptr KeyFile)
ostree_repo_copy_config Ptr Repo
self'
Text -> Ptr KeyFile -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoCopyConfig" Ptr KeyFile
result
KeyFile
result' <- ((ManagedPtr KeyFile -> KeyFile) -> Ptr KeyFile -> IO KeyFile
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr KeyFile -> KeyFile
GLib.KeyFile.KeyFile) Ptr KeyFile
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
KeyFile -> IO KeyFile
forall (m :: * -> *) a. Monad m => a -> m a
return KeyFile
result'
#if defined(ENABLE_OVERLOADING)
data RepoCopyConfigMethodInfo
instance (signature ~ (m GLib.KeyFile.KeyFile), MonadIO m, IsRepo a) => O.MethodInfo RepoCopyConfigMethodInfo a signature where
overloadedMethod = repoCopyConfig
#endif
foreign import ccall "ostree_repo_create" ostree_repo_create ::
Ptr Repo ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoCreate ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> OSTree.Enums.RepoMode
-> Maybe (b)
-> m ()
repoCreate :: a -> RepoMode -> Maybe b -> m ()
repoCreate self :: a
self mode :: RepoMode
mode cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let mode' :: CUInt
mode' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (RepoMode -> Int) -> RepoMode -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RepoMode -> Int
forall a. Enum a => a -> Int
fromEnum) RepoMode
mode
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo -> CUInt -> Ptr Cancellable -> Ptr (Ptr GError) -> IO CInt
ostree_repo_create Ptr Repo
self' CUInt
mode' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoCreateMethodInfo
instance (signature ~ (OSTree.Enums.RepoMode -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoCreateMethodInfo a signature where
overloadedMethod = repoCreate
#endif
foreign import ccall "ostree_repo_delete_object" ostree_repo_delete_object ::
Ptr Repo ->
CUInt ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoDeleteObject ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> OSTree.Enums.ObjectType
-> T.Text
-> Maybe (b)
-> m ()
repoDeleteObject :: a -> ObjectType -> Text -> Maybe b -> m ()
repoDeleteObject self :: a
self objtype :: ObjectType
objtype sha256 :: Text
sha256 cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let objtype' :: CUInt
objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
CString
sha256' <- Text -> IO CString
textToCString Text
sha256
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CUInt
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_delete_object Ptr Repo
self' CUInt
objtype' CString
sha256' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
sha256'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
sha256'
)
#if defined(ENABLE_OVERLOADING)
data RepoDeleteObjectMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoDeleteObjectMethodInfo a signature where
overloadedMethod = repoDeleteObject
#endif
foreign import ccall "ostree_repo_equal" ostree_repo_equal ::
Ptr Repo ->
Ptr Repo ->
IO CInt
repoEqual ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, IsRepo b) =>
a
-> b
-> m Bool
repoEqual :: a -> b -> m Bool
repoEqual a :: a
a b :: b
b = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
a' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
a
Ptr Repo
b' <- b -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
b
CInt
result <- Ptr Repo -> Ptr Repo -> IO CInt
ostree_repo_equal Ptr Repo
a' Ptr Repo
b'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
a
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
b
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data RepoEqualMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsRepo a, IsRepo b) => O.MethodInfo RepoEqualMethodInfo a signature where
overloadedMethod = repoEqual
#endif
foreign import ccall "ostree_repo_find_remotes_async" ostree_repo_find_remotes_async ::
Ptr Repo ->
Ptr (Ptr OSTree.CollectionRef.CollectionRef) ->
Ptr GVariant ->
Ptr (Ptr OSTree.RepoFinder.RepoFinder) ->
Ptr OSTree.AsyncProgress.AsyncProgress ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
repoFindRemotesAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) =>
a
-> [OSTree.CollectionRef.CollectionRef]
-> Maybe (GVariant)
-> [OSTree.RepoFinder.RepoFinder]
-> Maybe (b)
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
repoFindRemotesAsync :: a
-> [CollectionRef]
-> Maybe GVariant
-> [RepoFinder]
-> Maybe b
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
repoFindRemotesAsync self :: a
self refs :: [CollectionRef]
refs options :: Maybe GVariant
options finders :: [RepoFinder]
finders progress :: Maybe b
progress cancellable :: Maybe c
cancellable callback :: Maybe AsyncReadyCallback
callback = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
[Ptr CollectionRef]
refs' <- (CollectionRef -> IO (Ptr CollectionRef))
-> [CollectionRef] -> IO [Ptr CollectionRef]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM CollectionRef -> IO (Ptr CollectionRef)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [CollectionRef]
refs
Ptr (Ptr CollectionRef)
refs'' <- [Ptr CollectionRef] -> IO (Ptr (Ptr CollectionRef))
forall a. [Ptr a] -> IO (Ptr (Ptr a))
packZeroTerminatedPtrArray [Ptr CollectionRef]
refs'
Ptr GVariant
maybeOptions <- case Maybe GVariant
options of
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jOptions :: GVariant
jOptions -> do
Ptr GVariant
jOptions' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jOptions
Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jOptions'
[Ptr RepoFinder]
finders' <- (RepoFinder -> IO (Ptr RepoFinder))
-> [RepoFinder] -> IO [Ptr RepoFinder]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM RepoFinder -> IO (Ptr RepoFinder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr [RepoFinder]
finders
Ptr (Ptr RepoFinder)
finders'' <- [Ptr RepoFinder] -> IO (Ptr (Ptr RepoFinder))
forall a. [Ptr a] -> IO (Ptr (Ptr a))
packZeroTerminatedPtrArray [Ptr RepoFinder]
finders'
Ptr AsyncProgress
maybeProgress <- case Maybe b
progress of
Nothing -> Ptr AsyncProgress -> IO (Ptr AsyncProgress)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AsyncProgress
forall a. Ptr a
nullPtr
Just jProgress :: b
jProgress -> do
Ptr AsyncProgress
jProgress' <- b -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jProgress
Ptr AsyncProgress -> IO (Ptr AsyncProgress)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AsyncProgress
jProgress'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Repo
-> Ptr (Ptr CollectionRef)
-> Ptr GVariant
-> Ptr (Ptr RepoFinder)
-> Ptr AsyncProgress
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ostree_repo_find_remotes_async Ptr Repo
self' Ptr (Ptr CollectionRef)
refs'' Ptr GVariant
maybeOptions Ptr (Ptr RepoFinder)
finders'' Ptr AsyncProgress
maybeProgress Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
(CollectionRef -> IO ()) -> [CollectionRef] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ CollectionRef -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [CollectionRef]
refs
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
options GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
(RepoFinder -> IO ()) -> [RepoFinder] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ RepoFinder -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [RepoFinder]
finders
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
progress b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Ptr (Ptr CollectionRef) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CollectionRef)
refs''
Ptr (Ptr RepoFinder) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr RepoFinder)
finders''
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RepoFindRemotesAsyncMethodInfo
instance (signature ~ ([OSTree.CollectionRef.CollectionRef] -> Maybe (GVariant) -> [OSTree.RepoFinder.RepoFinder] -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoFindRemotesAsyncMethodInfo a signature where
overloadedMethod = repoFindRemotesAsync
#endif
foreign import ccall "ostree_repo_find_remotes_finish" ostree_repo_find_remotes_finish ::
Ptr Repo ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr (Ptr OSTree.RepoFinderResult.RepoFinderResult))
repoFindRemotesFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m [OSTree.RepoFinderResult.RepoFinderResult]
repoFindRemotesFinish :: a -> b -> m [RepoFinderResult]
repoFindRemotesFinish self :: a
self result_ :: b
result_ = IO [RepoFinderResult] -> m [RepoFinderResult]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [RepoFinderResult] -> m [RepoFinderResult])
-> IO [RepoFinderResult] -> m [RepoFinderResult]
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO [RepoFinderResult] -> IO () -> IO [RepoFinderResult]
forall a b. IO a -> IO b -> IO a
onException (do
Ptr (Ptr RepoFinderResult)
result <- (Ptr (Ptr GError) -> IO (Ptr (Ptr RepoFinderResult)))
-> IO (Ptr (Ptr RepoFinderResult))
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr (Ptr RepoFinderResult)))
-> IO (Ptr (Ptr RepoFinderResult)))
-> (Ptr (Ptr GError) -> IO (Ptr (Ptr RepoFinderResult)))
-> IO (Ptr (Ptr RepoFinderResult))
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr AsyncResult
-> Ptr (Ptr GError)
-> IO (Ptr (Ptr RepoFinderResult))
ostree_repo_find_remotes_finish Ptr Repo
self' Ptr AsyncResult
result_'
Text -> Ptr (Ptr RepoFinderResult) -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoFindRemotesFinish" Ptr (Ptr RepoFinderResult)
result
[Ptr RepoFinderResult]
result' <- Ptr (Ptr RepoFinderResult) -> IO [Ptr RepoFinderResult]
forall a. Ptr (Ptr a) -> IO [Ptr a]
unpackZeroTerminatedPtrArray Ptr (Ptr RepoFinderResult)
result
[RepoFinderResult]
result'' <- (Ptr RepoFinderResult -> IO RepoFinderResult)
-> [Ptr RepoFinderResult] -> IO [RepoFinderResult]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr RepoFinderResult -> RepoFinderResult)
-> Ptr RepoFinderResult -> IO RepoFinderResult
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr RepoFinderResult -> RepoFinderResult
OSTree.RepoFinderResult.RepoFinderResult) [Ptr RepoFinderResult]
result'
Ptr (Ptr RepoFinderResult) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr RepoFinderResult)
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
[RepoFinderResult] -> IO [RepoFinderResult]
forall (m :: * -> *) a. Monad m => a -> m a
return [RepoFinderResult]
result''
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoFindRemotesFinishMethodInfo
instance (signature ~ (b -> m [OSTree.RepoFinderResult.RepoFinderResult]), MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo RepoFindRemotesFinishMethodInfo a signature where
overloadedMethod = repoFindRemotesFinish
#endif
foreign import ccall "ostree_repo_fsck_object" ostree_repo_fsck_object ::
Ptr Repo ->
CUInt ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoFsckObject ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> OSTree.Enums.ObjectType
-> T.Text
-> Maybe (b)
-> m ()
repoFsckObject :: a -> ObjectType -> Text -> Maybe b -> m ()
repoFsckObject self :: a
self objtype :: ObjectType
objtype sha256 :: Text
sha256 cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let objtype' :: CUInt
objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
CString
sha256' <- Text -> IO CString
textToCString Text
sha256
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CUInt
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_fsck_object Ptr Repo
self' CUInt
objtype' CString
sha256' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
sha256'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
sha256'
)
#if defined(ENABLE_OVERLOADING)
data RepoFsckObjectMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoFsckObjectMethodInfo a signature where
overloadedMethod = repoFsckObject
#endif
foreign import ccall "ostree_repo_get_bootloader" ostree_repo_get_bootloader ::
Ptr Repo ->
IO CString
repoGetBootloader ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> m T.Text
repoGetBootloader :: a -> m Text
repoGetBootloader self :: a
self = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
result <- Ptr Repo -> IO CString
ostree_repo_get_bootloader Ptr Repo
self'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoGetBootloader" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data RepoGetBootloaderMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsRepo a) => O.MethodInfo RepoGetBootloaderMethodInfo a signature where
overloadedMethod = repoGetBootloader
#endif
foreign import ccall "ostree_repo_get_collection_id" ostree_repo_get_collection_id ::
Ptr Repo ->
IO CString
repoGetCollectionId ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> m (Maybe T.Text)
repoGetCollectionId :: a -> m (Maybe Text)
repoGetCollectionId self :: a
self = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
result <- Ptr Repo -> IO CString
ostree_repo_get_collection_id Ptr Repo
self'
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \result' :: CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data RepoGetCollectionIdMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsRepo a) => O.MethodInfo RepoGetCollectionIdMethodInfo a signature where
overloadedMethod = repoGetCollectionId
#endif
foreign import ccall "ostree_repo_get_config" ostree_repo_get_config ::
Ptr Repo ->
IO (Ptr GLib.KeyFile.KeyFile)
repoGetConfig ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> m GLib.KeyFile.KeyFile
repoGetConfig :: a -> m KeyFile
repoGetConfig self :: a
self = IO KeyFile -> m KeyFile
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO KeyFile -> m KeyFile) -> IO KeyFile -> m KeyFile
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr KeyFile
result <- Ptr Repo -> IO (Ptr KeyFile)
ostree_repo_get_config Ptr Repo
self'
Text -> Ptr KeyFile -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoGetConfig" Ptr KeyFile
result
KeyFile
result' <- ((ManagedPtr KeyFile -> KeyFile) -> Ptr KeyFile -> IO KeyFile
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr KeyFile -> KeyFile
GLib.KeyFile.KeyFile) Ptr KeyFile
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
KeyFile -> IO KeyFile
forall (m :: * -> *) a. Monad m => a -> m a
return KeyFile
result'
#if defined(ENABLE_OVERLOADING)
data RepoGetConfigMethodInfo
instance (signature ~ (m GLib.KeyFile.KeyFile), MonadIO m, IsRepo a) => O.MethodInfo RepoGetConfigMethodInfo a signature where
overloadedMethod = repoGetConfig
#endif
foreign import ccall "ostree_repo_get_default_repo_finders" ostree_repo_get_default_repo_finders ::
Ptr Repo ->
IO (Ptr CString)
repoGetDefaultRepoFinders ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> m [T.Text]
repoGetDefaultRepoFinders :: a -> m [Text]
repoGetDefaultRepoFinders self :: a
self = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr CString
result <- Ptr Repo -> IO (Ptr CString)
ostree_repo_get_default_repo_finders Ptr Repo
self'
Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoGetDefaultRepoFinders" Ptr CString
result
[Text]
result' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'
#if defined(ENABLE_OVERLOADING)
data RepoGetDefaultRepoFindersMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsRepo a) => O.MethodInfo RepoGetDefaultRepoFindersMethodInfo a signature where
overloadedMethod = repoGetDefaultRepoFinders
#endif
foreign import ccall "ostree_repo_get_dfd" ostree_repo_get_dfd ::
Ptr Repo ->
IO Int32
repoGetDfd ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> m Int32
repoGetDfd :: a -> m Int32
repoGetDfd self :: a
self = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Int32
result <- Ptr Repo -> IO Int32
ostree_repo_get_dfd Ptr Repo
self'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data RepoGetDfdMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsRepo a) => O.MethodInfo RepoGetDfdMethodInfo a signature where
overloadedMethod = repoGetDfd
#endif
foreign import ccall "ostree_repo_get_disable_fsync" ostree_repo_get_disable_fsync ::
Ptr Repo ->
IO CInt
repoGetDisableFsync ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> m Bool
repoGetDisableFsync :: a -> m Bool
repoGetDisableFsync self :: a
self = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CInt
result <- Ptr Repo -> IO CInt
ostree_repo_get_disable_fsync Ptr Repo
self'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data RepoGetDisableFsyncMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsRepo a) => O.MethodInfo RepoGetDisableFsyncMethodInfo a signature where
overloadedMethod = repoGetDisableFsync
#endif
foreign import ccall "ostree_repo_get_min_free_space_bytes" ostree_repo_get_min_free_space_bytes ::
Ptr Repo ->
Word64 ->
Ptr (Ptr GError) ->
IO CInt
repoGetMinFreeSpaceBytes ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> Word64
-> m ()
repoGetMinFreeSpaceBytes :: a -> Word64 -> m ()
repoGetMinFreeSpaceBytes self :: a
self outReservedBytes :: Word64
outReservedBytes = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo -> Word64 -> Ptr (Ptr GError) -> IO CInt
ostree_repo_get_min_free_space_bytes Ptr Repo
self' Word64
outReservedBytes
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoGetMinFreeSpaceBytesMethodInfo
instance (signature ~ (Word64 -> m ()), MonadIO m, IsRepo a) => O.MethodInfo RepoGetMinFreeSpaceBytesMethodInfo a signature where
overloadedMethod = repoGetMinFreeSpaceBytes
#endif
foreign import ccall "ostree_repo_get_mode" ostree_repo_get_mode ::
Ptr Repo ->
IO CUInt
repoGetMode ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> m OSTree.Enums.RepoMode
repoGetMode :: a -> m RepoMode
repoGetMode self :: a
self = IO RepoMode -> m RepoMode
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RepoMode -> m RepoMode) -> IO RepoMode -> m RepoMode
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CUInt
result <- Ptr Repo -> IO CUInt
ostree_repo_get_mode Ptr Repo
self'
let result' :: RepoMode
result' = (Int -> RepoMode
forall a. Enum a => Int -> a
toEnum (Int -> RepoMode) -> (CUInt -> Int) -> CUInt -> RepoMode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
RepoMode -> IO RepoMode
forall (m :: * -> *) a. Monad m => a -> m a
return RepoMode
result'
#if defined(ENABLE_OVERLOADING)
data RepoGetModeMethodInfo
instance (signature ~ (m OSTree.Enums.RepoMode), MonadIO m, IsRepo a) => O.MethodInfo RepoGetModeMethodInfo a signature where
overloadedMethod = repoGetMode
#endif
foreign import ccall "ostree_repo_get_parent" ostree_repo_get_parent ::
Ptr Repo ->
IO (Ptr Repo)
repoGetParent ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> m Repo
repoGetParent :: a -> m Repo
repoGetParent self :: a
self = IO Repo -> m Repo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Repo -> m Repo) -> IO Repo -> m Repo
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr Repo
result <- Ptr Repo -> IO (Ptr Repo)
ostree_repo_get_parent Ptr Repo
self'
Text -> Ptr Repo -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoGetParent" Ptr Repo
result
Repo
result' <- ((ManagedPtr Repo -> Repo) -> Ptr Repo -> IO Repo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Repo -> Repo
Repo) Ptr Repo
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Repo -> IO Repo
forall (m :: * -> *) a. Monad m => a -> m a
return Repo
result'
#if defined(ENABLE_OVERLOADING)
data RepoGetParentMethodInfo
instance (signature ~ (m Repo), MonadIO m, IsRepo a) => O.MethodInfo RepoGetParentMethodInfo a signature where
overloadedMethod = repoGetParent
#endif
foreign import ccall "ostree_repo_get_path" ostree_repo_get_path ::
Ptr Repo ->
IO (Ptr Gio.File.File)
repoGetPath ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> m Gio.File.File
repoGetPath :: a -> m File
repoGetPath self :: a
self = IO File -> m File
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO File -> m File) -> IO File -> m File
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr File
result <- Ptr Repo -> IO (Ptr File)
ostree_repo_get_path Ptr Repo
self'
Text -> Ptr File -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoGetPath" Ptr File
result
File
result' <- ((ManagedPtr File -> File) -> Ptr File -> IO File
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr File -> File
Gio.File.File) Ptr File
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
File -> IO File
forall (m :: * -> *) a. Monad m => a -> m a
return File
result'
#if defined(ENABLE_OVERLOADING)
data RepoGetPathMethodInfo
instance (signature ~ (m Gio.File.File), MonadIO m, IsRepo a) => O.MethodInfo RepoGetPathMethodInfo a signature where
overloadedMethod = repoGetPath
#endif
foreign import ccall "ostree_repo_get_remote_boolean_option" ostree_repo_get_remote_boolean_option ::
Ptr Repo ->
CString ->
CString ->
CInt ->
Ptr CInt ->
Ptr (Ptr GError) ->
IO CInt
repoGetRemoteBooleanOption ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> T.Text
-> T.Text
-> Bool
-> m (Bool)
repoGetRemoteBooleanOption :: a -> Text -> Text -> Bool -> m Bool
repoGetRemoteBooleanOption self :: a
self remoteName :: Text
remoteName optionName :: Text
optionName defaultValue :: Bool
defaultValue = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
remoteName' <- Text -> IO CString
textToCString Text
remoteName
CString
optionName' <- Text -> IO CString
textToCString Text
optionName
let defaultValue' :: CInt
defaultValue' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
defaultValue
Ptr CInt
outValue <- IO (Ptr CInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CInt)
IO Bool -> IO () -> IO Bool
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> CString
-> CInt
-> Ptr CInt
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_get_remote_boolean_option Ptr Repo
self' CString
remoteName' CString
optionName' CInt
defaultValue' Ptr CInt
outValue
CInt
outValue' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
outValue
let outValue'' :: Bool
outValue'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
outValue'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
remoteName'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
optionName'
Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
outValue
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
outValue''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
remoteName'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
optionName'
Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
outValue
)
#if defined(ENABLE_OVERLOADING)
data RepoGetRemoteBooleanOptionMethodInfo
instance (signature ~ (T.Text -> T.Text -> Bool -> m (Bool)), MonadIO m, IsRepo a) => O.MethodInfo RepoGetRemoteBooleanOptionMethodInfo a signature where
overloadedMethod = repoGetRemoteBooleanOption
#endif
foreign import ccall "ostree_repo_get_remote_list_option" ostree_repo_get_remote_list_option ::
Ptr Repo ->
CString ->
CString ->
Ptr (Ptr CString) ->
Ptr (Ptr GError) ->
IO CInt
repoGetRemoteListOption ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> T.Text
-> T.Text
-> m ([T.Text])
repoGetRemoteListOption :: a -> Text -> Text -> m [Text]
repoGetRemoteListOption self :: a
self remoteName :: Text
remoteName optionName :: Text
optionName = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
remoteName' <- Text -> IO CString
textToCString Text
remoteName
CString
optionName' <- Text -> IO CString
textToCString Text
optionName
Ptr (Ptr CString)
outValue <- IO (Ptr (Ptr CString))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr CString))
IO [Text] -> IO () -> IO [Text]
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> CString
-> Ptr (Ptr CString)
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_get_remote_list_option Ptr Repo
self' CString
remoteName' CString
optionName' Ptr (Ptr CString)
outValue
Ptr CString
outValue' <- Ptr (Ptr CString) -> IO (Ptr CString)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr CString)
outValue
[Text]
outValue'' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
outValue'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outValue'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outValue'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
remoteName'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
optionName'
Ptr (Ptr CString) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CString)
outValue
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
outValue''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
remoteName'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
optionName'
Ptr (Ptr CString) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CString)
outValue
)
#if defined(ENABLE_OVERLOADING)
data RepoGetRemoteListOptionMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ([T.Text])), MonadIO m, IsRepo a) => O.MethodInfo RepoGetRemoteListOptionMethodInfo a signature where
overloadedMethod = repoGetRemoteListOption
#endif
foreign import ccall "ostree_repo_get_remote_option" ostree_repo_get_remote_option ::
Ptr Repo ->
CString ->
CString ->
CString ->
Ptr CString ->
Ptr (Ptr GError) ->
IO CInt
repoGetRemoteOption ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> T.Text
-> T.Text
-> Maybe (T.Text)
-> m (T.Text)
repoGetRemoteOption :: a -> Text -> Text -> Maybe Text -> m Text
repoGetRemoteOption self :: a
self remoteName :: Text
remoteName optionName :: Text
optionName defaultValue :: Maybe Text
defaultValue = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
remoteName' <- Text -> IO CString
textToCString Text
remoteName
CString
optionName' <- Text -> IO CString
textToCString Text
optionName
CString
maybeDefaultValue <- case Maybe Text
defaultValue of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jDefaultValue :: Text
jDefaultValue -> do
CString
jDefaultValue' <- Text -> IO CString
textToCString Text
jDefaultValue
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jDefaultValue'
Ptr CString
outValue <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CString)
IO Text -> IO () -> IO Text
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> CString
-> CString
-> Ptr CString
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_get_remote_option Ptr Repo
self' CString
remoteName' CString
optionName' CString
maybeDefaultValue Ptr CString
outValue
CString
outValue' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
outValue
Text
outValue'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outValue'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
outValue'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
remoteName'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
optionName'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeDefaultValue
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outValue
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
outValue''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
remoteName'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
optionName'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeDefaultValue
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outValue
)
#if defined(ENABLE_OVERLOADING)
data RepoGetRemoteOptionMethodInfo
instance (signature ~ (T.Text -> T.Text -> Maybe (T.Text) -> m (T.Text)), MonadIO m, IsRepo a) => O.MethodInfo RepoGetRemoteOptionMethodInfo a signature where
overloadedMethod = repoGetRemoteOption
#endif
foreign import ccall "ostree_repo_gpg_verify_data" ostree_repo_gpg_verify_data ::
Ptr Repo ->
CString ->
Ptr GLib.Bytes.Bytes ->
Ptr GLib.Bytes.Bytes ->
Ptr Gio.File.File ->
Ptr Gio.File.File ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr OSTree.GpgVerifyResult.GpgVerifyResult)
repoGpgVerifyData ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.File.IsFile c, Gio.Cancellable.IsCancellable d) =>
a
-> Maybe (T.Text)
-> GLib.Bytes.Bytes
-> GLib.Bytes.Bytes
-> Maybe (b)
-> Maybe (c)
-> Maybe (d)
-> m OSTree.GpgVerifyResult.GpgVerifyResult
repoGpgVerifyData :: a
-> Maybe Text
-> Bytes
-> Bytes
-> Maybe b
-> Maybe c
-> Maybe d
-> m GpgVerifyResult
repoGpgVerifyData self :: a
self remoteName :: Maybe Text
remoteName data_ :: Bytes
data_ signatures :: Bytes
signatures keyringdir :: Maybe b
keyringdir extraKeyring :: Maybe c
extraKeyring cancellable :: Maybe d
cancellable = IO GpgVerifyResult -> m GpgVerifyResult
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GpgVerifyResult -> m GpgVerifyResult)
-> IO GpgVerifyResult -> m GpgVerifyResult
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
maybeRemoteName <- case Maybe Text
remoteName of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jRemoteName :: Text
jRemoteName -> do
CString
jRemoteName' <- Text -> IO CString
textToCString Text
jRemoteName
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jRemoteName'
Ptr Bytes
data_' <- Bytes -> IO (Ptr Bytes)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bytes
data_
Ptr Bytes
signatures' <- Bytes -> IO (Ptr Bytes)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bytes
signatures
Ptr File
maybeKeyringdir <- case Maybe b
keyringdir of
Nothing -> Ptr File -> IO (Ptr File)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
forall a. Ptr a
nullPtr
Just jKeyringdir :: b
jKeyringdir -> do
Ptr File
jKeyringdir' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jKeyringdir
Ptr File -> IO (Ptr File)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
jKeyringdir'
Ptr File
maybeExtraKeyring <- case Maybe c
extraKeyring of
Nothing -> Ptr File -> IO (Ptr File)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
forall a. Ptr a
nullPtr
Just jExtraKeyring :: c
jExtraKeyring -> do
Ptr File
jExtraKeyring' <- c -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jExtraKeyring
Ptr File -> IO (Ptr File)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
jExtraKeyring'
Ptr Cancellable
maybeCancellable <- case Maybe d
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: d
jCancellable -> do
Ptr Cancellable
jCancellable' <- d -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr d
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO GpgVerifyResult -> IO () -> IO GpgVerifyResult
forall a b. IO a -> IO b -> IO a
onException (do
Ptr GpgVerifyResult
result <- (Ptr (Ptr GError) -> IO (Ptr GpgVerifyResult))
-> IO (Ptr GpgVerifyResult)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr GpgVerifyResult))
-> IO (Ptr GpgVerifyResult))
-> (Ptr (Ptr GError) -> IO (Ptr GpgVerifyResult))
-> IO (Ptr GpgVerifyResult)
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr Bytes
-> Ptr Bytes
-> Ptr File
-> Ptr File
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr GpgVerifyResult)
ostree_repo_gpg_verify_data Ptr Repo
self' CString
maybeRemoteName Ptr Bytes
data_' Ptr Bytes
signatures' Ptr File
maybeKeyringdir Ptr File
maybeExtraKeyring Ptr Cancellable
maybeCancellable
Text -> Ptr GpgVerifyResult -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoGpgVerifyData" Ptr GpgVerifyResult
result
GpgVerifyResult
result' <- ((ManagedPtr GpgVerifyResult -> GpgVerifyResult)
-> Ptr GpgVerifyResult -> IO GpgVerifyResult
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr GpgVerifyResult -> GpgVerifyResult
OSTree.GpgVerifyResult.GpgVerifyResult) Ptr GpgVerifyResult
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Bytes -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Bytes
data_
Bytes -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Bytes
signatures
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
keyringdir b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
extraKeyring c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe d -> (d -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe d
cancellable d -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeRemoteName
GpgVerifyResult -> IO GpgVerifyResult
forall (m :: * -> *) a. Monad m => a -> m a
return GpgVerifyResult
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeRemoteName
)
#if defined(ENABLE_OVERLOADING)
data RepoGpgVerifyDataMethodInfo
instance (signature ~ (Maybe (T.Text) -> GLib.Bytes.Bytes -> GLib.Bytes.Bytes -> Maybe (b) -> Maybe (c) -> Maybe (d) -> m OSTree.GpgVerifyResult.GpgVerifyResult), MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.File.IsFile c, Gio.Cancellable.IsCancellable d) => O.MethodInfo RepoGpgVerifyDataMethodInfo a signature where
overloadedMethod = repoGpgVerifyData
#endif
foreign import ccall "ostree_repo_has_object" ostree_repo_has_object ::
Ptr Repo ->
CUInt ->
CString ->
Ptr CInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoHasObject ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> OSTree.Enums.ObjectType
-> T.Text
-> Maybe (b)
-> m (Bool)
repoHasObject :: a -> ObjectType -> Text -> Maybe b -> m Bool
repoHasObject self :: a
self objtype :: ObjectType
objtype checksum :: Text
checksum cancellable :: Maybe b
cancellable = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let objtype' :: CUInt
objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
CString
checksum' <- Text -> IO CString
textToCString Text
checksum
Ptr CInt
outHaveObject <- IO (Ptr CInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CInt)
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO Bool -> IO () -> IO Bool
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CUInt
-> CString
-> Ptr CInt
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_has_object Ptr Repo
self' CUInt
objtype' CString
checksum' Ptr CInt
outHaveObject Ptr Cancellable
maybeCancellable
CInt
outHaveObject' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
outHaveObject
let outHaveObject'' :: Bool
outHaveObject'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
outHaveObject'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
outHaveObject
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
outHaveObject''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
outHaveObject
)
#if defined(ENABLE_OVERLOADING)
data RepoHasObjectMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> Maybe (b) -> m (Bool)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoHasObjectMethodInfo a signature where
overloadedMethod = repoHasObject
#endif
foreign import ccall "ostree_repo_hash" ostree_repo_hash ::
Ptr Repo ->
IO Word32
repoHash ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> m Word32
repoHash :: a -> m Word32
repoHash self :: a
self = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Word32
result <- Ptr Repo -> IO Word32
ostree_repo_hash Ptr Repo
self'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data RepoHashMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsRepo a) => O.MethodInfo RepoHashMethodInfo a signature where
overloadedMethod = repoHash
#endif
foreign import ccall "ostree_repo_import_object_from" ostree_repo_import_object_from ::
Ptr Repo ->
Ptr Repo ->
CUInt ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoImportObjectFrom ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, IsRepo b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> OSTree.Enums.ObjectType
-> T.Text
-> Maybe (c)
-> m ()
repoImportObjectFrom :: a -> b -> ObjectType -> Text -> Maybe c -> m ()
repoImportObjectFrom self :: a
self source :: b
source objtype :: ObjectType
objtype checksum :: Text
checksum cancellable :: Maybe c
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr Repo
source' <- b -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
source
let objtype' :: CUInt
objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
CString
checksum' <- Text -> IO CString
textToCString Text
checksum
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr Repo
-> CUInt
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_import_object_from Ptr Repo
self' Ptr Repo
source' CUInt
objtype' CString
checksum' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
source
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
)
#if defined(ENABLE_OVERLOADING)
data RepoImportObjectFromMethodInfo
instance (signature ~ (b -> OSTree.Enums.ObjectType -> T.Text -> Maybe (c) -> m ()), MonadIO m, IsRepo a, IsRepo b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoImportObjectFromMethodInfo a signature where
overloadedMethod = repoImportObjectFrom
#endif
foreign import ccall "ostree_repo_import_object_from_with_trust" ostree_repo_import_object_from_with_trust ::
Ptr Repo ->
Ptr Repo ->
CUInt ->
CString ->
CInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoImportObjectFromWithTrust ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, IsRepo b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> OSTree.Enums.ObjectType
-> T.Text
-> Bool
-> Maybe (c)
-> m ()
repoImportObjectFromWithTrust :: a -> b -> ObjectType -> Text -> Bool -> Maybe c -> m ()
repoImportObjectFromWithTrust self :: a
self source :: b
source objtype :: ObjectType
objtype checksum :: Text
checksum trusted :: Bool
trusted cancellable :: Maybe c
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr Repo
source' <- b -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
source
let objtype' :: CUInt
objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
CString
checksum' <- Text -> IO CString
textToCString Text
checksum
let trusted' :: CInt
trusted' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
trusted
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr Repo
-> CUInt
-> CString
-> CInt
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_import_object_from_with_trust Ptr Repo
self' Ptr Repo
source' CUInt
objtype' CString
checksum' CInt
trusted' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
source
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
)
#if defined(ENABLE_OVERLOADING)
data RepoImportObjectFromWithTrustMethodInfo
instance (signature ~ (b -> OSTree.Enums.ObjectType -> T.Text -> Bool -> Maybe (c) -> m ()), MonadIO m, IsRepo a, IsRepo b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoImportObjectFromWithTrustMethodInfo a signature where
overloadedMethod = repoImportObjectFromWithTrust
#endif
foreign import ccall "ostree_repo_is_system" ostree_repo_is_system ::
Ptr Repo ->
IO CInt
repoIsSystem ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> m Bool
repoIsSystem :: a -> m Bool
repoIsSystem repo :: a
repo = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
repo' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
repo
CInt
result <- Ptr Repo -> IO CInt
ostree_repo_is_system Ptr Repo
repo'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
repo
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data RepoIsSystemMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsRepo a) => O.MethodInfo RepoIsSystemMethodInfo a signature where
overloadedMethod = repoIsSystem
#endif
foreign import ccall "ostree_repo_is_writable" ostree_repo_is_writable ::
Ptr Repo ->
Ptr (Ptr GError) ->
IO CInt
repoIsWritable ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> m ()
repoIsWritable :: a -> m ()
repoIsWritable self :: a
self = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo -> Ptr (Ptr GError) -> IO CInt
ostree_repo_is_writable Ptr Repo
self'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoIsWritableMethodInfo
instance (signature ~ (m ()), MonadIO m, IsRepo a) => O.MethodInfo RepoIsWritableMethodInfo a signature where
overloadedMethod = repoIsWritable
#endif
#if defined(ENABLE_OVERLOADING)
data RepoListCollectionRefsMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "listCollectionRefs" Repo) => O.MethodInfo RepoListCollectionRefsMethodInfo o p where
overloadedMethod = undefined
#endif
#if defined(ENABLE_OVERLOADING)
data RepoListCommitObjectsStartingWithMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "listCommitObjectsStartingWith" Repo) => O.MethodInfo RepoListCommitObjectsStartingWithMethodInfo o p where
overloadedMethod = undefined
#endif
#if defined(ENABLE_OVERLOADING)
data RepoListObjectsMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "listObjects" Repo) => O.MethodInfo RepoListObjectsMethodInfo o p where
overloadedMethod = undefined
#endif
#if defined(ENABLE_OVERLOADING)
data RepoListRefsMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "listRefs" Repo) => O.MethodInfo RepoListRefsMethodInfo o p where
overloadedMethod = undefined
#endif
#if defined(ENABLE_OVERLOADING)
data RepoListRefsExtMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "listRefsExt" Repo) => O.MethodInfo RepoListRefsExtMethodInfo o p where
overloadedMethod = undefined
#endif
foreign import ccall "ostree_repo_list_static_delta_names" ostree_repo_list_static_delta_names ::
Ptr Repo ->
Ptr (Ptr (GPtrArray CString)) ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoListStaticDeltaNames ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m ([T.Text])
repoListStaticDeltaNames :: a -> Maybe b -> m [Text]
repoListStaticDeltaNames self :: a
self cancellable :: Maybe b
cancellable = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr (Ptr (GPtrArray CString))
outDeltas <- IO (Ptr (Ptr (GPtrArray CString)))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr (GPtrArray CString)))
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO [Text] -> IO () -> IO [Text]
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr (Ptr (GPtrArray CString))
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_list_static_delta_names Ptr Repo
self' Ptr (Ptr (GPtrArray CString))
outDeltas Ptr Cancellable
maybeCancellable
Ptr (GPtrArray CString)
outDeltas' <- Ptr (Ptr (GPtrArray CString)) -> IO (Ptr (GPtrArray CString))
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr (GPtrArray CString))
outDeltas
[CString]
outDeltas'' <- Ptr (GPtrArray CString) -> IO [CString]
forall a. Ptr (GPtrArray (Ptr a)) -> IO [Ptr a]
unpackGPtrArray Ptr (GPtrArray CString)
outDeltas'
[Text]
outDeltas''' <- (CString -> IO Text) -> [CString] -> IO [Text]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText [CString]
outDeltas''
Ptr (GPtrArray CString) -> IO ()
forall a. Ptr (GPtrArray a) -> IO ()
unrefPtrArray Ptr (GPtrArray CString)
outDeltas'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Ptr (Ptr (GPtrArray CString)) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr (GPtrArray CString))
outDeltas
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
outDeltas'''
) (do
Ptr (Ptr (GPtrArray CString)) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr (GPtrArray CString))
outDeltas
)
#if defined(ENABLE_OVERLOADING)
data RepoListStaticDeltaNamesMethodInfo
instance (signature ~ (Maybe (b) -> m ([T.Text])), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoListStaticDeltaNamesMethodInfo a signature where
overloadedMethod = repoListStaticDeltaNames
#endif
foreign import ccall "ostree_repo_load_commit" ostree_repo_load_commit ::
Ptr Repo ->
CString ->
Ptr (Ptr GVariant) ->
Ptr CUInt ->
Ptr (Ptr GError) ->
IO CInt
repoLoadCommit ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> T.Text
-> m ((GVariant, [OSTree.Flags.RepoCommitState]))
repoLoadCommit :: a -> Text -> m (GVariant, [RepoCommitState])
repoLoadCommit self :: a
self checksum :: Text
checksum = IO (GVariant, [RepoCommitState]) -> m (GVariant, [RepoCommitState])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GVariant, [RepoCommitState])
-> m (GVariant, [RepoCommitState]))
-> IO (GVariant, [RepoCommitState])
-> m (GVariant, [RepoCommitState])
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
checksum' <- Text -> IO CString
textToCString Text
checksum
Ptr (Ptr GVariant)
outCommit <- IO (Ptr (Ptr GVariant))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr GVariant))
Ptr CUInt
outState <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
IO (GVariant, [RepoCommitState])
-> IO () -> IO (GVariant, [RepoCommitState])
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr (Ptr GVariant)
-> Ptr CUInt
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_load_commit Ptr Repo
self' CString
checksum' Ptr (Ptr GVariant)
outCommit Ptr CUInt
outState
Ptr GVariant
outCommit' <- Ptr (Ptr GVariant) -> IO (Ptr GVariant)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr GVariant)
outCommit
GVariant
outCommit'' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
outCommit'
CUInt
outState' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
outState
let outState'' :: [RepoCommitState]
outState'' = CUInt -> [RepoCommitState]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
outState'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
Ptr (Ptr GVariant) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr GVariant)
outCommit
Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
outState
(GVariant, [RepoCommitState]) -> IO (GVariant, [RepoCommitState])
forall (m :: * -> *) a. Monad m => a -> m a
return (GVariant
outCommit'', [RepoCommitState]
outState'')
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
Ptr (Ptr GVariant) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr GVariant)
outCommit
Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
outState
)
#if defined(ENABLE_OVERLOADING)
data RepoLoadCommitMethodInfo
instance (signature ~ (T.Text -> m ((GVariant, [OSTree.Flags.RepoCommitState]))), MonadIO m, IsRepo a) => O.MethodInfo RepoLoadCommitMethodInfo a signature where
overloadedMethod = repoLoadCommit
#endif
foreign import ccall "ostree_repo_load_file" ostree_repo_load_file ::
Ptr Repo ->
CString ->
Ptr (Ptr Gio.InputStream.InputStream) ->
Ptr (Ptr Gio.FileInfo.FileInfo) ->
Ptr (Ptr GVariant) ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoLoadFile ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Maybe (b)
-> m ((Maybe Gio.InputStream.InputStream, Maybe Gio.FileInfo.FileInfo, Maybe GVariant))
repoLoadFile :: a
-> Text
-> Maybe b
-> m (Maybe InputStream, Maybe FileInfo, Maybe GVariant)
repoLoadFile self :: a
self checksum :: Text
checksum cancellable :: Maybe b
cancellable = IO (Maybe InputStream, Maybe FileInfo, Maybe GVariant)
-> m (Maybe InputStream, Maybe FileInfo, Maybe GVariant)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe InputStream, Maybe FileInfo, Maybe GVariant)
-> m (Maybe InputStream, Maybe FileInfo, Maybe GVariant))
-> IO (Maybe InputStream, Maybe FileInfo, Maybe GVariant)
-> m (Maybe InputStream, Maybe FileInfo, Maybe GVariant)
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
checksum' <- Text -> IO CString
textToCString Text
checksum
Ptr (Ptr InputStream)
outInput <- IO (Ptr (Ptr InputStream))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr Gio.InputStream.InputStream))
Ptr (Ptr FileInfo)
outFileInfo <- IO (Ptr (Ptr FileInfo))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr Gio.FileInfo.FileInfo))
Ptr (Ptr GVariant)
outXattrs <- IO (Ptr (Ptr GVariant))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr GVariant))
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO (Maybe InputStream, Maybe FileInfo, Maybe GVariant)
-> IO () -> IO (Maybe InputStream, Maybe FileInfo, Maybe GVariant)
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr (Ptr InputStream)
-> Ptr (Ptr FileInfo)
-> Ptr (Ptr GVariant)
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_load_file Ptr Repo
self' CString
checksum' Ptr (Ptr InputStream)
outInput Ptr (Ptr FileInfo)
outFileInfo Ptr (Ptr GVariant)
outXattrs Ptr Cancellable
maybeCancellable
Ptr InputStream
outInput' <- Ptr (Ptr InputStream) -> IO (Ptr InputStream)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr InputStream)
outInput
Maybe InputStream
maybeOutInput' <- Ptr InputStream
-> (Ptr InputStream -> IO InputStream) -> IO (Maybe InputStream)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr InputStream
outInput' ((Ptr InputStream -> IO InputStream) -> IO (Maybe InputStream))
-> (Ptr InputStream -> IO InputStream) -> IO (Maybe InputStream)
forall a b. (a -> b) -> a -> b
$ \outInput'' :: Ptr InputStream
outInput'' -> do
InputStream
outInput''' <- ((ManagedPtr InputStream -> InputStream)
-> Ptr InputStream -> IO InputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr InputStream -> InputStream
Gio.InputStream.InputStream) Ptr InputStream
outInput''
InputStream -> IO InputStream
forall (m :: * -> *) a. Monad m => a -> m a
return InputStream
outInput'''
Ptr FileInfo
outFileInfo' <- Ptr (Ptr FileInfo) -> IO (Ptr FileInfo)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr FileInfo)
outFileInfo
Maybe FileInfo
maybeOutFileInfo' <- Ptr FileInfo
-> (Ptr FileInfo -> IO FileInfo) -> IO (Maybe FileInfo)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr FileInfo
outFileInfo' ((Ptr FileInfo -> IO FileInfo) -> IO (Maybe FileInfo))
-> (Ptr FileInfo -> IO FileInfo) -> IO (Maybe FileInfo)
forall a b. (a -> b) -> a -> b
$ \outFileInfo'' :: Ptr FileInfo
outFileInfo'' -> do
FileInfo
outFileInfo''' <- ((ManagedPtr FileInfo -> FileInfo) -> Ptr FileInfo -> IO FileInfo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr FileInfo -> FileInfo
Gio.FileInfo.FileInfo) Ptr FileInfo
outFileInfo''
FileInfo -> IO FileInfo
forall (m :: * -> *) a. Monad m => a -> m a
return FileInfo
outFileInfo'''
Ptr GVariant
outXattrs' <- Ptr (Ptr GVariant) -> IO (Ptr GVariant)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr GVariant)
outXattrs
Maybe GVariant
maybeOutXattrs' <- Ptr GVariant
-> (Ptr GVariant -> IO GVariant) -> IO (Maybe GVariant)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr GVariant
outXattrs' ((Ptr GVariant -> IO GVariant) -> IO (Maybe GVariant))
-> (Ptr GVariant -> IO GVariant) -> IO (Maybe GVariant)
forall a b. (a -> b) -> a -> b
$ \outXattrs'' :: Ptr GVariant
outXattrs'' -> do
GVariant
outXattrs''' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
outXattrs''
GVariant -> IO GVariant
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
outXattrs'''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
Ptr (Ptr InputStream) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr InputStream)
outInput
Ptr (Ptr FileInfo) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr FileInfo)
outFileInfo
Ptr (Ptr GVariant) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr GVariant)
outXattrs
(Maybe InputStream, Maybe FileInfo, Maybe GVariant)
-> IO (Maybe InputStream, Maybe FileInfo, Maybe GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe InputStream
maybeOutInput', Maybe FileInfo
maybeOutFileInfo', Maybe GVariant
maybeOutXattrs')
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
Ptr (Ptr InputStream) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr InputStream)
outInput
Ptr (Ptr FileInfo) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr FileInfo)
outFileInfo
Ptr (Ptr GVariant) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr GVariant)
outXattrs
)
#if defined(ENABLE_OVERLOADING)
data RepoLoadFileMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m ((Maybe Gio.InputStream.InputStream, Maybe Gio.FileInfo.FileInfo, Maybe GVariant))), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoLoadFileMethodInfo a signature where
overloadedMethod = repoLoadFile
#endif
foreign import ccall "ostree_repo_load_object_stream" ostree_repo_load_object_stream ::
Ptr Repo ->
CUInt ->
CString ->
Ptr (Ptr Gio.InputStream.InputStream) ->
Ptr Word64 ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoLoadObjectStream ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> OSTree.Enums.ObjectType
-> T.Text
-> Maybe (b)
-> m ((Gio.InputStream.InputStream, Word64))
repoLoadObjectStream :: a -> ObjectType -> Text -> Maybe b -> m (InputStream, Word64)
repoLoadObjectStream self :: a
self objtype :: ObjectType
objtype checksum :: Text
checksum cancellable :: Maybe b
cancellable = IO (InputStream, Word64) -> m (InputStream, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (InputStream, Word64) -> m (InputStream, Word64))
-> IO (InputStream, Word64) -> m (InputStream, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let objtype' :: CUInt
objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
CString
checksum' <- Text -> IO CString
textToCString Text
checksum
Ptr (Ptr InputStream)
outInput <- IO (Ptr (Ptr InputStream))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr Gio.InputStream.InputStream))
Ptr Word64
outSize <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO (InputStream, Word64) -> IO () -> IO (InputStream, Word64)
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CUInt
-> CString
-> Ptr (Ptr InputStream)
-> Ptr Word64
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_load_object_stream Ptr Repo
self' CUInt
objtype' CString
checksum' Ptr (Ptr InputStream)
outInput Ptr Word64
outSize Ptr Cancellable
maybeCancellable
Ptr InputStream
outInput' <- Ptr (Ptr InputStream) -> IO (Ptr InputStream)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr InputStream)
outInput
InputStream
outInput'' <- ((ManagedPtr InputStream -> InputStream)
-> Ptr InputStream -> IO InputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr InputStream -> InputStream
Gio.InputStream.InputStream) Ptr InputStream
outInput'
Word64
outSize' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
outSize
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
Ptr (Ptr InputStream) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr InputStream)
outInput
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
outSize
(InputStream, Word64) -> IO (InputStream, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (InputStream
outInput'', Word64
outSize')
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
Ptr (Ptr InputStream) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr InputStream)
outInput
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
outSize
)
#if defined(ENABLE_OVERLOADING)
data RepoLoadObjectStreamMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> Maybe (b) -> m ((Gio.InputStream.InputStream, Word64))), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoLoadObjectStreamMethodInfo a signature where
overloadedMethod = repoLoadObjectStream
#endif
foreign import ccall "ostree_repo_load_variant" ostree_repo_load_variant ::
Ptr Repo ->
CUInt ->
CString ->
Ptr (Ptr GVariant) ->
Ptr (Ptr GError) ->
IO CInt
repoLoadVariant ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> OSTree.Enums.ObjectType
-> T.Text
-> m (GVariant)
repoLoadVariant :: a -> ObjectType -> Text -> m GVariant
repoLoadVariant self :: a
self objtype :: ObjectType
objtype sha256 :: Text
sha256 = IO GVariant -> m GVariant
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GVariant -> m GVariant) -> IO GVariant -> m GVariant
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let objtype' :: CUInt
objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
CString
sha256' <- Text -> IO CString
textToCString Text
sha256
Ptr (Ptr GVariant)
outVariant <- IO (Ptr (Ptr GVariant))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr GVariant))
IO GVariant -> IO () -> IO GVariant
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CUInt
-> CString
-> Ptr (Ptr GVariant)
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_load_variant Ptr Repo
self' CUInt
objtype' CString
sha256' Ptr (Ptr GVariant)
outVariant
Ptr GVariant
outVariant' <- Ptr (Ptr GVariant) -> IO (Ptr GVariant)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr GVariant)
outVariant
GVariant
outVariant'' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
outVariant'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
sha256'
Ptr (Ptr GVariant) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr GVariant)
outVariant
GVariant -> IO GVariant
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
outVariant''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
sha256'
Ptr (Ptr GVariant) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr GVariant)
outVariant
)
#if defined(ENABLE_OVERLOADING)
data RepoLoadVariantMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> m (GVariant)), MonadIO m, IsRepo a) => O.MethodInfo RepoLoadVariantMethodInfo a signature where
overloadedMethod = repoLoadVariant
#endif
foreign import ccall "ostree_repo_load_variant_if_exists" ostree_repo_load_variant_if_exists ::
Ptr Repo ->
CUInt ->
CString ->
Ptr (Ptr GVariant) ->
Ptr (Ptr GError) ->
IO CInt
repoLoadVariantIfExists ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> OSTree.Enums.ObjectType
-> T.Text
-> m (GVariant)
repoLoadVariantIfExists :: a -> ObjectType -> Text -> m GVariant
repoLoadVariantIfExists self :: a
self objtype :: ObjectType
objtype sha256 :: Text
sha256 = IO GVariant -> m GVariant
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GVariant -> m GVariant) -> IO GVariant -> m GVariant
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let objtype' :: CUInt
objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
CString
sha256' <- Text -> IO CString
textToCString Text
sha256
Ptr (Ptr GVariant)
outVariant <- IO (Ptr (Ptr GVariant))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr GVariant))
IO GVariant -> IO () -> IO GVariant
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CUInt
-> CString
-> Ptr (Ptr GVariant)
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_load_variant_if_exists Ptr Repo
self' CUInt
objtype' CString
sha256' Ptr (Ptr GVariant)
outVariant
Ptr GVariant
outVariant' <- Ptr (Ptr GVariant) -> IO (Ptr GVariant)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr GVariant)
outVariant
GVariant
outVariant'' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
outVariant'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
sha256'
Ptr (Ptr GVariant) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr GVariant)
outVariant
GVariant -> IO GVariant
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
outVariant''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
sha256'
Ptr (Ptr GVariant) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr GVariant)
outVariant
)
#if defined(ENABLE_OVERLOADING)
data RepoLoadVariantIfExistsMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> m (GVariant)), MonadIO m, IsRepo a) => O.MethodInfo RepoLoadVariantIfExistsMethodInfo a signature where
overloadedMethod = repoLoadVariantIfExists
#endif
foreign import ccall "ostree_repo_mark_commit_partial" ostree_repo_mark_commit_partial ::
Ptr Repo ->
CString ->
CInt ->
Ptr (Ptr GError) ->
IO CInt
repoMarkCommitPartial ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> T.Text
-> Bool
-> m ()
repoMarkCommitPartial :: a -> Text -> Bool -> m ()
repoMarkCommitPartial self :: a
self checksum :: Text
checksum isPartial :: Bool
isPartial = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
checksum' <- Text -> IO CString
textToCString Text
checksum
let isPartial' :: CInt
isPartial' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
isPartial
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo -> CString -> CInt -> Ptr (Ptr GError) -> IO CInt
ostree_repo_mark_commit_partial Ptr Repo
self' CString
checksum' CInt
isPartial'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
)
#if defined(ENABLE_OVERLOADING)
data RepoMarkCommitPartialMethodInfo
instance (signature ~ (T.Text -> Bool -> m ()), MonadIO m, IsRepo a) => O.MethodInfo RepoMarkCommitPartialMethodInfo a signature where
overloadedMethod = repoMarkCommitPartial
#endif
foreign import ccall "ostree_repo_open" ostree_repo_open ::
Ptr Repo ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoOpen ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m ()
repoOpen :: a -> Maybe b -> m ()
repoOpen self :: a
self cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo -> Ptr Cancellable -> Ptr (Ptr GError) -> IO CInt
ostree_repo_open Ptr Repo
self' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoOpenMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoOpenMethodInfo a signature where
overloadedMethod = repoOpen
#endif
foreign import ccall "ostree_repo_prepare_transaction" ostree_repo_prepare_transaction ::
Ptr Repo ->
Ptr CInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoPrepareTransaction ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m (Bool)
repoPrepareTransaction :: a -> Maybe b -> m Bool
repoPrepareTransaction self :: a
self cancellable :: Maybe b
cancellable = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr CInt
outTransactionResume <- IO (Ptr CInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CInt)
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO Bool -> IO () -> IO Bool
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr CInt -> Ptr Cancellable -> Ptr (Ptr GError) -> IO CInt
ostree_repo_prepare_transaction Ptr Repo
self' Ptr CInt
outTransactionResume Ptr Cancellable
maybeCancellable
CInt
outTransactionResume' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
outTransactionResume
let outTransactionResume'' :: Bool
outTransactionResume'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
outTransactionResume'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
outTransactionResume
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
outTransactionResume''
) (do
Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
outTransactionResume
)
#if defined(ENABLE_OVERLOADING)
data RepoPrepareTransactionMethodInfo
instance (signature ~ (Maybe (b) -> m (Bool)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoPrepareTransactionMethodInfo a signature where
overloadedMethod = repoPrepareTransaction
#endif
foreign import ccall "ostree_repo_prune" ostree_repo_prune ::
Ptr Repo ->
CUInt ->
Int32 ->
Ptr Int32 ->
Ptr Int32 ->
Ptr Word64 ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoPrune ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> OSTree.Enums.RepoPruneFlags
-> Int32
-> Maybe (b)
-> m ((Int32, Int32, Word64))
repoPrune :: a -> RepoPruneFlags -> Int32 -> Maybe b -> m (Int32, Int32, Word64)
repoPrune self :: a
self flags :: RepoPruneFlags
flags depth :: Int32
depth cancellable :: Maybe b
cancellable = IO (Int32, Int32, Word64) -> m (Int32, Int32, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32, Word64) -> m (Int32, Int32, Word64))
-> IO (Int32, Int32, Word64) -> m (Int32, Int32, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let flags' :: CUInt
flags' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (RepoPruneFlags -> Int) -> RepoPruneFlags -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RepoPruneFlags -> Int
forall a. Enum a => a -> Int
fromEnum) RepoPruneFlags
flags
Ptr Int32
outObjectsTotal <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
outObjectsPruned <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Word64
outPrunedObjectSizeTotal <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO (Int32, Int32, Word64) -> IO () -> IO (Int32, Int32, Word64)
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CUInt
-> Int32
-> Ptr Int32
-> Ptr Int32
-> Ptr Word64
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_prune Ptr Repo
self' CUInt
flags' Int32
depth Ptr Int32
outObjectsTotal Ptr Int32
outObjectsPruned Ptr Word64
outPrunedObjectSizeTotal Ptr Cancellable
maybeCancellable
Int32
outObjectsTotal' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
outObjectsTotal
Int32
outObjectsPruned' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
outObjectsPruned
Word64
outPrunedObjectSizeTotal' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
outPrunedObjectSizeTotal
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
outObjectsTotal
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
outObjectsPruned
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
outPrunedObjectSizeTotal
(Int32, Int32, Word64) -> IO (Int32, Int32, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
outObjectsTotal', Int32
outObjectsPruned', Word64
outPrunedObjectSizeTotal')
) (do
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
outObjectsTotal
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
outObjectsPruned
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
outPrunedObjectSizeTotal
)
#if defined(ENABLE_OVERLOADING)
data RepoPruneMethodInfo
instance (signature ~ (OSTree.Enums.RepoPruneFlags -> Int32 -> Maybe (b) -> m ((Int32, Int32, Word64))), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoPruneMethodInfo a signature where
overloadedMethod = repoPrune
#endif
foreign import ccall "ostree_repo_prune_from_reachable" ostree_repo_prune_from_reachable ::
Ptr Repo ->
Ptr OSTree.RepoPruneOptions.RepoPruneOptions ->
Ptr Int32 ->
Ptr Int32 ->
Ptr Word64 ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoPruneFromReachable ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> OSTree.RepoPruneOptions.RepoPruneOptions
-> Maybe (b)
-> m ((Int32, Int32, Word64))
repoPruneFromReachable :: a -> RepoPruneOptions -> Maybe b -> m (Int32, Int32, Word64)
repoPruneFromReachable self :: a
self options :: RepoPruneOptions
options cancellable :: Maybe b
cancellable = IO (Int32, Int32, Word64) -> m (Int32, Int32, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32, Word64) -> m (Int32, Int32, Word64))
-> IO (Int32, Int32, Word64) -> m (Int32, Int32, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr RepoPruneOptions
options' <- RepoPruneOptions -> IO (Ptr RepoPruneOptions)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RepoPruneOptions
options
Ptr Int32
outObjectsTotal <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
outObjectsPruned <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Word64
outPrunedObjectSizeTotal <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO (Int32, Int32, Word64) -> IO () -> IO (Int32, Int32, Word64)
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr RepoPruneOptions
-> Ptr Int32
-> Ptr Int32
-> Ptr Word64
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_prune_from_reachable Ptr Repo
self' Ptr RepoPruneOptions
options' Ptr Int32
outObjectsTotal Ptr Int32
outObjectsPruned Ptr Word64
outPrunedObjectSizeTotal Ptr Cancellable
maybeCancellable
Int32
outObjectsTotal' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
outObjectsTotal
Int32
outObjectsPruned' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
outObjectsPruned
Word64
outPrunedObjectSizeTotal' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
outPrunedObjectSizeTotal
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
RepoPruneOptions -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RepoPruneOptions
options
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
outObjectsTotal
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
outObjectsPruned
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
outPrunedObjectSizeTotal
(Int32, Int32, Word64) -> IO (Int32, Int32, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
outObjectsTotal', Int32
outObjectsPruned', Word64
outPrunedObjectSizeTotal')
) (do
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
outObjectsTotal
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
outObjectsPruned
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
outPrunedObjectSizeTotal
)
#if defined(ENABLE_OVERLOADING)
data RepoPruneFromReachableMethodInfo
instance (signature ~ (OSTree.RepoPruneOptions.RepoPruneOptions -> Maybe (b) -> m ((Int32, Int32, Word64))), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoPruneFromReachableMethodInfo a signature where
overloadedMethod = repoPruneFromReachable
#endif
foreign import ccall "ostree_repo_prune_static_deltas" ostree_repo_prune_static_deltas ::
Ptr Repo ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoPruneStaticDeltas ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (T.Text)
-> Maybe (b)
-> m ()
repoPruneStaticDeltas :: a -> Maybe Text -> Maybe b -> m ()
repoPruneStaticDeltas self :: a
self commit :: Maybe Text
commit cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
maybeCommit <- case Maybe Text
commit of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jCommit :: Text
jCommit -> do
CString
jCommit' <- Text -> IO CString
textToCString Text
jCommit
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jCommit'
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString -> Ptr Cancellable -> Ptr (Ptr GError) -> IO CInt
ostree_repo_prune_static_deltas Ptr Repo
self' CString
maybeCommit Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeCommit
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeCommit
)
#if defined(ENABLE_OVERLOADING)
data RepoPruneStaticDeltasMethodInfo
instance (signature ~ (Maybe (T.Text) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoPruneStaticDeltasMethodInfo a signature where
overloadedMethod = repoPruneStaticDeltas
#endif
foreign import ccall "ostree_repo_pull" ostree_repo_pull ::
Ptr Repo ->
CString ->
Ptr CString ->
CUInt ->
Ptr OSTree.AsyncProgress.AsyncProgress ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoPull ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) =>
a
-> T.Text
-> Maybe ([T.Text])
-> [OSTree.Flags.RepoPullFlags]
-> Maybe (b)
-> Maybe (c)
-> m ()
repoPull :: a
-> Text
-> Maybe [Text]
-> [RepoPullFlags]
-> Maybe b
-> Maybe c
-> m ()
repoPull self :: a
self remoteName :: Text
remoteName refsToFetch :: Maybe [Text]
refsToFetch flags :: [RepoPullFlags]
flags progress :: Maybe b
progress cancellable :: Maybe c
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
remoteName' <- Text -> IO CString
textToCString Text
remoteName
Ptr CString
maybeRefsToFetch <- case Maybe [Text]
refsToFetch of
Nothing -> Ptr CString -> IO (Ptr CString)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
nullPtr
Just jRefsToFetch :: [Text]
jRefsToFetch -> do
Ptr CString
jRefsToFetch' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jRefsToFetch
Ptr CString -> IO (Ptr CString)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
jRefsToFetch'
let flags' :: CUInt
flags' = [RepoPullFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [RepoPullFlags]
flags
Ptr AsyncProgress
maybeProgress <- case Maybe b
progress of
Nothing -> Ptr AsyncProgress -> IO (Ptr AsyncProgress)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AsyncProgress
forall a. Ptr a
nullPtr
Just jProgress :: b
jProgress -> do
Ptr AsyncProgress
jProgress' <- b -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jProgress
Ptr AsyncProgress -> IO (Ptr AsyncProgress)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AsyncProgress
jProgress'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr CString
-> CUInt
-> Ptr AsyncProgress
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_pull Ptr Repo
self' CString
remoteName' Ptr CString
maybeRefsToFetch CUInt
flags' Ptr AsyncProgress
maybeProgress Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
progress b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
remoteName'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeRefsToFetch
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeRefsToFetch
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
remoteName'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeRefsToFetch
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeRefsToFetch
)
#if defined(ENABLE_OVERLOADING)
data RepoPullMethodInfo
instance (signature ~ (T.Text -> Maybe ([T.Text]) -> [OSTree.Flags.RepoPullFlags] -> Maybe (b) -> Maybe (c) -> m ()), MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoPullMethodInfo a signature where
overloadedMethod = repoPull
#endif
foreign import ccall "ostree_repo_pull_from_remotes_async" ostree_repo_pull_from_remotes_async ::
Ptr Repo ->
Ptr (Ptr OSTree.RepoFinderResult.RepoFinderResult) ->
Ptr GVariant ->
Ptr OSTree.AsyncProgress.AsyncProgress ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
repoPullFromRemotesAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) =>
a
-> [OSTree.RepoFinderResult.RepoFinderResult]
-> Maybe (GVariant)
-> Maybe (b)
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
repoPullFromRemotesAsync :: a
-> [RepoFinderResult]
-> Maybe GVariant
-> Maybe b
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
repoPullFromRemotesAsync self :: a
self results :: [RepoFinderResult]
results options :: Maybe GVariant
options progress :: Maybe b
progress cancellable :: Maybe c
cancellable callback :: Maybe AsyncReadyCallback
callback = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
[Ptr RepoFinderResult]
results' <- (RepoFinderResult -> IO (Ptr RepoFinderResult))
-> [RepoFinderResult] -> IO [Ptr RepoFinderResult]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM RepoFinderResult -> IO (Ptr RepoFinderResult)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [RepoFinderResult]
results
Ptr (Ptr RepoFinderResult)
results'' <- [Ptr RepoFinderResult] -> IO (Ptr (Ptr RepoFinderResult))
forall a. [Ptr a] -> IO (Ptr (Ptr a))
packZeroTerminatedPtrArray [Ptr RepoFinderResult]
results'
Ptr GVariant
maybeOptions <- case Maybe GVariant
options of
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jOptions :: GVariant
jOptions -> do
Ptr GVariant
jOptions' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jOptions
Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jOptions'
Ptr AsyncProgress
maybeProgress <- case Maybe b
progress of
Nothing -> Ptr AsyncProgress -> IO (Ptr AsyncProgress)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AsyncProgress
forall a. Ptr a
nullPtr
Just jProgress :: b
jProgress -> do
Ptr AsyncProgress
jProgress' <- b -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jProgress
Ptr AsyncProgress -> IO (Ptr AsyncProgress)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AsyncProgress
jProgress'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Repo
-> Ptr (Ptr RepoFinderResult)
-> Ptr GVariant
-> Ptr AsyncProgress
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ostree_repo_pull_from_remotes_async Ptr Repo
self' Ptr (Ptr RepoFinderResult)
results'' Ptr GVariant
maybeOptions Ptr AsyncProgress
maybeProgress Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
(RepoFinderResult -> IO ()) -> [RepoFinderResult] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ RepoFinderResult -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [RepoFinderResult]
results
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
options GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
progress b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Ptr (Ptr RepoFinderResult) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr RepoFinderResult)
results''
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RepoPullFromRemotesAsyncMethodInfo
instance (signature ~ ([OSTree.RepoFinderResult.RepoFinderResult] -> Maybe (GVariant) -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoPullFromRemotesAsyncMethodInfo a signature where
overloadedMethod = repoPullFromRemotesAsync
#endif
foreign import ccall "ostree_repo_pull_from_remotes_finish" ostree_repo_pull_from_remotes_finish ::
Ptr Repo ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
repoPullFromRemotesFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
repoPullFromRemotesFinish :: a -> b -> m ()
repoPullFromRemotesFinish self :: a
self result_ :: b
result_ = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
ostree_repo_pull_from_remotes_finish Ptr Repo
self' Ptr AsyncResult
result_'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoPullFromRemotesFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo RepoPullFromRemotesFinishMethodInfo a signature where
overloadedMethod = repoPullFromRemotesFinish
#endif
foreign import ccall "ostree_repo_pull_one_dir" ostree_repo_pull_one_dir ::
Ptr Repo ->
CString ->
CString ->
Ptr CString ->
CUInt ->
Ptr OSTree.AsyncProgress.AsyncProgress ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoPullOneDir ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) =>
a
-> T.Text
-> T.Text
-> Maybe ([T.Text])
-> [OSTree.Flags.RepoPullFlags]
-> Maybe (b)
-> Maybe (c)
-> m ()
repoPullOneDir :: a
-> Text
-> Text
-> Maybe [Text]
-> [RepoPullFlags]
-> Maybe b
-> Maybe c
-> m ()
repoPullOneDir self :: a
self remoteName :: Text
remoteName dirToPull :: Text
dirToPull refsToFetch :: Maybe [Text]
refsToFetch flags :: [RepoPullFlags]
flags progress :: Maybe b
progress cancellable :: Maybe c
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
remoteName' <- Text -> IO CString
textToCString Text
remoteName
CString
dirToPull' <- Text -> IO CString
textToCString Text
dirToPull
Ptr CString
maybeRefsToFetch <- case Maybe [Text]
refsToFetch of
Nothing -> Ptr CString -> IO (Ptr CString)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
nullPtr
Just jRefsToFetch :: [Text]
jRefsToFetch -> do
Ptr CString
jRefsToFetch' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jRefsToFetch
Ptr CString -> IO (Ptr CString)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
jRefsToFetch'
let flags' :: CUInt
flags' = [RepoPullFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [RepoPullFlags]
flags
Ptr AsyncProgress
maybeProgress <- case Maybe b
progress of
Nothing -> Ptr AsyncProgress -> IO (Ptr AsyncProgress)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AsyncProgress
forall a. Ptr a
nullPtr
Just jProgress :: b
jProgress -> do
Ptr AsyncProgress
jProgress' <- b -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jProgress
Ptr AsyncProgress -> IO (Ptr AsyncProgress)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AsyncProgress
jProgress'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> CString
-> Ptr CString
-> CUInt
-> Ptr AsyncProgress
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_pull_one_dir Ptr Repo
self' CString
remoteName' CString
dirToPull' Ptr CString
maybeRefsToFetch CUInt
flags' Ptr AsyncProgress
maybeProgress Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
progress b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
remoteName'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
dirToPull'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeRefsToFetch
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeRefsToFetch
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
remoteName'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
dirToPull'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeRefsToFetch
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeRefsToFetch
)
#if defined(ENABLE_OVERLOADING)
data RepoPullOneDirMethodInfo
instance (signature ~ (T.Text -> T.Text -> Maybe ([T.Text]) -> [OSTree.Flags.RepoPullFlags] -> Maybe (b) -> Maybe (c) -> m ()), MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoPullOneDirMethodInfo a signature where
overloadedMethod = repoPullOneDir
#endif
foreign import ccall "ostree_repo_pull_with_options" ostree_repo_pull_with_options ::
Ptr Repo ->
CString ->
Ptr GVariant ->
Ptr OSTree.AsyncProgress.AsyncProgress ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoPullWithOptions ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) =>
a
-> T.Text
-> GVariant
-> Maybe (b)
-> Maybe (c)
-> m ()
repoPullWithOptions :: a -> Text -> GVariant -> Maybe b -> Maybe c -> m ()
repoPullWithOptions self :: a
self remoteNameOrBaseurl :: Text
remoteNameOrBaseurl options :: GVariant
options progress :: Maybe b
progress cancellable :: Maybe c
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
remoteNameOrBaseurl' <- Text -> IO CString
textToCString Text
remoteNameOrBaseurl
Ptr GVariant
options' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
options
Ptr AsyncProgress
maybeProgress <- case Maybe b
progress of
Nothing -> Ptr AsyncProgress -> IO (Ptr AsyncProgress)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AsyncProgress
forall a. Ptr a
nullPtr
Just jProgress :: b
jProgress -> do
Ptr AsyncProgress
jProgress' <- b -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jProgress
Ptr AsyncProgress -> IO (Ptr AsyncProgress)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AsyncProgress
jProgress'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr GVariant
-> Ptr AsyncProgress
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_pull_with_options Ptr Repo
self' CString
remoteNameOrBaseurl' Ptr GVariant
options' Ptr AsyncProgress
maybeProgress Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
options
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
progress b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
remoteNameOrBaseurl'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
remoteNameOrBaseurl'
)
#if defined(ENABLE_OVERLOADING)
data RepoPullWithOptionsMethodInfo
instance (signature ~ (T.Text -> GVariant -> Maybe (b) -> Maybe (c) -> m ()), MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoPullWithOptionsMethodInfo a signature where
overloadedMethod = repoPullWithOptions
#endif
foreign import ccall "ostree_repo_query_object_storage_size" ostree_repo_query_object_storage_size ::
Ptr Repo ->
CUInt ->
CString ->
Ptr Word64 ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoQueryObjectStorageSize ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> OSTree.Enums.ObjectType
-> T.Text
-> Maybe (b)
-> m (Word64)
repoQueryObjectStorageSize :: a -> ObjectType -> Text -> Maybe b -> m Word64
repoQueryObjectStorageSize self :: a
self objtype :: ObjectType
objtype sha256 :: Text
sha256 cancellable :: Maybe b
cancellable = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let objtype' :: CUInt
objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
CString
sha256' <- Text -> IO CString
textToCString Text
sha256
Ptr Word64
outSize <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO Word64 -> IO () -> IO Word64
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CUInt
-> CString
-> Ptr Word64
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_query_object_storage_size Ptr Repo
self' CUInt
objtype' CString
sha256' Ptr Word64
outSize Ptr Cancellable
maybeCancellable
Word64
outSize' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
outSize
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
sha256'
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
outSize
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
outSize'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
sha256'
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
outSize
)
#if defined(ENABLE_OVERLOADING)
data RepoQueryObjectStorageSizeMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> Maybe (b) -> m (Word64)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoQueryObjectStorageSizeMethodInfo a signature where
overloadedMethod = repoQueryObjectStorageSize
#endif
foreign import ccall "ostree_repo_read_commit" ostree_repo_read_commit ::
Ptr Repo ->
CString ->
Ptr (Ptr Gio.File.File) ->
Ptr CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoReadCommit ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Maybe (b)
-> m ((Gio.File.File, T.Text))
repoReadCommit :: a -> Text -> Maybe b -> m (File, Text)
repoReadCommit self :: a
self ref :: Text
ref cancellable :: Maybe b
cancellable = IO (File, Text) -> m (File, Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (File, Text) -> m (File, Text))
-> IO (File, Text) -> m (File, Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
ref' <- Text -> IO CString
textToCString Text
ref
Ptr (Ptr File)
outRoot <- IO (Ptr (Ptr File))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr Gio.File.File))
Ptr CString
outCommit <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CString)
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO (File, Text) -> IO () -> IO (File, Text)
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr (Ptr File)
-> Ptr CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_read_commit Ptr Repo
self' CString
ref' Ptr (Ptr File)
outRoot Ptr CString
outCommit Ptr Cancellable
maybeCancellable
Ptr File
outRoot' <- Ptr (Ptr File) -> IO (Ptr File)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr File)
outRoot
File
outRoot'' <- ((ManagedPtr File -> File) -> Ptr File -> IO File
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr File -> File
Gio.File.File) Ptr File
outRoot'
CString
outCommit' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
outCommit
Text
outCommit'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outCommit'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
outCommit'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
ref'
Ptr (Ptr File) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr File)
outRoot
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outCommit
(File, Text) -> IO (File, Text)
forall (m :: * -> *) a. Monad m => a -> m a
return (File
outRoot'', Text
outCommit'')
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
ref'
Ptr (Ptr File) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr File)
outRoot
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outCommit
)
#if defined(ENABLE_OVERLOADING)
data RepoReadCommitMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m ((Gio.File.File, T.Text))), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoReadCommitMethodInfo a signature where
overloadedMethod = repoReadCommit
#endif
foreign import ccall "ostree_repo_read_commit_detached_metadata" ostree_repo_read_commit_detached_metadata ::
Ptr Repo ->
CString ->
Ptr (Ptr GVariant) ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoReadCommitDetachedMetadata ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Maybe (b)
-> m (GVariant)
repoReadCommitDetachedMetadata :: a -> Text -> Maybe b -> m GVariant
repoReadCommitDetachedMetadata self :: a
self checksum :: Text
checksum cancellable :: Maybe b
cancellable = IO GVariant -> m GVariant
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GVariant -> m GVariant) -> IO GVariant -> m GVariant
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
checksum' <- Text -> IO CString
textToCString Text
checksum
Ptr (Ptr GVariant)
outMetadata <- IO (Ptr (Ptr GVariant))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr GVariant))
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO GVariant -> IO () -> IO GVariant
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr (Ptr GVariant)
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_read_commit_detached_metadata Ptr Repo
self' CString
checksum' Ptr (Ptr GVariant)
outMetadata Ptr Cancellable
maybeCancellable
Ptr GVariant
outMetadata' <- Ptr (Ptr GVariant) -> IO (Ptr GVariant)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr GVariant)
outMetadata
GVariant
outMetadata'' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
outMetadata'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
Ptr (Ptr GVariant) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr GVariant)
outMetadata
GVariant -> IO GVariant
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
outMetadata''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
Ptr (Ptr GVariant) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr GVariant)
outMetadata
)
#if defined(ENABLE_OVERLOADING)
data RepoReadCommitDetachedMetadataMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m (GVariant)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoReadCommitDetachedMetadataMethodInfo a signature where
overloadedMethod = repoReadCommitDetachedMetadata
#endif
foreign import ccall "ostree_repo_regenerate_summary" ostree_repo_regenerate_summary ::
Ptr Repo ->
Ptr GVariant ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoRegenerateSummary ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (GVariant)
-> Maybe (b)
-> m ()
repoRegenerateSummary :: a -> Maybe GVariant -> Maybe b -> m ()
repoRegenerateSummary self :: a
self additionalMetadata :: Maybe GVariant
additionalMetadata cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr GVariant
maybeAdditionalMetadata <- case Maybe GVariant
additionalMetadata of
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jAdditionalMetadata :: GVariant
jAdditionalMetadata -> do
Ptr GVariant
jAdditionalMetadata' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jAdditionalMetadata
Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jAdditionalMetadata'
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr GVariant -> Ptr Cancellable -> Ptr (Ptr GError) -> IO CInt
ostree_repo_regenerate_summary Ptr Repo
self' Ptr GVariant
maybeAdditionalMetadata Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
additionalMetadata GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoRegenerateSummaryMethodInfo
instance (signature ~ (Maybe (GVariant) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoRegenerateSummaryMethodInfo a signature where
overloadedMethod = repoRegenerateSummary
#endif
foreign import ccall "ostree_repo_reload_config" ostree_repo_reload_config ::
Ptr Repo ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoReloadConfig ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m ()
repoReloadConfig :: a -> Maybe b -> m ()
repoReloadConfig self :: a
self cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo -> Ptr Cancellable -> Ptr (Ptr GError) -> IO CInt
ostree_repo_reload_config Ptr Repo
self' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoReloadConfigMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoReloadConfigMethodInfo a signature where
overloadedMethod = repoReloadConfig
#endif
foreign import ccall "ostree_repo_remote_add" ostree_repo_remote_add ::
Ptr Repo ->
CString ->
CString ->
Ptr GVariant ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoRemoteAdd ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> T.Text
-> Maybe (GVariant)
-> Maybe (b)
-> m ()
repoRemoteAdd :: a -> Text -> Text -> Maybe GVariant -> Maybe b -> m ()
repoRemoteAdd self :: a
self name :: Text
name url :: Text
url options :: Maybe GVariant
options cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
name' <- Text -> IO CString
textToCString Text
name
CString
url' <- Text -> IO CString
textToCString Text
url
Ptr GVariant
maybeOptions <- case Maybe GVariant
options of
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jOptions :: GVariant
jOptions -> do
Ptr GVariant
jOptions' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jOptions
Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jOptions'
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> CString
-> Ptr GVariant
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_remote_add Ptr Repo
self' CString
name' CString
url' Ptr GVariant
maybeOptions Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
options GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
url'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
url'
)
#if defined(ENABLE_OVERLOADING)
data RepoRemoteAddMethodInfo
instance (signature ~ (T.Text -> T.Text -> Maybe (GVariant) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoRemoteAddMethodInfo a signature where
overloadedMethod = repoRemoteAdd
#endif
foreign import ccall "ostree_repo_remote_change" ostree_repo_remote_change ::
Ptr Repo ->
Ptr Gio.File.File ->
CUInt ->
CString ->
CString ->
Ptr GVariant ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoRemoteChange ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) =>
a
-> Maybe (b)
-> OSTree.Enums.RepoRemoteChange
-> T.Text
-> T.Text
-> Maybe (GVariant)
-> Maybe (c)
-> m ()
repoRemoteChange :: a
-> Maybe b
-> RepoRemoteChange
-> Text
-> Text
-> Maybe GVariant
-> Maybe c
-> m ()
repoRemoteChange self :: a
self sysroot :: Maybe b
sysroot changeop :: RepoRemoteChange
changeop name :: Text
name url :: Text
url options :: Maybe GVariant
options cancellable :: Maybe c
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr File
maybeSysroot <- case Maybe b
sysroot of
Nothing -> Ptr File -> IO (Ptr File)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
forall a. Ptr a
nullPtr
Just jSysroot :: b
jSysroot -> do
Ptr File
jSysroot' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jSysroot
Ptr File -> IO (Ptr File)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
jSysroot'
let changeop' :: CUInt
changeop' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (RepoRemoteChange -> Int) -> RepoRemoteChange -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RepoRemoteChange -> Int
forall a. Enum a => a -> Int
fromEnum) RepoRemoteChange
changeop
CString
name' <- Text -> IO CString
textToCString Text
name
CString
url' <- Text -> IO CString
textToCString Text
url
Ptr GVariant
maybeOptions <- case Maybe GVariant
options of
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jOptions :: GVariant
jOptions -> do
Ptr GVariant
jOptions' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jOptions
Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jOptions'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr File
-> CUInt
-> CString
-> CString
-> Ptr GVariant
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_remote_change Ptr Repo
self' Ptr File
maybeSysroot CUInt
changeop' CString
name' CString
url' Ptr GVariant
maybeOptions Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
sysroot b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
options GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
url'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
url'
)
#if defined(ENABLE_OVERLOADING)
data RepoRemoteChangeMethodInfo
instance (signature ~ (Maybe (b) -> OSTree.Enums.RepoRemoteChange -> T.Text -> T.Text -> Maybe (GVariant) -> Maybe (c) -> m ()), MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoRemoteChangeMethodInfo a signature where
overloadedMethod = repoRemoteChange
#endif
foreign import ccall "ostree_repo_remote_delete" ostree_repo_remote_delete ::
Ptr Repo ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoRemoteDelete ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Maybe (b)
-> m ()
repoRemoteDelete :: a -> Text -> Maybe b -> m ()
repoRemoteDelete self :: a
self name :: Text
name cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString -> Ptr Cancellable -> Ptr (Ptr GError) -> IO CInt
ostree_repo_remote_delete Ptr Repo
self' CString
name' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
)
#if defined(ENABLE_OVERLOADING)
data RepoRemoteDeleteMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoRemoteDeleteMethodInfo a signature where
overloadedMethod = repoRemoteDelete
#endif
foreign import ccall "ostree_repo_remote_fetch_summary" ostree_repo_remote_fetch_summary ::
Ptr Repo ->
CString ->
Ptr (Ptr GLib.Bytes.Bytes) ->
Ptr (Ptr GLib.Bytes.Bytes) ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoRemoteFetchSummary ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Maybe (b)
-> m ((GLib.Bytes.Bytes, GLib.Bytes.Bytes))
repoRemoteFetchSummary :: a -> Text -> Maybe b -> m (Bytes, Bytes)
repoRemoteFetchSummary self :: a
self name :: Text
name cancellable :: Maybe b
cancellable = IO (Bytes, Bytes) -> m (Bytes, Bytes)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bytes, Bytes) -> m (Bytes, Bytes))
-> IO (Bytes, Bytes) -> m (Bytes, Bytes)
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr (Ptr Bytes)
outSummary <- IO (Ptr (Ptr Bytes))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
Ptr (Ptr Bytes)
outSignatures <- IO (Ptr (Ptr Bytes))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO (Bytes, Bytes) -> IO () -> IO (Bytes, Bytes)
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr (Ptr Bytes)
-> Ptr (Ptr Bytes)
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_remote_fetch_summary Ptr Repo
self' CString
name' Ptr (Ptr Bytes)
outSummary Ptr (Ptr Bytes)
outSignatures Ptr Cancellable
maybeCancellable
Ptr Bytes
outSummary' <- Ptr (Ptr Bytes) -> IO (Ptr Bytes)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Bytes)
outSummary
Bytes
outSummary'' <- ((ManagedPtr Bytes -> Bytes) -> Ptr Bytes -> IO Bytes
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Bytes -> Bytes
GLib.Bytes.Bytes) Ptr Bytes
outSummary'
Ptr Bytes
outSignatures' <- Ptr (Ptr Bytes) -> IO (Ptr Bytes)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Bytes)
outSignatures
Bytes
outSignatures'' <- ((ManagedPtr Bytes -> Bytes) -> Ptr Bytes -> IO Bytes
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Bytes -> Bytes
GLib.Bytes.Bytes) Ptr Bytes
outSignatures'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
Ptr (Ptr Bytes) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Bytes)
outSummary
Ptr (Ptr Bytes) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Bytes)
outSignatures
(Bytes, Bytes) -> IO (Bytes, Bytes)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bytes
outSummary'', Bytes
outSignatures'')
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
Ptr (Ptr Bytes) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Bytes)
outSummary
Ptr (Ptr Bytes) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Bytes)
outSignatures
)
#if defined(ENABLE_OVERLOADING)
data RepoRemoteFetchSummaryMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m ((GLib.Bytes.Bytes, GLib.Bytes.Bytes))), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoRemoteFetchSummaryMethodInfo a signature where
overloadedMethod = repoRemoteFetchSummary
#endif
foreign import ccall "ostree_repo_remote_fetch_summary_with_options" ostree_repo_remote_fetch_summary_with_options ::
Ptr Repo ->
CString ->
Ptr GVariant ->
Ptr (Ptr GLib.Bytes.Bytes) ->
Ptr (Ptr GLib.Bytes.Bytes) ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoRemoteFetchSummaryWithOptions ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Maybe (GVariant)
-> Maybe (b)
-> m ((GLib.Bytes.Bytes, GLib.Bytes.Bytes))
repoRemoteFetchSummaryWithOptions :: a -> Text -> Maybe GVariant -> Maybe b -> m (Bytes, Bytes)
repoRemoteFetchSummaryWithOptions self :: a
self name :: Text
name options :: Maybe GVariant
options cancellable :: Maybe b
cancellable = IO (Bytes, Bytes) -> m (Bytes, Bytes)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bytes, Bytes) -> m (Bytes, Bytes))
-> IO (Bytes, Bytes) -> m (Bytes, Bytes)
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr GVariant
maybeOptions <- case Maybe GVariant
options of
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jOptions :: GVariant
jOptions -> do
Ptr GVariant
jOptions' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jOptions
Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jOptions'
Ptr (Ptr Bytes)
outSummary <- IO (Ptr (Ptr Bytes))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
Ptr (Ptr Bytes)
outSignatures <- IO (Ptr (Ptr Bytes))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO (Bytes, Bytes) -> IO () -> IO (Bytes, Bytes)
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr GVariant
-> Ptr (Ptr Bytes)
-> Ptr (Ptr Bytes)
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_remote_fetch_summary_with_options Ptr Repo
self' CString
name' Ptr GVariant
maybeOptions Ptr (Ptr Bytes)
outSummary Ptr (Ptr Bytes)
outSignatures Ptr Cancellable
maybeCancellable
Ptr Bytes
outSummary' <- Ptr (Ptr Bytes) -> IO (Ptr Bytes)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Bytes)
outSummary
Bytes
outSummary'' <- ((ManagedPtr Bytes -> Bytes) -> Ptr Bytes -> IO Bytes
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Bytes -> Bytes
GLib.Bytes.Bytes) Ptr Bytes
outSummary'
Ptr Bytes
outSignatures' <- Ptr (Ptr Bytes) -> IO (Ptr Bytes)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Bytes)
outSignatures
Bytes
outSignatures'' <- ((ManagedPtr Bytes -> Bytes) -> Ptr Bytes -> IO Bytes
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Bytes -> Bytes
GLib.Bytes.Bytes) Ptr Bytes
outSignatures'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
options GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
Ptr (Ptr Bytes) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Bytes)
outSummary
Ptr (Ptr Bytes) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Bytes)
outSignatures
(Bytes, Bytes) -> IO (Bytes, Bytes)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bytes
outSummary'', Bytes
outSignatures'')
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
Ptr (Ptr Bytes) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Bytes)
outSummary
Ptr (Ptr Bytes) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Bytes)
outSignatures
)
#if defined(ENABLE_OVERLOADING)
data RepoRemoteFetchSummaryWithOptionsMethodInfo
instance (signature ~ (T.Text -> Maybe (GVariant) -> Maybe (b) -> m ((GLib.Bytes.Bytes, GLib.Bytes.Bytes))), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoRemoteFetchSummaryWithOptionsMethodInfo a signature where
overloadedMethod = repoRemoteFetchSummaryWithOptions
#endif
foreign import ccall "ostree_repo_remote_get_gpg_verify" ostree_repo_remote_get_gpg_verify ::
Ptr Repo ->
CString ->
Ptr CInt ->
Ptr (Ptr GError) ->
IO CInt
repoRemoteGetGpgVerify ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> T.Text
-> m (Bool)
repoRemoteGetGpgVerify :: a -> Text -> m Bool
repoRemoteGetGpgVerify self :: a
self name :: Text
name = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr CInt
outGpgVerify <- IO (Ptr CInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CInt)
IO Bool -> IO () -> IO Bool
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo -> CString -> Ptr CInt -> Ptr (Ptr GError) -> IO CInt
ostree_repo_remote_get_gpg_verify Ptr Repo
self' CString
name' Ptr CInt
outGpgVerify
CInt
outGpgVerify' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
outGpgVerify
let outGpgVerify'' :: Bool
outGpgVerify'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
outGpgVerify'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
outGpgVerify
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
outGpgVerify''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
outGpgVerify
)
#if defined(ENABLE_OVERLOADING)
data RepoRemoteGetGpgVerifyMethodInfo
instance (signature ~ (T.Text -> m (Bool)), MonadIO m, IsRepo a) => O.MethodInfo RepoRemoteGetGpgVerifyMethodInfo a signature where
overloadedMethod = repoRemoteGetGpgVerify
#endif
foreign import ccall "ostree_repo_remote_get_gpg_verify_summary" ostree_repo_remote_get_gpg_verify_summary ::
Ptr Repo ->
CString ->
Ptr CInt ->
Ptr (Ptr GError) ->
IO CInt
repoRemoteGetGpgVerifySummary ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> T.Text
-> m (Bool)
repoRemoteGetGpgVerifySummary :: a -> Text -> m Bool
repoRemoteGetGpgVerifySummary self :: a
self name :: Text
name = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr CInt
outGpgVerifySummary <- IO (Ptr CInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CInt)
IO Bool -> IO () -> IO Bool
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo -> CString -> Ptr CInt -> Ptr (Ptr GError) -> IO CInt
ostree_repo_remote_get_gpg_verify_summary Ptr Repo
self' CString
name' Ptr CInt
outGpgVerifySummary
CInt
outGpgVerifySummary' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
outGpgVerifySummary
let outGpgVerifySummary'' :: Bool
outGpgVerifySummary'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
outGpgVerifySummary'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
outGpgVerifySummary
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
outGpgVerifySummary''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
outGpgVerifySummary
)
#if defined(ENABLE_OVERLOADING)
data RepoRemoteGetGpgVerifySummaryMethodInfo
instance (signature ~ (T.Text -> m (Bool)), MonadIO m, IsRepo a) => O.MethodInfo RepoRemoteGetGpgVerifySummaryMethodInfo a signature where
overloadedMethod = repoRemoteGetGpgVerifySummary
#endif
foreign import ccall "ostree_repo_remote_get_url" ostree_repo_remote_get_url ::
Ptr Repo ->
CString ->
Ptr CString ->
Ptr (Ptr GError) ->
IO CInt
repoRemoteGetUrl ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> T.Text
-> m (T.Text)
repoRemoteGetUrl :: a -> Text -> m Text
repoRemoteGetUrl self :: a
self name :: Text
name = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr CString
outUrl <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CString)
IO Text -> IO () -> IO Text
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo -> CString -> Ptr CString -> Ptr (Ptr GError) -> IO CInt
ostree_repo_remote_get_url Ptr Repo
self' CString
name' Ptr CString
outUrl
CString
outUrl' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
outUrl
Text
outUrl'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outUrl'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
outUrl'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outUrl
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
outUrl''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outUrl
)
#if defined(ENABLE_OVERLOADING)
data RepoRemoteGetUrlMethodInfo
instance (signature ~ (T.Text -> m (T.Text)), MonadIO m, IsRepo a) => O.MethodInfo RepoRemoteGetUrlMethodInfo a signature where
overloadedMethod = repoRemoteGetUrl
#endif
foreign import ccall "ostree_repo_remote_gpg_import" ostree_repo_remote_gpg_import ::
Ptr Repo ->
CString ->
Ptr Gio.InputStream.InputStream ->
Ptr CString ->
Word32 ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoRemoteGpgImport ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) =>
a
-> T.Text
-> Maybe (b)
-> Maybe ([T.Text])
-> Word32
-> Maybe (c)
-> m ()
repoRemoteGpgImport :: a -> Text -> Maybe b -> Maybe [Text] -> Word32 -> Maybe c -> m ()
repoRemoteGpgImport self :: a
self name :: Text
name sourceStream :: Maybe b
sourceStream keyIds :: Maybe [Text]
keyIds outImported :: Word32
outImported cancellable :: Maybe c
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr InputStream
maybeSourceStream <- case Maybe b
sourceStream of
Nothing -> Ptr InputStream -> IO (Ptr InputStream)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr InputStream
forall a. Ptr a
nullPtr
Just jSourceStream :: b
jSourceStream -> do
Ptr InputStream
jSourceStream' <- b -> IO (Ptr InputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jSourceStream
Ptr InputStream -> IO (Ptr InputStream)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr InputStream
jSourceStream'
Ptr CString
maybeKeyIds <- case Maybe [Text]
keyIds of
Nothing -> Ptr CString -> IO (Ptr CString)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
nullPtr
Just jKeyIds :: [Text]
jKeyIds -> do
Ptr CString
jKeyIds' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jKeyIds
Ptr CString -> IO (Ptr CString)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
jKeyIds'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr InputStream
-> Ptr CString
-> Word32
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_remote_gpg_import Ptr Repo
self' CString
name' Ptr InputStream
maybeSourceStream Ptr CString
maybeKeyIds Word32
outImported Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
sourceStream b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeKeyIds
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeKeyIds
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeKeyIds
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeKeyIds
)
#if defined(ENABLE_OVERLOADING)
data RepoRemoteGpgImportMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> Maybe ([T.Text]) -> Word32 -> Maybe (c) -> m ()), MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoRemoteGpgImportMethodInfo a signature where
overloadedMethod = repoRemoteGpgImport
#endif
foreign import ccall "ostree_repo_remote_list" ostree_repo_remote_list ::
Ptr Repo ->
Ptr Word32 ->
IO (Ptr CString)
repoRemoteList ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> m [T.Text]
repoRemoteList :: a -> m [Text]
repoRemoteList self :: a
self = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr Word32
outNRemotes <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
Ptr CString
result <- Ptr Repo -> Ptr Word32 -> IO (Ptr CString)
ostree_repo_remote_list Ptr Repo
self' Ptr Word32
outNRemotes
Word32
outNRemotes' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
outNRemotes
Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoRemoteList" Ptr CString
result
[Text]
result' <- (Word32 -> Ptr CString -> IO [Text]
forall a.
(HasCallStack, Integral a) =>
a -> Ptr CString -> IO [Text]
unpackUTF8CArrayWithLength Word32
outNRemotes') Ptr CString
result
(Word32 -> (CString -> IO ()) -> Ptr CString -> IO ()
forall a b c.
(Storable a, Integral b) =>
b -> (a -> IO c) -> Ptr a -> IO ()
mapCArrayWithLength Word32
outNRemotes') CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
outNRemotes
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'
#if defined(ENABLE_OVERLOADING)
data RepoRemoteListMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsRepo a) => O.MethodInfo RepoRemoteListMethodInfo a signature where
overloadedMethod = repoRemoteList
#endif
#if defined(ENABLE_OVERLOADING)
data RepoRemoteListCollectionRefsMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "remoteListCollectionRefs" Repo) => O.MethodInfo RepoRemoteListCollectionRefsMethodInfo o p where
overloadedMethod = undefined
#endif
#if defined(ENABLE_OVERLOADING)
data RepoRemoteListRefsMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "remoteListRefs" Repo) => O.MethodInfo RepoRemoteListRefsMethodInfo o p where
overloadedMethod = undefined
#endif
foreign import ccall "ostree_repo_resolve_collection_ref" ostree_repo_resolve_collection_ref ::
Ptr Repo ->
Ptr OSTree.CollectionRef.CollectionRef ->
CInt ->
CUInt ->
Ptr CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoResolveCollectionRef ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> OSTree.CollectionRef.CollectionRef
-> Bool
-> [OSTree.Flags.RepoResolveRevExtFlags]
-> Maybe (b)
-> m ((Maybe T.Text))
repoResolveCollectionRef :: a
-> CollectionRef
-> Bool
-> [RepoResolveRevExtFlags]
-> Maybe b
-> m (Maybe Text)
repoResolveCollectionRef self :: a
self ref :: CollectionRef
ref allowNoent :: Bool
allowNoent flags :: [RepoResolveRevExtFlags]
flags cancellable :: Maybe b
cancellable = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr CollectionRef
ref' <- CollectionRef -> IO (Ptr CollectionRef)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr CollectionRef
ref
let allowNoent' :: CInt
allowNoent' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
allowNoent
let flags' :: CUInt
flags' = [RepoResolveRevExtFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [RepoResolveRevExtFlags]
flags
Ptr CString
outRev <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CString)
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO (Maybe Text) -> IO () -> IO (Maybe Text)
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr CollectionRef
-> CInt
-> CUInt
-> Ptr CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_resolve_collection_ref Ptr Repo
self' Ptr CollectionRef
ref' CInt
allowNoent' CUInt
flags' Ptr CString
outRev Ptr Cancellable
maybeCancellable
CString
outRev' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
outRev
Maybe Text
maybeOutRev' <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
outRev' ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \outRev'' :: CString
outRev'' -> do
Text
outRev''' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outRev''
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
outRev'''
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
outRev'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CollectionRef -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr CollectionRef
ref
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outRev
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeOutRev'
) (do
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outRev
)
#if defined(ENABLE_OVERLOADING)
data RepoResolveCollectionRefMethodInfo
instance (signature ~ (OSTree.CollectionRef.CollectionRef -> Bool -> [OSTree.Flags.RepoResolveRevExtFlags] -> Maybe (b) -> m ((Maybe T.Text))), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoResolveCollectionRefMethodInfo a signature where
overloadedMethod = repoResolveCollectionRef
#endif
foreign import ccall "ostree_repo_resolve_keyring_for_collection" ostree_repo_resolve_keyring_for_collection ::
Ptr Repo ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr OSTree.Remote.Remote)
repoResolveKeyringForCollection ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Maybe (b)
-> m OSTree.Remote.Remote
repoResolveKeyringForCollection :: a -> Text -> Maybe b -> m Remote
repoResolveKeyringForCollection self :: a
self collectionId :: Text
collectionId cancellable :: Maybe b
cancellable = IO Remote -> m Remote
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Remote -> m Remote) -> IO Remote -> m Remote
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
collectionId' <- Text -> IO CString
textToCString Text
collectionId
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO Remote -> IO () -> IO Remote
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Remote
result <- (Ptr (Ptr GError) -> IO (Ptr Remote)) -> IO (Ptr Remote)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Remote)) -> IO (Ptr Remote))
-> (Ptr (Ptr GError) -> IO (Ptr Remote)) -> IO (Ptr Remote)
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr Remote)
ostree_repo_resolve_keyring_for_collection Ptr Repo
self' CString
collectionId' Ptr Cancellable
maybeCancellable
Text -> Ptr Remote -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoResolveKeyringForCollection" Ptr Remote
result
Remote
result' <- ((ManagedPtr Remote -> Remote) -> Ptr Remote -> IO Remote
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Remote -> Remote
OSTree.Remote.Remote) Ptr Remote
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
collectionId'
Remote -> IO Remote
forall (m :: * -> *) a. Monad m => a -> m a
return Remote
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
collectionId'
)
#if defined(ENABLE_OVERLOADING)
data RepoResolveKeyringForCollectionMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m OSTree.Remote.Remote), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoResolveKeyringForCollectionMethodInfo a signature where
overloadedMethod = repoResolveKeyringForCollection
#endif
foreign import ccall "ostree_repo_resolve_rev" ostree_repo_resolve_rev ::
Ptr Repo ->
CString ->
CInt ->
Ptr CString ->
Ptr (Ptr GError) ->
IO CInt
repoResolveRev ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> T.Text
-> Bool
-> m (T.Text)
repoResolveRev :: a -> Text -> Bool -> m Text
repoResolveRev self :: a
self refspec :: Text
refspec allowNoent :: Bool
allowNoent = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
refspec' <- Text -> IO CString
textToCString Text
refspec
let allowNoent' :: CInt
allowNoent' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
allowNoent
Ptr CString
outRev <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CString)
IO Text -> IO () -> IO Text
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString -> CInt -> Ptr CString -> Ptr (Ptr GError) -> IO CInt
ostree_repo_resolve_rev Ptr Repo
self' CString
refspec' CInt
allowNoent' Ptr CString
outRev
CString
outRev' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
outRev
Text
outRev'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outRev'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
outRev'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
refspec'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outRev
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
outRev''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
refspec'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outRev
)
#if defined(ENABLE_OVERLOADING)
data RepoResolveRevMethodInfo
instance (signature ~ (T.Text -> Bool -> m (T.Text)), MonadIO m, IsRepo a) => O.MethodInfo RepoResolveRevMethodInfo a signature where
overloadedMethod = repoResolveRev
#endif
foreign import ccall "ostree_repo_resolve_rev_ext" ostree_repo_resolve_rev_ext ::
Ptr Repo ->
CString ->
CInt ->
CUInt ->
Ptr CString ->
Ptr (Ptr GError) ->
IO CInt
repoResolveRevExt ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> T.Text
-> Bool
-> [OSTree.Flags.RepoResolveRevExtFlags]
-> m (T.Text)
repoResolveRevExt :: a -> Text -> Bool -> [RepoResolveRevExtFlags] -> m Text
repoResolveRevExt self :: a
self refspec :: Text
refspec allowNoent :: Bool
allowNoent flags :: [RepoResolveRevExtFlags]
flags = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
refspec' <- Text -> IO CString
textToCString Text
refspec
let allowNoent' :: CInt
allowNoent' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
allowNoent
let flags' :: CUInt
flags' = [RepoResolveRevExtFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [RepoResolveRevExtFlags]
flags
Ptr CString
outRev <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CString)
IO Text -> IO () -> IO Text
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> CInt
-> CUInt
-> Ptr CString
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_resolve_rev_ext Ptr Repo
self' CString
refspec' CInt
allowNoent' CUInt
flags' Ptr CString
outRev
CString
outRev' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
outRev
Text
outRev'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outRev'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
outRev'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
refspec'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outRev
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
outRev''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
refspec'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outRev
)
#if defined(ENABLE_OVERLOADING)
data RepoResolveRevExtMethodInfo
instance (signature ~ (T.Text -> Bool -> [OSTree.Flags.RepoResolveRevExtFlags] -> m (T.Text)), MonadIO m, IsRepo a) => O.MethodInfo RepoResolveRevExtMethodInfo a signature where
overloadedMethod = repoResolveRevExt
#endif
foreign import ccall "ostree_repo_scan_hardlinks" ostree_repo_scan_hardlinks ::
Ptr Repo ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoScanHardlinks ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m ()
repoScanHardlinks :: a -> Maybe b -> m ()
repoScanHardlinks self :: a
self cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo -> Ptr Cancellable -> Ptr (Ptr GError) -> IO CInt
ostree_repo_scan_hardlinks Ptr Repo
self' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoScanHardlinksMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoScanHardlinksMethodInfo a signature where
overloadedMethod = repoScanHardlinks
#endif
foreign import ccall "ostree_repo_set_alias_ref_immediate" ostree_repo_set_alias_ref_immediate ::
Ptr Repo ->
CString ->
CString ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoSetAliasRefImmediate ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (T.Text)
-> T.Text
-> Maybe (T.Text)
-> Maybe (b)
-> m ()
repoSetAliasRefImmediate :: a -> Maybe Text -> Text -> Maybe Text -> Maybe b -> m ()
repoSetAliasRefImmediate self :: a
self remote :: Maybe Text
remote ref :: Text
ref target :: Maybe Text
target cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
maybeRemote <- case Maybe Text
remote of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jRemote :: Text
jRemote -> do
CString
jRemote' <- Text -> IO CString
textToCString Text
jRemote
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jRemote'
CString
ref' <- Text -> IO CString
textToCString Text
ref
CString
maybeTarget <- case Maybe Text
target of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jTarget :: Text
jTarget -> do
CString
jTarget' <- Text -> IO CString
textToCString Text
jTarget
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jTarget'
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> CString
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_set_alias_ref_immediate Ptr Repo
self' CString
maybeRemote CString
ref' CString
maybeTarget Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeRemote
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
ref'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeTarget
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeRemote
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
ref'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeTarget
)
#if defined(ENABLE_OVERLOADING)
data RepoSetAliasRefImmediateMethodInfo
instance (signature ~ (Maybe (T.Text) -> T.Text -> Maybe (T.Text) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoSetAliasRefImmediateMethodInfo a signature where
overloadedMethod = repoSetAliasRefImmediate
#endif
foreign import ccall "ostree_repo_set_cache_dir" ostree_repo_set_cache_dir ::
Ptr Repo ->
Int32 ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoSetCacheDir ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> T.Text
-> Maybe (b)
-> m ()
repoSetCacheDir :: a -> Int32 -> Text -> Maybe b -> m ()
repoSetCacheDir self :: a
self dfd :: Int32
dfd path :: Text
path cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
path' <- Text -> IO CString
textToCString Text
path
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Int32
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_set_cache_dir Ptr Repo
self' Int32
dfd CString
path' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
)
#if defined(ENABLE_OVERLOADING)
data RepoSetCacheDirMethodInfo
instance (signature ~ (Int32 -> T.Text -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoSetCacheDirMethodInfo a signature where
overloadedMethod = repoSetCacheDir
#endif
foreign import ccall "ostree_repo_set_collection_id" ostree_repo_set_collection_id ::
Ptr Repo ->
CString ->
Ptr (Ptr GError) ->
IO CInt
repoSetCollectionId ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> Maybe (T.Text)
-> m ()
repoSetCollectionId :: a -> Maybe Text -> m ()
repoSetCollectionId self :: a
self collectionId :: Maybe Text
collectionId = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
maybeCollectionId <- case Maybe Text
collectionId of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jCollectionId :: Text
jCollectionId -> do
CString
jCollectionId' <- Text -> IO CString
textToCString Text
jCollectionId
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jCollectionId'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo -> CString -> Ptr (Ptr GError) -> IO CInt
ostree_repo_set_collection_id Ptr Repo
self' CString
maybeCollectionId
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeCollectionId
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeCollectionId
)
#if defined(ENABLE_OVERLOADING)
data RepoSetCollectionIdMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsRepo a) => O.MethodInfo RepoSetCollectionIdMethodInfo a signature where
overloadedMethod = repoSetCollectionId
#endif
foreign import ccall "ostree_repo_set_collection_ref_immediate" ostree_repo_set_collection_ref_immediate ::
Ptr Repo ->
Ptr OSTree.CollectionRef.CollectionRef ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoSetCollectionRefImmediate ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> OSTree.CollectionRef.CollectionRef
-> Maybe (T.Text)
-> Maybe (b)
-> m ()
repoSetCollectionRefImmediate :: a -> CollectionRef -> Maybe Text -> Maybe b -> m ()
repoSetCollectionRefImmediate self :: a
self ref :: CollectionRef
ref checksum :: Maybe Text
checksum cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr CollectionRef
ref' <- CollectionRef -> IO (Ptr CollectionRef)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr CollectionRef
ref
CString
maybeChecksum <- case Maybe Text
checksum of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jChecksum :: Text
jChecksum -> do
CString
jChecksum' <- Text -> IO CString
textToCString Text
jChecksum
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jChecksum'
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr CollectionRef
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_set_collection_ref_immediate Ptr Repo
self' Ptr CollectionRef
ref' CString
maybeChecksum Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CollectionRef -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr CollectionRef
ref
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeChecksum
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeChecksum
)
#if defined(ENABLE_OVERLOADING)
data RepoSetCollectionRefImmediateMethodInfo
instance (signature ~ (OSTree.CollectionRef.CollectionRef -> Maybe (T.Text) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoSetCollectionRefImmediateMethodInfo a signature where
overloadedMethod = repoSetCollectionRefImmediate
#endif
foreign import ccall "ostree_repo_set_disable_fsync" ostree_repo_set_disable_fsync ::
Ptr Repo ->
CInt ->
IO ()
repoSetDisableFsync ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> Bool
-> m ()
repoSetDisableFsync :: a -> Bool -> m ()
repoSetDisableFsync self :: a
self disableFsync :: Bool
disableFsync = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let disableFsync' :: CInt
disableFsync' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
disableFsync
Ptr Repo -> CInt -> IO ()
ostree_repo_set_disable_fsync Ptr Repo
self' CInt
disableFsync'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RepoSetDisableFsyncMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsRepo a) => O.MethodInfo RepoSetDisableFsyncMethodInfo a signature where
overloadedMethod = repoSetDisableFsync
#endif
foreign import ccall "ostree_repo_set_ref_immediate" ostree_repo_set_ref_immediate ::
Ptr Repo ->
CString ->
CString ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoSetRefImmediate ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (T.Text)
-> T.Text
-> Maybe (T.Text)
-> Maybe (b)
-> m ()
repoSetRefImmediate :: a -> Maybe Text -> Text -> Maybe Text -> Maybe b -> m ()
repoSetRefImmediate self :: a
self remote :: Maybe Text
remote ref :: Text
ref checksum :: Maybe Text
checksum cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
maybeRemote <- case Maybe Text
remote of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jRemote :: Text
jRemote -> do
CString
jRemote' <- Text -> IO CString
textToCString Text
jRemote
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jRemote'
CString
ref' <- Text -> IO CString
textToCString Text
ref
CString
maybeChecksum <- case Maybe Text
checksum of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jChecksum :: Text
jChecksum -> do
CString
jChecksum' <- Text -> IO CString
textToCString Text
jChecksum
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jChecksum'
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> CString
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_set_ref_immediate Ptr Repo
self' CString
maybeRemote CString
ref' CString
maybeChecksum Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeRemote
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
ref'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeChecksum
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeRemote
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
ref'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeChecksum
)
#if defined(ENABLE_OVERLOADING)
data RepoSetRefImmediateMethodInfo
instance (signature ~ (Maybe (T.Text) -> T.Text -> Maybe (T.Text) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoSetRefImmediateMethodInfo a signature where
overloadedMethod = repoSetRefImmediate
#endif
foreign import ccall "ostree_repo_sign_commit" ostree_repo_sign_commit ::
Ptr Repo ->
CString ->
CString ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoSignCommit ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> T.Text
-> Maybe (T.Text)
-> Maybe (b)
-> m ()
repoSignCommit :: a -> Text -> Text -> Maybe Text -> Maybe b -> m ()
repoSignCommit self :: a
self commitChecksum :: Text
commitChecksum keyId :: Text
keyId homedir :: Maybe Text
homedir cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
commitChecksum' <- Text -> IO CString
textToCString Text
commitChecksum
CString
keyId' <- Text -> IO CString
textToCString Text
keyId
CString
maybeHomedir <- case Maybe Text
homedir of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jHomedir :: Text
jHomedir -> do
CString
jHomedir' <- Text -> IO CString
textToCString Text
jHomedir
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jHomedir'
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> CString
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_sign_commit Ptr Repo
self' CString
commitChecksum' CString
keyId' CString
maybeHomedir Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
commitChecksum'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
keyId'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeHomedir
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
commitChecksum'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
keyId'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeHomedir
)
#if defined(ENABLE_OVERLOADING)
data RepoSignCommitMethodInfo
instance (signature ~ (T.Text -> T.Text -> Maybe (T.Text) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoSignCommitMethodInfo a signature where
overloadedMethod = repoSignCommit
#endif
foreign import ccall "ostree_repo_sign_delta" ostree_repo_sign_delta ::
Ptr Repo ->
CString ->
CString ->
CString ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoSignDelta ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> T.Text
-> T.Text
-> T.Text
-> Maybe (b)
-> m ()
repoSignDelta :: a -> Text -> Text -> Text -> Text -> Maybe b -> m ()
repoSignDelta self :: a
self fromCommit :: Text
fromCommit toCommit :: Text
toCommit keyId :: Text
keyId homedir :: Text
homedir cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
fromCommit' <- Text -> IO CString
textToCString Text
fromCommit
CString
toCommit' <- Text -> IO CString
textToCString Text
toCommit
CString
keyId' <- Text -> IO CString
textToCString Text
keyId
CString
homedir' <- Text -> IO CString
textToCString Text
homedir
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> CString
-> CString
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_sign_delta Ptr Repo
self' CString
fromCommit' CString
toCommit' CString
keyId' CString
homedir' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
fromCommit'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
toCommit'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
keyId'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
homedir'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
fromCommit'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
toCommit'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
keyId'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
homedir'
)
#if defined(ENABLE_OVERLOADING)
data RepoSignDeltaMethodInfo
instance (signature ~ (T.Text -> T.Text -> T.Text -> T.Text -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoSignDeltaMethodInfo a signature where
overloadedMethod = repoSignDelta
#endif
foreign import ccall "ostree_repo_static_delta_execute_offline" ostree_repo_static_delta_execute_offline ::
Ptr Repo ->
Ptr Gio.File.File ->
CInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoStaticDeltaExecuteOffline ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Bool
-> Maybe (c)
-> m ()
repoStaticDeltaExecuteOffline :: a -> b -> Bool -> Maybe c -> m ()
repoStaticDeltaExecuteOffline self :: a
self dirOrFile :: b
dirOrFile skipValidation :: Bool
skipValidation cancellable :: Maybe c
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr File
dirOrFile' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
dirOrFile
let skipValidation' :: CInt
skipValidation' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
skipValidation
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr File
-> CInt
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_static_delta_execute_offline Ptr Repo
self' Ptr File
dirOrFile' CInt
skipValidation' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
dirOrFile
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoStaticDeltaExecuteOfflineMethodInfo
instance (signature ~ (b -> Bool -> Maybe (c) -> m ()), MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoStaticDeltaExecuteOfflineMethodInfo a signature where
overloadedMethod = repoStaticDeltaExecuteOffline
#endif
foreign import ccall "ostree_repo_static_delta_generate" ostree_repo_static_delta_generate ::
Ptr Repo ->
CUInt ->
CString ->
CString ->
Ptr GVariant ->
Ptr GVariant ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoStaticDeltaGenerate ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> OSTree.Enums.StaticDeltaGenerateOpt
-> T.Text
-> T.Text
-> Maybe (GVariant)
-> Maybe (GVariant)
-> Maybe (b)
-> m ()
repoStaticDeltaGenerate :: a
-> StaticDeltaGenerateOpt
-> Text
-> Text
-> Maybe GVariant
-> Maybe GVariant
-> Maybe b
-> m ()
repoStaticDeltaGenerate self :: a
self opt :: StaticDeltaGenerateOpt
opt from :: Text
from to :: Text
to metadata :: Maybe GVariant
metadata params :: Maybe GVariant
params cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let opt' :: CUInt
opt' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (StaticDeltaGenerateOpt -> Int)
-> StaticDeltaGenerateOpt
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StaticDeltaGenerateOpt -> Int
forall a. Enum a => a -> Int
fromEnum) StaticDeltaGenerateOpt
opt
CString
from' <- Text -> IO CString
textToCString Text
from
CString
to' <- Text -> IO CString
textToCString Text
to
Ptr GVariant
maybeMetadata <- case Maybe GVariant
metadata of
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jMetadata :: GVariant
jMetadata -> do
Ptr GVariant
jMetadata' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jMetadata
Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jMetadata'
Ptr GVariant
maybeParams <- case Maybe GVariant
params of
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jParams :: GVariant
jParams -> do
Ptr GVariant
jParams' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jParams
Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jParams'
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CUInt
-> CString
-> CString
-> Ptr GVariant
-> Ptr GVariant
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_static_delta_generate Ptr Repo
self' CUInt
opt' CString
from' CString
to' Ptr GVariant
maybeMetadata Ptr GVariant
maybeParams Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
metadata GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
params GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
from'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
to'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
from'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
to'
)
#if defined(ENABLE_OVERLOADING)
data RepoStaticDeltaGenerateMethodInfo
instance (signature ~ (OSTree.Enums.StaticDeltaGenerateOpt -> T.Text -> T.Text -> Maybe (GVariant) -> Maybe (GVariant) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoStaticDeltaGenerateMethodInfo a signature where
overloadedMethod = repoStaticDeltaGenerate
#endif
foreign import ccall "ostree_repo_transaction_set_collection_ref" ostree_repo_transaction_set_collection_ref ::
Ptr Repo ->
Ptr OSTree.CollectionRef.CollectionRef ->
CString ->
IO ()
repoTransactionSetCollectionRef ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> OSTree.CollectionRef.CollectionRef
-> Maybe (T.Text)
-> m ()
repoTransactionSetCollectionRef :: a -> CollectionRef -> Maybe Text -> m ()
repoTransactionSetCollectionRef self :: a
self ref :: CollectionRef
ref checksum :: Maybe Text
checksum = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr CollectionRef
ref' <- CollectionRef -> IO (Ptr CollectionRef)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr CollectionRef
ref
CString
maybeChecksum <- case Maybe Text
checksum of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jChecksum :: Text
jChecksum -> do
CString
jChecksum' <- Text -> IO CString
textToCString Text
jChecksum
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jChecksum'
Ptr Repo -> Ptr CollectionRef -> CString -> IO ()
ostree_repo_transaction_set_collection_ref Ptr Repo
self' Ptr CollectionRef
ref' CString
maybeChecksum
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CollectionRef -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr CollectionRef
ref
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeChecksum
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RepoTransactionSetCollectionRefMethodInfo
instance (signature ~ (OSTree.CollectionRef.CollectionRef -> Maybe (T.Text) -> m ()), MonadIO m, IsRepo a) => O.MethodInfo RepoTransactionSetCollectionRefMethodInfo a signature where
overloadedMethod = repoTransactionSetCollectionRef
#endif
foreign import ccall "ostree_repo_transaction_set_ref" ostree_repo_transaction_set_ref ::
Ptr Repo ->
CString ->
CString ->
CString ->
IO ()
repoTransactionSetRef ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> Maybe (T.Text)
-> T.Text
-> Maybe (T.Text)
-> m ()
repoTransactionSetRef :: a -> Maybe Text -> Text -> Maybe Text -> m ()
repoTransactionSetRef self :: a
self remote :: Maybe Text
remote ref :: Text
ref checksum :: Maybe Text
checksum = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
maybeRemote <- case Maybe Text
remote of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jRemote :: Text
jRemote -> do
CString
jRemote' <- Text -> IO CString
textToCString Text
jRemote
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jRemote'
CString
ref' <- Text -> IO CString
textToCString Text
ref
CString
maybeChecksum <- case Maybe Text
checksum of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jChecksum :: Text
jChecksum -> do
CString
jChecksum' <- Text -> IO CString
textToCString Text
jChecksum
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jChecksum'
Ptr Repo -> CString -> CString -> CString -> IO ()
ostree_repo_transaction_set_ref Ptr Repo
self' CString
maybeRemote CString
ref' CString
maybeChecksum
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeRemote
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
ref'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeChecksum
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RepoTransactionSetRefMethodInfo
instance (signature ~ (Maybe (T.Text) -> T.Text -> Maybe (T.Text) -> m ()), MonadIO m, IsRepo a) => O.MethodInfo RepoTransactionSetRefMethodInfo a signature where
overloadedMethod = repoTransactionSetRef
#endif
foreign import ccall "ostree_repo_transaction_set_refspec" ostree_repo_transaction_set_refspec ::
Ptr Repo ->
CString ->
CString ->
IO ()
repoTransactionSetRefspec ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> T.Text
-> Maybe (T.Text)
-> m ()
repoTransactionSetRefspec :: a -> Text -> Maybe Text -> m ()
repoTransactionSetRefspec self :: a
self refspec :: Text
refspec checksum :: Maybe Text
checksum = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
refspec' <- Text -> IO CString
textToCString Text
refspec
CString
maybeChecksum <- case Maybe Text
checksum of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jChecksum :: Text
jChecksum -> do
CString
jChecksum' <- Text -> IO CString
textToCString Text
jChecksum
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jChecksum'
Ptr Repo -> CString -> CString -> IO ()
ostree_repo_transaction_set_refspec Ptr Repo
self' CString
refspec' CString
maybeChecksum
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
refspec'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeChecksum
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RepoTransactionSetRefspecMethodInfo
instance (signature ~ (T.Text -> Maybe (T.Text) -> m ()), MonadIO m, IsRepo a) => O.MethodInfo RepoTransactionSetRefspecMethodInfo a signature where
overloadedMethod = repoTransactionSetRefspec
#endif
#if defined(ENABLE_OVERLOADING)
data RepoTraverseCommitMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "traverseCommit" Repo) => O.MethodInfo RepoTraverseCommitMethodInfo o p where
overloadedMethod = undefined
#endif
#if defined(ENABLE_OVERLOADING)
data RepoTraverseReachableRefsMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "traverseReachableRefs" Repo) => O.MethodInfo RepoTraverseReachableRefsMethodInfo o p where
overloadedMethod = undefined
#endif
foreign import ccall "ostree_repo_verify_commit" ostree_repo_verify_commit ::
Ptr Repo ->
CString ->
Ptr Gio.File.File ->
Ptr Gio.File.File ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoVerifyCommit ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.File.IsFile c, Gio.Cancellable.IsCancellable d) =>
a
-> T.Text
-> Maybe (b)
-> Maybe (c)
-> Maybe (d)
-> m ()
repoVerifyCommit :: a -> Text -> Maybe b -> Maybe c -> Maybe d -> m ()
repoVerifyCommit self :: a
self commitChecksum :: Text
commitChecksum keyringdir :: Maybe b
keyringdir extraKeyring :: Maybe c
extraKeyring cancellable :: Maybe d
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
commitChecksum' <- Text -> IO CString
textToCString Text
commitChecksum
Ptr File
maybeKeyringdir <- case Maybe b
keyringdir of
Nothing -> Ptr File -> IO (Ptr File)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
forall a. Ptr a
nullPtr
Just jKeyringdir :: b
jKeyringdir -> do
Ptr File
jKeyringdir' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jKeyringdir
Ptr File -> IO (Ptr File)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
jKeyringdir'
Ptr File
maybeExtraKeyring <- case Maybe c
extraKeyring of
Nothing -> Ptr File -> IO (Ptr File)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
forall a. Ptr a
nullPtr
Just jExtraKeyring :: c
jExtraKeyring -> do
Ptr File
jExtraKeyring' <- c -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jExtraKeyring
Ptr File -> IO (Ptr File)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
jExtraKeyring'
Ptr Cancellable
maybeCancellable <- case Maybe d
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: d
jCancellable -> do
Ptr Cancellable
jCancellable' <- d -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr d
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr File
-> Ptr File
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_verify_commit Ptr Repo
self' CString
commitChecksum' Ptr File
maybeKeyringdir Ptr File
maybeExtraKeyring Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
keyringdir b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
extraKeyring c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe d -> (d -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe d
cancellable d -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
commitChecksum'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
commitChecksum'
)
#if defined(ENABLE_OVERLOADING)
data RepoVerifyCommitMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> Maybe (c) -> Maybe (d) -> m ()), MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.File.IsFile c, Gio.Cancellable.IsCancellable d) => O.MethodInfo RepoVerifyCommitMethodInfo a signature where
overloadedMethod = repoVerifyCommit
#endif
foreign import ccall "ostree_repo_verify_commit_ext" ostree_repo_verify_commit_ext ::
Ptr Repo ->
CString ->
Ptr Gio.File.File ->
Ptr Gio.File.File ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr OSTree.GpgVerifyResult.GpgVerifyResult)
repoVerifyCommitExt ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.File.IsFile c, Gio.Cancellable.IsCancellable d) =>
a
-> T.Text
-> Maybe (b)
-> Maybe (c)
-> Maybe (d)
-> m OSTree.GpgVerifyResult.GpgVerifyResult
repoVerifyCommitExt :: a -> Text -> Maybe b -> Maybe c -> Maybe d -> m GpgVerifyResult
repoVerifyCommitExt self :: a
self commitChecksum :: Text
commitChecksum keyringdir :: Maybe b
keyringdir extraKeyring :: Maybe c
extraKeyring cancellable :: Maybe d
cancellable = IO GpgVerifyResult -> m GpgVerifyResult
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GpgVerifyResult -> m GpgVerifyResult)
-> IO GpgVerifyResult -> m GpgVerifyResult
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
commitChecksum' <- Text -> IO CString
textToCString Text
commitChecksum
Ptr File
maybeKeyringdir <- case Maybe b
keyringdir of
Nothing -> Ptr File -> IO (Ptr File)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
forall a. Ptr a
nullPtr
Just jKeyringdir :: b
jKeyringdir -> do
Ptr File
jKeyringdir' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jKeyringdir
Ptr File -> IO (Ptr File)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
jKeyringdir'
Ptr File
maybeExtraKeyring <- case Maybe c
extraKeyring of
Nothing -> Ptr File -> IO (Ptr File)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
forall a. Ptr a
nullPtr
Just jExtraKeyring :: c
jExtraKeyring -> do
Ptr File
jExtraKeyring' <- c -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jExtraKeyring
Ptr File -> IO (Ptr File)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
jExtraKeyring'
Ptr Cancellable
maybeCancellable <- case Maybe d
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: d
jCancellable -> do
Ptr Cancellable
jCancellable' <- d -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr d
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO GpgVerifyResult -> IO () -> IO GpgVerifyResult
forall a b. IO a -> IO b -> IO a
onException (do
Ptr GpgVerifyResult
result <- (Ptr (Ptr GError) -> IO (Ptr GpgVerifyResult))
-> IO (Ptr GpgVerifyResult)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr GpgVerifyResult))
-> IO (Ptr GpgVerifyResult))
-> (Ptr (Ptr GError) -> IO (Ptr GpgVerifyResult))
-> IO (Ptr GpgVerifyResult)
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr File
-> Ptr File
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr GpgVerifyResult)
ostree_repo_verify_commit_ext Ptr Repo
self' CString
commitChecksum' Ptr File
maybeKeyringdir Ptr File
maybeExtraKeyring Ptr Cancellable
maybeCancellable
Text -> Ptr GpgVerifyResult -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoVerifyCommitExt" Ptr GpgVerifyResult
result
GpgVerifyResult
result' <- ((ManagedPtr GpgVerifyResult -> GpgVerifyResult)
-> Ptr GpgVerifyResult -> IO GpgVerifyResult
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr GpgVerifyResult -> GpgVerifyResult
OSTree.GpgVerifyResult.GpgVerifyResult) Ptr GpgVerifyResult
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
keyringdir b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
extraKeyring c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe d -> (d -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe d
cancellable d -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
commitChecksum'
GpgVerifyResult -> IO GpgVerifyResult
forall (m :: * -> *) a. Monad m => a -> m a
return GpgVerifyResult
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
commitChecksum'
)
#if defined(ENABLE_OVERLOADING)
data RepoVerifyCommitExtMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> Maybe (c) -> Maybe (d) -> m OSTree.GpgVerifyResult.GpgVerifyResult), MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.File.IsFile c, Gio.Cancellable.IsCancellable d) => O.MethodInfo RepoVerifyCommitExtMethodInfo a signature where
overloadedMethod = repoVerifyCommitExt
#endif
foreign import ccall "ostree_repo_verify_commit_for_remote" ostree_repo_verify_commit_for_remote ::
Ptr Repo ->
CString ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr OSTree.GpgVerifyResult.GpgVerifyResult)
repoVerifyCommitForRemote ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> T.Text
-> Maybe (b)
-> m OSTree.GpgVerifyResult.GpgVerifyResult
repoVerifyCommitForRemote :: a -> Text -> Text -> Maybe b -> m GpgVerifyResult
repoVerifyCommitForRemote self :: a
self commitChecksum :: Text
commitChecksum remoteName :: Text
remoteName cancellable :: Maybe b
cancellable = IO GpgVerifyResult -> m GpgVerifyResult
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GpgVerifyResult -> m GpgVerifyResult)
-> IO GpgVerifyResult -> m GpgVerifyResult
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
commitChecksum' <- Text -> IO CString
textToCString Text
commitChecksum
CString
remoteName' <- Text -> IO CString
textToCString Text
remoteName
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO GpgVerifyResult -> IO () -> IO GpgVerifyResult
forall a b. IO a -> IO b -> IO a
onException (do
Ptr GpgVerifyResult
result <- (Ptr (Ptr GError) -> IO (Ptr GpgVerifyResult))
-> IO (Ptr GpgVerifyResult)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr GpgVerifyResult))
-> IO (Ptr GpgVerifyResult))
-> (Ptr (Ptr GError) -> IO (Ptr GpgVerifyResult))
-> IO (Ptr GpgVerifyResult)
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr GpgVerifyResult)
ostree_repo_verify_commit_for_remote Ptr Repo
self' CString
commitChecksum' CString
remoteName' Ptr Cancellable
maybeCancellable
Text -> Ptr GpgVerifyResult -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoVerifyCommitForRemote" Ptr GpgVerifyResult
result
GpgVerifyResult
result' <- ((ManagedPtr GpgVerifyResult -> GpgVerifyResult)
-> Ptr GpgVerifyResult -> IO GpgVerifyResult
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr GpgVerifyResult -> GpgVerifyResult
OSTree.GpgVerifyResult.GpgVerifyResult) Ptr GpgVerifyResult
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
commitChecksum'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
remoteName'
GpgVerifyResult -> IO GpgVerifyResult
forall (m :: * -> *) a. Monad m => a -> m a
return GpgVerifyResult
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
commitChecksum'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
remoteName'
)
#if defined(ENABLE_OVERLOADING)
data RepoVerifyCommitForRemoteMethodInfo
instance (signature ~ (T.Text -> T.Text -> Maybe (b) -> m OSTree.GpgVerifyResult.GpgVerifyResult), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoVerifyCommitForRemoteMethodInfo a signature where
overloadedMethod = repoVerifyCommitForRemote
#endif
foreign import ccall "ostree_repo_verify_summary" ostree_repo_verify_summary ::
Ptr Repo ->
CString ->
Ptr GLib.Bytes.Bytes ->
Ptr GLib.Bytes.Bytes ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr OSTree.GpgVerifyResult.GpgVerifyResult)
repoVerifySummary ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> GLib.Bytes.Bytes
-> GLib.Bytes.Bytes
-> Maybe (b)
-> m OSTree.GpgVerifyResult.GpgVerifyResult
repoVerifySummary :: a -> Text -> Bytes -> Bytes -> Maybe b -> m GpgVerifyResult
repoVerifySummary self :: a
self remoteName :: Text
remoteName summary :: Bytes
summary signatures :: Bytes
signatures cancellable :: Maybe b
cancellable = IO GpgVerifyResult -> m GpgVerifyResult
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GpgVerifyResult -> m GpgVerifyResult)
-> IO GpgVerifyResult -> m GpgVerifyResult
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
remoteName' <- Text -> IO CString
textToCString Text
remoteName
Ptr Bytes
summary' <- Bytes -> IO (Ptr Bytes)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bytes
summary
Ptr Bytes
signatures' <- Bytes -> IO (Ptr Bytes)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bytes
signatures
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO GpgVerifyResult -> IO () -> IO GpgVerifyResult
forall a b. IO a -> IO b -> IO a
onException (do
Ptr GpgVerifyResult
result <- (Ptr (Ptr GError) -> IO (Ptr GpgVerifyResult))
-> IO (Ptr GpgVerifyResult)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr GpgVerifyResult))
-> IO (Ptr GpgVerifyResult))
-> (Ptr (Ptr GError) -> IO (Ptr GpgVerifyResult))
-> IO (Ptr GpgVerifyResult)
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr Bytes
-> Ptr Bytes
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr GpgVerifyResult)
ostree_repo_verify_summary Ptr Repo
self' CString
remoteName' Ptr Bytes
summary' Ptr Bytes
signatures' Ptr Cancellable
maybeCancellable
Text -> Ptr GpgVerifyResult -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoVerifySummary" Ptr GpgVerifyResult
result
GpgVerifyResult
result' <- ((ManagedPtr GpgVerifyResult -> GpgVerifyResult)
-> Ptr GpgVerifyResult -> IO GpgVerifyResult
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr GpgVerifyResult -> GpgVerifyResult
OSTree.GpgVerifyResult.GpgVerifyResult) Ptr GpgVerifyResult
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Bytes -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Bytes
summary
Bytes -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Bytes
signatures
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
remoteName'
GpgVerifyResult -> IO GpgVerifyResult
forall (m :: * -> *) a. Monad m => a -> m a
return GpgVerifyResult
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
remoteName'
)
#if defined(ENABLE_OVERLOADING)
data RepoVerifySummaryMethodInfo
instance (signature ~ (T.Text -> GLib.Bytes.Bytes -> GLib.Bytes.Bytes -> Maybe (b) -> m OSTree.GpgVerifyResult.GpgVerifyResult), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoVerifySummaryMethodInfo a signature where
overloadedMethod = repoVerifySummary
#endif
foreign import ccall "ostree_repo_write_archive_to_mtree" ostree_repo_write_archive_to_mtree ::
Ptr Repo ->
Ptr Gio.File.File ->
Ptr OSTree.MutableTree.MutableTree ->
Ptr OSTree.RepoCommitModifier.RepoCommitModifier ->
CInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoWriteArchiveToMtree ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.File.IsFile b, OSTree.MutableTree.IsMutableTree c, Gio.Cancellable.IsCancellable d) =>
a
-> b
-> c
-> Maybe (OSTree.RepoCommitModifier.RepoCommitModifier)
-> Bool
-> Maybe (d)
-> m ()
repoWriteArchiveToMtree :: a -> b -> c -> Maybe RepoCommitModifier -> Bool -> Maybe d -> m ()
repoWriteArchiveToMtree self :: a
self archive :: b
archive mtree :: c
mtree modifier :: Maybe RepoCommitModifier
modifier autocreateParents :: Bool
autocreateParents cancellable :: Maybe d
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr File
archive' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
archive
Ptr MutableTree
mtree' <- c -> IO (Ptr MutableTree)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
mtree
Ptr RepoCommitModifier
maybeModifier <- case Maybe RepoCommitModifier
modifier of
Nothing -> Ptr RepoCommitModifier -> IO (Ptr RepoCommitModifier)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr RepoCommitModifier
forall a. Ptr a
nullPtr
Just jModifier :: RepoCommitModifier
jModifier -> do
Ptr RepoCommitModifier
jModifier' <- RepoCommitModifier -> IO (Ptr RepoCommitModifier)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RepoCommitModifier
jModifier
Ptr RepoCommitModifier -> IO (Ptr RepoCommitModifier)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr RepoCommitModifier
jModifier'
let autocreateParents' :: CInt
autocreateParents' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
autocreateParents
Ptr Cancellable
maybeCancellable <- case Maybe d
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: d
jCancellable -> do
Ptr Cancellable
jCancellable' <- d -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr d
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr File
-> Ptr MutableTree
-> Ptr RepoCommitModifier
-> CInt
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_write_archive_to_mtree Ptr Repo
self' Ptr File
archive' Ptr MutableTree
mtree' Ptr RepoCommitModifier
maybeModifier CInt
autocreateParents' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
archive
c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
mtree
Maybe RepoCommitModifier -> (RepoCommitModifier -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe RepoCommitModifier
modifier RepoCommitModifier -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe d -> (d -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe d
cancellable d -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoWriteArchiveToMtreeMethodInfo
instance (signature ~ (b -> c -> Maybe (OSTree.RepoCommitModifier.RepoCommitModifier) -> Bool -> Maybe (d) -> m ()), MonadIO m, IsRepo a, Gio.File.IsFile b, OSTree.MutableTree.IsMutableTree c, Gio.Cancellable.IsCancellable d) => O.MethodInfo RepoWriteArchiveToMtreeMethodInfo a signature where
overloadedMethod = repoWriteArchiveToMtree
#endif
foreign import ccall "ostree_repo_write_commit" ostree_repo_write_commit ::
Ptr Repo ->
CString ->
CString ->
CString ->
Ptr GVariant ->
Ptr OSTree.RepoFile.RepoFile ->
Ptr CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoWriteCommit ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.RepoFile.IsRepoFile b, Gio.Cancellable.IsCancellable c) =>
a
-> Maybe (T.Text)
-> Maybe (T.Text)
-> Maybe (T.Text)
-> Maybe (GVariant)
-> b
-> Maybe (c)
-> m (T.Text)
repoWriteCommit :: a
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe GVariant
-> b
-> Maybe c
-> m Text
repoWriteCommit self :: a
self parent :: Maybe Text
parent subject :: Maybe Text
subject body :: Maybe Text
body metadata :: Maybe GVariant
metadata root :: b
root cancellable :: Maybe c
cancellable = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
maybeParent <- case Maybe Text
parent of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jParent :: Text
jParent -> do
CString
jParent' <- Text -> IO CString
textToCString Text
jParent
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jParent'
CString
maybeSubject <- case Maybe Text
subject of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jSubject :: Text
jSubject -> do
CString
jSubject' <- Text -> IO CString
textToCString Text
jSubject
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jSubject'
CString
maybeBody <- case Maybe Text
body of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jBody :: Text
jBody -> do
CString
jBody' <- Text -> IO CString
textToCString Text
jBody
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jBody'
Ptr GVariant
maybeMetadata <- case Maybe GVariant
metadata of
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jMetadata :: GVariant
jMetadata -> do
Ptr GVariant
jMetadata' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jMetadata
Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jMetadata'
Ptr RepoFile
root' <- b -> IO (Ptr RepoFile)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
root
Ptr CString
outCommit <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CString)
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO Text -> IO () -> IO Text
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> CString
-> CString
-> Ptr GVariant
-> Ptr RepoFile
-> Ptr CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_write_commit Ptr Repo
self' CString
maybeParent CString
maybeSubject CString
maybeBody Ptr GVariant
maybeMetadata Ptr RepoFile
root' Ptr CString
outCommit Ptr Cancellable
maybeCancellable
CString
outCommit' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
outCommit
Text
outCommit'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outCommit'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
outCommit'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
metadata GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
root
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeParent
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeSubject
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeBody
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outCommit
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
outCommit''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeParent
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeSubject
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeBody
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outCommit
)
#if defined(ENABLE_OVERLOADING)
data RepoWriteCommitMethodInfo
instance (signature ~ (Maybe (T.Text) -> Maybe (T.Text) -> Maybe (T.Text) -> Maybe (GVariant) -> b -> Maybe (c) -> m (T.Text)), MonadIO m, IsRepo a, OSTree.RepoFile.IsRepoFile b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoWriteCommitMethodInfo a signature where
overloadedMethod = repoWriteCommit
#endif
foreign import ccall "ostree_repo_write_commit_detached_metadata" ostree_repo_write_commit_detached_metadata ::
Ptr Repo ->
CString ->
Ptr GVariant ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoWriteCommitDetachedMetadata ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Maybe (GVariant)
-> Maybe (b)
-> m ()
repoWriteCommitDetachedMetadata :: a -> Text -> Maybe GVariant -> Maybe b -> m ()
repoWriteCommitDetachedMetadata self :: a
self checksum :: Text
checksum metadata :: Maybe GVariant
metadata cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
checksum' <- Text -> IO CString
textToCString Text
checksum
Ptr GVariant
maybeMetadata <- case Maybe GVariant
metadata of
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jMetadata :: GVariant
jMetadata -> do
Ptr GVariant
jMetadata' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jMetadata
Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jMetadata'
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr GVariant
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_write_commit_detached_metadata Ptr Repo
self' CString
checksum' Ptr GVariant
maybeMetadata Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
metadata GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
)
#if defined(ENABLE_OVERLOADING)
data RepoWriteCommitDetachedMetadataMethodInfo
instance (signature ~ (T.Text -> Maybe (GVariant) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoWriteCommitDetachedMetadataMethodInfo a signature where
overloadedMethod = repoWriteCommitDetachedMetadata
#endif
foreign import ccall "ostree_repo_write_commit_with_time" ostree_repo_write_commit_with_time ::
Ptr Repo ->
CString ->
CString ->
CString ->
Ptr GVariant ->
Ptr OSTree.RepoFile.RepoFile ->
Word64 ->
Ptr CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoWriteCommitWithTime ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.RepoFile.IsRepoFile b, Gio.Cancellable.IsCancellable c) =>
a
-> Maybe (T.Text)
-> Maybe (T.Text)
-> Maybe (T.Text)
-> Maybe (GVariant)
-> b
-> Word64
-> Maybe (c)
-> m (T.Text)
repoWriteCommitWithTime :: a
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe GVariant
-> b
-> Word64
-> Maybe c
-> m Text
repoWriteCommitWithTime self :: a
self parent :: Maybe Text
parent subject :: Maybe Text
subject body :: Maybe Text
body metadata :: Maybe GVariant
metadata root :: b
root time :: Word64
time cancellable :: Maybe c
cancellable = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
maybeParent <- case Maybe Text
parent of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jParent :: Text
jParent -> do
CString
jParent' <- Text -> IO CString
textToCString Text
jParent
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jParent'
CString
maybeSubject <- case Maybe Text
subject of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jSubject :: Text
jSubject -> do
CString
jSubject' <- Text -> IO CString
textToCString Text
jSubject
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jSubject'
CString
maybeBody <- case Maybe Text
body of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jBody :: Text
jBody -> do
CString
jBody' <- Text -> IO CString
textToCString Text
jBody
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jBody'
Ptr GVariant
maybeMetadata <- case Maybe GVariant
metadata of
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jMetadata :: GVariant
jMetadata -> do
Ptr GVariant
jMetadata' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jMetadata
Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jMetadata'
Ptr RepoFile
root' <- b -> IO (Ptr RepoFile)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
root
Ptr CString
outCommit <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CString)
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO Text -> IO () -> IO Text
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> CString
-> CString
-> Ptr GVariant
-> Ptr RepoFile
-> Word64
-> Ptr CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_write_commit_with_time Ptr Repo
self' CString
maybeParent CString
maybeSubject CString
maybeBody Ptr GVariant
maybeMetadata Ptr RepoFile
root' Word64
time Ptr CString
outCommit Ptr Cancellable
maybeCancellable
CString
outCommit' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
outCommit
Text
outCommit'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outCommit'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
outCommit'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
metadata GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
root
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeParent
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeSubject
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeBody
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outCommit
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
outCommit''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeParent
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeSubject
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeBody
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outCommit
)
#if defined(ENABLE_OVERLOADING)
data RepoWriteCommitWithTimeMethodInfo
instance (signature ~ (Maybe (T.Text) -> Maybe (T.Text) -> Maybe (T.Text) -> Maybe (GVariant) -> b -> Word64 -> Maybe (c) -> m (T.Text)), MonadIO m, IsRepo a, OSTree.RepoFile.IsRepoFile b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoWriteCommitWithTimeMethodInfo a signature where
overloadedMethod = repoWriteCommitWithTime
#endif
foreign import ccall "ostree_repo_write_config" ostree_repo_write_config ::
Ptr Repo ->
Ptr GLib.KeyFile.KeyFile ->
Ptr (Ptr GError) ->
IO CInt
repoWriteConfig ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
a
-> GLib.KeyFile.KeyFile
-> m ()
repoWriteConfig :: a -> KeyFile -> m ()
repoWriteConfig self :: a
self newConfig :: KeyFile
newConfig = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr KeyFile
newConfig' <- KeyFile -> IO (Ptr KeyFile)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr KeyFile
newConfig
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo -> Ptr KeyFile -> Ptr (Ptr GError) -> IO CInt
ostree_repo_write_config Ptr Repo
self' Ptr KeyFile
newConfig'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
KeyFile -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr KeyFile
newConfig
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoWriteConfigMethodInfo
instance (signature ~ (GLib.KeyFile.KeyFile -> m ()), MonadIO m, IsRepo a) => O.MethodInfo RepoWriteConfigMethodInfo a signature where
overloadedMethod = repoWriteConfig
#endif
foreign import ccall "ostree_repo_write_content" ostree_repo_write_content ::
Ptr Repo ->
CString ->
Ptr Gio.InputStream.InputStream ->
Word64 ->
Ptr (Ptr Word8) ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoWriteContent ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) =>
a
-> Maybe (T.Text)
-> b
-> Word64
-> Maybe (c)
-> m (ByteString)
repoWriteContent :: a -> Maybe Text -> b -> Word64 -> Maybe c -> m ByteString
repoWriteContent self :: a
self expectedChecksum :: Maybe Text
expectedChecksum objectInput :: b
objectInput length_ :: Word64
length_ cancellable :: Maybe c
cancellable = IO ByteString -> m ByteString
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ByteString -> m ByteString) -> IO ByteString -> m ByteString
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
maybeExpectedChecksum <- case Maybe Text
expectedChecksum of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jExpectedChecksum :: Text
jExpectedChecksum -> do
CString
jExpectedChecksum' <- Text -> IO CString
textToCString Text
jExpectedChecksum
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jExpectedChecksum'
Ptr InputStream
objectInput' <- b -> IO (Ptr InputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
objectInput
Ptr (Ptr Word8)
outCsum <- IO (Ptr (Ptr Word8))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr Word8))
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO ByteString -> IO () -> IO ByteString
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr InputStream
-> Word64
-> Ptr (Ptr Word8)
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_write_content Ptr Repo
self' CString
maybeExpectedChecksum Ptr InputStream
objectInput' Word64
length_ Ptr (Ptr Word8)
outCsum Ptr Cancellable
maybeCancellable
Ptr Word8
outCsum' <- Ptr (Ptr Word8) -> IO (Ptr Word8)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word8)
outCsum
ByteString
outCsum'' <- (Integer -> Ptr Word8 -> IO ByteString
forall a. Integral a => a -> Ptr Word8 -> IO ByteString
unpackByteStringWithLength 32) Ptr Word8
outCsum'
Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
outCsum'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
objectInput
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeExpectedChecksum
Ptr (Ptr Word8) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word8)
outCsum
ByteString -> IO ByteString
forall (m :: * -> *) a. Monad m => a -> m a
return ByteString
outCsum''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeExpectedChecksum
Ptr (Ptr Word8) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word8)
outCsum
)
#if defined(ENABLE_OVERLOADING)
data RepoWriteContentMethodInfo
instance (signature ~ (Maybe (T.Text) -> b -> Word64 -> Maybe (c) -> m (ByteString)), MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoWriteContentMethodInfo a signature where
overloadedMethod = repoWriteContent
#endif
foreign import ccall "ostree_repo_write_content_async" ostree_repo_write_content_async ::
Ptr Repo ->
CString ->
Ptr Gio.InputStream.InputStream ->
Word64 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
repoWriteContentAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) =>
a
-> Maybe (T.Text)
-> b
-> Word64
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
repoWriteContentAsync :: a
-> Maybe Text
-> b
-> Word64
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
repoWriteContentAsync self :: a
self expectedChecksum :: Maybe Text
expectedChecksum object :: b
object length_ :: Word64
length_ cancellable :: Maybe c
cancellable callback :: Maybe AsyncReadyCallback
callback = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
maybeExpectedChecksum <- case Maybe Text
expectedChecksum of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jExpectedChecksum :: Text
jExpectedChecksum -> do
CString
jExpectedChecksum' <- Text -> IO CString
textToCString Text
jExpectedChecksum
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jExpectedChecksum'
Ptr InputStream
object' <- b -> IO (Ptr InputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
object
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Repo
-> CString
-> Ptr InputStream
-> Word64
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ostree_repo_write_content_async Ptr Repo
self' CString
maybeExpectedChecksum Ptr InputStream
object' Word64
length_ Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
object
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeExpectedChecksum
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RepoWriteContentAsyncMethodInfo
instance (signature ~ (Maybe (T.Text) -> b -> Word64 -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoWriteContentAsyncMethodInfo a signature where
overloadedMethod = repoWriteContentAsync
#endif
foreign import ccall "ostree_repo_write_content_finish" ostree_repo_write_content_finish ::
Ptr Repo ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr Word8 ->
Ptr (Ptr GError) ->
IO CInt
repoWriteContentFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m (Word8)
repoWriteContentFinish :: a -> b -> m Word8
repoWriteContentFinish self :: a
self result_ :: b
result_ = IO Word8 -> m Word8
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word8 -> m Word8) -> IO Word8 -> m Word8
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
Ptr Word8
outCsum <- IO (Ptr Word8)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word8)
IO Word8 -> IO () -> IO Word8
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr AsyncResult -> Ptr Word8 -> Ptr (Ptr GError) -> IO CInt
ostree_repo_write_content_finish Ptr Repo
self' Ptr AsyncResult
result_' Ptr Word8
outCsum
Word8
outCsum' <- Ptr Word8 -> IO Word8
forall a. Storable a => Ptr a -> IO a
peek Ptr Word8
outCsum
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
outCsum
Word8 -> IO Word8
forall (m :: * -> *) a. Monad m => a -> m a
return Word8
outCsum'
) (do
Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
outCsum
)
#if defined(ENABLE_OVERLOADING)
data RepoWriteContentFinishMethodInfo
instance (signature ~ (b -> m (Word8)), MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo RepoWriteContentFinishMethodInfo a signature where
overloadedMethod = repoWriteContentFinish
#endif
foreign import ccall "ostree_repo_write_content_trusted" ostree_repo_write_content_trusted ::
Ptr Repo ->
CString ->
Ptr Gio.InputStream.InputStream ->
Word64 ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoWriteContentTrusted ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) =>
a
-> T.Text
-> b
-> Word64
-> Maybe (c)
-> m ()
repoWriteContentTrusted :: a -> Text -> b -> Word64 -> Maybe c -> m ()
repoWriteContentTrusted self :: a
self checksum :: Text
checksum objectInput :: b
objectInput length_ :: Word64
length_ cancellable :: Maybe c
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
checksum' <- Text -> IO CString
textToCString Text
checksum
Ptr InputStream
objectInput' <- b -> IO (Ptr InputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
objectInput
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr InputStream
-> Word64
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_write_content_trusted Ptr Repo
self' CString
checksum' Ptr InputStream
objectInput' Word64
length_ Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
objectInput
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
)
#if defined(ENABLE_OVERLOADING)
data RepoWriteContentTrustedMethodInfo
instance (signature ~ (T.Text -> b -> Word64 -> Maybe (c) -> m ()), MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoWriteContentTrustedMethodInfo a signature where
overloadedMethod = repoWriteContentTrusted
#endif
foreign import ccall "ostree_repo_write_dfd_to_mtree" ostree_repo_write_dfd_to_mtree ::
Ptr Repo ->
Int32 ->
CString ->
Ptr OSTree.MutableTree.MutableTree ->
Ptr OSTree.RepoCommitModifier.RepoCommitModifier ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoWriteDfdToMtree ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.MutableTree.IsMutableTree b, Gio.Cancellable.IsCancellable c) =>
a
-> Int32
-> T.Text
-> b
-> Maybe (OSTree.RepoCommitModifier.RepoCommitModifier)
-> Maybe (c)
-> m ()
repoWriteDfdToMtree :: a
-> Int32
-> Text
-> b
-> Maybe RepoCommitModifier
-> Maybe c
-> m ()
repoWriteDfdToMtree self :: a
self dfd :: Int32
dfd path :: Text
path mtree :: b
mtree modifier :: Maybe RepoCommitModifier
modifier cancellable :: Maybe c
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
path' <- Text -> IO CString
textToCString Text
path
Ptr MutableTree
mtree' <- b -> IO (Ptr MutableTree)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
mtree
Ptr RepoCommitModifier
maybeModifier <- case Maybe RepoCommitModifier
modifier of
Nothing -> Ptr RepoCommitModifier -> IO (Ptr RepoCommitModifier)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr RepoCommitModifier
forall a. Ptr a
nullPtr
Just jModifier :: RepoCommitModifier
jModifier -> do
Ptr RepoCommitModifier
jModifier' <- RepoCommitModifier -> IO (Ptr RepoCommitModifier)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RepoCommitModifier
jModifier
Ptr RepoCommitModifier -> IO (Ptr RepoCommitModifier)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr RepoCommitModifier
jModifier'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Int32
-> CString
-> Ptr MutableTree
-> Ptr RepoCommitModifier
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_write_dfd_to_mtree Ptr Repo
self' Int32
dfd CString
path' Ptr MutableTree
mtree' Ptr RepoCommitModifier
maybeModifier Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
mtree
Maybe RepoCommitModifier -> (RepoCommitModifier -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe RepoCommitModifier
modifier RepoCommitModifier -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
)
#if defined(ENABLE_OVERLOADING)
data RepoWriteDfdToMtreeMethodInfo
instance (signature ~ (Int32 -> T.Text -> b -> Maybe (OSTree.RepoCommitModifier.RepoCommitModifier) -> Maybe (c) -> m ()), MonadIO m, IsRepo a, OSTree.MutableTree.IsMutableTree b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoWriteDfdToMtreeMethodInfo a signature where
overloadedMethod = repoWriteDfdToMtree
#endif
foreign import ccall "ostree_repo_write_directory_to_mtree" ostree_repo_write_directory_to_mtree ::
Ptr Repo ->
Ptr Gio.File.File ->
Ptr OSTree.MutableTree.MutableTree ->
Ptr OSTree.RepoCommitModifier.RepoCommitModifier ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoWriteDirectoryToMtree ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.File.IsFile b, OSTree.MutableTree.IsMutableTree c, Gio.Cancellable.IsCancellable d) =>
a
-> b
-> c
-> Maybe (OSTree.RepoCommitModifier.RepoCommitModifier)
-> Maybe (d)
-> m ()
repoWriteDirectoryToMtree :: a -> b -> c -> Maybe RepoCommitModifier -> Maybe d -> m ()
repoWriteDirectoryToMtree self :: a
self dir :: b
dir mtree :: c
mtree modifier :: Maybe RepoCommitModifier
modifier cancellable :: Maybe d
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr File
dir' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
dir
Ptr MutableTree
mtree' <- c -> IO (Ptr MutableTree)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
mtree
Ptr RepoCommitModifier
maybeModifier <- case Maybe RepoCommitModifier
modifier of
Nothing -> Ptr RepoCommitModifier -> IO (Ptr RepoCommitModifier)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr RepoCommitModifier
forall a. Ptr a
nullPtr
Just jModifier :: RepoCommitModifier
jModifier -> do
Ptr RepoCommitModifier
jModifier' <- RepoCommitModifier -> IO (Ptr RepoCommitModifier)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RepoCommitModifier
jModifier
Ptr RepoCommitModifier -> IO (Ptr RepoCommitModifier)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr RepoCommitModifier
jModifier'
Ptr Cancellable
maybeCancellable <- case Maybe d
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: d
jCancellable -> do
Ptr Cancellable
jCancellable' <- d -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr d
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr File
-> Ptr MutableTree
-> Ptr RepoCommitModifier
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_write_directory_to_mtree Ptr Repo
self' Ptr File
dir' Ptr MutableTree
mtree' Ptr RepoCommitModifier
maybeModifier Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
dir
c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
mtree
Maybe RepoCommitModifier -> (RepoCommitModifier -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe RepoCommitModifier
modifier RepoCommitModifier -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe d -> (d -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe d
cancellable d -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoWriteDirectoryToMtreeMethodInfo
instance (signature ~ (b -> c -> Maybe (OSTree.RepoCommitModifier.RepoCommitModifier) -> Maybe (d) -> m ()), MonadIO m, IsRepo a, Gio.File.IsFile b, OSTree.MutableTree.IsMutableTree c, Gio.Cancellable.IsCancellable d) => O.MethodInfo RepoWriteDirectoryToMtreeMethodInfo a signature where
overloadedMethod = repoWriteDirectoryToMtree
#endif
foreign import ccall "ostree_repo_write_metadata" ostree_repo_write_metadata ::
Ptr Repo ->
CUInt ->
CString ->
Ptr GVariant ->
Ptr (Ptr Word8) ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoWriteMetadata ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> OSTree.Enums.ObjectType
-> Maybe (T.Text)
-> GVariant
-> Maybe (b)
-> m (ByteString)
repoWriteMetadata :: a
-> ObjectType -> Maybe Text -> GVariant -> Maybe b -> m ByteString
repoWriteMetadata self :: a
self objtype :: ObjectType
objtype expectedChecksum :: Maybe Text
expectedChecksum object :: GVariant
object cancellable :: Maybe b
cancellable = IO ByteString -> m ByteString
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ByteString -> m ByteString) -> IO ByteString -> m ByteString
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let objtype' :: CUInt
objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
CString
maybeExpectedChecksum <- case Maybe Text
expectedChecksum of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jExpectedChecksum :: Text
jExpectedChecksum -> do
CString
jExpectedChecksum' <- Text -> IO CString
textToCString Text
jExpectedChecksum
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jExpectedChecksum'
Ptr GVariant
object' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
object
Ptr (Ptr Word8)
outCsum <- IO (Ptr (Ptr Word8))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr Word8))
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO ByteString -> IO () -> IO ByteString
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CUInt
-> CString
-> Ptr GVariant
-> Ptr (Ptr Word8)
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_write_metadata Ptr Repo
self' CUInt
objtype' CString
maybeExpectedChecksum Ptr GVariant
object' Ptr (Ptr Word8)
outCsum Ptr Cancellable
maybeCancellable
Ptr Word8
outCsum' <- Ptr (Ptr Word8) -> IO (Ptr Word8)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word8)
outCsum
ByteString
outCsum'' <- (Integer -> Ptr Word8 -> IO ByteString
forall a. Integral a => a -> Ptr Word8 -> IO ByteString
unpackByteStringWithLength 32) Ptr Word8
outCsum'
Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
outCsum'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
object
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeExpectedChecksum
Ptr (Ptr Word8) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word8)
outCsum
ByteString -> IO ByteString
forall (m :: * -> *) a. Monad m => a -> m a
return ByteString
outCsum''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeExpectedChecksum
Ptr (Ptr Word8) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word8)
outCsum
)
#if defined(ENABLE_OVERLOADING)
data RepoWriteMetadataMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> Maybe (T.Text) -> GVariant -> Maybe (b) -> m (ByteString)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoWriteMetadataMethodInfo a signature where
overloadedMethod = repoWriteMetadata
#endif
foreign import ccall "ostree_repo_write_metadata_async" ostree_repo_write_metadata_async ::
Ptr Repo ->
CUInt ->
CString ->
Ptr GVariant ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
repoWriteMetadataAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> OSTree.Enums.ObjectType
-> Maybe (T.Text)
-> GVariant
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
repoWriteMetadataAsync :: a
-> ObjectType
-> Maybe Text
-> GVariant
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
repoWriteMetadataAsync self :: a
self objtype :: ObjectType
objtype expectedChecksum :: Maybe Text
expectedChecksum object :: GVariant
object cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let objtype' :: CUInt
objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
CString
maybeExpectedChecksum <- case Maybe Text
expectedChecksum of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jExpectedChecksum :: Text
jExpectedChecksum -> do
CString
jExpectedChecksum' <- Text -> IO CString
textToCString Text
jExpectedChecksum
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jExpectedChecksum'
Ptr GVariant
object' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
object
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Repo
-> CUInt
-> CString
-> Ptr GVariant
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ostree_repo_write_metadata_async Ptr Repo
self' CUInt
objtype' CString
maybeExpectedChecksum Ptr GVariant
object' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
object
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeExpectedChecksum
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RepoWriteMetadataAsyncMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> Maybe (T.Text) -> GVariant -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoWriteMetadataAsyncMethodInfo a signature where
overloadedMethod = repoWriteMetadataAsync
#endif
foreign import ccall "ostree_repo_write_metadata_finish" ostree_repo_write_metadata_finish ::
Ptr Repo ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr Word8) ->
Ptr (Ptr GError) ->
IO CInt
repoWriteMetadataFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m (ByteString)
repoWriteMetadataFinish :: a -> b -> m ByteString
repoWriteMetadataFinish self :: a
self result_ :: b
result_ = IO ByteString -> m ByteString
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ByteString -> m ByteString) -> IO ByteString -> m ByteString
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
Ptr (Ptr Word8)
outCsum <- IO (Ptr (Ptr Word8))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr Word8))
IO ByteString -> IO () -> IO ByteString
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr AsyncResult
-> Ptr (Ptr Word8)
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_write_metadata_finish Ptr Repo
self' Ptr AsyncResult
result_' Ptr (Ptr Word8)
outCsum
Ptr Word8
outCsum' <- Ptr (Ptr Word8) -> IO (Ptr Word8)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word8)
outCsum
ByteString
outCsum'' <- (Integer -> Ptr Word8 -> IO ByteString
forall a. Integral a => a -> Ptr Word8 -> IO ByteString
unpackByteStringWithLength 32) Ptr Word8
outCsum'
Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
outCsum'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
Ptr (Ptr Word8) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word8)
outCsum
ByteString -> IO ByteString
forall (m :: * -> *) a. Monad m => a -> m a
return ByteString
outCsum''
) (do
Ptr (Ptr Word8) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word8)
outCsum
)
#if defined(ENABLE_OVERLOADING)
data RepoWriteMetadataFinishMethodInfo
instance (signature ~ (b -> m (ByteString)), MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo RepoWriteMetadataFinishMethodInfo a signature where
overloadedMethod = repoWriteMetadataFinish
#endif
foreign import ccall "ostree_repo_write_metadata_stream_trusted" ostree_repo_write_metadata_stream_trusted ::
Ptr Repo ->
CUInt ->
CString ->
Ptr Gio.InputStream.InputStream ->
Word64 ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoWriteMetadataStreamTrusted ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) =>
a
-> OSTree.Enums.ObjectType
-> T.Text
-> b
-> Word64
-> Maybe (c)
-> m ()
repoWriteMetadataStreamTrusted :: a -> ObjectType -> Text -> b -> Word64 -> Maybe c -> m ()
repoWriteMetadataStreamTrusted self :: a
self objtype :: ObjectType
objtype checksum :: Text
checksum objectInput :: b
objectInput length_ :: Word64
length_ cancellable :: Maybe c
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let objtype' :: CUInt
objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
CString
checksum' <- Text -> IO CString
textToCString Text
checksum
Ptr InputStream
objectInput' <- b -> IO (Ptr InputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
objectInput
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CUInt
-> CString
-> Ptr InputStream
-> Word64
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_write_metadata_stream_trusted Ptr Repo
self' CUInt
objtype' CString
checksum' Ptr InputStream
objectInput' Word64
length_ Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
objectInput
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
)
#if defined(ENABLE_OVERLOADING)
data RepoWriteMetadataStreamTrustedMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> b -> Word64 -> Maybe (c) -> m ()), MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoWriteMetadataStreamTrustedMethodInfo a signature where
overloadedMethod = repoWriteMetadataStreamTrusted
#endif
foreign import ccall "ostree_repo_write_metadata_trusted" ostree_repo_write_metadata_trusted ::
Ptr Repo ->
CUInt ->
CString ->
Ptr GVariant ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoWriteMetadataTrusted ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> OSTree.Enums.ObjectType
-> T.Text
-> GVariant
-> Maybe (b)
-> m ()
repoWriteMetadataTrusted :: a -> ObjectType -> Text -> GVariant -> Maybe b -> m ()
repoWriteMetadataTrusted self :: a
self objtype :: ObjectType
objtype checksum :: Text
checksum variant :: GVariant
variant cancellable :: Maybe b
cancellable = 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 Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let objtype' :: CUInt
objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
CString
checksum' <- Text -> IO CString
textToCString Text
checksum
Ptr GVariant
variant' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
variant
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CUInt
-> CString
-> Ptr GVariant
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_write_metadata_trusted Ptr Repo
self' CUInt
objtype' CString
checksum' Ptr GVariant
variant' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
variant
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
checksum'
)
#if defined(ENABLE_OVERLOADING)
data RepoWriteMetadataTrustedMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> GVariant -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoWriteMetadataTrustedMethodInfo a signature where
overloadedMethod = repoWriteMetadataTrusted
#endif
foreign import ccall "ostree_repo_write_mtree" ostree_repo_write_mtree ::
Ptr Repo ->
Ptr OSTree.MutableTree.MutableTree ->
Ptr (Ptr Gio.File.File) ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
repoWriteMtree ::
(B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.MutableTree.IsMutableTree b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Maybe (c)
-> m (Gio.File.File)
repoWriteMtree :: a -> b -> Maybe c -> m File
repoWriteMtree self :: a
self mtree :: b
mtree cancellable :: Maybe c
cancellable = IO File -> m File
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO File -> m File) -> IO File -> m File
forall a b. (a -> b) -> a -> b
$ do
Ptr Repo
self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr MutableTree
mtree' <- b -> IO (Ptr MutableTree)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
mtree
Ptr (Ptr File)
outFile <- IO (Ptr (Ptr File))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr Gio.File.File))
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO File -> IO () -> IO File
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> Ptr MutableTree
-> Ptr (Ptr File)
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_repo_write_mtree Ptr Repo
self' Ptr MutableTree
mtree' Ptr (Ptr File)
outFile Ptr Cancellable
maybeCancellable
Ptr File
outFile' <- Ptr (Ptr File) -> IO (Ptr File)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr File)
outFile
File
outFile'' <- ((ManagedPtr File -> File) -> Ptr File -> IO File
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr File -> File
Gio.File.File) Ptr File
outFile'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
mtree
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Ptr (Ptr File) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr File)
outFile
File -> IO File
forall (m :: * -> *) a. Monad m => a -> m a
return File
outFile''
) (do
Ptr (Ptr File) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr File)
outFile
)
#if defined(ENABLE_OVERLOADING)
data RepoWriteMtreeMethodInfo
instance (signature ~ (b -> Maybe (c) -> m (Gio.File.File)), MonadIO m, IsRepo a, OSTree.MutableTree.IsMutableTree b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoWriteMtreeMethodInfo a signature where
overloadedMethod = repoWriteMtree
#endif
foreign import ccall "ostree_repo_create_at" ostree_repo_create_at ::
Int32 ->
CString ->
CUInt ->
Ptr GVariant ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Repo)
repoCreateAt ::
(B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
Int32
-> T.Text
-> OSTree.Enums.RepoMode
-> GVariant
-> Maybe (a)
-> m Repo
repoCreateAt :: Int32 -> Text -> RepoMode -> GVariant -> Maybe a -> m Repo
repoCreateAt dfd :: Int32
dfd path :: Text
path mode :: RepoMode
mode options :: GVariant
options cancellable :: Maybe a
cancellable = IO Repo -> m Repo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Repo -> m Repo) -> IO Repo -> m Repo
forall a b. (a -> b) -> a -> b
$ do
CString
path' <- Text -> IO CString
textToCString Text
path
let mode' :: CUInt
mode' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (RepoMode -> Int) -> RepoMode -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RepoMode -> Int
forall a. Enum a => a -> Int
fromEnum) RepoMode
mode
Ptr GVariant
options' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
options
Ptr Cancellable
maybeCancellable <- case Maybe a
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: a
jCancellable -> do
Ptr Cancellable
jCancellable' <- a -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO Repo -> IO () -> IO Repo
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Repo
result <- (Ptr (Ptr GError) -> IO (Ptr Repo)) -> IO (Ptr Repo)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Repo)) -> IO (Ptr Repo))
-> (Ptr (Ptr GError) -> IO (Ptr Repo)) -> IO (Ptr Repo)
forall a b. (a -> b) -> a -> b
$ Int32
-> CString
-> CUInt
-> Ptr GVariant
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr Repo)
ostree_repo_create_at Int32
dfd CString
path' CUInt
mode' Ptr GVariant
options' Ptr Cancellable
maybeCancellable
Text -> Ptr Repo -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoCreateAt" Ptr Repo
result
Repo
result' <- ((ManagedPtr Repo -> Repo) -> Ptr Repo -> IO Repo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Repo -> Repo
Repo) Ptr Repo
result
GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
options
Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
cancellable a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
Repo -> IO Repo
forall (m :: * -> *) a. Monad m => a -> m a
return Repo
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ostree_repo_mode_from_string" ostree_repo_mode_from_string ::
CString ->
CUInt ->
Ptr (Ptr GError) ->
IO CInt
repoModeFromString ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> OSTree.Enums.RepoMode
-> m ()
repoModeFromString :: Text -> RepoMode -> m ()
repoModeFromString mode :: Text
mode outMode :: RepoMode
outMode = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
CString
mode' <- Text -> IO CString
textToCString Text
mode
let outMode' :: CUInt
outMode' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (RepoMode -> Int) -> RepoMode -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RepoMode -> Int
forall a. Enum a => a -> Int
fromEnum) RepoMode
outMode
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ CString -> CUInt -> Ptr (Ptr GError) -> IO CInt
ostree_repo_mode_from_string CString
mode' CUInt
outMode'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
mode'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
mode'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ostree_repo_open_at" ostree_repo_open_at ::
Int32 ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Repo)
repoOpenAt ::
(B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
Int32
-> T.Text
-> Maybe (a)
-> m Repo
repoOpenAt :: Int32 -> Text -> Maybe a -> m Repo
repoOpenAt dfd :: Int32
dfd path :: Text
path cancellable :: Maybe a
cancellable = IO Repo -> m Repo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Repo -> m Repo) -> IO Repo -> m Repo
forall a b. (a -> b) -> a -> b
$ do
CString
path' <- Text -> IO CString
textToCString Text
path
Ptr Cancellable
maybeCancellable <- case Maybe a
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: a
jCancellable -> do
Ptr Cancellable
jCancellable' <- a -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO Repo -> IO () -> IO Repo
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Repo
result <- (Ptr (Ptr GError) -> IO (Ptr Repo)) -> IO (Ptr Repo)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Repo)) -> IO (Ptr Repo))
-> (Ptr (Ptr GError) -> IO (Ptr Repo)) -> IO (Ptr Repo)
forall a b. (a -> b) -> a -> b
$ Int32
-> CString -> Ptr Cancellable -> Ptr (Ptr GError) -> IO (Ptr Repo)
ostree_repo_open_at Int32
dfd CString
path' Ptr Cancellable
maybeCancellable
Text -> Ptr Repo -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoOpenAt" Ptr Repo
result
Repo
result' <- ((ManagedPtr Repo -> Repo) -> Ptr Repo -> IO Repo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Repo -> Repo
Repo) Ptr Repo
result
Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
cancellable a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
Repo -> IO Repo
forall (m :: * -> *) a. Monad m => a -> m a
return Repo
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ostree_repo_pull_default_console_progress_changed" ostree_repo_pull_default_console_progress_changed ::
Ptr OSTree.AsyncProgress.AsyncProgress ->
Ptr () ->
IO ()
repoPullDefaultConsoleProgressChanged ::
(B.CallStack.HasCallStack, MonadIO m, OSTree.AsyncProgress.IsAsyncProgress a) =>
a
-> Ptr ()
-> m ()
repoPullDefaultConsoleProgressChanged :: a -> Ptr () -> m ()
repoPullDefaultConsoleProgressChanged progress :: a
progress userData :: Ptr ()
userData = 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 AsyncProgress
progress' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
progress
Ptr AsyncProgress -> Ptr () -> IO ()
ostree_repo_pull_default_console_progress_changed Ptr AsyncProgress
progress' Ptr ()
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
progress
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
data RepoTraverseNewParentsMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "traverseNewParents" Repo) => O.MethodInfo RepoTraverseNewParentsMethodInfo o p where
overloadedMethod = undefined
#endif
#if defined(ENABLE_OVERLOADING)
data RepoTraverseNewReachableMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "traverseNewReachable" Repo) => O.MethodInfo RepoTraverseNewReachableMethodInfo o p where
overloadedMethod = undefined
#endif
foreign import ccall "ostree_repo_traverse_parents_get_commits" ostree_repo_traverse_parents_get_commits ::
Ptr (GHashTable (Ptr ()) (Ptr ())) ->
Ptr GVariant ->
IO (Ptr CString)
repoTraverseParentsGetCommits ::
(B.CallStack.HasCallStack, MonadIO m) =>
Map.Map (Ptr ()) (Ptr ())
-> GVariant
-> m [T.Text]
repoTraverseParentsGetCommits :: Map (Ptr ()) (Ptr ()) -> GVariant -> m [Text]
repoTraverseParentsGetCommits parents :: Map (Ptr ()) (Ptr ())
parents object :: GVariant
object = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
let parents' :: [(Ptr (), Ptr ())]
parents' = Map (Ptr ()) (Ptr ()) -> [(Ptr (), Ptr ())]
forall k a. Map k a -> [(k, a)]
Map.toList Map (Ptr ()) (Ptr ())
parents
let parents'' :: [(PtrWrapped (Ptr ()), Ptr ())]
parents'' = (Ptr () -> PtrWrapped (Ptr ()))
-> [(Ptr (), Ptr ())] -> [(PtrWrapped (Ptr ()), Ptr ())]
forall a c b. (a -> c) -> [(a, b)] -> [(c, b)]
mapFirst Ptr () -> PtrWrapped (Ptr ())
forall a. Ptr a -> PtrWrapped (Ptr a)
ptrPackPtr [(Ptr (), Ptr ())]
parents'
let parents''' :: [(PtrWrapped (Ptr ()), PtrWrapped (Ptr ()))]
parents''' = (Ptr () -> PtrWrapped (Ptr ()))
-> [(PtrWrapped (Ptr ()), Ptr ())]
-> [(PtrWrapped (Ptr ()), PtrWrapped (Ptr ()))]
forall b c a. (b -> c) -> [(a, b)] -> [(a, c)]
mapSecond Ptr () -> PtrWrapped (Ptr ())
forall a. Ptr a -> PtrWrapped (Ptr a)
ptrPackPtr [(PtrWrapped (Ptr ()), Ptr ())]
parents''
Ptr (GHashTable (Ptr ()) (Ptr ()))
parents'''' <- GHashFunc (Ptr ())
-> GEqualFunc (Ptr ())
-> Maybe (GDestroyNotify (Ptr ()))
-> Maybe (GDestroyNotify (Ptr ()))
-> [(PtrWrapped (Ptr ()), PtrWrapped (Ptr ()))]
-> IO (Ptr (GHashTable (Ptr ()) (Ptr ())))
forall a b.
GHashFunc a
-> GEqualFunc a
-> Maybe (GDestroyNotify a)
-> Maybe (GDestroyNotify b)
-> [(PtrWrapped a, PtrWrapped b)]
-> IO (Ptr (GHashTable a b))
packGHashTable GHashFunc (Ptr ())
forall a. GHashFunc (Ptr a)
gDirectHash GEqualFunc (Ptr ())
forall a. GEqualFunc (Ptr a)
gDirectEqual Maybe (GDestroyNotify (Ptr ()))
forall a. Maybe a
Nothing Maybe (GDestroyNotify (Ptr ()))
forall a. Maybe a
Nothing [(PtrWrapped (Ptr ()), PtrWrapped (Ptr ()))]
parents'''
Ptr GVariant
object' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
object
Ptr CString
result <- Ptr (GHashTable (Ptr ()) (Ptr ()))
-> Ptr GVariant -> IO (Ptr CString)
ostree_repo_traverse_parents_get_commits Ptr (GHashTable (Ptr ()) (Ptr ()))
parents'''' Ptr GVariant
object'
Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoTraverseParentsGetCommits" Ptr CString
result
[Text]
result' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result
GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
object
Ptr (GHashTable (Ptr ()) (Ptr ())) -> IO ()
forall a b. Ptr (GHashTable a b) -> IO ()
unrefGHashTable Ptr (GHashTable (Ptr ()) (Ptr ()))
parents''''
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'
#if defined(ENABLE_OVERLOADING)
#endif