Main Page   Modules   Data Structures   File List   Data Fields   Related Pages  

DBusMessage
[D-BUS message system public API]

Message to be sent or received over a DBusConnection. More...

Typedefs

typedef DBusMessage DBusMessage
 Opaque data type representing a message received from or to be sent to another application.


Functions

DBusMessage * dbus_message_new (const char *name, const char *destination_service)
 Constructs a new message.

DBusMessage * dbus_message_new_reply (DBusMessage *original_message)
 Constructs a message that is a reply to some other message.

DBusMessage * dbus_message_new_error_reply (DBusMessage *original_message, const char *error_name, const char *error_message)
 Creates a new message that is an error reply to a certain message.

DBusMessage * dbus_message_copy (const DBusMessage *message)
 Creates a new message that is an exact replica of the message specified, except that its refcount is set to 1.

void dbus_message_ref (DBusMessage *message)
 Increments the reference count of a DBusMessage.

void dbus_message_unref (DBusMessage *message)
 Decrements the reference count of a DBusMessage.

const char * dbus_message_get_name (DBusMessage *message)
 Gets the name of a message.

const char * dbus_message_get_destination (DBusMessage *message)
 Gets the destination service of a message.

dbus_bool_t dbus_message_append_args (DBusMessage *message, int first_arg_type,...)
 Appends fields to a message given a variable argument list.

dbus_bool_t dbus_message_append_args_valist (DBusMessage *message, int first_arg_type, va_list var_args)
 This function takes a va_list for use by language bindings.

dbus_bool_t dbus_message_get_args (DBusMessage *message, DBusError *error, int first_arg_type,...)
 Gets arguments from a message given a variable argument list.

dbus_bool_t dbus_message_get_args_valist (DBusMessage *message, DBusError *error, int first_arg_type, va_list var_args)
 This function takes a va_list for use by language bindings.

dbus_bool_t dbus_message_iter_get_args (DBusMessageIter *iter, DBusError *error, int first_arg_type,...)
 Gets arguments from a message iterator given a variable argument list.

dbus_bool_t dbus_message_iter_get_args_valist (DBusMessageIter *iter, DBusError *error, int first_arg_type, va_list var_args)
 This function takes a va_list for use by language bindings.

void dbus_message_iter_init (DBusMessage *message, DBusMessageIter *iter)
 Initializes a DBusMessageIter representing the arguments of the message passed in.

dbus_bool_t dbus_message_iter_has_next (DBusMessageIter *iter)
 Checks if an iterator has any more fields.

dbus_bool_t dbus_message_iter_next (DBusMessageIter *iter)
 Moves the iterator to the next field.

int dbus_message_iter_get_arg_type (DBusMessageIter *iter)
 Returns the argument type of the argument that the message iterator points at.

int dbus_message_iter_get_array_type (DBusMessageIter *iter)
 Returns the element type of the array that the message iterator points at.

char * dbus_message_iter_get_string (DBusMessageIter *iter)
 Returns the string value that an iterator may point to.

dbus_bool_t dbus_message_iter_get_named (DBusMessageIter *iter, char **name, unsigned char **value, int *len)
 Returns the name and data from a named type that an iterator may point to.

unsigned char dbus_message_iter_get_byte (DBusMessageIter *iter)
 Returns the byte value that an iterator may point to.

dbus_bool_t dbus_message_iter_get_boolean (DBusMessageIter *iter)
 Returns the boolean value that an iterator may point to.

dbus_int32_t dbus_message_iter_get_int32 (DBusMessageIter *iter)
 Returns the 32 bit signed integer value that an iterator may point to.

dbus_uint32_t dbus_message_iter_get_uint32 (DBusMessageIter *iter)
 Returns the 32 bit unsigned integer value that an iterator may point to.

dbus_int64_t dbus_message_iter_get_int64 (DBusMessageIter *iter)
 Returns the 64 bit signed integer value that an iterator may point to.

dbus_uint64_t dbus_message_iter_get_uint64 (DBusMessageIter *iter)
 Returns the 64 bit unsigned integer value that an iterator may point to.

double dbus_message_iter_get_double (DBusMessageIter *iter)
 Returns the double value that an iterator may point to.

dbus_bool_t dbus_message_iter_init_array_iterator (DBusMessageIter *iter, DBusMessageIter *array_iter, int *array_type)
 Initializes an iterator for the array that the iterator may point to.

dbus_bool_t dbus_message_iter_init_dict_iterator (DBusMessageIter *iter, DBusMessageIter *dict_iter)
 Initializes an iterator for the dict that the iterator may point to.

dbus_bool_t dbus_message_iter_get_byte_array (DBusMessageIter *iter, unsigned char **value, int *len)
 Returns the byte array that the iterator may point to.

dbus_bool_t dbus_message_iter_get_boolean_array (DBusMessageIter *iter, unsigned char **value, int *len)
 Returns the boolean array that the iterator may point to.

dbus_bool_t dbus_message_iter_get_int32_array (DBusMessageIter *iter, dbus_int32_t **value, int *len)
 Returns the 32 bit signed integer array that the iterator may point to.

dbus_bool_t dbus_message_iter_get_uint32_array (DBusMessageIter *iter, dbus_uint32_t **value, int *len)
 Returns the 32 bit unsigned integer array that the iterator may point to.

dbus_bool_t dbus_message_iter_get_int64_array (DBusMessageIter *iter, dbus_int64_t **value, int *len)
 Returns the 64 bit signed integer array that the iterator may point to.

dbus_bool_t dbus_message_iter_get_uint64_array (DBusMessageIter *iter, dbus_uint64_t **value, int *len)
 Returns the 64 bit unsigned integer array that the iterator may point to.

dbus_bool_t dbus_message_iter_get_double_array (DBusMessageIter *iter, double **value, int *len)
 Returns the double array that the iterator may point to.

dbus_bool_t dbus_message_iter_get_string_array (DBusMessageIter *iter, char ***value, int *len)
 Returns the string array that the iterator may point to.

char * dbus_message_iter_get_dict_key (DBusMessageIter *iter)
 Returns the key name fot the dict entry that an iterator may point to.

void dbus_message_append_iter_init (DBusMessage *message, DBusMessageIter *iter)
 Initializes a DBusMessageIter pointing to the end of the message.

dbus_bool_t dbus_message_iter_append_nil (DBusMessageIter *iter)
 Appends a nil value to the message.

dbus_bool_t dbus_message_iter_append_boolean (DBusMessageIter *iter, dbus_bool_t value)
 Appends a boolean value to the message.

dbus_bool_t dbus_message_iter_append_byte (DBusMessageIter *iter, unsigned char value)
 Appends a byte to the message.

dbus_bool_t dbus_message_iter_append_int32 (DBusMessageIter *iter, dbus_int32_t value)
 Appends a 32 bit signed integer to the message.

dbus_bool_t dbus_message_iter_append_uint32 (DBusMessageIter *iter, dbus_uint32_t value)
 Appends a 32 bit unsigned integer to the message.

dbus_bool_t dbus_message_iter_append_int64 (DBusMessageIter *iter, dbus_int64_t value)
 Appends a 64 bit signed integer to the message.

dbus_bool_t dbus_message_iter_append_uint64 (DBusMessageIter *iter, dbus_uint64_t value)
 Appends a 64 bit unsigned integer to the message.

dbus_bool_t dbus_message_iter_append_double (DBusMessageIter *iter, double value)
 Appends a double value to the message.

dbus_bool_t dbus_message_iter_append_string (DBusMessageIter *iter, const char *value)
 Appends a UTF-8 string to the message.

dbus_bool_t dbus_message_iter_append_named (DBusMessageIter *iter, const char *name, const unsigned char *data, int len)
 Appends a named type data chunk to the message.

dbus_bool_t dbus_message_iter_append_dict_key (DBusMessageIter *iter, const char *value)
 Appends a dict key name to the message.

dbus_bool_t dbus_message_iter_append_array (DBusMessageIter *iter, DBusMessageIter *array_iter, int element_type)
 Appends an array to the message and initializes an iterator that can be used to append to the array.

dbus_bool_t dbus_message_iter_append_dict (DBusMessageIter *iter, DBusMessageIter *dict_iter)
 Appends a dict to the message and initializes an iterator that can be used to append to the dict.

dbus_bool_t dbus_message_iter_append_boolean_array (DBusMessageIter *iter, unsigned const char *value, int len)
 Appends a boolean array to the message.

dbus_bool_t dbus_message_iter_append_int32_array (DBusMessageIter *iter, const dbus_int32_t *value, int len)
 Appends a 32 bit signed integer array to the message.

dbus_bool_t dbus_message_iter_append_uint32_array (DBusMessageIter *iter, const dbus_uint32_t *value, int len)
 Appends a 32 bit unsigned integer array to the message.

dbus_bool_t dbus_message_iter_append_int64_array (DBusMessageIter *iter, const dbus_int64_t *value, int len)
 Appends a 64 bit signed integer array to the message.

dbus_bool_t dbus_message_iter_append_uint64_array (DBusMessageIter *iter, const dbus_uint64_t *value, int len)
 Appends a 64 bit unsigned integer array to the message.

dbus_bool_t dbus_message_iter_append_double_array (DBusMessageIter *iter, const double *value, int len)
 Appends a double array to the message.

dbus_bool_t dbus_message_iter_append_byte_array (DBusMessageIter *iter, unsigned const char *value, int len)
 Appends a byte array to the message.

dbus_bool_t dbus_message_iter_append_string_array (DBusMessageIter *iter, const char **value, int len)
 Appends a string array to the message.

dbus_bool_t dbus_message_set_sender (DBusMessage *message, const char *sender)
 Sets the message sender.

void dbus_message_set_is_error (DBusMessage *message, dbus_bool_t is_error_reply)
 Sets a flag indicating that the message is an error reply message, i.e.

dbus_bool_t dbus_message_get_is_error (DBusMessage *message)
 Returns TRUE if the message is an error reply to some previous message we sent.

const char * dbus_message_get_sender (DBusMessage *message)
 Gets the service which originated this message, or NULL if unknown or inapplicable.

dbus_bool_t dbus_message_has_name (DBusMessage *message, const char *name)
 Checks whether the message has the given name.

dbus_bool_t dbus_message_has_destination (DBusMessage *message, const char *service)
 Checks whether the message was sent to the given service.

dbus_bool_t dbus_message_has_sender (DBusMessage *message, const char *service)
 Checks whether the message has the given service as its sender.

dbus_bool_t dbus_set_error_from_message (DBusError *error, DBusMessage *message)
 Sets a #DBusError based on the contents of the given message.


Detailed Description

Message to be sent or received over a DBusConnection.

A DBusMessage is the most basic unit of communication over a DBusConnection. A DBusConnection represents a stream of messages received from a remote application, and a stream of messages sent to a remote application.


Function Documentation

dbus_bool_t dbus_message_append_args 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 the argument followed by the value to add. Array values are specified by an int typecode followed by a pointer to the array followed by an int giving the length of the array. The argument list must be terminated with #DBUS_TYPE_INVALID.

This function doesn't support dicts or non-fundamental arrays.

This function supports #DBUS_TYPE_INT64 and #DBUS_TYPE_UINT64 only if #DBUS_HAVE_INT64 is defined.

Parameters:
message the message
first_arg_type type of the first argument
... value of first argument, list of additional type-value pairs
Returns:
TRUE on success

Definition at line 1250 of file dbus-message.c.

References dbus_bool_t, and dbus_message_append_args_valist().

Referenced by dbus_bus_acquire_service(), dbus_bus_activate_service(), and dbus_bus_service_exists().

dbus_bool_t dbus_message_append_args_valist 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 dbus_message_append_args().

Todo:
: Shouldn't this function clean up the changes to the message on failures? (Yes)
See also:
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:
TRUE on success

Definition at line 1282 of file dbus-message.c.

References _dbus_string_get_length(), _dbus_warn(), body, dbus_message_append_iter_init(), dbus_message_iter_append_boolean(), dbus_message_iter_append_boolean_array(), dbus_message_iter_append_byte_array(), dbus_message_iter_append_double(), dbus_message_iter_append_double_array(), dbus_message_iter_append_int32(), dbus_message_iter_append_int32_array(), dbus_message_iter_append_int64(), dbus_message_iter_append_int64_array(), dbus_message_iter_append_named(), dbus_message_iter_append_nil(), dbus_message_iter_append_string(), dbus_message_iter_append_string_array(), dbus_message_iter_append_uint32(), dbus_message_iter_append_uint32_array(), dbus_message_iter_append_uint64(), dbus_message_iter_append_uint64_array(), FALSE, and TRUE.

Referenced by dbus_message_append_args().

void dbus_message_append_iter_init DBusMessage   message,
DBusMessageIter *    iter
 

Initializes a DBusMessageIter pointing to the end of the message.

This iterator can be used to append data to the message.

Parameters:
message the message
iter pointer to an iterator to initialize

Definition at line 2755 of file dbus-message.c.

References _dbus_string_get_length(), body, changed_stamp, DBusMessageRealIter::changed_stamp, DBusMessageRealIter::container_length_pos, DBusMessageRealIter, DBusMessageRealIter::end, DBusMessageRealIter::message, NULL, DBusMessageRealIter::parent_iter, DBusMessageRealIter::pos, DBusMessageRealIter::type, and DBusMessageRealIter::wrote_dict_key.

Referenced by dbus_message_append_args_valist(), and dbus_message_new_error_reply().

DBusMessage* dbus_message_copy const DBusMessage   message
 

Creates a new message that is an exact replica of the message specified, except that its refcount is set to 1.

Parameters:
message the message.
Returns:
the new message.

Definition at line 1081 of file dbus-message.c.

References _dbus_string_copy(), _dbus_string_free(), _dbus_string_init(), body, byte_order, client_serial, dbus_free(), dbus_new0, FALSE, header, header_fields, header_padding, locked, NULL, refcount, and reply_serial.

dbus_bool_t dbus_message_get_args DBusMessage   message,
DBusError *    error,
int    first_arg_type,
...   
 

Gets arguments from a message given a variable argument list.

The variable argument list should contain the type of the argumen followed by a pointer to where the value should be stored. The list is terminated with #DBUS_TYPE_INVALID.

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:
FALSE if the error was set

Definition at line 1438 of file dbus-message.c.

References dbus_bool_t, and dbus_message_get_args_valist().

Referenced by dbus_bus_acquire_service(), dbus_bus_activate_service(), dbus_bus_register(), dbus_bus_service_exists(), and dbus_set_error_from_message().

dbus_bool_t dbus_message_get_args_valist DBusMessage   message,
DBusError *    error,
int    first_arg_type,
va_list    var_args
 

This function takes a va_list for use by language bindings.

Todo:
We need to free the argument data when an error occurs.
See also:
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:
FALSE if error was set

Definition at line 1469 of file dbus-message.c.

References dbus_message_iter_get_args_valist(), and dbus_message_iter_init().

Referenced by dbus_message_get_args().

const char* dbus_message_get_destination DBusMessage   message
 

Gets the destination service of a message.

Parameters:
message the message
Returns:
the message destination service (should not be freed)

Definition at line 1224 of file dbus-message.c.

Referenced by dbus_message_has_destination().

dbus_bool_t dbus_message_get_is_error DBusMessage   message
 

Returns TRUE if the message is an error reply to some previous message we sent.

Parameters:
message the message
Returns:
TRUE if the message is an error

Definition at line 3723 of file dbus-message.c.

References _dbus_string_get_const_data_len(), and header.

Referenced by dbus_set_error_from_message().

const char* dbus_message_get_name DBusMessage   message
 

Gets the name of a message.

Parameters:
message the message
Returns:
the message name (should not be freed)

Definition at line 1210 of file dbus-message.c.

Referenced by dbus_connection_dispatch(), and dbus_message_has_name().

const char* dbus_message_get_sender DBusMessage   message
 

Gets the service which originated this message, or NULL if unknown or inapplicable.

Parameters:
message the message
Returns:
the service name or NULL

Definition at line 3742 of file dbus-message.c.

Referenced by dbus_message_has_sender().

dbus_bool_t dbus_message_has_destination DBusMessage   message,
const char *    service
 

Checks whether the message was sent to the given service.

If the message has no service specified or has a different name, returns FALSE.

Parameters:
message the message
service the service to check (must not be NULL)
Returns:
TRUE if the message has the given destination service

Definition at line 3787 of file dbus-message.c.

References dbus_message_get_destination(), FALSE, and TRUE.

dbus_bool_t dbus_message_has_name DBusMessage   message,
const char *    name
 

Checks whether the message has the given name.

If the message has no name or has a different name, returns FALSE.

Parameters:
message the message
name the name to check (must not be NULL)
Returns:
TRUE if the message has the given name

Definition at line 3760 of file dbus-message.c.

References dbus_message_get_name(), FALSE, and TRUE.

dbus_bool_t dbus_message_has_sender DBusMessage   message,
const char *    service
 

Checks whether the message has the given service as its sender.

If the message has no sender specified or has a different sender, returns FALSE. Note that if a peer application owns multiple services, its messages will have only one of those services as the sender (usually the base service). So you can't use this function to prove the sender didn't own service Foo, you can only use it to prove that it did.

Parameters:
message the message
service the service to check (must not be NULL)
Returns:
TRUE if the message has the given origin service

Definition at line 3818 of file dbus-message.c.

References _dbus_assert, dbus_message_get_sender(), FALSE, and TRUE.

dbus_bool_t dbus_message_iter_append_array DBusMessageIter *    iter,
DBusMessageIter *    array_iter,
int    element_type
 

Appends an array to the message and initializes an iterator that can be used to append to the array.

Parameters:
iter an iterator pointing to the end of the message
array_iter pointer to an iter that will be initialized
element_type the type of the array elements
Returns:
TRUE on success

Definition at line 3309 of file dbus-message.c.

References _dbus_marshal_uint32(), _dbus_string_get_length(), _dbus_string_set_length(), _dbus_warn(), DBusMessageRealIter::array_type_done, DBusMessageRealIter::array_type_pos, DBusMessageRealIter::changed_stamp, DBusMessageRealIter::container_length_pos, DBusMessageRealIter::container_start, dbus_bool_t, DBusMessageRealIter, DBusMessageRealIter::end, FALSE, DBusMessageRealIter::message, DBusMessageRealIter::parent_iter, DBusMessageRealIter::pos, TRUE, DBusMessageRealIter::type, and DBusMessageRealIter::wrote_dict_key.

dbus_bool_t dbus_message_iter_append_boolean DBusMessageIter *    iter,
dbus_bool_t    value
 

Appends a boolean value to the message.

Parameters:
iter an iterator pointing to the end of the message
value the boolean value
Returns:
TRUE on success

Definition at line 2913 of file dbus-message.c.

References _dbus_string_append_byte(), _dbus_string_set_length(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_append_args_valist().

dbus_bool_t dbus_message_iter_append_boolean_array DBusMessageIter *    iter,
unsigned const char *    value,
int    len
 

Appends a boolean array to the message.

Parameters:
iter an iterator pointing to the end of the message
value the array
len the length of the array
Returns:
TRUE on success

Definition at line 3418 of file dbus-message.c.

References _dbus_marshal_byte_array(), _dbus_string_set_length(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_append_args_valist().

dbus_bool_t dbus_message_iter_append_byte DBusMessageIter *    iter,
unsigned char    value
 

Appends a byte to the message.

Parameters:
iter an iterator pointing to the end of the message
value the byte value
Returns:
TRUE on success

Definition at line 2942 of file dbus-message.c.

References _dbus_string_append_byte(), _dbus_string_set_length(), DBusMessageRealIter, FALSE, and TRUE.

dbus_bool_t dbus_message_iter_append_byte_array DBusMessageIter *    iter,
unsigned const char *    value,
int    len
 

Appends a byte array to the message.

Parameters:
iter an iterator pointing to the end of the message
value the array
len the length of the array
Returns:
TRUE on success

Definition at line 3611 of file dbus-message.c.

References _dbus_marshal_byte_array(), _dbus_string_set_length(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_append_args_valist().

dbus_bool_t dbus_message_iter_append_dict DBusMessageIter *    iter,
DBusMessageIter *    dict_iter
 

Appends a dict to the message and initializes an iterator that can be used to append to the dict.

Parameters:
iter an iterator pointing to the end of the message
dict_iter pointer to an iter that will be initialized
Returns:
TRUE on success

Definition at line 3370 of file dbus-message.c.

References _dbus_marshal_uint32(), _dbus_string_get_length(), _dbus_string_set_length(), DBusMessageRealIter::changed_stamp, DBusMessageRealIter::container_length_pos, DBusMessageRealIter::container_start, DBusMessageRealIter, DBusMessageRealIter::end, FALSE, DBusMessageRealIter::message, DBusMessageRealIter::parent_iter, DBusMessageRealIter::pos, TRUE, DBusMessageRealIter::type, and DBusMessageRealIter::wrote_dict_key.

dbus_bool_t dbus_message_iter_append_dict_key DBusMessageIter *    iter,
const char *    value
 

Appends a dict key name to the message.

The iterator used must point to a dict.

Parameters:
iter an iterator pointing to the end of the message
value the string
Returns:
TRUE on success

Definition at line 3198 of file dbus-message.c.

References _dbus_assert, _dbus_marshal_string(), _dbus_warn(), DBusMessageRealIter, FALSE, and TRUE.

dbus_bool_t dbus_message_iter_append_double DBusMessageIter *    iter,
double    value
 

Appends a double value to the message.

Parameters:
iter an iterator pointing to the end of the message
value the double value
Returns:
TRUE on success

Definition at line 3096 of file dbus-message.c.

References _dbus_marshal_double(), _dbus_string_set_length(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_append_args_valist().

dbus_bool_t dbus_message_iter_append_double_array DBusMessageIter *    iter,
const double *    value,
int    len
 

Appends a double array to the message.

Parameters:
iter an iterator pointing to the end of the message
value the array
len the length of the array
Returns:
TRUE on success

Definition at line 3580 of file dbus-message.c.

References _dbus_marshal_double_array(), _dbus_string_set_length(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_append_args_valist().

dbus_bool_t dbus_message_iter_append_int32 DBusMessageIter *    iter,
dbus_int32_t    value
 

Appends a 32 bit signed integer to the message.

Parameters:
iter an iterator pointing to the end of the message
value the integer value
Returns:
TRUE on success

Definition at line 2972 of file dbus-message.c.

References _dbus_marshal_int32(), _dbus_string_set_length(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_append_args_valist().

dbus_bool_t dbus_message_iter_append_int32_array DBusMessageIter *    iter,
const dbus_int32_t   value,
int    len
 

Appends a 32 bit signed integer array to the message.

Parameters:
iter an iterator pointing to the end of the message
value the array
len the length of the array
Returns:
TRUE on success

Definition at line 3449 of file dbus-message.c.

References _dbus_marshal_int32_array(), _dbus_string_set_length(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_append_args_valist().

dbus_bool_t dbus_message_iter_append_int64 DBusMessageIter *    iter,
dbus_int64_t    value
 

Appends a 64 bit signed integer to the message.

This function only exists if #DBUS_HAVE_INT64 is defined.

Parameters:
iter an iterator pointing to the end of the message
value the integer value
Returns:
TRUE on success

Definition at line 3034 of file dbus-message.c.

References _dbus_marshal_int64(), _dbus_string_set_length(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_append_args_valist().

dbus_bool_t dbus_message_iter_append_int64_array DBusMessageIter *    iter,
const dbus_int64_t   value,
int    len
 

Appends a 64 bit signed integer array to the message.

This function only exists if #DBUS_HAVE_INT64 is defined.

Parameters:
iter an iterator pointing to the end of the message
value the array
len the length of the array
Returns:
TRUE on success

Definition at line 3515 of file dbus-message.c.

References _dbus_marshal_int64_array(), _dbus_string_set_length(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_append_args_valist().

dbus_bool_t dbus_message_iter_append_named DBusMessageIter *    iter,
const char *    name,
const unsigned char *    data,
int    len
 

Appends a named type data chunk to the message.

A named type is simply an arbitrary UTF-8 string used as a type tag, plus an array of arbitrary bytes to be interpreted according to the type tag.

Parameters:
iter an iterator pointing to the end of the message
name the name of the type
data the binary data used to store the value
len the length of the binary data in bytes
Returns:
TRUE on success

Definition at line 3159 of file dbus-message.c.

References _dbus_marshal_byte_array(), _dbus_marshal_string(), _dbus_string_set_length(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_append_args_valist().

dbus_bool_t dbus_message_iter_append_nil DBusMessageIter *    iter
 

Appends a nil value to the message.

Parameters:
iter an iterator pointing to the end of the message
Returns:
TRUE on success

Definition at line 2891 of file dbus-message.c.

References DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_append_args_valist().

dbus_bool_t dbus_message_iter_append_string DBusMessageIter *    iter,
const char *    value
 

Appends a UTF-8 string to the message.

Parameters:
iter an iterator pointing to the end of the message
value the string
Returns:
TRUE on success

Definition at line 3125 of file dbus-message.c.

References _dbus_marshal_string(), _dbus_string_set_length(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_append_args_valist(), and dbus_message_new_error_reply().

dbus_bool_t dbus_message_iter_append_string_array DBusMessageIter *    iter,
const char **    value,
int    len
 

Appends a string array to the message.

Parameters:
iter an iterator pointing to the end of the message
value the array
len the length of the array
Returns:
TRUE on success

Definition at line 3642 of file dbus-message.c.

References _dbus_marshal_string_array(), _dbus_string_set_length(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_append_args_valist().

dbus_bool_t dbus_message_iter_append_uint32 DBusMessageIter *    iter,
dbus_uint32_t    value
 

Appends a 32 bit unsigned integer to the message.

Parameters:
iter an iterator pointing to the end of the message
value the integer value
Returns:
TRUE on success

Definition at line 3001 of file dbus-message.c.

References _dbus_marshal_uint32(), _dbus_string_set_length(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_append_args_valist().

dbus_bool_t dbus_message_iter_append_uint32_array DBusMessageIter *    iter,
const dbus_uint32_t   value,
int    len
 

Appends a 32 bit unsigned integer array to the message.

Parameters:
iter an iterator pointing to the end of the message
value the array
len the length of the array
Returns:
TRUE on success

Definition at line 3480 of file dbus-message.c.

References _dbus_marshal_uint32_array(), _dbus_string_set_length(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_append_args_valist().

dbus_bool_t dbus_message_iter_append_uint64 DBusMessageIter *    iter,
dbus_uint64_t    value
 

Appends a 64 bit unsigned integer to the message.

This function only exists if #DBUS_HAVE_INT64 is defined.

Parameters:
iter an iterator pointing to the end of the message
value the integer value
Returns:
TRUE on success

Definition at line 3065 of file dbus-message.c.

References _dbus_marshal_uint64(), _dbus_string_set_length(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_append_args_valist().

dbus_bool_t dbus_message_iter_append_uint64_array DBusMessageIter *    iter,
const dbus_uint64_t   value,
int    len
 

Appends a 64 bit unsigned integer array to the message.

This function only exists if #DBUS_HAVE_INT64 is defined.

Parameters:
iter an iterator pointing to the end of the message
value the array
len the length of the array
Returns:
TRUE on success

Definition at line 3548 of file dbus-message.c.

References _dbus_marshal_uint64_array(), _dbus_string_set_length(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_append_args_valist().

int dbus_message_iter_get_arg_type DBusMessageIter *    iter
 

Returns the argument type of the argument that the message iterator points at.

Parameters:
iter the message iter
Returns:
the field type

Definition at line 1991 of file dbus-message.c.

References DBusMessageRealIter.

Referenced by dbus_message_iter_get_args_valist().

dbus_bool_t dbus_message_iter_get_args DBusMessageIter *    iter,
DBusError *    error,
int    first_arg_type,
...   
 

Gets arguments from a message iterator given a variable argument list.

The variable argument list should contain the type of the argumen followed by a pointer to where the value should be stored. The list is terminated with 0.

Parameters:
iter the message iterator
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:
FALSE if the error was set

Definition at line 1496 of file dbus-message.c.

References dbus_bool_t, and dbus_message_iter_get_args_valist().

dbus_bool_t dbus_message_iter_get_args_valist DBusMessageIter *    iter,
DBusError *    error,
int    first_arg_type,
va_list    var_args
 

This function takes a va_list for use by language bindings.

This function supports #DBUS_TYPE_INT64 and #DBUS_TYPE_UINT64 only if #DBUS_HAVE_INT64 is defined.

Todo:
this function (or some lower-level non-convenience function) needs better error handling; should allow the application to distinguish between out of memory, and bad data from the remote app. It also needs to not leak a bunch of args when it gets to the arg that's bad, as that would be a security hole (allow one app to force another to leak memory)

We need to free the argument data when an error occurs.

See also:
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:
FALSE if error was set

Definition at line 1537 of file dbus-message.c.

References _dbus_warn(), dbus_bool_t, dbus_int32_t, dbus_int64_t, dbus_message_iter_get_arg_type(), dbus_message_iter_get_array_type(), dbus_message_iter_get_boolean(), dbus_message_iter_get_boolean_array(), dbus_message_iter_get_byte(), dbus_message_iter_get_byte_array(), dbus_message_iter_get_double(), dbus_message_iter_get_double_array(), dbus_message_iter_get_int32(), dbus_message_iter_get_int32_array(), dbus_message_iter_get_int64(), dbus_message_iter_get_int64_array(), dbus_message_iter_get_named(), dbus_message_iter_get_string(), dbus_message_iter_get_string_array(), dbus_message_iter_get_uint32(), dbus_message_iter_get_uint32_array(), dbus_message_iter_get_uint64(), dbus_message_iter_get_uint64_array(), dbus_message_iter_next(), dbus_set_error(), dbus_uint32_t, dbus_uint64_t, FALSE, and TRUE.

Referenced by dbus_message_get_args_valist(), and dbus_message_iter_get_args().

int dbus_message_iter_get_array_type DBusMessageIter *    iter
 

Returns the element type of the array that the message iterator points at.

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 field type

Definition at line 2058 of file dbus-message.c.

References _dbus_assert, and DBusMessageRealIter.

Referenced by dbus_message_iter_get_args_valist().

dbus_bool_t dbus_message_iter_get_boolean DBusMessageIter *    iter
 

Returns the boolean value that an iterator may point to.

Note that you need to check that the iterator points to a boolean value before using this function.

See also:
dbus_message_iter_get_arg_type
Parameters:
iter the message iter
Returns:
the boolean value

Definition at line 2187 of file dbus-message.c.

References _dbus_assert, _dbus_string_get_byte(), and DBusMessageRealIter.

Referenced by dbus_message_iter_get_args_valist().

dbus_bool_t dbus_message_iter_get_boolean_array DBusMessageIter *    iter,
unsigned char **    value,
int *    len
 

Returns the boolean array that the iterator may point to.

Note that you need to check that the iterator points to an array of the correct type prior to using this function.

Parameters:
iter the iterator
value return location for the array
len return location for the array length
Returns:
TRUE on success

Definition at line 2481 of file dbus-message.c.

References _dbus_assert, _dbus_demarshal_byte_array(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_iter_get_args_valist().

unsigned char dbus_message_iter_get_byte DBusMessageIter *    iter
 

Returns the byte value that an iterator may point to.

Note that you need to check that the iterator points to a byte value before using this function.

See also:
dbus_message_iter_get_arg_type
Parameters:
iter the message iter
Returns:
the byte value

Definition at line 2159 of file dbus-message.c.

References _dbus_assert, _dbus_string_get_byte(), and DBusMessageRealIter.

Referenced by dbus_message_iter_get_args_valist().

dbus_bool_t dbus_message_iter_get_byte_array DBusMessageIter *    iter,
unsigned char **    value,
int *    len
 

Returns the byte array that the iterator may point to.

Note that you need to check that the iterator points to a byte array prior to using this function.

Parameters:
iter the iterator
value return location for array values
len return location for length of byte array
Returns:
TRUE on success

Definition at line 2446 of file dbus-message.c.

References _dbus_assert, _dbus_demarshal_byte_array(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_iter_get_args_valist().

char* dbus_message_iter_get_dict_key DBusMessageIter *    iter
 

Returns the key name fot the dict entry that an iterator may point to.

Note that you need to check that the iterator points to a dict entry before using this function.

See also:
dbus_message_iter_init_dict_iterator
Parameters:
iter the message iter
Returns:
the key name

Definition at line 2734 of file dbus-message.c.

References _dbus_assert, _dbus_demarshal_string(), and DBusMessageRealIter.

double dbus_message_iter_get_double DBusMessageIter *    iter
 

Returns the double value that an iterator may point to.

Note that you need to check that the iterator points to a string value before using this function.

See also:
dbus_message_iter_get_arg_type
Parameters:
iter the message iter
Returns:
the double

Definition at line 2322 of file dbus-message.c.

References _dbus_assert, _dbus_demarshal_double(), and DBusMessageRealIter.

Referenced by dbus_message_iter_get_args_valist().

dbus_bool_t dbus_message_iter_get_double_array DBusMessageIter *    iter,
double **    value,
int *    len
 

Returns the double array that the iterator may point to.

Note that you need to check that the iterator points to an array of the correct type prior to using this function.

Parameters:
iter the iterator
value return location for the array
len return location for the array length
Returns:
TRUE on success

Definition at line 2662 of file dbus-message.c.

References _dbus_assert, _dbus_demarshal_double_array(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_iter_get_args_valist().

dbus_int32_t dbus_message_iter_get_int32 DBusMessageIter *    iter
 

Returns the 32 bit signed integer value that an iterator may point to.

Note that you need to check that the iterator points to a 32-bit integer value before using this function.

See also:
dbus_message_iter_get_arg_type
Parameters:
iter the message iter
Returns:
the integer

Definition at line 2214 of file dbus-message.c.

References _dbus_assert, _dbus_demarshal_int32(), and DBusMessageRealIter.

Referenced by dbus_message_iter_get_args_valist().

dbus_bool_t dbus_message_iter_get_int32_array DBusMessageIter *    iter,
dbus_int32_t **    value,
int *    len
 

Returns the 32 bit signed integer array that the iterator may point to.

Note that you need to check that the iterator points to an array of the correct type prior to using this function.

Parameters:
iter the iterator
value return location for the array
len return location for the array length
Returns:
TRUE on success

Definition at line 2516 of file dbus-message.c.

References _dbus_assert, _dbus_demarshal_int32_array(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_iter_get_args_valist().

dbus_int64_t dbus_message_iter_get_int64 DBusMessageIter *    iter
 

Returns the 64 bit signed integer value that an iterator may point to.

Note that you need to check that the iterator points to a 64-bit integer value before using this function.

This function only exists if #DBUS_HAVE_INT64 is defined.

See also:
dbus_message_iter_get_arg_type
Parameters:
iter the message iter
Returns:
the integer

Definition at line 2268 of file dbus-message.c.

References _dbus_assert, _dbus_demarshal_int64(), and DBusMessageRealIter.

Referenced by dbus_message_iter_get_args_valist().

dbus_bool_t dbus_message_iter_get_int64_array DBusMessageIter *    iter,
dbus_int64_t **    value,
int *    len
 

Returns the 64 bit signed integer array that the iterator may point to.

Note that you need to check that the iterator points to an array of the correct type prior to using this function.

This function only exists if #DBUS_HAVE_INT64 is defined.

Parameters:
iter the iterator
value return location for the array
len return location for the array length
Returns:
TRUE on success

Definition at line 2589 of file dbus-message.c.

References _dbus_assert, _dbus_demarshal_int64_array(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_iter_get_args_valist().

dbus_bool_t dbus_message_iter_get_named DBusMessageIter *    iter,
char **    name,
unsigned char **    value,
int *    len
 

Returns the name and data from a named type that an iterator may point to.

Note that you need to check that the iterator points to a named type before using this function.

See also:
dbus_message_iter_get_arg_type
Parameters:
iter the message iter
name return location for the name
value return location for data
len return location for length of data
Returns:
TRUE if get succeed

Definition at line 2116 of file dbus-message.c.

References _dbus_assert, _dbus_demarshal_byte_array(), _dbus_demarshal_string(), dbus_free(), DBusMessageRealIter, FALSE, NULL, and TRUE.

Referenced by dbus_message_iter_get_args_valist().

char* dbus_message_iter_get_string DBusMessageIter *    iter
 

Returns the string value that an iterator may point to.

Note that you need to check that the iterator points to a string value before using this function.

See also:
dbus_message_iter_get_arg_type
Parameters:
iter the message iter
Returns:
the string

Definition at line 2086 of file dbus-message.c.

References _dbus_assert, _dbus_demarshal_string(), and DBusMessageRealIter.

Referenced by dbus_message_iter_get_args_valist().

dbus_bool_t dbus_message_iter_get_string_array DBusMessageIter *    iter,
char ***    value,
int *    len
 

Returns the string array that the iterator may point to.

Note that you need to check that the iterator points to a byte array prior to using this function.

The returned value is a NULL-terminated array of strings. Each string is a separate malloc block, and the array itself is a malloc block. You can free this type of string array with dbus_free_string_array().

Parameters:
iter the iterator
value return location for string values
len return location for length of byte array
Returns:
TRUE on success

Definition at line 2701 of file dbus-message.c.

References _dbus_assert, _dbus_demarshal_string_array(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_iter_get_args_valist().

dbus_uint32_t dbus_message_iter_get_uint32 DBusMessageIter *    iter
 

Returns the 32 bit unsigned integer value that an iterator may point to.

Note that you need to check that the iterator points to a 32-bit unsigned integer value before using this function.

See also:
dbus_message_iter_get_arg_type
Parameters:
iter the message iter
Returns:
the integer

Definition at line 2239 of file dbus-message.c.

References _dbus_assert, _dbus_demarshal_uint32(), and DBusMessageRealIter.

Referenced by dbus_message_iter_get_args_valist().

dbus_bool_t dbus_message_iter_get_uint32_array DBusMessageIter *    iter,
dbus_uint32_t **    value,
int *    len
 

Returns the 32 bit unsigned integer array that the iterator may point to.

Note that you need to check that the iterator points to an array of the correct type prior to using this function.

Parameters:
iter the iterator
value return location for the array
len return location for the array length
Returns:
TRUE on success

Definition at line 2551 of file dbus-message.c.

References _dbus_assert, _dbus_demarshal_uint32_array(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_iter_get_args_valist().

dbus_uint64_t dbus_message_iter_get_uint64 DBusMessageIter *    iter
 

Returns the 64 bit unsigned integer value that an iterator may point to.

Note that you need to check that the iterator points to a 64-bit unsigned integer value before using this function.

This function only exists if #DBUS_HAVE_INT64 is defined.

See also:
dbus_message_iter_get_arg_type
Parameters:
iter the message iter
Returns:
the integer

Definition at line 2295 of file dbus-message.c.

References _dbus_assert, _dbus_demarshal_uint64(), and DBusMessageRealIter.

Referenced by dbus_message_iter_get_args_valist().

dbus_bool_t dbus_message_iter_get_uint64_array DBusMessageIter *    iter,
dbus_uint64_t **    value,
int *    len
 

Returns the 64 bit unsigned integer array that the iterator may point to.

Note that you need to check that the iterator points to an array of the correct type prior to using this function.

This function only exists if #DBUS_HAVE_INT64 is defined.

Parameters:
iter the iterator
value return location for the array
len return location for the array length
Returns:
TRUE on success

Definition at line 2626 of file dbus-message.c.

References _dbus_assert, _dbus_demarshal_uint64_array(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_iter_get_args_valist().

dbus_bool_t dbus_message_iter_has_next DBusMessageIter *    iter
 

Checks if an iterator has any more fields.

Parameters:
iter the message iter
Returns:
TRUE if there are more fields following

Definition at line 1929 of file dbus-message.c.

References _dbus_marshal_get_arg_end_pos(), DBusMessageRealIter, FALSE, and TRUE.

void dbus_message_iter_init DBusMessage   message,
DBusMessageIter *    iter
 

Initializes a DBusMessageIter representing the arguments of the message passed in.

Parameters:
message the message
iter pointer to an iterator to initialize

Definition at line 1803 of file dbus-message.c.

References _dbus_assert, _dbus_string_get_length(), DBusMessageRealIter::array_type_pos, body, changed_stamp, DBusMessageRealIter::changed_stamp, DBusMessageRealIter::container_length_pos, DBusMessageRealIter::container_start, DBusMessageRealIter, DBusMessageRealIter::end, DBusMessageRealIter::message, NULL, DBusMessageRealIter::parent_iter, DBusMessageRealIter::pos, DBusMessageRealIter::type, and DBusMessageRealIter::wrote_dict_key.

Referenced by dbus_message_get_args_valist().

dbus_bool_t dbus_message_iter_init_array_iterator DBusMessageIter *    iter,
DBusMessageIter *    array_iter,
int *    array_type
 

Initializes an iterator for the array that the iterator may point to.

Note that you need to check that the iterator points to an array prior to using this function.

The array element type is returned in array_type, and the array iterator can only be used to get that type of data.

Parameters:
iter the iterator
array_iter pointer to an iterator to initialize
array_type gets set to the type of the array elements
Returns:
TRUE on success

Definition at line 2351 of file dbus-message.c.

References _dbus_assert, _dbus_demarshal_uint32(), DBusMessageRealIter::array_type_done, DBusMessageRealIter::array_type_pos, DBusMessageRealIter::changed_stamp, DBusMessageRealIter::container_length_pos, DBusMessageRealIter::container_start, DBusMessageRealIter, DBusMessageRealIter::end, DBusMessageRealIter::message, NULL, DBusMessageRealIter::parent_iter, DBusMessageRealIter::pos, TRUE, DBusMessageRealIter::type, and DBusMessageRealIter::wrote_dict_key.

dbus_bool_t dbus_message_iter_init_dict_iterator DBusMessageIter *    iter,
DBusMessageIter *    dict_iter
 

Initializes an iterator for the dict that the iterator may point to.

Note that you need to check that the iterator points to a dict prior to using this function.

Parameters:
iter the iterator
dict_iter pointer to an iterator to initialize
Returns:
TRUE on success

Definition at line 2403 of file dbus-message.c.

References _dbus_assert, _dbus_demarshal_uint32(), DBusMessageRealIter::changed_stamp, DBusMessageRealIter::container_length_pos, DBusMessageRealIter::container_start, DBusMessageRealIter, DBusMessageRealIter::end, DBusMessageRealIter::message, DBusMessageRealIter::parent_iter, DBusMessageRealIter::pos, TRUE, DBusMessageRealIter::type, and DBusMessageRealIter::wrote_dict_key.

dbus_bool_t dbus_message_iter_next DBusMessageIter *    iter
 

Moves the iterator to the next field.

Parameters:
iter The message iter
Returns:
TRUE if the iterator was moved to the next field

Definition at line 1960 of file dbus-message.c.

References _dbus_marshal_get_arg_end_pos(), DBusMessageRealIter, FALSE, and TRUE.

Referenced by dbus_message_iter_get_args_valist().

DBusMessage* dbus_message_new const char *    name,
const char *    destination_service
 

Constructs a new message.

Returns NULL if memory can't be allocated for the message. The service may be NULL in which case no service is set; this is appropriate when using D-BUS in a peer-to-peer context (no message bus).

Parameters:
name name of the message
destination_service service that the message should be sent to or NULL
Returns:
a new DBusMessage, free with dbus_message_unref()
See also:
dbus_message_unref()

Definition at line 958 of file dbus-message.c.

References dbus_message_unref(), and NULL.

Referenced by _dbus_connection_new_for_transport(), dbus_bus_acquire_service(), dbus_bus_activate_service(), dbus_bus_register(), dbus_bus_service_exists(), dbus_message_new_error_reply(), and dbus_message_new_reply().

DBusMessage* dbus_message_new_error_reply DBusMessage   original_message,
const char *    error_name,
const char *    error_message
 

Creates a new message that is an error reply to a certain message.

Parameters:
original_message the original message
error_name the error name
error_message the error message string or NULL for none
Returns:
a new error message

Definition at line 1027 of file dbus-message.c.

References dbus_message_append_iter_init(), dbus_message_iter_append_string(), dbus_message_new(), dbus_message_set_is_error(), dbus_message_set_reply_serial(), dbus_message_unref(), and NULL.

Referenced by dbus_connection_send_with_reply().

DBusMessage* dbus_message_new_reply DBusMessage   original_message
 

Constructs a message that is a reply to some other message.

Returns NULL if memory can't be allocated for the message.

Parameters:
original_message the message which the created message is a reply to.
Returns:
a new DBusMessage, free with dbus_message_unref()
See also:
dbus_message_new(), dbus_message_unref()

Definition at line 989 of file dbus-message.c.

References dbus_message_new(), dbus_message_set_reply_serial(), dbus_message_unref(), and NULL.

void dbus_message_ref DBusMessage   message
 

Increments the reference count of a DBusMessage.

Parameters:
message The message
See also:
dbus_message_unref

Definition at line 1148 of file dbus-message.c.

References _dbus_assert, _dbus_atomic_inc(), dbus_int32_t, and refcount.

void dbus_message_set_is_error DBusMessage   message,
dbus_bool_t    is_error_reply
 

Sets a flag indicating that the message is an error reply message, i.e.

an "exception" rather than a normal response.

Parameters:
message the message
is_error_reply TRUE if this is an error message.

Definition at line 3699 of file dbus-message.c.

References _dbus_string_get_data_len(), header, and locked.

Referenced by dbus_message_new_error_reply().

dbus_bool_t dbus_message_set_sender DBusMessage   message,
const char *    sender
 

Sets the message sender.

Parameters:
message the message
sender the sender
Returns:
FALSE if not enough memory

Definition at line 3672 of file dbus-message.c.

References locked, NULL, and TRUE.

void dbus_message_unref DBusMessage   message
 

Decrements the reference count of a DBusMessage.

Parameters:
message The message
See also:
dbus_message_ref

Definition at line 1177 of file dbus-message.c.

References _dbus_assert, _dbus_atomic_dec(), _dbus_data_slot_list_free(), _dbus_list_clear(), _dbus_list_foreach(), _dbus_string_free(), body, dbus_free(), dbus_int32_t, header, refcount, size_counters, and slot_list.

Referenced by _dbus_connection_message_sent(), _dbus_connection_new_for_transport(), _dbus_message_loader_queue_messages(), dbus_bus_acquire_service(), dbus_bus_activate_service(), dbus_bus_register(), dbus_bus_service_exists(), dbus_connection_dispatch(), dbus_connection_send_with_reply(), dbus_message_new(), dbus_message_new_error_reply(), and dbus_message_new_reply().

dbus_bool_t dbus_set_error_from_message DBusError *    error,
DBusMessage   message
 

Sets a #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_get_is_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 DBusError in one go.

Parameters:
error the error to set
message the message to set it from
Returns:
TRUE if dbus_message_get_is_error() returns TRUE for the message

Definition at line 3851 of file dbus-message.c.

References dbus_free(), dbus_message_get_args(), dbus_message_get_is_error(), dbus_set_error(), FALSE, NULL, and TRUE.

Referenced by dbus_bus_acquire_service(), dbus_bus_activate_service(), and dbus_bus_register().


Generated on Wed Oct 22 14:05:08 2003 for D-BUS by doxygen1.3-rc3