#define ENABLE_OVERLOADING \
(!defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.DataInputStream
(
DataInputStream(..) ,
IsDataInputStream ,
toDataInputStream ,
noDataInputStream ,
#if ENABLE_OVERLOADING
DataInputStreamGetByteOrderMethodInfo ,
#endif
dataInputStreamGetByteOrder ,
#if ENABLE_OVERLOADING
DataInputStreamGetNewlineTypeMethodInfo ,
#endif
dataInputStreamGetNewlineType ,
dataInputStreamNew ,
#if ENABLE_OVERLOADING
DataInputStreamReadByteMethodInfo ,
#endif
dataInputStreamReadByte ,
#if ENABLE_OVERLOADING
DataInputStreamReadInt16MethodInfo ,
#endif
dataInputStreamReadInt16 ,
#if ENABLE_OVERLOADING
DataInputStreamReadInt32MethodInfo ,
#endif
dataInputStreamReadInt32 ,
#if ENABLE_OVERLOADING
DataInputStreamReadInt64MethodInfo ,
#endif
dataInputStreamReadInt64 ,
#if ENABLE_OVERLOADING
DataInputStreamReadLineMethodInfo ,
#endif
dataInputStreamReadLine ,
#if ENABLE_OVERLOADING
DataInputStreamReadLineAsyncMethodInfo ,
#endif
dataInputStreamReadLineAsync ,
#if ENABLE_OVERLOADING
DataInputStreamReadLineFinishMethodInfo ,
#endif
dataInputStreamReadLineFinish ,
#if ENABLE_OVERLOADING
DataInputStreamReadLineFinishUtf8MethodInfo,
#endif
dataInputStreamReadLineFinishUtf8 ,
#if ENABLE_OVERLOADING
DataInputStreamReadLineUtf8MethodInfo ,
#endif
dataInputStreamReadLineUtf8 ,
#if ENABLE_OVERLOADING
DataInputStreamReadUint16MethodInfo ,
#endif
dataInputStreamReadUint16 ,
#if ENABLE_OVERLOADING
DataInputStreamReadUint32MethodInfo ,
#endif
dataInputStreamReadUint32 ,
#if ENABLE_OVERLOADING
DataInputStreamReadUint64MethodInfo ,
#endif
dataInputStreamReadUint64 ,
#if ENABLE_OVERLOADING
DataInputStreamReadUntilMethodInfo ,
#endif
dataInputStreamReadUntil ,
#if ENABLE_OVERLOADING
DataInputStreamReadUntilAsyncMethodInfo ,
#endif
dataInputStreamReadUntilAsync ,
#if ENABLE_OVERLOADING
DataInputStreamReadUntilFinishMethodInfo,
#endif
dataInputStreamReadUntilFinish ,
#if ENABLE_OVERLOADING
DataInputStreamReadUptoMethodInfo ,
#endif
dataInputStreamReadUpto ,
#if ENABLE_OVERLOADING
DataInputStreamReadUptoAsyncMethodInfo ,
#endif
dataInputStreamReadUptoAsync ,
#if ENABLE_OVERLOADING
DataInputStreamReadUptoFinishMethodInfo ,
#endif
dataInputStreamReadUptoFinish ,
#if ENABLE_OVERLOADING
DataInputStreamSetByteOrderMethodInfo ,
#endif
dataInputStreamSetByteOrder ,
#if ENABLE_OVERLOADING
DataInputStreamSetNewlineTypeMethodInfo ,
#endif
dataInputStreamSetNewlineType ,
#if ENABLE_OVERLOADING
DataInputStreamByteOrderPropertyInfo ,
#endif
constructDataInputStreamByteOrder ,
#if ENABLE_OVERLOADING
dataInputStreamByteOrder ,
#endif
getDataInputStreamByteOrder ,
setDataInputStreamByteOrder ,
#if ENABLE_OVERLOADING
DataInputStreamNewlineTypePropertyInfo ,
#endif
constructDataInputStreamNewlineType ,
#if ENABLE_OVERLOADING
dataInputStreamNewlineType ,
#endif
getDataInputStreamNewlineType ,
setDataInputStreamNewlineType ,
) 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.ManagedPtr as B.ManagedPtr
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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Seekable as Gio.Seekable
import {-# SOURCE #-} qualified GI.Gio.Objects.BufferedInputStream as Gio.BufferedInputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.FilterInputStream as Gio.FilterInputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.InputStream as Gio.InputStream
newtype DataInputStream = DataInputStream (ManagedPtr DataInputStream)
foreign import ccall "g_data_input_stream_get_type"
c_g_data_input_stream_get_type :: IO GType
instance GObject DataInputStream where
gobjectType :: DataInputStream -> IO GType
gobjectType _ = IO GType
c_g_data_input_stream_get_type
class GObject o => IsDataInputStream o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError DataInputStream a) =>
IsDataInputStream a
#endif
instance IsDataInputStream DataInputStream
instance Gio.BufferedInputStream.IsBufferedInputStream DataInputStream
instance Gio.FilterInputStream.IsFilterInputStream DataInputStream
instance Gio.InputStream.IsInputStream DataInputStream
instance GObject.Object.IsObject DataInputStream
instance Gio.Seekable.IsSeekable DataInputStream
toDataInputStream :: (MonadIO m, IsDataInputStream o) => o -> m DataInputStream
toDataInputStream :: o -> m DataInputStream
toDataInputStream = IO DataInputStream -> m DataInputStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DataInputStream -> m DataInputStream)
-> (o -> IO DataInputStream) -> o -> m DataInputStream
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr DataInputStream -> DataInputStream)
-> o -> IO DataInputStream
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr DataInputStream -> DataInputStream
DataInputStream
noDataInputStream :: Maybe DataInputStream
noDataInputStream :: Maybe DataInputStream
noDataInputStream = Maybe DataInputStream
forall a. Maybe a
Nothing
#if ENABLE_OVERLOADING
type family ResolveDataInputStreamMethod (t :: Symbol) (o :: *) :: * where
ResolveDataInputStreamMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDataInputStreamMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDataInputStreamMethod "canSeek" o = Gio.Seekable.SeekableCanSeekMethodInfo
ResolveDataInputStreamMethod "canTruncate" o = Gio.Seekable.SeekableCanTruncateMethodInfo
ResolveDataInputStreamMethod "clearPending" o = Gio.InputStream.InputStreamClearPendingMethodInfo
ResolveDataInputStreamMethod "close" o = Gio.InputStream.InputStreamCloseMethodInfo
ResolveDataInputStreamMethod "closeAsync" o = Gio.InputStream.InputStreamCloseAsyncMethodInfo
ResolveDataInputStreamMethod "closeFinish" o = Gio.InputStream.InputStreamCloseFinishMethodInfo
ResolveDataInputStreamMethod "fill" o = Gio.BufferedInputStream.BufferedInputStreamFillMethodInfo
ResolveDataInputStreamMethod "fillAsync" o = Gio.BufferedInputStream.BufferedInputStreamFillAsyncMethodInfo
ResolveDataInputStreamMethod "fillFinish" o = Gio.BufferedInputStream.BufferedInputStreamFillFinishMethodInfo
ResolveDataInputStreamMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDataInputStreamMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDataInputStreamMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDataInputStreamMethod "hasPending" o = Gio.InputStream.InputStreamHasPendingMethodInfo
ResolveDataInputStreamMethod "isClosed" o = Gio.InputStream.InputStreamIsClosedMethodInfo
ResolveDataInputStreamMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDataInputStreamMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDataInputStreamMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDataInputStreamMethod "peek" o = Gio.BufferedInputStream.BufferedInputStreamPeekMethodInfo
ResolveDataInputStreamMethod "peekBuffer" o = Gio.BufferedInputStream.BufferedInputStreamPeekBufferMethodInfo
ResolveDataInputStreamMethod "read" o = Gio.InputStream.InputStreamReadMethodInfo
ResolveDataInputStreamMethod "readAll" o = Gio.InputStream.InputStreamReadAllMethodInfo
ResolveDataInputStreamMethod "readAllAsync" o = Gio.InputStream.InputStreamReadAllAsyncMethodInfo
ResolveDataInputStreamMethod "readAllFinish" o = Gio.InputStream.InputStreamReadAllFinishMethodInfo
ResolveDataInputStreamMethod "readAsync" o = Gio.InputStream.InputStreamReadAsyncMethodInfo
ResolveDataInputStreamMethod "readByte" o = DataInputStreamReadByteMethodInfo
ResolveDataInputStreamMethod "readBytes" o = Gio.InputStream.InputStreamReadBytesMethodInfo
ResolveDataInputStreamMethod "readBytesAsync" o = Gio.InputStream.InputStreamReadBytesAsyncMethodInfo
ResolveDataInputStreamMethod "readBytesFinish" o = Gio.InputStream.InputStreamReadBytesFinishMethodInfo
ResolveDataInputStreamMethod "readFinish" o = Gio.InputStream.InputStreamReadFinishMethodInfo
ResolveDataInputStreamMethod "readInt16" o = DataInputStreamReadInt16MethodInfo
ResolveDataInputStreamMethod "readInt32" o = DataInputStreamReadInt32MethodInfo
ResolveDataInputStreamMethod "readInt64" o = DataInputStreamReadInt64MethodInfo
ResolveDataInputStreamMethod "readLine" o = DataInputStreamReadLineMethodInfo
ResolveDataInputStreamMethod "readLineAsync" o = DataInputStreamReadLineAsyncMethodInfo
ResolveDataInputStreamMethod "readLineFinish" o = DataInputStreamReadLineFinishMethodInfo
ResolveDataInputStreamMethod "readLineFinishUtf8" o = DataInputStreamReadLineFinishUtf8MethodInfo
ResolveDataInputStreamMethod "readLineUtf8" o = DataInputStreamReadLineUtf8MethodInfo
ResolveDataInputStreamMethod "readUint16" o = DataInputStreamReadUint16MethodInfo
ResolveDataInputStreamMethod "readUint32" o = DataInputStreamReadUint32MethodInfo
ResolveDataInputStreamMethod "readUint64" o = DataInputStreamReadUint64MethodInfo
ResolveDataInputStreamMethod "readUntil" o = DataInputStreamReadUntilMethodInfo
ResolveDataInputStreamMethod "readUntilAsync" o = DataInputStreamReadUntilAsyncMethodInfo
ResolveDataInputStreamMethod "readUntilFinish" o = DataInputStreamReadUntilFinishMethodInfo
ResolveDataInputStreamMethod "readUpto" o = DataInputStreamReadUptoMethodInfo
ResolveDataInputStreamMethod "readUptoAsync" o = DataInputStreamReadUptoAsyncMethodInfo
ResolveDataInputStreamMethod "readUptoFinish" o = DataInputStreamReadUptoFinishMethodInfo
ResolveDataInputStreamMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDataInputStreamMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDataInputStreamMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDataInputStreamMethod "seek" o = Gio.Seekable.SeekableSeekMethodInfo
ResolveDataInputStreamMethod "skip" o = Gio.InputStream.InputStreamSkipMethodInfo
ResolveDataInputStreamMethod "skipAsync" o = Gio.InputStream.InputStreamSkipAsyncMethodInfo
ResolveDataInputStreamMethod "skipFinish" o = Gio.InputStream.InputStreamSkipFinishMethodInfo
ResolveDataInputStreamMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDataInputStreamMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDataInputStreamMethod "tell" o = Gio.Seekable.SeekableTellMethodInfo
ResolveDataInputStreamMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDataInputStreamMethod "truncate" o = Gio.Seekable.SeekableTruncateMethodInfo
ResolveDataInputStreamMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDataInputStreamMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDataInputStreamMethod "getAvailable" o = Gio.BufferedInputStream.BufferedInputStreamGetAvailableMethodInfo
ResolveDataInputStreamMethod "getBaseStream" o = Gio.FilterInputStream.FilterInputStreamGetBaseStreamMethodInfo
ResolveDataInputStreamMethod "getBufferSize" o = Gio.BufferedInputStream.BufferedInputStreamGetBufferSizeMethodInfo
ResolveDataInputStreamMethod "getByteOrder" o = DataInputStreamGetByteOrderMethodInfo
ResolveDataInputStreamMethod "getCloseBaseStream" o = Gio.FilterInputStream.FilterInputStreamGetCloseBaseStreamMethodInfo
ResolveDataInputStreamMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDataInputStreamMethod "getNewlineType" o = DataInputStreamGetNewlineTypeMethodInfo
ResolveDataInputStreamMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDataInputStreamMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDataInputStreamMethod "setBufferSize" o = Gio.BufferedInputStream.BufferedInputStreamSetBufferSizeMethodInfo
ResolveDataInputStreamMethod "setByteOrder" o = DataInputStreamSetByteOrderMethodInfo
ResolveDataInputStreamMethod "setCloseBaseStream" o = Gio.FilterInputStream.FilterInputStreamSetCloseBaseStreamMethodInfo
ResolveDataInputStreamMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDataInputStreamMethod "setNewlineType" o = DataInputStreamSetNewlineTypeMethodInfo
ResolveDataInputStreamMethod "setPending" o = Gio.InputStream.InputStreamSetPendingMethodInfo
ResolveDataInputStreamMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDataInputStreamMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDataInputStreamMethod t DataInputStream, O.MethodInfo info DataInputStream p) => O.IsLabelProxy t (DataInputStream -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveDataInputStreamMethod t DataInputStream, O.MethodInfo info DataInputStream p) => O.IsLabel t (DataInputStream -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif
getDataInputStreamByteOrder :: (MonadIO m, IsDataInputStream o) => o -> m Gio.Enums.DataStreamByteOrder
getDataInputStreamByteOrder :: o -> m DataStreamByteOrder
getDataInputStreamByteOrder obj :: o
obj = IO DataStreamByteOrder -> m DataStreamByteOrder
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DataStreamByteOrder -> m DataStreamByteOrder)
-> IO DataStreamByteOrder -> m DataStreamByteOrder
forall a b. (a -> b) -> a -> b
$ o -> String -> IO DataStreamByteOrder
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
getObjectPropertyEnum o
obj "byte-order"
setDataInputStreamByteOrder :: (MonadIO m, IsDataInputStream o) => o -> Gio.Enums.DataStreamByteOrder -> m ()
setDataInputStreamByteOrder :: o -> DataStreamByteOrder -> m ()
setDataInputStreamByteOrder obj :: o
obj val :: DataStreamByteOrder
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> DataStreamByteOrder -> IO ()
forall a b.
(GObject a, Enum b, BoxedEnum b) =>
a -> String -> b -> IO ()
setObjectPropertyEnum o
obj "byte-order" DataStreamByteOrder
val
constructDataInputStreamByteOrder :: (IsDataInputStream o) => Gio.Enums.DataStreamByteOrder -> IO (GValueConstruct o)
constructDataInputStreamByteOrder :: DataStreamByteOrder -> IO (GValueConstruct o)
constructDataInputStreamByteOrder val :: DataStreamByteOrder
val = String -> DataStreamByteOrder -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
constructObjectPropertyEnum "byte-order" DataStreamByteOrder
val
#if ENABLE_OVERLOADING
data DataInputStreamByteOrderPropertyInfo
instance AttrInfo DataInputStreamByteOrderPropertyInfo where
type AttrAllowedOps DataInputStreamByteOrderPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DataInputStreamByteOrderPropertyInfo = (~) Gio.Enums.DataStreamByteOrder
type AttrBaseTypeConstraint DataInputStreamByteOrderPropertyInfo = IsDataInputStream
type AttrGetType DataInputStreamByteOrderPropertyInfo = Gio.Enums.DataStreamByteOrder
type AttrLabel DataInputStreamByteOrderPropertyInfo = "byte-order"
type AttrOrigin DataInputStreamByteOrderPropertyInfo = DataInputStream
attrGet _ = getDataInputStreamByteOrder
attrSet _ = setDataInputStreamByteOrder
attrConstruct _ = constructDataInputStreamByteOrder
attrClear _ = undefined
#endif
getDataInputStreamNewlineType :: (MonadIO m, IsDataInputStream o) => o -> m Gio.Enums.DataStreamNewlineType
getDataInputStreamNewlineType :: o -> m DataStreamNewlineType
getDataInputStreamNewlineType obj :: o
obj = IO DataStreamNewlineType -> m DataStreamNewlineType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DataStreamNewlineType -> m DataStreamNewlineType)
-> IO DataStreamNewlineType -> m DataStreamNewlineType
forall a b. (a -> b) -> a -> b
$ o -> String -> IO DataStreamNewlineType
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
getObjectPropertyEnum o
obj "newline-type"
setDataInputStreamNewlineType :: (MonadIO m, IsDataInputStream o) => o -> Gio.Enums.DataStreamNewlineType -> m ()
setDataInputStreamNewlineType :: o -> DataStreamNewlineType -> m ()
setDataInputStreamNewlineType obj :: o
obj val :: DataStreamNewlineType
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> DataStreamNewlineType -> IO ()
forall a b.
(GObject a, Enum b, BoxedEnum b) =>
a -> String -> b -> IO ()
setObjectPropertyEnum o
obj "newline-type" DataStreamNewlineType
val
constructDataInputStreamNewlineType :: (IsDataInputStream o) => Gio.Enums.DataStreamNewlineType -> IO (GValueConstruct o)
constructDataInputStreamNewlineType :: DataStreamNewlineType -> IO (GValueConstruct o)
constructDataInputStreamNewlineType val :: DataStreamNewlineType
val = String -> DataStreamNewlineType -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
constructObjectPropertyEnum "newline-type" DataStreamNewlineType
val
#if ENABLE_OVERLOADING
data DataInputStreamNewlineTypePropertyInfo
instance AttrInfo DataInputStreamNewlineTypePropertyInfo where
type AttrAllowedOps DataInputStreamNewlineTypePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DataInputStreamNewlineTypePropertyInfo = (~) Gio.Enums.DataStreamNewlineType
type AttrBaseTypeConstraint DataInputStreamNewlineTypePropertyInfo = IsDataInputStream
type AttrGetType DataInputStreamNewlineTypePropertyInfo = Gio.Enums.DataStreamNewlineType
type AttrLabel DataInputStreamNewlineTypePropertyInfo = "newline-type"
type AttrOrigin DataInputStreamNewlineTypePropertyInfo = DataInputStream
attrGet _ = getDataInputStreamNewlineType
attrSet _ = setDataInputStreamNewlineType
attrConstruct _ = constructDataInputStreamNewlineType
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList DataInputStream
type instance O.AttributeList DataInputStream = DataInputStreamAttributeList
type DataInputStreamAttributeList = ('[ '("baseStream", Gio.FilterInputStream.FilterInputStreamBaseStreamPropertyInfo), '("bufferSize", Gio.BufferedInputStream.BufferedInputStreamBufferSizePropertyInfo), '("byteOrder", DataInputStreamByteOrderPropertyInfo), '("closeBaseStream", Gio.FilterInputStream.FilterInputStreamCloseBaseStreamPropertyInfo), '("newlineType", DataInputStreamNewlineTypePropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
dataInputStreamByteOrder :: AttrLabelProxy "byteOrder"
dataInputStreamByteOrder = AttrLabelProxy
dataInputStreamNewlineType :: AttrLabelProxy "newlineType"
dataInputStreamNewlineType = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList DataInputStream = DataInputStreamSignalList
type DataInputStreamSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_data_input_stream_new" g_data_input_stream_new ::
Ptr Gio.InputStream.InputStream ->
IO (Ptr DataInputStream)
dataInputStreamNew ::
(B.CallStack.HasCallStack, MonadIO m, Gio.InputStream.IsInputStream a) =>
a
-> m DataInputStream
dataInputStreamNew :: a -> m DataInputStream
dataInputStreamNew baseStream :: a
baseStream = IO DataInputStream -> m DataInputStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DataInputStream -> m DataInputStream)
-> IO DataInputStream -> m DataInputStream
forall a b. (a -> b) -> a -> b
$ do
Ptr InputStream
baseStream' <- a -> IO (Ptr InputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
baseStream
Ptr DataInputStream
result <- Ptr InputStream -> IO (Ptr DataInputStream)
g_data_input_stream_new Ptr InputStream
baseStream'
Text -> Ptr DataInputStream -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dataInputStreamNew" Ptr DataInputStream
result
DataInputStream
result' <- ((ManagedPtr DataInputStream -> DataInputStream)
-> Ptr DataInputStream -> IO DataInputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DataInputStream -> DataInputStream
DataInputStream) Ptr DataInputStream
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
baseStream
DataInputStream -> IO DataInputStream
forall (m :: * -> *) a. Monad m => a -> m a
return DataInputStream
result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_data_input_stream_get_byte_order" g_data_input_stream_get_byte_order ::
Ptr DataInputStream ->
IO CUInt
dataInputStreamGetByteOrder ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a) =>
a
-> m Gio.Enums.DataStreamByteOrder
dataInputStreamGetByteOrder :: a -> m DataStreamByteOrder
dataInputStreamGetByteOrder stream :: a
stream = IO DataStreamByteOrder -> m DataStreamByteOrder
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DataStreamByteOrder -> m DataStreamByteOrder)
-> IO DataStreamByteOrder -> m DataStreamByteOrder
forall a b. (a -> b) -> a -> b
$ do
Ptr DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
CUInt
result <- Ptr DataInputStream -> IO CUInt
g_data_input_stream_get_byte_order Ptr DataInputStream
stream'
let result' :: DataStreamByteOrder
result' = (Int -> DataStreamByteOrder
forall a. Enum a => Int -> a
toEnum (Int -> DataStreamByteOrder)
-> (CUInt -> Int) -> CUInt -> DataStreamByteOrder
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
DataStreamByteOrder -> IO DataStreamByteOrder
forall (m :: * -> *) a. Monad m => a -> m a
return DataStreamByteOrder
result'
#if ENABLE_OVERLOADING
data DataInputStreamGetByteOrderMethodInfo
instance (signature ~ (m Gio.Enums.DataStreamByteOrder), MonadIO m, IsDataInputStream a) => O.MethodInfo DataInputStreamGetByteOrderMethodInfo a signature where
overloadedMethod _ = dataInputStreamGetByteOrder
#endif
foreign import ccall "g_data_input_stream_get_newline_type" g_data_input_stream_get_newline_type ::
Ptr DataInputStream ->
IO CUInt
dataInputStreamGetNewlineType ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a) =>
a
-> m Gio.Enums.DataStreamNewlineType
dataInputStreamGetNewlineType :: a -> m DataStreamNewlineType
dataInputStreamGetNewlineType stream :: a
stream = IO DataStreamNewlineType -> m DataStreamNewlineType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DataStreamNewlineType -> m DataStreamNewlineType)
-> IO DataStreamNewlineType -> m DataStreamNewlineType
forall a b. (a -> b) -> a -> b
$ do
Ptr DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
CUInt
result <- Ptr DataInputStream -> IO CUInt
g_data_input_stream_get_newline_type Ptr DataInputStream
stream'
let result' :: DataStreamNewlineType
result' = (Int -> DataStreamNewlineType
forall a. Enum a => Int -> a
toEnum (Int -> DataStreamNewlineType)
-> (CUInt -> Int) -> CUInt -> DataStreamNewlineType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
DataStreamNewlineType -> IO DataStreamNewlineType
forall (m :: * -> *) a. Monad m => a -> m a
return DataStreamNewlineType
result'
#if ENABLE_OVERLOADING
data DataInputStreamGetNewlineTypeMethodInfo
instance (signature ~ (m Gio.Enums.DataStreamNewlineType), MonadIO m, IsDataInputStream a) => O.MethodInfo DataInputStreamGetNewlineTypeMethodInfo a signature where
overloadedMethod _ = dataInputStreamGetNewlineType
#endif
foreign import ccall "g_data_input_stream_read_byte" g_data_input_stream_read_byte ::
Ptr DataInputStream ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO Word8
dataInputStreamReadByte ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m Word8
dataInputStreamReadByte :: a -> Maybe b -> m Word8
dataInputStreamReadByte stream :: a
stream cancellable :: Maybe b
cancellable = IO Word8 -> m Word8
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word8 -> m Word8) -> IO Word8 -> m Word8
forall a b. (a -> b) -> a -> b
$ do
Ptr DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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 Word8 -> IO () -> IO Word8
forall a b. IO a -> IO b -> IO a
onException (do
Word8
result <- (Ptr (Ptr GError) -> IO Word8) -> IO Word8
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Word8) -> IO Word8)
-> (Ptr (Ptr GError) -> IO Word8) -> IO Word8
forall a b. (a -> b) -> a -> b
$ Ptr DataInputStream
-> Ptr Cancellable -> Ptr (Ptr GError) -> IO Word8
g_data_input_stream_read_byte Ptr DataInputStream
stream' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
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
Word8 -> IO Word8
forall (m :: * -> *) a. Monad m => a -> m a
return Word8
result
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if ENABLE_OVERLOADING
data DataInputStreamReadByteMethodInfo
instance (signature ~ (Maybe (b) -> m Word8), MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataInputStreamReadByteMethodInfo a signature where
overloadedMethod _ = dataInputStreamReadByte
#endif
foreign import ccall "g_data_input_stream_read_int16" g_data_input_stream_read_int16 ::
Ptr DataInputStream ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO Int16
dataInputStreamReadInt16 ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m Int16
dataInputStreamReadInt16 :: a -> Maybe b -> m Int16
dataInputStreamReadInt16 stream :: a
stream cancellable :: Maybe b
cancellable = IO Int16 -> m Int16
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int16 -> m Int16) -> IO Int16 -> m Int16
forall a b. (a -> b) -> a -> b
$ do
Ptr DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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 Int16 -> IO () -> IO Int16
forall a b. IO a -> IO b -> IO a
onException (do
Int16
result <- (Ptr (Ptr GError) -> IO Int16) -> IO Int16
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Int16) -> IO Int16)
-> (Ptr (Ptr GError) -> IO Int16) -> IO Int16
forall a b. (a -> b) -> a -> b
$ Ptr DataInputStream
-> Ptr Cancellable -> Ptr (Ptr GError) -> IO Int16
g_data_input_stream_read_int16 Ptr DataInputStream
stream' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
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
Int16 -> IO Int16
forall (m :: * -> *) a. Monad m => a -> m a
return Int16
result
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if ENABLE_OVERLOADING
data DataInputStreamReadInt16MethodInfo
instance (signature ~ (Maybe (b) -> m Int16), MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataInputStreamReadInt16MethodInfo a signature where
overloadedMethod _ = dataInputStreamReadInt16
#endif
foreign import ccall "g_data_input_stream_read_int32" g_data_input_stream_read_int32 ::
Ptr DataInputStream ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO Int32
dataInputStreamReadInt32 ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m Int32
dataInputStreamReadInt32 :: a -> Maybe b -> m Int32
dataInputStreamReadInt32 stream :: a
stream cancellable :: Maybe b
cancellable = IO Int32 -> m Int32
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
Ptr DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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 Int32 -> IO () -> IO Int32
forall a b. IO a -> IO b -> IO a
onException (do
Int32
result <- (Ptr (Ptr GError) -> IO Int32) -> IO Int32
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Int32) -> IO Int32)
-> (Ptr (Ptr GError) -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ Ptr DataInputStream
-> Ptr Cancellable -> Ptr (Ptr GError) -> IO Int32
g_data_input_stream_read_int32 Ptr DataInputStream
stream' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
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
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if ENABLE_OVERLOADING
data DataInputStreamReadInt32MethodInfo
instance (signature ~ (Maybe (b) -> m Int32), MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataInputStreamReadInt32MethodInfo a signature where
overloadedMethod _ = dataInputStreamReadInt32
#endif
foreign import ccall "g_data_input_stream_read_int64" g_data_input_stream_read_int64 ::
Ptr DataInputStream ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO Int64
dataInputStreamReadInt64 ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m Int64
dataInputStreamReadInt64 :: a -> Maybe b -> m Int64
dataInputStreamReadInt64 stream :: a
stream cancellable :: Maybe b
cancellable = IO Int64 -> m Int64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int64 -> m Int64) -> IO Int64 -> m Int64
forall a b. (a -> b) -> a -> b
$ do
Ptr DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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 Int64 -> IO () -> IO Int64
forall a b. IO a -> IO b -> IO a
onException (do
Int64
result <- (Ptr (Ptr GError) -> IO Int64) -> IO Int64
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Int64) -> IO Int64)
-> (Ptr (Ptr GError) -> IO Int64) -> IO Int64
forall a b. (a -> b) -> a -> b
$ Ptr DataInputStream
-> Ptr Cancellable -> Ptr (Ptr GError) -> IO Int64
g_data_input_stream_read_int64 Ptr DataInputStream
stream' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
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
Int64 -> IO Int64
forall (m :: * -> *) a. Monad m => a -> m a
return Int64
result
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if ENABLE_OVERLOADING
data DataInputStreamReadInt64MethodInfo
instance (signature ~ (Maybe (b) -> m Int64), MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataInputStreamReadInt64MethodInfo a signature where
overloadedMethod _ = dataInputStreamReadInt64
#endif
foreign import ccall "g_data_input_stream_read_line" g_data_input_stream_read_line ::
Ptr DataInputStream ->
Ptr Word64 ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Word8)
dataInputStreamReadLine ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m ((Maybe ByteString, Word64))
dataInputStreamReadLine :: a -> Maybe b -> m (Maybe ByteString, Word64)
dataInputStreamReadLine stream :: a
stream cancellable :: Maybe b
cancellable = IO (Maybe ByteString, Word64) -> m (Maybe ByteString, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe ByteString, Word64) -> m (Maybe ByteString, Word64))
-> IO (Maybe ByteString, Word64) -> m (Maybe ByteString, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr Word64
length_ <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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 (Maybe ByteString, Word64)
-> IO () -> IO (Maybe ByteString, Word64)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Word8
result <- (Ptr (Ptr GError) -> IO (Ptr Word8)) -> IO (Ptr Word8)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Word8)) -> IO (Ptr Word8))
-> (Ptr (Ptr GError) -> IO (Ptr Word8)) -> IO (Ptr Word8)
forall a b. (a -> b) -> a -> b
$ Ptr DataInputStream
-> Ptr Word64
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr Word8)
g_data_input_stream_read_line Ptr DataInputStream
stream' Ptr Word64
length_ Ptr Cancellable
maybeCancellable
Maybe ByteString
maybeResult <- Ptr Word8 -> (Ptr Word8 -> IO ByteString) -> IO (Maybe ByteString)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Word8
result ((Ptr Word8 -> IO ByteString) -> IO (Maybe ByteString))
-> (Ptr Word8 -> IO ByteString) -> IO (Maybe ByteString)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr Word8
result' -> do
ByteString
result'' <- Ptr Word8 -> IO ByteString
unpackZeroTerminatedByteString Ptr Word8
result'
Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
result'
ByteString -> IO ByteString
forall (m :: * -> *) a. Monad m => a -> m a
return ByteString
result''
Word64
length_' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
length_
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
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
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
(Maybe ByteString, Word64) -> IO (Maybe ByteString, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe ByteString
maybeResult, Word64
length_')
) (do
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
)
#if ENABLE_OVERLOADING
data DataInputStreamReadLineMethodInfo
instance (signature ~ (Maybe (b) -> m ((Maybe ByteString, Word64))), MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataInputStreamReadLineMethodInfo a signature where
overloadedMethod _ = dataInputStreamReadLine
#endif
foreign import ccall "g_data_input_stream_read_line_async" g_data_input_stream_read_line_async ::
Ptr DataInputStream ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
dataInputStreamReadLineAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
dataInputStreamReadLineAsync :: a -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
dataInputStreamReadLineAsync stream :: a
stream ioPriority :: Int32
ioPriority cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = 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 DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr DataInputStream
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_data_input_stream_read_line_async Ptr DataInputStream
stream' Int32
ioPriority Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
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
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if ENABLE_OVERLOADING
data DataInputStreamReadLineAsyncMethodInfo
instance (signature ~ (Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataInputStreamReadLineAsyncMethodInfo a signature where
overloadedMethod _ = dataInputStreamReadLineAsync
#endif
foreign import ccall "g_data_input_stream_read_line_finish" g_data_input_stream_read_line_finish ::
Ptr DataInputStream ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr Word64 ->
Ptr (Ptr GError) ->
IO (Ptr Word8)
dataInputStreamReadLineFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ((Maybe ByteString, Word64))
dataInputStreamReadLineFinish :: a -> b -> m (Maybe ByteString, Word64)
dataInputStreamReadLineFinish stream :: a
stream result_ :: b
result_ = IO (Maybe ByteString, Word64) -> m (Maybe ByteString, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe ByteString, Word64) -> m (Maybe ByteString, Word64))
-> IO (Maybe ByteString, Word64) -> m (Maybe ByteString, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
Ptr Word64
length_ <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
IO (Maybe ByteString, Word64)
-> IO () -> IO (Maybe ByteString, Word64)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Word8
result <- (Ptr (Ptr GError) -> IO (Ptr Word8)) -> IO (Ptr Word8)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Word8)) -> IO (Ptr Word8))
-> (Ptr (Ptr GError) -> IO (Ptr Word8)) -> IO (Ptr Word8)
forall a b. (a -> b) -> a -> b
$ Ptr DataInputStream
-> Ptr AsyncResult
-> Ptr Word64
-> Ptr (Ptr GError)
-> IO (Ptr Word8)
g_data_input_stream_read_line_finish Ptr DataInputStream
stream' Ptr AsyncResult
result_' Ptr Word64
length_
Maybe ByteString
maybeResult <- Ptr Word8 -> (Ptr Word8 -> IO ByteString) -> IO (Maybe ByteString)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Word8
result ((Ptr Word8 -> IO ByteString) -> IO (Maybe ByteString))
-> (Ptr Word8 -> IO ByteString) -> IO (Maybe ByteString)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr Word8
result' -> do
ByteString
result'' <- Ptr Word8 -> IO ByteString
unpackZeroTerminatedByteString Ptr Word8
result'
Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
result'
ByteString -> IO ByteString
forall (m :: * -> *) a. Monad m => a -> m a
return ByteString
result''
Word64
length_' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
length_
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
(Maybe ByteString, Word64) -> IO (Maybe ByteString, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe ByteString
maybeResult, Word64
length_')
) (do
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
)
#if ENABLE_OVERLOADING
data DataInputStreamReadLineFinishMethodInfo
instance (signature ~ (b -> m ((Maybe ByteString, Word64))), MonadIO m, IsDataInputStream a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo DataInputStreamReadLineFinishMethodInfo a signature where
overloadedMethod _ = dataInputStreamReadLineFinish
#endif
foreign import ccall "g_data_input_stream_read_line_finish_utf8" g_data_input_stream_read_line_finish_utf8 ::
Ptr DataInputStream ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr Word64 ->
Ptr (Ptr GError) ->
IO CString
dataInputStreamReadLineFinishUtf8 ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ((Maybe T.Text, Word64))
dataInputStreamReadLineFinishUtf8 :: a -> b -> m (Maybe Text, Word64)
dataInputStreamReadLineFinishUtf8 stream :: a
stream result_ :: b
result_ = IO (Maybe Text, Word64) -> m (Maybe Text, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text, Word64) -> m (Maybe Text, Word64))
-> IO (Maybe Text, Word64) -> m (Maybe Text, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
Ptr Word64
length_ <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
IO (Maybe Text, Word64) -> IO () -> IO (Maybe Text, Word64)
forall a b. IO a -> IO b -> IO a
onException (do
CString
result <- (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CString) -> IO CString)
-> (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ Ptr DataInputStream
-> Ptr AsyncResult -> Ptr Word64 -> Ptr (Ptr GError) -> IO CString
g_data_input_stream_read_line_finish_utf8 Ptr DataInputStream
stream' Ptr AsyncResult
result_' Ptr Word64
length_
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \result' :: CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
Word64
length_' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
length_
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
(Maybe Text, Word64) -> IO (Maybe Text, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe Text
maybeResult, Word64
length_')
) (do
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
)
#if ENABLE_OVERLOADING
data DataInputStreamReadLineFinishUtf8MethodInfo
instance (signature ~ (b -> m ((Maybe T.Text, Word64))), MonadIO m, IsDataInputStream a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo DataInputStreamReadLineFinishUtf8MethodInfo a signature where
overloadedMethod _ = dataInputStreamReadLineFinishUtf8
#endif
foreign import ccall "g_data_input_stream_read_line_utf8" g_data_input_stream_read_line_utf8 ::
Ptr DataInputStream ->
Ptr Word64 ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CString
dataInputStreamReadLineUtf8 ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m ((Maybe T.Text, Word64))
dataInputStreamReadLineUtf8 :: a -> Maybe b -> m (Maybe Text, Word64)
dataInputStreamReadLineUtf8 stream :: a
stream cancellable :: Maybe b
cancellable = IO (Maybe Text, Word64) -> m (Maybe Text, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text, Word64) -> m (Maybe Text, Word64))
-> IO (Maybe Text, Word64) -> m (Maybe Text, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr Word64
length_ <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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 (Maybe Text, Word64) -> IO () -> IO (Maybe Text, Word64)
forall a b. IO a -> IO b -> IO a
onException (do
CString
result <- (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CString) -> IO CString)
-> (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ Ptr DataInputStream
-> Ptr Word64 -> Ptr Cancellable -> Ptr (Ptr GError) -> IO CString
g_data_input_stream_read_line_utf8 Ptr DataInputStream
stream' Ptr Word64
length_ Ptr Cancellable
maybeCancellable
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \result' :: CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
Word64
length_' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
length_
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
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
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
(Maybe Text, Word64) -> IO (Maybe Text, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe Text
maybeResult, Word64
length_')
) (do
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
)
#if ENABLE_OVERLOADING
data DataInputStreamReadLineUtf8MethodInfo
instance (signature ~ (Maybe (b) -> m ((Maybe T.Text, Word64))), MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataInputStreamReadLineUtf8MethodInfo a signature where
overloadedMethod _ = dataInputStreamReadLineUtf8
#endif
foreign import ccall "g_data_input_stream_read_uint16" g_data_input_stream_read_uint16 ::
Ptr DataInputStream ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO Word16
dataInputStreamReadUint16 ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m Word16
dataInputStreamReadUint16 :: a -> Maybe b -> m Word16
dataInputStreamReadUint16 stream :: a
stream cancellable :: Maybe b
cancellable = IO Word16 -> m Word16
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word16 -> m Word16) -> IO Word16 -> m Word16
forall a b. (a -> b) -> a -> b
$ do
Ptr DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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 Word16 -> IO () -> IO Word16
forall a b. IO a -> IO b -> IO a
onException (do
Word16
result <- (Ptr (Ptr GError) -> IO Word16) -> IO Word16
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Word16) -> IO Word16)
-> (Ptr (Ptr GError) -> IO Word16) -> IO Word16
forall a b. (a -> b) -> a -> b
$ Ptr DataInputStream
-> Ptr Cancellable -> Ptr (Ptr GError) -> IO Word16
g_data_input_stream_read_uint16 Ptr DataInputStream
stream' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
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
Word16 -> IO Word16
forall (m :: * -> *) a. Monad m => a -> m a
return Word16
result
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if ENABLE_OVERLOADING
data DataInputStreamReadUint16MethodInfo
instance (signature ~ (Maybe (b) -> m Word16), MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataInputStreamReadUint16MethodInfo a signature where
overloadedMethod _ = dataInputStreamReadUint16
#endif
foreign import ccall "g_data_input_stream_read_uint32" g_data_input_stream_read_uint32 ::
Ptr DataInputStream ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO Word32
dataInputStreamReadUint32 ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m Word32
dataInputStreamReadUint32 :: a -> Maybe b -> m Word32
dataInputStreamReadUint32 stream :: a
stream cancellable :: Maybe b
cancellable = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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 Word32 -> IO () -> IO Word32
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Word32) -> IO Word32)
-> (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ Ptr DataInputStream
-> Ptr Cancellable -> Ptr (Ptr GError) -> IO Word32
g_data_input_stream_read_uint32 Ptr DataInputStream
stream' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
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
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if ENABLE_OVERLOADING
data DataInputStreamReadUint32MethodInfo
instance (signature ~ (Maybe (b) -> m Word32), MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataInputStreamReadUint32MethodInfo a signature where
overloadedMethod _ = dataInputStreamReadUint32
#endif
foreign import ccall "g_data_input_stream_read_uint64" g_data_input_stream_read_uint64 ::
Ptr DataInputStream ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO Word64
dataInputStreamReadUint64 ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m Word64
dataInputStreamReadUint64 :: a -> Maybe b -> m Word64
dataInputStreamReadUint64 stream :: a
stream cancellable :: Maybe b
cancellable = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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 Word64 -> IO () -> IO Word64
forall a b. IO a -> IO b -> IO a
onException (do
Word64
result <- (Ptr (Ptr GError) -> IO Word64) -> IO Word64
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Word64) -> IO Word64)
-> (Ptr (Ptr GError) -> IO Word64) -> IO Word64
forall a b. (a -> b) -> a -> b
$ Ptr DataInputStream
-> Ptr Cancellable -> Ptr (Ptr GError) -> IO Word64
g_data_input_stream_read_uint64 Ptr DataInputStream
stream' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
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
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if ENABLE_OVERLOADING
data DataInputStreamReadUint64MethodInfo
instance (signature ~ (Maybe (b) -> m Word64), MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataInputStreamReadUint64MethodInfo a signature where
overloadedMethod _ = dataInputStreamReadUint64
#endif
foreign import ccall "g_data_input_stream_read_until" g_data_input_stream_read_until ::
Ptr DataInputStream ->
CString ->
Ptr Word64 ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CString
{-# DEPRECATED dataInputStreamReadUntil ["(Since version 2.56)","Use 'GI.Gio.Objects.DataInputStream.dataInputStreamReadUpto' instead, which has more"," consistent behaviour regarding the stop character."] #-}
dataInputStreamReadUntil ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Maybe (b)
-> m ((T.Text, Word64))
dataInputStreamReadUntil :: a -> Text -> Maybe b -> m (Text, Word64)
dataInputStreamReadUntil stream :: a
stream stopChars :: Text
stopChars cancellable :: Maybe b
cancellable = IO (Text, Word64) -> m (Text, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Text, Word64) -> m (Text, Word64))
-> IO (Text, Word64) -> m (Text, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
CString
stopChars' <- Text -> IO CString
textToCString Text
stopChars
Ptr Word64
length_ <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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 (Text, Word64) -> IO () -> IO (Text, Word64)
forall a b. IO a -> IO b -> IO a
onException (do
CString
result <- (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CString) -> IO CString)
-> (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ Ptr DataInputStream
-> CString
-> Ptr Word64
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CString
g_data_input_stream_read_until Ptr DataInputStream
stream' CString
stopChars' Ptr Word64
length_ Ptr Cancellable
maybeCancellable
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dataInputStreamReadUntil" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
Word64
length_' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
length_
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
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
stopChars'
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
(Text, Word64) -> IO (Text, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Text
result', Word64
length_')
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
stopChars'
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
)
#if ENABLE_OVERLOADING
data DataInputStreamReadUntilMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m ((T.Text, Word64))), MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataInputStreamReadUntilMethodInfo a signature where
overloadedMethod _ = dataInputStreamReadUntil
#endif
foreign import ccall "g_data_input_stream_read_until_async" g_data_input_stream_read_until_async ::
Ptr DataInputStream ->
CString ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
{-# DEPRECATED dataInputStreamReadUntilAsync ["(Since version 2.56)","Use 'GI.Gio.Objects.DataInputStream.dataInputStreamReadUptoAsync' instead, which"," has more consistent behaviour regarding the stop character."] #-}
dataInputStreamReadUntilAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
dataInputStreamReadUntilAsync :: a -> Text -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
dataInputStreamReadUntilAsync stream :: a
stream stopChars :: Text
stopChars ioPriority :: Int32
ioPriority cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = 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 DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
CString
stopChars' <- Text -> IO CString
textToCString Text
stopChars
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr DataInputStream
-> CString
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_data_input_stream_read_until_async Ptr DataInputStream
stream' CString
stopChars' Int32
ioPriority Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
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
stopChars'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if ENABLE_OVERLOADING
data DataInputStreamReadUntilAsyncMethodInfo
instance (signature ~ (T.Text -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataInputStreamReadUntilAsyncMethodInfo a signature where
overloadedMethod _ = dataInputStreamReadUntilAsync
#endif
foreign import ccall "g_data_input_stream_read_until_finish" g_data_input_stream_read_until_finish ::
Ptr DataInputStream ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr Word64 ->
Ptr (Ptr GError) ->
IO CString
{-# DEPRECATED dataInputStreamReadUntilFinish ["(Since version 2.56)","Use 'GI.Gio.Objects.DataInputStream.dataInputStreamReadUptoFinish' instead, which"," has more consistent behaviour regarding the stop character."] #-}
dataInputStreamReadUntilFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ((T.Text, Word64))
dataInputStreamReadUntilFinish :: a -> b -> m (Text, Word64)
dataInputStreamReadUntilFinish stream :: a
stream result_ :: b
result_ = IO (Text, Word64) -> m (Text, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Text, Word64) -> m (Text, Word64))
-> IO (Text, Word64) -> m (Text, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
Ptr Word64
length_ <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
IO (Text, Word64) -> IO () -> IO (Text, Word64)
forall a b. IO a -> IO b -> IO a
onException (do
CString
result <- (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CString) -> IO CString)
-> (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ Ptr DataInputStream
-> Ptr AsyncResult -> Ptr Word64 -> Ptr (Ptr GError) -> IO CString
g_data_input_stream_read_until_finish Ptr DataInputStream
stream' Ptr AsyncResult
result_' Ptr Word64
length_
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dataInputStreamReadUntilFinish" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
Word64
length_' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
length_
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
(Text, Word64) -> IO (Text, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Text
result', Word64
length_')
) (do
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
)
#if ENABLE_OVERLOADING
data DataInputStreamReadUntilFinishMethodInfo
instance (signature ~ (b -> m ((T.Text, Word64))), MonadIO m, IsDataInputStream a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo DataInputStreamReadUntilFinishMethodInfo a signature where
overloadedMethod _ = dataInputStreamReadUntilFinish
#endif
foreign import ccall "g_data_input_stream_read_upto" g_data_input_stream_read_upto ::
Ptr DataInputStream ->
CString ->
Int64 ->
Ptr Word64 ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CString
dataInputStreamReadUpto ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Int64
-> Maybe (b)
-> m ((T.Text, Word64))
dataInputStreamReadUpto :: a -> Text -> Int64 -> Maybe b -> m (Text, Word64)
dataInputStreamReadUpto stream :: a
stream stopChars :: Text
stopChars stopCharsLen :: Int64
stopCharsLen cancellable :: Maybe b
cancellable = IO (Text, Word64) -> m (Text, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Text, Word64) -> m (Text, Word64))
-> IO (Text, Word64) -> m (Text, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
CString
stopChars' <- Text -> IO CString
textToCString Text
stopChars
Ptr Word64
length_ <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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 (Text, Word64) -> IO () -> IO (Text, Word64)
forall a b. IO a -> IO b -> IO a
onException (do
CString
result <- (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CString) -> IO CString)
-> (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ Ptr DataInputStream
-> CString
-> Int64
-> Ptr Word64
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CString
g_data_input_stream_read_upto Ptr DataInputStream
stream' CString
stopChars' Int64
stopCharsLen Ptr Word64
length_ Ptr Cancellable
maybeCancellable
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dataInputStreamReadUpto" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
Word64
length_' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
length_
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
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
stopChars'
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
(Text, Word64) -> IO (Text, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Text
result', Word64
length_')
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
stopChars'
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
)
#if ENABLE_OVERLOADING
data DataInputStreamReadUptoMethodInfo
instance (signature ~ (T.Text -> Int64 -> Maybe (b) -> m ((T.Text, Word64))), MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataInputStreamReadUptoMethodInfo a signature where
overloadedMethod _ = dataInputStreamReadUpto
#endif
foreign import ccall "g_data_input_stream_read_upto_async" g_data_input_stream_read_upto_async ::
Ptr DataInputStream ->
CString ->
Int64 ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
dataInputStreamReadUptoAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Int64
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
dataInputStreamReadUptoAsync :: a
-> Text
-> Int64
-> Int32
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
dataInputStreamReadUptoAsync stream :: a
stream stopChars :: Text
stopChars stopCharsLen :: Int64
stopCharsLen ioPriority :: Int32
ioPriority cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = 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 DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
CString
stopChars' <- Text -> IO CString
textToCString Text
stopChars
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr DataInputStream
-> CString
-> Int64
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_data_input_stream_read_upto_async Ptr DataInputStream
stream' CString
stopChars' Int64
stopCharsLen Int32
ioPriority Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
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
stopChars'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if ENABLE_OVERLOADING
data DataInputStreamReadUptoAsyncMethodInfo
instance (signature ~ (T.Text -> Int64 -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDataInputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataInputStreamReadUptoAsyncMethodInfo a signature where
overloadedMethod _ = dataInputStreamReadUptoAsync
#endif
foreign import ccall "g_data_input_stream_read_upto_finish" g_data_input_stream_read_upto_finish ::
Ptr DataInputStream ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr Word64 ->
Ptr (Ptr GError) ->
IO CString
dataInputStreamReadUptoFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ((T.Text, Word64))
dataInputStreamReadUptoFinish :: a -> b -> m (Text, Word64)
dataInputStreamReadUptoFinish stream :: a
stream result_ :: b
result_ = IO (Text, Word64) -> m (Text, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Text, Word64) -> m (Text, Word64))
-> IO (Text, Word64) -> m (Text, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
Ptr Word64
length_ <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
IO (Text, Word64) -> IO () -> IO (Text, Word64)
forall a b. IO a -> IO b -> IO a
onException (do
CString
result <- (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CString) -> IO CString)
-> (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ Ptr DataInputStream
-> Ptr AsyncResult -> Ptr Word64 -> Ptr (Ptr GError) -> IO CString
g_data_input_stream_read_upto_finish Ptr DataInputStream
stream' Ptr AsyncResult
result_' Ptr Word64
length_
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dataInputStreamReadUptoFinish" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
Word64
length_' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
length_
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
(Text, Word64) -> IO (Text, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Text
result', Word64
length_')
) (do
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
)
#if ENABLE_OVERLOADING
data DataInputStreamReadUptoFinishMethodInfo
instance (signature ~ (b -> m ((T.Text, Word64))), MonadIO m, IsDataInputStream a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo DataInputStreamReadUptoFinishMethodInfo a signature where
overloadedMethod _ = dataInputStreamReadUptoFinish
#endif
foreign import ccall "g_data_input_stream_set_byte_order" g_data_input_stream_set_byte_order ::
Ptr DataInputStream ->
CUInt ->
IO ()
dataInputStreamSetByteOrder ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a) =>
a
-> Gio.Enums.DataStreamByteOrder
-> m ()
dataInputStreamSetByteOrder :: a -> DataStreamByteOrder -> m ()
dataInputStreamSetByteOrder stream :: a
stream order :: DataStreamByteOrder
order = 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 DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
let order' :: CUInt
order' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (DataStreamByteOrder -> Int) -> DataStreamByteOrder -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DataStreamByteOrder -> Int
forall a. Enum a => a -> Int
fromEnum) DataStreamByteOrder
order
Ptr DataInputStream -> CUInt -> IO ()
g_data_input_stream_set_byte_order Ptr DataInputStream
stream' CUInt
order'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if ENABLE_OVERLOADING
data DataInputStreamSetByteOrderMethodInfo
instance (signature ~ (Gio.Enums.DataStreamByteOrder -> m ()), MonadIO m, IsDataInputStream a) => O.MethodInfo DataInputStreamSetByteOrderMethodInfo a signature where
overloadedMethod _ = dataInputStreamSetByteOrder
#endif
foreign import ccall "g_data_input_stream_set_newline_type" g_data_input_stream_set_newline_type ::
Ptr DataInputStream ->
CUInt ->
IO ()
dataInputStreamSetNewlineType ::
(B.CallStack.HasCallStack, MonadIO m, IsDataInputStream a) =>
a
-> Gio.Enums.DataStreamNewlineType
-> m ()
dataInputStreamSetNewlineType :: a -> DataStreamNewlineType -> m ()
dataInputStreamSetNewlineType stream :: a
stream type_ :: DataStreamNewlineType
type_ = 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 DataInputStream
stream' <- a -> IO (Ptr DataInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
let type_' :: CUInt
type_' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (DataStreamNewlineType -> Int) -> DataStreamNewlineType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DataStreamNewlineType -> Int
forall a. Enum a => a -> Int
fromEnum) DataStreamNewlineType
type_
Ptr DataInputStream -> CUInt -> IO ()
g_data_input_stream_set_newline_type Ptr DataInputStream
stream' CUInt
type_'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if ENABLE_OVERLOADING
data DataInputStreamSetNewlineTypeMethodInfo
instance (signature ~ (Gio.Enums.DataStreamNewlineType -> m ()), MonadIO m, IsDataInputStream a) => O.MethodInfo DataInputStreamSetNewlineTypeMethodInfo a signature where
overloadedMethod _ = dataInputStreamSetNewlineType
#endif