{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.Subprocess
(
Subprocess(..) ,
IsSubprocess ,
toSubprocess ,
#if defined(ENABLE_OVERLOADING)
ResolveSubprocessMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
SubprocessCommunicateMethodInfo ,
#endif
subprocessCommunicate ,
#if defined(ENABLE_OVERLOADING)
SubprocessCommunicateAsyncMethodInfo ,
#endif
subprocessCommunicateAsync ,
#if defined(ENABLE_OVERLOADING)
SubprocessCommunicateFinishMethodInfo ,
#endif
subprocessCommunicateFinish ,
#if defined(ENABLE_OVERLOADING)
SubprocessCommunicateUtf8MethodInfo ,
#endif
subprocessCommunicateUtf8 ,
#if defined(ENABLE_OVERLOADING)
SubprocessCommunicateUtf8AsyncMethodInfo,
#endif
subprocessCommunicateUtf8Async ,
#if defined(ENABLE_OVERLOADING)
SubprocessCommunicateUtf8FinishMethodInfo,
#endif
subprocessCommunicateUtf8Finish ,
#if defined(ENABLE_OVERLOADING)
SubprocessForceExitMethodInfo ,
#endif
subprocessForceExit ,
#if defined(ENABLE_OVERLOADING)
SubprocessGetExitStatusMethodInfo ,
#endif
subprocessGetExitStatus ,
#if defined(ENABLE_OVERLOADING)
SubprocessGetIdentifierMethodInfo ,
#endif
subprocessGetIdentifier ,
#if defined(ENABLE_OVERLOADING)
SubprocessGetIfExitedMethodInfo ,
#endif
subprocessGetIfExited ,
#if defined(ENABLE_OVERLOADING)
SubprocessGetIfSignaledMethodInfo ,
#endif
subprocessGetIfSignaled ,
#if defined(ENABLE_OVERLOADING)
SubprocessGetStatusMethodInfo ,
#endif
subprocessGetStatus ,
#if defined(ENABLE_OVERLOADING)
SubprocessGetStderrPipeMethodInfo ,
#endif
subprocessGetStderrPipe ,
#if defined(ENABLE_OVERLOADING)
SubprocessGetStdinPipeMethodInfo ,
#endif
subprocessGetStdinPipe ,
#if defined(ENABLE_OVERLOADING)
SubprocessGetStdoutPipeMethodInfo ,
#endif
subprocessGetStdoutPipe ,
#if defined(ENABLE_OVERLOADING)
SubprocessGetSuccessfulMethodInfo ,
#endif
subprocessGetSuccessful ,
#if defined(ENABLE_OVERLOADING)
SubprocessGetTermSigMethodInfo ,
#endif
subprocessGetTermSig ,
subprocessNew ,
#if defined(ENABLE_OVERLOADING)
SubprocessSendSignalMethodInfo ,
#endif
subprocessSendSignal ,
#if defined(ENABLE_OVERLOADING)
SubprocessWaitMethodInfo ,
#endif
subprocessWait ,
#if defined(ENABLE_OVERLOADING)
SubprocessWaitAsyncMethodInfo ,
#endif
subprocessWaitAsync ,
#if defined(ENABLE_OVERLOADING)
SubprocessWaitCheckMethodInfo ,
#endif
subprocessWaitCheck ,
#if defined(ENABLE_OVERLOADING)
SubprocessWaitCheckAsyncMethodInfo ,
#endif
subprocessWaitCheckAsync ,
#if defined(ENABLE_OVERLOADING)
SubprocessWaitCheckFinishMethodInfo ,
#endif
subprocessWaitCheckFinish ,
#if defined(ENABLE_OVERLOADING)
SubprocessWaitFinishMethodInfo ,
#endif
subprocessWaitFinish ,
#if defined(ENABLE_OVERLOADING)
SubprocessArgvPropertyInfo ,
#endif
constructSubprocessArgv ,
#if defined(ENABLE_OVERLOADING)
subprocessArgv ,
#endif
#if defined(ENABLE_OVERLOADING)
SubprocessFlagsPropertyInfo ,
#endif
constructSubprocessFlags ,
#if defined(ENABLE_OVERLOADING)
subprocessFlags ,
#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.PollFD as GLib.PollFD
import qualified GI.GLib.Structs.Source as GLib.Source
import qualified GI.GObject.Callbacks as GObject.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.GObject.Structs.Parameter as GObject.Parameter
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Initable as Gio.Initable
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.InputStream as Gio.InputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import {-# SOURCE #-} qualified GI.Gio.Structs.OutputVector as Gio.OutputVector
#else
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Initable as Gio.Initable
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.InputStream as Gio.InputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
#endif
newtype Subprocess = Subprocess (SP.ManagedPtr Subprocess)
deriving (Subprocess -> Subprocess -> Bool
(Subprocess -> Subprocess -> Bool)
-> (Subprocess -> Subprocess -> Bool) -> Eq Subprocess
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Subprocess -> Subprocess -> Bool
== :: Subprocess -> Subprocess -> Bool
$c/= :: Subprocess -> Subprocess -> Bool
/= :: Subprocess -> Subprocess -> Bool
Eq)
instance SP.ManagedPtrNewtype Subprocess where
toManagedPtr :: Subprocess -> ManagedPtr Subprocess
toManagedPtr (Subprocess ManagedPtr Subprocess
p) = ManagedPtr Subprocess
p
foreign import ccall "g_subprocess_get_type"
c_g_subprocess_get_type :: IO B.Types.GType
instance B.Types.TypedObject Subprocess where
glibType :: IO GType
glibType = IO GType
c_g_subprocess_get_type
instance B.Types.GObject Subprocess
class (SP.GObject o, O.IsDescendantOf Subprocess o) => IsSubprocess o
instance (SP.GObject o, O.IsDescendantOf Subprocess o) => IsSubprocess o
instance O.HasParentTypes Subprocess
type instance O.ParentTypes Subprocess = '[GObject.Object.Object, Gio.Initable.Initable]
toSubprocess :: (MIO.MonadIO m, IsSubprocess o) => o -> m Subprocess
toSubprocess :: forall (m :: * -> *) o.
(MonadIO m, IsSubprocess o) =>
o -> m Subprocess
toSubprocess = IO Subprocess -> m Subprocess
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Subprocess -> m Subprocess)
-> (o -> IO Subprocess) -> o -> m Subprocess
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Subprocess -> Subprocess) -> o -> IO Subprocess
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Subprocess -> Subprocess
Subprocess
instance B.GValue.IsGValue (Maybe Subprocess) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_subprocess_get_type
gvalueSet_ :: Ptr GValue -> Maybe Subprocess -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Subprocess
P.Nothing = Ptr GValue -> Ptr Subprocess -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Subprocess
forall a. Ptr a
FP.nullPtr :: FP.Ptr Subprocess)
gvalueSet_ Ptr GValue
gv (P.Just Subprocess
obj) = Subprocess -> (Ptr Subprocess -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Subprocess
obj (Ptr GValue -> Ptr Subprocess -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Subprocess)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr Subprocess)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Subprocess)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject Subprocess ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveSubprocessMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveSubprocessMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSubprocessMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSubprocessMethod "communicate" o = SubprocessCommunicateMethodInfo
ResolveSubprocessMethod "communicateAsync" o = SubprocessCommunicateAsyncMethodInfo
ResolveSubprocessMethod "communicateFinish" o = SubprocessCommunicateFinishMethodInfo
ResolveSubprocessMethod "communicateUtf8" o = SubprocessCommunicateUtf8MethodInfo
ResolveSubprocessMethod "communicateUtf8Async" o = SubprocessCommunicateUtf8AsyncMethodInfo
ResolveSubprocessMethod "communicateUtf8Finish" o = SubprocessCommunicateUtf8FinishMethodInfo
ResolveSubprocessMethod "forceExit" o = SubprocessForceExitMethodInfo
ResolveSubprocessMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSubprocessMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSubprocessMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSubprocessMethod "init" o = Gio.Initable.InitableInitMethodInfo
ResolveSubprocessMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSubprocessMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSubprocessMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSubprocessMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSubprocessMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSubprocessMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSubprocessMethod "sendSignal" o = SubprocessSendSignalMethodInfo
ResolveSubprocessMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSubprocessMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSubprocessMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSubprocessMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSubprocessMethod "wait" o = SubprocessWaitMethodInfo
ResolveSubprocessMethod "waitAsync" o = SubprocessWaitAsyncMethodInfo
ResolveSubprocessMethod "waitCheck" o = SubprocessWaitCheckMethodInfo
ResolveSubprocessMethod "waitCheckAsync" o = SubprocessWaitCheckAsyncMethodInfo
ResolveSubprocessMethod "waitCheckFinish" o = SubprocessWaitCheckFinishMethodInfo
ResolveSubprocessMethod "waitFinish" o = SubprocessWaitFinishMethodInfo
ResolveSubprocessMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSubprocessMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSubprocessMethod "getExitStatus" o = SubprocessGetExitStatusMethodInfo
ResolveSubprocessMethod "getIdentifier" o = SubprocessGetIdentifierMethodInfo
ResolveSubprocessMethod "getIfExited" o = SubprocessGetIfExitedMethodInfo
ResolveSubprocessMethod "getIfSignaled" o = SubprocessGetIfSignaledMethodInfo
ResolveSubprocessMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSubprocessMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSubprocessMethod "getStatus" o = SubprocessGetStatusMethodInfo
ResolveSubprocessMethod "getStderrPipe" o = SubprocessGetStderrPipeMethodInfo
ResolveSubprocessMethod "getStdinPipe" o = SubprocessGetStdinPipeMethodInfo
ResolveSubprocessMethod "getStdoutPipe" o = SubprocessGetStdoutPipeMethodInfo
ResolveSubprocessMethod "getSuccessful" o = SubprocessGetSuccessfulMethodInfo
ResolveSubprocessMethod "getTermSig" o = SubprocessGetTermSigMethodInfo
ResolveSubprocessMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSubprocessMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveSubprocessMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSubprocessMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSubprocessMethod t Subprocess, O.OverloadedMethod info Subprocess p) => OL.IsLabel t (Subprocess -> 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 ~ ResolveSubprocessMethod t Subprocess, O.OverloadedMethod info Subprocess p, R.HasField t Subprocess p) => R.HasField t Subprocess p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveSubprocessMethod t Subprocess, O.OverloadedMethodInfo info Subprocess) => OL.IsLabel t (O.MethodProxy info Subprocess) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
constructSubprocessArgv :: (IsSubprocess o, MIO.MonadIO m) => [T.Text] -> m (GValueConstruct o)
constructSubprocessArgv :: forall o (m :: * -> *).
(IsSubprocess o, MonadIO m) =>
[Text] -> m (GValueConstruct o)
constructSubprocessArgv [Text]
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 [Text] -> IO (GValueConstruct o)
forall o. String -> Maybe [Text] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyStringArray String
"argv" ([Text] -> Maybe [Text]
forall a. a -> Maybe a
P.Just [Text]
val)
#if defined(ENABLE_OVERLOADING)
data SubprocessArgvPropertyInfo
instance AttrInfo SubprocessArgvPropertyInfo where
type AttrAllowedOps SubprocessArgvPropertyInfo = '[ 'AttrConstruct, 'AttrClear]
type AttrBaseTypeConstraint SubprocessArgvPropertyInfo = IsSubprocess
type AttrSetTypeConstraint SubprocessArgvPropertyInfo = (~) [T.Text]
type AttrTransferTypeConstraint SubprocessArgvPropertyInfo = (~) [T.Text]
type AttrTransferType SubprocessArgvPropertyInfo = [T.Text]
type AttrGetType SubprocessArgvPropertyInfo = ()
type AttrLabel SubprocessArgvPropertyInfo = "argv"
type AttrOrigin SubprocessArgvPropertyInfo = Subprocess
attrGet = undefined
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructSubprocessArgv
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.argv"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#g:attr:argv"
})
#endif
constructSubprocessFlags :: (IsSubprocess o, MIO.MonadIO m) => [Gio.Flags.SubprocessFlags] -> m (GValueConstruct o)
constructSubprocessFlags :: forall o (m :: * -> *).
(IsSubprocess o, MonadIO m) =>
[SubprocessFlags] -> m (GValueConstruct o)
constructSubprocessFlags [SubprocessFlags]
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 -> [SubprocessFlags] -> IO (GValueConstruct o)
forall a o.
(IsGFlag a, BoxedFlags a) =>
String -> [a] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyFlags String
"flags" [SubprocessFlags]
val
#if defined(ENABLE_OVERLOADING)
data SubprocessFlagsPropertyInfo
instance AttrInfo SubprocessFlagsPropertyInfo where
type AttrAllowedOps SubprocessFlagsPropertyInfo = '[ 'AttrConstruct]
type AttrBaseTypeConstraint SubprocessFlagsPropertyInfo = IsSubprocess
type AttrSetTypeConstraint SubprocessFlagsPropertyInfo = (~) [Gio.Flags.SubprocessFlags]
type AttrTransferTypeConstraint SubprocessFlagsPropertyInfo = (~) [Gio.Flags.SubprocessFlags]
type AttrTransferType SubprocessFlagsPropertyInfo = [Gio.Flags.SubprocessFlags]
type AttrGetType SubprocessFlagsPropertyInfo = ()
type AttrLabel SubprocessFlagsPropertyInfo = "flags"
type AttrOrigin SubprocessFlagsPropertyInfo = Subprocess
attrGet = undefined
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructSubprocessFlags
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.flags"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#g:attr:flags"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Subprocess
type instance O.AttributeList Subprocess = SubprocessAttributeList
type SubprocessAttributeList = ('[ '("argv", SubprocessArgvPropertyInfo), '("flags", SubprocessFlagsPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
subprocessArgv :: AttrLabelProxy "argv"
subprocessArgv = AttrLabelProxy
subprocessFlags :: AttrLabelProxy "flags"
subprocessFlags = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Subprocess = SubprocessSignalList
type SubprocessSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "g_subprocess_newv" g_subprocess_newv ::
Ptr CString ->
CUInt ->
Ptr (Ptr GError) ->
IO (Ptr Subprocess)
subprocessNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
[[Char]]
-> [Gio.Flags.SubprocessFlags]
-> m Subprocess
subprocessNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
[String] -> [SubprocessFlags] -> m Subprocess
subprocessNew [String]
argv [SubprocessFlags]
flags = IO Subprocess -> m Subprocess
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Subprocess -> m Subprocess) -> IO Subprocess -> m Subprocess
forall a b. (a -> b) -> a -> b
$ do
argv' <- [String] -> IO (Ptr CString)
packZeroTerminatedFileNameArray [String]
argv
let flags' = [SubprocessFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [SubprocessFlags]
flags
onException (do
result <- propagateGError $ g_subprocess_newv argv' flags'
checkUnexpectedReturnNULL "subprocessNew" result
result' <- (wrapObject Subprocess) result
mapZeroTerminatedCArray freeMem argv'
freeMem argv'
return result'
) (do
mapZeroTerminatedCArray freeMem argv'
freeMem argv'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_subprocess_communicate" g_subprocess_communicate ::
Ptr Subprocess ->
Ptr GLib.Bytes.Bytes ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GLib.Bytes.Bytes) ->
Ptr (Ptr GLib.Bytes.Bytes) ->
Ptr (Ptr GError) ->
IO CInt
subprocessCommunicate ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (GLib.Bytes.Bytes)
-> Maybe (b)
-> m ((Maybe GLib.Bytes.Bytes, Maybe GLib.Bytes.Bytes))
subprocessCommunicate :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSubprocess a, IsCancellable b) =>
a -> Maybe Bytes -> Maybe b -> m (Maybe Bytes, Maybe Bytes)
subprocessCommunicate a
subprocess Maybe Bytes
stdinBuf Maybe b
cancellable = IO (Maybe Bytes, Maybe Bytes) -> m (Maybe Bytes, Maybe Bytes)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Bytes, Maybe Bytes) -> m (Maybe Bytes, Maybe Bytes))
-> IO (Maybe Bytes, Maybe Bytes) -> m (Maybe Bytes, Maybe Bytes)
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
maybeStdinBuf <- case stdinBuf of
Maybe Bytes
Nothing -> Ptr Bytes -> IO (Ptr Bytes)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Bytes
forall a. Ptr a
FP.nullPtr
Just Bytes
jStdinBuf -> do
jStdinBuf' <- Bytes -> IO (Ptr Bytes)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bytes
jStdinBuf
return jStdinBuf'
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'
stdoutBuf <- callocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
stderrBuf <- callocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
onException (do
_ <- propagateGError $ g_subprocess_communicate subprocess' maybeStdinBuf maybeCancellable stdoutBuf stderrBuf
stdoutBuf' <- peek stdoutBuf
maybeStdoutBuf' <- convertIfNonNull stdoutBuf' $ \Ptr Bytes
stdoutBuf'' -> do
stdoutBuf''' <- ((ManagedPtr Bytes -> Bytes) -> Ptr Bytes -> IO Bytes
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Bytes -> Bytes
GLib.Bytes.Bytes) Ptr Bytes
stdoutBuf''
return stdoutBuf'''
stderrBuf' <- peek stderrBuf
maybeStderrBuf' <- convertIfNonNull stderrBuf' $ \Ptr Bytes
stderrBuf'' -> do
stderrBuf''' <- ((ManagedPtr Bytes -> Bytes) -> Ptr Bytes -> IO Bytes
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Bytes -> Bytes
GLib.Bytes.Bytes) Ptr Bytes
stderrBuf''
return stderrBuf'''
touchManagedPtr subprocess
whenJust stdinBuf touchManagedPtr
whenJust cancellable touchManagedPtr
freeMem stdoutBuf
freeMem stderrBuf
return (maybeStdoutBuf', maybeStderrBuf')
) (do
freeMem stdoutBuf
freeMem stderrBuf
)
#if defined(ENABLE_OVERLOADING)
data SubprocessCommunicateMethodInfo
instance (signature ~ (Maybe (GLib.Bytes.Bytes) -> Maybe (b) -> m ((Maybe GLib.Bytes.Bytes, Maybe GLib.Bytes.Bytes))), MonadIO m, IsSubprocess a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod SubprocessCommunicateMethodInfo a signature where
overloadedMethod = subprocessCommunicate
instance O.OverloadedMethodInfo SubprocessCommunicateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessCommunicate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessCommunicate"
})
#endif
foreign import ccall "g_subprocess_communicate_async" g_subprocess_communicate_async ::
Ptr Subprocess ->
Ptr GLib.Bytes.Bytes ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
subprocessCommunicateAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (GLib.Bytes.Bytes)
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
subprocessCommunicateAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSubprocess a, IsCancellable b) =>
a -> Maybe Bytes -> Maybe b -> Maybe AsyncReadyCallback -> m ()
subprocessCommunicateAsync a
subprocess Maybe Bytes
stdinBuf Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
maybeStdinBuf <- case stdinBuf of
Maybe Bytes
Nothing -> Ptr Bytes -> IO (Ptr Bytes)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Bytes
forall a. Ptr a
FP.nullPtr
Just Bytes
jStdinBuf -> do
jStdinBuf' <- Bytes -> IO (Ptr Bytes)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bytes
jStdinBuf
return jStdinBuf'
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_subprocess_communicate_async subprocess' maybeStdinBuf maybeCancellable maybeCallback userData
touchManagedPtr subprocess
whenJust stdinBuf touchManagedPtr
whenJust cancellable touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data SubprocessCommunicateAsyncMethodInfo
instance (signature ~ (Maybe (GLib.Bytes.Bytes) -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSubprocess a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod SubprocessCommunicateAsyncMethodInfo a signature where
overloadedMethod = subprocessCommunicateAsync
instance O.OverloadedMethodInfo SubprocessCommunicateAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessCommunicateAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessCommunicateAsync"
})
#endif
foreign import ccall "g_subprocess_communicate_finish" g_subprocess_communicate_finish ::
Ptr Subprocess ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GLib.Bytes.Bytes) ->
Ptr (Ptr GLib.Bytes.Bytes) ->
Ptr (Ptr GError) ->
IO CInt
subprocessCommunicateFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ((Maybe GLib.Bytes.Bytes, Maybe GLib.Bytes.Bytes))
subprocessCommunicateFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSubprocess a, IsAsyncResult b) =>
a -> b -> m (Maybe Bytes, Maybe Bytes)
subprocessCommunicateFinish a
subprocess b
result_ = IO (Maybe Bytes, Maybe Bytes) -> m (Maybe Bytes, Maybe Bytes)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Bytes, Maybe Bytes) -> m (Maybe Bytes, Maybe Bytes))
-> IO (Maybe Bytes, Maybe Bytes) -> m (Maybe Bytes, Maybe Bytes)
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
result_' <- unsafeManagedPtrCastPtr result_
stdoutBuf <- callocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
stderrBuf <- callocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
onException (do
_ <- propagateGError $ g_subprocess_communicate_finish subprocess' result_' stdoutBuf stderrBuf
stdoutBuf' <- peek stdoutBuf
maybeStdoutBuf' <- convertIfNonNull stdoutBuf' $ \Ptr Bytes
stdoutBuf'' -> do
stdoutBuf''' <- ((ManagedPtr Bytes -> Bytes) -> Ptr Bytes -> IO Bytes
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Bytes -> Bytes
GLib.Bytes.Bytes) Ptr Bytes
stdoutBuf''
return stdoutBuf'''
stderrBuf' <- peek stderrBuf
maybeStderrBuf' <- convertIfNonNull stderrBuf' $ \Ptr Bytes
stderrBuf'' -> do
stderrBuf''' <- ((ManagedPtr Bytes -> Bytes) -> Ptr Bytes -> IO Bytes
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Bytes -> Bytes
GLib.Bytes.Bytes) Ptr Bytes
stderrBuf''
return stderrBuf'''
touchManagedPtr subprocess
touchManagedPtr result_
freeMem stdoutBuf
freeMem stderrBuf
return (maybeStdoutBuf', maybeStderrBuf')
) (do
freeMem stdoutBuf
freeMem stderrBuf
)
#if defined(ENABLE_OVERLOADING)
data SubprocessCommunicateFinishMethodInfo
instance (signature ~ (b -> m ((Maybe GLib.Bytes.Bytes, Maybe GLib.Bytes.Bytes))), MonadIO m, IsSubprocess a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod SubprocessCommunicateFinishMethodInfo a signature where
overloadedMethod = subprocessCommunicateFinish
instance O.OverloadedMethodInfo SubprocessCommunicateFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessCommunicateFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessCommunicateFinish"
})
#endif
foreign import ccall "g_subprocess_communicate_utf8" g_subprocess_communicate_utf8 ::
Ptr Subprocess ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr CString ->
Ptr CString ->
Ptr (Ptr GError) ->
IO CInt
subprocessCommunicateUtf8 ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (T.Text)
-> Maybe (b)
-> m ((Maybe T.Text, Maybe T.Text))
subprocessCommunicateUtf8 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSubprocess a, IsCancellable b) =>
a -> Maybe Text -> Maybe b -> m (Maybe Text, Maybe Text)
subprocessCommunicateUtf8 a
subprocess Maybe Text
stdinBuf Maybe b
cancellable = IO (Maybe Text, Maybe Text) -> m (Maybe Text, Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text, Maybe Text) -> m (Maybe Text, Maybe Text))
-> IO (Maybe Text, Maybe Text) -> m (Maybe Text, Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
maybeStdinBuf <- case stdinBuf of
Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
Just Text
jStdinBuf -> do
jStdinBuf' <- Text -> IO CString
textToCString Text
jStdinBuf
return jStdinBuf'
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'
stdoutBuf <- callocMem :: IO (Ptr CString)
stderrBuf <- callocMem :: IO (Ptr CString)
onException (do
_ <- propagateGError $ g_subprocess_communicate_utf8 subprocess' maybeStdinBuf maybeCancellable stdoutBuf stderrBuf
stdoutBuf' <- peek stdoutBuf
maybeStdoutBuf' <- convertIfNonNull stdoutBuf' $ \CString
stdoutBuf'' -> do
stdoutBuf''' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
stdoutBuf''
return stdoutBuf'''
freeMem stdoutBuf'
stderrBuf' <- peek stderrBuf
maybeStderrBuf' <- convertIfNonNull stderrBuf' $ \CString
stderrBuf'' -> do
stderrBuf''' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
stderrBuf''
return stderrBuf'''
freeMem stderrBuf'
touchManagedPtr subprocess
whenJust cancellable touchManagedPtr
freeMem maybeStdinBuf
freeMem stdoutBuf
freeMem stderrBuf
return (maybeStdoutBuf', maybeStderrBuf')
) (do
freeMem maybeStdinBuf
freeMem stdoutBuf
freeMem stderrBuf
)
#if defined(ENABLE_OVERLOADING)
data SubprocessCommunicateUtf8MethodInfo
instance (signature ~ (Maybe (T.Text) -> Maybe (b) -> m ((Maybe T.Text, Maybe T.Text))), MonadIO m, IsSubprocess a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod SubprocessCommunicateUtf8MethodInfo a signature where
overloadedMethod = subprocessCommunicateUtf8
instance O.OverloadedMethodInfo SubprocessCommunicateUtf8MethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessCommunicateUtf8",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessCommunicateUtf8"
})
#endif
foreign import ccall "g_subprocess_communicate_utf8_async" g_subprocess_communicate_utf8_async ::
Ptr Subprocess ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
subprocessCommunicateUtf8Async ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (T.Text)
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
subprocessCommunicateUtf8Async :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSubprocess a, IsCancellable b) =>
a -> Maybe Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
subprocessCommunicateUtf8Async a
subprocess Maybe Text
stdinBuf Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
maybeStdinBuf <- case stdinBuf of
Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
Just Text
jStdinBuf -> do
jStdinBuf' <- Text -> IO CString
textToCString Text
jStdinBuf
return jStdinBuf'
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_subprocess_communicate_utf8_async subprocess' maybeStdinBuf maybeCancellable maybeCallback userData
touchManagedPtr subprocess
whenJust cancellable touchManagedPtr
freeMem maybeStdinBuf
return ()
#if defined(ENABLE_OVERLOADING)
data SubprocessCommunicateUtf8AsyncMethodInfo
instance (signature ~ (Maybe (T.Text) -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSubprocess a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod SubprocessCommunicateUtf8AsyncMethodInfo a signature where
overloadedMethod = subprocessCommunicateUtf8Async
instance O.OverloadedMethodInfo SubprocessCommunicateUtf8AsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessCommunicateUtf8Async",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessCommunicateUtf8Async"
})
#endif
foreign import ccall "g_subprocess_communicate_utf8_finish" g_subprocess_communicate_utf8_finish ::
Ptr Subprocess ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr CString ->
Ptr CString ->
Ptr (Ptr GError) ->
IO CInt
subprocessCommunicateUtf8Finish ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ((Maybe T.Text, Maybe T.Text))
subprocessCommunicateUtf8Finish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSubprocess a, IsAsyncResult b) =>
a -> b -> m (Maybe Text, Maybe Text)
subprocessCommunicateUtf8Finish a
subprocess b
result_ = IO (Maybe Text, Maybe Text) -> m (Maybe Text, Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text, Maybe Text) -> m (Maybe Text, Maybe Text))
-> IO (Maybe Text, Maybe Text) -> m (Maybe Text, Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
result_' <- unsafeManagedPtrCastPtr result_
stdoutBuf <- callocMem :: IO (Ptr CString)
stderrBuf <- callocMem :: IO (Ptr CString)
onException (do
_ <- propagateGError $ g_subprocess_communicate_utf8_finish subprocess' result_' stdoutBuf stderrBuf
stdoutBuf' <- peek stdoutBuf
maybeStdoutBuf' <- convertIfNonNull stdoutBuf' $ \CString
stdoutBuf'' -> do
stdoutBuf''' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
stdoutBuf''
return stdoutBuf'''
freeMem stdoutBuf'
stderrBuf' <- peek stderrBuf
maybeStderrBuf' <- convertIfNonNull stderrBuf' $ \CString
stderrBuf'' -> do
stderrBuf''' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
stderrBuf''
return stderrBuf'''
freeMem stderrBuf'
touchManagedPtr subprocess
touchManagedPtr result_
freeMem stdoutBuf
freeMem stderrBuf
return (maybeStdoutBuf', maybeStderrBuf')
) (do
freeMem stdoutBuf
freeMem stderrBuf
)
#if defined(ENABLE_OVERLOADING)
data SubprocessCommunicateUtf8FinishMethodInfo
instance (signature ~ (b -> m ((Maybe T.Text, Maybe T.Text))), MonadIO m, IsSubprocess a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod SubprocessCommunicateUtf8FinishMethodInfo a signature where
overloadedMethod = subprocessCommunicateUtf8Finish
instance O.OverloadedMethodInfo SubprocessCommunicateUtf8FinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessCommunicateUtf8Finish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessCommunicateUtf8Finish"
})
#endif
foreign import ccall "g_subprocess_force_exit" g_subprocess_force_exit ::
Ptr Subprocess ->
IO ()
subprocessForceExit ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a) =>
a
-> m ()
subprocessForceExit :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSubprocess a) =>
a -> m ()
subprocessForceExit a
subprocess = 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
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
g_subprocess_force_exit subprocess'
touchManagedPtr subprocess
return ()
#if defined(ENABLE_OVERLOADING)
data SubprocessForceExitMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSubprocess a) => O.OverloadedMethod SubprocessForceExitMethodInfo a signature where
overloadedMethod = subprocessForceExit
instance O.OverloadedMethodInfo SubprocessForceExitMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessForceExit",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessForceExit"
})
#endif
foreign import ccall "g_subprocess_get_exit_status" g_subprocess_get_exit_status ::
Ptr Subprocess ->
IO Int32
subprocessGetExitStatus ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a) =>
a
-> m Int32
subprocessGetExitStatus :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSubprocess a) =>
a -> m Int32
subprocessGetExitStatus a
subprocess = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
result <- g_subprocess_get_exit_status subprocess'
touchManagedPtr subprocess
return result
#if defined(ENABLE_OVERLOADING)
data SubprocessGetExitStatusMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsSubprocess a) => O.OverloadedMethod SubprocessGetExitStatusMethodInfo a signature where
overloadedMethod = subprocessGetExitStatus
instance O.OverloadedMethodInfo SubprocessGetExitStatusMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessGetExitStatus",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessGetExitStatus"
})
#endif
foreign import ccall "g_subprocess_get_identifier" g_subprocess_get_identifier ::
Ptr Subprocess ->
IO CString
subprocessGetIdentifier ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a) =>
a
-> m (Maybe T.Text)
subprocessGetIdentifier :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSubprocess a) =>
a -> m (Maybe Text)
subprocessGetIdentifier a
subprocess = 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
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
result <- g_subprocess_get_identifier subprocess'
maybeResult <- convertIfNonNull result $ \CString
result' -> do
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
return result''
touchManagedPtr subprocess
return maybeResult
#if defined(ENABLE_OVERLOADING)
data SubprocessGetIdentifierMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsSubprocess a) => O.OverloadedMethod SubprocessGetIdentifierMethodInfo a signature where
overloadedMethod = subprocessGetIdentifier
instance O.OverloadedMethodInfo SubprocessGetIdentifierMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessGetIdentifier",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessGetIdentifier"
})
#endif
foreign import ccall "g_subprocess_get_if_exited" g_subprocess_get_if_exited ::
Ptr Subprocess ->
IO CInt
subprocessGetIfExited ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a) =>
a
-> m Bool
subprocessGetIfExited :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSubprocess a) =>
a -> m Bool
subprocessGetIfExited a
subprocess = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
result <- g_subprocess_get_if_exited subprocess'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr subprocess
return result'
#if defined(ENABLE_OVERLOADING)
data SubprocessGetIfExitedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSubprocess a) => O.OverloadedMethod SubprocessGetIfExitedMethodInfo a signature where
overloadedMethod = subprocessGetIfExited
instance O.OverloadedMethodInfo SubprocessGetIfExitedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessGetIfExited",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessGetIfExited"
})
#endif
foreign import ccall "g_subprocess_get_if_signaled" g_subprocess_get_if_signaled ::
Ptr Subprocess ->
IO CInt
subprocessGetIfSignaled ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a) =>
a
-> m Bool
subprocessGetIfSignaled :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSubprocess a) =>
a -> m Bool
subprocessGetIfSignaled a
subprocess = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
result <- g_subprocess_get_if_signaled subprocess'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr subprocess
return result'
#if defined(ENABLE_OVERLOADING)
data SubprocessGetIfSignaledMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSubprocess a) => O.OverloadedMethod SubprocessGetIfSignaledMethodInfo a signature where
overloadedMethod = subprocessGetIfSignaled
instance O.OverloadedMethodInfo SubprocessGetIfSignaledMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessGetIfSignaled",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessGetIfSignaled"
})
#endif
foreign import ccall "g_subprocess_get_status" g_subprocess_get_status ::
Ptr Subprocess ->
IO Int32
subprocessGetStatus ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a) =>
a
-> m Int32
subprocessGetStatus :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSubprocess a) =>
a -> m Int32
subprocessGetStatus a
subprocess = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
result <- g_subprocess_get_status subprocess'
touchManagedPtr subprocess
return result
#if defined(ENABLE_OVERLOADING)
data SubprocessGetStatusMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsSubprocess a) => O.OverloadedMethod SubprocessGetStatusMethodInfo a signature where
overloadedMethod = subprocessGetStatus
instance O.OverloadedMethodInfo SubprocessGetStatusMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessGetStatus",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessGetStatus"
})
#endif
foreign import ccall "g_subprocess_get_stderr_pipe" g_subprocess_get_stderr_pipe ::
Ptr Subprocess ->
IO (Ptr Gio.InputStream.InputStream)
subprocessGetStderrPipe ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a) =>
a
-> m (Maybe Gio.InputStream.InputStream)
subprocessGetStderrPipe :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSubprocess a) =>
a -> m (Maybe InputStream)
subprocessGetStderrPipe a
subprocess = IO (Maybe InputStream) -> m (Maybe InputStream)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe InputStream) -> m (Maybe InputStream))
-> IO (Maybe InputStream) -> m (Maybe InputStream)
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
result <- g_subprocess_get_stderr_pipe subprocess'
maybeResult <- convertIfNonNull result $ \Ptr InputStream
result' -> do
result'' <- ((ManagedPtr InputStream -> InputStream)
-> Ptr InputStream -> IO InputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr InputStream -> InputStream
Gio.InputStream.InputStream) Ptr InputStream
result'
return result''
touchManagedPtr subprocess
return maybeResult
#if defined(ENABLE_OVERLOADING)
data SubprocessGetStderrPipeMethodInfo
instance (signature ~ (m (Maybe Gio.InputStream.InputStream)), MonadIO m, IsSubprocess a) => O.OverloadedMethod SubprocessGetStderrPipeMethodInfo a signature where
overloadedMethod = subprocessGetStderrPipe
instance O.OverloadedMethodInfo SubprocessGetStderrPipeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessGetStderrPipe",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessGetStderrPipe"
})
#endif
foreign import ccall "g_subprocess_get_stdin_pipe" g_subprocess_get_stdin_pipe ::
Ptr Subprocess ->
IO (Ptr Gio.OutputStream.OutputStream)
subprocessGetStdinPipe ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a) =>
a
-> m (Maybe Gio.OutputStream.OutputStream)
subprocessGetStdinPipe :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSubprocess a) =>
a -> m (Maybe OutputStream)
subprocessGetStdinPipe a
subprocess = IO (Maybe OutputStream) -> m (Maybe OutputStream)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe OutputStream) -> m (Maybe OutputStream))
-> IO (Maybe OutputStream) -> m (Maybe OutputStream)
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
result <- g_subprocess_get_stdin_pipe subprocess'
maybeResult <- convertIfNonNull result $ \Ptr OutputStream
result' -> do
result'' <- ((ManagedPtr OutputStream -> OutputStream)
-> Ptr OutputStream -> IO OutputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr OutputStream -> OutputStream
Gio.OutputStream.OutputStream) Ptr OutputStream
result'
return result''
touchManagedPtr subprocess
return maybeResult
#if defined(ENABLE_OVERLOADING)
data SubprocessGetStdinPipeMethodInfo
instance (signature ~ (m (Maybe Gio.OutputStream.OutputStream)), MonadIO m, IsSubprocess a) => O.OverloadedMethod SubprocessGetStdinPipeMethodInfo a signature where
overloadedMethod = subprocessGetStdinPipe
instance O.OverloadedMethodInfo SubprocessGetStdinPipeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessGetStdinPipe",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessGetStdinPipe"
})
#endif
foreign import ccall "g_subprocess_get_stdout_pipe" g_subprocess_get_stdout_pipe ::
Ptr Subprocess ->
IO (Ptr Gio.InputStream.InputStream)
subprocessGetStdoutPipe ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a) =>
a
-> m (Maybe Gio.InputStream.InputStream)
subprocessGetStdoutPipe :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSubprocess a) =>
a -> m (Maybe InputStream)
subprocessGetStdoutPipe a
subprocess = IO (Maybe InputStream) -> m (Maybe InputStream)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe InputStream) -> m (Maybe InputStream))
-> IO (Maybe InputStream) -> m (Maybe InputStream)
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
result <- g_subprocess_get_stdout_pipe subprocess'
maybeResult <- convertIfNonNull result $ \Ptr InputStream
result' -> do
result'' <- ((ManagedPtr InputStream -> InputStream)
-> Ptr InputStream -> IO InputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr InputStream -> InputStream
Gio.InputStream.InputStream) Ptr InputStream
result'
return result''
touchManagedPtr subprocess
return maybeResult
#if defined(ENABLE_OVERLOADING)
data SubprocessGetStdoutPipeMethodInfo
instance (signature ~ (m (Maybe Gio.InputStream.InputStream)), MonadIO m, IsSubprocess a) => O.OverloadedMethod SubprocessGetStdoutPipeMethodInfo a signature where
overloadedMethod = subprocessGetStdoutPipe
instance O.OverloadedMethodInfo SubprocessGetStdoutPipeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessGetStdoutPipe",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessGetStdoutPipe"
})
#endif
foreign import ccall "g_subprocess_get_successful" g_subprocess_get_successful ::
Ptr Subprocess ->
IO CInt
subprocessGetSuccessful ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a) =>
a
-> m Bool
subprocessGetSuccessful :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSubprocess a) =>
a -> m Bool
subprocessGetSuccessful a
subprocess = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
result <- g_subprocess_get_successful subprocess'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr subprocess
return result'
#if defined(ENABLE_OVERLOADING)
data SubprocessGetSuccessfulMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSubprocess a) => O.OverloadedMethod SubprocessGetSuccessfulMethodInfo a signature where
overloadedMethod = subprocessGetSuccessful
instance O.OverloadedMethodInfo SubprocessGetSuccessfulMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessGetSuccessful",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessGetSuccessful"
})
#endif
foreign import ccall "g_subprocess_get_term_sig" g_subprocess_get_term_sig ::
Ptr Subprocess ->
IO Int32
subprocessGetTermSig ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a) =>
a
-> m Int32
subprocessGetTermSig :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSubprocess a) =>
a -> m Int32
subprocessGetTermSig a
subprocess = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
result <- g_subprocess_get_term_sig subprocess'
touchManagedPtr subprocess
return result
#if defined(ENABLE_OVERLOADING)
data SubprocessGetTermSigMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsSubprocess a) => O.OverloadedMethod SubprocessGetTermSigMethodInfo a signature where
overloadedMethod = subprocessGetTermSig
instance O.OverloadedMethodInfo SubprocessGetTermSigMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessGetTermSig",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessGetTermSig"
})
#endif
foreign import ccall "g_subprocess_send_signal" g_subprocess_send_signal ::
Ptr Subprocess ->
Int32 ->
IO ()
subprocessSendSignal ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a) =>
a
-> Int32
-> m ()
subprocessSendSignal :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSubprocess a) =>
a -> Int32 -> m ()
subprocessSendSignal a
subprocess Int32
signalNum = 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
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
g_subprocess_send_signal subprocess' signalNum
touchManagedPtr subprocess
return ()
#if defined(ENABLE_OVERLOADING)
data SubprocessSendSignalMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsSubprocess a) => O.OverloadedMethod SubprocessSendSignalMethodInfo a signature where
overloadedMethod = subprocessSendSignal
instance O.OverloadedMethodInfo SubprocessSendSignalMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessSendSignal",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessSendSignal"
})
#endif
foreign import ccall "g_subprocess_wait" g_subprocess_wait ::
Ptr Subprocess ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
subprocessWait ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m ()
subprocessWait :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSubprocess a, IsCancellable b) =>
a -> Maybe b -> m ()
subprocessWait a
subprocess Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
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 $ g_subprocess_wait subprocess' maybeCancellable
touchManagedPtr subprocess
whenJust cancellable touchManagedPtr
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data SubprocessWaitMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsSubprocess a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod SubprocessWaitMethodInfo a signature where
overloadedMethod = subprocessWait
instance O.OverloadedMethodInfo SubprocessWaitMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessWait",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessWait"
})
#endif
foreign import ccall "g_subprocess_wait_async" g_subprocess_wait_async ::
Ptr Subprocess ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
subprocessWaitAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
subprocessWaitAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSubprocess a, IsCancellable b) =>
a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
subprocessWaitAsync a
subprocess Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_subprocess_wait_async subprocess' maybeCancellable maybeCallback userData
touchManagedPtr subprocess
whenJust cancellable touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data SubprocessWaitAsyncMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSubprocess a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod SubprocessWaitAsyncMethodInfo a signature where
overloadedMethod = subprocessWaitAsync
instance O.OverloadedMethodInfo SubprocessWaitAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessWaitAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessWaitAsync"
})
#endif
foreign import ccall "g_subprocess_wait_check" g_subprocess_wait_check ::
Ptr Subprocess ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
subprocessWaitCheck ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m ()
subprocessWaitCheck :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSubprocess a, IsCancellable b) =>
a -> Maybe b -> m ()
subprocessWaitCheck a
subprocess Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
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 $ g_subprocess_wait_check subprocess' maybeCancellable
touchManagedPtr subprocess
whenJust cancellable touchManagedPtr
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data SubprocessWaitCheckMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsSubprocess a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod SubprocessWaitCheckMethodInfo a signature where
overloadedMethod = subprocessWaitCheck
instance O.OverloadedMethodInfo SubprocessWaitCheckMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessWaitCheck",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessWaitCheck"
})
#endif
foreign import ccall "g_subprocess_wait_check_async" g_subprocess_wait_check_async ::
Ptr Subprocess ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
subprocessWaitCheckAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
subprocessWaitCheckAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSubprocess a, IsCancellable b) =>
a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
subprocessWaitCheckAsync a
subprocess Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_subprocess_wait_check_async subprocess' maybeCancellable maybeCallback userData
touchManagedPtr subprocess
whenJust cancellable touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data SubprocessWaitCheckAsyncMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSubprocess a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod SubprocessWaitCheckAsyncMethodInfo a signature where
overloadedMethod = subprocessWaitCheckAsync
instance O.OverloadedMethodInfo SubprocessWaitCheckAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessWaitCheckAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessWaitCheckAsync"
})
#endif
foreign import ccall "g_subprocess_wait_check_finish" g_subprocess_wait_check_finish ::
Ptr Subprocess ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
subprocessWaitCheckFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
subprocessWaitCheckFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSubprocess a, IsAsyncResult b) =>
a -> b -> m ()
subprocessWaitCheckFinish a
subprocess b
result_ = 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
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ g_subprocess_wait_check_finish subprocess' result_'
touchManagedPtr subprocess
touchManagedPtr result_
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data SubprocessWaitCheckFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsSubprocess a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod SubprocessWaitCheckFinishMethodInfo a signature where
overloadedMethod = subprocessWaitCheckFinish
instance O.OverloadedMethodInfo SubprocessWaitCheckFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessWaitCheckFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessWaitCheckFinish"
})
#endif
foreign import ccall "g_subprocess_wait_finish" g_subprocess_wait_finish ::
Ptr Subprocess ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
subprocessWaitFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsSubprocess a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
subprocessWaitFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSubprocess a, IsAsyncResult b) =>
a -> b -> m ()
subprocessWaitFinish a
subprocess b
result_ = 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
subprocess' <- a -> IO (Ptr Subprocess)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
subprocess
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ g_subprocess_wait_finish subprocess' result_'
touchManagedPtr subprocess
touchManagedPtr result_
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data SubprocessWaitFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsSubprocess a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod SubprocessWaitFinishMethodInfo a signature where
overloadedMethod = subprocessWaitFinish
instance O.OverloadedMethodInfo SubprocessWaitFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.Subprocess.subprocessWaitFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-Subprocess.html#v:subprocessWaitFinish"
})
#endif