Main Page   Modules   Data Structures   File List   Data Fields   Related Pages  

marshaling and unmarshaling
[D-BUS internal implementation details]

functions to marshal/unmarshal data from the wire More...

Data Structures

union  DBusOctets8

Functions

dbus_uint32_t _dbus_unpack_uint32 (int byte_order, const unsigned char *data)
 Unpacks a 32 bit unsigned integer from a data pointer.

dbus_int32_t _dbus_unpack_int32 (int byte_order, const unsigned char *data)
 Unpacks a 32 bit signed integer from a data pointer.

dbus_uint64_t _dbus_unpack_uint64 (int byte_order, const unsigned char *data)
 Unpacks a 64 bit unsigned integer from a data pointer.

dbus_int64_t _dbus_unpack_int64 (int byte_order, const unsigned char *data)
 Unpacks a 64 bit signed integer from a data pointer.

void _dbus_pack_uint32 (dbus_uint32_t value, int byte_order, unsigned char *data)
 Packs a 32 bit unsigned integer into a data pointer.

void _dbus_pack_int32 (dbus_int32_t value, int byte_order, unsigned char *data)
 Packs a 32 bit signed integer into a data pointer.

void _dbus_pack_uint64 (dbus_uint64_t value, int byte_order, unsigned char *data)
 Packs a 64 bit unsigned integer into a data pointer.

void _dbus_pack_int64 (dbus_int64_t value, int byte_order, unsigned char *data)
 Packs a 64 bit signed integer into a data pointer.

void _dbus_marshal_set_int32 (DBusString *str, int byte_order, int offset, dbus_int32_t value)
 Sets the 4 bytes at the given offset to a marshaled signed integer, replacing anything found there previously.

void _dbus_marshal_set_uint32 (DBusString *str, int byte_order, int offset, dbus_uint32_t value)
 Sets the 4 bytes at the given offset to a marshaled unsigned integer, replacing anything found there previously.

void _dbus_marshal_set_int64 (DBusString *str, int byte_order, int offset, dbus_int64_t value)
 Sets the 8 bytes at the given offset to a marshaled signed integer, replacing anything found there previously.

void _dbus_marshal_set_uint64 (DBusString *str, int byte_order, int offset, dbus_uint64_t value)
 Sets the 8 bytes at the given offset to a marshaled unsigned integer, replacing anything found there previously.

dbus_bool_t _dbus_marshal_set_string (DBusString *str, int byte_order, int offset, const DBusString *value, int len)
 Sets the existing marshaled string at the given offset with a new marshaled string.

dbus_bool_t _dbus_marshal_double (DBusString *str, int byte_order, double value)
 Marshals a double value.

dbus_bool_t _dbus_marshal_int32 (DBusString *str, int byte_order, dbus_int32_t value)
 Marshals a 32 bit signed integer value.

dbus_bool_t _dbus_marshal_uint32 (DBusString *str, int byte_order, dbus_uint32_t value)
 Marshals a 32 bit unsigned integer value.

dbus_bool_t _dbus_marshal_int64 (DBusString *str, int byte_order, dbus_int64_t value)
 Marshals a 64 bit signed integer value.

dbus_bool_t _dbus_marshal_uint64 (DBusString *str, int byte_order, dbus_uint64_t value)
 Marshals a 64 bit unsigned integer value.

dbus_bool_t _dbus_marshal_string (DBusString *str, int byte_order, const char *value)
 Marshals a UTF-8 string.

dbus_bool_t _dbus_marshal_byte_array (DBusString *str, int byte_order, const unsigned char *value, int len)
 Marshals a byte array.

dbus_bool_t _dbus_marshal_int32_array (DBusString *str, int byte_order, const dbus_int32_t *value, int len)
 Marshals a 32 bit signed integer array.

dbus_bool_t _dbus_marshal_uint32_array (DBusString *str, int byte_order, const dbus_uint32_t *value, int len)
 Marshals a 32 bit unsigned integer array.

dbus_bool_t _dbus_marshal_int64_array (DBusString *str, int byte_order, const dbus_int64_t *value, int len)
 Marshals a 64 bit signed integer array.

dbus_bool_t _dbus_marshal_uint64_array (DBusString *str, int byte_order, const dbus_uint64_t *value, int len)
 Marshals a 64 bit unsigned integer array.

dbus_bool_t _dbus_marshal_double_array (DBusString *str, int byte_order, const double *value, int len)
 Marshals a double array.

dbus_bool_t _dbus_marshal_string_array (DBusString *str, int byte_order, const char **value, int len)
 Marshals a string array.

double _dbus_demarshal_double (const DBusString *str, int byte_order, int pos, int *new_pos)
 Demarshals a double.

dbus_int32_t _dbus_demarshal_int32 (const DBusString *str, int byte_order, int pos, int *new_pos)
 Demarshals a 32 bit signed integer.

dbus_uint32_t _dbus_demarshal_uint32 (const DBusString *str, int byte_order, int pos, int *new_pos)
 Demarshals a 32 bit unsigned integer.

dbus_int64_t _dbus_demarshal_int64 (const DBusString *str, int byte_order, int pos, int *new_pos)
 Demarshals a 64 bit signed integer.

dbus_uint64_t _dbus_demarshal_uint64 (const DBusString *str, int byte_order, int pos, int *new_pos)
 Demarshals a 64 bit unsigned integer.

char * _dbus_demarshal_string (const DBusString *str, int byte_order, int pos, int *new_pos)
 Demarshals an UTF-8 string.

dbus_bool_t _dbus_demarshal_byte_array (const DBusString *str, int byte_order, int pos, int *new_pos, unsigned char **array, int *array_len)
 Demarshals a byte array.

dbus_bool_t _dbus_demarshal_int32_array (const DBusString *str, int byte_order, int pos, int *new_pos, dbus_int32_t **array, int *array_len)
 Demarshals a 32 bit signed integer array.

dbus_bool_t _dbus_demarshal_uint32_array (const DBusString *str, int byte_order, int pos, int *new_pos, dbus_uint32_t **array, int *array_len)
 Demarshals a 32 bit unsigned integer array.

dbus_bool_t _dbus_demarshal_int64_array (const DBusString *str, int byte_order, int pos, int *new_pos, dbus_int64_t **array, int *array_len)
 Demarshals a 64 bit signed integer array.

dbus_bool_t _dbus_demarshal_uint64_array (const DBusString *str, int byte_order, int pos, int *new_pos, dbus_uint64_t **array, int *array_len)
 Demarshals a 64 bit unsigned integer array.

dbus_bool_t _dbus_demarshal_double_array (const DBusString *str, int byte_order, int pos, int *new_pos, double **array, int *array_len)
 Demarshals a double array.

dbus_bool_t _dbus_demarshal_string_array (const DBusString *str, int byte_order, int pos, int *new_pos, char ***array, int *array_len)
 Demarshals a string array.

dbus_bool_t _dbus_marshal_get_arg_end_pos (const DBusString *str, int byte_order, int type, int pos, int *end_pos)
 Returns the position right after the end of an argument.

dbus_bool_t _dbus_marshal_validate_type (const DBusString *str, int pos, int *type, int *end_pos)
 Validates and returns a typecode at a specific position in the message.

dbus_bool_t _dbus_marshal_validate_arg (const DBusString *str, int byte_order, int depth, int type, int array_type_pos, int pos, int *end_pos)
 Validates an argument of a specific type, checking that it is well-formed, for example no ludicrous length fields, strings are nul-terminated, etc.

void _dbus_verbose_bytes (const unsigned char *data, int len)
 If in verbose mode, print a block of binary data.

void _dbus_verbose_bytes_of_string (const DBusString *str, int start, int len)
 Dump the given part of the string to verbose log.


Detailed Description

functions to marshal/unmarshal data from the wire

Types and functions related to converting primitive data types from wire format to native machine format, and vice versa.


Function Documentation

dbus_bool_t _dbus_demarshal_byte_array const DBusString *    str,
int    byte_order,
int    pos,
int *    new_pos,
unsigned char **    array,
int *    array_len
 

Demarshals a byte array.

Todo:
Should probably demarshal to a DBusString, having memcpy() in here is Evil(tm).
Parameters:
str the string containing the data
byte_order the byte order
pos the position in the string
new_pos the new position of the string
array the array
array_len length of the demarshaled data
Returns:
TRUE on success

Definition at line 1047 of file dbus-marshal.c.

References _dbus_demarshal_uint32(), _dbus_string_get_const_data_len(), dbus_free(), dbus_malloc(), FALSE, NULL, and TRUE.

Referenced by dbus_message_iter_get_boolean_array(), dbus_message_iter_get_byte_array(), and dbus_message_iter_get_named().

double _dbus_demarshal_double const DBusString *    str,
int    byte_order,
int    pos,
int *    new_pos
 

Demarshals a double.

Parameters:
str the string containing the data
byte_order the byte order
pos the position in the string
new_pos the new position of the string
Returns:
the demarshaled double.

Definition at line 889 of file dbus-marshal.c.

Referenced by dbus_message_iter_get_double().

dbus_bool_t _dbus_demarshal_double_array const DBusString *    str,
int    byte_order,
int    pos,
int *    new_pos,
double **    array,
int *    array_len
 

Demarshals a double array.

Parameters:
str the string containing the data
byte_order the byte order
pos the position in the string
new_pos the new position of the string
array the array
array_len length of the demarshaled data
Returns:
TRUE on success

Definition at line 1299 of file dbus-marshal.c.

Referenced by dbus_message_iter_get_double_array().

dbus_int32_t _dbus_demarshal_int32 const DBusString *    str,
int    byte_order,
int    pos,
int *    new_pos
 

Demarshals a 32 bit signed integer.

Parameters:
str the string containing the data
byte_order the byte order
pos the position in the string
new_pos the new position of the string
Returns:
the demarshaled integer.

Definition at line 911 of file dbus-marshal.c.

Referenced by dbus_message_iter_get_int32().

dbus_bool_t _dbus_demarshal_int32_array const DBusString *    str,
int    byte_order,
int    pos,
int *    new_pos,
dbus_int32_t **    array,
int *    array_len
 

Demarshals a 32 bit signed integer array.

Parameters:
str the string containing the data
byte_order the byte order
pos the position in the string
new_pos the new position of the string
array the array
array_len length of the demarshaled data
Returns:
TRUE on success

Definition at line 1203 of file dbus-marshal.c.

Referenced by dbus_message_iter_get_int32_array().

dbus_int64_t _dbus_demarshal_int64 const DBusString *    str,
int    byte_order,
int    pos,
int *    new_pos
 

Demarshals a 64 bit signed integer.

Parameters:
str the string containing the data
byte_order the byte order
pos the position in the string
new_pos the new position of the string
Returns:
the demarshaled integer.

Definition at line 949 of file dbus-marshal.c.

Referenced by dbus_message_iter_get_int64().

dbus_bool_t _dbus_demarshal_int64_array const DBusString *    str,
int    byte_order,
int    pos,
int *    new_pos,
dbus_int64_t **    array,
int *    array_len
 

Demarshals a 64 bit signed integer array.

Parameters:
str the string containing the data
byte_order the byte order
pos the position in the string
new_pos the new position of the string
array the array
array_len length of the demarshaled data
Returns:
TRUE on success

Definition at line 1251 of file dbus-marshal.c.

Referenced by dbus_message_iter_get_int64_array().

char* _dbus_demarshal_string const DBusString *    str,
int    byte_order,
int    pos,
int *    new_pos
 

Demarshals an UTF-8 string.

Todo:
Should we check the string to make sure that it's valid UTF-8, and maybe "fix" the string if it's broken?

Should probably demarshal to a DBusString, having memcpy() in here is Evil(tm).

Parameters:
str the string containing the data
byte_order the byte order
pos the position in the string
new_pos the new position of the string
Returns:
the demarshaled string.

Definition at line 1002 of file dbus-marshal.c.

References _dbus_demarshal_uint32(), _dbus_string_get_const_data_len(), dbus_malloc(), and NULL.

Referenced by _dbus_demarshal_string_array(), dbus_message_iter_get_dict_key(), dbus_message_iter_get_named(), and dbus_message_iter_get_string().

dbus_bool_t _dbus_demarshal_string_array const DBusString *    str,
int    byte_order,
int    pos,
int *    new_pos,
char ***    array,
int *    array_len
 

Demarshals a string array.

Parameters:
str the string containing the data
byte_order the byte order
pos the position in the string
new_pos the new position of the string
array the array
array_len length of the demarshaled data
Returns:
TRUE on success

Definition at line 1322 of file dbus-marshal.c.

References _dbus_demarshal_string(), _dbus_demarshal_uint32(), dbus_free(), dbus_new, dbus_realloc(), FALSE, NULL, and TRUE.

Referenced by dbus_message_iter_get_string_array().

dbus_uint32_t _dbus_demarshal_uint32 const DBusString *    str,
int    byte_order,
int    pos,
int *    new_pos
 

Demarshals a 32 bit unsigned integer.

Parameters:
str the string containing the data
byte_order the byte order
pos the position in the string
new_pos the new position of the string
Returns:
the demarshaled integer.

Definition at line 929 of file dbus-marshal.c.

Referenced by _dbus_demarshal_byte_array(), _dbus_demarshal_string(), _dbus_demarshal_string_array(), _dbus_marshal_get_arg_end_pos(), _dbus_marshal_set_string(), dbus_message_iter_get_uint32(), dbus_message_iter_init_array_iterator(), and dbus_message_iter_init_dict_iterator().

dbus_bool_t _dbus_demarshal_uint32_array const DBusString *    str,
int    byte_order,
int    pos,
int *    new_pos,
dbus_uint32_t **    array,
int *    array_len
 

Demarshals a 32 bit unsigned integer array.

Parameters:
str the string containing the data
byte_order the byte order
pos the position in the string
new_pos the new position of the string
array the array
array_len length of the demarshaled data
Returns:
TRUE on success

Definition at line 1226 of file dbus-marshal.c.

Referenced by dbus_message_iter_get_uint32_array().

dbus_uint64_t _dbus_demarshal_uint64 const DBusString *    str,
int    byte_order,
int    pos,
int *    new_pos
 

Demarshals a 64 bit unsigned integer.

Parameters:
str the string containing the data
byte_order the byte order
pos the position in the string
new_pos the new position of the string
Returns:
the demarshaled integer.

Definition at line 971 of file dbus-marshal.c.

Referenced by dbus_message_iter_get_uint64().

dbus_bool_t _dbus_demarshal_uint64_array const DBusString *    str,
int    byte_order,
int    pos,
int *    new_pos,
dbus_uint64_t **    array,
int *    array_len
 

Demarshals a 64 bit unsigned integer array.

Parameters:
str the string containing the data
byte_order the byte order
pos the position in the string
new_pos the new position of the string
array the array
array_len length of the demarshaled data
Returns:
TRUE on success

Definition at line 1274 of file dbus-marshal.c.

Referenced by dbus_message_iter_get_uint64_array().

dbus_bool_t _dbus_marshal_byte_array DBusString *    str,
int    byte_order,
const unsigned char *    value,
int    len
 

Marshals a byte array.

Parameters:
str the string to append the marshalled value to
byte_order the byte order to use
value the array
len number of elements in the array
Returns:
TRUE on success

Definition at line 587 of file dbus-marshal.c.

References _dbus_marshal_uint32(), _dbus_string_append_len(), _dbus_string_get_length(), _dbus_string_set_length(), FALSE, and TRUE.

Referenced by dbus_message_iter_append_boolean_array(), dbus_message_iter_append_byte_array(), and dbus_message_iter_append_named().

dbus_bool_t _dbus_marshal_double DBusString *    str,
int    byte_order,
double    value
 

Marshals a double value.

Parameters:
str the string to append the marshalled value to
byte_order the byte order to use
value the value
Returns:
TRUE on success

Definition at line 463 of file dbus-marshal.c.

Referenced by dbus_message_iter_append_double().

dbus_bool_t _dbus_marshal_double_array DBusString *    str,
int    byte_order,
const double *    value,
int    len
 

Marshals a double array.

Parameters:
str the string to append the marshalled value to
byte_order the byte order to use
value the array
len the length of the array
Returns:
TRUE on success

Definition at line 794 of file dbus-marshal.c.

Referenced by dbus_message_iter_append_double_array().

dbus_bool_t _dbus_marshal_get_arg_end_pos const DBusString *    str,
int    byte_order,
int    type,
int    pos,
int *    end_pos
 

Returns the position right after the end of an argument.

PERFORMS NO VALIDATION WHATSOEVER. The message must have been previously validated.

Parameters:
str a string
byte_order the byte order to use
type the type of the argument
pos the pos where the arg starts
end_pos pointer where the position right after the end position will follow
Returns:
TRUE if more data exists after the arg

Definition at line 1410 of file dbus-marshal.c.

References _dbus_assert_not_reached, _dbus_demarshal_uint32(), _dbus_string_get_length(), _dbus_warn(), FALSE, and TRUE.

Referenced by dbus_message_iter_has_next(), and dbus_message_iter_next().

dbus_bool_t _dbus_marshal_int32 DBusString *    str,
int    byte_order,
dbus_int32_t    value
 

Marshals a 32 bit signed integer value.

Parameters:
str the string to append the marshalled value to
byte_order the byte order to use
value the value
Returns:
TRUE on success

Definition at line 481 of file dbus-marshal.c.

Referenced by dbus_message_iter_append_int32().

dbus_bool_t _dbus_marshal_int32_array DBusString *    str,
int    byte_order,
const dbus_int32_t   value,
int    len
 

Marshals a 32 bit signed integer array.

Parameters:
str the string to append the marshalled value to
byte_order the byte order to use
value the array
len the length of the array
Returns:
TRUE on success

Definition at line 710 of file dbus-marshal.c.

Referenced by dbus_message_iter_append_int32_array().

dbus_bool_t _dbus_marshal_int64 DBusString *    str,
int    byte_order,
dbus_int64_t    value
 

Marshals a 64 bit signed integer value.

Parameters:
str the string to append the marshalled value to
byte_order the byte order to use
value the value
Returns:
TRUE on success

Definition at line 515 of file dbus-marshal.c.

Referenced by dbus_message_iter_append_int64().

dbus_bool_t _dbus_marshal_int64_array DBusString *    str,
int    byte_order,
const dbus_int64_t   value,
int    len
 

Marshals a 64 bit signed integer array.

Parameters:
str the string to append the marshalled value to
byte_order the byte order to use
value the array
len the length of the array
Returns:
TRUE on success

Definition at line 752 of file dbus-marshal.c.

Referenced by dbus_message_iter_append_int64_array().

void _dbus_marshal_set_int32 DBusString *    str,
int    byte_order,
int    offset,
dbus_int32_t    value
 

Sets the 4 bytes at the given offset to a marshaled signed integer, replacing anything found there previously.

Parameters:
str the string to write the marshalled int to
offset the byte offset where int should be written
byte_order the byte order to use
value the value

Definition at line 315 of file dbus-marshal.c.

void _dbus_marshal_set_int64 DBusString *    str,
int    byte_order,
int    offset,
dbus_int64_t    value
 

Sets the 8 bytes at the given offset to a marshaled signed integer, replacing anything found there previously.

Parameters:
str the string to write the marshalled int to
offset the byte offset where int should be written
byte_order the byte order to use
value the value

Definition at line 355 of file dbus-marshal.c.

dbus_bool_t _dbus_marshal_set_string DBusString *    str,
int    byte_order,
int    offset,
const DBusString *    value,
int    len
 

Sets the existing marshaled string at the given offset with a new marshaled string.

The given offset must point to an existing string or the wrong length will be deleted and replaced with the new string.

Parameters:
str the string to write the marshalled string to
offset the byte offset where string should be written
byte_order the byte order to use
value the value
len the length to use
Returns:
TRUE on success

Definition at line 402 of file dbus-marshal.c.

References _dbus_assert, _dbus_demarshal_uint32(), _dbus_marshal_set_uint32(), _dbus_string_replace_len(), FALSE, and TRUE.

void _dbus_marshal_set_uint32 DBusString *    str,
int    byte_order,
int    offset,
dbus_uint32_t    value
 

Sets the 4 bytes at the given offset to a marshaled unsigned integer, replacing anything found there previously.

Parameters:
str the string to write the marshalled int to
offset the byte offset where int should be written
byte_order the byte order to use
value the value

Definition at line 334 of file dbus-marshal.c.

Referenced by _dbus_marshal_set_string(), and _dbus_marshal_string_array().

void _dbus_marshal_set_uint64 DBusString *    str,
int    byte_order,
int    offset,
dbus_uint64_t    value
 

Sets the 8 bytes at the given offset to a marshaled unsigned integer, replacing anything found there previously.

Parameters:
str the string to write the marshalled int to
offset the byte offset where int should be written
byte_order the byte order to use
value the value

Definition at line 376 of file dbus-marshal.c.

dbus_bool_t _dbus_marshal_string DBusString *    str,
int    byte_order,
const char *    value
 

Marshals a UTF-8 string.

Todo:
: If the string append fails we need to restore the old length. (also for other marshallers)
Parameters:
str the string to append the marshalled value to
byte_order the byte order to use
value the string
Returns:
TRUE on success

Definition at line 556 of file dbus-marshal.c.

References _dbus_marshal_uint32(), _dbus_string_append_len(), _dbus_string_get_length(), _dbus_string_set_length(), and FALSE.

Referenced by _dbus_marshal_string_array(), dbus_message_iter_append_dict_key(), dbus_message_iter_append_named(), and dbus_message_iter_append_string().

dbus_bool_t _dbus_marshal_string_array DBusString *    str,
int    byte_order,
const char **    value,
int    len
 

Marshals a string array.

Parameters:
str the string to append the marshalled value to
byte_order the byte order to use
value the array
len the length of the array
Returns:
TRUE on success

Definition at line 814 of file dbus-marshal.c.

References _dbus_marshal_set_uint32(), _dbus_marshal_string(), _dbus_marshal_uint32(), _dbus_string_get_length(), _dbus_string_set_length(), FALSE, and TRUE.

Referenced by dbus_message_iter_append_string_array().

dbus_bool_t _dbus_marshal_uint32 DBusString *    str,
int    byte_order,
dbus_uint32_t    value
 

Marshals a 32 bit unsigned integer value.

Parameters:
str the string to append the marshalled value to
byte_order the byte order to use
value the value
Returns:
TRUE on success

Definition at line 497 of file dbus-marshal.c.

Referenced by _dbus_marshal_byte_array(), _dbus_marshal_string(), _dbus_marshal_string_array(), dbus_message_iter_append_array(), dbus_message_iter_append_dict(), and dbus_message_iter_append_uint32().

dbus_bool_t _dbus_marshal_uint32_array DBusString *    str,
int    byte_order,
const dbus_uint32_t   value,
int    len
 

Marshals a 32 bit unsigned integer array.

Parameters:
str the string to append the marshalled value to
byte_order the byte order to use
value the array
len the length of the array
Returns:
TRUE on success

Definition at line 730 of file dbus-marshal.c.

Referenced by dbus_message_iter_append_uint32_array().

dbus_bool_t _dbus_marshal_uint64 DBusString *    str,
int    byte_order,
dbus_uint64_t    value
 

Marshals a 64 bit unsigned integer value.

Parameters:
str the string to append the marshalled value to
byte_order the byte order to use
value the value
Returns:
TRUE on success

Definition at line 533 of file dbus-marshal.c.

Referenced by dbus_message_iter_append_uint64().

dbus_bool_t _dbus_marshal_uint64_array DBusString *    str,
int    byte_order,
const dbus_uint64_t   value,
int    len
 

Marshals a 64 bit unsigned integer array.

Parameters:
str the string to append the marshalled value to
byte_order the byte order to use
value the array
len the length of the array
Returns:
TRUE on success

Definition at line 772 of file dbus-marshal.c.

Referenced by dbus_message_iter_append_uint64_array().

dbus_bool_t _dbus_marshal_validate_arg const DBusString *    str,
int    byte_order,
int    depth,
int    type,
int    array_type_pos,
int    pos,
int *    end_pos
 

Validates an argument of a specific type, checking that it is well-formed, for example no ludicrous length fields, strings are nul-terminated, etc.

Returns the end position of the argument in end_pos, and returns TRUE if a valid arg begins at "pos"

Todo:
security: need to audit this function.

For array types that can't be invalid, we should not walk the whole array validating it. e.g. just skip all the int values in an int array.

Parameters:
str a string
byte_order the byte order to use
depth current recursion depth, to prevent excessive recursion
type the type of the argument
array_type_pos the position of the current array type, or -1 if not in an array
pos the pos where the arg starts
end_pos pointer where the position right after the end position will follow
Returns:
TRUE if the arg is valid.

Definition at line 1764 of file dbus-marshal.c.

References _dbus_marshal_validate_type(), _dbus_string_get_byte(), _dbus_string_get_length(), _dbus_string_validate_nul(), _dbus_verbose_bytes_of_string(), FALSE, and TRUE.

Referenced by _dbus_message_loader_queue_messages().

dbus_bool_t _dbus_marshal_validate_type const DBusString *    str,
int    pos,
int *    type,
int *    end_pos
 

Validates and returns a typecode at a specific position in the message.

Parameters:
str a string
type the type of the argument
pos the pos where the typecode starts
end_pos pointer where the position right after the end position will follow
Returns:
TRUE if the type is valid.

Definition at line 1622 of file dbus-marshal.c.

References _dbus_string_get_const_data_len(), _dbus_string_get_length(), FALSE, NULL, and TRUE.

Referenced by _dbus_marshal_validate_arg(), and _dbus_message_loader_queue_messages().

void _dbus_pack_int32 dbus_int32_t    value,
int    byte_order,
unsigned char *    data
 

Packs a 32 bit signed integer into a data pointer.

Parameters:
value the value
byte_order the byte order to use
data the data pointer

Definition at line 229 of file dbus-marshal.c.

void _dbus_pack_int64 dbus_int64_t    value,
int    byte_order,
unsigned char *    data
 

Packs a 64 bit signed integer into a data pointer.

Parameters:
value the value
byte_order the byte order to use
data the data pointer

Definition at line 262 of file dbus-marshal.c.

void _dbus_pack_uint32 dbus_uint32_t    value,
int    byte_order,
unsigned char *    data
 

Packs a 32 bit unsigned integer into a data pointer.

Parameters:
value the value
byte_order the byte order to use
data the data pointer

Definition at line 214 of file dbus-marshal.c.

void _dbus_pack_uint64 dbus_uint64_t    value,
int    byte_order,
unsigned char *    data
 

Packs a 64 bit unsigned integer into a data pointer.

Parameters:
value the value
byte_order the byte order to use
data the data pointer

Definition at line 245 of file dbus-marshal.c.

dbus_int32_t _dbus_unpack_int32 int    byte_order,
const unsigned char *    data
 

Unpacks a 32 bit signed integer from a data pointer.

Parameters:
byte_order The byte order to use
data the data pointer
Returns:
the integer

Definition at line 129 of file dbus-marshal.c.

dbus_int64_t _dbus_unpack_int64 int    byte_order,
const unsigned char *    data
 

Unpacks a 64 bit signed integer from a data pointer.

Parameters:
byte_order The byte order to use
data the data pointer
Returns:
the integer

Definition at line 162 of file dbus-marshal.c.

dbus_uint32_t _dbus_unpack_uint32 int    byte_order,
const unsigned char *    data
 

Unpacks a 32 bit unsigned integer from a data pointer.

Parameters:
byte_order The byte order to use
data the data pointer
Returns:
the integer

Definition at line 115 of file dbus-marshal.c.

Referenced by _dbus_message_loader_queue_messages().

dbus_uint64_t _dbus_unpack_uint64 int    byte_order,
const unsigned char *    data
 

Unpacks a 64 bit unsigned integer from a data pointer.

Parameters:
byte_order The byte order to use
data the data pointer
Returns:
the integer

Definition at line 144 of file dbus-marshal.c.

void _dbus_verbose_bytes const unsigned char *    data,
int    len
 

If in verbose mode, print a block of binary data.

Todo:
right now it prints even if not in verbose mode
Parameters:
data the data
len the length of the data

Definition at line 2060 of file dbus-marshal.c.

References _dbus_assert.

Referenced by _dbus_verbose_bytes_of_string().

void _dbus_verbose_bytes_of_string const DBusString *    str,
int    start,
int    len
 

Dump the given part of the string to verbose log.

Parameters:
str the string
start the start of range to dump
len length of range

Definition at line 2132 of file dbus-marshal.c.

References _dbus_assert, _dbus_string_get_const_data_len(), _dbus_string_get_length(), and _dbus_verbose_bytes().

Referenced by _dbus_marshal_validate_arg(), _dbus_message_loader_queue_messages(), _dbus_read(), and _dbus_write().


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