{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.OSTree.Objects.BootconfigParser
(
BootconfigParser(..) ,
IsBootconfigParser ,
toBootconfigParser ,
#if defined(ENABLE_OVERLOADING)
ResolveBootconfigParserMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
BootconfigParserCloneMethodInfo ,
#endif
bootconfigParserClone ,
#if defined(ENABLE_OVERLOADING)
BootconfigParserGetMethodInfo ,
#endif
bootconfigParserGet ,
#if defined(ENABLE_OVERLOADING)
BootconfigParserGetOverlayInitrdsMethodInfo,
#endif
bootconfigParserGetOverlayInitrds ,
bootconfigParserNew ,
#if defined(ENABLE_OVERLOADING)
BootconfigParserParseMethodInfo ,
#endif
bootconfigParserParse ,
#if defined(ENABLE_OVERLOADING)
BootconfigParserParseAtMethodInfo ,
#endif
bootconfigParserParseAt ,
#if defined(ENABLE_OVERLOADING)
BootconfigParserSetMethodInfo ,
#endif
bootconfigParserSet ,
#if defined(ENABLE_OVERLOADING)
BootconfigParserSetOverlayInitrdsMethodInfo,
#endif
bootconfigParserSetOverlayInitrds ,
#if defined(ENABLE_OVERLOADING)
BootconfigParserWriteMethodInfo ,
#endif
bootconfigParserWrite ,
#if defined(ENABLE_OVERLOADING)
BootconfigParserWriteAtMethodInfo ,
#endif
bootconfigParserWriteAt ,
) 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.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.Objects.Cancellable as Gio.Cancellable
newtype BootconfigParser = BootconfigParser (SP.ManagedPtr BootconfigParser)
deriving (BootconfigParser -> BootconfigParser -> Bool
(BootconfigParser -> BootconfigParser -> Bool)
-> (BootconfigParser -> BootconfigParser -> Bool)
-> Eq BootconfigParser
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BootconfigParser -> BootconfigParser -> Bool
$c/= :: BootconfigParser -> BootconfigParser -> Bool
== :: BootconfigParser -> BootconfigParser -> Bool
$c== :: BootconfigParser -> BootconfigParser -> Bool
Eq)
instance SP.ManagedPtrNewtype BootconfigParser where
toManagedPtr :: BootconfigParser -> ManagedPtr BootconfigParser
toManagedPtr (BootconfigParser ManagedPtr BootconfigParser
p) = ManagedPtr BootconfigParser
p
foreign import ccall "ostree_bootconfig_parser_get_type"
c_ostree_bootconfig_parser_get_type :: IO B.Types.GType
instance B.Types.TypedObject BootconfigParser where
glibType :: IO GType
glibType = IO GType
c_ostree_bootconfig_parser_get_type
instance B.Types.GObject BootconfigParser
class (SP.GObject o, O.IsDescendantOf BootconfigParser o) => IsBootconfigParser o
instance (SP.GObject o, O.IsDescendantOf BootconfigParser o) => IsBootconfigParser o
instance O.HasParentTypes BootconfigParser
type instance O.ParentTypes BootconfigParser = '[GObject.Object.Object]
toBootconfigParser :: (MIO.MonadIO m, IsBootconfigParser o) => o -> m BootconfigParser
toBootconfigParser :: forall (m :: * -> *) o.
(MonadIO m, IsBootconfigParser o) =>
o -> m BootconfigParser
toBootconfigParser = IO BootconfigParser -> m BootconfigParser
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO BootconfigParser -> m BootconfigParser)
-> (o -> IO BootconfigParser) -> o -> m BootconfigParser
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr BootconfigParser -> BootconfigParser)
-> o -> IO BootconfigParser
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr BootconfigParser -> BootconfigParser
BootconfigParser
instance B.GValue.IsGValue (Maybe BootconfigParser) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ostree_bootconfig_parser_get_type
gvalueSet_ :: Ptr GValue -> Maybe BootconfigParser -> IO ()
gvalueSet_ Ptr GValue
gv Maybe BootconfigParser
P.Nothing = Ptr GValue -> Ptr BootconfigParser -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr BootconfigParser
forall a. Ptr a
FP.nullPtr :: FP.Ptr BootconfigParser)
gvalueSet_ Ptr GValue
gv (P.Just BootconfigParser
obj) = BootconfigParser -> (Ptr BootconfigParser -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr BootconfigParser
obj (Ptr GValue -> Ptr BootconfigParser -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe BootconfigParser)
gvalueGet_ Ptr GValue
gv = do
Ptr BootconfigParser
ptr <- Ptr GValue -> IO (Ptr BootconfigParser)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr BootconfigParser)
if Ptr BootconfigParser
ptr Ptr BootconfigParser -> Ptr BootconfigParser -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr BootconfigParser
forall a. Ptr a
FP.nullPtr
then BootconfigParser -> Maybe BootconfigParser
forall a. a -> Maybe a
P.Just (BootconfigParser -> Maybe BootconfigParser)
-> IO BootconfigParser -> IO (Maybe BootconfigParser)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr BootconfigParser -> BootconfigParser)
-> Ptr BootconfigParser -> IO BootconfigParser
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr BootconfigParser -> BootconfigParser
BootconfigParser Ptr BootconfigParser
ptr
else Maybe BootconfigParser -> IO (Maybe BootconfigParser)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe BootconfigParser
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveBootconfigParserMethod (t :: Symbol) (o :: *) :: * where
ResolveBootconfigParserMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveBootconfigParserMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveBootconfigParserMethod "clone" o = BootconfigParserCloneMethodInfo
ResolveBootconfigParserMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveBootconfigParserMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveBootconfigParserMethod "get" o = BootconfigParserGetMethodInfo
ResolveBootconfigParserMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveBootconfigParserMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveBootconfigParserMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveBootconfigParserMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveBootconfigParserMethod "parse" o = BootconfigParserParseMethodInfo
ResolveBootconfigParserMethod "parseAt" o = BootconfigParserParseAtMethodInfo
ResolveBootconfigParserMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveBootconfigParserMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveBootconfigParserMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveBootconfigParserMethod "set" o = BootconfigParserSetMethodInfo
ResolveBootconfigParserMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveBootconfigParserMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveBootconfigParserMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveBootconfigParserMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveBootconfigParserMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveBootconfigParserMethod "write" o = BootconfigParserWriteMethodInfo
ResolveBootconfigParserMethod "writeAt" o = BootconfigParserWriteAtMethodInfo
ResolveBootconfigParserMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveBootconfigParserMethod "getOverlayInitrds" o = BootconfigParserGetOverlayInitrdsMethodInfo
ResolveBootconfigParserMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveBootconfigParserMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveBootconfigParserMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveBootconfigParserMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveBootconfigParserMethod "setOverlayInitrds" o = BootconfigParserSetOverlayInitrdsMethodInfo
ResolveBootconfigParserMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveBootconfigParserMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveBootconfigParserMethod t BootconfigParser, O.OverloadedMethod info BootconfigParser p) => OL.IsLabel t (BootconfigParser -> 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 ~ ResolveBootconfigParserMethod t BootconfigParser, O.OverloadedMethod info BootconfigParser p, R.HasField t BootconfigParser p) => R.HasField t BootconfigParser p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveBootconfigParserMethod t BootconfigParser, O.OverloadedMethodInfo info BootconfigParser) => OL.IsLabel t (O.MethodProxy info BootconfigParser) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList BootconfigParser
type instance O.AttributeList BootconfigParser = BootconfigParserAttributeList
type BootconfigParserAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList BootconfigParser = BootconfigParserSignalList
type BootconfigParserSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "ostree_bootconfig_parser_new" ostree_bootconfig_parser_new ::
IO (Ptr BootconfigParser)
bootconfigParserNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m BootconfigParser
bootconfigParserNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
m BootconfigParser
bootconfigParserNew = IO BootconfigParser -> m BootconfigParser
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BootconfigParser -> m BootconfigParser)
-> IO BootconfigParser -> m BootconfigParser
forall a b. (a -> b) -> a -> b
$ do
Ptr BootconfigParser
result <- IO (Ptr BootconfigParser)
ostree_bootconfig_parser_new
Text -> Ptr BootconfigParser -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bootconfigParserNew" Ptr BootconfigParser
result
BootconfigParser
result' <- ((ManagedPtr BootconfigParser -> BootconfigParser)
-> Ptr BootconfigParser -> IO BootconfigParser
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr BootconfigParser -> BootconfigParser
BootconfigParser) Ptr BootconfigParser
result
BootconfigParser -> IO BootconfigParser
forall (m :: * -> *) a. Monad m => a -> m a
return BootconfigParser
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ostree_bootconfig_parser_clone" ostree_bootconfig_parser_clone ::
Ptr BootconfigParser ->
IO (Ptr BootconfigParser)
bootconfigParserClone ::
(B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a) =>
a
-> m BootconfigParser
bootconfigParserClone :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBootconfigParser a) =>
a -> m BootconfigParser
bootconfigParserClone a
self = IO BootconfigParser -> m BootconfigParser
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BootconfigParser -> m BootconfigParser)
-> IO BootconfigParser -> m BootconfigParser
forall a b. (a -> b) -> a -> b
$ do
Ptr BootconfigParser
self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr BootconfigParser
result <- Ptr BootconfigParser -> IO (Ptr BootconfigParser)
ostree_bootconfig_parser_clone Ptr BootconfigParser
self'
Text -> Ptr BootconfigParser -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bootconfigParserClone" Ptr BootconfigParser
result
BootconfigParser
result' <- ((ManagedPtr BootconfigParser -> BootconfigParser)
-> Ptr BootconfigParser -> IO BootconfigParser
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr BootconfigParser -> BootconfigParser
BootconfigParser) Ptr BootconfigParser
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
BootconfigParser -> IO BootconfigParser
forall (m :: * -> *) a. Monad m => a -> m a
return BootconfigParser
result'
#if defined(ENABLE_OVERLOADING)
data BootconfigParserCloneMethodInfo
instance (signature ~ (m BootconfigParser), MonadIO m, IsBootconfigParser a) => O.OverloadedMethod BootconfigParserCloneMethodInfo a signature where
overloadedMethod = bootconfigParserClone
instance O.OverloadedMethodInfo BootconfigParserCloneMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.BootconfigParser.bootconfigParserClone",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.15/docs/GI-OSTree-Objects-BootconfigParser.html#v:bootconfigParserClone"
})
#endif
foreign import ccall "ostree_bootconfig_parser_get" ostree_bootconfig_parser_get ::
Ptr BootconfigParser ->
CString ->
IO CString
bootconfigParserGet ::
(B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a) =>
a
-> T.Text
-> m T.Text
bootconfigParserGet :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBootconfigParser a) =>
a -> Text -> m Text
bootconfigParserGet a
self Text
key = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr BootconfigParser
self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
key' <- Text -> IO CString
textToCString Text
key
CString
result <- Ptr BootconfigParser -> CString -> IO CString
ostree_bootconfig_parser_get Ptr BootconfigParser
self' CString
key'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bootconfigParserGet" 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
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data BootconfigParserGetMethodInfo
instance (signature ~ (T.Text -> m T.Text), MonadIO m, IsBootconfigParser a) => O.OverloadedMethod BootconfigParserGetMethodInfo a signature where
overloadedMethod = bootconfigParserGet
instance O.OverloadedMethodInfo BootconfigParserGetMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.BootconfigParser.bootconfigParserGet",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.15/docs/GI-OSTree-Objects-BootconfigParser.html#v:bootconfigParserGet"
})
#endif
foreign import ccall "ostree_bootconfig_parser_get_overlay_initrds" ostree_bootconfig_parser_get_overlay_initrds ::
Ptr BootconfigParser ->
IO (Ptr CString)
bootconfigParserGetOverlayInitrds ::
(B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a) =>
a
-> m (Maybe [T.Text])
bootconfigParserGetOverlayInitrds :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBootconfigParser a) =>
a -> m (Maybe [Text])
bootconfigParserGetOverlayInitrds a
self = IO (Maybe [Text]) -> m (Maybe [Text])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe [Text]) -> m (Maybe [Text]))
-> IO (Maybe [Text]) -> m (Maybe [Text])
forall a b. (a -> b) -> a -> b
$ do
Ptr BootconfigParser
self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr CString
result <- Ptr BootconfigParser -> IO (Ptr CString)
ostree_bootconfig_parser_get_overlay_initrds Ptr BootconfigParser
self'
Maybe [Text]
maybeResult <- Ptr CString -> (Ptr CString -> IO [Text]) -> IO (Maybe [Text])
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr CString
result ((Ptr CString -> IO [Text]) -> IO (Maybe [Text]))
-> (Ptr CString -> IO [Text]) -> IO (Maybe [Text])
forall a b. (a -> b) -> a -> b
$ \Ptr CString
result' -> do
[Text]
result'' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result'
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe [Text] -> IO (Maybe [Text])
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe [Text]
maybeResult
#if defined(ENABLE_OVERLOADING)
data BootconfigParserGetOverlayInitrdsMethodInfo
instance (signature ~ (m (Maybe [T.Text])), MonadIO m, IsBootconfigParser a) => O.OverloadedMethod BootconfigParserGetOverlayInitrdsMethodInfo a signature where
overloadedMethod = bootconfigParserGetOverlayInitrds
instance O.OverloadedMethodInfo BootconfigParserGetOverlayInitrdsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.BootconfigParser.bootconfigParserGetOverlayInitrds",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.15/docs/GI-OSTree-Objects-BootconfigParser.html#v:bootconfigParserGetOverlayInitrds"
})
#endif
foreign import ccall "ostree_bootconfig_parser_parse" ostree_bootconfig_parser_parse ::
Ptr BootconfigParser ->
Ptr Gio.File.File ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
bootconfigParserParse ::
(B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Maybe (c)
-> m ()
bootconfigParserParse :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsBootconfigParser a, IsFile b,
IsCancellable c) =>
a -> b -> Maybe c -> m ()
bootconfigParserParse a
self b
path Maybe c
cancellable = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr BootconfigParser
self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr File
path' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
path
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr BootconfigParser
-> Ptr File -> Ptr Cancellable -> Ptr (Ptr GError) -> IO CInt
ostree_bootconfig_parser_parse Ptr BootconfigParser
self' Ptr File
path' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
path
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BootconfigParserParseMethodInfo
instance (signature ~ (b -> Maybe (c) -> m ()), MonadIO m, IsBootconfigParser a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod BootconfigParserParseMethodInfo a signature where
overloadedMethod = bootconfigParserParse
instance O.OverloadedMethodInfo BootconfigParserParseMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.BootconfigParser.bootconfigParserParse",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.15/docs/GI-OSTree-Objects-BootconfigParser.html#v:bootconfigParserParse"
})
#endif
foreign import ccall "ostree_bootconfig_parser_parse_at" ostree_bootconfig_parser_parse_at ::
Ptr BootconfigParser ->
Int32 ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
bootconfigParserParseAt ::
(B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> T.Text
-> Maybe (b)
-> m ()
bootconfigParserParseAt :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsBootconfigParser a, IsCancellable b) =>
a -> Int32 -> Text -> Maybe b -> m ()
bootconfigParserParseAt a
self Int32
dfd Text
path Maybe b
cancellable = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr BootconfigParser
self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
path' <- Text -> IO CString
textToCString Text
path
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
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 (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr BootconfigParser
-> Int32
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_bootconfig_parser_parse_at Ptr BootconfigParser
self' Int32
dfd CString
path' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
)
#if defined(ENABLE_OVERLOADING)
data BootconfigParserParseAtMethodInfo
instance (signature ~ (Int32 -> T.Text -> Maybe (b) -> m ()), MonadIO m, IsBootconfigParser a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod BootconfigParserParseAtMethodInfo a signature where
overloadedMethod = bootconfigParserParseAt
instance O.OverloadedMethodInfo BootconfigParserParseAtMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.BootconfigParser.bootconfigParserParseAt",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.15/docs/GI-OSTree-Objects-BootconfigParser.html#v:bootconfigParserParseAt"
})
#endif
foreign import ccall "ostree_bootconfig_parser_set" ostree_bootconfig_parser_set ::
Ptr BootconfigParser ->
CString ->
CString ->
IO ()
bootconfigParserSet ::
(B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a) =>
a
-> T.Text
-> T.Text
-> m ()
bootconfigParserSet :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBootconfigParser a) =>
a -> Text -> Text -> m ()
bootconfigParserSet a
self Text
key Text
value = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr BootconfigParser
self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
key' <- Text -> IO CString
textToCString Text
key
CString
value' <- Text -> IO CString
textToCString Text
value
Ptr BootconfigParser -> CString -> CString -> IO ()
ostree_bootconfig_parser_set Ptr BootconfigParser
self' CString
key' CString
value'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
value'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BootconfigParserSetMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ()), MonadIO m, IsBootconfigParser a) => O.OverloadedMethod BootconfigParserSetMethodInfo a signature where
overloadedMethod = bootconfigParserSet
instance O.OverloadedMethodInfo BootconfigParserSetMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.BootconfigParser.bootconfigParserSet",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.15/docs/GI-OSTree-Objects-BootconfigParser.html#v:bootconfigParserSet"
})
#endif
foreign import ccall "ostree_bootconfig_parser_set_overlay_initrds" ostree_bootconfig_parser_set_overlay_initrds ::
Ptr BootconfigParser ->
Ptr CString ->
IO ()
bootconfigParserSetOverlayInitrds ::
(B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a) =>
a
-> Maybe ([T.Text])
-> m ()
bootconfigParserSetOverlayInitrds :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBootconfigParser a) =>
a -> Maybe [Text] -> m ()
bootconfigParserSetOverlayInitrds a
self Maybe [Text]
initrds = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr BootconfigParser
self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr CString
maybeInitrds <- case Maybe [Text]
initrds of
Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
nullPtr
Just [Text]
jInitrds -> do
Ptr CString
jInitrds' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jInitrds
Ptr CString -> IO (Ptr CString)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
jInitrds'
Ptr BootconfigParser -> Ptr CString -> IO ()
ostree_bootconfig_parser_set_overlay_initrds Ptr BootconfigParser
self' Ptr CString
maybeInitrds
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeInitrds
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeInitrds
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BootconfigParserSetOverlayInitrdsMethodInfo
instance (signature ~ (Maybe ([T.Text]) -> m ()), MonadIO m, IsBootconfigParser a) => O.OverloadedMethod BootconfigParserSetOverlayInitrdsMethodInfo a signature where
overloadedMethod = bootconfigParserSetOverlayInitrds
instance O.OverloadedMethodInfo BootconfigParserSetOverlayInitrdsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.BootconfigParser.bootconfigParserSetOverlayInitrds",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.15/docs/GI-OSTree-Objects-BootconfigParser.html#v:bootconfigParserSetOverlayInitrds"
})
#endif
foreign import ccall "ostree_bootconfig_parser_write" ostree_bootconfig_parser_write ::
Ptr BootconfigParser ->
Ptr Gio.File.File ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
bootconfigParserWrite ::
(B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Maybe (c)
-> m ()
bootconfigParserWrite :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsBootconfigParser a, IsFile b,
IsCancellable c) =>
a -> b -> Maybe c -> m ()
bootconfigParserWrite a
self b
output Maybe c
cancellable = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr BootconfigParser
self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr File
output' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
output
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr BootconfigParser
-> Ptr File -> Ptr Cancellable -> Ptr (Ptr GError) -> IO CInt
ostree_bootconfig_parser_write Ptr BootconfigParser
self' Ptr File
output' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
output
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BootconfigParserWriteMethodInfo
instance (signature ~ (b -> Maybe (c) -> m ()), MonadIO m, IsBootconfigParser a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod BootconfigParserWriteMethodInfo a signature where
overloadedMethod = bootconfigParserWrite
instance O.OverloadedMethodInfo BootconfigParserWriteMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.BootconfigParser.bootconfigParserWrite",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.15/docs/GI-OSTree-Objects-BootconfigParser.html#v:bootconfigParserWrite"
})
#endif
foreign import ccall "ostree_bootconfig_parser_write_at" ostree_bootconfig_parser_write_at ::
Ptr BootconfigParser ->
Int32 ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
bootconfigParserWriteAt ::
(B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> T.Text
-> Maybe (b)
-> m ()
bootconfigParserWriteAt :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsBootconfigParser a, IsCancellable b) =>
a -> Int32 -> Text -> Maybe b -> m ()
bootconfigParserWriteAt a
self Int32
dfd Text
path Maybe b
cancellable = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr BootconfigParser
self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
path' <- Text -> IO CString
textToCString Text
path
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
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 (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr BootconfigParser
-> Int32
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_bootconfig_parser_write_at Ptr BootconfigParser
self' Int32
dfd CString
path' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
)
#if defined(ENABLE_OVERLOADING)
data BootconfigParserWriteAtMethodInfo
instance (signature ~ (Int32 -> T.Text -> Maybe (b) -> m ()), MonadIO m, IsBootconfigParser a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod BootconfigParserWriteAtMethodInfo a signature where
overloadedMethod = bootconfigParserWriteAt
instance O.OverloadedMethodInfo BootconfigParserWriteAtMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.BootconfigParser.bootconfigParserWriteAt",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.15/docs/GI-OSTree-Objects-BootconfigParser.html#v:bootconfigParserWriteAt"
})
#endif