| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.Gio.Functions
Contents
- Methods
- busGet
- busGetFinish
- busGetSync
- busOwnName
- busOwnNameOnConnection
- busUnownName
- busUnwatchName
- busWatchName
- busWatchNameOnConnection
- contentTypeCanBeExecutable
- contentTypeEquals
- contentTypeFromMimeType
- contentTypeGetDescription
- contentTypeGetGenericIconName
- contentTypeGetIcon
- contentTypeGetMimeType
- contentTypeGetSymbolicIcon
- contentTypeGuess
- contentTypeGuessForTree
- contentTypeIsA
- contentTypeIsMimeType
- contentTypeIsUnknown
- contentTypesGetRegistered
- dbusAddressEscapeValue
- dbusAddressGetForBusSync
- dbusAddressGetStream
- dbusAddressGetStreamFinish
- dbusAddressGetStreamSync
- dbusGenerateGuid
- dbusGvalueToGvariant
- dbusGvariantToGvalue
- dbusIsAddress
- dbusIsGuid
- dbusIsInterfaceName
- dbusIsMemberName
- dbusIsName
- dbusIsSupportedAddress
- dbusIsUniqueName
- ioErrorFromErrno
- ioErrorQuark
- ioModulesScanAllInDirectory
- ioModulesScanAllInDirectoryWithScope
- ioSchedulerCancelAllJobs
- ioSchedulerPushJob
- keyfileSettingsBackendNew
- memorySettingsBackendNew
- networkingInit
- nullSettingsBackendNew
- pollableSourceNew
- pollableSourceNewFull
- pollableStreamRead
- pollableStreamWrite
- pollableStreamWriteAll
- resourcesEnumerateChildren
- resourcesGetInfo
- resourcesLookupData
- resourcesOpenStream
- resourcesRegister
- resourcesUnregister
- simpleAsyncReportGerrorInIdle
- unixIsMountPathSystemInternal
- unixMountCompare
- unixMountFree
- unixMountGetDevicePath
- unixMountGetFsType
- unixMountGetMountPath
- unixMountGuessCanEject
- unixMountGuessIcon
- unixMountGuessName
- unixMountGuessShouldDisplay
- unixMountGuessSymbolicIcon
- unixMountIsReadonly
- unixMountIsSystemInternal
- unixMountPointsChangedSince
- unixMountsChangedSince
Description
- busGet :: (HasCallStack, MonadIO m, IsCancellable a) => BusType -> Maybe a -> Maybe AsyncReadyCallback -> m ()
- busGetFinish :: (HasCallStack, MonadIO m, IsAsyncResult a) => a -> m DBusConnection
- busGetSync :: (HasCallStack, MonadIO m, IsCancellable a) => BusType -> Maybe a -> m DBusConnection
- busOwnName :: (HasCallStack, MonadIO m) => BusType -> Text -> [BusNameOwnerFlags] -> Maybe Closure -> Maybe Closure -> Maybe Closure -> m Word32
- busOwnNameOnConnection :: (HasCallStack, MonadIO m, IsDBusConnection a) => a -> Text -> [BusNameOwnerFlags] -> Maybe Closure -> Maybe Closure -> m Word32
- busUnownName :: (HasCallStack, MonadIO m) => Word32 -> m ()
- busUnwatchName :: (HasCallStack, MonadIO m) => Word32 -> m ()
- busWatchName :: (HasCallStack, MonadIO m) => BusType -> Text -> [BusNameWatcherFlags] -> Maybe Closure -> Maybe Closure -> m Word32
- busWatchNameOnConnection :: (HasCallStack, MonadIO m, IsDBusConnection a) => a -> Text -> [BusNameWatcherFlags] -> Maybe Closure -> Maybe Closure -> m Word32
- contentTypeCanBeExecutable :: (HasCallStack, MonadIO m) => Text -> m Bool
- contentTypeEquals :: (HasCallStack, MonadIO m) => Text -> Text -> m Bool
- contentTypeFromMimeType :: (HasCallStack, MonadIO m) => Text -> m (Maybe Text)
- contentTypeGetDescription :: (HasCallStack, MonadIO m) => Text -> m Text
- contentTypeGetGenericIconName :: (HasCallStack, MonadIO m) => Text -> m (Maybe Text)
- contentTypeGetIcon :: (HasCallStack, MonadIO m) => Text -> m Icon
- contentTypeGetMimeType :: (HasCallStack, MonadIO m) => Text -> m (Maybe Text)
- contentTypeGetSymbolicIcon :: (HasCallStack, MonadIO m) => Text -> m Icon
- contentTypeGuess :: (HasCallStack, MonadIO m) => Maybe Text -> Maybe ByteString -> m (Text, Bool)
- contentTypeGuessForTree :: (HasCallStack, MonadIO m, IsFile a) => a -> m [Text]
- contentTypeIsA :: (HasCallStack, MonadIO m) => Text -> Text -> m Bool
- contentTypeIsMimeType :: (HasCallStack, MonadIO m) => Text -> Text -> m Bool
- contentTypeIsUnknown :: (HasCallStack, MonadIO m) => Text -> m Bool
- contentTypesGetRegistered :: (HasCallStack, MonadIO m) => m [Text]
- dbusAddressEscapeValue :: (HasCallStack, MonadIO m) => Text -> m Text
- dbusAddressGetForBusSync :: (HasCallStack, MonadIO m, IsCancellable a) => BusType -> Maybe a -> m Text
- dbusAddressGetStream :: (HasCallStack, MonadIO m, IsCancellable a) => Text -> Maybe a -> Maybe AsyncReadyCallback -> m ()
- dbusAddressGetStreamFinish :: (HasCallStack, MonadIO m, IsAsyncResult a) => a -> m (IOStream, Text)
- dbusAddressGetStreamSync :: (HasCallStack, MonadIO m, IsCancellable a) => Text -> Maybe a -> m (IOStream, Text)
- dbusGenerateGuid :: (HasCallStack, MonadIO m) => m Text
- dbusGvalueToGvariant :: (HasCallStack, MonadIO m) => GValue -> VariantType -> m GVariant
- dbusGvariantToGvalue :: (HasCallStack, MonadIO m) => GVariant -> m GValue
- dbusIsAddress :: (HasCallStack, MonadIO m) => Text -> m Bool
- dbusIsGuid :: (HasCallStack, MonadIO m) => Text -> m Bool
- dbusIsInterfaceName :: (HasCallStack, MonadIO m) => Text -> m Bool
- dbusIsMemberName :: (HasCallStack, MonadIO m) => Text -> m Bool
- dbusIsName :: (HasCallStack, MonadIO m) => Text -> m Bool
- dbusIsSupportedAddress :: (HasCallStack, MonadIO m) => Text -> m ()
- dbusIsUniqueName :: (HasCallStack, MonadIO m) => Text -> m Bool
- ioErrorFromErrno :: (HasCallStack, MonadIO m) => Int32 -> m IOErrorEnum
- ioErrorQuark :: (HasCallStack, MonadIO m) => m Word32
- ioModulesScanAllInDirectory :: (HasCallStack, MonadIO m) => [Char] -> m ()
- ioModulesScanAllInDirectoryWithScope :: (HasCallStack, MonadIO m) => [Char] -> IOModuleScope -> m ()
- ioSchedulerCancelAllJobs :: (HasCallStack, MonadIO m) => m ()
- ioSchedulerPushJob :: (HasCallStack, MonadIO m, IsCancellable a) => IOSchedulerJobFunc -> Int32 -> Maybe a -> m ()
- keyfileSettingsBackendNew :: (HasCallStack, MonadIO m) => Text -> Text -> Maybe Text -> m SettingsBackend
- memorySettingsBackendNew :: (HasCallStack, MonadIO m) => m SettingsBackend
- networkingInit :: (HasCallStack, MonadIO m) => m ()
- nullSettingsBackendNew :: (HasCallStack, MonadIO m) => m SettingsBackend
- pollableSourceNew :: (HasCallStack, MonadIO m, IsObject a) => a -> m Source
- pollableSourceNewFull :: (HasCallStack, MonadIO m, IsObject a, IsCancellable b) => a -> Maybe Source -> Maybe b -> m Source
- pollableStreamRead :: (HasCallStack, MonadIO m, IsInputStream a, IsCancellable b) => a -> ByteString -> Bool -> Maybe b -> m Int64
- pollableStreamWrite :: (HasCallStack, MonadIO m, IsOutputStream a, IsCancellable b) => a -> ByteString -> Bool -> Maybe b -> m Int64
- pollableStreamWriteAll :: (HasCallStack, MonadIO m, IsOutputStream a, IsCancellable b) => a -> ByteString -> Bool -> Maybe b -> m Word64
- resourcesEnumerateChildren :: (HasCallStack, MonadIO m) => Text -> [ResourceLookupFlags] -> m [Text]
- resourcesGetInfo :: (HasCallStack, MonadIO m) => Text -> [ResourceLookupFlags] -> m (Word64, Word32)
- resourcesLookupData :: (HasCallStack, MonadIO m) => Text -> [ResourceLookupFlags] -> m Bytes
- resourcesOpenStream :: (HasCallStack, MonadIO m) => Text -> [ResourceLookupFlags] -> m InputStream
- resourcesRegister :: (HasCallStack, MonadIO m) => Resource -> m ()
- resourcesUnregister :: (HasCallStack, MonadIO m) => Resource -> m ()
- simpleAsyncReportGerrorInIdle :: (HasCallStack, MonadIO m, IsObject a) => Maybe a -> Maybe AsyncReadyCallback -> GError -> m ()
- unixIsMountPathSystemInternal :: (HasCallStack, MonadIO m) => [Char] -> m Bool
- unixMountCompare :: (HasCallStack, MonadIO m) => UnixMountEntry -> UnixMountEntry -> m Int32
- unixMountFree :: (HasCallStack, MonadIO m) => UnixMountEntry -> m ()
- unixMountGetDevicePath :: (HasCallStack, MonadIO m) => UnixMountEntry -> m [Char]
- unixMountGetFsType :: (HasCallStack, MonadIO m) => UnixMountEntry -> m Text
- unixMountGetMountPath :: (HasCallStack, MonadIO m) => UnixMountEntry -> m [Char]
- unixMountGuessCanEject :: (HasCallStack, MonadIO m) => UnixMountEntry -> m Bool
- unixMountGuessIcon :: (HasCallStack, MonadIO m) => UnixMountEntry -> m Icon
- unixMountGuessName :: (HasCallStack, MonadIO m) => UnixMountEntry -> m Text
- unixMountGuessShouldDisplay :: (HasCallStack, MonadIO m) => UnixMountEntry -> m Bool
- unixMountGuessSymbolicIcon :: (HasCallStack, MonadIO m) => UnixMountEntry -> m Icon
- unixMountIsReadonly :: (HasCallStack, MonadIO m) => UnixMountEntry -> m Bool
- unixMountIsSystemInternal :: (HasCallStack, MonadIO m) => UnixMountEntry -> m Bool
- unixMountPointsChangedSince :: (HasCallStack, MonadIO m) => Word64 -> m Bool
- unixMountsChangedSince :: (HasCallStack, MonadIO m) => Word64 -> m Bool
Methods
busGet
Arguments
| :: (HasCallStack, MonadIO m, IsCancellable a) | |
| => BusType |
|
| -> Maybe a |
|
| -> Maybe AsyncReadyCallback |
|
| -> m () |
Asynchronously connects to the message bus specified by busType.
When the operation is finished, callback will be invoked. You can
then call busGetFinish to get the result of the operation.
This is a asynchronous failable function. See busGetSync for
the synchronous version.
Since: 2.26
busGetFinish
Arguments
| :: (HasCallStack, MonadIO m, IsAsyncResult a) | |
| => a |
|
| -> m DBusConnection | Returns: a |
Finishes an operation started with busGet.
The returned object is a singleton, that is, shared with other
callers of busGet and busGetSync for busType. In the
event that you need a private message bus connection, use
dbusAddressGetForBusSync and
dBusConnectionNewForAddress.
Note that the returned DBusConnection object will (usually) have
the DBusConnection:exit-on-close property set to True.
Since: 2.26
busGetSync
Arguments
| :: (HasCallStack, MonadIO m, IsCancellable a) | |
| => BusType |
|
| -> Maybe a |
|
| -> m DBusConnection | Returns: a |
Synchronously connects to the message bus specified by busType.
Note that the returned object may shared with other callers,
e.g. if two separate parts of a process calls this function with
the same busType, they will share the same object.
This is a synchronous failable function. See busGet and
busGetFinish for the asynchronous version.
The returned object is a singleton, that is, shared with other
callers of busGet and busGetSync for busType. In the
event that you need a private message bus connection, use
dbusAddressGetForBusSync and
dBusConnectionNewForAddress.
Note that the returned DBusConnection object will (usually) have
the DBusConnection:exit-on-close property set to True.
Since: 2.26
busOwnName
Arguments
| :: (HasCallStack, MonadIO m) | |
| => BusType |
|
| -> Text |
|
| -> [BusNameOwnerFlags] |
|
| -> Maybe Closure |
|
| -> Maybe Closure |
|
| -> Maybe Closure |
|
| -> m Word32 | Returns: an identifier (never 0) that an be used with
|
Version of g_bus_own_name() using closures instead of callbacks for
easier binding in other languages.
Since: 2.26
busOwnNameOnConnection
busOwnNameOnConnection Source #
Arguments
| :: (HasCallStack, MonadIO m, IsDBusConnection a) | |
| => a |
|
| -> Text |
|
| -> [BusNameOwnerFlags] |
|
| -> Maybe Closure |
|
| -> Maybe Closure |
|
| -> m Word32 | Returns: an identifier (never 0) that an be used with
|
Version of g_bus_own_name_on_connection() using closures instead of
callbacks for easier binding in other languages.
Since: 2.26
busUnownName
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Word32 |
|
| -> m () |
Stops owning a name.
Since: 2.26
busUnwatchName
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Word32 |
|
| -> m () |
Stops watching a name.
Since: 2.26
busWatchName
Arguments
| :: (HasCallStack, MonadIO m) | |
| => BusType |
|
| -> Text |
|
| -> [BusNameWatcherFlags] |
|
| -> Maybe Closure |
|
| -> Maybe Closure |
|
| -> m Word32 | Returns: An identifier (never 0) that an be used with
|
Version of g_bus_watch_name() using closures instead of callbacks for
easier binding in other languages.
Since: 2.26
busWatchNameOnConnection
busWatchNameOnConnection Source #
Arguments
| :: (HasCallStack, MonadIO m, IsDBusConnection a) | |
| => a |
|
| -> Text |
|
| -> [BusNameWatcherFlags] |
|
| -> Maybe Closure |
|
| -> Maybe Closure |
|
| -> m Word32 | Returns: An identifier (never 0) that an be used with
|
Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
easier binding in other languages.
Since: 2.26
contentTypeCanBeExecutable
contentTypeCanBeExecutable Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m Bool | Returns: |
Checks if a content type can be executable. Note that for instance things like text files can be executables (i.e. scripts and batch files).
contentTypeEquals
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> Text |
|
| -> m Bool | Returns: |
Compares two content types for equality.
contentTypeFromMimeType
contentTypeFromMimeType Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m (Maybe Text) | Returns: Newly allocated string with content type or
|
Tries to find a content type based on the mime type name.
Since: 2.18
contentTypeGetDescription
contentTypeGetDescription Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m Text | Returns: a short description of the content type |
Gets the human readable description of the content type.
contentTypeGetGenericIconName
contentTypeGetGenericIconName Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m (Maybe Text) | Returns: the registered generic icon name for the given |
Gets the generic icon name for a content type.
See the shared-mime-info specification for more on the generic icon name.
Since: 2.34
contentTypeGetIcon
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m Icon | Returns: |
Gets the icon for a content type.
contentTypeGetMimeType
contentTypeGetMimeType Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m (Maybe Text) | Returns: the registered mime type for the given |
Gets the mime type for the content type, if one is registered.
contentTypeGetSymbolicIcon
contentTypeGetSymbolicIcon Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m Icon | Returns: symbolic |
Gets the symbolic icon for a content type.
Since: 2.34
contentTypeGuess
contentTypeGuessForTree
contentTypeGuessForTree Source #
Arguments
| :: (HasCallStack, MonadIO m, IsFile a) | |
| => a |
|
| -> m [Text] | Returns: an |
Tries to guess the type of the tree with root root, by
looking at the files it contains. The result is an array
of content types, with the best guess coming first.
The types returned all have the form x-content/foo, e.g. x-content/audio-cdda (for audio CDs) or x-content/image-dcf (for a camera memory card). See the shared-mime-info specification for more on x-content types.
This function is useful in the implementation of
mountGuessContentType.
Since: 2.18
contentTypeIsA
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> Text |
|
| -> m Bool | Returns: |
Determines if type is a subset of supertype.
contentTypeIsMimeType
contentTypeIsMimeType Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> Text |
|
| -> m Bool | Returns: |
Determines if type is a subset of mimeType.
Convenience wrapper around contentTypeIsA.
Since: 2.52
contentTypeIsUnknown
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m Bool | Returns: |
Checks if the content type is the generic "unknown" type. On UNIX this is the "application/octet-stream" mimetype, while on win32 it is "*" and on OSX it is a dynamic type or octet-stream.
contentTypesGetRegistered
contentTypesGetRegistered Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m [Text] | Returns: list of the registered content types |
Gets a list of strings containing all the registered content types known to the system. The list and its data should be freed using g_list_free_full (list, g_free).
dbusAddressEscapeValue
dbusAddressEscapeValue Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m Text | Returns: a copy of |
Escape string so it can appear in a D-Bus address as the value
part of a key-value pair.
For instance, if string is "/run/bus-for-:0",
this function would return "/run/bus-for-3A0",
which could be used in a D-Bus address like
"unix:nonce-tcp:host=127.0.0.1,port=42,noncefile=/run/bus-for-3A0".
Since: 2.36
dbusAddressGetForBusSync
dbusAddressGetForBusSync Source #
Arguments
| :: (HasCallStack, MonadIO m, IsCancellable a) | |
| => BusType |
|
| -> Maybe a |
|
| -> m Text | Returns: a valid D-Bus address string for |
Synchronously looks up the D-Bus address for the well-known message
bus instance specified by busType. This may involve using various
platform specific mechanisms.
The returned address will be in the D-Bus address format.
Since: 2.26
dbusAddressGetStream
Arguments
| :: (HasCallStack, MonadIO m, IsCancellable a) | |
| => Text |
|
| -> Maybe a |
|
| -> Maybe AsyncReadyCallback |
|
| -> m () |
Asynchronously connects to an endpoint specified by address and
sets up the connection so it is in a state to run the client-side
of the D-Bus authentication conversation. address must be in the
D-Bus address format.
When the operation is finished, callback will be invoked. You can
then call dbusAddressGetStreamFinish to get the result of
the operation.
This is an asynchronous failable function. See
dbusAddressGetStreamSync for the synchronous version.
Since: 2.26
dbusAddressGetStreamFinish
dbusAddressGetStreamFinish Source #
Arguments
| :: (HasCallStack, MonadIO m, IsAsyncResult a) | |
| => a |
|
| -> m (IOStream, Text) | Returns: A |
Finishes an operation started with dbusAddressGetStream.
Since: 2.26
dbusAddressGetStreamSync
dbusAddressGetStreamSync Source #
Arguments
| :: (HasCallStack, MonadIO m, IsCancellable a) | |
| => Text |
|
| -> Maybe a |
|
| -> m (IOStream, Text) | Returns: A |
Synchronously connects to an endpoint specified by address and
sets up the connection so it is in a state to run the client-side
of the D-Bus authentication conversation. address must be in the
D-Bus address format.
This is a synchronous failable function. See
dbusAddressGetStream for the asynchronous version.
Since: 2.26
dbusGenerateGuid
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m Text | Returns: A valid D-Bus GUID. Free with |
Generate a D-Bus GUID that can be used with
e.g. dBusConnectionNew.
See the D-Bus specification regarding what strings are valid D-Bus GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
Since: 2.26
dbusGvalueToGvariant
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GValue | |
| -> VariantType |
|
| -> m GVariant | Returns: A |
Converts a Value to a GVariant of the type indicated by the type
parameter.
The conversion is using the following rules:
G_TYPE_STRING: 's', 'o', 'g' or 'ay'G_TYPE_STRV: 'as', 'ao' or 'aay'G_TYPE_BOOLEAN: 'b'G_TYPE_UCHAR: 'y'G_TYPE_INT: 'i', 'n'G_TYPE_UINT: 'u', 'q'G_TYPE_INT64'x'G_TYPE_UINT64: 't'G_TYPE_DOUBLE: 'd'G_TYPE_VARIANT: AnyVariantType
This can fail if e.g. gvalue is of type G_TYPE_STRING and type
is ['i'][G-VARIANT-TYPE-INT32:CAPS]. It will also fail for any GType
(including e.g. G_TYPE_OBJECT and G_TYPE_BOXED derived-types) not
in the table above.
Note that if gvalue is of type G_TYPE_VARIANT and its value is
Nothing, the empty GVariant instance (never Nothing) for type is
returned (e.g. 0 for scalar types, the empty string for string types,
'/' for object path types, the empty array for any array type and so on).
See the dbusGvariantToGvalue function for how to convert a
GVariant to a Value.
Since: 2.30
dbusGvariantToGvalue
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GVariant |
|
| -> m GValue |
Converts a GVariant to a Value. If value is floating, it is consumed.
The rules specified in the dbusGvalueToGvariant function are
used - this function is essentially its reverse form.
The conversion never fails - a valid Value is always returned in
outGvalue.
Since: 2.30
dbusIsAddress
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m Bool | Returns: |
Checks if string is a
D-Bus address.
This doesn't check if string is actually supported by DBusServer
or DBusConnection - use dbusIsSupportedAddress to do more
checks.
Since: 2.26
dbusIsGuid
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m Bool |
Checks if string is a D-Bus GUID.
See the D-Bus specification regarding what strings are valid D-Bus GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
Since: 2.26
dbusIsInterfaceName
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m Bool |
Checks if string is a valid D-Bus interface name.
Since: 2.26
dbusIsMemberName
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m Bool |
Checks if string is a valid D-Bus member (e.g. signal or method) name.
Since: 2.26
dbusIsName
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m Bool |
Checks if string is a valid D-Bus bus name (either unique or well-known).
Since: 2.26
dbusIsSupportedAddress
dbusIsSupportedAddress Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m () | (Can throw |
Like dbusIsAddress but also checks if the library supports the
transports in string and that key/value pairs for each transport
are valid. See the specification of the
D-Bus address format.
Since: 2.26
dbusIsUniqueName
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m Bool |
Checks if string is a valid D-Bus unique bus name.
Since: 2.26
ioErrorFromErrno
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Int32 |
|
| -> m IOErrorEnum | Returns: |
Converts errno.h error codes into GIO error codes. The fallback
value IOErrorEnumFailed is returned for error codes not currently
handled (but note that future GLib releases may return a more
specific value instead).
ioErrorQuark
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m Word32 | Returns: a |
Gets the GIO Error Quark.
ioModulesScanAllInDirectory
ioModulesScanAllInDirectory Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => [Char] |
|
| -> m () |
Scans all the modules in the specified directory, ensuring that any extension point implemented by a module is registered.
This may not actually load and initialize all the types in each
module, some modules may be lazily loaded and initialized when
an extension point it implementes is used with e.g.
iOExtensionPointGetExtensions or
iOExtensionPointGetExtensionByName.
If you need to guarantee that all types are loaded in all the modules,
use g_io_modules_load_all_in_directory().
Since: 2.24
ioModulesScanAllInDirectoryWithScope
ioModulesScanAllInDirectoryWithScope Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => [Char] |
|
| -> IOModuleScope |
|
| -> m () |
Scans all the modules in the specified directory, ensuring that any extension point implemented by a module is registered.
This may not actually load and initialize all the types in each
module, some modules may be lazily loaded and initialized when
an extension point it implementes is used with e.g.
iOExtensionPointGetExtensions or
iOExtensionPointGetExtensionByName.
If you need to guarantee that all types are loaded in all the modules,
use g_io_modules_load_all_in_directory().
Since: 2.30
ioSchedulerCancelAllJobs
ioSchedulerCancelAllJobs :: (HasCallStack, MonadIO m) => m () Source #
Deprecated: You should never call this function, since you don'tknow how other libraries in your program might be making use ofgioscheduler.
Cancels all cancellable I/O jobs.
A job is cancellable if a Cancellable was passed into
ioSchedulerPushJob.
ioSchedulerPushJob
Arguments
| :: (HasCallStack, MonadIO m, IsCancellable a) | |
| => IOSchedulerJobFunc |
|
| -> Int32 |
|
| -> Maybe a |
|
| -> m () |
Deprecated: use ThreadPool or g_task_run_in_thread()
Schedules the I/O job to run in another thread.
notify will be called on userData after jobFunc has returned,
regardless whether the job was cancelled or has run to completion.
If cancellable is not Nothing, it can be used to cancel the I/O job
by calling cancellableCancel or by calling
ioSchedulerCancelAllJobs.
keyfileSettingsBackendNew
keyfileSettingsBackendNew Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> Text |
|
| -> Maybe Text |
|
| -> m SettingsBackend | Returns: a keyfile-backed |
Creates a keyfile-backed SettingsBackend.
The filename of the keyfile to use is given by filename.
All settings read to or written from the backend must fall under the
path given in rootPath (which must start and end with a slash and
not contain two consecutive slashes). rootPath may be "/".
If rootGroup is non-Nothing then it specifies the name of the keyfile
group used for keys that are written directly below rootPath. For
example, if rootPath is "/apps/example/" and rootGroup is
"toplevel", then settings the key "/apps/example/enabled" to a value
of True will cause the following to appear in the keyfile:
[toplevel] enabled=true
If rootGroup is Nothing then it is not permitted to store keys
directly below the rootPath.
For keys not stored directly below rootPath (ie: in a sub-path),
the name of the subpath (with the final slash stripped) is used as
the name of the keyfile group. To continue the example, if
"/apps/example/profiles/default/font-size" were set to
12 then the following would appear in the keyfile:
[profiles/default] font-size=12
The backend will refuse writes (and return writability as being
False) for keys outside of rootPath and, in the event that
rootGroup is Nothing, also for keys directly under rootPath.
Writes will also be refused if the backend detects that it has the
inability to rewrite the keyfile (ie: the containing directory is not
writable).
There is no checking done for your key namespace clashing with the syntax of the key file format. For example, if you have '[' or ']' characters in your path names or '=' in your key names you may be in trouble.
memorySettingsBackendNew
memorySettingsBackendNew Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m SettingsBackend | Returns: a newly created |
Creates a memory-backed SettingsBackend.
This backend allows changes to settings, but does not write them to any backing storage, so the next time you run your application, the memory backend will start out with the default values again.
Since: 2.28
networkingInit
networkingInit :: (HasCallStack, MonadIO m) => m () Source #
Initializes the platform networking libraries (eg, on Windows, this
calls WSAStartup()). GLib will call this itself if it is needed, so
you only need to call it if you directly call system networking
functions (without calling any GLib networking functions first).
Since: 2.36
nullSettingsBackendNew
nullSettingsBackendNew Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m SettingsBackend | Returns: a newly created |
Creates a readonly SettingsBackend.
This backend does not allow changes to settings, so all settings will always have their default values.
Since: 2.28
pollableSourceNew
Arguments
| :: (HasCallStack, MonadIO m, IsObject a) | |
| => a |
|
| -> m Source | Returns: the new |
Utility method for PollableInputStream and PollableOutputStream
implementations. Creates a new Source that expects a callback of
type PollableSourceFunc. The new source does not actually do
anything on its own; use sourceAddChildSource to add other
sources to it to cause it to trigger.
Since: 2.28
pollableSourceNewFull
pollableSourceNewFull Source #
Arguments
| :: (HasCallStack, MonadIO m, IsObject a, IsCancellable b) | |
| => a |
|
| -> Maybe Source |
|
| -> Maybe b |
|
| -> m Source | Returns: the new |
Utility method for PollableInputStream and PollableOutputStream
implementations. Creates a new Source, as with
pollableSourceNew, but also attaching childSource (with a
dummy callback), and cancellable, if they are non-Nothing.
Since: 2.34
pollableStreamRead
Arguments
| :: (HasCallStack, MonadIO m, IsInputStream a, IsCancellable b) | |
| => a |
|
| -> ByteString |
|
| -> Bool |
|
| -> Maybe b |
|
| -> m Int64 | Returns: the number of bytes read, or -1 on error. (Can throw |
Tries to read from stream, as with inputStreamRead (if
blocking is True) or pollableInputStreamReadNonblocking
(if blocking is False). This can be used to more easily share
code between blocking and non-blocking implementations of a method.
If blocking is False, then stream must be a
PollableInputStream for which pollableInputStreamCanPoll
returns True, or else the behavior is undefined. If blocking is
True, then stream does not need to be a PollableInputStream.
Since: 2.34
pollableStreamWrite
Arguments
| :: (HasCallStack, MonadIO m, IsOutputStream a, IsCancellable b) | |
| => a |
|
| -> ByteString |
|
| -> Bool |
|
| -> Maybe b |
|
| -> m Int64 | Returns: the number of bytes written, or -1 on error. (Can throw |
Tries to write to stream, as with outputStreamWrite (if
blocking is True) or pollableOutputStreamWriteNonblocking
(if blocking is False). This can be used to more easily share
code between blocking and non-blocking implementations of a method.
If blocking is False, then stream must be a
PollableOutputStream for which
pollableOutputStreamCanPoll returns True or else the
behavior is undefined. If blocking is True, then stream does not
need to be a PollableOutputStream.
Since: 2.34
pollableStreamWriteAll
pollableStreamWriteAll Source #
Arguments
| :: (HasCallStack, MonadIO m, IsOutputStream a, IsCancellable b) | |
| => a |
|
| -> ByteString |
|
| -> Bool |
|
| -> Maybe b |
|
| -> m Word64 | (Can throw |
Tries to write count bytes to stream, as with
outputStreamWriteAll, but using pollableStreamWrite
rather than outputStreamWrite.
On a successful write of count bytes, True is returned, and
bytesWritten is set to count.
If there is an error during the operation (including
IOErrorEnumWouldBlock in the non-blocking case), False is
returned and error is set to indicate the error status,
bytesWritten is updated to contain the number of bytes written
into the stream before the error occurred.
As with pollableStreamWrite, if blocking is False, then
stream must be a PollableOutputStream for which
pollableOutputStreamCanPoll returns True or else the
behavior is undefined. If blocking is True, then stream does not
need to be a PollableOutputStream.
Since: 2.34
resourcesEnumerateChildren
resourcesEnumerateChildren Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> [ResourceLookupFlags] |
|
| -> m [Text] | Returns: an array of constant strings (Can throw |
resourcesGetInfo
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> [ResourceLookupFlags] |
|
| -> m (Word64, Word32) | (Can throw |
Looks for a file at the specified path in the set of
globally registered resources and if found returns information about it.
lookupFlags controls the behaviour of the lookup.
Since: 2.32
resourcesLookupData
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> [ResourceLookupFlags] |
|
| -> m Bytes | Returns: |
Looks for a file at the specified path in the set of
globally registered resources and returns a Bytes that
lets you directly access the data in memory.
The data is always followed by a zero byte, so you can safely use the data as a C string. However, that byte is not included in the size of the GBytes.
For uncompressed resource files this is a pointer directly into the resource bundle, which is typically in some readonly data section in the program binary. For compressed files we allocate memory on the heap and automatically uncompress the data.
lookupFlags controls the behaviour of the lookup.
Since: 2.32
resourcesOpenStream
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> [ResourceLookupFlags] |
|
| -> m InputStream | Returns: |
Looks for a file at the specified path in the set of
globally registered resources and returns a InputStream
that lets you read the data.
lookupFlags controls the behaviour of the lookup.
Since: 2.32
resourcesRegister
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Resource |
|
| -> m () |
Registers the resource with the process-global set of resources.
Once a resource is registered the files in it can be accessed
with the global resource lookup functions like resourcesLookupData.
Since: 2.32
resourcesUnregister
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Resource |
|
| -> m () |
Unregisters the resource from the process-global set of resources.
Since: 2.32
simpleAsyncReportGerrorInIdle
simpleAsyncReportGerrorInIdle Source #
Arguments
| :: (HasCallStack, MonadIO m, IsObject a) | |
| => Maybe a | |
| -> Maybe AsyncReadyCallback |
|
| -> GError |
|
| -> m () |
Deprecated: (Since version 2.46)Use taskReportError.
Reports an error in an idle function. Similar to
g_simple_async_report_error_in_idle(), but takes a GError rather
than building a new one.
unixIsMountPathSystemInternal
unixIsMountPathSystemInternal Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => [Char] |
|
| -> m Bool | Returns: |
Determines if mountPath is considered an implementation of the
OS. This is primarily used for hiding mountable and mounted volumes
that only are used in the OS and has little to no relevance to the
casual user.
unixMountCompare
Arguments
| :: (HasCallStack, MonadIO m) | |
| => UnixMountEntry |
|
| -> UnixMountEntry |
|
| -> m Int32 | Returns: 1, 0 or -1 if |
Compares two unix mounts.
unixMountFree
Arguments
| :: (HasCallStack, MonadIO m) | |
| => UnixMountEntry |
|
| -> m () |
Frees a unix mount.
unixMountGetDevicePath
unixMountGetDevicePath Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => UnixMountEntry |
|
| -> m [Char] | Returns: a string containing the device path. |
Gets the device path for a unix mount.
unixMountGetFsType
Arguments
| :: (HasCallStack, MonadIO m) | |
| => UnixMountEntry |
|
| -> m Text | Returns: a string containing the file system type. |
Gets the filesystem type for the unix mount.
unixMountGetMountPath
unixMountGetMountPath Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => UnixMountEntry |
|
| -> m [Char] | Returns: the mount path for |
Gets the mount path for a unix mount.
unixMountGuessCanEject
unixMountGuessCanEject Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => UnixMountEntry |
|
| -> m Bool | Returns: |
Guesses whether a Unix mount can be ejected.
unixMountGuessIcon
Arguments
| :: (HasCallStack, MonadIO m) | |
| => UnixMountEntry |
|
| -> m Icon | Returns: a |
Guesses the icon of a Unix mount.
unixMountGuessName
Arguments
| :: (HasCallStack, MonadIO m) | |
| => UnixMountEntry |
|
| -> m Text | Returns: A newly allocated string that must
be freed with |
Guesses the name of a Unix mount. The result is a translated string.
unixMountGuessShouldDisplay
unixMountGuessShouldDisplay Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => UnixMountEntry |
|
| -> m Bool | Returns: |
Guesses whether a Unix mount should be displayed in the UI.
unixMountGuessSymbolicIcon
unixMountGuessSymbolicIcon Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => UnixMountEntry |
|
| -> m Icon | Returns: a |
Guesses the symbolic icon of a Unix mount.
Since: 2.34
unixMountIsReadonly
Arguments
| :: (HasCallStack, MonadIO m) | |
| => UnixMountEntry |
|
| -> m Bool | Returns: |
Checks if a unix mount is mounted read only.
unixMountIsSystemInternal
unixMountIsSystemInternal Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => UnixMountEntry |
|
| -> m Bool | Returns: |
Checks if a unix mount is a system path.
unixMountPointsChangedSince
unixMountPointsChangedSince Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Word64 |
|
| -> m Bool | Returns: |
Checks if the unix mount points have changed since a given unix time.
unixMountsChangedSince
unixMountsChangedSince Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Word64 |
|
| -> m Bool | Returns: |
Checks if the unix mounts have changed since a given unix time.