Description
Routines for working with D-Bus addresses. A D-Bus address is a string
like unix:tmpdir=/tmp/my-app-name. The exact format of addresses
is explained in detail in the
D-Bus specification.
TCP D-Bus connections are supported, but accessing them via a proxy is
currently not supported.
Functions
g_dbus_is_supported_address ()
gboolean
g_dbus_is_supported_address (const gchar *string,
GError **error);
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.
Returns
TRUE if string
is a valid D-Bus address that is
supported by this library, FALSE if error
is set.
Since: 2.26
g_dbus_address_get_stream ()
void
g_dbus_address_get_stream (const gchar *address,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
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 g_dbus_address_get_stream_finish() to get the result of
the operation.
This is an asynchronous failable function. See
g_dbus_address_get_stream_sync() for the synchronous version.
Since: 2.26
g_dbus_address_get_stream_sync ()
GIOStream *
g_dbus_address_get_stream_sync (const gchar *address,
gchar **out_guid,
GCancellable *cancellable,
GError **error);
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
g_dbus_address_get_stream() for the asynchronous version.
Returns
A GIOStream or NULL if error
is set.
[transfer full]
Since: 2.26
g_dbus_address_get_for_bus_sync ()
gchar *
g_dbus_address_get_for_bus_sync (GBusType bus_type,
GCancellable *cancellable,
GError **error);
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.
The returned address will be in the
D-Bus address format.
Returns
a valid D-Bus address string for bus_type
or
NULL if error
is set.
[transfer full]
Since: 2.26
g_dbus_address_escape_value ()
gchar *
g_dbus_address_escape_value (const gchar *string);
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.
Returns
a copy of string
with all
non-optionally-escaped bytes escaped.
[transfer full]
Since: 2.36