Hoogle Search
Within LTS Haskell 24.52 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
gi-glib GI.GLib.Structs.IOChannel Replacement for iOChannelRead with the new API.
iOChannelReadLine :: (HasCallStack, MonadIO m) => IOChannel -> m (IOStatus, Text, CSize, CSize)gi-glib GI.GLib.Structs.IOChannel Reads a line, including the terminating character(s), from a IOChannel into a newly-allocated string. strReturn will contain allocated memory if the return is IOStatusNormal.
iOChannelReadToEnd :: (HasCallStack, MonadIO m) => IOChannel -> m (IOStatus, ByteString)gi-glib GI.GLib.Structs.IOChannel Reads all the remaining data from the file.
iOChannelReadUnichar :: (HasCallStack, MonadIO m) => IOChannel -> m (IOStatus, Char)gi-glib GI.GLib.Structs.IOChannel Reads a Unicode character from channel. This function cannot be called on a channel with Nothing encoding.
clearIOFuncsIoRead :: MonadIO m => IOFuncs -> m ()gi-glib GI.GLib.Structs.IOFuncs Set the value of the “io_read” field to Nothing. When overloading is enabled, this is equivalent to
clear #ioRead
getIOFuncsIoRead :: MonadIO m => IOFuncs -> m (Maybe IOFuncsIoReadFieldCallback)gi-glib GI.GLib.Structs.IOFuncs Get the value of the “io_read” field. When overloading is enabled, this is equivalent to
get iOFuncs #ioRead
setIOFuncsIoRead :: MonadIO m => IOFuncs -> FunPtr C_IOFuncsIoReadFieldCallback -> m ()gi-glib GI.GLib.Structs.IOFuncs Set the value of the “io_read” field. When overloading is enabled, this is equivalent to
set iOFuncs [ #ioRead := value ]
mainContextGetThreadDefault :: (HasCallStack, MonadIO m) => m (Maybe MainContext)gi-glib GI.GLib.Structs.MainContext Gets the thread-default MainContext for this thread. Asynchronous operations that want to be able to be run in contexts other than the default one should call this method or mainContextRefThreadDefault to get a MainContext to add their GSources to. (Note that even in single-threaded programs applications may sometimes want to temporarily push a non-default context, so it is not safe to assume that this will always return Nothing if you are running in the default thread.) If you need to hold a reference on the context, use mainContextRefThreadDefault instead. Since: 2.22
mainContextPopThreadDefault :: (HasCallStack, MonadIO m) => Maybe MainContext -> m ()gi-glib GI.GLib.Structs.MainContext Pops context off the thread-default context stack (verifying that it was on the top of the stack). Since: 2.22
mainContextPushThreadDefault :: (HasCallStack, MonadIO m) => Maybe MainContext -> m ()gi-glib GI.GLib.Structs.MainContext Acquires context and sets it as the thread-default context for the current thread. This will cause certain asynchronous operations (such as most [gio][gio]-based I/O) which are started in this thread to run under context and deliver their results to its main loop, rather than running under the global default main context in the main thread. Note that calling this function changes the context returned by mainContextGetThreadDefault, not the one returned by mainContextDefault, so it does not affect the context used by functions like g_idle_add(). Normally you would call this function shortly after creating a new thread, passing it a MainContext which will be run by a MainLoop in that thread, to set a new default context for all async operations in that thread. In this case you may not need to ever call mainContextPopThreadDefault, assuming you want the new MainContext to be the default for the whole lifecycle of the thread. If you don't have control over how the new thread was created (e.g. in the new thread isn't newly created, or if the thread life cycle is managed by a ThreadPool), it is always suggested to wrap the logic that needs to use the new MainContext inside a mainContextPushThreadDefault / mainContextPopThreadDefault pair, otherwise threads that are re-used will end up never explicitly releasing the MainContext reference they hold. In some cases you may want to schedule a single operation in a non-default context, or temporarily use a non-default context in the main thread. In that case, you can wrap the call to the asynchronous operation inside a mainContextPushThreadDefault / mainContextPopThreadDefault pair, but it is up to you to ensure that no other asynchronous operations accidentally get started while the non-default context is active. Beware that libraries that predate this function may not correctly handle being used from a thread with a thread-default context. Eg, see g_file_supports_thread_contexts(). Since: 2.22