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
DBusMessage
[
group__DBus.html
D-BUS low-level public API
]
Message to be sent or received over a
structDBusConnection.html
DBusConnection
.
#_details
More...
Defines
#define
group__DBusMessage.html#ga76
MAX_MESSAGE_SIZE_TO_CACHE
_DBUS_ONE_MEGABYTE
Avoid caching huge messages.
#define
group__DBusMessage.html#ga77
MAX_MESSAGE_CACHE_SIZE
5
Avoid caching too many messages.
Typedefs
typedef
structDBusMessage.html
DBusMessage
group__DBusMessage.html#ga78
DBusMessage
Opaque data type representing a message received from or to be sent to another application.
Functions
group__DBusTypes.html#ga3
dbus_uint32_t
group__DBusMessage.html#ga3
dbus_message_get_serial
(
structDBusMessage.html
DBusMessage
*message)
Returns the serial of a message or 0 if none has been specified.
#ga3
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga4
dbus_message_set_reply_serial
(
structDBusMessage.html
DBusMessage
*message,
group__DBusTypes.html#ga3
dbus_uint32_t
reply_serial)
Sets the reply serial of a message (the client serial of the message this is a reply to).
#ga4
group__DBusTypes.html#ga3
dbus_uint32_t
group__DBusMessage.html#ga5
dbus_message_get_reply_serial
(
structDBusMessage.html
DBusMessage
*message)
Returns the serial that the message is a reply to or 0 if none.
#ga5
structDBusMessage.html
DBusMessage
*
group__DBusMessage.html#ga12
dbus_message_new
(int message_type)
Constructs a new message of the given message type.
#ga12
structDBusMessage.html
DBusMessage
*
group__DBusMessage.html#ga13
dbus_message_new_method_call
(const char *destination, const char *path, const char *interface, const char *method)
Constructs a new message to invoke a method on a remote object.
#ga13
structDBusMessage.html
DBusMessage
*
group__DBusMessage.html#ga14
dbus_message_new_method_return
(
structDBusMessage.html
DBusMessage
*method_call)
Constructs a message that is a reply to a method call.
#ga14
structDBusMessage.html
DBusMessage
*
group__DBusMessage.html#ga15
dbus_message_new_signal
(const char *path, const char *interface, const char *name)
Constructs a new message representing a signal emission.
#ga15
structDBusMessage.html
DBusMessage
*
group__DBusMessage.html#ga16
dbus_message_new_error
(
structDBusMessage.html
DBusMessage
*reply_to, const char *error_name, const char *error_message)
Creates a new message that is an error reply to a certain message.
#ga16
structDBusMessage.html
DBusMessage
*
group__DBusMessage.html#ga17
dbus_message_new_error_printf
(
structDBusMessage.html
DBusMessage
*reply_to, const char *error_name, const char *error_format,...)
Creates a new message that is an error reply to a certain message.
#ga17
structDBusMessage.html
DBusMessage
*
group__DBusMessage.html#ga18
dbus_message_copy
(const
structDBusMessage.html
DBusMessage
*message)
Creates a new message that is an exact replica of the message specified, except that its refcount is set to 1, its message serial is reset to 0, and if the original message was "locked" (in the outgoing message queue and thus not modifiable) the new message will not be locked.
#ga18
structDBusMessage.html
DBusMessage
*
group__DBusMessage.html#ga19
dbus_message_ref
(
structDBusMessage.html
DBusMessage
*message)
Increments the reference count of a
structDBusMessage.html
DBusMessage
.
#ga19
void
group__DBusMessage.html#ga20
dbus_message_unref
(
structDBusMessage.html
DBusMessage
*message)
Decrements the reference count of a
structDBusMessage.html
DBusMessage
.
#ga20
int
group__DBusMessage.html#ga21
dbus_message_get_type
(
structDBusMessage.html
DBusMessage
*message)
Gets the type of a message.
#ga21
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga22
dbus_message_append_args
(
structDBusMessage.html
DBusMessage
*message, int first_arg_type,...)
Appends fields to a message given a variable argument list.
#ga22
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga23
dbus_message_append_args_valist
(
structDBusMessage.html
DBusMessage
*message, int first_arg_type, va_list var_args)
This function takes a va_list for use by language bindings.
#ga23
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga24
dbus_message_get_args
(
structDBusMessage.html
DBusMessage
*message,
structDBusError.html
DBusError
*error, int first_arg_type,...)
Gets arguments from a message given a variable argument list.
#ga24
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga25
dbus_message_get_args_valist
(
structDBusMessage.html
DBusMessage
*message,
structDBusError.html
DBusError
*error, int first_arg_type, va_list var_args)
This function takes a va_list for use by language bindings.
#ga25
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga27
dbus_message_iter_init
(
structDBusMessage.html
DBusMessage
*message,
structDBusMessageIter.html
DBusMessageIter
*iter)
Initializes a
structDBusMessageIter.html
DBusMessageIter
for reading the arguments of the message passed in.
#ga27
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga29
dbus_message_iter_has_next
(
structDBusMessageIter.html
DBusMessageIter
*iter)
Checks if an iterator has any more fields.
#ga29
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga30
dbus_message_iter_next
(
structDBusMessageIter.html
DBusMessageIter
*iter)
Moves the iterator to the next field, if any.
#ga30
int
group__DBusMessage.html#ga31
dbus_message_iter_get_arg_type
(
structDBusMessageIter.html
DBusMessageIter
*iter)
Returns the argument type of the argument that the message iterator points to.
#ga31
int
group__DBusMessage.html#ga32
dbus_message_iter_get_element_type
(
structDBusMessageIter.html
DBusMessageIter
*iter)
Returns the element type of the array that the message iterator points to.
#ga32
void
group__DBusMessage.html#ga33
dbus_message_iter_recurse
(
structDBusMessageIter.html
DBusMessageIter
*iter,
structDBusMessageIter.html
DBusMessageIter
*sub)
Recurses into a container value when reading values from a message, initializing a sub-iterator to use for traversing the child values of the container.
#ga33
char *
group__DBusMessage.html#ga34
dbus_message_iter_get_signature
(
structDBusMessageIter.html
DBusMessageIter
*iter)
Returns the current signature of a message iterator.
#ga34
void
group__DBusMessage.html#ga35
dbus_message_iter_get_basic
(
structDBusMessageIter.html
DBusMessageIter
*iter, void *value)
Reads a basic-typed value from the message iterator.
#ga35
int
group__DBusMessage.html#ga36
dbus_message_iter_get_array_len
(
structDBusMessageIter.html
DBusMessageIter
*iter)
Returns the number of elements in the array;.
#ga36
void
group__DBusMessage.html#ga37
dbus_message_iter_get_fixed_array
(
structDBusMessageIter.html
DBusMessageIter
*iter, void *value, int *n_elements)
Reads a block of fixed-length values from the message iterator.
#ga37
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga38
_dbus_message_iter_get_args_valist
(
structDBusMessageIter.html
DBusMessageIter
*iter,
structDBusError.html
DBusError
*error, int first_arg_type, va_list var_args)
This function takes a va_list for use by language bindings and is otherwise the same as dbus_message_iter_get_args().
#ga38
void
group__DBusMessage.html#ga39
dbus_message_iter_init_append
(
structDBusMessage.html
DBusMessage
*message,
structDBusMessageIter.html
DBusMessageIter
*iter)
Initializes a
structDBusMessageIter.html
DBusMessageIter
for appending arguments to the end of a message.
#ga39
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga43
dbus_message_iter_append_basic
(
structDBusMessageIter.html
DBusMessageIter
*iter, int type, const void *value)
Appends a basic-typed value to the message.
#ga43
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga44
dbus_message_iter_append_fixed_array
(
structDBusMessageIter.html
DBusMessageIter
*iter, int element_type, const void *value, int n_elements)
Appends a block of fixed-length values to an array.
#ga44
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga45
dbus_message_iter_open_container
(
structDBusMessageIter.html
DBusMessageIter
*iter, int type, const char *contained_signature,
structDBusMessageIter.html
DBusMessageIter
*sub)
Appends a container-typed value to the message; you are required to append the contents of the container using the returned sub-iterator, and then call
group__DBusMessage.html#ga46
dbus_message_iter_close_container()
.
#ga45
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga46
dbus_message_iter_close_container
(
structDBusMessageIter.html
DBusMessageIter
*iter,
structDBusMessageIter.html
DBusMessageIter
*sub)
Closes a container-typed value appended to the message; may write out more information to the message known only after the entire container is written, and may free resources created by
group__DBusMessage.html#ga45
dbus_message_iter_open_container()
.
#ga46
void
group__DBusMessage.html#ga47
dbus_message_set_no_reply
(
structDBusMessage.html
DBusMessage
*message,
group__DBusTypes.html#ga2
dbus_bool_t
no_reply)
Sets a flag indicating that the message does not want a reply; if this flag is set, the other end of the connection may (but is not required to) optimize by not sending method return or error replies.
#ga47
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga48
dbus_message_get_no_reply
(
structDBusMessage.html
DBusMessage
*message)
Returns
group__DBusMacros.html#ga2
TRUE
if the message does not expect a reply.
#ga48
void
group__DBusMessage.html#ga49
dbus_message_set_auto_start
(
structDBusMessage.html
DBusMessage
*message,
group__DBusTypes.html#ga2
dbus_bool_t
auto_start)
Sets a flag indicating that an owner for the destination name will be automatically started before the message is delivered.
#ga49
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga50
dbus_message_get_auto_start
(
structDBusMessage.html
DBusMessage
*message)
Returns
group__DBusMacros.html#ga2
TRUE
if the message will cause an owner for destination name to be auto-started.
#ga50
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga51
dbus_message_set_path
(
structDBusMessage.html
DBusMessage
*message, const char *object_path)
Sets the object path this message is being sent to (for DBUS_MESSAGE_TYPE_METHOD_CALL) or the one a signal is being emitted from (for DBUS_MESSAGE_TYPE_SIGNAL).
#ga51
const char *
group__DBusMessage.html#ga52
dbus_message_get_path
(
structDBusMessage.html
DBusMessage
*message)
Gets the object path this message is being sent to (for DBUS_MESSAGE_TYPE_METHOD_CALL) or being emitted from (for DBUS_MESSAGE_TYPE_SIGNAL).
#ga52
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga53
dbus_message_has_path
(
structDBusMessage.html
DBusMessage
*message, const char *path)
Checks if the message has a path.
#ga53
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga54
dbus_message_get_path_decomposed
(
structDBusMessage.html
DBusMessage
*message, char ***path)
Gets the object path this message is being sent to (for DBUS_MESSAGE_TYPE_METHOD_CALL) or being emitted from (for DBUS_MESSAGE_TYPE_SIGNAL) in a decomposed format (one array element per path component).
#ga54
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga55
dbus_message_set_interface
(
structDBusMessage.html
DBusMessage
*message, const char *interface)
Sets the interface this message is being sent to (for DBUS_MESSAGE_TYPE_METHOD_CALL) or the interface a signal is being emitted from (for DBUS_MESSAGE_TYPE_SIGNAL).
#ga55
const char *
group__DBusMessage.html#ga56
dbus_message_get_interface
(
structDBusMessage.html
DBusMessage
*message)
Gets the interface this message is being sent to (for DBUS_MESSAGE_TYPE_METHOD_CALL) or being emitted from (for DBUS_MESSAGE_TYPE_SIGNAL).
#ga56
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga57
dbus_message_has_interface
(
structDBusMessage.html
DBusMessage
*message, const char *interface)
Checks if the message has an interface.
#ga57
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga58
dbus_message_set_member
(
structDBusMessage.html
DBusMessage
*message, const char *member)
Sets the interface member being invoked (DBUS_MESSAGE_TYPE_METHOD_CALL) or emitted (DBUS_MESSAGE_TYPE_SIGNAL).
#ga58
const char *
group__DBusMessage.html#ga59
dbus_message_get_member
(
structDBusMessage.html
DBusMessage
*message)
Gets the interface member being invoked (DBUS_MESSAGE_TYPE_METHOD_CALL) or emitted (DBUS_MESSAGE_TYPE_SIGNAL).
#ga59
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga60
dbus_message_has_member
(
structDBusMessage.html
DBusMessage
*message, const char *member)
Checks if the message has an interface member.
#ga60
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga61
dbus_message_set_error_name
(
structDBusMessage.html
DBusMessage
*message, const char *error_name)
Sets the name of the error (DBUS_MESSAGE_TYPE_ERROR).
#ga61
const char *
group__DBusMessage.html#ga62
dbus_message_get_error_name
(
structDBusMessage.html
DBusMessage
*message)
Gets the error name (DBUS_MESSAGE_TYPE_ERROR only) or
group__DBusMacros.html#ga4
NULL
if none.
#ga62
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga63
dbus_message_set_destination
(
structDBusMessage.html
DBusMessage
*message, const char *destination)
Sets the message's destination.
#ga63
const char *
group__DBusMessage.html#ga64
dbus_message_get_destination
(
structDBusMessage.html
DBusMessage
*message)
Gets the destination of a message or
group__DBusMacros.html#ga4
NULL
if there is none set.
#ga64
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga65
dbus_message_set_sender
(
structDBusMessage.html
DBusMessage
*message, const char *sender)
Sets the message sender.
#ga65
const char *
group__DBusMessage.html#ga66
dbus_message_get_sender
(
structDBusMessage.html
DBusMessage
*message)
Gets the unique name of the connection which originated this message, or
group__DBusMacros.html#ga4
NULL
if unknown or inapplicable.
#ga66
const char *
group__DBusMessage.html#ga67
dbus_message_get_signature
(
structDBusMessage.html
DBusMessage
*message)
Gets the type signature of the message, i.e.
#ga67
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga69
dbus_message_is_method_call
(
structDBusMessage.html
DBusMessage
*message, const char *interface, const char *method)
Checks whether the message is a method call with the given interface and member fields.
#ga69
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga70
dbus_message_is_signal
(
structDBusMessage.html
DBusMessage
*message, const char *interface, const char *signal_name)
Checks whether the message is a signal with the given interface and member fields.
#ga70
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga71
dbus_message_is_error
(
structDBusMessage.html
DBusMessage
*message, const char *error_name)
Checks whether the message is an error reply with the given error name.
#ga71
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga72
dbus_message_has_destination
(
structDBusMessage.html
DBusMessage
*message, const char *name)
Checks whether the message was sent to the given name.
#ga72
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga73
dbus_message_has_sender
(
structDBusMessage.html
DBusMessage
*message, const char *name)
Checks whether the message has the given unique name as its sender.
#ga73
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga74
dbus_message_has_signature
(
structDBusMessage.html
DBusMessage
*message, const char *signature)
Checks whether the message has the given signature; see
group__DBusMessage.html#ga67
dbus_message_get_signature()
for more details on what the signature looks like.
#ga74
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMessage.html#ga75
dbus_set_error_from_message
(
structDBusError.html
DBusError
*error,
structDBusMessage.html
DBusMessage
*message)
Sets a
structDBusError.html
DBusError
based on the contents of the given message.
#ga75
Detailed Description
Message to be sent or received over a
structDBusConnection.html
DBusConnection
.
A
structDBusMessage.html
DBusMessage
is the most basic unit of communication over a
structDBusConnection.html
DBusConnection
. A
structDBusConnection.html
DBusConnection
represents a stream of messages received from a remote application, and a stream of messages sent to a remote application.
Function Documentation
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_message_iter_get_args_valist
(
structDBusMessageIter.html
DBusMessageIter
*
iter
,
structDBusError.html
DBusError
*
error
,
int
first_arg_type
,
va_list
var_args
)
This function takes a va_list for use by language bindings and is otherwise the same as dbus_message_iter_get_args().
group__DBusMessage.html#ga24
dbus_message_get_args()
is the place to go for complete documentation.
See also:
group__DBusMessage.html#ga24
dbus_message_get_args
Parameters:
iter
the message iter
error
error to be filled in
first_arg_type
type of the first argument
var_args
return location for first argument, followed by list of type/location pairs
Returns:
group__DBusMacros.html#ga3
FALSE
if error was set
Definition at line
dbus-message_8c-source.html#l01760
1760
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8c-source.html#l00303
_dbus_strdup()
,
dbus-marshal-recursive_8c-source.html#l00881
_dbus_type_reader_get_current_type()
,
dbus-marshal-recursive_8c-source.html#l00916
_dbus_type_reader_get_element_type()
,
dbus-marshal-recursive_8c-source.html#l01147
_dbus_type_reader_next()
,
dbus-marshal-recursive_8c-source.html#l00965
_dbus_type_reader_read_basic()
,
dbus-marshal-recursive_8c-source.html#l01019
_dbus_type_reader_read_fixed_multi()
,
dbus-marshal-recursive_8c-source.html#l01084
_dbus_type_reader_recurse()
,
dbus-marshal-basic_8c-source.html#l01308
_dbus_type_to_string()
,
dbus-internals_8c-source.html#l00203
_dbus_warn()
,
dbus-memory_8c-source.html#l00650
dbus_free_string_array()
,
dbus-message_8c-source.html#l01556
dbus_message_iter_get_arg_type()
,
dbus-memory_8h-source.html#l00042
dbus_new0
,
dbus-errors_8c-source.html#l00313
dbus_set_error()
,
dbus-signature_8c-source.html#l00285
dbus_type_is_basic()
,
dbus-signature_8c-source.html#l00307
dbus_type_is_fixed()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-message_8c-source.html#l01393
dbus_message_get_args_valist()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_append_args
(
structDBusMessage.html
DBusMessage
*
message
,
int
first_arg_type
,
...
)
Appends fields to a message given a variable argument list.
The variable argument list should contain the type of each argument followed by the value to append. Appendable types are basic types, and arrays of fixed-length basic types. To append variable-length basic types, or any more complex value, you have to use an iterator rather than this function.
To append a basic type, specify its type code followed by the address of the value. For example:
group__DBusTypes.html#ga4
dbus_int32_t
v_INT32 = 42;
const
char
*v_STRING =
"Hello World"
;
DBUS_TYPE_INT32, &v_INT32,
DBUS_TYPE_STRING, &v_STRING,
To append an array of fixed-length basic types, pass in the DBUS_TYPE_ARRAY typecode, the element typecode, the address of the array pointer, and a 32-bit integer giving the number of elements in the array. So for example:
const
group__DBusTypes.html#ga4
dbus_int32_t
array[] = { 1, 2, 3 };
const
group__DBusTypes.html#ga4
dbus_int32_t
*v_ARRAY = array;
DBUS_TYPE_ARRAY, DBUS_TYPE_INT32, &v_ARRAY, 3
Warning:
in C, given "int array[]", "&array == array" (the comp.lang.c FAQ says otherwise, but gcc and the FAQ don't agree). So if you're using an array instead of a pointer you have to create a pointer variable, assign the array to it, then take the address of the pointer variable. For strings it works to write const char *array = "Hello" and then use &array though.
The last argument to this function must be DBUS_TYPE_INVALID, marking the end of the argument list.
String/signature/path arrays should be passed in as "const char*** address_of_array" and "int n_elements"
todo.html#_todo000042
Todo:
support DBUS_TYPE_STRUCT and DBUS_TYPE_VARIANT and complex arrays
todo.html#_todo000042
Todo:
If this fails due to lack of memory, the message is hosed and you have to start over building the whole message.
Parameters:
message
the message
first_arg_type
type of the first argument
...
value of first argument, list of additional type-value pairs
Returns:
group__DBusMacros.html#ga2
TRUE
on success
Definition at line
dbus-message_8c-source.html#l01189
1189
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-message_8c-source.html#l01222
dbus_message_append_args_valist()
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-bus_8c-source.html#l00889
dbus_bus_add_match()
,
dbus-bus_8c-source.html#l00560
dbus_bus_get_unix_user()
,
dbus-bus_8c-source.html#l00716
dbus_bus_name_has_owner()
,
dbus-bus_8c-source.html#l00935
dbus_bus_remove_match()
,
dbus-bus_8c-source.html#l00641
dbus_bus_request_name()
,
dbus-bus_8c-source.html#l00785
dbus_bus_start_service_by_name()
, and
message_8cpp-source.html#l00507
DBusQt::Message::operator<<()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_append_args_valist
(
structDBusMessage.html
DBusMessage
*
message
,
int
first_arg_type
,
va_list
var_args
)
This function takes a va_list for use by language bindings.
It's otherwise the same as
group__DBusMessage.html#ga22
dbus_message_append_args()
.
todo.html#_todo000044
Todo:
for now, if this function fails due to OOM it will leave the message half-written and you have to discard the message and start over.
See also:
group__DBusMessage.html#ga22
dbus_message_append_args
.
Parameters:
message
the message
first_arg_type
type of first argument
var_args
value of first argument, then list of type/value pairs
Returns:
group__DBusMacros.html#ga2
TRUE
on success
Definition at line
dbus-message_8c-source.html#l01222
1222
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-basic_8c-source.html#l01308
_dbus_type_to_string()
,
dbus-internals_8c-source.html#l00203
_dbus_warn()
,
dbus-message_8c-source.html#l02116
dbus_message_iter_append_basic()
,
dbus-message_8c-source.html#l02175
dbus_message_iter_append_fixed_array()
,
dbus-message_8c-source.html#l02286
dbus_message_iter_close_container()
,
dbus-message_8c-source.html#l01948
dbus_message_iter_init_append()
,
dbus-message_8c-source.html#l02220
dbus_message_iter_open_container()
,
dbus-signature_8c-source.html#l00285
dbus_type_is_basic()
,
dbus-signature_8c-source.html#l00307
dbus_type_is_fixed()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-message_8c-source.html#l01189
dbus_message_append_args()
.
structDBusMessage.html
DBusMessage
* dbus_message_copy
(
const
structDBusMessage.html
DBusMessage
*
message
)
Creates a new message that is an exact replica of the message specified, except that its refcount is set to 1, its message serial is reset to 0, and if the original message was "locked" (in the outgoing message queue and thus not modifiable) the new message will not be locked.
Parameters:
message
the message.
Returns:
the new message.
Definition at line
dbus-message_8c-source.html#l01022
1022
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l00481
_dbus_header_copy()
,
dbus-marshal-header_8c-source.html#l00467
_dbus_header_free()
,
dbus-string_8c-source.html#l01472
_dbus_string_copy()
,
dbus-string_8c-source.html#l00261
_dbus_string_free()
,
dbus-string_8c-source.html#l00130
_dbus_string_init_preallocated()
,
dbus-message-private_8h-source.html#l00094
body
,
dbus-message-private_8h-source.html#l00096
byte_order
,
dbus-memory_8c-source.html#l00612
dbus_free()
,
dbus-memory_8h-source.html#l00042
dbus_new0
,
group__DBusMacros.html#ga3
FALSE
,
dbus-message-private_8h-source.html#l00112
generation
,
dbus-message-private_8h-source.html#l00092
header
,
dbus-message-private_8h-source.html#l00098
locked
,
group__DBusMacros.html#ga4
NULL
,
dbus-message-private_8h-source.html#l00090
refcount
, and
dbus-sysdeps_8h-source.html#l00192
DBusAtomic::value
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_get_args
(
structDBusMessage.html
DBusMessage
*
message
,
structDBusError.html
DBusError
*
error
,
int
first_arg_type
,
...
)
Gets arguments from a message given a variable argument list.
The supported types include those supported by
group__DBusMessage.html#ga22
dbus_message_append_args()
; that is, basic types and arrays of fixed-length basic types. The arguments are the same as they would be for
group__DBusMessage.html#ga35
dbus_message_iter_get_basic()
or
group__DBusMessage.html#ga37
dbus_message_iter_get_fixed_array()
.
In addition to those types, arrays of string, object path, and signature are supported; but these are returned as allocated memory and must be freed with
group__DBusMemory.html#ga4
dbus_free_string_array()
, while the other types are returned as const references. To get a string array pass in "char ***array_location" and "int *n_elements"
The variable argument list should contain the type of the argument followed by a pointer to where the value should be stored. The list is terminated with DBUS_TYPE_INVALID.
The returned values are constant; do not free them. They point into the
structDBusMessage.html
DBusMessage
.
If the requested arguments are not present, or do not have the requested types, then an error will be set.
todo.html#_todo000045
Todo:
support DBUS_TYPE_STRUCT and DBUS_TYPE_VARIANT and complex arrays
Parameters:
message
the message
error
error to be filled in on failure
first_arg_type
the first argument type
...
location for first argument value, then list of type-location pairs
Returns:
group__DBusMacros.html#ga3
FALSE
if the error was set
Definition at line
dbus-message_8c-source.html#l01363
1363
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-message_8c-source.html#l01393
dbus_message_get_args_valist()
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-bus_8c-source.html#l00560
dbus_bus_get_unix_user()
,
dbus-bus_8c-source.html#l00716
dbus_bus_name_has_owner()
,
dbus-bus_8c-source.html#l00428
dbus_bus_register()
,
dbus-bus_8c-source.html#l00641
dbus_bus_request_name()
,
dbus-bus_8c-source.html#l00785
dbus_bus_start_service_by_name()
, and
dbus-message_8c-source.html#l03074
dbus_set_error_from_message()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_get_args_valist
(
structDBusMessage.html
DBusMessage
*
message
,
structDBusError.html
DBusError
*
error
,
int
first_arg_type
,
va_list
var_args
)
This function takes a va_list for use by language bindings.
It is otherwise the same as
group__DBusMessage.html#ga24
dbus_message_get_args()
.
See also:
group__DBusMessage.html#ga24
dbus_message_get_args
Parameters:
message
the message
error
error to be filled in
first_arg_type
type of the first argument
var_args
return location for first argument, followed by list of type/location pairs
Returns:
group__DBusMacros.html#ga3
FALSE
if error was set
Definition at line
dbus-message_8c-source.html#l01393
1393
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-message_8c-source.html#l01760
_dbus_message_iter_get_args_valist()
,
dbus-message_8c-source.html#l01434
dbus_message_iter_init()
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-message_8c-source.html#l01363
dbus_message_get_args()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_get_auto_start
(
structDBusMessage.html
DBusMessage
*
message
)
Returns
group__DBusMacros.html#ga2
TRUE
if the message will cause an owner for destination name to be auto-started.
Parameters:
message
the message
Returns:
group__DBusMacros.html#ga2
TRUE
if the message will use auto-start
Definition at line
dbus-message_8c-source.html#l02376
2376
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l01449
_dbus_header_get_flag()
,
group__DBusMacros.html#ga3
FALSE
,
dbus-message-private_8h-source.html#l00092
header
, and
group__DBusMacros.html#ga4
NULL
.
const char* dbus_message_get_destination
(
structDBusMessage.html
DBusMessage
*
message
)
Gets the destination of a message or
group__DBusMacros.html#ga4
NULL
if there is none set.
Parameters:
message
the message
Returns:
the message destination (should not be freed) or
group__DBusMacros.html#ga4
NULL
Definition at line
dbus-message_8c-source.html#l02743
2743
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l01321
_dbus_header_get_field_basic()
,
dbus-message-private_8h-source.html#l00092
header
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-message_8c-source.html#l02968
dbus_message_has_destination()
, and
message_8cpp-source.html#l00425
DBusQt::Message::destination()
.
const char* dbus_message_get_error_name
(
structDBusMessage.html
DBusMessage
*
message
)
Gets the error name (DBUS_MESSAGE_TYPE_ERROR only) or
group__DBusMacros.html#ga4
NULL
if none.
Parameters:
message
the message
Returns:
the error name (should not be freed) or
group__DBusMacros.html#ga4
NULL
Definition at line
dbus-message_8c-source.html#l02696
2696
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l01321
_dbus_header_get_field_basic()
,
dbus-message-private_8h-source.html#l00092
header
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-message_8c-source.html#l02935
dbus_message_is_error()
,
dbus-message_8c-source.html#l03074
dbus_set_error_from_message()
, and
message_8cpp-source.html#l00415
DBusQt::Message::errorName()
.
const char* dbus_message_get_interface
(
structDBusMessage.html
DBusMessage
*
message
)
Gets the interface this message is being sent to (for DBUS_MESSAGE_TYPE_METHOD_CALL) or being emitted from (for DBUS_MESSAGE_TYPE_SIGNAL).
The interface name is fully-qualified (namespaced). Returns
group__DBusMacros.html#ga4
NULL
if none.
Parameters:
message
the message
Returns:
the message interface (should not be freed) or
group__DBusMacros.html#ga4
NULL
Definition at line
dbus-message_8c-source.html#l02539
2539
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l01321
_dbus_header_get_field_basic()
,
dbus-message-private_8h-source.html#l00092
header
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-connection_8c-source.html#l00492
_dbus_connection_message_sent()
,
dbus-connection_8c-source.html#l00358
_dbus_connection_queue_received_message_link()
,
dbus-connection_8c-source.html#l03435
dbus_connection_dispatch()
,
dbus-connection_8c-source.html#l02248
dbus_connection_send_preallocated()
,
dbus-message_8c-source.html#l02560
dbus_message_has_interface()
, and
message_8cpp-source.html#l00395
DBusQt::Message::interface()
.
const char* dbus_message_get_member
(
structDBusMessage.html
DBusMessage
*
message
)
Gets the interface member being invoked (DBUS_MESSAGE_TYPE_METHOD_CALL) or emitted (DBUS_MESSAGE_TYPE_SIGNAL).
Returns
group__DBusMacros.html#ga4
NULL
if none.
Parameters:
message
the message
Returns:
the member name (should not be freed) or
group__DBusMacros.html#ga4
NULL
Definition at line
dbus-message_8c-source.html#l02619
2619
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l01321
_dbus_header_get_field_basic()
,
dbus-message-private_8h-source.html#l00092
header
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-connection_8c-source.html#l00492
_dbus_connection_message_sent()
,
dbus-connection_8c-source.html#l00358
_dbus_connection_queue_received_message_link()
,
dbus-connection_8c-source.html#l03435
dbus_connection_dispatch()
,
dbus-connection_8c-source.html#l02248
dbus_connection_send_preallocated()
,
dbus-message_8c-source.html#l02640
dbus_message_has_member()
, and
message_8cpp-source.html#l00405
DBusQt::Message::member()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_get_no_reply
(
structDBusMessage.html
DBusMessage
*
message
)
Returns
group__DBusMacros.html#ga2
TRUE
if the message does not expect a reply.
Parameters:
message
the message
Returns:
group__DBusMacros.html#ga2
TRUE
if the message sender isn't waiting for a reply
Definition at line
dbus-message_8c-source.html#l02338
2338
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l01449
_dbus_header_get_flag()
,
group__DBusMacros.html#ga3
FALSE
,
dbus-message-private_8h-source.html#l00092
header
, and
group__DBusMacros.html#ga4
NULL
.
const char* dbus_message_get_path
(
structDBusMessage.html
DBusMessage
*
message
)
Gets the object path this message is being sent to (for DBUS_MESSAGE_TYPE_METHOD_CALL) or being emitted from (for DBUS_MESSAGE_TYPE_SIGNAL).
Returns
group__DBusMacros.html#ga4
NULL
if none.
Parameters:
message
the message
Returns:
the path (should not be freed) or
group__DBusMacros.html#ga4
NULL
Definition at line
dbus-message_8c-source.html#l02419
2419
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l01321
_dbus_header_get_field_basic()
,
dbus-message-private_8h-source.html#l00092
header
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-connection_8c-source.html#l00492
_dbus_connection_message_sent()
,
dbus-connection_8c-source.html#l00358
_dbus_connection_queue_received_message_link()
,
dbus-message_8c-source.html#l02482
dbus_message_get_path_decomposed()
,
dbus-message_8c-source.html#l02440
dbus_message_has_path()
, and
message_8cpp-source.html#l00385
DBusQt::Message::path()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_get_path_decomposed
(
structDBusMessage.html
DBusMessage
*
message
,
char ***
path
)
Gets the object path this message is being sent to (for DBUS_MESSAGE_TYPE_METHOD_CALL) or being emitted from (for DBUS_MESSAGE_TYPE_SIGNAL) in a decomposed format (one array element per path component).
Free the returned array with
group__DBusMemory.html#ga4
dbus_free_string_array()
.
An empty but non-NULL path array means the path "/". So the path "/foo/bar" becomes { "foo", "bar", NULL } and the path "/" becomes { NULL }.
todo.html#_todo000051
Todo:
this could be optimized by using the len from the message instead of calling strlen() again
Parameters:
message
the message
path
place to store allocated array of path components;
group__DBusMacros.html#ga4
NULL
set here if no path field exists
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory to allocate the array
Definition at line
dbus-message_8c-source.html#l02482
2482
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-object-tree_8c-source.html#l01081
_dbus_decompose_path()
,
dbus-message_8c-source.html#l02419
dbus_message_get_path()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-object-tree_8c-source.html#l00749
_dbus_object_tree_dispatch_and_unlock()
.
group__DBusTypes.html#ga3
dbus_uint32_t
dbus_message_get_reply_serial
(
structDBusMessage.html
DBusMessage
*
message
)
Returns the serial that the message is a reply to or 0 if none.
Parameters:
message
the message
Returns:
the reply serial
Definition at line
dbus-message_8c-source.html#l00419
419
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l01321
_dbus_header_get_field_basic()
,
dbus-message-private_8h-source.html#l00092
header
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-connection_8c-source.html#l00358
_dbus_connection_queue_received_message_link()
,
dbus-connection_8c-source.html#l00875
_dbus_pending_call_complete_and_unlock()
, and
dbus-connection_8c-source.html#l03435
dbus_connection_dispatch()
.
const char* dbus_message_get_sender
(
structDBusMessage.html
DBusMessage
*
message
)
Gets the unique name of the connection which originated this message, or
group__DBusMacros.html#ga4
NULL
if unknown or inapplicable.
The sender is filled in by the message bus.
Parameters:
message
the message
Returns:
the unique name of the sender or
group__DBusMacros.html#ga4
NULL
Definition at line
dbus-message_8c-source.html#l02789
2789
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l01321
_dbus_header_get_field_basic()
,
dbus-message-private_8h-source.html#l00092
header
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-message_8c-source.html#l03003
dbus_message_has_sender()
,
dbus-message_8c-source.html#l00914
dbus_message_new_error()
,
dbus-message_8c-source.html#l00826
dbus_message_new_method_return()
, and
message_8cpp-source.html#l00446
DBusQt::Message::sender()
.
group__DBusTypes.html#ga3
dbus_uint32_t
dbus_message_get_serial
(
structDBusMessage.html
DBusMessage
*
message
)
Returns the serial of a message or 0 if none has been specified.
The message's serial number is provided by the application sending the message and is used to identify replies to this message. All messages received on a connection will have a serial, but messages you haven't sent yet may return 0.
Parameters:
message
the message
Returns:
the client serial
Definition at line
dbus-message_8c-source.html#l00384
384
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l00413
_dbus_header_get_serial()
,
dbus-message-private_8h-source.html#l00092
header
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-message_8c-source.html#l00162
_dbus_message_set_serial()
,
dbus-connection_8c-source.html#l02416
dbus_connection_send_with_reply()
,
dbus-message_8c-source.html#l00914
dbus_message_new_error()
, and
dbus-message_8c-source.html#l00826
dbus_message_new_method_return()
.
const char* dbus_message_get_signature
(
structDBusMessage.html
DBusMessage
*
message
)
Gets the type signature of the message, i.e.
the arguments in the message payload. The signature includes only "in" arguments for DBUS_MESSAGE_TYPE_METHOD_CALL and only "out" arguments for DBUS_MESSAGE_TYPE_METHOD_RETURN, so is slightly different from what you might expect (it does not include the signature of the entire C++-style method).
The signature is a string made up of type codes such as DBUS_TYPE_INT32. The string is terminated with nul (nul is also the value of DBUS_TYPE_INVALID).
Parameters:
message
the message
Returns:
the type signature
Definition at line
dbus-message_8c-source.html#l02819
2819
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-message-private_8h-source.html#l00092
header
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-connection_8c-source.html#l00492
_dbus_connection_message_sent()
,
dbus-connection_8c-source.html#l00358
_dbus_connection_queue_received_message_link()
,
dbus-message_8c-source.html#l00277
_dbus_message_lock()
,
dbus-connection_8c-source.html#l03435
dbus_connection_dispatch()
,
dbus-message_8c-source.html#l03032
dbus_message_has_signature()
, and
message_8cpp-source.html#l00451
DBusQt::Message::signature()
.
int dbus_message_get_type
(
structDBusMessage.html
DBusMessage
*
message
)
Gets the type of a message.
Types include DBUS_MESSAGE_TYPE_METHOD_CALL, DBUS_MESSAGE_TYPE_METHOD_RETURN, DBUS_MESSAGE_TYPE_ERROR, DBUS_MESSAGE_TYPE_SIGNAL, but other types are allowed and all code must silently ignore messages of unknown type. DBUS_MESSAGE_TYPE_INVALID will never be returned, however.
Parameters:
message
the message
Returns:
the type of the message
Definition at line
dbus-message_8c-source.html#l01129
1129
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l00372
_dbus_header_get_message_type()
,
dbus-message-private_8h-source.html#l00092
header
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-connection_8c-source.html#l00492
_dbus_connection_message_sent()
,
dbus-connection_8c-source.html#l00358
_dbus_connection_queue_received_message_link()
,
dbus-connection_8c-source.html#l00875
_dbus_pending_call_complete_and_unlock()
,
dbus-connection_8c-source.html#l03435
dbus_connection_dispatch()
,
dbus-connection_8c-source.html#l02248
dbus_connection_send_preallocated()
,
dbus-message_8c-source.html#l02935
dbus_message_is_error()
,
dbus-message_8c-source.html#l03074
dbus_set_error_from_message()
, and
message_8cpp-source.html#l00375
DBusQt::Message::type()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_has_destination
(
structDBusMessage.html
DBusMessage
*
message
,
const char *
name
)
Checks whether the message was sent to the given name.
If the message has no destination specified or has a different destination, returns
group__DBusMacros.html#ga3
FALSE
.
Parameters:
message
the message
name
the name to check (must not be
group__DBusMacros.html#ga4
NULL
)
Returns:
group__DBusMacros.html#ga2
TRUE
if the message has the given destination name
Definition at line
dbus-message_8c-source.html#l02968
2968
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-message_8c-source.html#l02743
dbus_message_get_destination()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_has_interface
(
structDBusMessage.html
DBusMessage
*
message
,
const char *
interface
)
Checks if the message has an interface.
Parameters:
message
the message
Returns:
group__DBusMacros.html#ga2
TRUE
if there is a interface field in the header
Definition at line
dbus-message_8c-source.html#l02560
2560
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-message_8c-source.html#l02539
dbus_message_get_interface()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_has_member
(
structDBusMessage.html
DBusMessage
*
message
,
const char *
member
)
Checks if the message has an interface member.
Parameters:
message
the message
Returns:
group__DBusMacros.html#ga2
TRUE
if there is a member field in the header
Definition at line
dbus-message_8c-source.html#l02640
2640
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-message_8c-source.html#l02619
dbus_message_get_member()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_has_path
(
structDBusMessage.html
DBusMessage
*
message
,
const char *
path
)
Checks if the message has a path.
Parameters:
message
the message
Returns:
group__DBusMacros.html#ga2
TRUE
if there is a path field in the header
Definition at line
dbus-message_8c-source.html#l02440
2440
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-message_8c-source.html#l02419
dbus_message_get_path()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_has_sender
(
structDBusMessage.html
DBusMessage
*
message
,
const char *
name
)
Checks whether the message has the given unique name as its sender.
If the message has no sender specified or has a different sender, returns
group__DBusMacros.html#ga3
FALSE
. Note that a peer application will always have the unique name of the connection as the sender. So you can't use this function to see whether a sender owned a well-known name.
Messages from the bus itself will have DBUS_SERVICE_DBUS as the sender.
Parameters:
message
the message
name
the name to check (must not be
group__DBusMacros.html#ga4
NULL
)
Returns:
group__DBusMacros.html#ga2
TRUE
if the message has the given sender
Definition at line
dbus-message_8c-source.html#l03003
3003
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-message_8c-source.html#l02789
dbus_message_get_sender()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_has_signature
(
structDBusMessage.html
DBusMessage
*
message
,
const char *
signature
)
Checks whether the message has the given signature; see
group__DBusMessage.html#ga67
dbus_message_get_signature()
for more details on what the signature looks like.
Parameters:
message
the message
signature
typecode array
Returns:
group__DBusMacros.html#ga2
TRUE
if message has the given signature
Definition at line
dbus-message_8c-source.html#l03032
3032
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-message_8c-source.html#l02819
dbus_message_get_signature()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_is_error
(
structDBusMessage.html
DBusMessage
*
message
,
const char *
error_name
)
Checks whether the message is an error reply with the given error name.
If the message is not DBUS_MESSAGE_TYPE_ERROR, or has a different name, returns
group__DBusMacros.html#ga3
FALSE
.
Parameters:
message
the message
error_name
the name to check (must not be
group__DBusMacros.html#ga4
NULL
)
Returns:
group__DBusMacros.html#ga2
TRUE
if the message is the specified error
Definition at line
dbus-message_8c-source.html#l02935
2935
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-message_8c-source.html#l02696
dbus_message_get_error_name()
,
dbus-message_8c-source.html#l01129
dbus_message_get_type()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_is_method_call
(
structDBusMessage.html
DBusMessage
*
message
,
const char *
interface
,
const char *
method
)
Checks whether the message is a method call with the given interface and member fields.
If the message is not DBUS_MESSAGE_TYPE_METHOD_CALL, or has a different interface or member field, returns
group__DBusMacros.html#ga3
FALSE
. If the interface field is missing, then it will be assumed equal to the provided interface. The D-BUS protocol allows method callers to leave out the interface name.
Parameters:
message
the message
interface
the name to check (must not be
group__DBusMacros.html#ga4
NULL
)
method
the name to check (must not be
group__DBusMacros.html#ga4
NULL
)
Returns:
group__DBusMacros.html#ga2
TRUE
if the message is the specified method call
Definition at line
dbus-message_8c-source.html#l02878
2878
of file
dbus-message_8c-source.html
dbus-message.c
.
References
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga4
NULL
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_is_signal
(
structDBusMessage.html
DBusMessage
*
message
,
const char *
interface
,
const char *
signal_name
)
Checks whether the message is a signal with the given interface and member fields.
If the message is not DBUS_MESSAGE_TYPE_SIGNAL, or has a different interface or member field, returns
group__DBusMacros.html#ga3
FALSE
. If the interface field in the message is missing, it is assumed to match any interface you pass in to this function.
Parameters:
message
the message
interface
the name to check (must not be
group__DBusMacros.html#ga4
NULL
)
signal_name
the name to check (must not be
group__DBusMacros.html#ga4
NULL
)
Returns:
group__DBusMacros.html#ga2
TRUE
if the message is the specified signal
Definition at line
dbus-message_8c-source.html#l02908
2908
of file
dbus-message_8c-source.html
dbus-message.c
.
References
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-connection_8c-source.html#l03435
dbus_connection_dispatch()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_iter_append_basic
(
structDBusMessageIter.html
DBusMessageIter
*
iter
,
int
type
,
const void *
value
)
Appends a basic-typed value to the message.
The basic types are the non-container types such as integer and string.
The "value" argument should be the address of a basic-typed value. So for string, const char**. For integer, dbus_int32_t*.
todo.html#_todo000047
Todo:
If this fails due to lack of memory, the message is hosed and you have to start over building the whole message.
Parameters:
iter
the append iterator
type
the type of the value
value
the address of the value
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-message_8c-source.html#l02116
2116
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-recursive_8c-source.html#l02387
_dbus_type_writer_write_basic()
,
dbus-signature_8c-source.html#l00285
dbus_type_is_basic()
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
UInt64_8cs-source.html#l00031
DBus::DBusType::UInt64::Append()
,
UInt32_8cs-source.html#l00031
DBus::DBusType::UInt32::Append()
,
String_8cs-source.html#l00035
DBus::DBusType::String::Append()
,
ObjectPath_8cs-source.html#l00051
DBus::DBusType::ObjectPath::Append()
,
Int64_8cs-source.html#l00031
DBus::DBusType::Int64::Append()
,
Int32_8cs-source.html#l00031
DBus::DBusType::Int32::Append()
,
Double_8cs-source.html#l00031
DBus::DBusType::Double::Append()
,
Byte_8cs-source.html#l00036
DBus::DBusType::Byte::Append()
,
Boolean_8cs-source.html#l00031
DBus::DBusType::Boolean::Append()
,
dbus-message_8c-source.html#l01222
dbus_message_append_args_valist()
, and
dbus-message_8c-source.html#l00914
dbus_message_new_error()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_iter_append_fixed_array
(
structDBusMessageIter.html
DBusMessageIter
*
iter
,
int
element_type
,
const void *
value
,
int
n_elements
)
Appends a block of fixed-length values to an array.
The fixed-length types are all basic types that are not string-like. So int32, double, bool, etc. You must call
group__DBusMessage.html#ga45
dbus_message_iter_open_container()
to open an array of values before calling this function. You may call this function multiple times (and intermixed with calls to
group__DBusMessage.html#ga43
dbus_message_iter_append_basic()
) for the same array.
The "value" argument should be the address of the array. So for integer, "dbus_int32_t**" is expected for example.
Warning:
in C, given "int array[]", "&array == array" (the comp.lang.c FAQ says otherwise, but gcc and the FAQ don't agree). So if you're using an array instead of a pointer you have to create a pointer variable, assign the array to it, then take the address of the pointer variable.
const
group__DBusTypes.html#ga4
dbus_int32_t
array[] = { 1, 2, 3 };
const
group__DBusTypes.html#ga4
dbus_int32_t
*v_ARRAY = array;
if
(!
group__DBusMessage.html#ga44
dbus_message_iter_append_fixed_array
(&iter, DBUS_TYPE_INT32, &v_ARRAY, 3))
fprintf (stderr,
"No memory!\n"
);
For strings it works to write const char *array = "Hello" and then use &array though.
todo.html#_todo000048
Todo:
If this fails due to lack of memory, the message is hosed and you have to start over building the whole message.
Parameters:
iter
the append iterator
element_type
the type of the array elements
value
the address of the array
n_elements
the number of elements to append
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-message_8c-source.html#l02175
2175
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-basic_8c-source.html#l01226
_dbus_type_get_alignment()
,
dbus-marshal-recursive_8c-source.html#l02435
_dbus_type_writer_write_fixed_multi()
,
dbus-signature_8c-source.html#l00307
dbus_type_is_fixed()
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-message_8c-source.html#l01222
dbus_message_append_args_valist()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_iter_close_container
(
structDBusMessageIter.html
DBusMessageIter
*
iter
,
structDBusMessageIter.html
DBusMessageIter
*
sub
)
Closes a container-typed value appended to the message; may write out more information to the message known only after the entire container is written, and may free resources created by
group__DBusMessage.html#ga45
dbus_message_iter_open_container()
.
todo.html#_todo000050
Todo:
If this fails due to lack of memory, the message is hosed and you have to start over building the whole message.
Parameters:
iter
the append iterator
sub
sub-iterator to close
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-message_8c-source.html#l02286
2286
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-recursive_8c-source.html#l02255
_dbus_type_writer_unrecurse()
, and
group__DBusMacros.html#ga3
FALSE
.
Referenced by
Array_8cs-source.html#l00057
DBus::DBusType::Array::Append()
, and
dbus-message_8c-source.html#l01222
dbus_message_append_args_valist()
.
int dbus_message_iter_get_arg_type
(
structDBusMessageIter.html
DBusMessageIter
*
iter
)
Returns the argument type of the argument that the message iterator points to.
If the iterator is at the end of the message, returns DBUS_TYPE_INVALID. You can thus write a loop as follows:
group__DBusMessage.html#ga27
dbus_message_iter_init
(&iter);
while
((current_type =
group__DBusMessage.html#ga31
dbus_message_iter_get_arg_type
(&iter)) != DBUS_TYPE_INVALID)
group__DBusMessage.html#ga30
dbus_message_iter_next
(&iter);
Parameters:
iter
the message iter
Returns:
the argument type
Definition at line
dbus-message_8c-source.html#l01556
1556
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-recursive_8c-source.html#l00881
_dbus_type_reader_get_current_type()
, and
group__DBusMacros.html#ga3
FALSE
.
Referenced by
dbus-message_8c-source.html#l01760
_dbus_message_iter_get_args_valist()
,
Array_8cs-source.html#l00032
DBus::DBusType::Array::Array()
,
dbus-message_8c-source.html#l01575
dbus_message_iter_get_element_type()
,
message_8cpp-source.html#l00226
DBusQt::Message::iterator::fillVar()
, and
message_8cpp-source.html#l00183
DBusQt::Message::iterator::marshallBaseType()
.
int dbus_message_iter_get_array_len
(
structDBusMessageIter.html
DBusMessageIter
*
iter
)
Returns the number of elements in the array;.
Parameters:
iter
the iterator
Returns:
the number of elements in the array
Definition at line
dbus-message_8c-source.html#l01705
1705
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-recursive_8c-source.html#l00995
_dbus_type_reader_get_array_length()
.
void dbus_message_iter_get_basic
(
structDBusMessageIter.html
DBusMessageIter
*
iter
,
void *
value
)
Reads a basic-typed value from the message iterator.
Basic types are the non-containers such as integer and string.
The value argument should be the address of a location to store the returned value. So for int32 it should be a "dbus_int32_t*" and for string a "const char**". The returned value is by reference and should not be freed.
All returned values are guaranteed to fit in 8 bytes. So you can write code like this:
#ifdef DBUS_HAVE_INT64
group__DBusTypes.html#ga7
dbus_uint64_t
value;
int
type;
group__DBusMessage.html#ga35
dbus_message_iter_get_basic
(&read_iter, &value);
type =
group__DBusMessage.html#ga31
dbus_message_iter_get_arg_type
(&read_iter);
group__DBusMessage.html#ga43
dbus_message_iter_append_basic
(&write_iter, type, &value);
#endif
To avoid the DBUS_HAVE_INT64 conditional, create a struct or something that occupies at least 8 bytes, e.g. you could use a struct with two int32 values in it. dbus_uint64_t is just one example of a type that's large enough to hold any possible value.
Be sure you have somehow checked that
group__DBusMessage.html#ga31
dbus_message_iter_get_arg_type()
matches the type you are expecting, or you'll crash when you try to use an integer as a string or something.
Parameters:
iter
the iterator
value
location to store the value
Definition at line
dbus-message_8c-source.html#l01686
1686
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-recursive_8c-source.html#l00965
_dbus_type_reader_read_basic()
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
Boolean_8cs-source.html#l00026
DBus::DBusType::Boolean::Boolean()
,
Byte_8cs-source.html#l00031
DBus::DBusType::Byte::Byte()
,
Double_8cs-source.html#l00026
DBus::DBusType::Double::Double()
,
message_8cpp-source.html#l00226
DBusQt::Message::iterator::fillVar()
,
Int32_8cs-source.html#l00026
DBus::DBusType::Int32::Int32()
,
Int64_8cs-source.html#l00026
DBus::DBusType::Int64::Int64()
,
message_8cpp-source.html#l00183
DBusQt::Message::iterator::marshallBaseType()
,
ObjectPath_8cs-source.html#l00029
DBus::DBusType::ObjectPath::ObjectPath()
,
String_8cs-source.html#l00026
DBus::DBusType::String::String()
,
UInt32_8cs-source.html#l00026
DBus::DBusType::UInt32::UInt32()
, and
UInt64_8cs-source.html#l00026
DBus::DBusType::UInt64::UInt64()
.
int dbus_message_iter_get_element_type
(
structDBusMessageIter.html
DBusMessageIter
*
iter
)
Returns the element type of the array that the message iterator points to.
Note that you need to check that the iterator points to an array prior to using this function.
Parameters:
iter
the message iter
Returns:
the array element type
Definition at line
dbus-message_8c-source.html#l01575
1575
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-recursive_8c-source.html#l00916
_dbus_type_reader_get_element_type()
, and
dbus-message_8c-source.html#l01556
dbus_message_iter_get_arg_type()
.
Referenced by
Array_8cs-source.html#l00032
DBus::DBusType::Array::Array()
, and
message_8cpp-source.html#l00226
DBusQt::Message::iterator::fillVar()
.
void dbus_message_iter_get_fixed_array
(
structDBusMessageIter.html
DBusMessageIter
*
iter
,
void *
value
,
int *
n_elements
)
Reads a block of fixed-length values from the message iterator.
Fixed-length values are those basic types that are not string-like, such as integers, bool, double. The block read will be from the current position in the array until the end of the array.
This function should only be used if
group__DBusSignature.html#ga10
dbus_type_is_fixed
returns
group__DBusMacros.html#ga2
TRUE
for the element type.
The value argument should be the address of a location to store the returned array. So for int32 it should be a "const dbus_int32_t**" The returned value is by reference and should not be freed.
Parameters:
iter
the iterator
value
location to store the block
n_elements
number of elements in the block
Definition at line
dbus-message_8c-source.html#l01732
1732
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-recursive_8c-source.html#l00881
_dbus_type_reader_get_current_type()
,
dbus-marshal-recursive_8c-source.html#l01019
_dbus_type_reader_read_fixed_multi()
,
dbus-signature_8c-source.html#l00307
dbus_type_is_fixed()
, and
group__DBusMacros.html#ga4
NULL
.
char* dbus_message_iter_get_signature
(
structDBusMessageIter.html
DBusMessageIter
*
iter
)
Returns the current signature of a message iterator.
This is useful primarily for dealing with variants; one can recurse into a variant and determine the signature of the variant's value.
Parameters:
iter
the message iterator
Returns:
the contained signature, or NULL if out of memory
Definition at line
dbus-message_8c-source.html#l01625
1625
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-string_8c-source.html#l01253
_dbus_string_append_len()
,
dbus-string_8c-source.html#l00261
_dbus_string_free()
,
dbus-string_8c-source.html#l00174
_dbus_string_init()
,
dbus-string_8c-source.html#l00607
_dbus_string_steal_data()
,
dbus-marshal-recursive_8c-source.html#l01218
_dbus_type_reader_get_signature()
, and
group__DBusMacros.html#ga4
NULL
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_iter_has_next
(
structDBusMessageIter.html
DBusMessageIter
*
iter
)
Checks if an iterator has any more fields.
Parameters:
iter
the message iter
Returns:
group__DBusMacros.html#ga2
TRUE
if there are more fields following
Definition at line
dbus-message_8c-source.html#l01512
1512
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-recursive_8c-source.html#l01187
_dbus_type_reader_has_next()
, and
group__DBusMacros.html#ga3
FALSE
.
Referenced by
message_8cpp-source.html#l00226
DBusQt::Message::iterator::fillVar()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_iter_init
(
structDBusMessage.html
DBusMessage
*
message
,
structDBusMessageIter.html
DBusMessageIter
*
iter
)
Initializes a
structDBusMessageIter.html
DBusMessageIter
for reading the arguments of the message passed in.
Parameters:
message
the message
iter
pointer to an iterator to initialize
Returns:
group__DBusMacros.html#ga3
FALSE
if the message has no arguments
Definition at line
dbus-message_8c-source.html#l01434
1434
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-recursive_8c-source.html#l00881
_dbus_type_reader_get_current_type()
,
dbus-marshal-recursive_8c-source.html#l00739
_dbus_type_reader_init()
,
dbus-message-private_8h-source.html#l00094
body
,
dbus-message-private_8h-source.html#l00096
byte_order
,
group__DBusMacros.html#ga3
FALSE
,
dbus-message-private_8h-source.html#l00092
header
,
group__DBusMacros.html#ga4
NULL
, and
structDBusMessageRealIter.html#o6
DBusMessageRealIter::u
.
Referenced by
dbus-message_8c-source.html#l01393
dbus_message_get_args_valist()
, and
message_8cpp-source.html#l00051
DBusQt::Message::iterator::iterator()
.
void dbus_message_iter_init_append
(
structDBusMessage.html
DBusMessage
*
message
,
structDBusMessageIter.html
DBusMessageIter
*
iter
)
Initializes a
structDBusMessageIter.html
DBusMessageIter
for appending arguments to the end of a message.
todo.html#_todo000046
Todo:
If appending any of the arguments fails due to lack of memory, generally the message is hosed and you have to start over building the whole message.
Parameters:
message
the message
iter
pointer to an iterator to initialize
Definition at line
dbus-message_8c-source.html#l01948
1948
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-recursive_8c-source.html#l01621
_dbus_type_writer_init_types_delayed()
,
dbus-message-private_8h-source.html#l00094
body
,
dbus-message-private_8h-source.html#l00096
byte_order
,
group__DBusMacros.html#ga4
NULL
, and
structDBusMessageRealIter.html#o6
DBusMessageRealIter::u
.
Referenced by
dbus-gobject_8c-source.html#l01866
dbus_g_method_return()
,
dbus-message_8c-source.html#l01222
dbus_message_append_args_valist()
, and
dbus-message_8c-source.html#l00914
dbus_message_new_error()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_iter_next
(
structDBusMessageIter.html
DBusMessageIter
*
iter
)
Moves the iterator to the next field, if any.
If there's no next field, returns
group__DBusMacros.html#ga3
FALSE
. If the iterator moves forward, returns
group__DBusMacros.html#ga2
TRUE
.
Parameters:
iter
the message iter
Returns:
group__DBusMacros.html#ga2
TRUE
if the iterator was moved to the next field
Definition at line
dbus-message_8c-source.html#l01531
1531
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-recursive_8c-source.html#l01147
_dbus_type_reader_next()
, and
group__DBusMacros.html#ga3
FALSE
.
Referenced by
Array_8cs-source.html#l00032
DBus::DBusType::Array::Array()
,
message_8cpp-source.html#l00226
DBusQt::Message::iterator::fillVar()
, and
message_8cpp-source.html#l00127
DBusQt::Message::iterator::operator++()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_iter_open_container
(
structDBusMessageIter.html
DBusMessageIter
*
iter
,
int
type
,
const char *
contained_signature
,
structDBusMessageIter.html
DBusMessageIter
*
sub
)
Appends a container-typed value to the message; you are required to append the contents of the container using the returned sub-iterator, and then call
group__DBusMessage.html#ga46
dbus_message_iter_close_container()
.
Container types are for example struct, variant, and array. For variants, the contained_signature should be the type of the single value inside the variant. For structs and dict entries, contained_signature should be
group__DBusMacros.html#ga4
NULL
; it will be set to whatever types you write into the struct. For arrays, contained_signature should be the type of the array elements.
todo.html#_todo000049
Todo:
If this fails due to lack of memory, the message is hosed and you have to start over building the whole message.
Parameters:
iter
the append iterator
type
the type of the value
contained_signature
the type of container contents
sub
sub-iterator to initialize
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-message_8c-source.html#l02220
2220
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-string_8c-source.html#l00208
_dbus_string_init_const()
,
dbus-marshal-recursive_8c-source.html#l02185
_dbus_type_writer_recurse()
,
dbus-signature_8c-source.html#l00263
dbus_type_is_container()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
structDBusMessageRealIter.html#o6
DBusMessageRealIter::u
.
Referenced by
Array_8cs-source.html#l00057
DBus::DBusType::Array::Append()
, and
dbus-message_8c-source.html#l01222
dbus_message_append_args_valist()
.
void dbus_message_iter_recurse
(
structDBusMessageIter.html
DBusMessageIter
*
iter
,
structDBusMessageIter.html
DBusMessageIter
*
sub
)
Recurses into a container value when reading values from a message, initializing a sub-iterator to use for traversing the child values of the container.
Note that this recurses into a value, not a type, so you can only recurse if the value exists. The main implication of this is that if you have for example an empty array of array of int32, you can recurse into the outermost array, but it will have no values, so you won't be able to recurse further. There's no array of int32 to recurse into.
Parameters:
iter
the message iterator
sub
the sub-iterator to initialize
Definition at line
dbus-message_8c-source.html#l01602
1602
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-recursive_8c-source.html#l01084
_dbus_type_reader_recurse()
,
group__DBusMacros.html#ga4
NULL
, and
structDBusMessageRealIter.html#o6
DBusMessageRealIter::u
.
Referenced by
Array_8cs-source.html#l00032
DBus::DBusType::Array::Array()
, and
message_8cpp-source.html#l00226
DBusQt::Message::iterator::fillVar()
.
structDBusMessage.html
DBusMessage
* dbus_message_new
(
int
message_type
)
Constructs a new message of the given message type.
Types include DBUS_MESSAGE_TYPE_METHOD_CALL, DBUS_MESSAGE_TYPE_SIGNAL, and so forth.
Parameters:
message_type
type of message
Returns:
new message or
group__DBusMacros.html#ga4
NULL
If no memory
Definition at line
dbus-message_8c-source.html#l00746
746
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l00518
_dbus_header_create()
,
dbus-message_8c-source.html#l01097
dbus_message_unref()
,
dbus-message-private_8h-source.html#l00092
header
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
message_8cpp-source.html#l00311
DBusQt::Message::Message()
.
structDBusMessage.html
DBusMessage
* dbus_message_new_error
(
structDBusMessage.html
DBusMessage
*
reply_to
,
const char *
error_name
,
const char *
error_message
)
Creates a new message that is an error reply to a certain message.
Error replies are possible in response to method calls primarily.
Parameters:
reply_to
the original message
error_name
the error name
error_message
the error message string or
group__DBusMacros.html#ga4
NULL
for none
Returns:
a new error message
Definition at line
dbus-message_8c-source.html#l00914
914
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l00518
_dbus_header_create()
,
dbus-message_8c-source.html#l02789
dbus_message_get_sender()
,
dbus-message_8c-source.html#l00384
dbus_message_get_serial()
,
dbus-message_8c-source.html#l02116
dbus_message_iter_append_basic()
,
dbus-message_8c-source.html#l01948
dbus_message_iter_init_append()
,
dbus-message_8c-source.html#l02319
dbus_message_set_no_reply()
,
dbus-message_8c-source.html#l00400
dbus_message_set_reply_serial()
,
dbus-message_8c-source.html#l01097
dbus_message_unref()
,
dbus-message-private_8h-source.html#l00092
header
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-connection_8c-source.html#l03435
dbus_connection_dispatch()
,
dbus-connection_8c-source.html#l02416
dbus_connection_send_with_reply()
,
dbus-message_8c-source.html#l00979
dbus_message_new_error_printf()
, and
message_8cpp-source.html#l00351
DBusQt::Message::Message()
.
structDBusMessage.html
DBusMessage
* dbus_message_new_error_printf
(
structDBusMessage.html
DBusMessage
*
reply_to
,
const char *
error_name
,
const char *
error_format
,
...
)
Creates a new message that is an error reply to a certain message.
Error replies are possible in response to method calls primarily.
Parameters:
reply_to
the original message
error_name
the error name
error_format
the error message format as with printf
...
format string arguments
Returns:
a new error message
Definition at line
dbus-message_8c-source.html#l00979
979
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-string_8c-source.html#l01191
_dbus_string_append_printf_valist()
,
dbus-string_8c-source.html#l00261
_dbus_string_free()
,
dbus-string_8c-source.html#l00174
_dbus_string_init()
,
dbus-message_8c-source.html#l00914
dbus_message_new_error()
, and
group__DBusMacros.html#ga4
NULL
.
structDBusMessage.html
DBusMessage
* dbus_message_new_method_call
(
const char *
destination
,
const char *
path
,
const char *
interface
,
const char *
method
)
Constructs a new message to invoke a method on a remote object.
Returns
group__DBusMacros.html#ga4
NULL
if memory can't be allocated for the message. The destination may be
group__DBusMacros.html#ga4
NULL
in which case no destination is set; this is appropriate when using D-BUS in a peer-to-peer context (no message bus). The interface may be
group__DBusMacros.html#ga4
NULL
, which means that if multiple methods with the given name exist it is undefined which one will be invoked.
Parameters:
destination
name that the message should be sent to or
group__DBusMacros.html#ga4
NULL
path
object path the message should be sent to
interface
interface to invoke method on
method
method to invoke
Returns:
a new
structDBusMessage.html
DBusMessage
, free with
group__DBusMessage.html#ga20
dbus_message_unref()
See also:
group__DBusMessage.html#ga20
dbus_message_unref()
Definition at line
dbus-message_8c-source.html#l00785
785
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l00518
_dbus_header_create()
,
dbus-message_8c-source.html#l01097
dbus_message_unref()
,
dbus-message-private_8h-source.html#l00092
header
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-bus_8c-source.html#l00889
dbus_bus_add_match()
,
dbus-bus_8c-source.html#l00560
dbus_bus_get_unix_user()
,
dbus-bus_8c-source.html#l00716
dbus_bus_name_has_owner()
,
dbus-bus_8c-source.html#l00428
dbus_bus_register()
,
dbus-bus_8c-source.html#l00935
dbus_bus_remove_match()
,
dbus-bus_8c-source.html#l00641
dbus_bus_request_name()
,
dbus-bus_8c-source.html#l00785
dbus_bus_start_service_by_name()
, and
message_8cpp-source.html#l00322
DBusQt::Message::Message()
.
structDBusMessage.html
DBusMessage
* dbus_message_new_method_return
(
structDBusMessage.html
DBusMessage
*
method_call
)
Constructs a message that is a reply to a method call.
Returns
group__DBusMacros.html#ga4
NULL
if memory can't be allocated for the message.
Parameters:
method_call
the message which the created message is a reply to.
Returns:
a new
structDBusMessage.html
DBusMessage
, free with
group__DBusMessage.html#ga20
dbus_message_unref()
See also:
group__DBusMessage.html#ga13
dbus_message_new_method_call()
,
group__DBusMessage.html#ga20
dbus_message_unref()
Definition at line
dbus-message_8c-source.html#l00826
826
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l00518
_dbus_header_create()
,
dbus-message_8c-source.html#l02789
dbus_message_get_sender()
,
dbus-message_8c-source.html#l00384
dbus_message_get_serial()
,
dbus-message_8c-source.html#l02319
dbus_message_set_no_reply()
,
dbus-message_8c-source.html#l00400
dbus_message_set_reply_serial()
,
dbus-message_8c-source.html#l01097
dbus_message_unref()
,
dbus-message-private_8h-source.html#l00092
header
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-gobject_8c-source.html#l01866
dbus_g_method_return()
, and
message_8cpp-source.html#l00337
DBusQt::Message::Message()
.
structDBusMessage.html
DBusMessage
* dbus_message_new_signal
(
const char *
path
,
const char *
interface
,
const char *
name
)
Constructs a new message representing a signal emission.
Returns
group__DBusMacros.html#ga4
NULL
if memory can't be allocated for the message. A signal is identified by its originating interface, and the name of the signal.
Parameters:
path
the path to the object emitting the signal
interface
the interface the signal is emitted from
name
name of the signal
Returns:
a new
structDBusMessage.html
DBusMessage
, free with
group__DBusMessage.html#ga20
dbus_message_unref()
See also:
group__DBusMessage.html#ga20
dbus_message_unref()
Definition at line
dbus-message_8c-source.html#l00874
874
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l00518
_dbus_header_create()
,
dbus-message_8c-source.html#l02319
dbus_message_set_no_reply()
,
dbus-message_8c-source.html#l01097
dbus_message_unref()
,
dbus-message-private_8h-source.html#l00092
header
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-connection_8c-source.html#l01070
_dbus_connection_new_for_transport()
, and
message_8cpp-source.html#l00343
DBusQt::Message::Message()
.
structDBusMessage.html
DBusMessage
* dbus_message_ref
(
structDBusMessage.html
DBusMessage
*
message
)
Increments the reference count of a
structDBusMessage.html
DBusMessage
.
Parameters:
message
The message
Returns:
the message
See also:
group__DBusMessage.html#ga20
dbus_message_unref
Definition at line
dbus-message_8c-source.html#l01076
1076
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-sysdeps_8c-source.html#l01809
_dbus_atomic_inc()
,
dbus-memory_8c-source.html#l00682
_dbus_current_generation
,
dbus-message-private_8h-source.html#l00112
generation
,
dbus-message-private_8h-source.html#l00101
in_cache
,
group__DBusMacros.html#ga4
NULL
, and
dbus-message-private_8h-source.html#l00090
refcount
.
Referenced by
dbus-connection_8c-source.html#l00875
_dbus_pending_call_complete_and_unlock()
,
dbus-glib_8c-source.html#l00091
dbus_g_message_ref()
, and
dbus-glib_8c-source.html#l00201
dbus_message_get_g_type()
.
void dbus_message_set_auto_start
(
structDBusMessage.html
DBusMessage
*
message
,
group__DBusTypes.html#ga2
dbus_bool_t
auto_start
)
Sets a flag indicating that an owner for the destination name will be automatically started before the message is delivered.
When this flag is set, the message is held until a name owner finishes starting up, or fails to start up. In case of failure, the reply will be an error.
Parameters:
message
the message
auto_start
group__DBusMacros.html#ga2
TRUE
if auto-starting is desired
Definition at line
dbus-message_8c-source.html#l02357
2357
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l01427
_dbus_header_toggle_flag()
,
dbus-message-private_8h-source.html#l00092
header
,
dbus-message-private_8h-source.html#l00098
locked
, and
group__DBusMacros.html#ga4
NULL
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_set_destination
(
structDBusMessage.html
DBusMessage
*
message
,
const char *
destination
)
Sets the message's destination.
The destination is the name of another connection on the bus and may be either the unique name assigned by the bus to each connection, or a well-known name specified in advance.
Parameters:
message
the message
destination
the destination name or
group__DBusMacros.html#ga4
NULL
to unset
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-message_8c-source.html#l02721
2721
of file
dbus-message_8c-source.html
dbus-message.c
.
References
group__DBusMacros.html#ga3
FALSE
,
dbus-message-private_8h-source.html#l00098
locked
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-gproxy_8c-source.html#l02450
dbus_g_proxy_send()
, and
message_8cpp-source.html#l00420
DBusQt::Message::setDestination()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_set_error_name
(
structDBusMessage.html
DBusMessage
*
message
,
const char *
error_name
)
Sets the name of the error (DBUS_MESSAGE_TYPE_ERROR).
The name is fully-qualified (namespaced).
Parameters:
message
the message
error_name
the name or
group__DBusMacros.html#ga4
NULL
to unset
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-message_8c-source.html#l02673
2673
of file
dbus-message_8c-source.html
dbus-message.c
.
References
group__DBusMacros.html#ga3
FALSE
,
dbus-message-private_8h-source.html#l00098
locked
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
message_8cpp-source.html#l00410
DBusQt::Message::setErrorName()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_set_interface
(
structDBusMessage.html
DBusMessage
*
message
,
const char *
interface
)
Sets the interface this message is being sent to (for DBUS_MESSAGE_TYPE_METHOD_CALL) or the interface a signal is being emitted from (for DBUS_MESSAGE_TYPE_SIGNAL).
Parameters:
message
the message
interface
the interface or
group__DBusMacros.html#ga4
NULL
to unset
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-message_8c-source.html#l02513
2513
of file
dbus-message_8c-source.html
dbus-message.c
.
References
group__DBusMacros.html#ga3
FALSE
,
dbus-message-private_8h-source.html#l00098
locked
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-gproxy_8c-source.html#l02450
dbus_g_proxy_send()
, and
message_8cpp-source.html#l00390
DBusQt::Message::setInterface()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_set_member
(
structDBusMessage.html
DBusMessage
*
message
,
const char *
member
)
Sets the interface member being invoked (DBUS_MESSAGE_TYPE_METHOD_CALL) or emitted (DBUS_MESSAGE_TYPE_SIGNAL).
The interface name is fully-qualified (namespaced).
Parameters:
message
the message
member
the member or
group__DBusMacros.html#ga4
NULL
to unset
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-message_8c-source.html#l02595
2595
of file
dbus-message_8c-source.html
dbus-message.c
.
References
group__DBusMacros.html#ga3
FALSE
,
dbus-message-private_8h-source.html#l00098
locked
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
message_8cpp-source.html#l00400
DBusQt::Message::setMember()
.
void dbus_message_set_no_reply
(
structDBusMessage.html
DBusMessage
*
message
,
group__DBusTypes.html#ga2
dbus_bool_t
no_reply
)
Sets a flag indicating that the message does not want a reply; if this flag is set, the other end of the connection may (but is not required to) optimize by not sending method return or error replies.
If this flag is set, there is no way to know whether the message successfully arrived at the remote end. Normally you know a message was received when you receive the reply to it.
Parameters:
message
the message
no_reply
group__DBusMacros.html#ga2
TRUE
if no reply is desired
Definition at line
dbus-message_8c-source.html#l02319
2319
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l01427
_dbus_header_toggle_flag()
,
dbus-message-private_8h-source.html#l00092
header
,
dbus-message-private_8h-source.html#l00098
locked
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-gproxy_8c-source.html#l02366
dbus_g_proxy_call_no_reply()
,
dbus-message_8c-source.html#l00914
dbus_message_new_error()
,
dbus-message_8c-source.html#l00826
dbus_message_new_method_return()
, and
dbus-message_8c-source.html#l00874
dbus_message_new_signal()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_set_path
(
structDBusMessage.html
DBusMessage
*
message
,
const char *
object_path
)
Sets the object path this message is being sent to (for DBUS_MESSAGE_TYPE_METHOD_CALL) or the one a signal is being emitted from (for DBUS_MESSAGE_TYPE_SIGNAL).
Parameters:
message
the message
object_path
the path or
group__DBusMacros.html#ga4
NULL
to unset
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-message_8c-source.html#l02395
2395
of file
dbus-message_8c-source.html
dbus-message.c
.
References
group__DBusMacros.html#ga3
FALSE
,
dbus-message-private_8h-source.html#l00098
locked
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-gproxy_8c-source.html#l02450
dbus_g_proxy_send()
, and
message_8cpp-source.html#l00380
DBusQt::Message::setPath()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_set_reply_serial
(
structDBusMessage.html
DBusMessage
*
message
,
group__DBusTypes.html#ga3
dbus_uint32_t
reply_serial
)
Sets the reply serial of a message (the client serial of the message this is a reply to).
Parameters:
message
the message
reply_serial
the client serial
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-message_8c-source.html#l00400
400
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-marshal-header_8c-source.html#l01243
_dbus_header_set_field_basic()
,
group__DBusMacros.html#ga3
FALSE
,
dbus-message-private_8h-source.html#l00092
header
,
dbus-message-private_8h-source.html#l00098
locked
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-message_8c-source.html#l00914
dbus_message_new_error()
, and
dbus-message_8c-source.html#l00826
dbus_message_new_method_return()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_message_set_sender
(
structDBusMessage.html
DBusMessage
*
message
,
const char *
sender
)
Sets the message sender.
Parameters:
message
the message
sender
the sender or
group__DBusMacros.html#ga4
NULL
to unset
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-message_8c-source.html#l02765
2765
of file
dbus-message_8c-source.html
dbus-message.c
.
References
group__DBusMacros.html#ga3
FALSE
,
dbus-message-private_8h-source.html#l00098
locked
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
message_8cpp-source.html#l00436
DBusQt::Message::setSender()
.
void dbus_message_unref
(
structDBusMessage.html
DBusMessage
*
message
)
Decrements the reference count of a
structDBusMessage.html
DBusMessage
.
Parameters:
message
The message
See also:
group__DBusMessage.html#ga19
dbus_message_ref
Definition at line
dbus-message_8c-source.html#l01097
1097
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-sysdeps_8c-source.html#l01832
_dbus_atomic_dec()
,
dbus-memory_8c-source.html#l00682
_dbus_current_generation
,
dbus-message-private_8h-source.html#l00112
generation
,
dbus-message-private_8h-source.html#l00101
in_cache
,
group__DBusMacros.html#ga4
NULL
, and
dbus-message-private_8h-source.html#l00090
refcount
.
Referenced by
dbus-connection_8c-source.html#l02571
_dbus_connection_block_pending_call()
,
dbus-connection_8c-source.html#l00492
_dbus_connection_message_sent()
,
dbus-connection_8c-source.html#l01070
_dbus_connection_new_for_transport()
,
dbus-message_8c-source.html#l03411
_dbus_message_loader_queue_messages()
,
dbus-message_8c-source.html#l03173
_dbus_message_loader_unref()
,
dbus-bus_8c-source.html#l00889
dbus_bus_add_match()
,
dbus-bus_8c-source.html#l00560
dbus_bus_get_unix_user()
,
dbus-bus_8c-source.html#l00716
dbus_bus_name_has_owner()
,
dbus-bus_8c-source.html#l00428
dbus_bus_register()
,
dbus-bus_8c-source.html#l00935
dbus_bus_remove_match()
,
dbus-bus_8c-source.html#l00641
dbus_bus_request_name()
,
dbus-bus_8c-source.html#l00785
dbus_bus_start_service_by_name()
,
dbus-connection_8c-source.html#l03435
dbus_connection_dispatch()
,
dbus-connection_8c-source.html#l02416
dbus_connection_send_with_reply()
,
dbus-connection_8c-source.html#l02753
dbus_connection_send_with_reply_and_block()
,
dbus-glib_8c-source.html#l00106
dbus_g_message_unref()
,
dbus-gobject_8c-source.html#l01866
dbus_g_method_return()
,
dbus-gobject_8c-source.html#l01915
dbus_g_method_return_error()
,
dbus-glib_8c-source.html#l00201
dbus_message_get_g_type()
,
dbus-message_8c-source.html#l00746
dbus_message_new()
,
dbus-message_8c-source.html#l00914
dbus_message_new_error()
,
dbus-message_8c-source.html#l00785
dbus_message_new_method_call()
,
dbus-message_8c-source.html#l00826
dbus_message_new_method_return()
,
dbus-message_8c-source.html#l00874
dbus_message_new_signal()
,
dbus-pending-call_8c-source.html#l00170
dbus_pending_call_unref()
, and
message_8cpp-source.html#l00367
DBusQt::Message::~Message()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_set_error_from_message
(
structDBusError.html
DBusError
*
error
,
structDBusMessage.html
DBusMessage
*
message
)
Sets a
structDBusError.html
DBusError
based on the contents of the given message.
The error is only set if the message is an error message, as in DBUS_MESSAGE_TYPE_ERROR. The name of the error is set to the name of the message, and the error message is set to the first argument if the argument exists and is a string.
The return value indicates whether the error was set (the error is set if and only if the message is an error message). So you can check for an error reply and convert it to
structDBusError.html
DBusError
in one go:
if
(
group__DBusMessage.html#ga75
dbus_set_error_from_message
(error, reply))
return
error;
else
process reply;
Parameters:
error
the error to set
message
the message to set it from
Returns:
group__DBusMacros.html#ga2
TRUE
if dbus_message_get_is_error() returns
group__DBusMacros.html#ga2
TRUE
for the message
Definition at line
dbus-message_8c-source.html#l03074
3074
of file
dbus-message_8c-source.html
dbus-message.c
.
References
dbus-message_8c-source.html#l01363
dbus_message_get_args()
,
dbus-message_8c-source.html#l02696
dbus_message_get_error_name()
,
dbus-message_8c-source.html#l01129
dbus_message_get_type()
,
dbus-errors_8c-source.html#l00313
dbus_set_error()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-bus_8c-source.html#l00560
dbus_bus_get_unix_user()
,
dbus-bus_8c-source.html#l00428
dbus_bus_register()
,
dbus-bus_8c-source.html#l00641
dbus_bus_request_name()
,
dbus-bus_8c-source.html#l00785
dbus_bus_start_service_by_name()
, and
dbus-connection_8c-source.html#l02753
dbus_connection_send_with_reply_and_block()
.
Generated on Tue Sep 13 01:28:09 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
