Namespace
Gio – 2.0
Gio is a library providing useful classes for general purpose I/O, networking, IPC, settings, and other high level application functionality
Build
gio/gio.h
gio-2.0
Dependencies
Additional documentation
- Overview
- File Attributes
- TLS Overview
- GIOError
- Pollable Utility Functions
- D-Bus Error Handling
- D-Bus Introspection Data
- D-Bus Name Owning
- D-Bus Name Watching
- D-Bus Utilities
- GMenuModel Exporter
- gnetworking.h
- Migrating to GDBus
- Migrating from GConf to GSettings
- Migrating from GnomeVFS to GIO
- Migrating from POSIX to GIO
- GIOScheduler
- Content Types
- Classes Hierarchy
Classes
Integrating the launch with the launching application. This is used to handle for instance startup notification and launching the new application on the same screen as the launching window.
GApplicationCommandLine
represents a command-line invocation of
an application.
Buffered input stream implements GFilterInputStream
and provides
for buffered reads.
Buffered output stream implements GFilterOutputStream
and provides
for buffered writes.
GBytesIcon
specifies an image held in memory in a common format (usually
PNG) to be used as icon.
since: 2.38
GCancellable
allows operations to be cancelled.
GCharsetConverter
is an implementation of GConverter
based on
GIConv
.
Converter input stream implements GInputStream
and allows
conversion of data of various types during reading.
Converter output stream implements GOutputStream
and allows
conversion of data of various types during reading.
The GCredentials
type is a reference-counted wrapper for native credentials.
since: 2.26
Data input stream implements GInputStream
and includes functions
for reading structured data directly from a binary input stream.
Data output stream implements GOutputStream
and includes functions
for writing data directly to an output stream.
GDBusActionGroup
is an implementation of the GActionGroup
interface.
GDBusAuthObserver
provides a mechanism for participating
in how a GDBusServer
(or a GDBusConnection
)
authenticates remote peers.
since: 2.26
The GDBusConnection
type is used for D-Bus connections to remote
peers such as a message buses.
since: 2.26
GDBusMenuModel
is an implementation of GMenuModel
that can be
used as a proxy for a menu model that is exported over D-Bus with
g_dbus_connection_export_menu_model()
.
A type for representing D-Bus messages that can be sent or received
on a GDBusConnection
.
since: 2.26
Instances of the GDBusMethodInvocation
class are used when
handling D-Bus method calls. It provides a way to asynchronously
return results and errors.
since: 2.26
GDBusObjectManagerClient
is used to create, monitor and delete object
proxies for remote objects exported by a GDBusObjectManagerServer
(or any code implementing the
org.freedesktop.DBus.ObjectManager interface).
since: 2.30
GDBusObjectManagerServer
is used to export GDBusObject
instances
using the standardized
org.freedesktop.DBus.ObjectManager
interface. For example, remote D-Bus clients can get all objects
and properties in a single call. Additionally, any change in the
object hierarchy is broadcast using signals. This means that D-Bus
clients can keep caches up to date by only listening to D-Bus signals.
since: 2.30
A GDBusObjectProxy
is an object used to represent a remote object
with one or more D-Bus interfaces. Normally, you don’t instantiate
a GDBusObjectProxy
yourself — typically GDBusObjectManagerClient
is used to obtain it.
since: 2.30
A GDBusObjectSkeleton
instance is essentially a group of D-Bus
interfaces. The set of exported interfaces on the object may be
dynamic and change at runtime.
since: 2.30
GDBusProxy
is a base class used for proxies to access a D-Bus
interface on a remote object. A GDBusProxy
can be constructed for
both well-known and unique names.
since: 2.26
GDBusServer
is a helper for listening to and accepting D-Bus
connections. This can be used to create a new D-Bus server, allowing two
peers to use the D-Bus protocol for their own specialized communication.
A server instance provided in this way will not perform message routing or
implement the
org.freedesktop.DBus
interface.
since: 2.26
GDebugControllerDBus
is an implementation of GDebugController
which exposes debug settings as a D-Bus object.
since: 2.72
GEmblem
is an implementation of GIcon
that supports
having an emblem, which is an icon with additional properties.
It can than be added to a GEmblemedIcon
.
GEmblemedIcon
is an implementation of GIcon
that supports
adding an emblem to an icon. Adding multiple emblems to an
icon is ensured via g_emblemed_icon_add_emblem()
.
GFileEnumerator
allows you to operate on a set of GFile
objects,
returning a GFileInfo
structure for each file enumerated (e.g.
g_file_enumerate_children()
will return a GFileEnumerator
for each
of the children within a directory).
GFileIcon
specifies an icon by pointing to an image file
to be used as icon.
Stores information about a file system object referenced by a GFile
.
GFileInputStream
provides input streams that take their
content from a file.
GFileIOStream
provides I/O streams that both read and write to the same
file handle.
since: 2.22
Monitors a file or directory for changes.
Completes partial file and directory names given a partial string by looking in the file system for clues. Can return a list of possible completion strings for widget implementations.
GFileOutputStream
provides output streams that write their
content to a file.
Base class for input stream implementations that perform some kind of filtering operation on a base stream. Typical examples of filtering operations are character set conversion, compression and byte order flipping.
Base class for output stream implementations that perform some kind of filtering operation on a base stream. Typical examples of filtering operations are character set conversion, compression and byte order flipping.
GInetAddress
represents an IPv4 or IPv6 internet address. Use
g_resolver_lookup_by_name()
or
g_resolver_lookup_by_name_async()
to look up the GInetAddress
for
a hostname. Use g_resolver_lookup_by_address()
or
g_resolver_lookup_by_address_async()
to look up the hostname for a
GInetAddress
.
GInetAddressMask
represents a range of IPv4 or IPv6 addresses
described by a base address and a length indicating how many bits
of the base address are relevant for matching purposes. These are
often given in string form. For example, 10.0.0.0/8
, or fe80::/10
.
since: 2.32
An IPv4 or IPv6 socket address. That is, the combination of a
GInetAddress
and a port number.
GInputStream
is a base class for implementing streaming input.
Provides an interface and default functions for loading and unloading modules. This is used internally to make GIO extensible, but can also be used by others to implement module loading.
GIOStream
represents an object that has both read and write streams.
Generally the two streams act as separate input and output streams,
but they share some common resources and state. For instance, for
seekable streams, both streams may use the same position.
since: 2.22
GListStore
is a simple implementation of GListModel
that stores
all items in memory.
GMemoryInputStream
is a class for using arbitrary
memory chunks as input for GIO streaming input operations.
GMemoryOutputStream
is a class for using arbitrary
memory chunks as output for GIO streaming output operations.
GMenu
is a simple implementation of GMenuModel
.
You populate a GMenu
by adding GMenuItem
instances to it.
since: 2.32
GMenuAttributeIter
is an opaque structure type. You must access it
using the functions below.
since: 2.32
GMenuItem
is an opaque structure type. You must access it using the
functions below.
since: 2.32
GMenuLinkIter
is an opaque structure type. You must access it using
the functions below.
since: 2.32
GMenuModel
represents the contents of a menu — an ordered list of
menu items. The items are associated with actions, which can be
activated through them. Items can be grouped in sections, and may
have submenus associated with them. Both items and sections usually
have some representation data, such as labels or icons. The type of
the associated action (ie whether it is stateful, and what kind of
state it has) can influence the representation of the item.
since: 2.32
GMountOperation
provides a mechanism for interacting with the user.
It can be used for authenticating mountable operations, such as loop
mounting files, hard drive partitions or server locations. It can
also be used to ask the user questions or show a list of applications
preventing unmount or eject operations from completing.
GNetworkAddress
provides an easy way to resolve a hostname and
then attempt to connect to that host, handling the possibility of
multiple IP addresses and multiple address families.
Like GNetworkAddress
does with hostnames, GNetworkService
provides an easy way to resolve a SRV record, and then attempt to
connect to one of the hosts that implements that service, handling
service priority/weighting, multiple IP addresses, and multiple
address families.
GNotification
is a mechanism for creating a notification to be shown
to the user — typically as a pop-up notification presented by the
desktop environment shell.
since: 2.40
GOutputStream
is a base class for implementing streaming output.
A GPermission
represents the status of the caller’s permission to
perform a certain action.
A GPropertyAction
is a way to get a GAction
with a state value
reflecting and controlling the value of a GObject
property.
since: 2.38
GProxyAddressEnumerator
is a wrapper around
GSocketAddressEnumerator
which takes the GSocketAddress
instances returned by the GSocketAddressEnumerator
and wraps them in GProxyAddress
instances, using the given
GProxyAddressEnumerator:proxy-resolver
.
The object that handles DNS resolution. Use g_resolver_get_default()
to get the default resolver.
The GSettings
class provides a convenient API for storing and retrieving
application settings.
The GSettingsBackend
interface defines a generic interface for
non-strictly-typed data that is stored in a hierarchy. To implement
an alternative storage backend for GSettings
, you need to
implement the GSettingsBackend
interface and then make it implement the
extension point G_SETTINGS_BACKEND_EXTENSION_POINT_NAME
.
A GSimpleAction
is the obvious simple implementation of the
GAction
interface. This is the easiest way to create an action for
purposes of adding it to a GSimpleActionGroup
.
GSimpleActionGroup
is a hash table filled with GAction
objects,
implementing the GActionGroup
and GActionMap
interfaces.
since: 2.28
As of GLib 2.46, GSimpleAsyncResult
is deprecated in favor of
GTask
, which provides a simpler API.
GSimpleIOStream
creates a GIOStream
from an arbitrary
GInputStream
and GOutputStream
. This allows any pair of
input and output streams to be used with GIOStream
methods.
since: 2.44
GSimplePermission
is a trivial implementation of GPermission
that represents a permission that is either always or never allowed. The
value is given at construction and doesn’t change.
GSimpleProxyResolver
is a simple GProxyResolver
implementation
that handles a single default proxy, multiple URI-scheme-specific
proxies, and a list of hosts that proxies should not be used for.
since: 2.36
A GSocket
is a low-level networking primitive. It is a more or less
direct mapping of the BSD socket API in a portable GObject based API.
It supports both the UNIX socket implementations and winsock2 on Windows.
since: 2.22
GSocketAddress
is the equivalent of
struct sockaddr
and its subtypes in the BSD sockets
API. This is an abstract class; use GInetSocketAddress
for
internet sockets, or GUnixSocketAddress
for UNIX domain sockets.
GSocketAddressEnumerator
is an enumerator type for
GSocketAddress
instances. It is returned by enumeration functions
such as g_socket_connectable_enumerate()
, which returns a
GSocketAddressEnumerator
to list each GSocketAddress
which could
be used to connect to that GSocketConnectable
.
GSocketClient
is a lightweight high-level utility class for connecting to
a network host using a connection oriented socket type.
since: 2.22
GSocketConnection
is a GIOStream
for a connected socket. They
can be created either by GSocketClient
when connecting to a host,
or by GSocketListener
when accepting a new client.
since: 2.22
A GSocketControlMessage
is a special-purpose utility message that
can be sent to or received from a GSocket
. These types of
messages are often called ‘ancillary data’.
since: 2.22
A GSocketListener
is an object that keeps track of a set
of server sockets and helps you accept sockets from any of the
socket, either sync or async.
since: 2.22
A GSocketService
is an object that represents a service that
is provided to the network or over local sockets. When a new
connection is made to the service the GSocketService::incoming
signal is emitted.
since: 2.22
This class contains a set of options for launching child processes, such as where its standard input and output will be directed, the argument list, the environment, and more.
since: 2.40
A GTask
represents and manages a cancellable ‘task’.
This is the subclass of GSocketConnection
that is created
for TCP/IP sockets.
since: 2.22
A GTcpWrapperConnection
can be used to wrap a GIOStream
that is
based on a GSocket
, but which is not actually a
GSocketConnection
. This is used by GSocketClient
so
that it can always return a GSocketConnection
, even when the
connection it has actually created is not directly a
GSocketConnection
.
since: 2.28
A helper class for testing code which uses D-Bus without touching the user’s session bus.
since: 2.34
GThemedIcon
is an implementation of GIcon
that supports icon themes.
GThreadedResolver
is an implementation of GResolver
which calls the libc
lookup functions in threads to allow them to run asynchronously.
since: 2.20
A GThreadedSocketService
is a simple subclass of GSocketService
that handles incoming connections by creating a worker thread and
dispatching the connection to it by emitting the
[signal@Gio.ThreadedSocketService::run signal] in the new thread.
since: 2.22
A certificate used for TLS authentication and encryption.
This can represent either a certificate only (eg, the certificate
received by a client from a server), or the combination of
a certificate and a private key (which is needed when acting as a
GTlsServerConnection
).
since: 2.28
GTlsConnection
is the base TLS connection class type, which wraps
a GIOStream
and provides TLS encryption on top of it. Its
subclasses, GTlsClientConnection
and
GTlsServerConnection
, implement client-side and server-side TLS, respectively.
since: 2.28
GTlsDatabase
is used to look up certificates and other information
from a certificate or key store. It is an abstract base class which
TLS library specific subtypes override.
since: 2.30
GTlsInteraction
provides a mechanism for the TLS connection and database
code to interact with the user. It can be used to ask the user for passwords.
since: 2.30
An abstract interface representing a password used in TLS. Often used in user interaction such as unlocking a key storage token.
since: 2.30
This is the subclass of GSocketConnection
that is created
for UNIX domain sockets.
since: 2.22
This GSocketControlMessage
contains a GCredentials
instance. It may be sent using g_socket_send_message()
and received
using g_socket_receive_message()
over UNIX sockets (ie: sockets in
the G_SOCKET_FAMILY_UNIX
family).
since: 2.26
A GUnixFDList
contains a list of file descriptors. It owns the file
descriptors that it contains, closing them when finalized.
Support for UNIX-domain (also known as local) sockets, corresponding to
struct sockaddr_un
.
Entry point for using GIO functionality.
GVolumeMonitor
is for listing the user interesting devices and volumes
on the computer. In other words, what a file selector or file manager
would show in a sidebar.
GZlibCompressor
is an implementation of GConverter
that
compresses data using zlib.
GZlibDecompressor
is an implementation of GConverter
that
decompresses data compressed with zlib.
Interfaces
GAction
represents a single named action.
GActionGroup
represents a group of actions.
Information about an installed application and methods to launch it (with file arguments).
GAsyncResult
provides a base class for implementing asynchronous function results.
The GDBusObject
type is the base type for D-Bus objects on both
the service side (see GDBusObjectSkeleton
) and the client side
(see GDBusObjectProxy
). It is essentially just a container of interfaces.
The GDBusObjectManager
type is the base type for service- and
client-side implementations of the standardized
org.freedesktop.DBus.ObjectManager
interface.
GDebugController
is an interface to expose control of debugging features and
debug output.
since: 2.72
GDrive
represents a piece of hardware connected to the machine.
It’s generally only created for removable hardware or hardware with
removable media. For example, an optical disc drive, or a USB flash drive.
GDtlsClientConnection
is the client-side subclass of
GDtlsConnection
, representing a client-side DTLS connection.
since: 2.48
GDtlsConnection
is the base DTLS connection class type, which wraps
a GDatagramBased
and provides DTLS encryption on top of it. Its
subclasses, GDtlsClientConnection
and
GDtlsServerConnection
, implement client-side and server-side DTLS, respectively.
since: 2.48
GDtlsServerConnection
is the server-side subclass of
GDtlsConnection
, representing a server-side DTLS connection.
since: 2.48
GFile
is a high level abstraction for manipulating files on a
virtual file system. GFile
s are lightweight, immutable objects
that do no I/O upon creation. It is necessary to understand that
GFile
objects do not represent files, merely an identifier for a
file. All file content I/O is implemented as streaming operations
(see GInputStream
and GOutputStream
).
GIcon
is a very minimal interface for icons. It provides functions
for checking the equality of two icons, hashing of icons and
serializing an icon to and from strings.
GInitable
is implemented by objects that can fail during
initialization. If an object implements this interface then
it must be initialized as the first thing after construction,
either via g_initable_init()
or g_async_initable_init_async()
(the latter is only available if it also implements GAsyncInitable
).
since: 2.22
GListModel
is an interface that represents a mutable list of
GObject
. Its main intention is as a model for various widgets
in user interfaces, such as list views, but it can also be used as a
convenient method of returning lists of data, with support for updates.
GLoadableIcon
extends the GIcon
interface and adds the ability
to load icons from streams.
GMemoryMonitor
will monitor system memory and suggest to the application
when to free memory so as to leave more room for other applications.
It is implemented on Linux using the
Low Memory Monitor
(API documentation).
since: 2.64
The GMount
interface represents a user-visible mount, such as a mounted
file system.
GNetworkMonitor
provides an easy-to-use cross-platform API
for monitoring network connectivity. On Linux, the available
implementations are based on the kernel’s netlink interface and
on NetworkManager.
since: 2.32
GPollableInputStream
is implemented by GInputStream
s that
can be polled for readiness to read. This can be used when
interfacing with a non-GIO API that expects
UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
since: 2.28
GPollableOutputStream
is implemented by GOutputStream
s that
can be polled for readiness to write. This can be used when
interfacing with a non-GIO API that expects
UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
since: 2.28
GPowerProfileMonitor
makes it possible for applications as well as OS
components to monitor system power profiles and act upon them. It currently
only exports whether the system is in "Power Saver" mode (known as
"Low Power" mode on some systems).
since: 2.70
A GProxy
handles connecting to a remote host via a given type of
proxy server. It is implemented by the gio-proxy
extension point.
The extensions are named after their proxy protocol name. As an
example, a SOCKS5 proxy implementation can be retrieved with the
name socks5
using the function
g_io_extension_point_get_extension_by_name()
.
since: 2.26
GProxyResolver
provides synchronous and asynchronous network proxy
resolution. GProxyResolver
is used within GSocketClient
through
the method g_socket_connectable_proxy_enumerate()
.
since: 2.26
The GRemoteActionGroup
interface is implemented by GActionGroup
instances that either transmit action invocations to other processes
or receive action invocations in the local process from other processes.
since: 2.32
GSeekable
is implemented by streams (implementations of
GInputStream
or GOutputStream
) that support seeking.
Objects that describe one or more potential socket endpoints
implement GSocketConnectable
. Callers can then use
g_socket_connectable_enumerate()
to get a
GSocketAddressEnumerator
to try out each socket address in turn
until one succeeds, as shown in the sample code below.
TLS (Transport Layer Security, aka SSL) and DTLS backend. This is an internal type used to coordinate the different classes implemented by a TLS backend.
since: 2.28
GTlsClientConnection
is the client-side subclass of
GTlsConnection
, representing a client-side TLS connection.
since: 2.28
GTlsFileDatabase
is implemented by GTlsDatabase
objects which
load their certificate information from a file. It is an interface which
TLS library specific subtypes implement.
since: 2.30
GTlsServerConnection
is the server-side subclass of
GTlsConnection
, representing a server-side TLS connection.
since: 2.28
The GVolume
interface represents user-visible objects that can be
mounted. For example, a file system partition on a USB flash drive, or an
optical disc inserted into a disc drive.
Structs
This struct defines a single action. It is for use with
g_action_map_add_action_entries()
.
Virtual table for handling properties and method calls for a D-Bus interface.
since: 2.26
Virtual table for handling subtrees registered with g_dbus_connection_register_subtree().
since: 2.26
Information about a specific attribute.
Acts as a lightweight registry for possible valid file attributes.
The registry stores Key-Value pair formats as GFileAttributeInfos
.
Determines if a string matches a file attribute.
Structure used for scatter/gather data input when receiving multiple
messages or packets in one go. You generally pass in an array of empty
GInputVectors
and the operation will use all the buffers as if they
were one buffer, and will set bytes_received
to the total number of bytes
received across all GInputVectors
.
since: 2.48
Structure used for scatter/gather data input.
You generally pass in an array of GInputVectors
and the operation will store the read data starting in the
first buffer, switching to the next as needed.
since: 2.22
GIOExtension
is an opaque data structure and can only be accessed
using the following functions.
GIOExtensionPoint
provides a mechanism for modules to extend the
functionality of the library or application that loaded it in an
organized fashion.
Represents a scope for loading IO modules. A scope can be used for blocking duplicate modules, or blocking a module you don’t want to load.
since: 2.30
Structure used for scatter/gather data output when sending multiple
messages or packets in one go. You generally pass in an array of
GOutputVectors
and the operation will use all the buffers as if they
were one buffer.
since: 2.44
Structure used for scatter/gather data output.
You generally pass in an array of GOutputVectors
and the operation will use all the buffers as if they were
one buffer.
since: 2.22
Applications and libraries often contain binary or textual data that is
really part of the application, rather than user data. For instance
GtkBuilder
.ui
files,
splashscreen images, GMenu
markup XML, CSS files, icons, etc.
These are often shipped as files in $datadir/appname
, or manually
included as literal strings in the code.
since: 2.32
The GSettingsSchemaSource
and GSettingsSchema
APIs provide a
mechanism for advanced control over the loading of schemas and a
mechanism for introspecting their content.
since: 2.32
GSettingsSchemaKey
is an opaque data structure and can only be accessed
using the following functions.
A single target host/port that a network service is running on.
GStaticResource
is an opaque data structure and can only be accessed
using the following functions.
Enumerations
GDataStreamByteOrder
is used to ensure proper endianness of streaming data sources
across various machine architectures.
GDataStreamNewlineType
is used when checking for or setting the line endings for a given file.
GEmblemOrigin is used to add information about the origin of the emblem
to GEmblem
.
since: 2.18
Used by g_file_set_attributes_from_info()
when setting file attributes.
The data types for file attributes.
Specifies what type of event a monitor event is.
Indicates a hint from the file system whether files should be
previewed in a file manager. Returned as the value of the key
G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW
.
Indicates the file’s on-disk type.
GMountOperationResult
is returned as a result when a request for
information is send by the mounting operation.
The host’s network connectivity state, as reported by GNetworkMonitor
.
since: 2.44
GPasswordSave
is used to indicate the lifespan of a saved password.
Return value for various IO operations that signal errors via the
return value and not necessarily via a GError
.
since: 2.60
The type of record that g_resolver_lookup_records()
or
g_resolver_lookup_records_async()
should retrieve. The records are returned
as lists of GVariant
tuples. Each record type has different values in
the variant tuples returned.
since: 2.34
Describes an event occurring on a GSocketClient
. See the
GSocketClient::event
signal for more details.
since: 2.32
The protocol family of a GSocketAddress
. (These values are
identical to the system defines AF_INET
, AF_INET6
and AF_UNIX
,
if available.).
since: 2.22
Describes an event occurring on a GSocketListener
. See the
GSocketListener::event
signal for more details.
since: 2.46
A protocol identifier is specified when creating a GSocket
, which is a
family/type specific identifier, where 0 means the default protocol for
the particular family/type.
since: 2.22
Flags used when creating a GSocket
. Some protocols may not implement
all the socket types.
since: 2.22
Flags for g_tls_interaction_request_certificate(), g_tls_interaction_request_certificate_async(), and g_tls_interaction_invoke_request_certificate().
since: 2.40
The type of TLS channel binding data to retrieve from GTlsConnection
or GDtlsConnection
, as documented by RFC 5929 or RFC 9266. The
tls-unique-for-telnet
binding type is not currently implemented.
since: 2.66
Flags for g_tls_database_lookup_certificate_for_handle(), g_tls_database_lookup_certificate_issuer(), and g_tls_database_lookup_certificates_issued_by().
since: 2.30
GTlsInteractionResult
is returned by various functions in GTlsInteraction
when finishing an interaction request.
since: 2.30
The TLS or DTLS protocol version used by a GTlsConnection
or
GDtlsConnection
. The integer values of these versions are sequential
to ensure newer known protocol versions compare greater than older
known versions. Any known DTLS protocol version will compare greater
than any SSL or TLS protocol version. The protocol version may be
G_TLS_PROTOCOL_VERSION_UNKNOWN
if the TLS backend supports a newer
protocol version that GLib does not yet know about. This means that
it’s possible for an unknown DTLS protocol version to compare less
than the TLS protocol versions.
since: 2.70
When to allow rehandshaking. See g_tls_connection_set_rehandshake_mode().
deprecated: 2.60. since: 2.28
The type of name used by a GUnixSocketAddress
.
G_UNIX_SOCKET_ADDRESS_PATH
indicates a traditional unix domain
socket bound to a filesystem path. G_UNIX_SOCKET_ADDRESS_ANONYMOUS
indicates a socket not bound to any name (eg, a client-side socket,
or a socket created with socketpair()).
since: 2.26
Used to select the type of data format to use for GZlibDecompressor
and GZlibCompressor
.
since: 2.24
Bitfields
Flags used when creating a GAppInfo
.
GAskPasswordFlags
are used to request specific information from the
user, or to notify the user of their choices in an authentication situation.
Flags describing the behavior of a GDBusInterfaceSkeleton
instance.
since: 2.30
Flags used when subscribing to signals via g_dbus_connection_signal_subscribe().
since: 2.26
Flags specifying the behaviour of an attribute.
Flags used when copying or moving files.
Flags used when an operation may create a file.
Flags used to set what a GFileMonitor
will watch for.
Flags used when querying a GFileInfo
.
Flags used when mounting a mount.
Flags used when an unmounting a mount.
GOutputStreamSpliceFlags determine how streams should be spliced.
GResourceFlags give information about a particular file inside a resource bundle.
since: 2.32
GResourceLookupFlags determine how resource path lookups are handled.
since: 2.32
Flags used when creating a binding.
Flags used in g_socket_receive_message()
and g_socket_send_message().
The flags listed in the enum are some commonly available flags, but the
values used for them are the same as on the platform, and any other flags
are passed in/out as is. So to use a platform specific flag, just include
the right system header and pass in the flag.
since: 2.22
A set of flags describing TLS certification validation. This can be
used to describe why a particular certificate was rejected (for
example, in GTlsConnection::accept-certificate
).
since: 2.28
Error Domains
Error codes returned by GIO functions.
An error code used with G_RESOLVER_ERROR
in a GError
returned
from a GResolver
routine.
since: 2.22
An error code used with G_RESOURCE_ERROR
in a GError
returned
from a GResource
routine.
since: 2.32
An error code used with G_TLS_CHANNEL_BINDING_ERROR
in a GError
to
indicate a TLS channel binding retrieval error.
since: 2.66
An error code used with G_TLS_ERROR
in a GError
returned from a
TLS-related routine.
since: 2.28
Callbacks
Type definition for a function that will be called back when an asynchronous
operation within GIO has been completed. GAsyncReadyCallback
callbacks from GTask
are guaranteed to be invoked in a later
iteration of the thread-default main context
(see g_main_context_push_thread_default()
)
where the GTask
was created. All other users of
GAsyncReadyCallback
must likewise call it asynchronously in a
later iteration of the main context.
Invoked when the name being watched is known to have to have an owner.
since: 2.26
Invoked when the name being watched is known not to have to have an owner.
since: 2.26
This is the function type of the callback used for the GSource
returned by g_cancellable_source_new().
since: 2.28
This is the function type of the callback used for the GSource
returned by g_datagram_based_create_source().
since: 2.48
The type of the get_property
function in GDBusInterfaceVTable
.
since: 2.26
The type of the method_call
function in GDBusInterfaceVTable
.
since: 2.26
The type of the set_property
function in GDBusInterfaceVTable
.
since: 2.26
Signature for function used in g_dbus_connection_add_filter().
since: 2.26
Function signature for a function used to determine the GType
to
use for an interface proxy (if interface_name
is not NULL
) or
object proxy (if interface_name
is NULL
).
since: 2.30
Signature for callback function used in g_dbus_connection_signal_subscribe().
since: 2.26
This callback type is used by g_file_measure_disk_usage()
to make
periodic progress reports when measuring the amount of disk spaced
used by a directory.
since: 2.38
When doing file operations that may take a while, such as moving a file or copying a file, a progress callback is used to pass how far along that operation is to the application.
When loading the partial contents of a file with g_file_load_partial_contents_async(),
it may become necessary to determine if any more data from the file should be loaded.
A GFileReadMoreCallback
function facilitates this by returning TRUE
if more data
should be read, or FALSE
otherwise.
This is the function type of the callback used for the GSource
returned by g_pollable_input_stream_create_source()
and g_pollable_output_stream_create_source().
since: 2.28
Changes the size of the memory block pointed to by data
to
size
bytes.
The type for the function that is used to convert from GSettings
to an object property.
The type for the function that is used to convert an object property
value to a GVariant
for storing it in GSettings
.
The type of the function that is used to convert from a value stored
in a GSettings
to a value that is useful to the application.
Simple thread function that runs an asynchronous operation and checks for cancellation.
This is the function type of the callback used for the GSource
returned by g_socket_create_source().
since: 2.22
The prototype for a task function to be run in a thread via
g_task_run_in_thread()
or g_task_run_in_thread_sync().
since: 2.36
This function type is used by g_vfs_register_uri_scheme()
to make it
possible for a client to associate a URI scheme to a different GFile
implementation.
since: 2.50
Functions
Synchronously connects to the message bus specified by bus_type
.
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 bus_type
, they will share the same object.
since: 2.26
Like g_bus_own_name()
but takes a GDBusConnection
instead
of a GBusType
.
since: 2.26
Version of g_bus_own_name_on_connection()
using closures instead of
callbacks for easier binding in other languages.
since: 2.26
Version of [func@Gio.bus_own_name using closures instead of callbacks for easier binding in other languages.
since: 2.26
Starts watching name
on the bus specified by bus_type
and calls
name_appeared_handler
and name_vanished_handler
when the name is
known to have an owner respectively known to lose its
owner. Callbacks will be invoked in the thread-default main context
(see g_main_context_push_thread_default()
)
of the thread you are calling this function from.
since: 2.26
Like g_bus_watch_name()
but takes a GDBusConnection
instead of a
GBusType
.
since: 2.26
Version of g_bus_watch_name_on_connection()
using closures instead of callbacks for
easier binding in other languages.
since: 2.26
Version of g_bus_watch_name()
using closures instead of callbacks for
easier binding in other languages.
since: 2.26
If subscription_id_pointer
points to a nonzero subscription ID,
unsubscribe from that D-Bus signal subscription as if via
g_dbus_connection_signal_unsubscribe()
.
since: 2.84
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).
Compares two content types for equality.
Gets the human readable description of the content type.
Gets the icon for a content type.
Get the list of directories which MIME data is loaded from. See
g_content_type_set_mime_dirs()
for details.
since: 2.60
Gets the mime type for the content type, if one is registered.
Guesses the content type based on example data. If the function is
uncertain, result_uncertain
will be set to TRUE
. Either filename
or data
may be NULL
, in which case the guess will be based solely
on the other argument.
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.
since: 2.18
Determines if type
is a subset of supertype
.
Determines if type
is a subset of mime_type
.
Convenience wrapper around g_content_type_is_a().
since: 2.52
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.
Set the list of directories used by GIO to load the MIME database.
If dirs
is NULL
, the directories used are the default:.
since: 2.60
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)
.
Escape string
so it can appear in a D-Bus address as the value
part of a key-value pair.
since: 2.36
Synchronously looks up the D-Bus address for the well-known message
bus instance specified by bus_type
. This may involve using various
platform specific mechanisms.
since: 2.26
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.
since: 2.26
Finishes an operation started with g_dbus_address_get_stream().
since: 2.26
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.
since: 2.26
This is a language binding friendly version of g_dbus_escape_object_path_bytestring().
since: 2.68
Escapes bytes
for use in a D-Bus object path component.
bytes
is an array of zero or more nonzero bytes in an
unspecified encoding, followed by a single zero byte.
since: 2.68
Generate a D-Bus GUID that can be used with e.g. g_dbus_connection_new().
since: 2.26
Converts a GValue
to a GVariant
of the type indicated by the type
parameter.
since: 2.30
Converts a GVariant
to a GValue
. If value
is floating, it is consumed.
since: 2.30
Checks if string
is a valid D-Bus member (e.g. signal or method) name.
since: 2.26
Like g_dbus_is_address()
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
Unescapes an string that was previously escaped with
g_dbus_escape_object_path(). If the string is in a format that could
not have been returned by g_dbus_escape_object_path(), this function
returns NULL
.
since: 2.68
Converts errno.h
error codes into GIO error codes.
Gets the GIO Error Quark.
Loads all the modules in the specified directory.
Loads all the modules in the specified directory.
since: 2.30
Scans all the modules in the specified directory, ensuring that any extension point implemented by a module is registered.
since: 2.24
Scans all the modules in the specified directory, ensuring that any extension point implemented by a module is registered.
since: 2.30
Creates a keyfile-backed GSettingsBackend
.
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
Utility method for GPollableInputStream
and GPollableOutputStream
implementations. Creates a new GSource
that expects a callback of
type GPollableSourceFunc
. The new source does not actually do
anything on its own; use g_source_add_child_source()
to add other
sources to it to cause it to trigger.
since: 2.28
Utility method for GPollableInputStream
and GPollableOutputStream
implementations. Creates a new GSource
, as with
g_pollable_source_new(), but also attaching child_source
(with a
dummy callback), and cancellable
, if they are non-NULL
.
since: 2.34
Tries to read from stream
, as with g_input_stream_read()
(if
blocking
is TRUE
) or g_pollable_input_stream_read_nonblocking()
(if blocking
is FALSE
). This can be used to more easily share
code between blocking and non-blocking implementations of a method.
since: 2.34
Tries to write to stream
, as with g_output_stream_write()
(if
blocking
is TRUE
) or g_pollable_output_stream_write_nonblocking()
(if blocking
is FALSE
). This can be used to more easily share
code between blocking and non-blocking implementations of a method.
since: 2.34
Tries to write count
bytes to stream
, as with
g_output_stream_write_all(), but using g_pollable_stream_write()
rather than g_output_stream_write().
since: 2.34
Returns all the names of children at the specified path
in the set of
globally registered resources.
since: 2.32
Looks for a file at the specified path
in the set of
globally registered resources and if found returns information about it.
since: 2.32
Returns whether the specified path
in the set of
globally registered resources has children.
since: 2.84
Looks for a file at the specified path
in the set of
globally registered resources and returns a GBytes
that
lets you directly access the data in memory.
since: 2.32
Looks for a file at the specified path
in the set of
globally registered resources and returns a GInputStream
that lets you read the data.
since: 2.32
Reports an error in an asynchronous function in an idle function by
directly setting the contents of the GAsyncResult
with the given error information.
deprecated: 2.46
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.
deprecated: 2.46
Reports an error in an idle function. Similar to
g_simple_async_report_gerror_in_idle(), but takes over the caller’s
ownership of error
, so the caller does not have to free it any more.
deprecated: 2.46 since: 2.28
Function Macros
Constants
The value returned by handlers of the signals generated by
the gdbus-codegen
tool to indicate that a method call has been
handled by an implementation. It is equal to TRUE
, but using
this macro is sometimes more readable.
The value returned by handlers of the signals generated by
the gdbus-codegen
tool to indicate that a method call has not been
handled by an implementation. It is equal to FALSE
, but using
this macro is sometimes more readable.
Extension point for debug control functionality. See Extending GIO.
The string used to obtain a Unix device path with g_drive_get_identifier().
A key in the “access” namespace for checking deletion privileges.
A key in the “access” namespace for getting execution privileges.
A key in the “access” namespace for getting read privileges.
A key in the “access” namespace for checking renaming privileges.
A key in the “access” namespace for checking trashing privileges.
A key in the “access” namespace for getting write privileges.
A key in the “dos” namespace for checking if the file’s archive flag is set.
A key in the “dos” namespace for checking if the file is a NTFS mount point (a volume mount or a junction point).
A key in the “dos” namespace for checking if the file’s backup flag is set.
A key in the “dos” namespace for getting the file NTFS reparse tag.
A key in the “etag” namespace for getting the value of the file’s entity tag.
A key in the “filesystem” namespace for getting the number of bytes of free space left on the file system.
A key in the “filesystem” namespace for checking if the file system is read only.
A key in the “filesystem” namespace for checking if the file system is remote.
A key in the “filesystem” namespace for getting the total size (in bytes) of the file system, used in g_file_query_filesystem_info().
A key in the “filesystem” namespace for getting the file system’s type.
A key in the “filesystem” namespace for hinting a file manager application whether it should preview (e.g. thumbnail) files on the file system.
A key in the “filesystem” namespace for getting the number of bytes used by data on the file system.
A key in the “gvfs” namespace that gets the name of the current GVFS backend in use.
A key in the “id” namespace for getting a file identifier.
A key in the “id” namespace for getting the file system identifier.
A key in the “mountable” namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be ejected.
A key in the “mountable” namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is mountable.
A key in the “mountable” namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be polled.
A key in the “mountable” namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be started.
A key in the “mountable” namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be started degraded.
A key in the “mountable” namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be stopped.
A key in the “mountable” namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is unmountable.
A key in the “mountable” namespace for getting the HAL UDI for the mountable file.
A key in the “mountable” namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is automatically polled for media.
A key in the “mountable” namespace for getting the GDriveStartStopType
.
A key in the “mountable” namespace for getting the unix device.
A key in the “mountable” namespace for getting the unix device file.
A key in the “owner” namespace for getting the file owner’s group.
A key in the “owner” namespace for getting the user name of the file’s owner.
A key in the “owner” namespace for getting the real name of the user that owns the file.
A key in the “preview” namespace for getting a GIcon
that can be
used to get preview of the file.
A key in the “recent” namespace for getting time, when the metadata for the
file in recent:///
was last changed.
A key in the “selinux” namespace for getting the file’s SELinux context.
A key in the “standard” namespace for getting the amount of disk space that is consumed by the file (in bytes).
A key in the “standard” namespace for getting the content type of the file.
A key in the “standard” namespace for getting the copy name of the file.
A key in the “standard” namespace for getting the description of the file.
A key in the “standard” namespace for getting the display name of the file.
A key in the “standard” namespace for edit name of the file.
A key in the “standard” namespace for getting the fast content type.
A key in the “standard” namespace for getting the icon for the file.
A key in the “standard” namespace for checking if a file is a backup file.
A key in the “standard” namespace for checking if a file is hidden.
A key in the “standard” namespace for checking if the file is a symlink. Typically the actual type is something else, if we followed the symlink to get the type.
A key in the “standard” namespace for checking if a file is virtual.
A key in the “standard” namespace for checking if a file is
volatile. This is meant for opaque, non-POSIX-like backends to
indicate that the URI is not persistent. Applications should look
at G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET
for the persistent URI.
A key in the “standard” namespace for getting the name of the file.
A key in the “standard” namespace for getting the file’s size (in bytes).
A key in the “standard” namespace for setting the sort order of a file.
A key in the “standard” namespace for getting the symbolic icon for the file.
A key in the “standard” namespace for getting the symlink target, if the file is a symlink.
A key in the “standard” namespace for getting the target URI for the file, in
the case of G_FILE_TYPE_SHORTCUT
or G_FILE_TYPE_MOUNTABLE
files.
A key in the “standard” namespace for storing file types.
A key in the “thumbnail” namespace for checking whether the thumbnail is outdated.
A key in the “thumbnail” namespace for checking whether the large thumbnail is outdated.
A key in the “thumbnail” namespace for checking whether the normal thumbnail is outdated.
A key in the “thumbnail” namespace for checking whether the x-large thumbnail is outdated.
A key in the “thumbnail” namespace for checking whether the xx-large thumbnail is outdated.
A key in the “thumbnail” namespace for getting the path to the thumbnail image with the biggest size available.
A key in the “thumbnail” namespace for getting the path to the large thumbnail image.
A key in the “thumbnail” namespace for getting the path to the normal thumbnail image.
A key in the “thumbnail” namespace for getting the path to the x-large thumbnail image.
A key in the “thumbnail” namespace for getting the path to the xx-large thumbnail image.
A key in the “thumbnail” namespace for checking if thumbnailing failed.
A key in the “thumbnail” namespace for checking if thumbnailing failed for the large image.
A key in the “thumbnail” namespace for checking if thumbnailing failed for the normal image.
A key in the “thumbnail” namespace for checking if thumbnailing failed for the x-large image.
A key in the “thumbnail” namespace for checking if thumbnailing failed for the xx-large image.
A key in the “time” namespace for getting the time the file was last accessed.
A key in the “time” namespace for getting the nanoseconds of the time the file was last accessed. This should be used in conjunction with
G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding GFileAttributeType
is
G_FILE_ATTRIBUTE_TYPE_UINT32
.
A key in the “time” namespace for getting the microseconds of the time the file was last accessed.
A key in the “time” namespace for getting the time the file was last changed.
A key in the “time” namespace for getting the nanoseconds of the time the file was last changed. This should be used in conjunction with
G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding GFileAttributeType
is
G_FILE_ATTRIBUTE_TYPE_UINT32
.
A key in the “time” namespace for getting the microseconds of the time the file was last changed.
A key in the “time” namespace for getting the time the file was created.
A key in the “time” namespace for getting the nanoseconds of the time the file was created. This should be used in conjunction with
G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding GFileAttributeType
is
G_FILE_ATTRIBUTE_TYPE_UINT32
.
A key in the “time” namespace for getting the microseconds of the time the file was created.
A key in the “time” namespace for getting the time the file was last modified.
A key in the “time” namespace for getting the nanoseconds of the time the file was last modified. This should be used in conjunction with
G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding GFileAttributeType
is
G_FILE_ATTRIBUTE_TYPE_UINT32
.
A key in the “time” namespace for getting the microseconds of the time the file was last modified.
A key in the “trash” namespace for getting the deletion date and time
of a file inside the trash:///
folder.
A key in the “trash” namespace for getting the number of (toplevel) items
that are present in the trash:///
folder.
A key in the “trash” namespace for getting the original path of a file
inside the trash:///
folder before it was trashed.
A key in the “unix” namespace for getting the block size for the file system.
A key in the “unix” namespace for getting the number of blocks allocated for the file.
A key in the “unix” namespace for getting the device id of the device the
file is located on (see stat()
documentation).
A key in the “unix” namespace for getting the group ID for the file.
A key in the “unix” namespace for getting the inode of the file.
A key in the “unix” namespace for checking if the file represents a UNIX mount point.
A key in the “unix” namespace for getting the mode of the file (e.g. whether the file is a regular file, symlink, etc).
A key in the “unix” namespace for getting the number of hard links for a file.
A key in the “unix” namespace for getting the device ID for the file (if it is a special file).
A key in the “unix” namespace for getting the user ID for the file.
Extension point for memory usage monitoring functionality. See Extending GIO.
The menu item attribute which holds the action name of the item. Action names are namespaced with an identifier for the action group in which the action resides. For example, “win.” for window-specific actions and “app.” for application-wide actions.
The menu item attribute that holds the namespace for all action names in menus that are linked from this item.
The menu item attribute which holds the icon of the item.
The menu item attribute which holds the label of the item.
The menu item attribute which holds the target with which the item’s action will be activated.
The maximum number of entries in a menu section supported by g_dbus_connection_export_menu_model().
The name of the link that associates a menu item with a section. The linked menu will usually be shown in place of the menu item, using the item’s label as a header.
The name of the link that associates a menu item with a submenu.
Extension point for network status monitoring functionality. See Extending GIO.
Extension point for power profile usage monitoring functionality. See Extending GIO.
Extension point for proxy functionality. See Extending GIO.
Extension point for proxy resolving functionality. See Extending GIO.
Extension point for GSettingsBackend
functionality.
Extension point for TLS functionality via GTlsBackend
.
See Extending GIO.
The purpose used to verify the client certificate in a TLS connection. Used by TLS servers.
The purpose used to verify the server certificate in a TLS connection. This is the most common purpose in use. Used by TLS clients.
Extension point for GVfs
functionality.
See Extending GIO.
The string used to obtain the volume class with g_volume_get_identifier().
The string used to obtain a Hal UDI with g_volume_get_identifier().
deprecated: 2.58
The string used to obtain a filesystem label with g_volume_get_identifier().
The string used to obtain a NFS mount with g_volume_get_identifier().
The string used to obtain a Unix device path with g_volume_get_identifier().
The string used to obtain a UUID with g_volume_get_identifier().
Extension point for volume monitor functionality. See Extending GIO.