index.html
Main Page
|
modules.html
Modules
|
namespaces.html
Namespace List
|
hierarchy.html
Class Hierarchy
|
annotated.html
Data Structures
|
dirs.html
Directories
|
files.html
File List
|
namespacemembers.html
Namespace Members
|
functions.html
Data Fields
|
pages.html
Related Pages
Message bus APIs
[
group__DBus.html
D-BUS low-level public API
]
Functions for communicating with the message bus.
#_details
More...
Functions
structDBusConnection.html
DBusConnection
*
group__DBusBus.html#ga0
dbus_bus_get
(DBusBusType type,
structDBusError.html
DBusError
*error)
Connects to a bus daemon and registers the client with it.
#ga0
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusBus.html#ga1
dbus_bus_register
(
structDBusConnection.html
DBusConnection
*connection,
structDBusError.html
DBusError
*error)
Registers a connection with the bus.
#ga1
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusBus.html#ga2
dbus_bus_set_unique_name
(
structDBusConnection.html
DBusConnection
*connection, const char *unique_name)
Sets the unique name of the connection.
#ga2
const char *
group__DBusBus.html#ga3
dbus_bus_get_unique_name
(
structDBusConnection.html
DBusConnection
*connection)
Gets the unique name of the connection.
#ga3
unsigned long
group__DBusBus.html#ga4
dbus_bus_get_unix_user
(
structDBusConnection.html
DBusConnection
*connection, const char *name,
structDBusError.html
DBusError
*error)
Asks the bus to return the uid of the named connection.
#ga4
int
group__DBusBus.html#ga5
dbus_bus_request_name
(
structDBusConnection.html
DBusConnection
*connection, const char *name, unsigned int flags,
structDBusError.html
DBusError
*error)
Asks the bus to assign the given name to this connection.
#ga5
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusBus.html#ga6
dbus_bus_name_has_owner
(
structDBusConnection.html
DBusConnection
*connection, const char *name,
structDBusError.html
DBusError
*error)
Checks whether a certain name has an owner.
#ga6
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusBus.html#ga7
dbus_bus_start_service_by_name
(
structDBusConnection.html
DBusConnection
*connection, const char *name,
group__DBusTypes.html#ga3
dbus_uint32_t
flags,
group__DBusTypes.html#ga3
dbus_uint32_t
*result,
structDBusError.html
DBusError
*error)
Starts a service that will request ownership of the given name.
#ga7
void
group__DBusBus.html#ga9
dbus_bus_add_match
(
structDBusConnection.html
DBusConnection
*connection, const char *rule,
structDBusError.html
DBusError
*error)
Adds a match rule to match messages going through the message bus.
#ga9
void
group__DBusBus.html#ga10
dbus_bus_remove_match
(
structDBusConnection.html
DBusConnection
*connection, const char *rule,
structDBusError.html
DBusError
*error)
Removes a previously-added match rule "by value" (the most recently-added identical rule gets removed).
#ga10
Detailed Description
Functions for communicating with the message bus.
todo.html#_todo000008
Todo:
right now the default address of the system bus is hardcoded, so if you change it in the global config file suddenly you have to set DBUS_SYSTEM_BUS_ADDRESS env variable.
Might be nice if the client lib somehow read the config file, or if the bus on startup somehow wrote out its address to a well-known spot, but might also not be worth it.
Function Documentation
void dbus_bus_add_match
(
structDBusConnection.html
DBusConnection
*
connection
,
const char *
rule
,
structDBusError.html
DBusError
*
error
)
Adds a match rule to match messages going through the message bus.
The "rule" argument is the string form of a match rule.
If you pass
group__DBusMacros.html#ga4
NULL
for the error, this function will not block; the match thus won't be added until you flush the connection, and if there's an error adding the match (only possible error is lack of resources in the bus), you won't find out about it.
If you pass non-
group__DBusMacros.html#ga4
NULL
for the error this function will block until it gets a reply.
Normal API conventions would have the function return a boolean value indicating whether the error was set, but that would require blocking always to determine the return value.
Parameters:
connection
connection to the message bus
rule
textual form of match rule
error
location to store any errors
Definition at line
dbus-bus_8c-source.html#l00889
889
of file
dbus-bus_8c-source.html
dbus-bus.c
.
References
dbus-message_8c-source.html#l01189
dbus_message_append_args()
,
dbus-message_8c-source.html#l00785
dbus_message_new_method_call()
,
dbus-message_8c-source.html#l01097
dbus_message_unref()
, and
group__DBusMacros.html#ga4
NULL
.
structDBusConnection.html
DBusConnection
* dbus_bus_get
(
DBusBusType
type
,
structDBusError.html
DBusError
*
error
)
Connects to a bus daemon and registers the client with it.
If a connection to the bus already exists, then that connection is returned. Caller owns a reference to the bus.
todo.html#_todo000010
Todo:
alex thinks we should nullify the connection when we get a disconnect-message.
Parameters:
type
bus type
error
address where an error can be returned.
Returns:
a
structDBusConnection.html
DBusConnection
with new ref
Definition at line
dbus-bus_8c-source.html#l00328
328
of file
dbus-bus_8c-source.html
dbus-bus.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8h-source.html#l00270
_DBUS_LOCK
,
dbus-internals_8h-source.html#l00271
_DBUS_UNLOCK
,
dbus-bus_8c-source.html#l00428
dbus_bus_register()
,
dbus-connection_8c-source.html#l01930
dbus_connection_close()
,
dbus-connection_8c-source.html#l01694
dbus_connection_open()
,
dbus-connection_8c-source.html#l01746
dbus_connection_ref()
,
dbus-connection_8c-source.html#l02029
dbus_connection_set_exit_on_disconnect()
,
dbus-connection_8c-source.html#l01884
dbus_connection_unref()
,
dbus-errors_8c-source.html#l00313
dbus_set_error()
,
dbus-bus_8c-source.html#l00068
BusData::is_well_known
,
dbus-bus_8c-source.html#l00076
N_BUS_TYPES
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-gmain_8c-source.html#l00709
dbus_g_bus_get()
.
const char* dbus_bus_get_unique_name
(
structDBusConnection.html
DBusConnection
*
connection
)
Gets the unique name of the connection.
Only possible after the connection has been registered with the message bus.
Parameters:
connection
the connection
Returns:
the unique name
Definition at line
dbus-bus_8c-source.html#l00537
537
of file
dbus-bus_8c-source.html
dbus-bus.c
.
References
group__DBusMacros.html#ga4
NULL
, and
dbus-bus_8c-source.html#l00066
BusData::unique_name
.
unsigned long dbus_bus_get_unix_user
(
structDBusConnection.html
DBusConnection
*
connection
,
const char *
name
,
structDBusError.html
DBusError
*
error
)
Asks the bus to return the uid of the named connection.
Parameters:
connection
the connection
name
a name owned by the connection
error
location to store the error
Returns:
a result code, -1 if error is set
Definition at line
dbus-bus_8c-source.html#l00560
560
of file
dbus-bus_8c-source.html
dbus-bus.c
.
References
dbus-connection_8c-source.html#l02753
dbus_connection_send_with_reply_and_block()
,
dbus-message_8c-source.html#l01189
dbus_message_append_args()
,
dbus-message_8c-source.html#l01363
dbus_message_get_args()
,
dbus-message_8c-source.html#l00785
dbus_message_new_method_call()
,
dbus-message_8c-source.html#l01097
dbus_message_unref()
,
dbus-message_8c-source.html#l03074
dbus_set_error_from_message()
, and
group__DBusMacros.html#ga4
NULL
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_bus_name_has_owner
(
structDBusConnection.html
DBusConnection
*
connection
,
const char *
name
,
structDBusError.html
DBusError
*
error
)
Checks whether a certain name has an owner.
Parameters:
connection
the connection
name
the name
error
location to store any errors
Returns:
group__DBusMacros.html#ga2
TRUE
if the name exists,
group__DBusMacros.html#ga3
FALSE
if not or on error
Definition at line
dbus-bus_8c-source.html#l00716
716
of file
dbus-bus_8c-source.html
dbus-bus.c
.
References
dbus-connection_8c-source.html#l02753
dbus_connection_send_with_reply_and_block()
,
dbus-message_8c-source.html#l01189
dbus_message_append_args()
,
dbus-message_8c-source.html#l01363
dbus_message_get_args()
,
dbus-message_8c-source.html#l00785
dbus_message_new_method_call()
,
dbus-message_8c-source.html#l01097
dbus_message_unref()
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga4
NULL
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_bus_register
(
structDBusConnection.html
DBusConnection
*
connection
,
structDBusError.html
DBusError
*
error
)
Registers a connection with the bus.
This must be the first thing an application does when connecting to the message bus. If registration succeeds, the unique name will be set, and can be obtained using
group__DBusBus.html#ga3
dbus_bus_get_unique_name()
.
Parameters:
connection
the connection
error
place to store errors
Returns:
group__DBusMacros.html#ga2
TRUE
on success
Definition at line
dbus-bus_8c-source.html#l00428
428
of file
dbus-bus_8c-source.html
dbus-bus.c
.
References
dbus-internals_8c-source.html#l00303
_dbus_strdup()
,
dbus-internals_8c-source.html#l00203
_dbus_warn()
,
dbus-connection_8c-source.html#l02753
dbus_connection_send_with_reply_and_block()
,
dbus-message_8c-source.html#l01363
dbus_message_get_args()
,
dbus-message_8c-source.html#l00785
dbus_message_new_method_call()
,
dbus-message_8c-source.html#l01097
dbus_message_unref()
,
dbus-message_8c-source.html#l03074
dbus_set_error_from_message()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga2
TRUE
, and
dbus-bus_8c-source.html#l00066
BusData::unique_name
.
Referenced by
dbus-bus_8c-source.html#l00328
dbus_bus_get()
.
void dbus_bus_remove_match
(
structDBusConnection.html
DBusConnection
*
connection
,
const char *
rule
,
structDBusError.html
DBusError
*
error
)
Removes a previously-added match rule "by value" (the most recently-added identical rule gets removed).
The "rule" argument is the string form of a match rule.
If you pass
group__DBusMacros.html#ga4
NULL
for the error, this function will not block; otherwise it will. See detailed explanation in docs for
group__DBusBus.html#ga9
dbus_bus_add_match()
.
Parameters:
connection
connection to the message bus
rule
textual form of match rule
error
location to store any errors
Definition at line
dbus-bus_8c-source.html#l00935
935
of file
dbus-bus_8c-source.html
dbus-bus.c
.
References
dbus-message_8c-source.html#l01189
dbus_message_append_args()
,
dbus-message_8c-source.html#l00785
dbus_message_new_method_call()
,
dbus-message_8c-source.html#l01097
dbus_message_unref()
, and
group__DBusMacros.html#ga4
NULL
.
int dbus_bus_request_name
(
structDBusConnection.html
DBusConnection
*
connection
,
const char *
name
,
unsigned int
flags
,
structDBusError.html
DBusError
*
error
)
Asks the bus to assign the given name to this connection.
todo.html#_todo000011
Todo:
these docs are not complete, need to document the return value and flags
todo.html#_todo000011
Todo:
if we get an error reply, it has to be converted into
structDBusError.html
DBusError
and returned
Parameters:
connection
the connection
name
the name to request
flags
flags
error
location to store the error
Returns:
a result code, -1 if error is set
Definition at line
dbus-bus_8c-source.html#l00641
641
of file
dbus-bus_8c-source.html
dbus-bus.c
.
References
dbus-connection_8c-source.html#l02753
dbus_connection_send_with_reply_and_block()
,
dbus-message_8c-source.html#l01189
dbus_message_append_args()
,
dbus-message_8c-source.html#l01363
dbus_message_get_args()
,
dbus-message_8c-source.html#l00785
dbus_message_new_method_call()
,
dbus-message_8c-source.html#l01097
dbus_message_unref()
,
dbus-message_8c-source.html#l03074
dbus_set_error_from_message()
, and
group__DBusMacros.html#ga4
NULL
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_bus_set_unique_name
(
structDBusConnection.html
DBusConnection
*
connection
,
const char *
unique_name
)
Sets the unique name of the connection.
Can only be used if you registered with the bus manually (i.e. if you did not call
group__DBusBus.html#ga1
dbus_bus_register()
). Can only be called once per connection.
Parameters:
connection
the connection
unique_name
the unique name
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-bus_8c-source.html#l00511
511
of file
dbus-bus_8c-source.html
dbus-bus.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8c-source.html#l00303
_dbus_strdup()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
dbus-bus_8c-source.html#l00066
BusData::unique_name
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_bus_start_service_by_name
(
structDBusConnection.html
DBusConnection
*
connection
,
const char *
name
,
group__DBusTypes.html#ga3
dbus_uint32_t
flags
,
group__DBusTypes.html#ga3
dbus_uint32_t
*
result
,
structDBusError.html
DBusError
*
error
)
Starts a service that will request ownership of the given name.
The returned result will be one of be one of DBUS_START_REPLY_SUCCESS or DBUS_START_REPLY_ALREADY_RUNNING if successful. Pass
group__DBusMacros.html#ga4
NULL
if you don't care about the result.
Parameters:
connection
the connection
name
the name we want the new service to request
flags
the flags
result
a place to store the result or
group__DBusMacros.html#ga4
NULL
error
location to store any errors
Returns:
group__DBusMacros.html#ga2
TRUE
if the activation succeeded,
group__DBusMacros.html#ga3
FALSE
if not
todo.html#_todo000013
Todo:
document what the flags do
Definition at line
dbus-bus_8c-source.html#l00785
785
of file
dbus-bus_8c-source.html
dbus-bus.c
.
References
dbus-connection_8c-source.html#l02753
dbus_connection_send_with_reply_and_block()
,
dbus-message_8c-source.html#l01189
dbus_message_append_args()
,
dbus-message_8c-source.html#l01363
dbus_message_get_args()
,
dbus-message_8c-source.html#l00785
dbus_message_new_method_call()
,
dbus-message_8c-source.html#l01097
dbus_message_unref()
,
dbus-message_8c-source.html#l03074
dbus_set_error_from_message()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
Generated on Tue Sep 13 01:28:08 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
