-- | Copyright : Will Thompson and Iñaki García Etxebarria -- License : LGPL-2.1 -- Maintainer : Iñaki García Etxebarria #if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__)) #define ENABLE_OVERLOADING #endif module GI.OSTree.Functions ( -- * Methods -- ** breakHardlink #method:breakHardlink# breakHardlink , -- ** checkVersion #method:checkVersion# checkVersion , -- ** checksumB64FromBytes #method:checksumB64FromBytes# checksumB64FromBytes , -- ** checksumB64ToBytes #method:checksumB64ToBytes# checksumB64ToBytes , -- ** checksumBytesPeek #method:checksumBytesPeek# checksumBytesPeek , -- ** checksumBytesPeekValidate #method:checksumBytesPeekValidate# checksumBytesPeekValidate , -- ** checksumFile #method:checksumFile# checksumFile , -- ** checksumFileAsync #method:checksumFileAsync# checksumFileAsync , -- ** checksumFileAsyncFinish #method:checksumFileAsyncFinish# checksumFileAsyncFinish , -- ** checksumFileAt #method:checksumFileAt# checksumFileAt , -- ** checksumFileFromInput #method:checksumFileFromInput# checksumFileFromInput , -- ** checksumFromBytes #method:checksumFromBytes# checksumFromBytes , -- ** checksumFromBytesV #method:checksumFromBytesV# checksumFromBytesV , -- ** checksumInplaceToBytes #method:checksumInplaceToBytes# checksumInplaceToBytes , -- ** checksumToBytes #method:checksumToBytes# checksumToBytes , -- ** checksumToBytesV #method:checksumToBytesV# checksumToBytesV , -- ** cmpChecksumBytes #method:cmpChecksumBytes# cmpChecksumBytes , -- ** commitGetContentChecksum #method:commitGetContentChecksum# commitGetContentChecksum , -- ** commitGetObjectSizes #method:commitGetObjectSizes# commitGetObjectSizes , -- ** commitGetParent #method:commitGetParent# commitGetParent , -- ** commitGetTimestamp #method:commitGetTimestamp# commitGetTimestamp , -- ** commitMetadataForBootable #method:commitMetadataForBootable# commitMetadataForBootable , -- ** contentFileParse #method:contentFileParse# contentFileParse , -- ** contentFileParseAt #method:contentFileParseAt# contentFileParseAt , -- ** contentStreamParse #method:contentStreamParse# contentStreamParse , -- ** createDirectoryMetadata #method:createDirectoryMetadata# createDirectoryMetadata , -- ** diffDirs #method:diffDirs# diffDirs , -- ** diffDirsWithOptions #method:diffDirsWithOptions# diffDirsWithOptions , -- ** diffPrint #method:diffPrint# diffPrint , -- ** fsGetAllXattrs #method:fsGetAllXattrs# fsGetAllXattrs , -- ** fsGetAllXattrsAt #method:fsGetAllXattrsAt# fsGetAllXattrsAt , -- ** gpgErrorQuark #method:gpgErrorQuark# gpgErrorQuark , -- ** hashObjectName #method:hashObjectName# hashObjectName , -- ** metadataVariantType #method:metadataVariantType# metadataVariantType , -- ** objectFromString #method:objectFromString# objectFromString , -- ** objectNameDeserialize #method:objectNameDeserialize# objectNameDeserialize , -- ** objectNameSerialize #method:objectNameSerialize# objectNameSerialize , -- ** objectToString #method:objectToString# objectToString , -- ** objectTypeFromString #method:objectTypeFromString# objectTypeFromString , -- ** objectTypeToString #method:objectTypeToString# objectTypeToString , -- ** parseRefspec #method:parseRefspec# parseRefspec , -- ** rawFileToArchiveZ2Stream #method:rawFileToArchiveZ2Stream# rawFileToArchiveZ2Stream , -- ** rawFileToArchiveZ2StreamWithOptions #method:rawFileToArchiveZ2StreamWithOptions# rawFileToArchiveZ2StreamWithOptions , -- ** rawFileToContentStream #method:rawFileToContentStream# rawFileToContentStream , -- ** validateChecksumString #method:validateChecksumString# validateChecksumString , -- ** validateCollectionId #method:validateCollectionId# validateCollectionId , -- ** validateRemoteName #method:validateRemoteName# validateRemoteName , -- ** validateRev #method:validateRev# validateRev , -- ** validateStructureofChecksumString #method:validateStructureofChecksumString# validateStructureofChecksumString , -- ** validateStructureofCommit #method:validateStructureofCommit# validateStructureofCommit , -- ** validateStructureofCsumV #method:validateStructureofCsumV# validateStructureofCsumV , -- ** validateStructureofDirmeta #method:validateStructureofDirmeta# validateStructureofDirmeta , -- ** validateStructureofDirtree #method:validateStructureofDirtree# validateStructureofDirtree , -- ** validateStructureofFileMode #method:validateStructureofFileMode# validateStructureofFileMode , -- ** validateStructureofObjtype #method:validateStructureofObjtype# validateStructureofObjtype , ) where import Data.GI.Base.ShortPrelude import qualified Data.GI.Base.ShortPrelude as SP import qualified Data.GI.Base.Overloading as O import qualified Prelude as P import qualified Data.GI.Base.Attributes as GI.Attributes import qualified Data.GI.Base.BasicTypes as B.Types import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr import qualified Data.GI.Base.GArray as B.GArray import qualified Data.GI.Base.GClosure as B.GClosure import qualified Data.GI.Base.GError as B.GError import qualified Data.GI.Base.GHashTable as B.GHT import qualified Data.GI.Base.GVariant as B.GVariant import qualified Data.GI.Base.GValue as B.GValue import qualified Data.GI.Base.GParamSpec as B.GParamSpec import qualified Data.GI.Base.CallStack as B.CallStack import qualified Data.GI.Base.Properties as B.Properties import qualified Data.GI.Base.Signals as B.Signals import qualified Control.Monad.IO.Class as MIO import qualified Data.Coerce as Coerce import qualified Data.Text as T import qualified Data.Kind as DK 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 GHC.Records as R import qualified Data.Word as DW import qualified Data.Int as DI import qualified System.Posix.Types as SPT import qualified Foreign.C.Types as FCT -- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392 #if MIN_VERSION_base(4,18,0) import qualified GI.GLib.Structs.VariantDict as GLib.VariantDict import qualified GI.GLib.Structs.VariantType as GLib.VariantType 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.Structs.CommitSizesEntry as OSTree.CommitSizesEntry import {-# SOURCE #-} qualified GI.OSTree.Structs.DiffDirsOptions as OSTree.DiffDirsOptions import {-# SOURCE #-} qualified GI.OSTree.Structs.DiffItem as OSTree.DiffItem import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoDevInoCache as OSTree.RepoDevInoCache #else import qualified GI.GLib.Structs.VariantDict as GLib.VariantDict import qualified GI.GLib.Structs.VariantType as GLib.VariantType 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.Structs.CommitSizesEntry as OSTree.CommitSizesEntry import {-# SOURCE #-} qualified GI.OSTree.Structs.DiffDirsOptions as OSTree.DiffDirsOptions import {-# SOURCE #-} qualified GI.OSTree.Structs.DiffItem as OSTree.DiffItem #endif -- function validate_structureof_objtype -- Args: [ Arg -- { argCName = "objtype" -- , argType = TBasicType TUInt8 -- , argCType = Just "guchar" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_validate_structureof_objtype" ostree_validate_structureof_objtype :: Word8 -> -- objtype : TBasicType TUInt8 Ptr (Ptr GError) -> -- error IO CInt -- | /No description available in the introspection data./ validateStructureofObjtype :: (B.CallStack.HasCallStack, MonadIO m) => Word8 -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ validateStructureofObjtype :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Word8 -> m () validateStructureofObjtype Word8 objtype = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do IO () -> IO () -> IO () forall a b. IO a -> IO b -> IO a onException (do _ <- (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 $ Word8 -> Ptr (Ptr GError) -> IO CInt ostree_validate_structureof_objtype Word8 objtype return () ) (do () -> IO () forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return () ) -- function validate_structureof_file_mode -- Args: [ Arg -- { argCName = "mode" -- , argType = TBasicType TUInt32 -- , argCType = Just "guint32" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A Unix filesystem mode" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_validate_structureof_file_mode" ostree_validate_structureof_file_mode :: Word32 -> -- mode : TBasicType TUInt32 Ptr (Ptr GError) -> -- error IO CInt -- | /No description available in the introspection data./ validateStructureofFileMode :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@mode@/: A Unix filesystem mode -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ validateStructureofFileMode :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Word32 -> m () validateStructureofFileMode Word32 mode = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do IO () -> IO () -> IO () forall a b. IO a -> IO b -> IO a onException (do _ <- (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 $ Word32 -> Ptr (Ptr GError) -> IO CInt ostree_validate_structureof_file_mode Word32 mode return () ) (do () -> IO () forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return () ) -- function validate_structureof_dirtree -- Args: [ Arg -- { argCName = "dirtree" -- , argType = TVariant -- , argCType = Just "GVariant*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "A dirtree object, %OSTREE_OBJECT_TYPE_DIR_TREE" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_validate_structureof_dirtree" ostree_validate_structureof_dirtree :: Ptr GVariant -> -- dirtree : TVariant Ptr (Ptr GError) -> -- error IO CInt -- | Use this to validate the basic structure of /@dirtree@/, independent of -- any other objects it references. validateStructureofDirtree :: (B.CallStack.HasCallStack, MonadIO m) => GVariant -- ^ /@dirtree@/: A dirtree object, 'GI.OSTree.Enums.ObjectTypeDirTree' -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ validateStructureofDirtree :: forall (m :: * -> *). (HasCallStack, MonadIO m) => GVariant -> m () validateStructureofDirtree GVariant dirtree = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do dirtree' <- GVariant -> IO (Ptr GVariant) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant dirtree onException (do _ <- propagateGError $ ostree_validate_structureof_dirtree dirtree' touchManagedPtr dirtree return () ) (do return () ) -- function validate_structureof_dirmeta -- Args: [ Arg -- { argCName = "dirmeta" -- , argType = TVariant -- , argCType = Just "GVariant*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "A dirmeta object, %OSTREE_OBJECT_TYPE_DIR_META" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_validate_structureof_dirmeta" ostree_validate_structureof_dirmeta :: Ptr GVariant -> -- dirmeta : TVariant Ptr (Ptr GError) -> -- error IO CInt -- | Use this to validate the basic structure of /@dirmeta@/. validateStructureofDirmeta :: (B.CallStack.HasCallStack, MonadIO m) => GVariant -- ^ /@dirmeta@/: A dirmeta object, 'GI.OSTree.Enums.ObjectTypeDirMeta' -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ validateStructureofDirmeta :: forall (m :: * -> *). (HasCallStack, MonadIO m) => GVariant -> m () validateStructureofDirmeta GVariant dirmeta = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do dirmeta' <- GVariant -> IO (Ptr GVariant) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant dirmeta onException (do _ <- propagateGError $ ostree_validate_structureof_dirmeta dirmeta' touchManagedPtr dirmeta return () ) (do return () ) -- function validate_structureof_csum_v -- Args: [ Arg -- { argCName = "checksum" -- , argType = TVariant -- , argCType = Just "GVariant*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GVariant of type \"ay\"" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_validate_structureof_csum_v" ostree_validate_structureof_csum_v :: Ptr GVariant -> -- checksum : TVariant Ptr (Ptr GError) -> -- error IO CInt -- | /No description available in the introspection data./ validateStructureofCsumV :: (B.CallStack.HasCallStack, MonadIO m) => GVariant -- ^ /@checksum@/: a t'GVariant' of type \"ay\" -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ validateStructureofCsumV :: forall (m :: * -> *). (HasCallStack, MonadIO m) => GVariant -> m () validateStructureofCsumV GVariant checksum = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do checksum' <- GVariant -> IO (Ptr GVariant) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant checksum onException (do _ <- propagateGError $ ostree_validate_structureof_csum_v checksum' touchManagedPtr checksum return () ) (do return () ) -- function validate_structureof_commit -- Args: [ Arg -- { argCName = "commit" -- , argType = TVariant -- , argCType = Just "GVariant*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A commit object, %OSTREE_OBJECT_TYPE_COMMIT" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_validate_structureof_commit" ostree_validate_structureof_commit :: Ptr GVariant -> -- commit : TVariant Ptr (Ptr GError) -> -- error IO CInt -- | Use this to validate the basic structure of /@commit@/, independent of -- any other objects it references. validateStructureofCommit :: (B.CallStack.HasCallStack, MonadIO m) => GVariant -- ^ /@commit@/: A commit object, 'GI.OSTree.Enums.ObjectTypeCommit' -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ validateStructureofCommit :: forall (m :: * -> *). (HasCallStack, MonadIO m) => GVariant -> m () validateStructureofCommit GVariant commit = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do commit' <- GVariant -> IO (Ptr GVariant) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant commit onException (do _ <- propagateGError $ ostree_validate_structureof_commit commit' touchManagedPtr commit return () ) (do return () ) -- function validate_structureof_checksum_string -- Args: [ Arg -- { argCName = "checksum" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an ASCII string" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_validate_structureof_checksum_string" ostree_validate_structureof_checksum_string :: CString -> -- checksum : TBasicType TUTF8 Ptr (Ptr GError) -> -- error IO CInt -- | /No description available in the introspection data./ validateStructureofChecksumString :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@checksum@/: an ASCII string -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ validateStructureofChecksumString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m () validateStructureofChecksumString Text checksum = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do checksum' <- Text -> IO CString textToCString Text checksum onException (do _ <- propagateGError $ ostree_validate_structureof_checksum_string checksum' freeMem checksum' return () ) (do freeMem checksum' ) -- function validate_rev -- Args: [ Arg -- { argCName = "rev" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A revision string" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_validate_rev" ostree_validate_rev :: CString -> -- rev : TBasicType TUTF8 Ptr (Ptr GError) -> -- error IO CInt -- | /No description available in the introspection data./ validateRev :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@rev@/: A revision string -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ validateRev :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m () validateRev Text rev = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do rev' <- Text -> IO CString textToCString Text rev onException (do _ <- propagateGError $ ostree_validate_rev rev' freeMem rev' return () ) (do freeMem rev' ) -- function validate_remote_name -- Args: [ Arg -- { argCName = "remote_name" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A remote name" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_validate_remote_name" ostree_validate_remote_name :: CString -> -- remote_name : TBasicType TUTF8 Ptr (Ptr GError) -> -- error IO CInt -- | /No description available in the introspection data./ -- -- /Since: 2017.8/ validateRemoteName :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@remoteName@/: A remote name -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ validateRemoteName :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m () validateRemoteName Text remoteName = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do remoteName' <- Text -> IO CString textToCString Text remoteName onException (do _ <- propagateGError $ ostree_validate_remote_name remoteName' freeMem remoteName' return () ) (do freeMem remoteName' ) -- function validate_collection_id -- Args: [ Arg -- { argCName = "collection_id" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "A collection ID" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_validate_collection_id" ostree_validate_collection_id :: CString -> -- collection_id : TBasicType TUTF8 Ptr (Ptr GError) -> -- error IO CInt -- | Check whether the given /@collectionId@/ is valid. Return an error if it is -- invalid or 'P.Nothing'. -- -- Valid collection IDs are reverse DNS names: -- * They are composed of 1 or more elements separated by a period (@.@) character. -- All elements must contain at least one character. -- * Each element must only contain the ASCII characters @[A-Z][a-z][0-9]_@ and must not -- begin with a digit. -- * They must contain at least one @.@ (period) character (and thus at least two elements). -- * They must not begin with a @.@ (period) character. -- * They must not exceed 255 characters in length. -- -- (This makes their format identical to D-Bus interface names, for consistency.) -- -- /Since: 2018.6/ validateCollectionId :: (B.CallStack.HasCallStack, MonadIO m) => Maybe (T.Text) -- ^ /@collectionId@/: A collection ID -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ validateCollectionId :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Maybe Text -> m () validateCollectionId Maybe Text collectionId = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do maybeCollectionId <- case Maybe Text collectionId of Maybe Text Nothing -> CString -> IO CString forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return CString forall a. Ptr a FP.nullPtr Just Text jCollectionId -> do jCollectionId' <- Text -> IO CString textToCString Text jCollectionId return jCollectionId' onException (do _ <- propagateGError $ ostree_validate_collection_id maybeCollectionId freeMem maybeCollectionId return () ) (do freeMem maybeCollectionId ) -- function validate_checksum_string -- Args: [ Arg -- { argCName = "sha256" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "SHA256 hex string" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_validate_checksum_string" ostree_validate_checksum_string :: CString -> -- sha256 : TBasicType TUTF8 Ptr (Ptr GError) -> -- error IO CInt -- | Use this function to see if input strings are checksums. validateChecksumString :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@sha256@/: SHA256 hex string -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ validateChecksumString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m () validateChecksumString Text sha256 = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do sha256' <- Text -> IO CString textToCString Text sha256 onException (do _ <- propagateGError $ ostree_validate_checksum_string sha256' freeMem sha256' return () ) (do freeMem sha256' ) -- function raw_file_to_content_stream -- Args: [ Arg -- { argCName = "input" -- , argType = -- TInterface Name { namespace = "Gio" , name = "InputStream" } -- , argCType = Just "GInputStream*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "File raw content stream" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "file_info" -- , argType = -- TInterface Name { namespace = "Gio" , name = "FileInfo" } -- , argCType = Just "GFileInfo*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A file info" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "xattrs" -- , argType = TVariant -- , argCType = Just "GVariant*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Optional extended attributes" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out_input" -- , argType = -- TInterface Name { namespace = "Gio" , name = "InputStream" } -- , argCType = Just "GInputStream**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Serialized object stream" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "out_length" -- , argType = TBasicType TUInt64 -- , argCType = Just "guint64*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Length of stream" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , argCType = Just "GCancellable*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Cancellable" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_raw_file_to_content_stream" ostree_raw_file_to_content_stream :: Ptr Gio.InputStream.InputStream -> -- input : TInterface (Name {namespace = "Gio", name = "InputStream"}) Ptr Gio.FileInfo.FileInfo -> -- file_info : TInterface (Name {namespace = "Gio", name = "FileInfo"}) Ptr GVariant -> -- xattrs : TVariant Ptr (Ptr Gio.InputStream.InputStream) -> -- out_input : TInterface (Name {namespace = "Gio", name = "InputStream"}) Ptr Word64 -> -- out_length : TBasicType TUInt64 Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO CInt -- | Convert from a \"bare\" file representation into an -- OSTREE_OBJECT_TYPE_FILE stream. This is a fundamental operation -- for writing data to an t'GI.OSTree.Objects.Repo.Repo'. rawFileToContentStream :: (B.CallStack.HasCallStack, MonadIO m, Gio.InputStream.IsInputStream a, Gio.FileInfo.IsFileInfo b, Gio.Cancellable.IsCancellable c) => a -- ^ /@input@/: File raw content stream -> b -- ^ /@fileInfo@/: A file info -> Maybe (GVariant) -- ^ /@xattrs@/: Optional extended attributes -> Maybe (c) -- ^ /@cancellable@/: Cancellable -> m ((Gio.InputStream.InputStream, Word64)) -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ rawFileToContentStream :: forall (m :: * -> *) a b c. (HasCallStack, MonadIO m, IsInputStream a, IsFileInfo b, IsCancellable c) => a -> b -> Maybe GVariant -> Maybe c -> m (InputStream, Word64) rawFileToContentStream a input b fileInfo Maybe GVariant xattrs Maybe c cancellable = IO (InputStream, Word64) -> m (InputStream, Word64) forall a. IO a -> m a 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 input' <- a -> IO (Ptr InputStream) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a input fileInfo' <- unsafeManagedPtrCastPtr fileInfo maybeXattrs <- case xattrs of Maybe GVariant Nothing -> Ptr GVariant -> IO (Ptr GVariant) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr GVariant forall a. Ptr a FP.nullPtr Just GVariant jXattrs -> do jXattrs' <- GVariant -> IO (Ptr GVariant) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant jXattrs return jXattrs' outInput <- callocMem :: IO (Ptr (Ptr Gio.InputStream.InputStream)) outLength <- allocMem :: IO (Ptr Word64) maybeCancellable <- case cancellable of Maybe c Nothing -> Ptr Cancellable -> IO (Ptr Cancellable) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable forall a. Ptr a FP.nullPtr Just c jCancellable -> do jCancellable' <- c -> IO (Ptr Cancellable) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr c jCancellable return jCancellable' onException (do _ <- propagateGError $ ostree_raw_file_to_content_stream input' fileInfo' maybeXattrs outInput outLength maybeCancellable outInput' <- peek outInput outInput'' <- (wrapObject Gio.InputStream.InputStream) outInput' outLength' <- peek outLength touchManagedPtr input touchManagedPtr fileInfo whenJust xattrs touchManagedPtr whenJust cancellable touchManagedPtr freeMem outInput freeMem outLength return (outInput'', outLength') ) (do freeMem outInput freeMem outLength ) -- function raw_file_to_archive_z2_stream_with_options -- Args: [ Arg -- { argCName = "input" -- , argType = -- TInterface Name { namespace = "Gio" , name = "InputStream" } -- , argCType = Just "GInputStream*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "File raw content stream" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "file_info" -- , argType = -- TInterface Name { namespace = "Gio" , name = "FileInfo" } -- , argCType = Just "GFileInfo*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A file info" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "xattrs" -- , argType = TVariant -- , argCType = Just "GVariant*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Optional extended attributes" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "options" -- , argType = TVariant -- , argCType = Just "GVariant*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "A GVariant `a{sv}` with an extensible set of flags" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out_input" -- , argType = -- TInterface Name { namespace = "Gio" , name = "InputStream" } -- , argCType = Just "GInputStream**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Serialized object stream" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , argCType = Just "GCancellable*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Cancellable" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_raw_file_to_archive_z2_stream_with_options" ostree_raw_file_to_archive_z2_stream_with_options :: Ptr Gio.InputStream.InputStream -> -- input : TInterface (Name {namespace = "Gio", name = "InputStream"}) Ptr Gio.FileInfo.FileInfo -> -- file_info : TInterface (Name {namespace = "Gio", name = "FileInfo"}) Ptr GVariant -> -- xattrs : TVariant Ptr GVariant -> -- options : TVariant Ptr (Ptr Gio.InputStream.InputStream) -> -- out_input : TInterface (Name {namespace = "Gio", name = "InputStream"}) Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO CInt -- | Like 'GI.OSTree.Functions.rawFileToArchiveZ2Stream', but supports an extensible set -- of flags. The following flags are currently defined: -- -- * @compression-level@ (@i@): Level of compression to use, 0–9, with 0 being -- the least compression, and \<0 giving the default level (currently 6). -- -- -- /Since: 2017.3/ rawFileToArchiveZ2StreamWithOptions :: (B.CallStack.HasCallStack, MonadIO m, Gio.InputStream.IsInputStream a, Gio.FileInfo.IsFileInfo b, Gio.Cancellable.IsCancellable c) => a -- ^ /@input@/: File raw content stream -> b -- ^ /@fileInfo@/: A file info -> Maybe (GVariant) -- ^ /@xattrs@/: Optional extended attributes -> Maybe (GVariant) -- ^ /@options@/: A GVariant @a{sv}@ with an extensible set of flags -> Maybe (c) -- ^ /@cancellable@/: Cancellable -> m (Gio.InputStream.InputStream) -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ rawFileToArchiveZ2StreamWithOptions :: forall (m :: * -> *) a b c. (HasCallStack, MonadIO m, IsInputStream a, IsFileInfo b, IsCancellable c) => a -> b -> Maybe GVariant -> Maybe GVariant -> Maybe c -> m InputStream rawFileToArchiveZ2StreamWithOptions a input b fileInfo Maybe GVariant xattrs Maybe GVariant options Maybe c cancellable = IO InputStream -> m InputStream forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO InputStream -> m InputStream) -> IO InputStream -> m InputStream forall a b. (a -> b) -> a -> b $ do input' <- a -> IO (Ptr InputStream) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a input fileInfo' <- unsafeManagedPtrCastPtr fileInfo maybeXattrs <- case xattrs of Maybe GVariant Nothing -> Ptr GVariant -> IO (Ptr GVariant) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr GVariant forall a. Ptr a FP.nullPtr Just GVariant jXattrs -> do jXattrs' <- GVariant -> IO (Ptr GVariant) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant jXattrs return jXattrs' maybeOptions <- case options of Maybe GVariant Nothing -> Ptr GVariant -> IO (Ptr GVariant) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr GVariant forall a. Ptr a FP.nullPtr Just GVariant jOptions -> do jOptions' <- GVariant -> IO (Ptr GVariant) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant jOptions return jOptions' outInput <- callocMem :: IO (Ptr (Ptr Gio.InputStream.InputStream)) maybeCancellable <- case cancellable of Maybe c Nothing -> Ptr Cancellable -> IO (Ptr Cancellable) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable forall a. Ptr a FP.nullPtr Just c jCancellable -> do jCancellable' <- c -> IO (Ptr Cancellable) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr c jCancellable return jCancellable' onException (do _ <- propagateGError $ ostree_raw_file_to_archive_z2_stream_with_options input' fileInfo' maybeXattrs maybeOptions outInput maybeCancellable outInput' <- peek outInput outInput'' <- (wrapObject Gio.InputStream.InputStream) outInput' touchManagedPtr input touchManagedPtr fileInfo whenJust xattrs touchManagedPtr whenJust options touchManagedPtr whenJust cancellable touchManagedPtr freeMem outInput return outInput'' ) (do freeMem outInput ) -- function raw_file_to_archive_z2_stream -- Args: [ Arg -- { argCName = "input" -- , argType = -- TInterface Name { namespace = "Gio" , name = "InputStream" } -- , argCType = Just "GInputStream*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "File raw content stream" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "file_info" -- , argType = -- TInterface Name { namespace = "Gio" , name = "FileInfo" } -- , argCType = Just "GFileInfo*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A file info" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "xattrs" -- , argType = TVariant -- , argCType = Just "GVariant*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Optional extended attributes" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out_input" -- , argType = -- TInterface Name { namespace = "Gio" , name = "InputStream" } -- , argCType = Just "GInputStream**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Serialized object stream" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , argCType = Just "GCancellable*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Cancellable" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_raw_file_to_archive_z2_stream" ostree_raw_file_to_archive_z2_stream :: Ptr Gio.InputStream.InputStream -> -- input : TInterface (Name {namespace = "Gio", name = "InputStream"}) Ptr Gio.FileInfo.FileInfo -> -- file_info : TInterface (Name {namespace = "Gio", name = "FileInfo"}) Ptr GVariant -> -- xattrs : TVariant Ptr (Ptr Gio.InputStream.InputStream) -> -- out_input : TInterface (Name {namespace = "Gio", name = "InputStream"}) Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO CInt -- | Convert from a \"bare\" file representation into an -- OSTREE_OBJECT_TYPE_FILE stream suitable for ostree pull. -- -- /Since: 2016.6/ rawFileToArchiveZ2Stream :: (B.CallStack.HasCallStack, MonadIO m, Gio.InputStream.IsInputStream a, Gio.FileInfo.IsFileInfo b, Gio.Cancellable.IsCancellable c) => a -- ^ /@input@/: File raw content stream -> b -- ^ /@fileInfo@/: A file info -> Maybe (GVariant) -- ^ /@xattrs@/: Optional extended attributes -> Maybe (c) -- ^ /@cancellable@/: Cancellable -> m (Gio.InputStream.InputStream) -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ rawFileToArchiveZ2Stream :: forall (m :: * -> *) a b c. (HasCallStack, MonadIO m, IsInputStream a, IsFileInfo b, IsCancellable c) => a -> b -> Maybe GVariant -> Maybe c -> m InputStream rawFileToArchiveZ2Stream a input b fileInfo Maybe GVariant xattrs Maybe c cancellable = IO InputStream -> m InputStream forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO InputStream -> m InputStream) -> IO InputStream -> m InputStream forall a b. (a -> b) -> a -> b $ do input' <- a -> IO (Ptr InputStream) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a input fileInfo' <- unsafeManagedPtrCastPtr fileInfo maybeXattrs <- case xattrs of Maybe GVariant Nothing -> Ptr GVariant -> IO (Ptr GVariant) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr GVariant forall a. Ptr a FP.nullPtr Just GVariant jXattrs -> do jXattrs' <- GVariant -> IO (Ptr GVariant) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant jXattrs return jXattrs' outInput <- callocMem :: IO (Ptr (Ptr Gio.InputStream.InputStream)) maybeCancellable <- case cancellable of Maybe c Nothing -> Ptr Cancellable -> IO (Ptr Cancellable) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable forall a. Ptr a FP.nullPtr Just c jCancellable -> do jCancellable' <- c -> IO (Ptr Cancellable) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr c jCancellable return jCancellable' onException (do _ <- propagateGError $ ostree_raw_file_to_archive_z2_stream input' fileInfo' maybeXattrs outInput maybeCancellable outInput' <- peek outInput outInput'' <- (wrapObject Gio.InputStream.InputStream) outInput' touchManagedPtr input touchManagedPtr fileInfo whenJust xattrs touchManagedPtr whenJust cancellable touchManagedPtr freeMem outInput return outInput'' ) (do freeMem outInput ) -- function parse_refspec -- Args: [ Arg -- { argCName = "refspec" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A \"refspec\" string" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out_remote" -- , argType = TBasicType TUTF8 -- , argCType = Just "char**" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Return location for the remote name,\n or %NULL if the refspec refs to a local ref" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "out_ref" -- , argType = TBasicType TUTF8 -- , argCType = Just "char**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Return location for the ref name" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_parse_refspec" ostree_parse_refspec :: CString -> -- refspec : TBasicType TUTF8 Ptr CString -> -- out_remote : TBasicType TUTF8 Ptr CString -> -- out_ref : TBasicType TUTF8 Ptr (Ptr GError) -> -- error IO CInt -- | Split a refspec like @gnome-ostree:gnome-ostree\/buildmain@ or just -- @gnome-ostree\/buildmain@ into two parts. In the first case, /@outRemote@/ -- will be set to @gnome-ostree@, and /@outRef@/ to @gnome-ostree\/buildmain@. -- In the second case (a local ref), /@outRemote@/ will be 'P.Nothing', and /@outRef@/ -- will be @gnome-ostree\/buildmain@. In both cases, 'P.True' will be returned. parseRefspec :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@refspec@/: A \"refspec\" string -> m ((Maybe T.Text, T.Text)) -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ parseRefspec :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m (Maybe Text, Text) parseRefspec Text refspec = IO (Maybe Text, Text) -> m (Maybe Text, Text) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Maybe Text, Text) -> m (Maybe Text, Text)) -> IO (Maybe Text, Text) -> m (Maybe Text, Text) forall a b. (a -> b) -> a -> b $ do refspec' <- Text -> IO CString textToCString Text refspec outRemote <- callocMem :: IO (Ptr CString) outRef <- callocMem :: IO (Ptr CString) onException (do _ <- propagateGError $ ostree_parse_refspec refspec' outRemote outRef outRemote' <- peek outRemote maybeOutRemote' <- convertIfNonNull outRemote' $ \CString outRemote'' -> do outRemote''' <- HasCallStack => CString -> IO Text CString -> IO Text cstringToText CString outRemote'' return outRemote''' freeMem outRemote' outRef' <- peek outRef outRef'' <- cstringToText outRef' freeMem outRef' freeMem refspec' freeMem outRemote freeMem outRef return (maybeOutRemote', outRef'') ) (do freeMem refspec' freeMem outRemote freeMem outRef ) -- function object_type_to_string -- Args: [ Arg -- { argCName = "objtype" -- , argType = -- TInterface Name { namespace = "OSTree" , name = "ObjectType" } -- , argCType = Just "OstreeObjectType" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #OstreeObjectType" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "ostree_object_type_to_string" ostree_object_type_to_string :: CUInt -> -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"}) IO CString -- | Serialize /@objtype@/ to a string; this is used for file extensions. objectTypeToString :: (B.CallStack.HasCallStack, MonadIO m) => OSTree.Enums.ObjectType -- ^ /@objtype@/: an t'GI.OSTree.Enums.ObjectType' -> m T.Text objectTypeToString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => ObjectType -> m Text objectTypeToString ObjectType objtype = IO Text -> m Text forall a. IO a -> m a 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 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 result <- CUInt -> IO CString ostree_object_type_to_string CUInt objtype' checkUnexpectedReturnNULL "objectTypeToString" result result' <- cstringToText result return result' -- function object_type_from_string -- Args: [ Arg -- { argCName = "str" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A stringified version of #OstreeObjectType" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "OSTree" , name = "ObjectType" }) -- throws : False -- Skip return : False foreign import ccall "ostree_object_type_from_string" ostree_object_type_from_string :: CString -> -- str : TBasicType TUTF8 IO CUInt -- | The reverse of 'GI.OSTree.Functions.objectTypeToString'. objectTypeFromString :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@str@/: A stringified version of t'GI.OSTree.Enums.ObjectType' -> m OSTree.Enums.ObjectType objectTypeFromString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m ObjectType objectTypeFromString Text str = IO ObjectType -> m ObjectType forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO ObjectType -> m ObjectType) -> IO ObjectType -> m ObjectType forall a b. (a -> b) -> a -> b $ do str' <- Text -> IO CString textToCString Text str result <- ostree_object_type_from_string str' let result' = (Int -> ObjectType forall a. Enum a => Int -> a toEnum (Int -> ObjectType) -> (CUInt -> Int) -> CUInt -> ObjectType forall b c a. (b -> c) -> (a -> b) -> a -> c . CUInt -> Int forall a b. (Integral a, Num b) => a -> b fromIntegral) CUInt result freeMem str' return result' -- function object_to_string -- Args: [ Arg -- { argCName = "checksum" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An ASCII checksum" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "objtype" -- , argType = -- TInterface Name { namespace = "OSTree" , name = "ObjectType" } -- , argCType = Just "OstreeObjectType" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Object type" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "ostree_object_to_string" ostree_object_to_string :: CString -> -- checksum : TBasicType TUTF8 CUInt -> -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"}) IO CString -- | /No description available in the introspection data./ objectToString :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@checksum@/: An ASCII checksum -> OSTree.Enums.ObjectType -- ^ /@objtype@/: Object type -> m T.Text -- ^ __Returns:__ A string containing both /@checksum@/ and a stringifed version of /@objtype@/ objectToString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> ObjectType -> m Text objectToString Text checksum ObjectType objtype = IO Text -> m Text forall a. IO a -> m a 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 checksum' <- Text -> IO CString textToCString Text checksum let 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 result <- ostree_object_to_string checksum' objtype' checkUnexpectedReturnNULL "objectToString" result result' <- cstringToText result freeMem result freeMem checksum' return result' -- function object_name_serialize -- Args: [ Arg -- { argCName = "checksum" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An ASCII checksum" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "objtype" -- , argType = -- TInterface Name { namespace = "OSTree" , name = "ObjectType" } -- , argCType = Just "OstreeObjectType" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An object type" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just TVariant -- throws : False -- Skip return : False foreign import ccall "ostree_object_name_serialize" ostree_object_name_serialize :: CString -> -- checksum : TBasicType TUTF8 CUInt -> -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"}) IO (Ptr GVariant) -- | /No description available in the introspection data./ objectNameSerialize :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@checksum@/: An ASCII checksum -> OSTree.Enums.ObjectType -- ^ /@objtype@/: An object type -> m GVariant -- ^ __Returns:__ A new floating t'GVariant' containing checksum string and objtype objectNameSerialize :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> ObjectType -> m GVariant objectNameSerialize Text checksum ObjectType objtype = IO GVariant -> m GVariant forall a. IO a -> m a 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 checksum' <- Text -> IO CString textToCString Text checksum let 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 result <- ostree_object_name_serialize checksum' objtype' checkUnexpectedReturnNULL "objectNameSerialize" result result' <- B.GVariant.newGVariantFromPtr result freeMem checksum' return result' -- function object_name_deserialize -- Args: [ Arg -- { argCName = "variant" -- , argType = TVariant -- , argCType = Just "GVariant*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A #GVariant of type (su)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out_checksum" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "Pointer into string memory of @variant with checksum" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out_objtype" -- , argType = -- TInterface Name { namespace = "OSTree" , name = "ObjectType" } -- , argCType = Just "OstreeObjectType*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Return object type" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "ostree_object_name_deserialize" ostree_object_name_deserialize :: Ptr GVariant -> -- variant : TVariant Ptr CString -> -- out_checksum : TBasicType TUTF8 Ptr CUInt -> -- out_objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"}) IO () -- | Reverse 'GI.OSTree.Functions.objectNameSerialize'. Note that /@outChecksum@/ is -- only valid for the lifetime of /@variant@/, and must not be freed. objectNameDeserialize :: (B.CallStack.HasCallStack, MonadIO m) => GVariant -- ^ /@variant@/: A t'GVariant' of type (su) -> m ((T.Text, OSTree.Enums.ObjectType)) objectNameDeserialize :: forall (m :: * -> *). (HasCallStack, MonadIO m) => GVariant -> m (Text, ObjectType) objectNameDeserialize GVariant variant = IO (Text, ObjectType) -> m (Text, ObjectType) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Text, ObjectType) -> m (Text, ObjectType)) -> IO (Text, ObjectType) -> m (Text, ObjectType) forall a b. (a -> b) -> a -> b $ do variant' <- GVariant -> IO (Ptr GVariant) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant variant outChecksum <- callocMem :: IO (Ptr CString) outObjtype <- allocMem :: IO (Ptr CUInt) ostree_object_name_deserialize variant' outChecksum outObjtype outChecksum' <- peek outChecksum outChecksum'' <- cstringToText outChecksum' outObjtype' <- peek outObjtype let outObjtype'' = (Int -> ObjectType forall a. Enum a => Int -> a toEnum (Int -> ObjectType) -> (CUInt -> Int) -> CUInt -> ObjectType forall b c a. (b -> c) -> (a -> b) -> a -> c . CUInt -> Int forall a b. (Integral a, Num b) => a -> b fromIntegral) CUInt outObjtype' touchManagedPtr variant freeMem outChecksum freeMem outObjtype return (outChecksum'', outObjtype'') -- function object_from_string -- Args: [ Arg -- { argCName = "str" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An ASCII checksum" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out_checksum" -- , argType = TBasicType TUTF8 -- , argCType = Just "gchar**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Parsed checksum" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "out_objtype" -- , argType = -- TInterface Name { namespace = "OSTree" , name = "ObjectType" } -- , argCType = Just "OstreeObjectType*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Parsed object type" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "ostree_object_from_string" ostree_object_from_string :: CString -> -- str : TBasicType TUTF8 Ptr CString -> -- out_checksum : TBasicType TUTF8 Ptr CUInt -> -- out_objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"}) IO () -- | Reverse 'GI.OSTree.Functions.objectToString'. objectFromString :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@str@/: An ASCII checksum -> m ((T.Text, OSTree.Enums.ObjectType)) objectFromString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m (Text, ObjectType) objectFromString Text str = IO (Text, ObjectType) -> m (Text, ObjectType) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Text, ObjectType) -> m (Text, ObjectType)) -> IO (Text, ObjectType) -> m (Text, ObjectType) forall a b. (a -> b) -> a -> b $ do str' <- Text -> IO CString textToCString Text str outChecksum <- callocMem :: IO (Ptr CString) outObjtype <- allocMem :: IO (Ptr CUInt) ostree_object_from_string str' outChecksum outObjtype outChecksum' <- peek outChecksum outChecksum'' <- cstringToText outChecksum' freeMem outChecksum' outObjtype' <- peek outObjtype let outObjtype'' = (Int -> ObjectType forall a. Enum a => Int -> a toEnum (Int -> ObjectType) -> (CUInt -> Int) -> CUInt -> ObjectType forall b c a. (b -> c) -> (a -> b) -> a -> c . CUInt -> Int forall a b. (Integral a, Num b) => a -> b fromIntegral) CUInt outObjtype' freeMem str' freeMem outChecksum freeMem outObjtype return (outChecksum'', outObjtype'') -- function metadata_variant_type -- Args: [ Arg -- { argCName = "objtype" -- , argType = -- TInterface Name { namespace = "OSTree" , name = "ObjectType" } -- , argCType = Just "OstreeObjectType" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "GLib" , name = "VariantType" }) -- throws : False -- Skip return : False foreign import ccall "ostree_metadata_variant_type" ostree_metadata_variant_type :: CUInt -> -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"}) IO (Ptr GLib.VariantType.VariantType) -- | /No description available in the introspection data./ metadataVariantType :: (B.CallStack.HasCallStack, MonadIO m) => OSTree.Enums.ObjectType -> m GLib.VariantType.VariantType metadataVariantType :: forall (m :: * -> *). (HasCallStack, MonadIO m) => ObjectType -> m VariantType metadataVariantType ObjectType objtype = IO VariantType -> m VariantType forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO VariantType -> m VariantType) -> IO VariantType -> m VariantType forall a b. (a -> b) -> a -> b $ do 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 result <- CUInt -> IO (Ptr VariantType) ostree_metadata_variant_type CUInt objtype' checkUnexpectedReturnNULL "metadataVariantType" result result' <- (newBoxed GLib.VariantType.VariantType) result return result' -- function hash_object_name -- Args: [ Arg -- { argCName = "a" -- , argType = TBasicType TPtr -- , argCType = Just "gconstpointer" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "A #GVariant containing a serialized object" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "ostree_hash_object_name" ostree_hash_object_name :: Ptr () -> -- a : TBasicType TPtr IO Word32 -- | Use this function with t'GI.GLib.Structs.HashTable.HashTable' and 'GI.OSTree.Functions.objectNameSerialize'. hashObjectName :: (B.CallStack.HasCallStack, MonadIO m) => Ptr () -- ^ /@a@/: A t'GVariant' containing a serialized object -> m Word32 hashObjectName :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Ptr () -> m Word32 hashObjectName Ptr () a = IO Word32 -> m Word32 forall a. IO a -> m a 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 result <- Ptr () -> IO Word32 ostree_hash_object_name Ptr () a return result -- function gpg_error_quark -- Args: [] -- Lengths: [] -- returnType: Just (TBasicType TUInt32) -- throws : False -- Skip return : False foreign import ccall "ostree_gpg_error_quark" ostree_gpg_error_quark :: IO Word32 -- | /No description available in the introspection data./ -- -- /Since: 2017.10/ gpgErrorQuark :: (B.CallStack.HasCallStack, MonadIO m) => m Word32 gpgErrorQuark :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Word32 gpgErrorQuark = IO Word32 -> m Word32 forall a. IO a -> m a 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 result <- IO Word32 ostree_gpg_error_quark return result -- function fs_get_all_xattrs_at -- Args: [ Arg -- { argCName = "dfd" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Directory file descriptor" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "path" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Filesystem path" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , argCType = Just "GCancellable*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Cancellable" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just TVariant -- throws : True -- Skip return : False foreign import ccall "ostree_fs_get_all_xattrs_at" ostree_fs_get_all_xattrs_at :: Int32 -> -- dfd : TBasicType TInt CString -> -- path : TBasicType TUTF8 Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO (Ptr GVariant) -- | Retrieve all extended attributes in a canonical (sorted) order from -- the given path, relative to the provided directory file descriptor. -- The target path will not be dereferenced. Currently on Linux, this -- API must be used currently to retrieve extended attributes -- for symbolic links because while @O_PATH@ exists, it cannot be used -- with @fgetxattr()@. fsGetAllXattrsAt :: (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) => Int32 -- ^ /@dfd@/: Directory file descriptor -> T.Text -- ^ /@path@/: Filesystem path -> Maybe (a) -- ^ /@cancellable@/: Cancellable -> m GVariant -- ^ __Returns:__ A GVariant of type @a(ayay)@ /(Can throw 'Data.GI.Base.GError.GError')/ fsGetAllXattrsAt :: forall (m :: * -> *) a. (HasCallStack, MonadIO m, IsCancellable a) => Int32 -> Text -> Maybe a -> m GVariant fsGetAllXattrsAt Int32 dfd Text path Maybe a cancellable = IO GVariant -> m GVariant forall a. IO a -> m a 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 path' <- Text -> IO CString textToCString Text path maybeCancellable <- case cancellable of Maybe a Nothing -> Ptr Cancellable -> IO (Ptr Cancellable) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable forall a. Ptr a FP.nullPtr Just a jCancellable -> do jCancellable' <- a -> IO (Ptr Cancellable) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a jCancellable return jCancellable' onException (do result <- propagateGError $ ostree_fs_get_all_xattrs_at dfd path' maybeCancellable checkUnexpectedReturnNULL "fsGetAllXattrsAt" result result' <- B.GVariant.wrapGVariantPtr result whenJust cancellable touchManagedPtr freeMem path' return result' ) (do freeMem path' ) -- function fs_get_all_xattrs -- Args: [ Arg -- { argCName = "fd" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "File descriptor" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , argCType = Just "GCancellable*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Cancellable" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just TVariant -- throws : True -- Skip return : False foreign import ccall "ostree_fs_get_all_xattrs" ostree_fs_get_all_xattrs :: Int32 -> -- fd : TBasicType TInt Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO (Ptr GVariant) -- | Retrieve all extended attributes in a canonical (sorted) order from -- the given file descriptor. fsGetAllXattrs :: (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) => Int32 -- ^ /@fd@/: File descriptor -> Maybe (a) -- ^ /@cancellable@/: Cancellable -> m GVariant -- ^ __Returns:__ A GVariant of type @a(ayay)@ /(Can throw 'Data.GI.Base.GError.GError')/ fsGetAllXattrs :: forall (m :: * -> *) a. (HasCallStack, MonadIO m, IsCancellable a) => Int32 -> Maybe a -> m GVariant fsGetAllXattrs Int32 fd Maybe a cancellable = IO GVariant -> m GVariant forall a. IO a -> m a 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 maybeCancellable <- case Maybe a cancellable of Maybe a Nothing -> Ptr Cancellable -> IO (Ptr Cancellable) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable forall a. Ptr a FP.nullPtr Just a jCancellable -> do jCancellable' <- a -> IO (Ptr Cancellable) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a jCancellable return jCancellable' onException (do result <- propagateGError $ ostree_fs_get_all_xattrs fd maybeCancellable checkUnexpectedReturnNULL "fsGetAllXattrs" result result' <- B.GVariant.wrapGVariantPtr result whenJust cancellable touchManagedPtr return result' ) (do return () ) -- function diff_print -- Args: [ Arg -- { argCName = "a" -- , argType = TInterface Name { namespace = "Gio" , name = "File" } -- , argCType = Just "GFile*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "First directory path" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "b" -- , argType = TInterface Name { namespace = "Gio" , name = "File" } -- , argCType = Just "GFile*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "First directory path" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "modified" -- , argType = -- TPtrArray -- (TInterface Name { namespace = "OSTree" , name = "DiffItem" }) -- , argCType = Just "GPtrArray*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Modified files" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "removed" -- , argType = -- TPtrArray (TInterface Name { namespace = "Gio" , name = "File" }) -- , argCType = Just "GPtrArray*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Removed files" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "added" -- , argType = -- TPtrArray (TInterface Name { namespace = "Gio" , name = "File" }) -- , argCType = Just "GPtrArray*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Added files" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "ostree_diff_print" ostree_diff_print :: Ptr Gio.File.File -> -- a : TInterface (Name {namespace = "Gio", name = "File"}) Ptr Gio.File.File -> -- b : TInterface (Name {namespace = "Gio", name = "File"}) Ptr (GPtrArray (Ptr OSTree.DiffItem.DiffItem)) -> -- modified : TPtrArray (TInterface (Name {namespace = "OSTree", name = "DiffItem"})) Ptr (GPtrArray (Ptr Gio.File.File)) -> -- removed : TPtrArray (TInterface (Name {namespace = "Gio", name = "File"})) Ptr (GPtrArray (Ptr Gio.File.File)) -> -- added : TPtrArray (TInterface (Name {namespace = "Gio", name = "File"})) IO () -- | Print the contents of a diff to stdout. diffPrint :: (B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a, Gio.File.IsFile b) => a -- ^ /@a@/: First directory path -> b -- ^ /@b@/: First directory path -> [OSTree.DiffItem.DiffItem] -- ^ /@modified@/: Modified files -> [Gio.File.File] -- ^ /@removed@/: Removed files -> [Gio.File.File] -- ^ /@added@/: Added files -> m () diffPrint :: forall (m :: * -> *) a b. (HasCallStack, MonadIO m, IsFile a, IsFile b) => a -> b -> [DiffItem] -> [File] -> [File] -> m () diffPrint a a b b [DiffItem] modified [File] removed [File] added = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do a' <- a -> IO (Ptr File) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a a b' <- unsafeManagedPtrCastPtr b modified' <- mapM unsafeManagedPtrGetPtr modified modified'' <- packGPtrArray modified' removed' <- mapM unsafeManagedPtrCastPtr removed removed'' <- packGPtrArray removed' added' <- mapM unsafeManagedPtrCastPtr added added'' <- packGPtrArray added' ostree_diff_print a' b' modified'' removed'' added'' touchManagedPtr a touchManagedPtr b mapM_ touchManagedPtr modified mapM_ touchManagedPtr removed mapM_ touchManagedPtr added unrefPtrArray modified'' unrefPtrArray removed'' unrefPtrArray added'' return () -- function diff_dirs_with_options -- Args: [ Arg -- { argCName = "flags" -- , argType = -- TInterface Name { namespace = "OSTree" , name = "DiffFlags" } -- , argCType = Just "OstreeDiffFlags" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Flags" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "a" -- , argType = TInterface Name { namespace = "Gio" , name = "File" } -- , argCType = Just "GFile*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "First directory path, or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "b" -- , argType = TInterface Name { namespace = "Gio" , name = "File" } -- , argCType = Just "GFile*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "First directory path" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "modified" -- , argType = -- TPtrArray -- (TInterface Name { namespace = "OSTree" , name = "DiffItem" }) -- , argCType = Just "GPtrArray*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Modified files" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "removed" -- , argType = -- TPtrArray (TInterface Name { namespace = "Gio" , name = "File" }) -- , argCType = Just "GPtrArray*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Removed files" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "added" -- , argType = -- TPtrArray (TInterface Name { namespace = "Gio" , name = "File" }) -- , argCType = Just "GPtrArray*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Added files" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "options" -- , argType = -- TInterface Name { namespace = "OSTree" , name = "DiffDirsOptions" } -- , argCType = Just "OstreeDiffDirsOptions*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Options" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , argCType = Just "GCancellable*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Cancellable" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_diff_dirs_with_options" ostree_diff_dirs_with_options :: CUInt -> -- flags : TInterface (Name {namespace = "OSTree", name = "DiffFlags"}) Ptr Gio.File.File -> -- a : TInterface (Name {namespace = "Gio", name = "File"}) Ptr Gio.File.File -> -- b : TInterface (Name {namespace = "Gio", name = "File"}) Ptr (GPtrArray (Ptr OSTree.DiffItem.DiffItem)) -> -- modified : TPtrArray (TInterface (Name {namespace = "OSTree", name = "DiffItem"})) Ptr (GPtrArray (Ptr Gio.File.File)) -> -- removed : TPtrArray (TInterface (Name {namespace = "Gio", name = "File"})) Ptr (GPtrArray (Ptr Gio.File.File)) -> -- added : TPtrArray (TInterface (Name {namespace = "Gio", name = "File"})) Ptr OSTree.DiffDirsOptions.DiffDirsOptions -> -- options : TInterface (Name {namespace = "OSTree", name = "DiffDirsOptions"}) Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO CInt -- | Compute the difference between directory /@a@/ and /@b@/ as 3 separate -- sets of t'GI.OSTree.Structs.DiffItem.DiffItem' in /@modified@/, /@removed@/, and /@added@/. -- -- /Since: 2017.4/ diffDirsWithOptions :: (B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) => [OSTree.Flags.DiffFlags] -- ^ /@flags@/: Flags -> a -- ^ /@a@/: First directory path, or 'P.Nothing' -> b -- ^ /@b@/: First directory path -> [OSTree.DiffItem.DiffItem] -- ^ /@modified@/: Modified files -> [Gio.File.File] -- ^ /@removed@/: Removed files -> [Gio.File.File] -- ^ /@added@/: Added files -> Maybe (OSTree.DiffDirsOptions.DiffDirsOptions) -- ^ /@options@/: Options -> Maybe (c) -- ^ /@cancellable@/: Cancellable -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ diffDirsWithOptions :: forall (m :: * -> *) a b c. (HasCallStack, MonadIO m, IsFile a, IsFile b, IsCancellable c) => [DiffFlags] -> a -> b -> [DiffItem] -> [File] -> [File] -> Maybe DiffDirsOptions -> Maybe c -> m () diffDirsWithOptions [DiffFlags] flags a a b b [DiffItem] modified [File] removed [File] added Maybe DiffDirsOptions options Maybe c cancellable = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let flags' :: CUInt flags' = [DiffFlags] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [DiffFlags] flags a' <- a -> IO (Ptr File) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a a b' <- unsafeManagedPtrCastPtr b modified' <- mapM unsafeManagedPtrGetPtr modified modified'' <- packGPtrArray modified' removed' <- mapM unsafeManagedPtrCastPtr removed removed'' <- packGPtrArray removed' added' <- mapM unsafeManagedPtrCastPtr added added'' <- packGPtrArray added' maybeOptions <- case options of Maybe DiffDirsOptions Nothing -> Ptr DiffDirsOptions -> IO (Ptr DiffDirsOptions) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr DiffDirsOptions forall a. Ptr a FP.nullPtr Just DiffDirsOptions jOptions -> do jOptions' <- DiffDirsOptions -> IO (Ptr DiffDirsOptions) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr DiffDirsOptions jOptions return jOptions' maybeCancellable <- case cancellable of Maybe c Nothing -> Ptr Cancellable -> IO (Ptr Cancellable) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable forall a. Ptr a FP.nullPtr Just c jCancellable -> do jCancellable' <- c -> IO (Ptr Cancellable) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr c jCancellable return jCancellable' onException (do _ <- propagateGError $ ostree_diff_dirs_with_options flags' a' b' modified'' removed'' added'' maybeOptions maybeCancellable touchManagedPtr a touchManagedPtr b mapM_ touchManagedPtr modified mapM_ touchManagedPtr removed mapM_ touchManagedPtr added whenJust options touchManagedPtr whenJust cancellable touchManagedPtr unrefPtrArray modified'' unrefPtrArray removed'' unrefPtrArray added'' return () ) (do unrefPtrArray modified'' unrefPtrArray removed'' unrefPtrArray added'' ) -- function diff_dirs -- Args: [ Arg -- { argCName = "flags" -- , argType = -- TInterface Name { namespace = "OSTree" , name = "DiffFlags" } -- , argCType = Just "OstreeDiffFlags" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Flags" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "a" -- , argType = TInterface Name { namespace = "Gio" , name = "File" } -- , argCType = Just "GFile*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "First directory path, or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "b" -- , argType = TInterface Name { namespace = "Gio" , name = "File" } -- , argCType = Just "GFile*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "First directory path" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "modified" -- , argType = -- TPtrArray -- (TInterface Name { namespace = "OSTree" , name = "DiffItem" }) -- , argCType = Just "GPtrArray*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Modified files" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "removed" -- , argType = -- TPtrArray (TInterface Name { namespace = "Gio" , name = "File" }) -- , argCType = Just "GPtrArray*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Removed files" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "added" -- , argType = -- TPtrArray (TInterface Name { namespace = "Gio" , name = "File" }) -- , argCType = Just "GPtrArray*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Added files" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , argCType = Just "GCancellable*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Cancellable" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_diff_dirs" ostree_diff_dirs :: CUInt -> -- flags : TInterface (Name {namespace = "OSTree", name = "DiffFlags"}) Ptr Gio.File.File -> -- a : TInterface (Name {namespace = "Gio", name = "File"}) Ptr Gio.File.File -> -- b : TInterface (Name {namespace = "Gio", name = "File"}) Ptr (GPtrArray (Ptr OSTree.DiffItem.DiffItem)) -> -- modified : TPtrArray (TInterface (Name {namespace = "OSTree", name = "DiffItem"})) Ptr (GPtrArray (Ptr Gio.File.File)) -> -- removed : TPtrArray (TInterface (Name {namespace = "Gio", name = "File"})) Ptr (GPtrArray (Ptr Gio.File.File)) -> -- added : TPtrArray (TInterface (Name {namespace = "Gio", name = "File"})) Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO CInt -- | Compute the difference between directory /@a@/ and /@b@/ as 3 separate -- sets of t'GI.OSTree.Structs.DiffItem.DiffItem' in /@modified@/, /@removed@/, and /@added@/. diffDirs :: (B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) => [OSTree.Flags.DiffFlags] -- ^ /@flags@/: Flags -> a -- ^ /@a@/: First directory path, or 'P.Nothing' -> b -- ^ /@b@/: First directory path -> [OSTree.DiffItem.DiffItem] -- ^ /@modified@/: Modified files -> [Gio.File.File] -- ^ /@removed@/: Removed files -> [Gio.File.File] -- ^ /@added@/: Added files -> Maybe (c) -- ^ /@cancellable@/: Cancellable -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ diffDirs :: forall (m :: * -> *) a b c. (HasCallStack, MonadIO m, IsFile a, IsFile b, IsCancellable c) => [DiffFlags] -> a -> b -> [DiffItem] -> [File] -> [File] -> Maybe c -> m () diffDirs [DiffFlags] flags a a b b [DiffItem] modified [File] removed [File] added Maybe c cancellable = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let flags' :: CUInt flags' = [DiffFlags] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [DiffFlags] flags a' <- a -> IO (Ptr File) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a a b' <- unsafeManagedPtrCastPtr b modified' <- mapM unsafeManagedPtrGetPtr modified modified'' <- packGPtrArray modified' removed' <- mapM unsafeManagedPtrCastPtr removed removed'' <- packGPtrArray removed' added' <- mapM unsafeManagedPtrCastPtr added added'' <- packGPtrArray added' maybeCancellable <- case cancellable of Maybe c Nothing -> Ptr Cancellable -> IO (Ptr Cancellable) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable forall a. Ptr a FP.nullPtr Just c jCancellable -> do jCancellable' <- c -> IO (Ptr Cancellable) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr c jCancellable return jCancellable' onException (do _ <- propagateGError $ ostree_diff_dirs flags' a' b' modified'' removed'' added'' maybeCancellable touchManagedPtr a touchManagedPtr b mapM_ touchManagedPtr modified mapM_ touchManagedPtr removed mapM_ touchManagedPtr added whenJust cancellable touchManagedPtr unrefPtrArray modified'' unrefPtrArray removed'' unrefPtrArray added'' return () ) (do unrefPtrArray modified'' unrefPtrArray removed'' unrefPtrArray added'' ) -- function create_directory_metadata -- Args: [ Arg -- { argCName = "dir_info" -- , argType = -- TInterface Name { namespace = "Gio" , name = "FileInfo" } -- , argCType = Just "GFileInfo*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GFileInfo containing directory information" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "xattrs" -- , argType = TVariant -- , argCType = Just "GVariant*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Optional extended attributes" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just TVariant -- throws : False -- Skip return : False foreign import ccall "ostree_create_directory_metadata" ostree_create_directory_metadata :: Ptr Gio.FileInfo.FileInfo -> -- dir_info : TInterface (Name {namespace = "Gio", name = "FileInfo"}) Ptr GVariant -> -- xattrs : TVariant IO (Ptr GVariant) -- | /No description available in the introspection data./ createDirectoryMetadata :: (B.CallStack.HasCallStack, MonadIO m, Gio.FileInfo.IsFileInfo a) => a -- ^ /@dirInfo@/: a t'GI.Gio.Objects.FileInfo.FileInfo' containing directory information -> Maybe (GVariant) -- ^ /@xattrs@/: Optional extended attributes -> m GVariant -- ^ __Returns:__ A new t'GVariant' containing 'GI.OSTree.Enums.ObjectTypeDirMeta' createDirectoryMetadata :: forall (m :: * -> *) a. (HasCallStack, MonadIO m, IsFileInfo a) => a -> Maybe GVariant -> m GVariant createDirectoryMetadata a dirInfo Maybe GVariant xattrs = IO GVariant -> m GVariant forall a. IO a -> m a 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 dirInfo' <- a -> IO (Ptr FileInfo) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a dirInfo maybeXattrs <- case xattrs of Maybe GVariant Nothing -> Ptr GVariant -> IO (Ptr GVariant) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr GVariant forall a. Ptr a FP.nullPtr Just GVariant jXattrs -> do jXattrs' <- GVariant -> IO (Ptr GVariant) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant jXattrs return jXattrs' result <- ostree_create_directory_metadata dirInfo' maybeXattrs checkUnexpectedReturnNULL "createDirectoryMetadata" result result' <- B.GVariant.wrapGVariantPtr result touchManagedPtr dirInfo whenJust xattrs touchManagedPtr return result' -- function content_stream_parse -- Args: [ Arg -- { argCName = "compressed" -- , argType = TBasicType TBoolean -- , argCType = Just "gboolean" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Whether or not the stream is zlib-compressed" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "input" -- , argType = -- TInterface Name { namespace = "Gio" , name = "InputStream" } -- , argCType = Just "GInputStream*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Object content stream" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "input_length" -- , argType = TBasicType TUInt64 -- , argCType = Just "guint64" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Length of stream" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "trusted" -- , argType = TBasicType TBoolean -- , argCType = Just "gboolean" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "If %TRUE, assume the content has been validated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out_input" -- , argType = -- TInterface Name { namespace = "Gio" , name = "InputStream" } -- , argCType = Just "GInputStream**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The raw file content stream" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "out_file_info" -- , argType = -- TInterface Name { namespace = "Gio" , name = "FileInfo" } -- , argCType = Just "GFileInfo**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Normal metadata" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "out_xattrs" -- , argType = TVariant -- , argCType = Just "GVariant**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Extended attributes" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , argCType = Just "GCancellable*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Cancellable" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_content_stream_parse" ostree_content_stream_parse :: CInt -> -- compressed : TBasicType TBoolean Ptr Gio.InputStream.InputStream -> -- input : TInterface (Name {namespace = "Gio", name = "InputStream"}) Word64 -> -- input_length : TBasicType TUInt64 CInt -> -- trusted : TBasicType TBoolean Ptr (Ptr Gio.InputStream.InputStream) -> -- out_input : TInterface (Name {namespace = "Gio", name = "InputStream"}) Ptr (Ptr Gio.FileInfo.FileInfo) -> -- out_file_info : TInterface (Name {namespace = "Gio", name = "FileInfo"}) Ptr (Ptr GVariant) -> -- out_xattrs : TVariant Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO CInt -- | The reverse of 'GI.OSTree.Functions.rawFileToContentStream'; this function -- converts an object content stream back into components. contentStreamParse :: (B.CallStack.HasCallStack, MonadIO m, Gio.InputStream.IsInputStream a, Gio.Cancellable.IsCancellable b) => Bool -- ^ /@compressed@/: Whether or not the stream is zlib-compressed -> a -- ^ /@input@/: Object content stream -> Word64 -- ^ /@inputLength@/: Length of stream -> Bool -- ^ /@trusted@/: If 'P.True', assume the content has been validated -> Maybe (b) -- ^ /@cancellable@/: Cancellable -> m ((Gio.InputStream.InputStream, Gio.FileInfo.FileInfo, GVariant)) -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ contentStreamParse :: forall (m :: * -> *) a b. (HasCallStack, MonadIO m, IsInputStream a, IsCancellable b) => Bool -> a -> Word64 -> Bool -> Maybe b -> m (InputStream, FileInfo, GVariant) contentStreamParse Bool compressed a input Word64 inputLength Bool trusted Maybe b cancellable = IO (InputStream, FileInfo, GVariant) -> m (InputStream, FileInfo, GVariant) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (InputStream, FileInfo, GVariant) -> m (InputStream, FileInfo, GVariant)) -> IO (InputStream, FileInfo, GVariant) -> m (InputStream, FileInfo, GVariant) forall a b. (a -> b) -> a -> b $ do let compressed' :: CInt compressed' = (Int -> CInt forall a b. (Integral a, Num b) => a -> b P.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 P.fromEnum) Bool compressed input' <- a -> IO (Ptr InputStream) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a input let trusted' = (Int -> CInt forall a b. (Integral a, Num b) => a -> b P.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 P.fromEnum) Bool trusted outInput <- callocMem :: IO (Ptr (Ptr Gio.InputStream.InputStream)) outFileInfo <- callocMem :: IO (Ptr (Ptr Gio.FileInfo.FileInfo)) outXattrs <- callocMem :: IO (Ptr (Ptr GVariant)) maybeCancellable <- case cancellable of Maybe b Nothing -> Ptr Cancellable -> IO (Ptr Cancellable) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable forall a. Ptr a FP.nullPtr Just b jCancellable -> do jCancellable' <- b -> IO (Ptr Cancellable) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr b jCancellable return jCancellable' onException (do _ <- propagateGError $ ostree_content_stream_parse compressed' input' inputLength trusted' outInput outFileInfo outXattrs maybeCancellable outInput' <- peek outInput outInput'' <- (wrapObject Gio.InputStream.InputStream) outInput' outFileInfo' <- peek outFileInfo outFileInfo'' <- (wrapObject Gio.FileInfo.FileInfo) outFileInfo' outXattrs' <- peek outXattrs outXattrs'' <- B.GVariant.wrapGVariantPtr outXattrs' touchManagedPtr input whenJust cancellable touchManagedPtr freeMem outInput freeMem outFileInfo freeMem outXattrs return (outInput'', outFileInfo'', outXattrs'') ) (do freeMem outInput freeMem outFileInfo freeMem outXattrs ) -- function content_file_parse_at -- Args: [ Arg -- { argCName = "compressed" -- , argType = TBasicType TBoolean -- , argCType = Just "gboolean" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Whether or not the stream is zlib-compressed" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "parent_dfd" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Directory file descriptor" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "path" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Subpath" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "trusted" -- , argType = TBasicType TBoolean -- , argCType = Just "gboolean" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "If %TRUE, assume the content has been validated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out_input" -- , argType = -- TInterface Name { namespace = "Gio" , name = "InputStream" } -- , argCType = Just "GInputStream**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The raw file content stream" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "out_file_info" -- , argType = -- TInterface Name { namespace = "Gio" , name = "FileInfo" } -- , argCType = Just "GFileInfo**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Normal metadata" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "out_xattrs" -- , argType = TVariant -- , argCType = Just "GVariant**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Extended attributes" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , argCType = Just "GCancellable*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Cancellable" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_content_file_parse_at" ostree_content_file_parse_at :: CInt -> -- compressed : TBasicType TBoolean Int32 -> -- parent_dfd : TBasicType TInt CString -> -- path : TBasicType TUTF8 CInt -> -- trusted : TBasicType TBoolean Ptr (Ptr Gio.InputStream.InputStream) -> -- out_input : TInterface (Name {namespace = "Gio", name = "InputStream"}) Ptr (Ptr Gio.FileInfo.FileInfo) -> -- out_file_info : TInterface (Name {namespace = "Gio", name = "FileInfo"}) Ptr (Ptr GVariant) -> -- out_xattrs : TVariant Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO CInt -- | A thin wrapper for 'GI.OSTree.Functions.contentStreamParse'; this function -- converts an object content stream back into components. contentFileParseAt :: (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) => Bool -- ^ /@compressed@/: Whether or not the stream is zlib-compressed -> Int32 -- ^ /@parentDfd@/: Directory file descriptor -> T.Text -- ^ /@path@/: Subpath -> Bool -- ^ /@trusted@/: If 'P.True', assume the content has been validated -> Maybe (a) -- ^ /@cancellable@/: Cancellable -> m ((Gio.InputStream.InputStream, Gio.FileInfo.FileInfo, GVariant)) -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ contentFileParseAt :: forall (m :: * -> *) a. (HasCallStack, MonadIO m, IsCancellable a) => Bool -> Int32 -> Text -> Bool -> Maybe a -> m (InputStream, FileInfo, GVariant) contentFileParseAt Bool compressed Int32 parentDfd Text path Bool trusted Maybe a cancellable = IO (InputStream, FileInfo, GVariant) -> m (InputStream, FileInfo, GVariant) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (InputStream, FileInfo, GVariant) -> m (InputStream, FileInfo, GVariant)) -> IO (InputStream, FileInfo, GVariant) -> m (InputStream, FileInfo, GVariant) forall a b. (a -> b) -> a -> b $ do let compressed' :: CInt compressed' = (Int -> CInt forall a b. (Integral a, Num b) => a -> b P.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 P.fromEnum) Bool compressed path' <- Text -> IO CString textToCString Text path let trusted' = (Int -> CInt forall a b. (Integral a, Num b) => a -> b P.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 P.fromEnum) Bool trusted outInput <- callocMem :: IO (Ptr (Ptr Gio.InputStream.InputStream)) outFileInfo <- callocMem :: IO (Ptr (Ptr Gio.FileInfo.FileInfo)) outXattrs <- callocMem :: IO (Ptr (Ptr GVariant)) maybeCancellable <- case cancellable of Maybe a Nothing -> Ptr Cancellable -> IO (Ptr Cancellable) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable forall a. Ptr a FP.nullPtr Just a jCancellable -> do jCancellable' <- a -> IO (Ptr Cancellable) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a jCancellable return jCancellable' onException (do _ <- propagateGError $ ostree_content_file_parse_at compressed' parentDfd path' trusted' outInput outFileInfo outXattrs maybeCancellable outInput' <- peek outInput outInput'' <- (wrapObject Gio.InputStream.InputStream) outInput' outFileInfo' <- peek outFileInfo outFileInfo'' <- (wrapObject Gio.FileInfo.FileInfo) outFileInfo' outXattrs' <- peek outXattrs outXattrs'' <- B.GVariant.wrapGVariantPtr outXattrs' whenJust cancellable touchManagedPtr freeMem path' freeMem outInput freeMem outFileInfo freeMem outXattrs return (outInput'', outFileInfo'', outXattrs'') ) (do freeMem path' freeMem outInput freeMem outFileInfo freeMem outXattrs ) -- function content_file_parse -- Args: [ Arg -- { argCName = "compressed" -- , argType = TBasicType TBoolean -- , argCType = Just "gboolean" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Whether or not the stream is zlib-compressed" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "content_path" -- , argType = TInterface Name { namespace = "Gio" , name = "File" } -- , argCType = Just "GFile*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Path to file containing content" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "trusted" -- , argType = TBasicType TBoolean -- , argCType = Just "gboolean" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "If %TRUE, assume the content has been validated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out_input" -- , argType = -- TInterface Name { namespace = "Gio" , name = "InputStream" } -- , argCType = Just "GInputStream**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The raw file content stream" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "out_file_info" -- , argType = -- TInterface Name { namespace = "Gio" , name = "FileInfo" } -- , argCType = Just "GFileInfo**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Normal metadata" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "out_xattrs" -- , argType = TVariant -- , argCType = Just "GVariant**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Extended attributes" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , argCType = Just "GCancellable*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Cancellable" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_content_file_parse" ostree_content_file_parse :: CInt -> -- compressed : TBasicType TBoolean Ptr Gio.File.File -> -- content_path : TInterface (Name {namespace = "Gio", name = "File"}) CInt -> -- trusted : TBasicType TBoolean Ptr (Ptr Gio.InputStream.InputStream) -> -- out_input : TInterface (Name {namespace = "Gio", name = "InputStream"}) Ptr (Ptr Gio.FileInfo.FileInfo) -> -- out_file_info : TInterface (Name {namespace = "Gio", name = "FileInfo"}) Ptr (Ptr GVariant) -> -- out_xattrs : TVariant Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO CInt -- | A thin wrapper for 'GI.OSTree.Functions.contentStreamParse'; this function -- converts an object content stream back into components. contentFileParse :: (B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a, Gio.Cancellable.IsCancellable b) => Bool -- ^ /@compressed@/: Whether or not the stream is zlib-compressed -> a -- ^ /@contentPath@/: Path to file containing content -> Bool -- ^ /@trusted@/: If 'P.True', assume the content has been validated -> Maybe (b) -- ^ /@cancellable@/: Cancellable -> m ((Gio.InputStream.InputStream, Gio.FileInfo.FileInfo, GVariant)) -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ contentFileParse :: forall (m :: * -> *) a b. (HasCallStack, MonadIO m, IsFile a, IsCancellable b) => Bool -> a -> Bool -> Maybe b -> m (InputStream, FileInfo, GVariant) contentFileParse Bool compressed a contentPath Bool trusted Maybe b cancellable = IO (InputStream, FileInfo, GVariant) -> m (InputStream, FileInfo, GVariant) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (InputStream, FileInfo, GVariant) -> m (InputStream, FileInfo, GVariant)) -> IO (InputStream, FileInfo, GVariant) -> m (InputStream, FileInfo, GVariant) forall a b. (a -> b) -> a -> b $ do let compressed' :: CInt compressed' = (Int -> CInt forall a b. (Integral a, Num b) => a -> b P.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 P.fromEnum) Bool compressed contentPath' <- a -> IO (Ptr File) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a contentPath let trusted' = (Int -> CInt forall a b. (Integral a, Num b) => a -> b P.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 P.fromEnum) Bool trusted outInput <- callocMem :: IO (Ptr (Ptr Gio.InputStream.InputStream)) outFileInfo <- callocMem :: IO (Ptr (Ptr Gio.FileInfo.FileInfo)) outXattrs <- callocMem :: IO (Ptr (Ptr GVariant)) maybeCancellable <- case cancellable of Maybe b Nothing -> Ptr Cancellable -> IO (Ptr Cancellable) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable forall a. Ptr a FP.nullPtr Just b jCancellable -> do jCancellable' <- b -> IO (Ptr Cancellable) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr b jCancellable return jCancellable' onException (do _ <- propagateGError $ ostree_content_file_parse compressed' contentPath' trusted' outInput outFileInfo outXattrs maybeCancellable outInput' <- peek outInput outInput'' <- (wrapObject Gio.InputStream.InputStream) outInput' outFileInfo' <- peek outFileInfo outFileInfo'' <- (wrapObject Gio.FileInfo.FileInfo) outFileInfo' outXattrs' <- peek outXattrs outXattrs'' <- B.GVariant.wrapGVariantPtr outXattrs' touchManagedPtr contentPath whenJust cancellable touchManagedPtr freeMem outInput freeMem outFileInfo freeMem outXattrs return (outInput'', outFileInfo'', outXattrs'') ) (do freeMem outInput freeMem outFileInfo freeMem outXattrs ) -- function commit_metadata_for_bootable -- Args: [ Arg -- { argCName = "root" -- , argType = TInterface Name { namespace = "Gio" , name = "File" } -- , argCType = Just "GFile*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Root filesystem to be committed" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "dict" -- , argType = -- TInterface Name { namespace = "GLib" , name = "VariantDict" } -- , argCType = Just "GVariantDict*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Dictionary to update" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , argCType = Just "GCancellable*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_commit_metadata_for_bootable" ostree_commit_metadata_for_bootable :: Ptr Gio.File.File -> -- root : TInterface (Name {namespace = "Gio", name = "File"}) Ptr GLib.VariantDict.VariantDict -> -- dict : TInterface (Name {namespace = "GLib", name = "VariantDict"}) Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO CInt -- | Update provided /@dict@/ with standard metadata for bootable OSTree commits. -- -- /Since: 2021.1/ commitMetadataForBootable :: (B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a, Gio.Cancellable.IsCancellable b) => a -- ^ /@root@/: Root filesystem to be committed -> GLib.VariantDict.VariantDict -- ^ /@dict@/: Dictionary to update -> Maybe (b) -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ commitMetadataForBootable :: forall (m :: * -> *) a b. (HasCallStack, MonadIO m, IsFile a, IsCancellable b) => a -> VariantDict -> Maybe b -> m () commitMetadataForBootable a root VariantDict dict Maybe b cancellable = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do root' <- a -> IO (Ptr File) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a root dict' <- unsafeManagedPtrGetPtr dict maybeCancellable <- case cancellable of Maybe b Nothing -> Ptr Cancellable -> IO (Ptr Cancellable) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable forall a. Ptr a FP.nullPtr Just b jCancellable -> do jCancellable' <- b -> IO (Ptr Cancellable) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr b jCancellable return jCancellable' onException (do _ <- propagateGError $ ostree_commit_metadata_for_bootable root' dict' maybeCancellable touchManagedPtr root touchManagedPtr dict whenJust cancellable touchManagedPtr return () ) (do return () ) -- function commit_get_timestamp -- Args: [ Arg -- { argCName = "commit_variant" -- , argType = TVariant -- , argCType = Just "GVariant*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Commit object" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt64) -- throws : False -- Skip return : False foreign import ccall "ostree_commit_get_timestamp" ostree_commit_get_timestamp :: Ptr GVariant -> -- commit_variant : TVariant IO Word64 -- | /No description available in the introspection data./ -- -- /Since: 2016.3/ commitGetTimestamp :: (B.CallStack.HasCallStack, MonadIO m) => GVariant -- ^ /@commitVariant@/: Commit object -> m Word64 -- ^ __Returns:__ timestamp in seconds since the Unix epoch, UTC commitGetTimestamp :: forall (m :: * -> *). (HasCallStack, MonadIO m) => GVariant -> m Word64 commitGetTimestamp GVariant commitVariant = IO Word64 -> m Word64 forall a. IO a -> m a 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 commitVariant' <- GVariant -> IO (Ptr GVariant) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant commitVariant result <- ostree_commit_get_timestamp commitVariant' touchManagedPtr commitVariant return result -- function commit_get_parent -- Args: [ Arg -- { argCName = "commit_variant" -- , argType = TVariant -- , argCType = Just "GVariant*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Variant of type %OSTREE_OBJECT_TYPE_COMMIT" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "ostree_commit_get_parent" ostree_commit_get_parent :: Ptr GVariant -> -- commit_variant : TVariant IO CString -- | /No description available in the introspection data./ commitGetParent :: (B.CallStack.HasCallStack, MonadIO m) => GVariant -- ^ /@commitVariant@/: Variant of type 'GI.OSTree.Enums.ObjectTypeCommit' -> m (Maybe T.Text) -- ^ __Returns:__ Checksum of the parent commit of /@commitVariant@/, or 'P.Nothing' -- if none commitGetParent :: forall (m :: * -> *). (HasCallStack, MonadIO m) => GVariant -> m (Maybe Text) commitGetParent GVariant commitVariant = IO (Maybe Text) -> m (Maybe Text) forall a. IO a -> m a 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 commitVariant' <- GVariant -> IO (Ptr GVariant) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant commitVariant result <- ostree_commit_get_parent commitVariant' maybeResult <- convertIfNonNull result $ \CString result' -> do result'' <- HasCallStack => CString -> IO Text CString -> IO Text cstringToText CString result' freeMem result' return result'' touchManagedPtr commitVariant return maybeResult -- function commit_get_object_sizes -- Args: [ Arg -- { argCName = "commit_variant" -- , argType = TVariant -- , argCType = Just "GVariant*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "variant of type %OSTREE_OBJECT_TYPE_COMMIT" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out_sizes_entries" -- , argType = -- TPtrArray -- (TInterface -- Name { namespace = "OSTree" , name = "CommitSizesEntry" }) -- , argCType = Just "GPtrArray**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "\n return location for an array of object size entries" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferContainer -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_commit_get_object_sizes" ostree_commit_get_object_sizes :: Ptr GVariant -> -- commit_variant : TVariant Ptr (Ptr (GPtrArray (Ptr OSTree.CommitSizesEntry.CommitSizesEntry))) -> -- out_sizes_entries : TPtrArray (TInterface (Name {namespace = "OSTree", name = "CommitSizesEntry"})) Ptr (Ptr GError) -> -- error IO CInt -- | Reads a commit\'s \"ostree.sizes\" metadata and returns an array of -- t'GI.OSTree.Structs.CommitSizesEntry.CommitSizesEntry' in /@outSizesEntries@/. Each element -- represents an object in the commit. If the commit does not contain -- the \"ostree.sizes\" metadata, a 'GI.Gio.Enums.IOErrorEnumNotFound' error will be -- returned. -- -- /Since: 2020.1/ commitGetObjectSizes :: (B.CallStack.HasCallStack, MonadIO m) => GVariant -- ^ /@commitVariant@/: variant of type 'GI.OSTree.Enums.ObjectTypeCommit' -> m ([OSTree.CommitSizesEntry.CommitSizesEntry]) -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ commitGetObjectSizes :: forall (m :: * -> *). (HasCallStack, MonadIO m) => GVariant -> m [CommitSizesEntry] commitGetObjectSizes GVariant commitVariant = IO [CommitSizesEntry] -> m [CommitSizesEntry] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [CommitSizesEntry] -> m [CommitSizesEntry]) -> IO [CommitSizesEntry] -> m [CommitSizesEntry] forall a b. (a -> b) -> a -> b $ do commitVariant' <- GVariant -> IO (Ptr GVariant) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant commitVariant outSizesEntries <- callocMem :: IO (Ptr (Ptr (GPtrArray (Ptr OSTree.CommitSizesEntry.CommitSizesEntry)))) onException (do _ <- propagateGError $ ostree_commit_get_object_sizes commitVariant' outSizesEntries outSizesEntries' <- peek outSizesEntries outSizesEntries'' <- unpackGPtrArray outSizesEntries' outSizesEntries''' <- mapM (newBoxed OSTree.CommitSizesEntry.CommitSizesEntry) outSizesEntries'' unrefPtrArray outSizesEntries' touchManagedPtr commitVariant freeMem outSizesEntries return outSizesEntries''' ) (do freeMem outSizesEntries ) -- function commit_get_content_checksum -- Args: [ Arg -- { argCName = "commit_variant" -- , argType = TVariant -- , argCType = Just "GVariant*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A commit object" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "ostree_commit_get_content_checksum" ostree_commit_get_content_checksum :: Ptr GVariant -> -- commit_variant : TVariant IO CString -- | There are use cases where one wants a checksum just of the content of a -- commit. OSTree commits by default capture the current timestamp, and may have -- additional metadata, which means that re-committing identical content -- often results in a new checksum. -- -- By comparing checksums of content, it\'s possible to easily distinguish -- cases where nothing actually changed. -- -- The content checksums is simply defined as @SHA256(root dirtree_checksum || -- root_dirmeta_checksum)@, i.e. the SHA-256 of the root \"dirtree\" object\'s checksum concatenated -- with the root \"dirmeta\" checksum (both in binary form, not hexadecimal). -- -- /Since: 2018.2/ commitGetContentChecksum :: (B.CallStack.HasCallStack, MonadIO m) => GVariant -- ^ /@commitVariant@/: A commit object -> m (Maybe T.Text) -- ^ __Returns:__ A SHA-256 hex string, or 'P.Nothing' if /@commitVariant@/ is not well-formed commitGetContentChecksum :: forall (m :: * -> *). (HasCallStack, MonadIO m) => GVariant -> m (Maybe Text) commitGetContentChecksum GVariant commitVariant = IO (Maybe Text) -> m (Maybe Text) forall a. IO a -> m a 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 commitVariant' <- GVariant -> IO (Ptr GVariant) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant commitVariant result <- ostree_commit_get_content_checksum commitVariant' maybeResult <- convertIfNonNull result $ \CString result' -> do result'' <- HasCallStack => CString -> IO Text CString -> IO Text cstringToText CString result' freeMem result' return result'' touchManagedPtr commitVariant return maybeResult -- function cmp_checksum_bytes -- Args: [ Arg -- { argCName = "a" -- , argType = TBasicType TUInt8 -- , argCType = Just "const guchar*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A binary checksum" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "b" -- , argType = TBasicType TUInt8 -- , argCType = Just "const guchar*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A binary checksum" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "ostree_cmp_checksum_bytes" ostree_cmp_checksum_bytes :: Word8 -> -- a : TBasicType TUInt8 Word8 -> -- b : TBasicType TUInt8 IO Int32 -- | Compare two binary checksums, using @/memcmp()/@. cmpChecksumBytes :: (B.CallStack.HasCallStack, MonadIO m) => Word8 -- ^ /@a@/: A binary checksum -> Word8 -- ^ /@b@/: A binary checksum -> m Int32 cmpChecksumBytes :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Word8 -> Word8 -> m Int32 cmpChecksumBytes Word8 a Word8 b = IO Int32 -> m Int32 forall a. IO a -> m a 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 result <- Word8 -> Word8 -> IO Int32 ostree_cmp_checksum_bytes Word8 a Word8 b return result -- function checksum_to_bytes_v -- Args: [ Arg -- { argCName = "checksum" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An ASCII checksum" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just TVariant -- throws : False -- Skip return : False foreign import ccall "ostree_checksum_to_bytes_v" ostree_checksum_to_bytes_v :: CString -> -- checksum : TBasicType TUTF8 IO (Ptr GVariant) -- | /No description available in the introspection data./ checksumToBytesV :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@checksum@/: An ASCII checksum -> m GVariant -- ^ __Returns:__ New t'GVariant' of type ay with length 32 checksumToBytesV :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m GVariant checksumToBytesV Text checksum = IO GVariant -> m GVariant forall a. IO a -> m a 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 checksum' <- Text -> IO CString textToCString Text checksum result <- ostree_checksum_to_bytes_v checksum' checkUnexpectedReturnNULL "checksumToBytesV" result result' <- B.GVariant.wrapGVariantPtr result freeMem checksum' return result' -- function checksum_to_bytes -- Args: [ Arg -- { argCName = "checksum" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An ASCII checksum" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TCArray False 32 (-1) (TBasicType TUInt8)) -- throws : False -- Skip return : False foreign import ccall "ostree_checksum_to_bytes" ostree_checksum_to_bytes :: CString -> -- checksum : TBasicType TUTF8 IO (Ptr Word8) -- | /No description available in the introspection data./ checksumToBytes :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@checksum@/: An ASCII checksum -> m ByteString -- ^ __Returns:__ Binary checksum from /@checksum@/ of length 32; -- free with 'GI.GLib.Functions.free'. checksumToBytes :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m ByteString checksumToBytes Text checksum = IO ByteString -> m ByteString forall a. IO a -> m a 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 checksum' <- Text -> IO CString textToCString Text checksum result <- ostree_checksum_to_bytes checksum' checkUnexpectedReturnNULL "checksumToBytes" result result' <- (unpackByteStringWithLength 32) result freeMem result freeMem checksum' return result' -- function checksum_inplace_to_bytes -- Args: [ Arg -- { argCName = "checksum" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a SHA256 string" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "buf" -- , argType = TBasicType TUInt8 -- , argCType = Just "guchar*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Output buffer with at least 32 bytes of space" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "ostree_checksum_inplace_to_bytes" ostree_checksum_inplace_to_bytes :: CString -> -- checksum : TBasicType TUTF8 Word8 -> -- buf : TBasicType TUInt8 IO () -- | Convert /@checksum@/ from a string to binary in-place, without -- allocating memory. Use this function in hot code paths. checksumInplaceToBytes :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@checksum@/: a SHA256 string -> Word8 -- ^ /@buf@/: Output buffer with at least 32 bytes of space -> m () checksumInplaceToBytes :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> Word8 -> m () checksumInplaceToBytes Text checksum Word8 buf = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do checksum' <- Text -> IO CString textToCString Text checksum ostree_checksum_inplace_to_bytes checksum' buf freeMem checksum' return () -- function checksum_from_bytes_v -- Args: [ Arg -- { argCName = "csum_v" -- , argType = TVariant -- , argCType = Just "GVariant*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#GVariant of type ay" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "ostree_checksum_from_bytes_v" ostree_checksum_from_bytes_v :: Ptr GVariant -> -- csum_v : TVariant IO CString -- | /No description available in the introspection data./ checksumFromBytesV :: (B.CallStack.HasCallStack, MonadIO m) => GVariant -- ^ /@csumV@/: t'GVariant' of type ay -> m T.Text -- ^ __Returns:__ String form of /@csumBytes@/ checksumFromBytesV :: forall (m :: * -> *). (HasCallStack, MonadIO m) => GVariant -> m Text checksumFromBytesV GVariant csumV = IO Text -> m Text forall a. IO a -> m a 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 csumV' <- GVariant -> IO (Ptr GVariant) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant csumV result <- ostree_checksum_from_bytes_v csumV' checkUnexpectedReturnNULL "checksumFromBytesV" result result' <- cstringToText result freeMem result touchManagedPtr csumV return result' -- function checksum_from_bytes -- Args: [ Arg -- { argCName = "csum" -- , argType = TCArray False 32 (-1) (TBasicType TUInt8) -- , argCType = Just "const guchar*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An binary checksum of length 32" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "ostree_checksum_from_bytes" ostree_checksum_from_bytes :: Ptr Word8 -> -- csum : TCArray False 32 (-1) (TBasicType TUInt8) IO CString -- | /No description available in the introspection data./ checksumFromBytes :: (B.CallStack.HasCallStack, MonadIO m) => ByteString -- ^ /@csum@/: An binary checksum of length 32 -> m T.Text -- ^ __Returns:__ String form of /@csum@/ checksumFromBytes :: forall (m :: * -> *). (HasCallStack, MonadIO m) => ByteString -> m Text checksumFromBytes ByteString csum = IO Text -> m Text forall a. IO a -> m a 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 csum' <- ByteString -> IO (Ptr Word8) packByteString ByteString csum result <- ostree_checksum_from_bytes csum' checkUnexpectedReturnNULL "checksumFromBytes" result result' <- cstringToText result freeMem result freeMem csum' return result' -- function checksum_file_from_input -- Args: [ Arg -- { argCName = "file_info" -- , argType = -- TInterface Name { namespace = "Gio" , name = "FileInfo" } -- , argCType = Just "GFileInfo*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "File information" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "xattrs" -- , argType = TVariant -- , argCType = Just "GVariant*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Optional extended attributes" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "in" -- , argType = -- TInterface Name { namespace = "Gio" , name = "InputStream" } -- , argCType = Just "GInputStream*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "File content, should be %NULL for symbolic links" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "objtype" -- , argType = -- TInterface Name { namespace = "OSTree" , name = "ObjectType" } -- , argCType = Just "OstreeObjectType" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Object type" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out_csum" -- , argType = TCArray False 32 (-1) (TBasicType TUInt8) -- , argCType = Just "guchar**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Return location for binary checksum" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , argCType = Just "GCancellable*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Cancellable" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_checksum_file_from_input" ostree_checksum_file_from_input :: Ptr Gio.FileInfo.FileInfo -> -- file_info : TInterface (Name {namespace = "Gio", name = "FileInfo"}) Ptr GVariant -> -- xattrs : TVariant Ptr Gio.InputStream.InputStream -> -- in : TInterface (Name {namespace = "Gio", name = "InputStream"}) CUInt -> -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"}) Ptr (Ptr Word8) -> -- out_csum : TCArray False 32 (-1) (TBasicType TUInt8) Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO CInt -- | Compute the OSTree checksum for a given input. checksumFileFromInput :: (B.CallStack.HasCallStack, MonadIO m, Gio.FileInfo.IsFileInfo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) => a -- ^ /@fileInfo@/: File information -> Maybe (GVariant) -- ^ /@xattrs@/: Optional extended attributes -> Maybe (b) -- ^ /@in@/: File content, should be 'P.Nothing' for symbolic links -> OSTree.Enums.ObjectType -- ^ /@objtype@/: Object type -> Maybe (c) -- ^ /@cancellable@/: Cancellable -> m (ByteString) -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ checksumFileFromInput :: forall (m :: * -> *) a b c. (HasCallStack, MonadIO m, IsFileInfo a, IsInputStream b, IsCancellable c) => a -> Maybe GVariant -> Maybe b -> ObjectType -> Maybe c -> m ByteString checksumFileFromInput a fileInfo Maybe GVariant xattrs Maybe b in_ ObjectType objtype Maybe c cancellable = IO ByteString -> m ByteString forall a. IO a -> m a 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 fileInfo' <- a -> IO (Ptr FileInfo) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a fileInfo maybeXattrs <- case xattrs of Maybe GVariant Nothing -> Ptr GVariant -> IO (Ptr GVariant) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr GVariant forall a. Ptr a FP.nullPtr Just GVariant jXattrs -> do jXattrs' <- GVariant -> IO (Ptr GVariant) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant jXattrs return jXattrs' maybeIn_ <- case in_ of Maybe b Nothing -> Ptr InputStream -> IO (Ptr InputStream) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr InputStream forall a. Ptr a FP.nullPtr Just b jIn_ -> do jIn_' <- b -> IO (Ptr InputStream) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr b jIn_ return jIn_' let 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 outCsum <- callocMem :: IO (Ptr (Ptr Word8)) maybeCancellable <- case cancellable of Maybe c Nothing -> Ptr Cancellable -> IO (Ptr Cancellable) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable forall a. Ptr a FP.nullPtr Just c jCancellable -> do jCancellable' <- c -> IO (Ptr Cancellable) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr c jCancellable return jCancellable' onException (do _ <- propagateGError $ ostree_checksum_file_from_input fileInfo' maybeXattrs maybeIn_ objtype' outCsum maybeCancellable outCsum' <- peek outCsum outCsum'' <- (unpackByteStringWithLength 32) outCsum' freeMem outCsum' touchManagedPtr fileInfo whenJust xattrs touchManagedPtr whenJust in_ touchManagedPtr whenJust cancellable touchManagedPtr freeMem outCsum return outCsum'' ) (do freeMem outCsum ) -- function checksum_file_at -- Args: [ Arg -- { argCName = "dfd" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Directory file descriptor" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "path" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "Subpath\n@stbuf (allow-none): Optional stat buffer" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "stbuf" -- , argType = TBasicType TPtr -- , argCType = Just "stat*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "objtype" -- , argType = -- TInterface Name { namespace = "OSTree" , name = "ObjectType" } -- , argCType = Just "OstreeObjectType" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Object type" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "flags" -- , argType = -- TInterface Name { namespace = "OSTree" , name = "ChecksumFlags" } -- , argCType = Just "OstreeChecksumFlags" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Flags\n@out_checksum (out) (transfer full): Return location for hex checksum" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out_checksum" -- , argType = TBasicType TUTF8 -- , argCType = Just "char**" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , argCType = Just "GCancellable*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Cancellable" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_checksum_file_at" ostree_checksum_file_at :: Int32 -> -- dfd : TBasicType TInt CString -> -- path : TBasicType TUTF8 Ptr () -> -- stbuf : TBasicType TPtr CUInt -> -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"}) CUInt -> -- flags : TInterface (Name {namespace = "OSTree", name = "ChecksumFlags"}) CString -> -- out_checksum : TBasicType TUTF8 Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO CInt -- | Compute the OSTree checksum for a given file. This is an fd-relative version -- of 'GI.OSTree.Functions.checksumFile' which also takes flags and fills in a caller -- allocated buffer. -- -- /Since: 2017.13/ checksumFileAt :: (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) => Int32 -- ^ /@dfd@/: Directory file descriptor -> T.Text -- ^ /@path@/: Subpath -- /@stbuf@/ (allow-none): Optional stat buffer -> Ptr () -> OSTree.Enums.ObjectType -- ^ /@objtype@/: Object type -> [OSTree.Flags.ChecksumFlags] -- ^ /@flags@/: Flags -- /@outChecksum@/ (out) (transfer full): Return location for hex checksum -> T.Text -> Maybe (a) -- ^ /@cancellable@/: Cancellable -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ checksumFileAt :: forall (m :: * -> *) a. (HasCallStack, MonadIO m, IsCancellable a) => Int32 -> Text -> Ptr () -> ObjectType -> [ChecksumFlags] -> Text -> Maybe a -> m () checksumFileAt Int32 dfd Text path Ptr () stbuf ObjectType objtype [ChecksumFlags] flags Text outChecksum Maybe a cancellable = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do path' <- Text -> IO CString textToCString Text path let 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 let flags' = [ChecksumFlags] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ChecksumFlags] flags outChecksum' <- textToCString outChecksum maybeCancellable <- case cancellable of Maybe a Nothing -> Ptr Cancellable -> IO (Ptr Cancellable) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable forall a. Ptr a FP.nullPtr Just a jCancellable -> do jCancellable' <- a -> IO (Ptr Cancellable) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a jCancellable return jCancellable' onException (do _ <- propagateGError $ ostree_checksum_file_at dfd path' stbuf objtype' flags' outChecksum' maybeCancellable whenJust cancellable touchManagedPtr freeMem path' freeMem outChecksum' return () ) (do freeMem path' freeMem outChecksum' ) -- function checksum_file_async_finish -- Args: [ Arg -- { argCName = "f" -- , argType = TInterface Name { namespace = "Gio" , name = "File" } -- , argCType = Just "GFile*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "File path" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "result" -- , argType = -- TInterface Name { namespace = "Gio" , name = "AsyncResult" } -- , argCType = Just "GAsyncResult*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Async result" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out_csum" -- , argType = TCArray False 32 (-1) (TBasicType TUInt8) -- , argCType = Just "guchar**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Return location for binary checksum" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_checksum_file_async_finish" ostree_checksum_file_async_finish :: Ptr Gio.File.File -> -- f : TInterface (Name {namespace = "Gio", name = "File"}) Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"}) Ptr (Ptr Word8) -> -- out_csum : TCArray False 32 (-1) (TBasicType TUInt8) Ptr (Ptr GError) -> -- error IO CInt -- | Finish computing the OSTree checksum for a given file; see -- 'GI.OSTree.Functions.checksumFileAsync'. checksumFileAsyncFinish :: (B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a, Gio.AsyncResult.IsAsyncResult b) => a -- ^ /@f@/: File path -> b -- ^ /@result@/: Async result -> m (ByteString) -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ checksumFileAsyncFinish :: forall (m :: * -> *) a b. (HasCallStack, MonadIO m, IsFile a, IsAsyncResult b) => a -> b -> m ByteString checksumFileAsyncFinish a f b result_ = IO ByteString -> m ByteString forall a. IO a -> m a 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 f' <- a -> IO (Ptr File) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a f result_' <- unsafeManagedPtrCastPtr result_ outCsum <- callocMem :: IO (Ptr (Ptr Word8)) onException (do _ <- propagateGError $ ostree_checksum_file_async_finish f' result_' outCsum outCsum' <- peek outCsum outCsum'' <- (unpackByteStringWithLength 32) outCsum' freeMem outCsum' touchManagedPtr f touchManagedPtr result_ freeMem outCsum return outCsum'' ) (do freeMem outCsum ) -- function checksum_file_async -- Args: [ Arg -- { argCName = "f" -- , argType = TInterface Name { namespace = "Gio" , name = "File" } -- , argCType = Just "GFile*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "File path" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "objtype" -- , argType = -- TInterface Name { namespace = "OSTree" , name = "ObjectType" } -- , argCType = Just "OstreeObjectType" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Object type" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "io_priority" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "Priority for operation, see %G_IO_PRIORITY_DEFAULT" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , argCType = Just "GCancellable*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Cancellable" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "callback" -- , argType = -- TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" } -- , argCType = Just "GAsyncReadyCallback" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Invoked when operation is complete" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeAsync -- , argClosure = 5 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "user_data" -- , argType = TBasicType TPtr -- , argCType = Just "gpointer" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Data for @callback" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "ostree_checksum_file_async" ostree_checksum_file_async :: Ptr Gio.File.File -> -- f : TInterface (Name {namespace = "Gio", name = "File"}) CUInt -> -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"}) Int32 -> -- io_priority : TBasicType TInt Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}) Ptr () -> -- user_data : TBasicType TPtr IO () -- | Asynchronously compute the OSTree checksum for a given file; -- complete with 'GI.OSTree.Functions.checksumFileAsyncFinish'. checksumFileAsync :: (B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a, Gio.Cancellable.IsCancellable b) => a -- ^ /@f@/: File path -> OSTree.Enums.ObjectType -- ^ /@objtype@/: Object type -> Int32 -- ^ /@ioPriority@/: Priority for operation, see @/G_IO_PRIORITY_DEFAULT/@ -> Maybe (b) -- ^ /@cancellable@/: Cancellable -> Maybe (Gio.Callbacks.AsyncReadyCallback) -- ^ /@callback@/: Invoked when operation is complete -> m () checksumFileAsync :: forall (m :: * -> *) a b. (HasCallStack, MonadIO m, IsFile a, IsCancellable b) => a -> ObjectType -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m () checksumFileAsync a f ObjectType objtype Int32 ioPriority Maybe b cancellable Maybe AsyncReadyCallback callback = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do f' <- a -> IO (Ptr File) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a f let 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 maybeCancellable <- case cancellable of Maybe b Nothing -> Ptr Cancellable -> IO (Ptr Cancellable) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable forall a. Ptr a FP.nullPtr Just b jCancellable -> do jCancellable' <- b -> IO (Ptr Cancellable) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr b jCancellable return jCancellable' maybeCallback <- case callback of Maybe AsyncReadyCallback Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return FunPtr C_AsyncReadyCallback forall a. FunPtr a FP.nullFunPtr Just AsyncReadyCallback jCallback -> do ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback)) forall a. Storable a => IO (Ptr a) callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback)) jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback)) poke ptrcallback jCallback' return jCallback' let userData = Ptr a forall a. Ptr a nullPtr ostree_checksum_file_async f' objtype' ioPriority maybeCancellable maybeCallback userData touchManagedPtr f whenJust cancellable touchManagedPtr return () -- function checksum_file -- Args: [ Arg -- { argCName = "f" -- , argType = TInterface Name { namespace = "Gio" , name = "File" } -- , argCType = Just "GFile*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "File path" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "objtype" -- , argType = -- TInterface Name { namespace = "OSTree" , name = "ObjectType" } -- , argCType = Just "OstreeObjectType" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Object type" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out_csum" -- , argType = TCArray False 32 (-1) (TBasicType TUInt8) -- , argCType = Just "guchar**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Return location for binary checksum" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , argCType = Just "GCancellable*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Cancellable" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_checksum_file" ostree_checksum_file :: Ptr Gio.File.File -> -- f : TInterface (Name {namespace = "Gio", name = "File"}) CUInt -> -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"}) Ptr (Ptr Word8) -> -- out_csum : TCArray False 32 (-1) (TBasicType TUInt8) Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO CInt -- | Compute the OSTree checksum for a given file. checksumFile :: (B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a, Gio.Cancellable.IsCancellable b) => a -- ^ /@f@/: File path -> OSTree.Enums.ObjectType -- ^ /@objtype@/: Object type -> Maybe (b) -- ^ /@cancellable@/: Cancellable -> m (ByteString) -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ checksumFile :: forall (m :: * -> *) a b. (HasCallStack, MonadIO m, IsFile a, IsCancellable b) => a -> ObjectType -> Maybe b -> m ByteString checksumFile a f ObjectType objtype Maybe b cancellable = IO ByteString -> m ByteString forall a. IO a -> m a 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 f' <- a -> IO (Ptr File) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a f let 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 outCsum <- callocMem :: IO (Ptr (Ptr Word8)) maybeCancellable <- case cancellable of Maybe b Nothing -> Ptr Cancellable -> IO (Ptr Cancellable) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable forall a. Ptr a FP.nullPtr Just b jCancellable -> do jCancellable' <- b -> IO (Ptr Cancellable) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr b jCancellable return jCancellable' onException (do _ <- propagateGError $ ostree_checksum_file f' objtype' outCsum maybeCancellable outCsum' <- peek outCsum outCsum'' <- (unpackByteStringWithLength 32) outCsum' freeMem outCsum' touchManagedPtr f whenJust cancellable touchManagedPtr freeMem outCsum return outCsum'' ) (do freeMem outCsum ) -- function checksum_bytes_peek_validate -- Args: [ Arg -- { argCName = "bytes" -- , argType = TVariant -- , argCType = Just "GVariant*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#GVariant of type ay" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TCArray False 32 (-1) (TBasicType TUInt8)) -- throws : True -- Skip return : False foreign import ccall "ostree_checksum_bytes_peek_validate" ostree_checksum_bytes_peek_validate :: Ptr GVariant -> -- bytes : TVariant Ptr (Ptr GError) -> -- error IO (Ptr Word8) -- | Like 'GI.OSTree.Functions.checksumBytesPeek', but also throws /@error@/. checksumBytesPeekValidate :: (B.CallStack.HasCallStack, MonadIO m) => GVariant -- ^ /@bytes@/: t'GVariant' of type ay -> m ByteString -- ^ __Returns:__ Binary checksum data /(Can throw 'Data.GI.Base.GError.GError')/ checksumBytesPeekValidate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => GVariant -> m ByteString checksumBytesPeekValidate GVariant bytes = IO ByteString -> m ByteString forall a. IO a -> m a 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 bytes' <- GVariant -> IO (Ptr GVariant) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant bytes onException (do result <- propagateGError $ ostree_checksum_bytes_peek_validate bytes' checkUnexpectedReturnNULL "checksumBytesPeekValidate" result result' <- (unpackByteStringWithLength 32) result touchManagedPtr bytes return result' ) (do return () ) -- function checksum_bytes_peek -- Args: [ Arg -- { argCName = "bytes" -- , argType = TVariant -- , argCType = Just "GVariant*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#GVariant of type ay" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TCArray False 32 (-1) (TBasicType TUInt8)) -- throws : False -- Skip return : False foreign import ccall "ostree_checksum_bytes_peek" ostree_checksum_bytes_peek :: Ptr GVariant -> -- bytes : TVariant IO (Ptr Word8) -- | /No description available in the introspection data./ checksumBytesPeek :: (B.CallStack.HasCallStack, MonadIO m) => GVariant -- ^ /@bytes@/: t'GVariant' of type ay -> m ByteString -- ^ __Returns:__ Binary checksum data in -- /@bytes@/; do not free. If /@bytes@/ does not have the correct length, return 'P.Nothing'. checksumBytesPeek :: forall (m :: * -> *). (HasCallStack, MonadIO m) => GVariant -> m ByteString checksumBytesPeek GVariant bytes = IO ByteString -> m ByteString forall a. IO a -> m a 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 bytes' <- GVariant -> IO (Ptr GVariant) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant bytes result <- ostree_checksum_bytes_peek bytes' checkUnexpectedReturnNULL "checksumBytesPeek" result result' <- (unpackByteStringWithLength 32) result touchManagedPtr bytes return result' -- function checksum_b64_to_bytes -- Args: [ Arg -- { argCName = "checksum" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An ASCII checksum" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TCArray False 32 (-1) (TBasicType TUInt8)) -- throws : False -- Skip return : False foreign import ccall "ostree_checksum_b64_to_bytes" ostree_checksum_b64_to_bytes :: CString -> -- checksum : TBasicType TUTF8 IO (Ptr Word8) -- | /No description available in the introspection data./ -- -- /Since: 2016.8/ checksumB64ToBytes :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@checksum@/: An ASCII checksum -> m ByteString -- ^ __Returns:__ Binary version of /@checksum@/. checksumB64ToBytes :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m ByteString checksumB64ToBytes Text checksum = IO ByteString -> m ByteString forall a. IO a -> m a 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 checksum' <- Text -> IO CString textToCString Text checksum result <- ostree_checksum_b64_to_bytes checksum' checkUnexpectedReturnNULL "checksumB64ToBytes" result result' <- (unpackByteStringWithLength 32) result freeMem result freeMem checksum' return result' -- function checksum_b64_from_bytes -- Args: [ Arg -- { argCName = "csum" -- , argType = TCArray False 32 (-1) (TBasicType TUInt8) -- , argCType = Just "const guchar*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An binary checksum of length 32" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "ostree_checksum_b64_from_bytes" ostree_checksum_b64_from_bytes :: Ptr Word8 -> -- csum : TCArray False 32 (-1) (TBasicType TUInt8) IO CString -- | /No description available in the introspection data./ -- -- /Since: 2016.8/ checksumB64FromBytes :: (B.CallStack.HasCallStack, MonadIO m) => ByteString -- ^ /@csum@/: An binary checksum of length 32 -> m T.Text -- ^ __Returns:__ Modified base64 encoding of /@csum@/ -- -- The \"modified\" term refers to the fact that instead of \'\/\', the \'_\' -- character is used. checksumB64FromBytes :: forall (m :: * -> *). (HasCallStack, MonadIO m) => ByteString -> m Text checksumB64FromBytes ByteString csum = IO Text -> m Text forall a. IO a -> m a 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 csum' <- ByteString -> IO (Ptr Word8) packByteString ByteString csum result <- ostree_checksum_b64_from_bytes csum' checkUnexpectedReturnNULL "checksumB64FromBytes" result result' <- cstringToText result freeMem result freeMem csum' return result' -- function check_version -- Args: [ Arg -- { argCName = "required_year" -- , argType = TBasicType TUInt -- , argCType = Just "guint" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Major/year required" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "required_release" -- , argType = TBasicType TUInt -- , argCType = Just "guint" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Release version required" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "ostree_check_version" ostree_check_version :: Word32 -> -- required_year : TBasicType TUInt Word32 -> -- required_release : TBasicType TUInt IO CInt -- | /No description available in the introspection data./ -- -- /Since: 2017.4/ checkVersion :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@requiredYear@/: Major\/year required -> Word32 -- ^ /@requiredRelease@/: Release version required -> m Bool -- ^ __Returns:__ 'P.True' if current libostree has at least the requested version, 'P.False' otherwise checkVersion :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Word32 -> Word32 -> m Bool checkVersion Word32 requiredYear Word32 requiredRelease = IO Bool -> m Bool forall a. IO a -> m a 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 result <- Word32 -> Word32 -> IO CInt ostree_check_version Word32 requiredYear Word32 requiredRelease let result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result return result' -- function break_hardlink -- Args: [ Arg -- { argCName = "dfd" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Directory fd" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "path" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Path relative to @dfd" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "skip_xattrs" -- , argType = TBasicType TBoolean -- , argCType = Just "gboolean" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Do not copy extended attributes" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , argCType = Just "GCancellable*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "ostree_break_hardlink" ostree_break_hardlink :: Int32 -> -- dfd : TBasicType TInt CString -> -- path : TBasicType TUTF8 CInt -> -- skip_xattrs : TBasicType TBoolean Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO CInt -- | In many cases using libostree, a program may need to \"break\" -- hardlinks by performing a copy. For example, in order to -- logically append to a file. -- -- This function performs full copying, including e.g. extended -- attributes and permissions of both regular files and symbolic links. -- -- If the file is not hardlinked, this function does nothing and -- returns successfully. -- -- This function does not perform synchronization via @fsync()@ or -- @fdatasync()@; the idea is this will commonly be done as part -- of an @ostree_repo_commit_transaction()@, which itself takes -- care of synchronization. -- -- /Since: 2017.15/ breakHardlink :: (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) => Int32 -- ^ /@dfd@/: Directory fd -> T.Text -- ^ /@path@/: Path relative to /@dfd@/ -> Bool -- ^ /@skipXattrs@/: Do not copy extended attributes -> Maybe (a) -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ breakHardlink :: forall (m :: * -> *) a. (HasCallStack, MonadIO m, IsCancellable a) => Int32 -> Text -> Bool -> Maybe a -> m () breakHardlink Int32 dfd Text path Bool skipXattrs Maybe a cancellable = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do path' <- Text -> IO CString textToCString Text path let skipXattrs' = (Int -> CInt forall a b. (Integral a, Num b) => a -> b P.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 P.fromEnum) Bool skipXattrs maybeCancellable <- case cancellable of Maybe a Nothing -> Ptr Cancellable -> IO (Ptr Cancellable) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable forall a. Ptr a FP.nullPtr Just a jCancellable -> do jCancellable' <- a -> IO (Ptr Cancellable) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a jCancellable return jCancellable' onException (do _ <- propagateGError $ ostree_break_hardlink dfd path' skipXattrs' maybeCancellable whenJust cancellable touchManagedPtr freeMem path' return () ) (do freeMem path' )