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
marshaling and unmarshaling
[
group__DBusInternals.html
D-BUS internal implementation details
]
functions to marshal/unmarshal data from the wire
#_details
More...
Data Structures
struct
structHeaderFieldType.html
HeaderFieldType
struct
structDBusTypeReaderClass.html
DBusTypeReaderClass
Virtual table for a type reader.
structDBusTypeReaderClass.html#_details
More...
struct
structReplacementBlock.html
ReplacementBlock
Defines
#define
group__DBusMarshal.html#ga168
FIELDS_ARRAY_SIGNATURE_OFFSET
6
Offset from start of _dbus_header_signature_str to the signature of the fields array.
#define
group__DBusMarshal.html#ga169
FIELDS_ARRAY_ELEMENT_SIGNATURE_OFFSET
7
Offset from start of _dbus_header_signature_str to the signature of an element of the fields array.
#define
group__DBusMarshal.html#ga170
BYTE_ORDER_OFFSET
0
Offset to byte order from start of header.
#define
group__DBusMarshal.html#ga171
TYPE_OFFSET
1
Offset to type from start of header.
#define
group__DBusMarshal.html#ga172
FLAGS_OFFSET
2
Offset to flags from start of header.
#define
group__DBusMarshal.html#ga173
VERSION_OFFSET
3
Offset to version from start of header.
#define
group__DBusMarshal.html#ga174
BODY_LENGTH_OFFSET
4
Offset to body length from start of header.
#define
group__DBusMarshal.html#ga175
SERIAL_OFFSET
8
Offset to client serial from start of header.
#define
group__DBusMarshal.html#ga176
FIELDS_ARRAY_LENGTH_OFFSET
12
Offset to fields array length from start of header.
#define
group__DBusMarshal.html#ga177
FIRST_FIELD_OFFSET
16
Offset to first field in header.
#define
group__DBusMarshal.html#ga178
EXPECTED_TYPE_OF_FIELD
(field)   (_dbus_header_field_types[field].type)
Macro to look up the correct type for a field.
#define
group__DBusMarshal.html#ga179
MAX_POSSIBLE_HEADER_PADDING
7
The most padding we could ever need for a header.
#define
group__DBusMarshal.html#ga180
HEADER_END_BEFORE_PADDING
(header)   (_dbus_string_get_length (&(header)->data) - (header)->padding)
Compute the end of the header, ignoring padding.
#define
group__DBusMarshal.html#ga181
RECURSIVE_MARSHAL_READ_TRACE
0
turn this on to get deluged in TypeReader verbose spam
#define
group__DBusMarshal.html#ga182
RECURSIVE_MARSHAL_WRITE_TRACE
0
turn this on to get deluged in TypeWriter verbose spam
#define
group__DBusMarshal.html#ga183
ARRAY_READER_LEN_POS
(reader)   ((reader)->u.array.start_pos - ((int)(reader)->array_len_offset) - 4)
compute position of array length given array_len_offset, which is the offset back from start_pos to end of the len
#define
group__DBusMarshal.html#ga184
VALID_INITIAL_NAME_CHARACTER
(c)
Determine wether the given charater is valid as the first charater in a name.
#ga184
#define
group__DBusMarshal.html#ga185
VALID_NAME_CHARACTER
(c)
Determine wether the given charater is valid as a second or later character in a name.
#ga185
Enumerations
enum
{
MARSHAL_AS_STRING
,
MARSHAL_AS_SIGNATURE
,
MARSHAL_AS_BYTE_ARRAY
}
Functions
void
group__DBusMarshal.html#ga14
_dbus_pack_uint32
(
group__DBusTypes.html#ga3
dbus_uint32_t
value, int byte_order, unsigned char *data)
Packs a 32 bit unsigned integer into a data pointer.
#ga14
void
group__DBusMarshal.html#ga19
_dbus_marshal_set_uint32
(
structDBusString.html
DBusString
*str, int pos,
group__DBusTypes.html#ga3
dbus_uint32_t
value, int byte_order)
Sets the 4 bytes at the given offset to a marshaled unsigned integer, replacing anything found there previously.
#ga19
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga22
_dbus_marshal_set_basic
(
structDBusString.html
DBusString
*str, int pos, int type, const void *value, int byte_order, int *old_end_pos, int *new_end_pos)
Sets an existing basic type value to a new value.
#ga22
group__DBusTypes.html#ga3
dbus_uint32_t
group__DBusMarshal.html#ga23
_dbus_marshal_read_uint32
(const
structDBusString.html
DBusString
*str, int pos, int byte_order, int *new_pos)
Convenience function to demarshal a 32 bit unsigned integer.
#ga23
void
group__DBusMarshal.html#ga24
_dbus_marshal_read_basic
(const
structDBusString.html
DBusString
*str, int pos, int type, void *value, int byte_order, int *new_pos)
Demarshals a basic-typed value.
#ga24
void
group__DBusMarshal.html#ga25
_dbus_marshal_read_fixed_multi
(const
structDBusString.html
DBusString
*str, int pos, int element_type, void *value, int n_elements, int byte_order, int *new_pos)
Reads a block of fixed-length basic values, as an optimization vs.
#ga25
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga32
_dbus_marshal_write_basic
(
structDBusString.html
DBusString
*str, int insert_at, int type, const void *value, int byte_order, int *pos_after)
Marshals a basic-typed value.
#ga32
void
group__DBusMarshal.html#ga34
_dbus_swap_array
(unsigned char *data, int n_elements, int alignment)
Swaps the elements of an array to the opposite byte order.
#ga34
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga37
_dbus_marshal_write_fixed_multi
(
structDBusString.html
DBusString
*str, int insert_at, int element_type, const void *value, int n_elements, int byte_order, int *pos_after)
Marshals a block of values of fixed-length type all at once, as an optimization.
#ga37
void
group__DBusMarshal.html#ga38
_dbus_marshal_skip_basic
(const
structDBusString.html
DBusString
*str, int type, int byte_order, int *pos)
Skips over a basic-typed value, reporting the following position.
#ga38
void
group__DBusMarshal.html#ga39
_dbus_marshal_skip_array
(const
structDBusString.html
DBusString
*str, int element_type, int byte_order, int *pos)
Skips an array, returning the next position.
#ga39
int
group__DBusMarshal.html#ga40
_dbus_type_get_alignment
(int typecode)
Gets the alignment requirement for the given type; will be 1, 4, or 8.
#ga40
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga41
_dbus_type_is_valid
(int typecode)
Return
group__DBusMacros.html#ga2
TRUE
if the typecode is a valid typecode.
#ga41
const char *
group__DBusMarshal.html#ga42
_dbus_type_to_string
(int typecode)
Returns a string describing the given type.
#ga42
void
group__DBusMarshal.html#ga43
_dbus_verbose_bytes
(const unsigned char *data, int len, int offset)
If in verbose mode, print a block of binary data.
#ga43
void
group__DBusMarshal.html#ga44
_dbus_verbose_bytes_of_string
(const
structDBusString.html
DBusString
*str, int start, int len)
Dump the given part of the string to verbose log.
#ga44
int
group__DBusMarshal.html#ga46
_dbus_first_type_in_signature
(const
structDBusString.html
DBusString
*str, int pos)
Get the first type in the signature.
#ga46
int
group__DBusMarshal.html#ga47
_dbus_first_type_in_signature_c_str
(const char *str, int pos)
Similar to
group__DBusMarshal.html#ga46
_dbus_first_type_in_signature
, but operates on a C string buffer.
#ga47
void
group__DBusMarshal.html#ga49
_dbus_marshal_byteswap
(const
structDBusString.html
DBusString
*signature, int signature_start, int old_byte_order, int new_byte_order,
structDBusString.html
DBusString
*value_str, int value_pos)
Byteswaps the marshaled data in the given value_str.
#ga49
group__DBusMarshal.html#ga50
_DBUS_STRING_DEFINE_STATIC
(_dbus_header_signature_str, DBUS_HEADER_SIGNATURE)
Static
structDBusString.html
DBusString
containing the signature of a message header.
group__DBusMarshal.html#ga51
_DBUS_STRING_DEFINE_STATIC
(_dbus_local_interface_str, DBUS_INTERFACE_LOCAL)
Static
structDBusString.html
DBusString
containing the local interface.
group__DBusMarshal.html#ga52
_DBUS_STRING_DEFINE_STATIC
(_dbus_local_path_str, DBUS_PATH_LOCAL)
Static
structDBusString.html
DBusString
containing the local path.
int
group__DBusMarshal.html#ga62
_dbus_header_get_message_type
(
structDBusHeader.html
DBusHeader
*header)
Gets the type of the message.
#ga62
void
group__DBusMarshal.html#ga63
_dbus_header_set_serial
(
structDBusHeader.html
DBusHeader
*header,
group__DBusTypes.html#ga3
dbus_uint32_t
serial)
Sets the serial number of a header.
#ga63
group__DBusTypes.html#ga3
dbus_uint32_t
group__DBusMarshal.html#ga64
_dbus_header_get_serial
(
structDBusHeader.html
DBusHeader
*header)
See
group__DBusMessage.html#ga3
dbus_message_get_serial()
.
#ga64
void
group__DBusMarshal.html#ga65
_dbus_header_reinit
(
structDBusHeader.html
DBusHeader
*header, int byte_order)
Re-initializes a header that was previously initialized and never freed.
#ga65
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga66
_dbus_header_init
(
structDBusHeader.html
DBusHeader
*header, int byte_order)
Initializes a header, but doesn't prepare it for use; to make the header valid, you have to call
group__DBusMarshal.html#ga69
_dbus_header_create()
.
#ga66
void
group__DBusMarshal.html#ga67
_dbus_header_free
(
structDBusHeader.html
DBusHeader
*header)
Frees a header.
#ga67
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga68
_dbus_header_copy
(const
structDBusHeader.html
DBusHeader
*header,
structDBusHeader.html
DBusHeader
*dest)
Initializes dest with a copy of the given header.
#ga68
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga69
_dbus_header_create
(
structDBusHeader.html
DBusHeader
*header, int message_type, const char *destination, const char *path, const char *interface, const char *member, const char *error_name)
Fills in the primary fields of the header, so the header is ready for use.
#ga69
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga70
_dbus_header_have_message_untrusted
(int max_message_length, DBusValidity *validity, int *byte_order, int *fields_array_len, int *header_len, int *body_len, const
structDBusString.html
DBusString
*str, int start, int len)
Given data long enough to contain the length of the message body and the fields array, check whether the data is long enough to contain the entire message (assuming the claimed lengths are accurate).
#ga70
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga73
_dbus_header_load
(
structDBusHeader.html
DBusHeader
*header, DBusValidationMode mode, DBusValidity *validity, int byte_order, int fields_array_len, int header_len, int body_len, const
structDBusString.html
DBusString
*str, int start, int len)
Creates a message header from potentially-untrusted data.
#ga73
void
group__DBusMarshal.html#ga74
_dbus_header_update_lengths
(
structDBusHeader.html
DBusHeader
*header, int body_len)
Fills in the correct body length.
#ga74
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga76
_dbus_header_set_field_basic
(
structDBusHeader.html
DBusHeader
*header, int field, int type, const void *value)
Sets the value of a field with basic type.
#ga76
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga77
_dbus_header_get_field_basic
(
structDBusHeader.html
DBusHeader
*header, int field, int type, void *value)
Gets the value of a field with basic type.
#ga77
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga78
_dbus_header_get_field_raw
(
structDBusHeader.html
DBusHeader
*header, int field, const
structDBusString.html
DBusString
**str, int *pos)
Gets the raw marshaled data for a field.
#ga78
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga79
_dbus_header_delete_field
(
structDBusHeader.html
DBusHeader
*header, int field)
Deletes a field, if it exists.
#ga79
void
group__DBusMarshal.html#ga80
_dbus_header_toggle_flag
(
structDBusHeader.html
DBusHeader
*header,
group__DBusTypes.html#ga3
dbus_uint32_t
flag,
group__DBusTypes.html#ga2
dbus_bool_t
value)
Toggles a message flag bit, turning on the bit if value = TRUE and flipping it off if value = FALSE.
#ga80
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga81
_dbus_header_get_flag
(
structDBusHeader.html
DBusHeader
*header,
group__DBusTypes.html#ga3
dbus_uint32_t
flag)
Gets a message flag bit, returning TRUE if the bit is set.
#ga81
void
group__DBusMarshal.html#ga82
_dbus_header_byteswap
(
structDBusHeader.html
DBusHeader
*header, int new_order)
Swaps the header into the given order if required.
#ga82
void
group__DBusMarshal.html#ga96
_dbus_type_signature_next
(const char *type_str, int *type_pos)
Skips to the next "complete" type inside a type signature.
#ga96
void
group__DBusMarshal.html#ga104
_dbus_type_reader_init
(
structDBusTypeReader.html
DBusTypeReader
*reader, int byte_order, const
structDBusString.html
DBusString
*type_str, int type_pos, const
structDBusString.html
DBusString
*value_str, int value_pos)
Initializes a type reader.
#ga104
void
group__DBusMarshal.html#ga105
_dbus_type_reader_init_from_mark
(
structDBusTypeReader.html
DBusTypeReader
*reader, int byte_order, const
structDBusString.html
DBusString
*type_str, const
structDBusString.html
DBusString
*value_str, const
structDBusTypeMark.html
DBusTypeMark
*mark)
Initializes a type reader that's been compressed into a
structDBusTypeMark.html
DBusTypeMark
.
#ga105
void
group__DBusMarshal.html#ga106
_dbus_type_reader_init_types_only
(
structDBusTypeReader.html
DBusTypeReader
*reader, const
structDBusString.html
DBusString
*type_str, int type_pos)
Like
group__DBusMarshal.html#ga104
_dbus_type_reader_init()
but the iteration is over the signature, not over values.
#ga106
void
group__DBusMarshal.html#ga107
_dbus_type_reader_init_types_only_from_mark
(
structDBusTypeReader.html
DBusTypeReader
*reader, const
structDBusString.html
DBusString
*type_str, const
structDBusTypeMark.html
DBusTypeMark
*mark)
Like
group__DBusMarshal.html#ga105
_dbus_type_reader_init_from_mark()
but only iterates over the signature, not the values.
#ga107
void
group__DBusMarshal.html#ga108
_dbus_type_reader_save_mark
(const
structDBusTypeReader.html
DBusTypeReader
*reader,
structDBusTypeMark.html
DBusTypeMark
*mark)
Compresses a type reader into a
structDBusTypeMark.html
DBusTypeMark
, useful for example if you want to cache a bunch of positions in a block of values.
#ga108
int
group__DBusMarshal.html#ga109
_dbus_type_reader_get_current_type
(const
structDBusTypeReader.html
DBusTypeReader
*reader)
Gets the type of the value the reader is currently pointing to; or for a types-only reader gets the type it's currently pointing to.
#ga109
int
group__DBusMarshal.html#ga110
_dbus_type_reader_get_element_type
(const
structDBusTypeReader.html
DBusTypeReader
*reader)
Gets the type of an element of the array the reader is currently pointing to.
#ga110
int
group__DBusMarshal.html#ga111
_dbus_type_reader_get_value_pos
(const
structDBusTypeReader.html
DBusTypeReader
*reader)
Gets the current position in the value block.
#ga111
void
group__DBusMarshal.html#ga112
_dbus_type_reader_read_raw
(const
structDBusTypeReader.html
DBusTypeReader
*reader, const unsigned char **value_location)
Get the address of the marshaled value in the data being read.
#ga112
void
group__DBusMarshal.html#ga113
_dbus_type_reader_read_basic
(const
structDBusTypeReader.html
DBusTypeReader
*reader, void *value)
Reads a basic-typed value, as with
group__DBusMarshal.html#ga24
_dbus_marshal_read_basic()
.
#ga113
int
group__DBusMarshal.html#ga114
_dbus_type_reader_get_array_length
(const
structDBusTypeReader.html
DBusTypeReader
*reader)
Returns the number of values remaining in the current array reader.
#ga114
void
group__DBusMarshal.html#ga115
_dbus_type_reader_read_fixed_multi
(const
structDBusTypeReader.html
DBusTypeReader
*reader, void *value, int *n_elements)
Reads a block of fixed-length basic values, from the current point in an array to the end of the array.
#ga115
void
group__DBusMarshal.html#ga116
_dbus_type_reader_recurse
(
structDBusTypeReader.html
DBusTypeReader
*reader,
structDBusTypeReader.html
DBusTypeReader
*sub)
Initialize a new reader pointing to the first type and corresponding value that's a child of the current container.
#ga116
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga117
_dbus_type_reader_next
(
structDBusTypeReader.html
DBusTypeReader
*reader)
Skip to the next value on this "level".
#ga117
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga118
_dbus_type_reader_has_next
(const
structDBusTypeReader.html
DBusTypeReader
*reader)
Check whether there's another value on this "level".
#ga118
void
group__DBusMarshal.html#ga119
_dbus_type_reader_get_signature
(const
structDBusTypeReader.html
DBusTypeReader
*reader, const
structDBusString.html
DBusString
**str_p, int *start_p, int *len_p)
Gets the string and range of said string containing the signature of the current value.
#ga119
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga125
_dbus_type_reader_set_basic
(
structDBusTypeReader.html
DBusTypeReader
*reader, const void *value, const
structDBusTypeReader.html
DBusTypeReader
*realign_root)
Sets a new value for the basic type value pointed to by the reader, leaving the reader valid to continue reading.
#ga125
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga126
_dbus_type_reader_delete
(
structDBusTypeReader.html
DBusTypeReader
*reader, const
structDBusTypeReader.html
DBusTypeReader
*realign_root)
Recursively deletes any value pointed to by the reader, leaving the reader valid to continue reading.
#ga126
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga127
_dbus_type_reader_greater_than
(const
structDBusTypeReader.html
DBusTypeReader
*lhs, const
structDBusTypeReader.html
DBusTypeReader
*rhs)
Compares two readers, which must be iterating over the same value data.
#ga127
void
group__DBusMarshal.html#ga128
_dbus_type_writer_init
(
structDBusTypeWriter.html
DBusTypeWriter
*writer, int byte_order,
structDBusString.html
DBusString
*type_str, int type_pos,
structDBusString.html
DBusString
*value_str, int value_pos)
Initialize a write iterator, which is used to write out values in serialized D-BUS format.
#ga128
void
group__DBusMarshal.html#ga129
_dbus_type_writer_init_types_delayed
(
structDBusTypeWriter.html
DBusTypeWriter
*writer, int byte_order,
structDBusString.html
DBusString
*value_str, int value_pos)
Initialize a write iterator, with the signature to be provided later.
#ga129
void
group__DBusMarshal.html#ga130
_dbus_type_writer_add_types
(
structDBusTypeWriter.html
DBusTypeWriter
*writer,
structDBusString.html
DBusString
*type_str, int type_pos)
Adds type string to the writer, if it had none.
#ga130
void
group__DBusMarshal.html#ga131
_dbus_type_writer_remove_types
(
structDBusTypeWriter.html
DBusTypeWriter
*writer)
Removes type string from the writer.
#ga131
void
group__DBusMarshal.html#ga132
_dbus_type_writer_init_values_only
(
structDBusTypeWriter.html
DBusTypeWriter
*writer, int byte_order, const
structDBusString.html
DBusString
*type_str, int type_pos,
structDBusString.html
DBusString
*value_str, int value_pos)
Like
group__DBusMarshal.html#ga128
_dbus_type_writer_init()
, except the type string passed in should correspond to an existing signature that matches what you're going to write out.
#ga132
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga140
_dbus_type_writer_recurse
(
structDBusTypeWriter.html
DBusTypeWriter
*writer, int container_type, const
structDBusString.html
DBusString
*contained_type, int contained_type_start,
structDBusTypeWriter.html
DBusTypeWriter
*sub)
Opens a new container and writes out the initial information for that container.
#ga140
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga141
_dbus_type_writer_append_array
(
structDBusTypeWriter.html
DBusTypeWriter
*writer, const
structDBusString.html
DBusString
*contained_type, int contained_type_start,
structDBusTypeWriter.html
DBusTypeWriter
*sub)
Append to an existing array.
#ga141
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga143
_dbus_type_writer_unrecurse
(
structDBusTypeWriter.html
DBusTypeWriter
*writer,
structDBusTypeWriter.html
DBusTypeWriter
*sub)
Closes a container created by
group__DBusMarshal.html#ga140
_dbus_type_writer_recurse()
and writes any additional information to the values block.
#ga143
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga144
_dbus_type_writer_write_basic
(
structDBusTypeWriter.html
DBusTypeWriter
*writer, int type, const void *value)
Writes out a basic type.
#ga144
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga145
_dbus_type_writer_write_fixed_multi
(
structDBusTypeWriter.html
DBusTypeWriter
*writer, int element_type, const void *value, int n_elements)
Writes a block of fixed-length basic values, i.e.
#ga145
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga149
_dbus_type_writer_write_reader_partial
(
structDBusTypeWriter.html
DBusTypeWriter
*writer,
structDBusTypeReader.html
DBusTypeReader
*reader, const
structDBusTypeReader.html
DBusTypeReader
*start_after, int start_after_new_pos, int start_after_new_len,
structDBusList.html
DBusList
**fixups)
Iterate through all values in the given reader, writing a copy of each value to the writer.
#ga149
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga150
_dbus_type_writer_write_reader
(
structDBusTypeWriter.html
DBusTypeWriter
*writer,
structDBusTypeReader.html
DBusTypeReader
*reader)
Iterate through all values in the given reader, writing a copy of each value to the writer.
#ga150
void
group__DBusMarshal.html#ga151
_dbus_type_writer_set_enabled
(
structDBusTypeWriter.html
DBusTypeWriter
*writer,
group__DBusTypes.html#ga2
dbus_bool_t
enabled)
If disabled, a writer can still be iterated forward and recursed/unrecursed but won't write any values.
#ga151
DBusValidity
group__DBusMarshal.html#ga152
_dbus_validate_signature_with_reason
(const
structDBusString.html
DBusString
*type_str, int type_pos, int len)
Verifies that the range of type_str from type_pos to type_end is a valid signature.
#ga152
DBusValidity
group__DBusMarshal.html#ga154
_dbus_validate_body_with_reason
(const
structDBusString.html
DBusString
*expected_signature, int expected_signature_start, int byte_order, int *bytes_remaining, const
structDBusString.html
DBusString
*value_str, int value_pos, int len)
Verifies that the range of value_str from value_pos to value_end is a legitimate value of type expected_signature.
#ga154
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga155
_dbus_validate_path
(const
structDBusString.html
DBusString
*str, int start, int len)
Checks that the given range of the string is a valid object path name in the D-BUS protocol.
#ga155
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga156
_dbus_validate_interface
(const
structDBusString.html
DBusString
*str, int start, int len)
Checks that the given range of the string is a valid interface name in the D-BUS protocol.
#ga156
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga157
_dbus_validate_member
(const
structDBusString.html
DBusString
*str, int start, int len)
Checks that the given range of the string is a valid member name in the D-BUS protocol.
#ga157
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga158
_dbus_validate_error_name
(const
structDBusString.html
DBusString
*str, int start, int len)
Checks that the given range of the string is a valid error name in the D-BUS protocol.
#ga158
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga160
_dbus_validate_bus_name
(const
structDBusString.html
DBusString
*str, int start, int len)
Checks that the given range of the string is a valid bus name in the D-BUS protocol.
#ga160
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusMarshal.html#ga161
_dbus_validate_signature
(const
structDBusString.html
DBusString
*str, int start, int len)
Checks that the given range of the string is a valid message type signature in the D-BUS protocol.
#ga161
group__DBusMarshal.html#ga162
DEFINE_DBUS_NAME_CHECK
(path)
define _dbus_check_is_valid_path()
group__DBusMarshal.html#ga163
DEFINE_DBUS_NAME_CHECK
(interface)
define _dbus_check_is_valid_interface()
group__DBusMarshal.html#ga164
DEFINE_DBUS_NAME_CHECK
(member)
define _dbus_check_is_valid_member()
group__DBusMarshal.html#ga165
DEFINE_DBUS_NAME_CHECK
(error_name)
define _dbus_check_is_valid_error_name()
group__DBusMarshal.html#ga166
DEFINE_DBUS_NAME_CHECK
(bus_name)
define _dbus_check_is_valid_bus_name()
group__DBusMarshal.html#ga167
DEFINE_DBUS_NAME_CHECK
(signature)
define _dbus_check_is_valid_signature()
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.
A signature is just a string with multiple types one after the other. for example a type is "i" or "(ii)", a signature is "i(ii)" where i is int and (ii) is struct { int; int; }
Define Documentation
#define VALID_INITIAL_NAME_CHARACTER
(
c
)
Value:
( ((c) >=
'A'
&& (c) <=
'Z'
) ||               \
((c) >=
'a'
&& (c) <=
'z'
) ||               \
((c) ==
'_'
) )
Determine wether the given charater is valid as the first charater in a name.
Definition at line
dbus-marshal-validate_8c-source.html#l00683
683
of file
dbus-marshal-validate_8c-source.html
dbus-marshal-validate.c
.
Referenced by
dbus-marshal-validate_8c-source.html#l00780
_dbus_validate_interface()
, and
dbus-marshal-validate_8c-source.html#l00856
_dbus_validate_member()
.
#define VALID_NAME_CHARACTER
(
c
)
Value:
( ((c) >=
'0'
&& (c) <=
'9'
) ||               \
((c) >=
'A'
&& (c) <=
'Z'
) ||               \
((c) >=
'a'
&& (c) <=
'z'
) ||               \
((c) ==
'_'
) )
Determine wether the given charater is valid as a second or later character in a name.
Definition at line
dbus-marshal-validate_8c-source.html#l00692
692
of file
dbus-marshal-validate_8c-source.html
dbus-marshal-validate.c
.
Referenced by
dbus-marshal-validate_8c-source.html#l00780
_dbus_validate_interface()
,
dbus-marshal-validate_8c-source.html#l00856
_dbus_validate_member()
, and
dbus-marshal-validate_8c-source.html#l00715
_dbus_validate_path()
.
Function Documentation
int _dbus_first_type_in_signature
(
const
structDBusString.html
DBusString
*
str
,
int
pos
)
Get the first type in the signature.
The difference between this and just getting the first byte of the signature is that you won't get DBUS_STRUCT_BEGIN_CHAR, you'll get DBUS_TYPE_STRUCT instead.
Parameters:
str
string containing signature
pos
where the signature starts
Returns:
the first type in the signature
Definition at line
dbus-marshal-basic_8c-source.html#l01504
1504
of file
dbus-marshal-basic_8c-source.html
dbus-marshal-basic.c
.
Referenced by
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#l01019
_dbus_type_reader_read_fixed_multi()
, and
dbus-marshal-recursive_8c-source.html#l01084
_dbus_type_reader_recurse()
.
int _dbus_first_type_in_signature_c_str
(
const char *
str
,
int
pos
)
Similar to
group__DBusMarshal.html#ga46
_dbus_first_type_in_signature
, but operates on a C string buffer.
Parameters:
str
a C string buffer
pos
where the signature starts
Returns:
the first type in the signature
Definition at line
dbus-marshal-basic_8c-source.html#l01519
1519
of file
dbus-marshal-basic_8c-source.html
dbus-marshal-basic.c
.
Referenced by
dbus-signature_8c-source.html#l00077
dbus_signature_iter_get_current_type()
, and
dbus-signature_8c-source.html#l00126
dbus_signature_iter_get_element_type()
.
void _dbus_header_byteswap
(
structDBusHeader.html
DBusHeader
*
header
,
int
new_order
)
Swaps the header into the given order if required.
Parameters:
header
the header
new_order
the new byte order
Definition at line
dbus-marshal-header_8c-source.html#l01466
1466
of file
dbus-marshal-header_8c-source.html
dbus-marshal-header.c
.
References
dbus-marshal-byteswap_8c-source.html#l00220
_dbus_marshal_byteswap()
,
dbus-marshal-header_8h-source.html#l00064
DBusHeader::byte_order
, and
dbus-marshal-header_8h-source.html#l00054
DBusHeader::data
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_header_copy
(
const
structDBusHeader.html
DBusHeader
*
header
,
structDBusHeader.html
DBusHeader
*
dest
)
Initializes dest with a copy of the given header.
Resets the message serial to 0 on the copy.
Parameters:
header
header to copy
dest
destination for copy
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-marshal-header_8c-source.html#l00481
481
of file
dbus-marshal-header_8c-source.html
dbus-marshal-header.c
.
References
dbus-marshal-header_8c-source.html#l00390
_dbus_header_set_serial()
,
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-marshal-header_8h-source.html#l00054
DBusHeader::data
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-message_8c-source.html#l01022
dbus_message_copy()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_header_create
(
structDBusHeader.html
DBusHeader
*
header
,
int
message_type
,
const char *
destination
,
const char *
path
,
const char *
interface
,
const char *
member
,
const char *
error_name
)
Fills in the primary fields of the header, so the header is ready for use.
group__DBusMacros.html#ga4
NULL
may be specified for some or all of the fields to avoid adding those fields. Some combinations of fields don't make sense, and passing them in will trigger an assertion failure.
Parameters:
header
the header
message_type
the message type
destination
destination field or
group__DBusMacros.html#ga4
NULL
path
path field or
group__DBusMacros.html#ga4
NULL
interface
interface field or
group__DBusMacros.html#ga4
NULL
member
member field or
group__DBusMacros.html#ga4
NULL
error_name
error name or
group__DBusMacros.html#ga4
NULL
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-marshal-header_8c-source.html#l00518
518
of file
dbus-marshal-header_8c-source.html
dbus-marshal-header.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string_8c-source.html#l01382
_dbus_string_delete()
,
dbus-marshal-recursive_8c-source.html#l01677
_dbus_type_writer_init_values_only()
,
dbus-marshal-recursive_8c-source.html#l02185
_dbus_type_writer_recurse()
,
dbus-marshal-recursive_8c-source.html#l02255
_dbus_type_writer_unrecurse()
,
dbus-marshal-recursive_8c-source.html#l02387
_dbus_type_writer_write_basic()
,
dbus-marshal-recursive_8h-source.html#l00092
DBusTypeWriter::byte_order
,
dbus-marshal-header_8h-source.html#l00054
DBusHeader::data
,
group__DBusMacros.html#ga3
FALSE
,
dbus-marshal-header_8c-source.html#l00046
FIELDS_ARRAY_SIGNATURE_OFFSET
,
dbus-marshal-header_8c-source.html#l00121
HEADER_END_BEFORE_PADDING
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
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()
, and
dbus-message_8c-source.html#l00874
dbus_message_new_signal()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_header_delete_field
(
structDBusHeader.html
DBusHeader
*
header
,
int
field
)
Deletes a field, if it exists.
Parameters:
header
the header
field
the field to delete
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-marshal-header_8c-source.html#l01386
1386
of file
dbus-marshal-header_8c-source.html
dbus-marshal-header.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-recursive_8c-source.html#l01513
_dbus_type_reader_delete()
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga2
TRUE
.
void _dbus_header_free
(
structDBusHeader.html
DBusHeader
*
header
)
Frees a header.
Parameters:
header
the header
Definition at line
dbus-marshal-header_8c-source.html#l00467
467
of file
dbus-marshal-header_8c-source.html
dbus-marshal-header.c
.
References
dbus-string_8c-source.html#l00261
_dbus_string_free()
, and
dbus-marshal-header_8h-source.html#l00054
DBusHeader::data
.
Referenced by
dbus-message_8c-source.html#l01022
dbus_message_copy()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_header_get_field_basic
(
structDBusHeader.html
DBusHeader
*
header
,
int
field
,
int
type
,
void *
value
)
Gets the value of a field with basic type.
If the field doesn't exist, returns
group__DBusMacros.html#ga3
FALSE
, otherwise returns
group__DBusMacros.html#ga2
TRUE
.
Parameters:
header
the header
field
the field to get
type
the type of the value
value
the value as for
group__DBusMarshal.html#ga24
_dbus_marshal_read_basic()
Returns:
group__DBusMacros.html#ga3
FALSE
if the field doesn't exist
Definition at line
dbus-marshal-header_8c-source.html#l01321
1321
of file
dbus-marshal-header_8c-source.html
dbus-marshal-header.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-basic_8c-source.html#l00503
_dbus_marshal_read_basic()
,
dbus-marshal-header_8c-source.html#l00088
EXPECTED_TYPE_OF_FIELD
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-message_8c-source.html#l02743
dbus_message_get_destination()
,
dbus-message_8c-source.html#l02696
dbus_message_get_error_name()
,
dbus-message_8c-source.html#l02539
dbus_message_get_interface()
,
dbus-message_8c-source.html#l02619
dbus_message_get_member()
,
dbus-message_8c-source.html#l02419
dbus_message_get_path()
,
dbus-message_8c-source.html#l00419
dbus_message_get_reply_serial()
, and
dbus-message_8c-source.html#l02789
dbus_message_get_sender()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_header_get_field_raw
(
structDBusHeader.html
DBusHeader
*
header
,
int
field
,
const
structDBusString.html
DBusString
**
str
,
int *
pos
)
Gets the raw marshaled data for a field.
If the field doesn't exist, returns
group__DBusMacros.html#ga3
FALSE
, otherwise returns
group__DBusMacros.html#ga2
TRUE
. Returns the start of the marshaled data, i.e. usually the byte where the length starts (for strings and arrays) or for basic types just the value itself.
Parameters:
header
the header
field
the field to get
str
return location for the data string
pos
return location for start of field value
Returns:
group__DBusMacros.html#ga3
FALSE
if the field doesn't exist
Definition at line
dbus-marshal-header_8c-source.html#l01362
1362
of file
dbus-marshal-header_8c-source.html
dbus-marshal-header.c
.
References
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_header_get_flag
(
structDBusHeader.html
DBusHeader
*
header
,
group__DBusTypes.html#ga3
dbus_uint32_t
flag
)
Gets a message flag bit, returning TRUE if the bit is set.
Parameters:
header
the header
flag
the message flag to get
Returns:
group__DBusMacros.html#ga2
TRUE
if the flag is set
Definition at line
dbus-marshal-header_8c-source.html#l01449
1449
of file
dbus-marshal-header_8c-source.html
dbus-marshal-header.c
.
References
dbus-marshal-header_8h-source.html#l00054
DBusHeader::data
, and
dbus-marshal-header_8c-source.html#l00056
FLAGS_OFFSET
.
Referenced by
dbus-message_8c-source.html#l02376
dbus_message_get_auto_start()
, and
dbus-message_8c-source.html#l02338
dbus_message_get_no_reply()
.
int _dbus_header_get_message_type
(
structDBusHeader.html
DBusHeader
*
header
)
Gets the type of the message.
Parameters:
header
the header
Returns:
the type
Definition at line
dbus-marshal-header_8c-source.html#l00372
372
of file
dbus-marshal-header_8c-source.html
dbus-marshal-header.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-header_8h-source.html#l00054
DBusHeader::data
, and
dbus-marshal-header_8c-source.html#l00054
TYPE_OFFSET
.
Referenced by
dbus-message_8c-source.html#l01129
dbus_message_get_type()
.
group__DBusTypes.html#ga3
dbus_uint32_t
_dbus_header_get_serial
(
structDBusHeader.html
DBusHeader
*
header
)
See
group__DBusMessage.html#ga3
dbus_message_get_serial()
.
Parameters:
header
the header
Returns:
the client serial
Definition at line
dbus-marshal-header_8c-source.html#l00413
413
of file
dbus-marshal-header_8c-source.html
dbus-marshal-header.c
.
References
dbus-marshal-basic_8c-source.html#l00465
_dbus_marshal_read_uint32()
,
dbus-marshal-header_8h-source.html#l00064
DBusHeader::byte_order
,
dbus-marshal-header_8h-source.html#l00054
DBusHeader::data
,
group__DBusMacros.html#ga4
NULL
, and
dbus-marshal-header_8c-source.html#l00062
SERIAL_OFFSET
.
Referenced by
dbus-marshal-header_8c-source.html#l00390
_dbus_header_set_serial()
, and
dbus-message_8c-source.html#l00384
dbus_message_get_serial()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_header_have_message_untrusted
(
int
max_message_length
,
DBusValidity *
validity
,
int *
byte_order
,
int *
fields_array_len
,
int *
header_len
,
int *
body_len
,
const
structDBusString.html
DBusString
*
str
,
int
start
,
int
len
)
Given data long enough to contain the length of the message body and the fields array, check whether the data is long enough to contain the entire message (assuming the claimed lengths are accurate).
Also checks that the lengths are in sanity parameters.
Parameters:
max_message_length
maximum length of a valid message
validity
return location for why the data is invalid if it is
byte_order
return location for byte order
fields_array_len
return location for claimed fields array length
header_len
return location for claimed header length
body_len
return location for claimed body length
str
the data
start
start of data, 8-aligned
len
length of data
Returns:
group__DBusMacros.html#ga2
TRUE
if the data is long enough for the claimed length, and the lengths were valid
Definition at line
dbus-marshal-header_8c-source.html#l00660
660
of file
dbus-marshal-header_8c-source.html
dbus-marshal-header.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8h-source.html#l00190
_DBUS_INT32_MAX
,
dbus-marshal-basic_8c-source.html#l00465
_dbus_marshal_read_uint32()
,
dbus-marshal-header_8c-source.html#l00060
BODY_LENGTH_OFFSET
,
dbus-marshal-header_8c-source.html#l00052
BYTE_ORDER_OFFSET
,
group__DBusMacros.html#ga3
FALSE
,
dbus-marshal-header_8c-source.html#l00064
FIELDS_ARRAY_LENGTH_OFFSET
,
dbus-marshal-header_8c-source.html#l00066
FIRST_FIELD_OFFSET
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-message_8c-source.html#l03411
_dbus_message_loader_queue_messages()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_header_init
(
structDBusHeader.html
DBusHeader
*
header
,
int
byte_order
)
Initializes a header, but doesn't prepare it for use; to make the header valid, you have to call
group__DBusMarshal.html#ga69
_dbus_header_create()
.
Parameters:
header
header to initialize
byte_order
byte order of the header
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-marshal-header_8c-source.html#l00450
450
of file
dbus-marshal-header_8c-source.html
dbus-marshal-header.c
.
References
dbus-marshal-header_8c-source.html#l00430
_dbus_header_reinit()
,
dbus-string_8c-source.html#l00130
_dbus_string_init_preallocated()
,
dbus-marshal-header_8h-source.html#l00054
DBusHeader::data
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_header_load
(
structDBusHeader.html
DBusHeader
*
header
,
DBusValidationMode
mode
,
DBusValidity *
validity
,
int
byte_order
,
int
fields_array_len
,
int
header_len
,
int
body_len
,
const
structDBusString.html
DBusString
*
str
,
int
start
,
int
len
)
Creates a message header from potentially-untrusted data.
The return value is
group__DBusMacros.html#ga2
TRUE
if there was enough memory and the data was valid. If it returns
group__DBusMacros.html#ga2
TRUE
, the header will be created. If it returns
group__DBusMacros.html#ga3
FALSE
and *validity == DBUS_VALIDITY_UNKNOWN_OOM_ERROR, then there wasn't enough memory. If it returns
group__DBusMacros.html#ga3
FALSE
and *validity != DBUS_VALIDITY_UNKNOWN_OOM_ERROR then the data was invalid.
The byte_order, fields_array_len, and body_len args should be from
group__DBusMarshal.html#ga70
_dbus_header_have_message_untrusted()
. Validation performed in
group__DBusMarshal.html#ga70
_dbus_header_have_message_untrusted()
is assumed to have been already done.
Parameters:
header
the header (must be initialized)
mode
whether to do validation
validity
return location for invalidity reason
byte_order
byte order from header
fields_array_len
claimed length of fields array
body_len
claimed length of body
header_len
claimed length of header
str
a string
start
start of header, 8-aligned
len
length of string to look at
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory or data was invalid,
group__DBusMacros.html#ga2
TRUE
otherwise
Definition at line
dbus-marshal-header_8c-source.html#l00952
952
of file
dbus-marshal-header_8c-source.html
dbus-marshal-header.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string_8c-source.html#l01567
_dbus_string_copy_len()
,
dbus-string_8c-source.html#l00853
_dbus_string_set_length()
,
dbus-string_8c-source.html#l02638
_dbus_string_validate_nul()
,
dbus-marshal-recursive_8c-source.html#l00881
_dbus_type_reader_get_current_type()
,
dbus-marshal-recursive_8c-source.html#l00933
_dbus_type_reader_get_value_pos()
,
dbus-marshal-recursive_8c-source.html#l00739
_dbus_type_reader_init()
,
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#l01084
_dbus_type_reader_recurse()
,
dbus-marshal-validate_8c-source.html#l00633
_dbus_validate_body_with_reason()
,
dbus-marshal-header_8c-source.html#l00060
BODY_LENGTH_OFFSET
,
dbus-marshal-header_8h-source.html#l00064
DBusHeader::byte_order
,
dbus-marshal-header_8c-source.html#l00052
BYTE_ORDER_OFFSET
,
dbus-marshal-header_8h-source.html#l00054
DBusHeader::data
,
group__DBusMacros.html#ga3
FALSE
,
dbus-marshal-header_8h-source.html#l00059
DBusHeader::fields
,
dbus-marshal-header_8c-source.html#l00064
FIELDS_ARRAY_LENGTH_OFFSET
,
dbus-marshal-header_8c-source.html#l00066
FIRST_FIELD_OFFSET
,
dbus-marshal-header_8c-source.html#l00056
FLAGS_OFFSET
,
dbus-marshal-header_8h-source.html#l00063
DBusHeader::padding
,
dbus-marshal-header_8c-source.html#l00062
SERIAL_OFFSET
,
group__DBusMacros.html#ga2
TRUE
,
dbus-marshal-header_8c-source.html#l00054
TYPE_OFFSET
,
dbus-marshal-header_8h-source.html#l00046
DBusHeaderField::value_pos
, and
dbus-marshal-header_8c-source.html#l00058
VERSION_OFFSET
.
void _dbus_header_reinit
(
structDBusHeader.html
DBusHeader
*
header
,
int
byte_order
)
Re-initializes a header that was previously initialized and never freed.
After this, to make the header valid you have to call
group__DBusMarshal.html#ga69
_dbus_header_create()
.
Parameters:
header
header to re-initialize
byte_order
byte order of the header
Definition at line
dbus-marshal-header_8c-source.html#l00430
430
of file
dbus-marshal-header_8c-source.html
dbus-marshal-header.c
.
References
dbus-string_8c-source.html#l00853
_dbus_string_set_length()
,
dbus-marshal-header_8h-source.html#l00064
DBusHeader::byte_order
,
dbus-marshal-header_8h-source.html#l00054
DBusHeader::data
, and
dbus-marshal-header_8h-source.html#l00063
DBusHeader::padding
.
Referenced by
dbus-marshal-header_8c-source.html#l00450
_dbus_header_init()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_header_set_field_basic
(
structDBusHeader.html
DBusHeader
*
header
,
int
field
,
int
type
,
const void *
value
)
Sets the value of a field with basic type.
If the value is a string value, it isn't allowed to be
group__DBusMacros.html#ga4
NULL
. If the field doesn't exist, it will be created.
Parameters:
header
the header
field
the field to set
type
the type of the value
value
the value as for
group__DBusMarshal.html#ga22
_dbus_marshal_set_basic()
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-marshal-header_8c-source.html#l01243
1243
of file
dbus-marshal-header_8c-source.html
dbus-marshal-header.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8h-source.html#l00112
_dbus_assert_not_reached
,
dbus-marshal-recursive_8c-source.html#l02219
_dbus_type_writer_append_array()
,
dbus-marshal-recursive_8c-source.html#l01677
_dbus_type_writer_init_values_only()
,
dbus-marshal-recursive_8c-source.html#l02255
_dbus_type_writer_unrecurse()
,
dbus-marshal-recursive_8h-source.html#l00092
DBusTypeWriter::byte_order
,
group__DBusMacros.html#ga3
FALSE
,
dbus-marshal-header_8c-source.html#l00048
FIELDS_ARRAY_ELEMENT_SIGNATURE_OFFSET
,
dbus-marshal-header_8c-source.html#l00064
FIELDS_ARRAY_LENGTH_OFFSET
,
dbus-marshal-header_8c-source.html#l00046
FIELDS_ARRAY_SIGNATURE_OFFSET
,
dbus-marshal-header_8c-source.html#l00066
FIRST_FIELD_OFFSET
,
dbus-marshal-header_8c-source.html#l00121
HEADER_END_BEFORE_PADDING
,
group__DBusMacros.html#ga2
TRUE
,
structDBusTypeWriter.html#o12
DBusTypeWriter::u
, and
dbus-marshal-recursive_8h-source.html#l00103
DBusTypeWriter::value_pos
.
Referenced by
dbus-message_8c-source.html#l00400
dbus_message_set_reply_serial()
.
void _dbus_header_set_serial
(
structDBusHeader.html
DBusHeader
*
header
,
group__DBusTypes.html#ga3
dbus_uint32_t
serial
)
Sets the serial number of a header.
This can only be done once on a header.
Parameters:
header
the header
serial
the serial
Definition at line
dbus-marshal-header_8c-source.html#l00390
390
of file
dbus-marshal-header_8c-source.html
dbus-marshal-header.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-header_8c-source.html#l00413
_dbus_header_get_serial()
,
dbus-marshal-basic_8c-source.html#l00265
_dbus_marshal_set_uint32()
, and
dbus-marshal-header_8c-source.html#l00062
SERIAL_OFFSET
.
Referenced by
dbus-marshal-header_8c-source.html#l00481
_dbus_header_copy()
, and
dbus-message_8c-source.html#l00162
_dbus_message_set_serial()
.
void _dbus_header_toggle_flag
(
structDBusHeader.html
DBusHeader
*
header
,
group__DBusTypes.html#ga3
dbus_uint32_t
flag
,
group__DBusTypes.html#ga2
dbus_bool_t
value
)
Toggles a message flag bit, turning on the bit if value = TRUE and flipping it off if value = FALSE.
Parameters:
header
the header
flag
the message flag to toggle
value
toggle on or off
Definition at line
dbus-marshal-header_8c-source.html#l01427
1427
of file
dbus-marshal-header_8c-source.html
dbus-marshal-header.c
.
References
dbus-string_8c-source.html#l00456
_dbus_string_get_data_len()
,
dbus-marshal-header_8h-source.html#l00054
DBusHeader::data
, and
dbus-marshal-header_8c-source.html#l00056
FLAGS_OFFSET
.
Referenced by
dbus-message_8c-source.html#l02357
dbus_message_set_auto_start()
, and
dbus-message_8c-source.html#l02319
dbus_message_set_no_reply()
.
void _dbus_header_update_lengths
(
structDBusHeader.html
DBusHeader
*
header
,
int
body_len
)
Fills in the correct body length.
Parameters:
header
the header
body_len
the length of the body
Definition at line
dbus-marshal-header_8c-source.html#l01179
1179
of file
dbus-marshal-header_8c-source.html
dbus-marshal-header.c
.
References
dbus-marshal-basic_8c-source.html#l00265
_dbus_marshal_set_uint32()
,
dbus-marshal-header_8c-source.html#l00060
BODY_LENGTH_OFFSET
,
dbus-marshal-header_8h-source.html#l00064
DBusHeader::byte_order
, and
dbus-marshal-header_8h-source.html#l00054
DBusHeader::data
.
Referenced by
dbus-message_8c-source.html#l00277
_dbus_message_lock()
.
void _dbus_marshal_byteswap
(
const
structDBusString.html
DBusString
*
signature
,
int
signature_start
,
int
old_byte_order
,
int
new_byte_order
,
structDBusString.html
DBusString
*
value_str
,
int
value_pos
)
Byteswaps the marshaled data in the given value_str.
Parameters:
signature
the types in the value_str
signature_start
where in signature is the signature
old_byte_order
the old byte order
new_byte_order
the new byte order
value_str
the string containing the body
value_pos
where the values start
Definition at line
dbus-marshal-byteswap_8c-source.html#l00220
220
of file
dbus-marshal-byteswap_8c-source.html
dbus-marshal-byteswap.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-string_8c-source.html#l00456
_dbus_string_get_data_len()
,
dbus-marshal-recursive_8c-source.html#l00802
_dbus_type_reader_init_types_only()
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-marshal-header_8c-source.html#l01466
_dbus_header_byteswap()
.
void _dbus_marshal_read_basic
(
const
structDBusString.html
DBusString
*
str
,
int
pos
,
int
type
,
void *
value
,
int
byte_order
,
int *
new_pos
)
Demarshals a basic-typed value.
The "value" pointer is always the address of a variable of the basic type. So e.g. if the basic type is "double" then the pointer is a double*, and if it's "char*" then the pointer is a "char**".
A value of type
unionDBusBasicValue.html
DBusBasicValue
is guaranteed to be large enough to hold any of the types that may be returned, which is handy if you are trying to do things generically. For example you can pass a DBusBasicValue* in to this function, and then pass the same DBusBasicValue* in to _dbus_marshal_basic_type() in order to move a value from one place to another.
Parameters:
str
the string containing the data
pos
position in the string
type
type of value to demarshal
value
pointer to return value data
byte_order
the byte order
new_pos
pointer to update with new position, or
group__DBusMacros.html#ga4
NULL
Definition at line
dbus-marshal-basic_8c-source.html#l00503
503
of file
dbus-marshal-basic_8c-source.html
dbus-marshal-basic.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8h-source.html#l00112
_dbus_assert_not_reached
,
dbus-marshal-basic_8c-source.html#l00465
_dbus_marshal_read_uint32()
,
dbus-marshal-basic_8c-source.html#l01308
_dbus_type_to_string()
,
dbus-internals_8c-source.html#l00203
_dbus_warn()
,
dbus-marshal-basic_8h-source.html#l00167
DBusBasicValue::byt
,
dbus-signature_8c-source.html#l00285
dbus_type_is_basic()
,
dbus-marshal-basic_8h-source.html#l00168
DBusBasicValue::str
,
dbus-marshal-basic_8h-source.html#l00157
DBusBasicValue::u16
,
dbus-marshal-basic_8h-source.html#l00159
DBusBasicValue::u32
, and
dbus-marshal-basic_8h-source.html#l00162
DBusBasicValue::u64
.
Referenced by
dbus-marshal-header_8c-source.html#l01321
_dbus_header_get_field_basic()
, and
dbus-marshal-recursive_8c-source.html#l00965
_dbus_type_reader_read_basic()
.
void _dbus_marshal_read_fixed_multi
(
const
structDBusString.html
DBusString
*
str
,
int
pos
,
int
element_type
,
void *
value
,
int
n_elements
,
int
byte_order
,
int *
new_pos
)
Reads a block of fixed-length basic values, as an optimization vs.
reading each one individually into a new buffer.
This function returns the data in-place; it does not make a copy, and it does not swap the bytes.
If you ask for DBUS_TYPE_DOUBLE you will get a "const double*" back and the "value" argument should be a "const double**" and so on.
todo.html#_todo000026
Todo:
we aren't using this function (except in the test suite)
Parameters:
str
the string to read from
pos
position to read from
element_type
type of array elements
value
place to return the array
n_elements
number of array elements to read
byte_order
the byte order, used to read the array length
new_pos
group__DBusMacros.html#ga4
NULL
or location to store a position after the elements
Definition at line
dbus-marshal-basic_8c-source.html#l00612
612
of file
dbus-marshal-basic_8c-source.html
dbus-marshal-basic.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-basic_8c-source.html#l01226
_dbus_type_get_alignment()
,
dbus-marshal-basic_8c-source.html#l01308
_dbus_type_to_string()
,
dbus-signature_8c-source.html#l00285
dbus_type_is_basic()
, and
dbus-signature_8c-source.html#l00307
dbus_type_is_fixed()
.
group__DBusTypes.html#ga3
dbus_uint32_t
_dbus_marshal_read_uint32
(
const
structDBusString.html
DBusString
*
str
,
int
pos
,
int
byte_order
,
int *
new_pos
)
Convenience function to demarshal 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
dbus-marshal-basic_8c-source.html#l00465
465
of file
dbus-marshal-basic_8c-source.html
dbus-marshal-basic.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
.
Referenced by
dbus-marshal-header_8c-source.html#l00413
_dbus_header_get_serial()
,
dbus-marshal-header_8c-source.html#l00660
_dbus_header_have_message_untrusted()
,
dbus-marshal-basic_8c-source.html#l00503
_dbus_marshal_read_basic()
,
dbus-marshal-basic_8c-source.html#l01198
_dbus_marshal_skip_array()
, and
dbus-marshal-basic_8c-source.html#l01131
_dbus_marshal_skip_basic()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_marshal_set_basic
(
structDBusString.html
DBusString
*
str
,
int
pos
,
int
type
,
const void *
value
,
int
byte_order
,
int *
old_end_pos
,
int *
new_end_pos
)
Sets an existing basic type value to a new value.
Arguments work the same way as _dbus_marshal_basic_type().
Parameters:
str
the string
pos
location of the current value
type
the type of the current and new values
value
the address of the new value
byte_order
byte order for marshaling
old_end_pos
location to store end position of the old value, or
group__DBusMacros.html#ga4
NULL
new_end_pos
location to store end position of the new value, or
group__DBusMacros.html#ga4
NULL
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-marshal-basic_8c-source.html#l00382
382
of file
dbus-marshal-basic_8c-source.html
dbus-marshal-basic.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8h-source.html#l00112
_dbus_assert_not_reached
,
dbus-marshal-basic_8h-source.html#l00167
DBusBasicValue::byt
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
,
dbus-marshal-basic_8h-source.html#l00168
DBusBasicValue::str
,
group__DBusMacros.html#ga2
TRUE
,
dbus-marshal-basic_8h-source.html#l00157
DBusBasicValue::u16
, and
dbus-marshal-basic_8h-source.html#l00159
DBusBasicValue::u32
.
void _dbus_marshal_set_uint32
(
structDBusString.html
DBusString
*
str
,
int
pos
,
group__DBusTypes.html#ga3
dbus_uint32_t
value
,
int
byte_order
)
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
pos
the byte offset where int should be written
value
the value
byte_order
the byte order to use
Definition at line
dbus-marshal-basic_8c-source.html#l00265
265
of file
dbus-marshal-basic_8c-source.html
dbus-marshal-basic.c
.
Referenced by
dbus-marshal-header_8c-source.html#l00390
_dbus_header_set_serial()
,
dbus-marshal-header_8c-source.html#l01179
_dbus_header_update_lengths()
, and
dbus-marshal-recursive_8c-source.html#l02255
_dbus_type_writer_unrecurse()
.
void _dbus_marshal_skip_array
(
const
structDBusString.html
DBusString
*
str
,
int
element_type
,
int
byte_order
,
int *
pos
)
Skips an array, returning the next position.
Parameters:
str
the string containing the data
element_type
the type of array elements
byte_order
the byte order
pos
pointer to position in the string, updated on return to new position
Definition at line
dbus-marshal-basic_8c-source.html#l01198
1198
of file
dbus-marshal-basic_8c-source.html
dbus-marshal-basic.c
.
References
dbus-marshal-basic_8c-source.html#l00465
_dbus_marshal_read_uint32()
, and
dbus-marshal-basic_8c-source.html#l01226
_dbus_type_get_alignment()
.
void _dbus_marshal_skip_basic
(
const
structDBusString.html
DBusString
*
str
,
int
type
,
int
byte_order
,
int *
pos
)
Skips over a basic-typed value, reporting the following position.
Parameters:
str
the string containing the data
type
type of value to read
byte_order
the byte order
pos
pointer to position in the string, updated on return to new position
Definition at line
dbus-marshal-basic_8c-source.html#l01131
1131
of file
dbus-marshal-basic_8c-source.html
dbus-marshal-basic.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8h-source.html#l00112
_dbus_assert_not_reached
,
dbus-marshal-basic_8c-source.html#l00465
_dbus_marshal_read_uint32()
,
dbus-marshal-basic_8c-source.html#l01308
_dbus_type_to_string()
, and
dbus-internals_8c-source.html#l00203
_dbus_warn()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_marshal_write_basic
(
structDBusString.html
DBusString
*
str
,
int
insert_at
,
int
type
,
const void *
value
,
int
byte_order
,
int *
pos_after
)
Marshals a basic-typed value.
The "value" pointer is always the address of a variable containing the basic type value. So for example for int32 it will be dbus_int32_t*, and for string it will be const char**. This is for symmetry with
group__DBusMarshal.html#ga24
_dbus_marshal_read_basic()
and to have a simple consistent rule.
Parameters:
str
string to marshal to
insert_at
where to insert the value
type
type of value
value
pointer to a variable containing the value
byte_order
byte order
pos_after
group__DBusMacros.html#ga4
NULL
or the position after the type
Returns:
group__DBusMacros.html#ga2
TRUE
on success
Definition at line
dbus-marshal-basic_8c-source.html#l00844
844
of file
dbus-marshal-basic_8c-source.html
dbus-marshal-basic.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8h-source.html#l00112
_dbus_assert_not_reached
,
dbus-string_8c-source.html#l00580
_dbus_string_insert_byte()
,
dbus-marshal-basic_8h-source.html#l00167
DBusBasicValue::byt
,
dbus-signature_8c-source.html#l00285
dbus_type_is_basic()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
,
dbus-marshal-basic_8h-source.html#l00168
DBusBasicValue::str
,
group__DBusMacros.html#ga2
TRUE
,
dbus-marshal-basic_8h-source.html#l00157
DBusBasicValue::u16
, and
dbus-marshal-basic_8h-source.html#l00159
DBusBasicValue::u32
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_marshal_write_fixed_multi
(
structDBusString.html
DBusString
*
str
,
int
insert_at
,
int
element_type
,
const void *
value
,
int
n_elements
,
int
byte_order
,
int *
pos_after
)
Marshals a block of values of fixed-length type all at once, as an optimization.
group__DBusSignature.html#ga10
dbus_type_is_fixed()
returns
group__DBusMacros.html#ga2
TRUE
for fixed-length types, which are the basic types minus the string-like types.
The value argument should be the adddress of an array, so e.g. "const dbus_uint32_t**"
Parameters:
str
string to marshal to
insert_at
where to insert the value
element_type
type of array elements
value
address of an array to marshal
n_elements
number of elements in the array
byte_order
byte order
pos_after
group__DBusMacros.html#ga4
NULL
or the position after the type
Returns:
group__DBusMacros.html#ga2
TRUE
on success
Definition at line
dbus-marshal-basic_8c-source.html#l01073
1073
of file
dbus-marshal-basic_8c-source.html
dbus-marshal-basic.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8h-source.html#l00112
_dbus_assert_not_reached
,
dbus-marshal-basic_8c-source.html#l01308
_dbus_type_to_string()
,
dbus-signature_8c-source.html#l00307
dbus_type_is_fixed()
, and
group__DBusMacros.html#ga3
FALSE
.
Referenced by
dbus-marshal-recursive_8c-source.html#l02435
_dbus_type_writer_write_fixed_multi()
.
void _dbus_pack_uint32
(
group__DBusTypes.html#ga3
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
dbus-marshal-basic_8c-source.html#l00098
98
of file
dbus-marshal-basic_8c-source.html
dbus-marshal-basic.c
.
void _dbus_swap_array
(
unsigned char *
data
,
int
n_elements
,
int
alignment
)
Swaps the elements of an array to the opposite byte order.
Parameters:
data
start of array
n_elements
number of elements
alignment
size of each element
Definition at line
dbus-marshal-basic_8c-source.html#l00937
937
of file
dbus-marshal-basic_8c-source.html
dbus-marshal-basic.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
.
int _dbus_type_get_alignment
(
int
typecode
)
Gets the alignment requirement for the given type; will be 1, 4, or 8.
Parameters:
typecode
the type
Returns:
alignment of 1, 4, or 8
Definition at line
dbus-marshal-basic_8c-source.html#l01226
1226
of file
dbus-marshal-basic_8c-source.html
dbus-marshal-basic.c
.
References
dbus-internals_8h-source.html#l00112
_dbus_assert_not_reached
.
Referenced by
dbus-marshal-basic_8c-source.html#l00612
_dbus_marshal_read_fixed_multi()
,
dbus-marshal-basic_8c-source.html#l01198
_dbus_marshal_skip_array()
,
dbus-marshal-recursive_8c-source.html#l01019
_dbus_type_reader_read_fixed_multi()
, and
dbus-message_8c-source.html#l02175
dbus_message_iter_append_fixed_array()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_type_is_valid
(
int
typecode
)
Return
group__DBusMacros.html#ga2
TRUE
if the typecode is a valid typecode.
DBUS_TYPE_INVALID surprisingly enough is not considered valid, and random unknown bytes aren't either. This function is safe with untrusted data.
Returns:
group__DBusMacros.html#ga2
TRUE
if valid
Definition at line
dbus-marshal-basic_8c-source.html#l01274
1274
of file
dbus-marshal-basic_8c-source.html
dbus-marshal-basic.c
.
References
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-signature_8c-source.html#l00285
dbus_type_is_basic()
, and
dbus-signature_8c-source.html#l00263
dbus_type_is_container()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_type_reader_delete
(
structDBusTypeReader.html
DBusTypeReader
*
reader
,
const
structDBusTypeReader.html
DBusTypeReader
*
realign_root
)
Recursively deletes any value pointed to by the reader, leaving the reader valid to continue reading.
Any other readers will be invalidated.
The provided realign_root is the reader to start from when realigning the data that follows the newly-set value. See
group__DBusMarshal.html#ga125
_dbus_type_reader_set_basic()
for more details on the realign_root paramter.
todo.html#_todo000030
Todo:
for now this does not delete the typecodes associated with the value, so this function should only be used for array elements.
Parameters:
reader
reader indicating where to delete a value
realign_root
realign from here
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-marshal-recursive_8c-source.html#l01513
1513
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
group__DBusMacros.html#ga3
FALSE
,
dbus-marshal-recursive_8h-source.html#l00078
DBusTypeReader::klass
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-marshal-header_8c-source.html#l01386
_dbus_header_delete_field()
.
int _dbus_type_reader_get_array_length
(
const
structDBusTypeReader.html
DBusTypeReader
*
reader
)
Returns the number of values remaining in the current array reader.
Parameters:
reader
the reader to read from
Returns:
the number of elements remaining in the array
Definition at line
dbus-marshal-recursive_8c-source.html#l00995
995
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-recursive_8h-source.html#l00078
DBusTypeReader::klass
, and
dbus-marshal-recursive_8c-source.html#l00116
DBusTypeReaderClass::types_only
.
Referenced by
dbus-message_8c-source.html#l01705
dbus_message_iter_get_array_len()
.
int _dbus_type_reader_get_current_type
(
const
structDBusTypeReader.html
DBusTypeReader
*
reader
)
Gets the type of the value the reader is currently pointing to; or for a types-only reader gets the type it's currently pointing to.
If the reader is at the end of a block or end of a container such as an array, returns DBUS_TYPE_INVALID.
Parameters:
reader
the reader
Definition at line
dbus-marshal-recursive_8c-source.html#l00881
881
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-basic_8c-source.html#l01504
_dbus_first_type_in_signature()
,
dbus-marshal-basic_8c-source.html#l01308
_dbus_type_to_string()
,
structDBusTypeReaderClass.html#o4
DBusTypeReaderClass::check_finished
,
dbus-marshal-recursive_8h-source.html#l00069
DBusTypeReader::finished
,
dbus-marshal-recursive_8h-source.html#l00078
DBusTypeReader::klass
,
dbus-marshal-recursive_8h-source.html#l00074
DBusTypeReader::type_pos
, and
dbus-marshal-recursive_8h-source.html#l00073
DBusTypeReader::type_str
.
Referenced by
dbus-marshal-header_8c-source.html#l00952
_dbus_header_load()
,
dbus-message_8c-source.html#l01760
_dbus_message_iter_get_args_valist()
,
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#l01456
_dbus_type_reader_set_basic()
,
dbus-message_8c-source.html#l01556
dbus_message_iter_get_arg_type()
,
dbus-message_8c-source.html#l01732
dbus_message_iter_get_fixed_array()
, and
dbus-message_8c-source.html#l01434
dbus_message_iter_init()
.
int _dbus_type_reader_get_element_type
(
const
structDBusTypeReader.html
DBusTypeReader
*
reader
)
Gets the type of an element of the array the reader is currently pointing to.
It's an error to call this if
group__DBusMarshal.html#ga109
_dbus_type_reader_get_current_type()
doesn't return DBUS_TYPE_ARRAY for this reader.
Parameters:
reader
the reader
Definition at line
dbus-marshal-recursive_8c-source.html#l00916
916
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-basic_8c-source.html#l01504
_dbus_first_type_in_signature()
, and
dbus-marshal-recursive_8c-source.html#l00881
_dbus_type_reader_get_current_type()
.
Referenced by
dbus-message_8c-source.html#l01760
_dbus_message_iter_get_args_valist()
, and
dbus-message_8c-source.html#l01575
dbus_message_iter_get_element_type()
.
void _dbus_type_reader_get_signature
(
const
structDBusTypeReader.html
DBusTypeReader
*
reader
,
const
structDBusString.html
DBusString
**
str_p
,
int *
start_p
,
int *
len_p
)
Gets the string and range of said string containing the signature of the current value.
Essentially a more complete version of
group__DBusMarshal.html#ga109
_dbus_type_reader_get_current_type()
(returns the full type rather than only the outside of the onion).
Note though that the first byte in a struct signature is DBUS_STRUCT_BEGIN_CHAR while the current type will be DBUS_TYPE_STRUCT so it isn't true that the first byte of the signature is always the same as the current type. Another difference is that this function will still return a signature when inside an empty array; say you recurse into empty array of int32, the signature is "i" but the current type will always be DBUS_TYPE_INVALID since there are no elements to be currently pointing to.
Parameters:
reader
the reader
str_p
place to return the string with the type in it
start_p
place to return start of the type
len_p
place to return the length of the type
Definition at line
dbus-marshal-recursive_8c-source.html#l01218
1218
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-marshal-recursive_8h-source.html#l00074
DBusTypeReader::type_pos
, and
dbus-marshal-recursive_8h-source.html#l00073
DBusTypeReader::type_str
.
Referenced by
dbus-message_8c-source.html#l01625
dbus_message_iter_get_signature()
.
int _dbus_type_reader_get_value_pos
(
const
structDBusTypeReader.html
DBusTypeReader
*
reader
)
Gets the current position in the value block.
Parameters:
reader
the reader
Definition at line
dbus-marshal-recursive_8c-source.html#l00933
933
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-marshal-recursive_8h-source.html#l00076
DBusTypeReader::value_pos
.
Referenced by
dbus-marshal-header_8c-source.html#l00952
_dbus_header_load()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_type_reader_greater_than
(
const
structDBusTypeReader.html
DBusTypeReader
*
lhs
,
const
structDBusTypeReader.html
DBusTypeReader
*
rhs
)
Compares two readers, which must be iterating over the same value data.
Returns
group__DBusMacros.html#ga2
TRUE
if the first parameter is further along than the second parameter.
Parameters:
lhs
left-hand-side (first) parameter
rhs
left-hand-side (first) parameter
Returns:
whether lhs is greater than rhs
Definition at line
dbus-marshal-recursive_8c-source.html#l01548
1548
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-recursive_8h-source.html#l00076
DBusTypeReader::value_pos
, and
dbus-marshal-recursive_8h-source.html#l00075
DBusTypeReader::value_str
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_type_reader_has_next
(
const
structDBusTypeReader.html
DBusTypeReader
*
reader
)
Check whether there's another value on this "level".
e.g. the next field in a struct, the next value in an array. Returns FALSE at the end of the current container.
You probably don't want to use this; it makes for an awkward for/while loop. A nicer one is "while ((current_type = get_current_type()) != INVALID)"
Parameters:
reader
the reader
Returns:
FALSE if nothing more to read at or below this level
Definition at line
dbus-marshal-recursive_8c-source.html#l01187
1187
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-marshal-recursive_8c-source.html#l01147
_dbus_type_reader_next()
.
Referenced by
dbus-message_8c-source.html#l01512
dbus_message_iter_has_next()
.
void _dbus_type_reader_init
(
structDBusTypeReader.html
DBusTypeReader
*
reader
,
int
byte_order
,
const
structDBusString.html
DBusString
*
type_str
,
int
type_pos
,
const
structDBusString.html
DBusString
*
value_str
,
int
value_pos
)
Initializes a type reader.
Parameters:
reader
the reader
byte_order
the byte order of the block to read
type_str
the signature of the block to read
type_pos
location of signature
value_str
the string containing values block
value_pos
start of values block
Definition at line
dbus-marshal-recursive_8c-source.html#l00739
739
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-marshal-recursive_8h-source.html#l00078
DBusTypeReader::klass
,
dbus-marshal-recursive_8h-source.html#l00074
DBusTypeReader::type_pos
,
dbus-marshal-recursive_8h-source.html#l00073
DBusTypeReader::type_str
, and
dbus-marshal-recursive_8h-source.html#l00076
DBusTypeReader::value_pos
.
Referenced by
dbus-marshal-header_8c-source.html#l00952
_dbus_header_load()
, and
dbus-message_8c-source.html#l01434
dbus_message_iter_init()
.
void _dbus_type_reader_init_from_mark
(
structDBusTypeReader.html
DBusTypeReader
*
reader
,
int
byte_order
,
const
structDBusString.html
DBusString
*
type_str
,
const
structDBusString.html
DBusString
*
value_str
,
const
structDBusTypeMark.html
DBusTypeMark
*
mark
)
Initializes a type reader that's been compressed into a
structDBusTypeMark.html
DBusTypeMark
.
The args have to be the same as those passed in to create the original
structDBusTypeReader.html
DBusTypeReader
.
Parameters:
reader
the reader
byte_order
the byte order of the value block
type_str
string containing the type signature
value_str
string containing the values block
mark
the mark to decompress from
Definition at line
dbus-marshal-recursive_8c-source.html#l00770
770
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-marshal-recursive_8h-source.html#l00054
DBusTypeMark::container_type
,
structDBusTypeReaderClass.html#o6
DBusTypeReaderClass::init_from_mark
,
dbus-marshal-recursive_8h-source.html#l00078
DBusTypeReader::klass
,
dbus-marshal-recursive_8h-source.html#l00056
DBusTypeMark::type_pos
,
dbus-marshal-recursive_8h-source.html#l00074
DBusTypeReader::type_pos
,
dbus-marshal-recursive_8h-source.html#l00053
DBusTypeMark::type_pos_in_value_str
,
dbus-marshal-recursive_8h-source.html#l00073
DBusTypeReader::type_str
,
dbus-marshal-recursive_8h-source.html#l00057
DBusTypeMark::value_pos
, and
dbus-marshal-recursive_8h-source.html#l00076
DBusTypeReader::value_pos
.
void _dbus_type_reader_init_types_only
(
structDBusTypeReader.html
DBusTypeReader
*
reader
,
const
structDBusString.html
DBusString
*
type_str
,
int
type_pos
)
Like
group__DBusMarshal.html#ga104
_dbus_type_reader_init()
but the iteration is over the signature, not over values.
Parameters:
reader
the reader
type_str
the signature string
type_pos
location in the signature string
Definition at line
dbus-marshal-recursive_8c-source.html#l00802
802
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-internals_8h-source.html#l00194
_DBUS_INT_MAX
,
dbus-marshal-recursive_8h-source.html#l00078
DBusTypeReader::klass
,
dbus-marshal-recursive_8h-source.html#l00074
DBusTypeReader::type_pos
, and
dbus-marshal-recursive_8h-source.html#l00073
DBusTypeReader::type_str
.
Referenced by
dbus-marshal-byteswap_8c-source.html#l00220
_dbus_marshal_byteswap()
, and
dbus-marshal-validate_8c-source.html#l00633
_dbus_validate_body_with_reason()
.
void _dbus_type_reader_init_types_only_from_mark
(
structDBusTypeReader.html
DBusTypeReader
*
reader
,
const
structDBusString.html
DBusString
*
type_str
,
const
structDBusTypeMark.html
DBusTypeMark
*
mark
)
Like
group__DBusMarshal.html#ga105
_dbus_type_reader_init_from_mark()
but only iterates over the signature, not the values.
Parameters:
reader
the reader
type_str
the signature string
mark
the mark to decompress from
Definition at line
dbus-marshal-recursive_8c-source.html#l00827
827
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8h-source.html#l00194
_DBUS_INT_MAX
,
dbus-marshal-recursive_8h-source.html#l00054
DBusTypeMark::container_type
,
structDBusTypeReaderClass.html#o6
DBusTypeReaderClass::init_from_mark
,
dbus-marshal-recursive_8h-source.html#l00078
DBusTypeReader::klass
,
dbus-marshal-recursive_8h-source.html#l00056
DBusTypeMark::type_pos
,
dbus-marshal-recursive_8h-source.html#l00074
DBusTypeReader::type_pos
,
dbus-marshal-recursive_8h-source.html#l00053
DBusTypeMark::type_pos_in_value_str
,
dbus-marshal-recursive_8h-source.html#l00073
DBusTypeReader::type_str
, and
dbus-marshal-recursive_8c-source.html#l00116
DBusTypeReaderClass::types_only
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_type_reader_next
(
structDBusTypeReader.html
DBusTypeReader
*
reader
)
Skip to the next value on this "level".
e.g. the next field in a struct, the next value in an array. Returns FALSE at the end of the current container.
Parameters:
reader
the reader
Returns:
FALSE if nothing more to read at or below this level
Definition at line
dbus-marshal-recursive_8c-source.html#l01147
1147
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-marshal-recursive_8c-source.html#l00881
_dbus_type_reader_get_current_type()
,
dbus-marshal-basic_8c-source.html#l01308
_dbus_type_to_string()
,
group__DBusMacros.html#ga3
FALSE
,
dbus-marshal-recursive_8h-source.html#l00078
DBusTypeReader::klass
,
structDBusTypeReaderClass.html#o5
DBusTypeReaderClass::next
,
dbus-marshal-recursive_8h-source.html#l00074
DBusTypeReader::type_pos
,
dbus-marshal-recursive_8h-source.html#l00073
DBusTypeReader::type_str
, and
dbus-marshal-recursive_8h-source.html#l00076
DBusTypeReader::value_pos
.
Referenced by
dbus-marshal-header_8c-source.html#l00952
_dbus_header_load()
,
dbus-message_8c-source.html#l01760
_dbus_message_iter_get_args_valist()
,
dbus-marshal-recursive_8c-source.html#l01187
_dbus_type_reader_has_next()
, and
dbus-message_8c-source.html#l01531
dbus_message_iter_next()
.
void _dbus_type_reader_read_basic
(
const
structDBusTypeReader.html
DBusTypeReader
*
reader
,
void *
value
)
Reads a basic-typed value, as with
group__DBusMarshal.html#ga24
_dbus_marshal_read_basic()
.
Parameters:
reader
the reader
value
the address of the value
Definition at line
dbus-marshal-recursive_8c-source.html#l00965
965
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-basic_8c-source.html#l00503
_dbus_marshal_read_basic()
,
dbus-marshal-recursive_8c-source.html#l00881
_dbus_type_reader_get_current_type()
,
dbus-marshal-recursive_8h-source.html#l00067
DBusTypeReader::byte_order
,
dbus-marshal-recursive_8h-source.html#l00078
DBusTypeReader::klass
,
dbus-marshal-recursive_8h-source.html#l00074
DBusTypeReader::type_pos
,
dbus-marshal-recursive_8h-source.html#l00073
DBusTypeReader::type_str
,
dbus-marshal-recursive_8c-source.html#l00116
DBusTypeReaderClass::types_only
,
dbus-marshal-recursive_8h-source.html#l00076
DBusTypeReader::value_pos
, and
dbus-marshal-recursive_8h-source.html#l00075
DBusTypeReader::value_str
.
Referenced by
dbus-marshal-header_8c-source.html#l00952
_dbus_header_load()
,
dbus-message_8c-source.html#l01760
_dbus_message_iter_get_args_valist()
, and
dbus-message_8c-source.html#l01686
dbus_message_iter_get_basic()
.
void _dbus_type_reader_read_fixed_multi
(
const
structDBusTypeReader.html
DBusTypeReader
*
reader
,
void *
value
,
int *
n_elements
)
Reads a block of fixed-length basic values, from the current point in an array to the end of the array.
Does not work for arrays of string or container types.
This function returns the array in-place; it does not make a copy, and it does not swap the bytes.
If you ask for DBUS_TYPE_DOUBLE you will get a "const double*" back and the "value" argument should be a "const double**" and so on.
Parameters:
reader
the reader to read from
value
place to return the array values
n_elements
place to return number of array elements
Definition at line
dbus-marshal-recursive_8c-source.html#l01019
1019
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-basic_8c-source.html#l01504
_dbus_first_type_in_signature()
,
dbus-marshal-basic_8c-source.html#l01226
_dbus_type_get_alignment()
,
dbus-signature_8c-source.html#l00307
dbus_type_is_fixed()
,
dbus-marshal-recursive_8h-source.html#l00078
DBusTypeReader::klass
,
dbus-marshal-recursive_8h-source.html#l00074
DBusTypeReader::type_pos
,
dbus-marshal-recursive_8h-source.html#l00073
DBusTypeReader::type_str
,
dbus-marshal-recursive_8c-source.html#l00116
DBusTypeReaderClass::types_only
,
structDBusTypeReader.html#o10
DBusTypeReader::u
,
dbus-marshal-recursive_8h-source.html#l00076
DBusTypeReader::value_pos
, and
dbus-marshal-recursive_8h-source.html#l00075
DBusTypeReader::value_str
.
Referenced by
dbus-message_8c-source.html#l01760
_dbus_message_iter_get_args_valist()
, and
dbus-message_8c-source.html#l01732
dbus_message_iter_get_fixed_array()
.
void _dbus_type_reader_read_raw
(
const
structDBusTypeReader.html
DBusTypeReader
*
reader
,
const unsigned char **
value_location
)
Get the address of the marshaled value in the data being read.
The address may not be aligned; you have to align it to the type of the value you want to read. Most of the demarshal routines do this for you.
Parameters:
reader
the reader
value_location
the address of the marshaled value
Definition at line
dbus-marshal-recursive_8c-source.html#l00948
948
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-recursive_8h-source.html#l00078
DBusTypeReader::klass
,
dbus-marshal-recursive_8c-source.html#l00116
DBusTypeReaderClass::types_only
,
dbus-marshal-recursive_8h-source.html#l00076
DBusTypeReader::value_pos
, and
dbus-marshal-recursive_8h-source.html#l00075
DBusTypeReader::value_str
.
void _dbus_type_reader_recurse
(
structDBusTypeReader.html
DBusTypeReader
*
reader
,
structDBusTypeReader.html
DBusTypeReader
*
sub
)
Initialize a new reader pointing to the first type and corresponding value that's a child of the current container.
It's an error to call this if the current type is a non-container.
Note that
structDBusTypeReader.html
DBusTypeReader
traverses values, not types. So if you have an empty array of array of int, you can't recurse into it. You can only recurse into each element.
Parameters:
reader
the reader
sub
a reader to init pointing to the first child
Definition at line
dbus-marshal-recursive_8c-source.html#l01084
1084
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8h-source.html#l00112
_dbus_assert_not_reached
,
dbus-marshal-basic_8c-source.html#l01504
_dbus_first_type_in_signature()
,
dbus-marshal-basic_8c-source.html#l01308
_dbus_type_to_string()
,
dbus-internals_8c-source.html#l00203
_dbus_warn()
,
dbus-marshal-recursive_8c-source.html#l00115
DBusTypeReaderClass::id
,
dbus-marshal-recursive_8h-source.html#l00078
DBusTypeReader::klass
,
structDBusTypeReaderClass.html#o3
DBusTypeReaderClass::recurse
,
dbus-marshal-recursive_8h-source.html#l00074
DBusTypeReader::type_pos
,
dbus-marshal-recursive_8h-source.html#l00073
DBusTypeReader::type_str
,
dbus-marshal-recursive_8c-source.html#l00116
DBusTypeReaderClass::types_only
, and
dbus-marshal-recursive_8h-source.html#l00076
DBusTypeReader::value_pos
.
Referenced by
dbus-marshal-header_8c-source.html#l00952
_dbus_header_load()
,
dbus-message_8c-source.html#l01760
_dbus_message_iter_get_args_valist()
, and
dbus-message_8c-source.html#l01602
dbus_message_iter_recurse()
.
void _dbus_type_reader_save_mark
(
const
structDBusTypeReader.html
DBusTypeReader
*
reader
,
structDBusTypeMark.html
DBusTypeMark
*
mark
)
Compresses a type reader into a
structDBusTypeMark.html
DBusTypeMark
, useful for example if you want to cache a bunch of positions in a block of values.
Parameters:
reader
the reader
mark
the mark to init
Definition at line
dbus-marshal-recursive_8c-source.html#l00857
857
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-recursive_8h-source.html#l00055
DBusTypeMark::array_len_offset
,
dbus-marshal-recursive_8h-source.html#l00072
DBusTypeReader::array_len_offset
,
dbus-marshal-recursive_8h-source.html#l00058
DBusTypeMark::array_start_pos
,
dbus-marshal-recursive_8h-source.html#l00054
DBusTypeMark::container_type
,
dbus-marshal-recursive_8c-source.html#l00115
DBusTypeReaderClass::id
,
dbus-marshal-recursive_8h-source.html#l00078
DBusTypeReader::klass
,
dbus-marshal-recursive_8h-source.html#l00056
DBusTypeMark::type_pos
,
dbus-marshal-recursive_8h-source.html#l00074
DBusTypeReader::type_pos
,
dbus-marshal-recursive_8h-source.html#l00053
DBusTypeMark::type_pos_in_value_str
,
dbus-marshal-recursive_8h-source.html#l00073
DBusTypeReader::type_str
,
structDBusTypeReader.html#o10
DBusTypeReader::u
,
dbus-marshal-recursive_8h-source.html#l00057
DBusTypeMark::value_pos
,
dbus-marshal-recursive_8h-source.html#l00076
DBusTypeReader::value_pos
, and
dbus-marshal-recursive_8h-source.html#l00075
DBusTypeReader::value_str
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_type_reader_set_basic
(
structDBusTypeReader.html
DBusTypeReader
*
reader
,
const void *
value
,
const
structDBusTypeReader.html
DBusTypeReader
*
realign_root
)
Sets a new value for the basic type value pointed to by the reader, leaving the reader valid to continue reading.
Any other readers will be invalidated if you set a variable-length type such as a string.
The provided realign_root is the reader to start from when realigning the data that follows the newly-set value. The reader parameter must point to a value below the realign_root parameter. If the type being set is fixed-length, then realign_root may be
group__DBusMacros.html#ga4
NULL
. Only values reachable from realign_root will be realigned, so if your string contains other values you will need to deal with those somehow yourself. It is OK if realign_root is the same reader as the reader parameter, though if you aren't setting the root it may not be such a good idea.
todo.html#_todo000028
Todo:
structDBusTypeReader.html
DBusTypeReader
currently takes "const" versions of the type and value strings, and this function modifies those strings by casting away the const, which is of course bad if we want to get picky.
(To be truly clean you'd have an object which contained the type and value strings and set_basic would be a method on that object... this would also make
structDBusTypeReader.html
DBusTypeReader
the same thing as
structDBusTypeMark.html
DBusTypeMark
. But since
structDBusMessage.html
DBusMessage
is effectively that object for D-BUS it doesn't seem worth creating some random object.)
todo.html#_todo000028
Todo:
optimize this by only rewriting until the old and new values are at the same alignment.
Frequently this should result in only replacing the value that's immediately at hand.
Parameters:
reader
reader indicating where to set a new value
value
address of the value to set
realign_root
realign from here
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-marshal-recursive_8c-source.html#l01456
1456
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-recursive_8c-source.html#l00881
_dbus_type_reader_get_current_type()
,
dbus-marshal-basic_8c-source.html#l01308
_dbus_type_to_string()
,
dbus-marshal-basic_8c-source.html#l01448
_dbus_verbose_bytes_of_string()
,
dbus-signature_8c-source.html#l00285
dbus_type_is_basic()
,
dbus-signature_8c-source.html#l00307
dbus_type_is_fixed()
,
dbus-marshal-recursive_8h-source.html#l00078
DBusTypeReader::klass
,
group__DBusMacros.html#ga2
TRUE
,
dbus-marshal-recursive_8h-source.html#l00074
DBusTypeReader::type_pos
,
dbus-marshal-recursive_8h-source.html#l00073
DBusTypeReader::type_str
,
dbus-marshal-recursive_8c-source.html#l00116
DBusTypeReaderClass::types_only
,
dbus-marshal-recursive_8h-source.html#l00076
DBusTypeReader::value_pos
, and
dbus-marshal-recursive_8h-source.html#l00075
DBusTypeReader::value_str
.
void _dbus_type_signature_next
(
const char *
type_str
,
int *
type_pos
)
Skips to the next "complete" type inside a type signature.
The signature is read starting at type_pos, and the next type position is stored in the same variable.
Parameters:
type_str
a type signature (must be valid)
type_pos
an integer position in the type signtaure (in and out)
Definition at line
dbus-marshal-recursive_8c-source.html#l00329
329
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-signature_8c-source.html#l00092
dbus_signature_iter_get_signature()
, and
dbus-signature_8c-source.html#l00144
dbus_signature_iter_next()
.
const char* _dbus_type_to_string
(
int
typecode
)
Returns a string describing the given type.
Parameters:
typecode
the type to describe
Returns:
a constant string describing the type
Definition at line
dbus-marshal-basic_8c-source.html#l01308
1308
of file
dbus-marshal-basic_8c-source.html
dbus-marshal-basic.c
.
Referenced by
dbus-marshal-basic_8c-source.html#l00503
_dbus_marshal_read_basic()
,
dbus-marshal-basic_8c-source.html#l00612
_dbus_marshal_read_fixed_multi()
,
dbus-marshal-basic_8c-source.html#l01131
_dbus_marshal_skip_basic()
,
dbus-marshal-basic_8c-source.html#l01073
_dbus_marshal_write_fixed_multi()
,
dbus-message_8c-source.html#l01760
_dbus_message_iter_get_args_valist()
,
dbus-marshal-recursive_8c-source.html#l00881
_dbus_type_reader_get_current_type()
,
dbus-marshal-recursive_8c-source.html#l01147
_dbus_type_reader_next()
,
dbus-marshal-recursive_8c-source.html#l01084
_dbus_type_reader_recurse()
,
dbus-marshal-recursive_8c-source.html#l01456
_dbus_type_reader_set_basic()
,
dbus-marshal-recursive_8c-source.html#l02255
_dbus_type_writer_unrecurse()
, and
dbus-message_8c-source.html#l01222
dbus_message_append_args_valist()
.
void _dbus_type_writer_add_types
(
structDBusTypeWriter.html
DBusTypeWriter
*
writer
,
structDBusString.html
DBusString
*
type_str
,
int
type_pos
)
Adds type string to the writer, if it had none.
Parameters:
writer
the writer to init
type_str
type string to add
type_pos
type position
Definition at line
dbus-marshal-recursive_8c-source.html#l01639
1639
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-marshal-recursive_8h-source.html#l00101
DBusTypeWriter::type_pos
, and
dbus-marshal-recursive_8h-source.html#l00100
DBusTypeWriter::type_str
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_type_writer_append_array
(
structDBusTypeWriter.html
DBusTypeWriter
*
writer
,
const
structDBusString.html
DBusString
*
contained_type
,
int
contained_type_start
,
structDBusTypeWriter.html
DBusTypeWriter
*
sub
)
Append to an existing array.
Essentially, the writer will read an existing length at the write location; jump over that length; and write new fields. On unrecurse(), the existing length will be updated.
Parameters:
writer
the writer
contained_type
element type
contained_type_start
position of element type
sub
the subwriter to init
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-marshal-recursive_8c-source.html#l02219
2219
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-marshal-header_8c-source.html#l01243
_dbus_header_set_field_basic()
.
void _dbus_type_writer_init
(
structDBusTypeWriter.html
DBusTypeWriter
*
writer
,
int
byte_order
,
structDBusString.html
DBusString
*
type_str
,
int
type_pos
,
structDBusString.html
DBusString
*
value_str
,
int
value_pos
)
Initialize a write iterator, which is used to write out values in serialized D-BUS format.
The type_pos passed in is expected to be inside an already-valid, though potentially empty, type signature. This means that the byte after type_pos must be either DBUS_TYPE_INVALID (aka nul) or some other valid type.
structDBusTypeWriter.html
DBusTypeWriter
won't enforce that the signature is already valid (you can append the nul byte at the end if you like), but just be aware that you need the nul byte eventually and
structDBusTypeWriter.html
DBusTypeWriter
isn't going to write it for you.
Parameters:
writer
the writer to init
byte_order
the byte order to marshal into
type_str
the string to write typecodes into
type_pos
where to insert typecodes
value_str
the string to write values into
value_pos
where to insert values
Definition at line
dbus-marshal-recursive_8c-source.html#l01586
1586
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-marshal-recursive_8h-source.html#l00092
DBusTypeWriter::byte_order
,
dbus-marshal-recursive_8h-source.html#l00094
DBusTypeWriter::container_type
,
dbus-marshal-recursive_8h-source.html#l00098
DBusTypeWriter::enabled
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga2
TRUE
,
dbus-marshal-recursive_8h-source.html#l00101
DBusTypeWriter::type_pos
,
dbus-marshal-recursive_8h-source.html#l00096
DBusTypeWriter::type_pos_is_expectation
,
dbus-marshal-recursive_8h-source.html#l00100
DBusTypeWriter::type_str
,
dbus-marshal-recursive_8h-source.html#l00103
DBusTypeWriter::value_pos
, and
dbus-marshal-recursive_8h-source.html#l00102
DBusTypeWriter::value_str
.
Referenced by
dbus-marshal-recursive_8c-source.html#l01621
_dbus_type_writer_init_types_delayed()
, and
dbus-marshal-recursive_8c-source.html#l01677
_dbus_type_writer_init_values_only()
.
void _dbus_type_writer_init_types_delayed
(
structDBusTypeWriter.html
DBusTypeWriter
*
writer
,
int
byte_order
,
structDBusString.html
DBusString
*
value_str
,
int
value_pos
)
Initialize a write iterator, with the signature to be provided later.
Parameters:
writer
the writer to init
byte_order
the byte order to marshal into
value_str
the string to write values into
value_pos
where to insert values
Definition at line
dbus-marshal-recursive_8c-source.html#l01621
1621
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-marshal-recursive_8c-source.html#l01586
_dbus_type_writer_init()
.
Referenced by
dbus-message_8c-source.html#l01948
dbus_message_iter_init_append()
.
void _dbus_type_writer_init_values_only
(
structDBusTypeWriter.html
DBusTypeWriter
*
writer
,
int
byte_order
,
const
structDBusString.html
DBusString
*
type_str
,
int
type_pos
,
structDBusString.html
DBusString
*
value_str
,
int
value_pos
)
Like
group__DBusMarshal.html#ga128
_dbus_type_writer_init()
, except the type string passed in should correspond to an existing signature that matches what you're going to write out.
The writer will check what you write vs. this existing signature.
Parameters:
writer
the writer to init
byte_order
the byte order to marshal into
type_str
the string with signature
type_pos
start of signature
value_str
the string to write values into
value_pos
where to insert values
Definition at line
dbus-marshal-recursive_8c-source.html#l01677
1677
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-marshal-recursive_8c-source.html#l01586
_dbus_type_writer_init()
,
group__DBusMacros.html#ga2
TRUE
, and
dbus-marshal-recursive_8h-source.html#l00096
DBusTypeWriter::type_pos_is_expectation
.
Referenced by
dbus-marshal-header_8c-source.html#l00518
_dbus_header_create()
, and
dbus-marshal-header_8c-source.html#l01243
_dbus_header_set_field_basic()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_type_writer_recurse
(
structDBusTypeWriter.html
DBusTypeWriter
*
writer
,
int
container_type
,
const
structDBusString.html
DBusString
*
contained_type
,
int
contained_type_start
,
structDBusTypeWriter.html
DBusTypeWriter
*
sub
)
Opens a new container and writes out the initial information for that container.
Parameters:
writer
the writer
container_type
the type of the container to open
contained_type
the array element type or variant content type
contained_type_start
position to look for the type
sub
the new sub-writer to write container contents
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-marshal-recursive_8c-source.html#l02185
2185
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
group__DBusMacros.html#ga3
FALSE
.
Referenced by
dbus-marshal-header_8c-source.html#l00518
_dbus_header_create()
, and
dbus-message_8c-source.html#l02220
dbus_message_iter_open_container()
.
void _dbus_type_writer_remove_types
(
structDBusTypeWriter.html
DBusTypeWriter
*
writer
)
Removes type string from the writer.
Parameters:
writer
the writer to remove from
Definition at line
dbus-marshal-recursive_8c-source.html#l01656
1656
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-marshal-recursive_8h-source.html#l00101
DBusTypeWriter::type_pos
, and
dbus-marshal-recursive_8h-source.html#l00100
DBusTypeWriter::type_str
.
void _dbus_type_writer_set_enabled
(
structDBusTypeWriter.html
DBusTypeWriter
*
writer
,
group__DBusTypes.html#ga2
dbus_bool_t
enabled
)
If disabled, a writer can still be iterated forward and recursed/unrecursed but won't write any values.
Types will still be written unless the writer is a "values only" writer, because the writer needs access to a valid signature to be able to iterate.
Parameters:
writer
the type writer
enabled
group__DBusMacros.html#ga2
TRUE
if values should be written
Definition at line
dbus-marshal-recursive_8c-source.html#l02823
2823
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-marshal-recursive_8h-source.html#l00098
DBusTypeWriter::enabled
, and
group__DBusMacros.html#ga3
FALSE
.
Referenced by
dbus-marshal-recursive_8c-source.html#l02753
_dbus_type_writer_write_reader_partial()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_type_writer_unrecurse
(
structDBusTypeWriter.html
DBusTypeWriter
*
writer
,
structDBusTypeWriter.html
DBusTypeWriter
*
sub
)
Closes a container created by
group__DBusMarshal.html#ga140
_dbus_type_writer_recurse()
and writes any additional information to the values block.
Parameters:
writer
the writer
sub
the sub-writer created by
group__DBusMarshal.html#ga140
_dbus_type_writer_recurse()
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-marshal-recursive_8c-source.html#l02255
2255
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-basic_8c-source.html#l00265
_dbus_marshal_set_uint32()
,
dbus-marshal-basic_8c-source.html#l01308
_dbus_type_to_string()
,
dbus-marshal-recursive_8h-source.html#l00092
DBusTypeWriter::byte_order
,
dbus-marshal-recursive_8h-source.html#l00094
DBusTypeWriter::container_type
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga2
TRUE
,
dbus-marshal-recursive_8h-source.html#l00101
DBusTypeWriter::type_pos
,
dbus-marshal-recursive_8h-source.html#l00096
DBusTypeWriter::type_pos_is_expectation
,
dbus-marshal-recursive_8h-source.html#l00100
DBusTypeWriter::type_str
,
structDBusTypeWriter.html#o12
DBusTypeWriter::u
,
dbus-marshal-recursive_8h-source.html#l00103
DBusTypeWriter::value_pos
, and
dbus-marshal-recursive_8h-source.html#l00102
DBusTypeWriter::value_str
.
Referenced by
dbus-marshal-header_8c-source.html#l00518
_dbus_header_create()
,
dbus-marshal-header_8c-source.html#l01243
_dbus_header_set_field_basic()
, and
dbus-message_8c-source.html#l02286
dbus_message_iter_close_container()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_type_writer_write_basic
(
structDBusTypeWriter.html
DBusTypeWriter
*
writer
,
int
type
,
const void *
value
)
Writes out a basic type.
Parameters:
writer
the writer
type
the type to write
value
the address of the value to write
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-marshal-recursive_8c-source.html#l02387
2387
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-internals_8h-source.html#l00112
_dbus_assert_not_reached
,
dbus-string_8c-source.html#l00950
_dbus_string_alloc_space()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga2
TRUE
,
dbus-marshal-recursive_8h-source.html#l00096
DBusTypeWriter::type_pos_is_expectation
, and
dbus-marshal-recursive_8h-source.html#l00100
DBusTypeWriter::type_str
.
Referenced by
dbus-marshal-header_8c-source.html#l00518
_dbus_header_create()
, and
dbus-message_8c-source.html#l02116
dbus_message_iter_append_basic()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_type_writer_write_fixed_multi
(
structDBusTypeWriter.html
DBusTypeWriter
*
writer
,
int
element_type
,
const void *
value
,
int
n_elements
)
Writes a block of fixed-length basic values, i.e.
those that are both
group__DBusSignature.html#ga10
dbus_type_is_fixed()
and _dbus_type_is_basic(). The block must be written inside an array.
The value parameter should be the address of said array of values, so e.g. if it's an array of double, pass in "const double**"
Parameters:
writer
the writer
element_type
type of stuff in the array
value
address of the array
n_elements
number of elements in the array
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-marshal-recursive_8c-source.html#l02435
2435
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8h-source.html#l00112
_dbus_assert_not_reached
,
dbus-marshal-basic_8c-source.html#l01073
_dbus_marshal_write_fixed_multi()
,
dbus-marshal-recursive_8h-source.html#l00094
DBusTypeWriter::container_type
,
dbus-signature_8c-source.html#l00307
dbus_type_is_fixed()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga2
TRUE
,
dbus-marshal-recursive_8h-source.html#l00101
DBusTypeWriter::type_pos
,
dbus-marshal-recursive_8h-source.html#l00096
DBusTypeWriter::type_pos_is_expectation
, and
dbus-marshal-recursive_8h-source.html#l00103
DBusTypeWriter::value_pos
.
Referenced by
dbus-message_8c-source.html#l02175
dbus_message_iter_append_fixed_array()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_type_writer_write_reader
(
structDBusTypeWriter.html
DBusTypeWriter
*
writer
,
structDBusTypeReader.html
DBusTypeReader
*
reader
)
Iterate through all values in the given reader, writing a copy of each value to the writer.
The reader will be moved forward to its end position.
Parameters:
writer
the writer to copy to
reader
the reader to copy from
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-marshal-recursive_8c-source.html#l02807
2807
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-marshal-recursive_8c-source.html#l02753
_dbus_type_writer_write_reader_partial()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_type_writer_write_reader_partial
(
structDBusTypeWriter.html
DBusTypeWriter
*
writer
,
structDBusTypeReader.html
DBusTypeReader
*
reader
,
const
structDBusTypeReader.html
DBusTypeReader
*
start_after
,
int
start_after_new_pos
,
int
start_after_new_len
,
structDBusList.html
DBusList
**
fixups
)
Iterate through all values in the given reader, writing a copy of each value to the writer.
The reader will be moved forward to its end position.
If a reader start_after is provided, it should be a reader for the same data as the reader to be written. Only values occurring after the value pointed to by start_after will be written to the writer.
If start_after is provided, then the copy of the reader will be partial. This means that array lengths will not have been copied. The assumption is that you wrote a new version of the value at start_after to the writer. You have to pass in the start position and length of the new value. (If you are deleting the value at start_after, pass in 0 for the length.)
If the fixups parameter is non-
group__DBusMacros.html#ga4
NULL
, then any array length that was read but not written due to start_after will be provided as a
structDBusArrayLenFixup.html
DBusArrayLenFixup
. The fixup contains the position of the array length in the source data, and the correct array length assuming you combine the source data before start_after with the written data at start_after and beyond.
Parameters:
writer
the writer to copy to
reader
the reader to copy from
start_after
group__DBusMacros.html#ga4
NULL
or a reader showing where to start
start_after_new_pos
the position of start_after equivalent in the target data
start_after_new_len
the length of start_after equivalent in the target data
fixups
list to append
structDBusArrayLenFixup.html
DBusArrayLenFixup
if the write was partial
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-marshal-recursive_8c-source.html#l02753
2753
of file
dbus-marshal-recursive_8c-source.html
dbus-marshal-recursive.c
.
References
dbus-string_8c-source.html#l01382
_dbus_string_delete()
,
dbus-marshal-recursive_8c-source.html#l02823
_dbus_type_writer_set_enabled()
,
dbus-marshal-recursive_8h-source.html#l00098
DBusTypeWriter::enabled
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga2
TRUE
,
dbus-marshal-recursive_8h-source.html#l00101
DBusTypeWriter::type_pos
,
dbus-marshal-recursive_8h-source.html#l00100
DBusTypeWriter::type_str
,
dbus-marshal-recursive_8h-source.html#l00103
DBusTypeWriter::value_pos
, and
dbus-marshal-recursive_8h-source.html#l00102
DBusTypeWriter::value_str
.
Referenced by
dbus-marshal-recursive_8c-source.html#l02807
_dbus_type_writer_write_reader()
.
DBusValidity _dbus_validate_body_with_reason
(
const
structDBusString.html
DBusString
*
expected_signature
,
int
expected_signature_start
,
int
byte_order
,
int *
bytes_remaining
,
const
structDBusString.html
DBusString
*
value_str
,
int
value_pos
,
int
len
)
Verifies that the range of value_str from value_pos to value_end is a legitimate value of type expected_signature.
If this function returns
group__DBusMacros.html#ga2
TRUE
, it will be safe to iterate over the values with
structDBusTypeReader.html
DBusTypeReader
. The signature is assumed to be already valid.
If bytes_remaining is not
group__DBusMacros.html#ga4
NULL
, then leftover bytes will be stored there and DBUS_VALID returned. If it is
group__DBusMacros.html#ga4
NULL
, then DBUS_INVALID_TOO_MUCH_DATA will be returned if bytes are left over.
Parameters:
expected_signature
the expected types in the value_str
expected_signature_start
where in expected_signature is the signature
byte_order
the byte order
bytes_remaining
place to store leftover bytes
value_str
the string containing the body
value_pos
where the values start
len
length of values after value_pos
Returns:
DBUS_VALID if valid, reason why invalid otherwise
Definition at line
dbus-marshal-validate_8c-source.html#l00633
633
of file
dbus-marshal-validate_8c-source.html
dbus-marshal-validate.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-recursive_8c-source.html#l00802
_dbus_type_reader_init_types_only()
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-marshal-header_8c-source.html#l00952
_dbus_header_load()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_validate_bus_name
(
const
structDBusString.html
DBusString
*
str
,
int
start
,
int
len
)
Checks that the given range of the string is a valid bus name in the D-BUS protocol.
This includes a length restriction, etc., see the specification.
todo.html#_todo000039
Todo:
this is inconsistent with most of
structDBusString.html
DBusString
in that it allows a start,len range that extends past the string end.
Parameters:
str
the string
start
first byte index to check
len
number of bytes to check
Returns:
group__DBusMacros.html#ga2
TRUE
if the byte range exists and is a valid name
Definition at line
dbus-marshal-validate_8c-source.html#l00987
987
of file
dbus-marshal-validate_8c-source.html
dbus-marshal-validate.c
.
References
dbus-marshal-validate_8c-source.html#l00780
_dbus_validate_interface()
, and
group__DBusMacros.html#ga3
FALSE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_validate_error_name
(
const
structDBusString.html
DBusString
*
str
,
int
start
,
int
len
)
Checks that the given range of the string is a valid error name in the D-BUS protocol.
This includes a length restriction, etc., see the specification.
todo.html#_todo000038
Todo:
this is inconsistent with most of
structDBusString.html
DBusString
in that it allows a start,len range that extends past the string end.
Parameters:
str
the string
start
first byte index to check
len
number of bytes to check
Returns:
group__DBusMacros.html#ga2
TRUE
if the byte range exists and is a valid name
Definition at line
dbus-marshal-validate_8c-source.html#l00917
917
of file
dbus-marshal-validate_8c-source.html
dbus-marshal-validate.c
.
References
dbus-marshal-validate_8c-source.html#l00780
_dbus_validate_interface()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_validate_interface
(
const
structDBusString.html
DBusString
*
str
,
int
start
,
int
len
)
Checks that the given range of the string is a valid interface name in the D-BUS protocol.
This includes a length restriction and an ASCII subset, see the specification.
todo.html#_todo000036
Todo:
this is inconsistent with most of
structDBusString.html
DBusString
in that it allows a start,len range that extends past the string end.
Parameters:
str
the string
start
first byte index to check
len
number of bytes to check
Returns:
group__DBusMacros.html#ga2
TRUE
if the byte range exists and is a valid name
Definition at line
dbus-marshal-validate_8c-source.html#l00780
780
of file
dbus-marshal-validate_8c-source.html
dbus-marshal-validate.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga2
TRUE
,
dbus-marshal-validate_8c-source.html#l00683
VALID_INITIAL_NAME_CHARACTER
, and
dbus-marshal-validate_8c-source.html#l00692
VALID_NAME_CHARACTER
.
Referenced by
dbus-marshal-validate_8c-source.html#l00987
_dbus_validate_bus_name()
, and
dbus-marshal-validate_8c-source.html#l00917
_dbus_validate_error_name()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_validate_member
(
const
structDBusString.html
DBusString
*
str
,
int
start
,
int
len
)
Checks that the given range of the string is a valid member name in the D-BUS protocol.
This includes a length restriction, etc., see the specification.
todo.html#_todo000037
Todo:
this is inconsistent with most of
structDBusString.html
DBusString
in that it allows a start,len range that extends past the string end.
Parameters:
str
the string
start
first byte index to check
len
number of bytes to check
Returns:
group__DBusMacros.html#ga2
TRUE
if the byte range exists and is a valid name
Definition at line
dbus-marshal-validate_8c-source.html#l00856
856
of file
dbus-marshal-validate_8c-source.html
dbus-marshal-validate.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga2
TRUE
,
dbus-marshal-validate_8c-source.html#l00683
VALID_INITIAL_NAME_CHARACTER
, and
dbus-marshal-validate_8c-source.html#l00692
VALID_NAME_CHARACTER
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_validate_path
(
const
structDBusString.html
DBusString
*
str
,
int
start
,
int
len
)
Checks that the given range of the string is a valid object path name in the D-BUS protocol.
Part of the validation ensures that the object path contains only ASCII.
todo.html#_todo000034
Todo:
this is inconsistent with most of
structDBusString.html
DBusString
in that it allows a start,len range that extends past the string end.
todo.html#_todo000034
Todo:
change spec to disallow more things, such as spaces in the path name
Parameters:
str
the string
start
first byte index to check
len
number of bytes to check
Returns:
group__DBusMacros.html#ga2
TRUE
if the byte range exists and is a valid name
Definition at line
dbus-marshal-validate_8c-source.html#l00715
715
of file
dbus-marshal-validate_8c-source.html
dbus-marshal-validate.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga2
TRUE
, and
dbus-marshal-validate_8c-source.html#l00692
VALID_NAME_CHARACTER
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_validate_signature
(
const
structDBusString.html
DBusString
*
str
,
int
start
,
int
len
)
Checks that the given range of the string is a valid message type signature in the D-BUS protocol.
todo.html#_todo000040
Todo:
this is inconsistent with most of
structDBusString.html
DBusString
in that it allows a start,len range that extends past the string end.
Parameters:
str
the string
start
first byte index to check
len
number of bytes to check
Returns:
group__DBusMacros.html#ga2
TRUE
if the byte range exists and is a valid signature
Definition at line
dbus-marshal-validate_8c-source.html#l01012
1012
of file
dbus-marshal-validate_8c-source.html
dbus-marshal-validate.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-marshal-validate_8c-source.html#l00054
_dbus_validate_signature_with_reason()
, and
group__DBusMacros.html#ga3
FALSE
.
Referenced by
dbus-signature_8c-source.html#l00207
dbus_signature_validate()
.
DBusValidity _dbus_validate_signature_with_reason
(
const
structDBusString.html
DBusString
*
type_str
,
int
type_pos
,
int
len
)
Verifies that the range of type_str from type_pos to type_end is a valid signature.
If this function returns
group__DBusMacros.html#ga2
TRUE
, it will be safe to iterate over the signature with a types-only
structDBusTypeReader.html
DBusTypeReader
. The range passed in should NOT include the terminating nul/DBUS_TYPE_INVALID.
todo.html#_todo000032
Todo:
verify that dict entries have exactly two fields
todo.html#_todo000032
Todo:
require that dict entries are in an array
Parameters:
type_str
the string
type_pos
where the typecodes start
len
length of typecodes
Returns:
DBUS_VALID if valid, reason why invalid otherwise
Definition at line
dbus-marshal-validate_8c-source.html#l00054
54
of file
dbus-marshal-validate_8c-source.html
dbus-marshal-validate.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8h-source.html#l00190
_DBUS_INT32_MAX
,
dbus-internals_8h-source.html#l00148
_DBUS_INT_TO_POINTER
,
dbus-list_8c-source.html#l00249
_dbus_list_append()
,
dbus-list_8c-source.html#l00556
_dbus_list_clear()
,
dbus-list_8c-source.html#l00686
_dbus_list_pop_last()
,
dbus-internals_8h-source.html#l00147
_DBUS_POINTER_TO_INT
,
dbus-signature_8c-source.html#l00285
dbus_type_is_basic()
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-marshal-validate_8c-source.html#l01012
_dbus_validate_signature()
.
void _dbus_verbose_bytes
(
const unsigned char *
data
,
int
len
,
int
offset
)
If in verbose mode, print a block of binary data.
todo.html#_todo000027
Todo:
right now it prints even if not in verbose mode
Parameters:
data
the data
len
the length of the data
offset
where to start counting for byte indexes
Definition at line
dbus-marshal-basic_8c-source.html#l01365
1365
of file
dbus-marshal-basic_8c-source.html
dbus-marshal-basic.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
.
Referenced by
dbus-marshal-basic_8c-source.html#l01448
_dbus_verbose_bytes_of_string()
.
void _dbus_verbose_bytes_of_string
(
const
structDBusString.html
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
dbus-marshal-basic_8c-source.html#l01448
1448
of file
dbus-marshal-basic_8c-source.html
dbus-marshal-basic.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
, and
dbus-marshal-basic_8c-source.html#l01365
_dbus_verbose_bytes()
.
Referenced by
dbus-sysdeps_8c-source.html#l00191
_dbus_read()
,
dbus-marshal-recursive_8c-source.html#l01456
_dbus_type_reader_set_basic()
, and
dbus-sysdeps_8c-source.html#l00251
_dbus_write()
.
Generated on Tue Sep 13 01:28:09 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
