{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.OSTree.Objects.SePolicy
(
SePolicy(..) ,
IsSePolicy ,
toSePolicy ,
#if defined(ENABLE_OVERLOADING)
ResolveSePolicyMethod ,
#endif
sePolicyFscreateconCleanup ,
#if defined(ENABLE_OVERLOADING)
SePolicyGetCsumMethodInfo ,
#endif
sePolicyGetCsum ,
#if defined(ENABLE_OVERLOADING)
SePolicyGetLabelMethodInfo ,
#endif
sePolicyGetLabel ,
#if defined(ENABLE_OVERLOADING)
SePolicyGetNameMethodInfo ,
#endif
sePolicyGetName ,
#if defined(ENABLE_OVERLOADING)
SePolicyGetPathMethodInfo ,
#endif
sePolicyGetPath ,
sePolicyNew ,
sePolicyNewAt ,
sePolicyNewFromCommit ,
#if defined(ENABLE_OVERLOADING)
SePolicyRestoreconMethodInfo ,
#endif
sePolicyRestorecon ,
sePolicySetNullLog ,
#if defined(ENABLE_OVERLOADING)
SePolicySetfscreateconMethodInfo ,
#endif
sePolicySetfscreatecon ,
#if defined(ENABLE_OVERLOADING)
SePolicyPathPropertyInfo ,
#endif
constructSePolicyPath ,
getSePolicyPath ,
#if defined(ENABLE_OVERLOADING)
sePolicyPath ,
#endif
#if defined(ENABLE_OVERLOADING)
SePolicyRootfsDfdPropertyInfo ,
#endif
constructSePolicyRootfsDfd ,
getSePolicyRootfsDfd ,
#if defined(ENABLE_OVERLOADING)
sePolicyRootfsDfd ,
#endif
) 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
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.KeyFile as GLib.KeyFile
import qualified GI.GLib.Structs.String as GLib.String
import qualified GI.GLib.Structs.VariantDict as GLib.VariantDict
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Flags as Gio.Flags
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
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 qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import qualified GI.OSTree.Callbacks as OSTree.Callbacks
import {-# SOURCE #-} qualified GI.OSTree.Enums as OSTree.Enums
import {-# SOURCE #-} qualified GI.OSTree.Flags as OSTree.Flags
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.BlobReader as OSTree.BlobReader
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.RepoFinder as OSTree.RepoFinder
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.Sign as OSTree.Sign
import {-# SOURCE #-} qualified GI.OSTree.Objects.AsyncProgress as OSTree.AsyncProgress
import {-# SOURCE #-} qualified GI.OSTree.Objects.ContentWriter as OSTree.ContentWriter
import {-# SOURCE #-} qualified GI.OSTree.Objects.GpgVerifyResult as OSTree.GpgVerifyResult
import {-# SOURCE #-} qualified GI.OSTree.Objects.MutableTree as OSTree.MutableTree
import {-# SOURCE #-} qualified GI.OSTree.Objects.Repo as OSTree.Repo
import {-# SOURCE #-} qualified GI.OSTree.Objects.RepoFile as OSTree.RepoFile
import {-# SOURCE #-} qualified GI.OSTree.Structs.CollectionRef as OSTree.CollectionRef
import {-# SOURCE #-} qualified GI.OSTree.Structs.Remote as OSTree.Remote
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoCheckoutAtOptions as OSTree.RepoCheckoutAtOptions
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoCommitModifier as OSTree.RepoCommitModifier
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoDevInoCache as OSTree.RepoDevInoCache
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoFinderResult as OSTree.RepoFinderResult
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoPruneOptions as OSTree.RepoPruneOptions
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoTransactionStats as OSTree.RepoTransactionStats
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.FileInfo as Gio.FileInfo
import {-# SOURCE #-} qualified GI.OSTree.Flags as OSTree.Flags
import {-# SOURCE #-} qualified GI.OSTree.Objects.Repo as OSTree.Repo
#endif
newtype SePolicy = SePolicy (SP.ManagedPtr SePolicy)
deriving (SePolicy -> SePolicy -> Bool
(SePolicy -> SePolicy -> Bool)
-> (SePolicy -> SePolicy -> Bool) -> Eq SePolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SePolicy -> SePolicy -> Bool
== :: SePolicy -> SePolicy -> Bool
$c/= :: SePolicy -> SePolicy -> Bool
/= :: SePolicy -> SePolicy -> Bool
Eq)
instance SP.ManagedPtrNewtype SePolicy where
toManagedPtr :: SePolicy -> ManagedPtr SePolicy
toManagedPtr (SePolicy ManagedPtr SePolicy
p) = ManagedPtr SePolicy
p
foreign import ccall "ostree_sepolicy_get_type"
c_ostree_sepolicy_get_type :: IO B.Types.GType
instance B.Types.TypedObject SePolicy where
glibType :: IO GType
glibType = IO GType
c_ostree_sepolicy_get_type
instance B.Types.GObject SePolicy
class (SP.GObject o, O.IsDescendantOf SePolicy o) => IsSePolicy o
instance (SP.GObject o, O.IsDescendantOf SePolicy o) => IsSePolicy o
instance O.HasParentTypes SePolicy
type instance O.ParentTypes SePolicy = '[GObject.Object.Object, Gio.Initable.Initable]
toSePolicy :: (MIO.MonadIO m, IsSePolicy o) => o -> m SePolicy
toSePolicy :: forall (m :: * -> *) o.
(MonadIO m, IsSePolicy o) =>
o -> m SePolicy
toSePolicy = IO SePolicy -> m SePolicy
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO SePolicy -> m SePolicy)
-> (o -> IO SePolicy) -> o -> m SePolicy
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr SePolicy -> SePolicy) -> o -> IO SePolicy
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr SePolicy -> SePolicy
SePolicy
instance B.GValue.IsGValue (Maybe SePolicy) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ostree_sepolicy_get_type
gvalueSet_ :: Ptr GValue -> Maybe SePolicy -> IO ()
gvalueSet_ Ptr GValue
gv Maybe SePolicy
P.Nothing = Ptr GValue -> Ptr SePolicy -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr SePolicy
forall a. Ptr a
FP.nullPtr :: FP.Ptr SePolicy)
gvalueSet_ Ptr GValue
gv (P.Just SePolicy
obj) = SePolicy -> (Ptr SePolicy -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr SePolicy
obj (Ptr GValue -> Ptr SePolicy -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe SePolicy)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr SePolicy)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr SePolicy)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject SePolicy ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveSePolicyMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveSePolicyMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSePolicyMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSePolicyMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSePolicyMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSePolicyMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSePolicyMethod "init" o = Gio.Initable.InitableInitMethodInfo
ResolveSePolicyMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSePolicyMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSePolicyMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSePolicyMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSePolicyMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSePolicyMethod "restorecon" o = SePolicyRestoreconMethodInfo
ResolveSePolicyMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSePolicyMethod "setfscreatecon" o = SePolicySetfscreateconMethodInfo
ResolveSePolicyMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSePolicyMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSePolicyMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSePolicyMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSePolicyMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSePolicyMethod "getCsum" o = SePolicyGetCsumMethodInfo
ResolveSePolicyMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSePolicyMethod "getLabel" o = SePolicyGetLabelMethodInfo
ResolveSePolicyMethod "getName" o = SePolicyGetNameMethodInfo
ResolveSePolicyMethod "getPath" o = SePolicyGetPathMethodInfo
ResolveSePolicyMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSePolicyMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSePolicyMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSePolicyMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveSePolicyMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSePolicyMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSePolicyMethod t SePolicy, O.OverloadedMethod info SePolicy p) => OL.IsLabel t (SePolicy -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveSePolicyMethod t SePolicy, O.OverloadedMethod info SePolicy p, R.HasField t SePolicy p) => R.HasField t SePolicy p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveSePolicyMethod t SePolicy, O.OverloadedMethodInfo info SePolicy) => OL.IsLabel t (O.MethodProxy info SePolicy) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getSePolicyPath :: (MonadIO m, IsSePolicy o) => o -> m (Maybe Gio.File.File)
getSePolicyPath :: forall (m :: * -> *) o.
(MonadIO m, IsSePolicy o) =>
o -> m (Maybe File)
getSePolicyPath o
obj = IO (Maybe File) -> m (Maybe File)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe File) -> m (Maybe File))
-> IO (Maybe File) -> m (Maybe File)
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr File -> File) -> IO (Maybe File)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"path" ManagedPtr File -> File
Gio.File.File
constructSePolicyPath :: (IsSePolicy o, MIO.MonadIO m, Gio.File.IsFile a) => a -> m (GValueConstruct o)
constructSePolicyPath :: forall o (m :: * -> *) a.
(IsSePolicy o, MonadIO m, IsFile a) =>
a -> m (GValueConstruct o)
constructSePolicyPath a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"path" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data SePolicyPathPropertyInfo
instance AttrInfo SePolicyPathPropertyInfo where
type AttrAllowedOps SePolicyPathPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint SePolicyPathPropertyInfo = IsSePolicy
type AttrSetTypeConstraint SePolicyPathPropertyInfo = Gio.File.IsFile
type AttrTransferTypeConstraint SePolicyPathPropertyInfo = Gio.File.IsFile
type AttrTransferType SePolicyPathPropertyInfo = Gio.File.File
type AttrGetType SePolicyPathPropertyInfo = (Maybe Gio.File.File)
type AttrLabel SePolicyPathPropertyInfo = "path"
type AttrOrigin SePolicyPathPropertyInfo = SePolicy
attrGet = getSePolicyPath
attrSet = undefined
attrPut = undefined
attrTransfer _ v = do
unsafeCastTo Gio.File.File v
attrConstruct = constructSePolicyPath
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.SePolicy.path"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Objects-SePolicy.html#g:attr:path"
})
#endif
getSePolicyRootfsDfd :: (MonadIO m, IsSePolicy o) => o -> m Int32
getSePolicyRootfsDfd :: forall (m :: * -> *) o. (MonadIO m, IsSePolicy o) => o -> m Int32
getSePolicyRootfsDfd o
obj = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Int32
forall a. GObject a => a -> String -> IO Int32
B.Properties.getObjectPropertyInt32 o
obj String
"rootfs-dfd"
constructSePolicyRootfsDfd :: (IsSePolicy o, MIO.MonadIO m) => Int32 -> m (GValueConstruct o)
constructSePolicyRootfsDfd :: forall o (m :: * -> *).
(IsSePolicy o, MonadIO m) =>
Int32 -> m (GValueConstruct o)
constructSePolicyRootfsDfd Int32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Int32 -> IO (GValueConstruct o)
forall o. String -> Int32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyInt32 String
"rootfs-dfd" Int32
val
#if defined(ENABLE_OVERLOADING)
data SePolicyRootfsDfdPropertyInfo
instance AttrInfo SePolicyRootfsDfdPropertyInfo where
type AttrAllowedOps SePolicyRootfsDfdPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint SePolicyRootfsDfdPropertyInfo = IsSePolicy
type AttrSetTypeConstraint SePolicyRootfsDfdPropertyInfo = (~) Int32
type AttrTransferTypeConstraint SePolicyRootfsDfdPropertyInfo = (~) Int32
type AttrTransferType SePolicyRootfsDfdPropertyInfo = Int32
type AttrGetType SePolicyRootfsDfdPropertyInfo = Int32
type AttrLabel SePolicyRootfsDfdPropertyInfo = "rootfs-dfd"
type AttrOrigin SePolicyRootfsDfdPropertyInfo = SePolicy
attrGet = getSePolicyRootfsDfd
attrSet = undefined
attrPut = undefined
attrTransfer _ v = do
return v
attrConstruct = constructSePolicyRootfsDfd
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.SePolicy.rootfsDfd"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Objects-SePolicy.html#g:attr:rootfsDfd"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SePolicy
type instance O.AttributeList SePolicy = SePolicyAttributeList
type SePolicyAttributeList = ('[ '("path", SePolicyPathPropertyInfo), '("rootfsDfd", SePolicyRootfsDfdPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
sePolicyPath :: AttrLabelProxy "path"
sePolicyPath = AttrLabelProxy
sePolicyRootfsDfd :: AttrLabelProxy "rootfsDfd"
sePolicyRootfsDfd = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList SePolicy = SePolicySignalList
type SePolicySignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "ostree_sepolicy_new" ostree_sepolicy_new ::
Ptr Gio.File.File ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr SePolicy)
sePolicyNew ::
(B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m SePolicy
sePolicyNew :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsFile a, IsCancellable b) =>
a -> Maybe b -> m SePolicy
sePolicyNew a
path Maybe b
cancellable = IO SePolicy -> m SePolicy
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SePolicy -> m SePolicy) -> IO SePolicy -> m SePolicy
forall a b. (a -> b) -> a -> b
$ do
path' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
path
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
result <- propagateGError $ ostree_sepolicy_new path' maybeCancellable
checkUnexpectedReturnNULL "sePolicyNew" result
result' <- (wrapObject SePolicy) result
touchManagedPtr path
whenJust cancellable touchManagedPtr
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ostree_sepolicy_new_at" ostree_sepolicy_new_at ::
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr SePolicy)
sePolicyNewAt ::
(B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
Int32
-> Maybe (a)
-> m SePolicy
sePolicyNewAt :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCancellable a) =>
Int32 -> Maybe a -> m SePolicy
sePolicyNewAt Int32
rootfsDfd Maybe a
cancellable = IO SePolicy -> m SePolicy
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SePolicy -> m SePolicy) -> IO SePolicy -> m SePolicy
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_sepolicy_new_at rootfsDfd maybeCancellable
checkUnexpectedReturnNULL "sePolicyNewAt" result
result' <- (wrapObject SePolicy) result
whenJust cancellable touchManagedPtr
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ostree_sepolicy_new_from_commit" ostree_sepolicy_new_from_commit ::
Ptr OSTree.Repo.Repo ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr SePolicy)
sePolicyNewFromCommit ::
(B.CallStack.HasCallStack, MonadIO m, OSTree.Repo.IsRepo a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Maybe (b)
-> m SePolicy
sePolicyNewFromCommit :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Text -> Maybe b -> m SePolicy
sePolicyNewFromCommit a
repo Text
rev Maybe b
cancellable = IO SePolicy -> m SePolicy
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SePolicy -> m SePolicy) -> IO SePolicy -> m SePolicy
forall a b. (a -> b) -> a -> b
$ do
repo' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
repo
rev' <- textToCString rev
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
result <- propagateGError $ ostree_sepolicy_new_from_commit repo' rev' maybeCancellable
checkUnexpectedReturnNULL "sePolicyNewFromCommit" result
result' <- (wrapObject SePolicy) result
touchManagedPtr repo
whenJust cancellable touchManagedPtr
freeMem rev'
return result'
) (do
freeMem rev'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ostree_sepolicy_get_csum" ostree_sepolicy_get_csum ::
Ptr SePolicy ->
IO CString
sePolicyGetCsum ::
(B.CallStack.HasCallStack, MonadIO m, IsSePolicy a) =>
a
-> m (Maybe T.Text)
sePolicyGetCsum :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSePolicy a) =>
a -> m (Maybe Text)
sePolicyGetCsum a
self = 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
self' <- a -> IO (Ptr SePolicy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
result <- ostree_sepolicy_get_csum self'
maybeResult <- convertIfNonNull result $ \CString
result' -> do
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
return result''
touchManagedPtr self
return maybeResult
#if defined(ENABLE_OVERLOADING)
data SePolicyGetCsumMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsSePolicy a) => O.OverloadedMethod SePolicyGetCsumMethodInfo a signature where
overloadedMethod = sePolicyGetCsum
instance O.OverloadedMethodInfo SePolicyGetCsumMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.SePolicy.sePolicyGetCsum",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Objects-SePolicy.html#v:sePolicyGetCsum"
})
#endif
foreign import ccall "ostree_sepolicy_get_label" ostree_sepolicy_get_label ::
Ptr SePolicy ->
CString ->
Word32 ->
Ptr CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
sePolicyGetLabel ::
(B.CallStack.HasCallStack, MonadIO m, IsSePolicy a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Word32
-> Maybe (b)
-> m ((Maybe T.Text))
sePolicyGetLabel :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSePolicy a, IsCancellable b) =>
a -> Text -> Word32 -> Maybe b -> m (Maybe Text)
sePolicyGetLabel a
self Text
relpath Word32
unixMode Maybe b
cancellable = 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
self' <- a -> IO (Ptr SePolicy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
relpath' <- textToCString relpath
outLabel <- callocMem :: IO (Ptr CString)
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_sepolicy_get_label self' relpath' unixMode outLabel maybeCancellable
outLabel' <- peek outLabel
maybeOutLabel' <- convertIfNonNull outLabel' $ \CString
outLabel'' -> do
outLabel''' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outLabel''
return outLabel'''
freeMem outLabel'
touchManagedPtr self
whenJust cancellable touchManagedPtr
freeMem relpath'
freeMem outLabel
return maybeOutLabel'
) (do
freeMem relpath'
freeMem outLabel
)
#if defined(ENABLE_OVERLOADING)
data SePolicyGetLabelMethodInfo
instance (signature ~ (T.Text -> Word32 -> Maybe (b) -> m ((Maybe T.Text))), MonadIO m, IsSePolicy a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod SePolicyGetLabelMethodInfo a signature where
overloadedMethod = sePolicyGetLabel
instance O.OverloadedMethodInfo SePolicyGetLabelMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.SePolicy.sePolicyGetLabel",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Objects-SePolicy.html#v:sePolicyGetLabel"
})
#endif
foreign import ccall "ostree_sepolicy_get_name" ostree_sepolicy_get_name ::
Ptr SePolicy ->
IO CString
sePolicyGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsSePolicy a) =>
a
-> m (Maybe T.Text)
sePolicyGetName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSePolicy a) =>
a -> m (Maybe Text)
sePolicyGetName a
self = 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
self' <- a -> IO (Ptr SePolicy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
result <- ostree_sepolicy_get_name self'
maybeResult <- convertIfNonNull result $ \CString
result' -> do
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
return result''
touchManagedPtr self
return maybeResult
#if defined(ENABLE_OVERLOADING)
data SePolicyGetNameMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsSePolicy a) => O.OverloadedMethod SePolicyGetNameMethodInfo a signature where
overloadedMethod = sePolicyGetName
instance O.OverloadedMethodInfo SePolicyGetNameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.SePolicy.sePolicyGetName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Objects-SePolicy.html#v:sePolicyGetName"
})
#endif
foreign import ccall "ostree_sepolicy_get_path" ostree_sepolicy_get_path ::
Ptr SePolicy ->
IO (Ptr Gio.File.File)
sePolicyGetPath ::
(B.CallStack.HasCallStack, MonadIO m, IsSePolicy a) =>
a
-> m (Maybe Gio.File.File)
sePolicyGetPath :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSePolicy a) =>
a -> m (Maybe File)
sePolicyGetPath a
self = IO (Maybe File) -> m (Maybe File)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe File) -> m (Maybe File))
-> IO (Maybe File) -> m (Maybe File)
forall a b. (a -> b) -> a -> b
$ do
self' <- a -> IO (Ptr SePolicy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
result <- ostree_sepolicy_get_path self'
maybeResult <- convertIfNonNull result $ \Ptr File
result' -> do
result'' <- ((ManagedPtr File -> File) -> Ptr File -> IO File
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr File -> File
Gio.File.File) Ptr File
result'
return result''
touchManagedPtr self
return maybeResult
#if defined(ENABLE_OVERLOADING)
data SePolicyGetPathMethodInfo
instance (signature ~ (m (Maybe Gio.File.File)), MonadIO m, IsSePolicy a) => O.OverloadedMethod SePolicyGetPathMethodInfo a signature where
overloadedMethod = sePolicyGetPath
instance O.OverloadedMethodInfo SePolicyGetPathMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.SePolicy.sePolicyGetPath",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Objects-SePolicy.html#v:sePolicyGetPath"
})
#endif
foreign import ccall "ostree_sepolicy_restorecon" ostree_sepolicy_restorecon ::
Ptr SePolicy ->
CString ->
Ptr Gio.FileInfo.FileInfo ->
Ptr Gio.File.File ->
CUInt ->
Ptr CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
sePolicyRestorecon ::
(B.CallStack.HasCallStack, MonadIO m, IsSePolicy a, Gio.FileInfo.IsFileInfo b, Gio.File.IsFile c, Gio.Cancellable.IsCancellable d) =>
a
-> T.Text
-> Maybe (b)
-> c
-> [OSTree.Flags.SePolicyRestoreconFlags]
-> Maybe (d)
-> m ((Maybe T.Text))
sePolicyRestorecon :: forall (m :: * -> *) a b c d.
(HasCallStack, MonadIO m, IsSePolicy a, IsFileInfo b, IsFile c,
IsCancellable d) =>
a
-> Text
-> Maybe b
-> c
-> [SePolicyRestoreconFlags]
-> Maybe d
-> m (Maybe Text)
sePolicyRestorecon a
self Text
path Maybe b
info c
target [SePolicyRestoreconFlags]
flags Maybe d
cancellable = 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
self' <- a -> IO (Ptr SePolicy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
path' <- textToCString path
maybeInfo <- case info of
Maybe b
Nothing -> Ptr FileInfo -> IO (Ptr FileInfo)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FileInfo
forall a. Ptr a
FP.nullPtr
Just b
jInfo -> do
jInfo' <- b -> IO (Ptr FileInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jInfo
return jInfo'
target' <- unsafeManagedPtrCastPtr target
let flags' = [SePolicyRestoreconFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [SePolicyRestoreconFlags]
flags
outNewLabel <- callocMem :: IO (Ptr CString)
maybeCancellable <- case cancellable of
Maybe d
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 d
jCancellable -> do
jCancellable' <- d -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr d
jCancellable
return jCancellable'
onException (do
_ <- propagateGError $ ostree_sepolicy_restorecon self' path' maybeInfo target' flags' outNewLabel maybeCancellable
outNewLabel' <- peek outNewLabel
maybeOutNewLabel' <- convertIfNonNull outNewLabel' $ \CString
outNewLabel'' -> do
outNewLabel''' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outNewLabel''
return outNewLabel'''
freeMem outNewLabel'
touchManagedPtr self
whenJust info touchManagedPtr
touchManagedPtr target
whenJust cancellable touchManagedPtr
freeMem path'
freeMem outNewLabel
return maybeOutNewLabel'
) (do
freeMem path'
freeMem outNewLabel
)
#if defined(ENABLE_OVERLOADING)
data SePolicyRestoreconMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> c -> [OSTree.Flags.SePolicyRestoreconFlags] -> Maybe (d) -> m ((Maybe T.Text))), MonadIO m, IsSePolicy a, Gio.FileInfo.IsFileInfo b, Gio.File.IsFile c, Gio.Cancellable.IsCancellable d) => O.OverloadedMethod SePolicyRestoreconMethodInfo a signature where
overloadedMethod = sePolicyRestorecon
instance O.OverloadedMethodInfo SePolicyRestoreconMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.SePolicy.sePolicyRestorecon",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Objects-SePolicy.html#v:sePolicyRestorecon"
})
#endif
foreign import ccall "ostree_sepolicy_setfscreatecon" ostree_sepolicy_setfscreatecon ::
Ptr SePolicy ->
CString ->
Word32 ->
Ptr (Ptr GError) ->
IO CInt
sePolicySetfscreatecon ::
(B.CallStack.HasCallStack, MonadIO m, IsSePolicy a) =>
a
-> T.Text
-> Word32
-> m ()
sePolicySetfscreatecon :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSePolicy a) =>
a -> Text -> Word32 -> m ()
sePolicySetfscreatecon a
self Text
path 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
self' <- a -> IO (Ptr SePolicy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
path' <- textToCString path
onException (do
_ <- propagateGError $ ostree_sepolicy_setfscreatecon self' path' mode
touchManagedPtr self
freeMem path'
return ()
) (do
freeMem path'
)
#if defined(ENABLE_OVERLOADING)
data SePolicySetfscreateconMethodInfo
instance (signature ~ (T.Text -> Word32 -> m ()), MonadIO m, IsSePolicy a) => O.OverloadedMethod SePolicySetfscreateconMethodInfo a signature where
overloadedMethod = sePolicySetfscreatecon
instance O.OverloadedMethodInfo SePolicySetfscreateconMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.SePolicy.sePolicySetfscreatecon",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Objects-SePolicy.html#v:sePolicySetfscreatecon"
})
#endif
foreign import ccall "ostree_sepolicy_fscreatecon_cleanup" ostree_sepolicy_fscreatecon_cleanup ::
Ptr () ->
IO ()
sePolicyFscreateconCleanup ::
(B.CallStack.HasCallStack, MonadIO m) =>
Ptr ()
-> m ()
sePolicyFscreateconCleanup :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Ptr () -> m ()
sePolicyFscreateconCleanup Ptr ()
unused = 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
Ptr () -> IO ()
ostree_sepolicy_fscreatecon_cleanup Ptr ()
unused
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ostree_sepolicy_set_null_log" ostree_sepolicy_set_null_log ::
IO ()
sePolicySetNullLog ::
(B.CallStack.HasCallStack, MonadIO m) =>
m ()
sePolicySetNullLog :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m ()
sePolicySetNullLog = 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 ()
ostree_sepolicy_set_null_log
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif