{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Interfaces.PollableInputStream
(
PollableInputStream(..) ,
IsPollableInputStream ,
toPollableInputStream ,
#if defined(ENABLE_OVERLOADING)
ResolvePollableInputStreamMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
PollableInputStreamCanPollMethodInfo ,
#endif
pollableInputStreamCanPoll ,
#if defined(ENABLE_OVERLOADING)
PollableInputStreamCreateSourceMethodInfo,
#endif
pollableInputStreamCreateSource ,
#if defined(ENABLE_OVERLOADING)
PollableInputStreamIsReadableMethodInfo ,
#endif
pollableInputStreamIsReadable ,
#if defined(ENABLE_OVERLOADING)
PollableInputStreamReadNonblockingMethodInfo,
#endif
pollableInputStreamReadNonblocking ,
) 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.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.InputStream as Gio.InputStream
#else
import qualified GI.GLib.Structs.Source as GLib.Source
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.InputStream as Gio.InputStream
#endif
newtype PollableInputStream = PollableInputStream (SP.ManagedPtr PollableInputStream)
deriving (PollableInputStream -> PollableInputStream -> Bool
(PollableInputStream -> PollableInputStream -> Bool)
-> (PollableInputStream -> PollableInputStream -> Bool)
-> Eq PollableInputStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PollableInputStream -> PollableInputStream -> Bool
== :: PollableInputStream -> PollableInputStream -> Bool
$c/= :: PollableInputStream -> PollableInputStream -> Bool
/= :: PollableInputStream -> PollableInputStream -> Bool
Eq)
instance SP.ManagedPtrNewtype PollableInputStream where
toManagedPtr :: PollableInputStream -> ManagedPtr PollableInputStream
toManagedPtr (PollableInputStream ManagedPtr PollableInputStream
p) = ManagedPtr PollableInputStream
p
foreign import ccall "g_pollable_input_stream_get_type"
c_g_pollable_input_stream_get_type :: IO B.Types.GType
instance B.Types.TypedObject PollableInputStream where
glibType :: IO GType
glibType = IO GType
c_g_pollable_input_stream_get_type
instance B.Types.GObject PollableInputStream
class (SP.GObject o, O.IsDescendantOf PollableInputStream o) => IsPollableInputStream o
instance (SP.GObject o, O.IsDescendantOf PollableInputStream o) => IsPollableInputStream o
instance O.HasParentTypes PollableInputStream
type instance O.ParentTypes PollableInputStream = '[Gio.InputStream.InputStream, GObject.Object.Object]
toPollableInputStream :: (MIO.MonadIO m, IsPollableInputStream o) => o -> m PollableInputStream
toPollableInputStream :: forall (m :: * -> *) o.
(MonadIO m, IsPollableInputStream o) =>
o -> m PollableInputStream
toPollableInputStream = IO PollableInputStream -> m PollableInputStream
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO PollableInputStream -> m PollableInputStream)
-> (o -> IO PollableInputStream) -> o -> m PollableInputStream
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr PollableInputStream -> PollableInputStream)
-> o -> IO PollableInputStream
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr PollableInputStream -> PollableInputStream
PollableInputStream
instance B.GValue.IsGValue (Maybe PollableInputStream) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_pollable_input_stream_get_type
gvalueSet_ :: Ptr GValue -> Maybe PollableInputStream -> IO ()
gvalueSet_ Ptr GValue
gv Maybe PollableInputStream
P.Nothing = Ptr GValue -> Ptr PollableInputStream -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr PollableInputStream
forall a. Ptr a
FP.nullPtr :: FP.Ptr PollableInputStream)
gvalueSet_ Ptr GValue
gv (P.Just PollableInputStream
obj) = PollableInputStream -> (Ptr PollableInputStream -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr PollableInputStream
obj (Ptr GValue -> Ptr PollableInputStream -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe PollableInputStream)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr PollableInputStream)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr PollableInputStream)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject PollableInputStream ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList PollableInputStream
type instance O.AttributeList PollableInputStream = PollableInputStreamAttributeList
type PollableInputStreamAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolvePollableInputStreamMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolvePollableInputStreamMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolvePollableInputStreamMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolvePollableInputStreamMethod "canPoll" o = PollableInputStreamCanPollMethodInfo
ResolvePollableInputStreamMethod "clearPending" o = Gio.InputStream.InputStreamClearPendingMethodInfo
ResolvePollableInputStreamMethod "close" o = Gio.InputStream.InputStreamCloseMethodInfo
ResolvePollableInputStreamMethod "closeAsync" o = Gio.InputStream.InputStreamCloseAsyncMethodInfo
ResolvePollableInputStreamMethod "closeFinish" o = Gio.InputStream.InputStreamCloseFinishMethodInfo
ResolvePollableInputStreamMethod "createSource" o = PollableInputStreamCreateSourceMethodInfo
ResolvePollableInputStreamMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolvePollableInputStreamMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolvePollableInputStreamMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolvePollableInputStreamMethod "hasPending" o = Gio.InputStream.InputStreamHasPendingMethodInfo
ResolvePollableInputStreamMethod "isClosed" o = Gio.InputStream.InputStreamIsClosedMethodInfo
ResolvePollableInputStreamMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolvePollableInputStreamMethod "isReadable" o = PollableInputStreamIsReadableMethodInfo
ResolvePollableInputStreamMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolvePollableInputStreamMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolvePollableInputStreamMethod "read" o = Gio.InputStream.InputStreamReadMethodInfo
ResolvePollableInputStreamMethod "readAll" o = Gio.InputStream.InputStreamReadAllMethodInfo
ResolvePollableInputStreamMethod "readAllAsync" o = Gio.InputStream.InputStreamReadAllAsyncMethodInfo
ResolvePollableInputStreamMethod "readAllFinish" o = Gio.InputStream.InputStreamReadAllFinishMethodInfo
ResolvePollableInputStreamMethod "readAsync" o = Gio.InputStream.InputStreamReadAsyncMethodInfo
ResolvePollableInputStreamMethod "readBytes" o = Gio.InputStream.InputStreamReadBytesMethodInfo
ResolvePollableInputStreamMethod "readBytesAsync" o = Gio.InputStream.InputStreamReadBytesAsyncMethodInfo
ResolvePollableInputStreamMethod "readBytesFinish" o = Gio.InputStream.InputStreamReadBytesFinishMethodInfo
ResolvePollableInputStreamMethod "readFinish" o = Gio.InputStream.InputStreamReadFinishMethodInfo
ResolvePollableInputStreamMethod "readNonblocking" o = PollableInputStreamReadNonblockingMethodInfo
ResolvePollableInputStreamMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolvePollableInputStreamMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolvePollableInputStreamMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolvePollableInputStreamMethod "skip" o = Gio.InputStream.InputStreamSkipMethodInfo
ResolvePollableInputStreamMethod "skipAsync" o = Gio.InputStream.InputStreamSkipAsyncMethodInfo
ResolvePollableInputStreamMethod "skipFinish" o = Gio.InputStream.InputStreamSkipFinishMethodInfo
ResolvePollableInputStreamMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolvePollableInputStreamMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolvePollableInputStreamMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolvePollableInputStreamMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolvePollableInputStreamMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolvePollableInputStreamMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolvePollableInputStreamMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolvePollableInputStreamMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolvePollableInputStreamMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolvePollableInputStreamMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolvePollableInputStreamMethod "setPending" o = Gio.InputStream.InputStreamSetPendingMethodInfo
ResolvePollableInputStreamMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolvePollableInputStreamMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolvePollableInputStreamMethod t PollableInputStream, O.OverloadedMethod info PollableInputStream p) => OL.IsLabel t (PollableInputStream -> 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 ~ ResolvePollableInputStreamMethod t PollableInputStream, O.OverloadedMethod info PollableInputStream p, R.HasField t PollableInputStream p) => R.HasField t PollableInputStream p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolvePollableInputStreamMethod t PollableInputStream, O.OverloadedMethodInfo info PollableInputStream) => OL.IsLabel t (O.MethodProxy info PollableInputStream) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
foreign import ccall "g_pollable_input_stream_can_poll" g_pollable_input_stream_can_poll ::
Ptr PollableInputStream ->
IO CInt
pollableInputStreamCanPoll ::
(B.CallStack.HasCallStack, MonadIO m, IsPollableInputStream a) =>
a
-> m Bool
pollableInputStreamCanPoll :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPollableInputStream a) =>
a -> m Bool
pollableInputStreamCanPoll a
stream = 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
stream' <- a -> IO (Ptr PollableInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
result <- g_pollable_input_stream_can_poll stream'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr stream
return result'
#if defined(ENABLE_OVERLOADING)
data PollableInputStreamCanPollMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsPollableInputStream a) => O.OverloadedMethod PollableInputStreamCanPollMethodInfo a signature where
overloadedMethod = pollableInputStreamCanPoll
instance O.OverloadedMethodInfo PollableInputStreamCanPollMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.PollableInputStream.pollableInputStreamCanPoll",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-PollableInputStream.html#v:pollableInputStreamCanPoll"
})
#endif
foreign import ccall "g_pollable_input_stream_create_source" g_pollable_input_stream_create_source ::
Ptr PollableInputStream ->
Ptr Gio.Cancellable.Cancellable ->
IO (Ptr GLib.Source.Source)
pollableInputStreamCreateSource ::
(B.CallStack.HasCallStack, MonadIO m, IsPollableInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m GLib.Source.Source
pollableInputStreamCreateSource :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsPollableInputStream a,
IsCancellable b) =>
a -> Maybe b -> m Source
pollableInputStreamCreateSource a
stream Maybe b
cancellable = IO Source -> m Source
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Source -> m Source) -> IO Source -> m Source
forall a b. (a -> b) -> a -> b
$ do
stream' <- a -> IO (Ptr PollableInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
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'
result <- g_pollable_input_stream_create_source stream' maybeCancellable
checkUnexpectedReturnNULL "pollableInputStreamCreateSource" result
result' <- (wrapBoxed GLib.Source.Source) result
touchManagedPtr stream
whenJust cancellable touchManagedPtr
return result'
#if defined(ENABLE_OVERLOADING)
data PollableInputStreamCreateSourceMethodInfo
instance (signature ~ (Maybe (b) -> m GLib.Source.Source), MonadIO m, IsPollableInputStream a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod PollableInputStreamCreateSourceMethodInfo a signature where
overloadedMethod = pollableInputStreamCreateSource
instance O.OverloadedMethodInfo PollableInputStreamCreateSourceMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.PollableInputStream.pollableInputStreamCreateSource",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-PollableInputStream.html#v:pollableInputStreamCreateSource"
})
#endif
foreign import ccall "g_pollable_input_stream_is_readable" g_pollable_input_stream_is_readable ::
Ptr PollableInputStream ->
IO CInt
pollableInputStreamIsReadable ::
(B.CallStack.HasCallStack, MonadIO m, IsPollableInputStream a) =>
a
-> m Bool
pollableInputStreamIsReadable :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPollableInputStream a) =>
a -> m Bool
pollableInputStreamIsReadable a
stream = 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
stream' <- a -> IO (Ptr PollableInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
result <- g_pollable_input_stream_is_readable stream'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr stream
return result'
#if defined(ENABLE_OVERLOADING)
data PollableInputStreamIsReadableMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsPollableInputStream a) => O.OverloadedMethod PollableInputStreamIsReadableMethodInfo a signature where
overloadedMethod = pollableInputStreamIsReadable
instance O.OverloadedMethodInfo PollableInputStreamIsReadableMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.PollableInputStream.pollableInputStreamIsReadable",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-PollableInputStream.html#v:pollableInputStreamIsReadable"
})
#endif
foreign import ccall "g_pollable_input_stream_read_nonblocking" g_pollable_input_stream_read_nonblocking ::
Ptr PollableInputStream ->
Ptr Word8 ->
FCT.CSize ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO DI.Int64
pollableInputStreamReadNonblocking ::
(B.CallStack.HasCallStack, MonadIO m, IsPollableInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (ByteString)
-> Maybe (b)
-> m ((DI.Int64, Maybe ByteString))
pollableInputStreamReadNonblocking :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsPollableInputStream a,
IsCancellable b) =>
a -> Maybe ByteString -> Maybe b -> m (Int64, Maybe ByteString)
pollableInputStreamReadNonblocking a
stream Maybe ByteString
buffer Maybe b
cancellable = IO (Int64, Maybe ByteString) -> m (Int64, Maybe ByteString)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int64, Maybe ByteString) -> m (Int64, Maybe ByteString))
-> IO (Int64, Maybe ByteString) -> m (Int64, Maybe ByteString)
forall a b. (a -> b) -> a -> b
$ do
let count :: CSize
count = case Maybe ByteString
buffer of
Maybe ByteString
Nothing -> CSize
0
Just ByteString
jBuffer -> Int -> CSize
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CSize) -> Int -> CSize
forall a b. (a -> b) -> a -> b
$ ByteString -> Int
B.length ByteString
jBuffer
stream' <- a -> IO (Ptr PollableInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
maybeBuffer <- case buffer of
Maybe ByteString
Nothing -> Ptr Word8 -> IO (Ptr Word8)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Word8
forall a. Ptr a
FP.nullPtr
Just ByteString
jBuffer -> do
jBuffer' <- ByteString -> IO (Ptr Word8)
packByteString ByteString
jBuffer
return jBuffer'
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_pollable_input_stream_read_nonblocking stream' maybeBuffer count maybeCancellable
maybeMaybeBuffer <- convertIfNonNull maybeBuffer $ \Ptr Word8
maybeBuffer' -> do
maybeBuffer'' <- (CSize -> Ptr Word8 -> IO ByteString
forall a. Integral a => a -> Ptr Word8 -> IO ByteString
unpackByteStringWithLength CSize
count) Ptr Word8
maybeBuffer'
freeMem maybeBuffer'
return maybeBuffer''
touchManagedPtr stream
whenJust cancellable touchManagedPtr
return (result, maybeMaybeBuffer)
) (do
freeMem maybeBuffer
)
#if defined(ENABLE_OVERLOADING)
data PollableInputStreamReadNonblockingMethodInfo
instance (signature ~ (Maybe (ByteString) -> Maybe (b) -> m ((DI.Int64, Maybe ByteString))), MonadIO m, IsPollableInputStream a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod PollableInputStreamReadNonblockingMethodInfo a signature where
overloadedMethod = pollableInputStreamReadNonblocking
instance O.OverloadedMethodInfo PollableInputStreamReadNonblockingMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.PollableInputStream.pollableInputStreamReadNonblocking",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-PollableInputStream.html#v:pollableInputStreamReadNonblocking"
})
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList PollableInputStream = PollableInputStreamSignalList
type PollableInputStreamSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif