{-# 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 ,
#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.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 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
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 SePolicy
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 SePolicy
ptr Ptr SePolicy -> Ptr SePolicy -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr SePolicy
forall a. Ptr a
FP.nullPtr
then SePolicy -> Maybe SePolicy
forall a. a -> Maybe a
P.Just (SePolicy -> Maybe SePolicy) -> IO SePolicy -> IO (Maybe SePolicy)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr SePolicy -> SePolicy) -> Ptr SePolicy -> IO SePolicy
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr SePolicy -> SePolicy
SePolicy Ptr SePolicy
ptr
else Maybe SePolicy -> IO (Maybe SePolicy)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe SePolicy
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveSePolicyMethod (t :: Symbol) (o :: *) :: * 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 Gio.File.File
getSePolicyPath :: forall (m :: * -> *) o. (MonadIO m, IsSePolicy o) => o -> m File
getSePolicyPath o
obj = IO File -> m File
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO File -> m File) -> IO File -> m File
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe File) -> IO File
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getSePolicyPath" (IO (Maybe File) -> IO File) -> IO (Maybe File) -> IO File
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr File -> File) -> IO (Maybe File)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj 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 = Gio.File.File
type AttrLabel SePolicyPathPropertyInfo = "path"
type AttrOrigin SePolicyPathPropertyInfo = SePolicy
attrGet = getSePolicyPath
attrSet = 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.16/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
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.16/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, *)])
#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, *)])
#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
Ptr File
path' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
path
Ptr Cancellable
maybeCancellable <- case Maybe b
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
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO SePolicy -> IO () -> IO SePolicy
forall a b. IO a -> IO b -> IO a
onException (do
Ptr SePolicy
result <- (Ptr (Ptr GError) -> IO (Ptr SePolicy)) -> IO (Ptr SePolicy)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr SePolicy)) -> IO (Ptr SePolicy))
-> (Ptr (Ptr GError) -> IO (Ptr SePolicy)) -> IO (Ptr SePolicy)
forall a b. (a -> b) -> a -> b
$ Ptr File
-> Ptr Cancellable -> Ptr (Ptr GError) -> IO (Ptr SePolicy)
ostree_sepolicy_new Ptr File
path' Ptr Cancellable
maybeCancellable
Text -> Ptr SePolicy -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sePolicyNew" Ptr SePolicy
result
SePolicy
result' <- ((ManagedPtr SePolicy -> SePolicy) -> Ptr SePolicy -> IO SePolicy
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SePolicy -> SePolicy
SePolicy) Ptr SePolicy
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
path
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
SePolicy -> IO SePolicy
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return SePolicy
result'
) (do
() -> 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_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
Ptr Cancellable
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
nullPtr
Just a
jCancellable -> do
Ptr Cancellable
jCancellable' <- a -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO SePolicy -> IO () -> IO SePolicy
forall a b. IO a -> IO b -> IO a
onException (do
Ptr SePolicy
result <- (Ptr (Ptr GError) -> IO (Ptr SePolicy)) -> IO (Ptr SePolicy)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr SePolicy)) -> IO (Ptr SePolicy))
-> (Ptr (Ptr GError) -> IO (Ptr SePolicy)) -> IO (Ptr SePolicy)
forall a b. (a -> b) -> a -> b
$ Int32 -> Ptr Cancellable -> Ptr (Ptr GError) -> IO (Ptr SePolicy)
ostree_sepolicy_new_at Int32
rootfsDfd Ptr Cancellable
maybeCancellable
Text -> Ptr SePolicy -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sePolicyNewAt" Ptr SePolicy
result
SePolicy
result' <- ((ManagedPtr SePolicy -> SePolicy) -> Ptr SePolicy -> IO SePolicy
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SePolicy -> SePolicy
SePolicy) Ptr SePolicy
result
Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
cancellable a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
SePolicy -> IO SePolicy
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return SePolicy
result'
) (do
() -> 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_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
Ptr Repo
repo' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
repo
CString
rev' <- Text -> IO CString
textToCString Text
rev
Ptr Cancellable
maybeCancellable <- case Maybe b
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
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO SePolicy -> IO () -> IO SePolicy
forall a b. IO a -> IO b -> IO a
onException (do
Ptr SePolicy
result <- (Ptr (Ptr GError) -> IO (Ptr SePolicy)) -> IO (Ptr SePolicy)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr SePolicy)) -> IO (Ptr SePolicy))
-> (Ptr (Ptr GError) -> IO (Ptr SePolicy)) -> IO (Ptr SePolicy)
forall a b. (a -> b) -> a -> b
$ Ptr Repo
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr SePolicy)
ostree_sepolicy_new_from_commit Ptr Repo
repo' CString
rev' Ptr Cancellable
maybeCancellable
Text -> Ptr SePolicy -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sePolicyNewFromCommit" Ptr SePolicy
result
SePolicy
result' <- ((ManagedPtr SePolicy -> SePolicy) -> Ptr SePolicy -> IO SePolicy
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SePolicy -> SePolicy
SePolicy) Ptr SePolicy
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
repo
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
rev'
SePolicy -> IO SePolicy
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return SePolicy
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
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 T.Text
sePolicyGetCsum :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSePolicy a) =>
a -> m Text
sePolicyGetCsum a
self = 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
Ptr SePolicy
self' <- a -> IO (Ptr SePolicy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
result <- Ptr SePolicy -> IO CString
ostree_sepolicy_get_csum Ptr SePolicy
self'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sePolicyGetCsum" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data SePolicyGetCsumMethodInfo
instance (signature ~ (m 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.16/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 (T.Text)
sePolicyGetLabel :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSePolicy a, IsCancellable b) =>
a -> Text -> Word32 -> Maybe b -> m Text
sePolicyGetLabel a
self Text
relpath Word32
unixMode Maybe b
cancellable = 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
Ptr SePolicy
self' <- a -> IO (Ptr SePolicy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
relpath' <- Text -> IO CString
textToCString Text
relpath
Ptr CString
outLabel <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr CString)
Ptr Cancellable
maybeCancellable <- case Maybe b
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
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO Text -> IO () -> IO Text
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr SePolicy
-> CString
-> Word32
-> Ptr CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_sepolicy_get_label Ptr SePolicy
self' CString
relpath' Word32
unixMode Ptr CString
outLabel Ptr Cancellable
maybeCancellable
CString
outLabel' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
outLabel
Text
outLabel'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outLabel'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
outLabel'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
relpath'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outLabel
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
outLabel''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
relpath'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outLabel
)
#if defined(ENABLE_OVERLOADING)
data SePolicyGetLabelMethodInfo
instance (signature ~ (T.Text -> Word32 -> Maybe (b) -> m (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.16/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 T.Text
sePolicyGetName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSePolicy a) =>
a -> m Text
sePolicyGetName a
self = 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
Ptr SePolicy
self' <- a -> IO (Ptr SePolicy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
result <- Ptr SePolicy -> IO CString
ostree_sepolicy_get_name Ptr SePolicy
self'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sePolicyGetName" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data SePolicyGetNameMethodInfo
instance (signature ~ (m 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.16/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 Gio.File.File
sePolicyGetPath :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSePolicy a) =>
a -> m File
sePolicyGetPath a
self = IO File -> m File
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO File -> m File) -> IO File -> m File
forall a b. (a -> b) -> a -> b
$ do
Ptr SePolicy
self' <- a -> IO (Ptr SePolicy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr File
result <- Ptr SePolicy -> IO (Ptr File)
ostree_sepolicy_get_path Ptr SePolicy
self'
Text -> Ptr File -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sePolicyGetPath" Ptr File
result
File
result' <- ((ManagedPtr File -> File) -> Ptr File -> IO File
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr File -> File
Gio.File.File) Ptr File
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
File -> IO File
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return File
result'
#if defined(ENABLE_OVERLOADING)
data SePolicyGetPathMethodInfo
instance (signature ~ (m 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.16/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 (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 Text
sePolicyRestorecon a
self Text
path Maybe b
info c
target [SePolicyRestoreconFlags]
flags Maybe d
cancellable = 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
Ptr SePolicy
self' <- a -> IO (Ptr SePolicy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
path' <- Text -> IO CString
textToCString Text
path
Ptr FileInfo
maybeInfo <- case Maybe b
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
nullPtr
Just b
jInfo -> do
Ptr FileInfo
jInfo' <- b -> IO (Ptr FileInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jInfo
Ptr FileInfo -> IO (Ptr FileInfo)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FileInfo
jInfo'
Ptr File
target' <- c -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
target
let flags' :: CUInt
flags' = [SePolicyRestoreconFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [SePolicyRestoreconFlags]
flags
Ptr CString
outNewLabel <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr CString)
Ptr Cancellable
maybeCancellable <- case Maybe d
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
nullPtr
Just d
jCancellable -> do
Ptr Cancellable
jCancellable' <- d -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr d
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO Text -> IO () -> IO Text
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr SePolicy
-> CString
-> Ptr FileInfo
-> Ptr File
-> CUInt
-> Ptr CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_sepolicy_restorecon Ptr SePolicy
self' CString
path' Ptr FileInfo
maybeInfo Ptr File
target' CUInt
flags' Ptr CString
outNewLabel Ptr Cancellable
maybeCancellable
CString
outNewLabel' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
outNewLabel
Text
outNewLabel'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outNewLabel'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
outNewLabel'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
info b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
target
Maybe d -> (d -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe d
cancellable d -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outNewLabel
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
outNewLabel''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outNewLabel
)
#if defined(ENABLE_OVERLOADING)
data SePolicyRestoreconMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> c -> [OSTree.Flags.SePolicyRestoreconFlags] -> Maybe (d) -> m (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.16/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
Ptr SePolicy
self' <- a -> IO (Ptr SePolicy)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
path' <- Text -> IO CString
textToCString Text
path
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr SePolicy -> CString -> Word32 -> Ptr (Ptr GError) -> IO CInt
ostree_sepolicy_setfscreatecon Ptr SePolicy
self' CString
path' Word32
mode
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
)
#if defined(ENABLE_OVERLOADING)
data 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.16/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